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 |
---|---|---|---|---|---|---|
Test get all items endpoints
|
public function testIndex()
{
Item::factory()->count(20)->create();
$this->call('GET', '/items')
->assertStatus(200)
->assertJsonStructure([
'data' => [
'*' => [
'id',
'guid',
'name',
'email',
'created_dates',
'updated_dates',
]
]
])
->assertJsonPath('meta.current_page', 1);
//test paginate
$parameters = array(
'per_page' => 10,
'page' => 2,
);
$this->call('GET', '/items', $parameters)
->assertStatus(200)
->assertJsonStructure([
'data' => [
'*' => [
'id',
'guid',
'name',
'email',
'created_dates',
'updated_dates',
]
]
])
->assertJsonPath('meta.current_page', $parameters['page'])
->assertJsonPath('meta.per_page', $parameters['per_page']);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testRequestItemsAvailable()\n {\n $response = $this->get('/api/items/available');\n\n $response->assertStatus(200);\n }",
"public function testProductGetAll()\r\n\t{\r\n\t\t$this->json('get', '/api/products')->assertStatus(200);\r\n\t}",
"public function testGetAll()\n {\n $response = $this->get('/api/Product/GetAll/');\n\n $response->assertStatus(200);\n $response->assertJsonStructure(['data' =>\n [\n '*' =>[\n 'name'\n ]\n ],\n ]);\n\n }",
"public function testDosenGetAll()\n {\n $this->json('get', '/dasbor/dosen')\n ->assertStatus(300);\n }",
"public function testIndexActionGet()\n {\n $res = $this->controller->indexActionGet();\n $this->assertContains(\"View all items\", $res->getBody());\n }",
"public function test_all_email_endpoint()\n {\n $response = $this->json('GET', route('emails.index'));\n $response->assertStatus(200);\n }",
"function list(){\n $res = $res = $this->client->request('GET',$this->path,[]);\n $this->checkResponse($res,array(200));\n return $res;\n }",
"public function testGetAll()\n {\n $ret =\\App\\Providers\\ListsServiceProvider::getLists();\n \n $this->assertNotEmpty($ret);\n }",
"public function testCatchAllGet()\n {\n $res = $this->controller->catchAll();\n $this->assertNull($res);\n }",
"public function testAllProductsList()\n {\n $response = $this->runApp('GET', '/v1/products?password=' . $this->apiPassword);\n\n $this->assertEquals(StatusCode::HTTP_OK, $response->getStatusCode());\n $result = (array)json_decode($response->getBody())->result;\n $this->assertEquals(count($result), 100);//default 100 products in db\n }",
"public function testListAll() {\n $array = [\n 'status' => true,\n 'data' => [\n 0 => [\n 'company_id' => 4564658766,\n 'name' => 'My Test Key',\n 'slug' => 'my-test-key',\n 'public' => '4c9184f37cff01bcdc32dc486ec36961',\n 'private' => '2c17c6393771ee3048ae34d6b380c5ec',\n 'production' => 0,\n 'special' => 1,\n 'created_at' => time(),\n 'updated_at' => time()\n ]\n ]\n ];\n\n /**\n * Mocks the HTTP Response.\n */\n $this->httpResponse = $this\n ->getMockBuilder('GuzzleHttp\\Psr7\\Response')\n ->getMock();\n $this->httpResponse\n ->method('getBody')\n ->will($this->returnValue(json_encode($array)));\n $this->httpClient\n ->method('request')\n ->will($this->returnValue($this->httpResponse));\n\n /**\n * Calls the listAll() method.\n */\n $response = $this->credentialsEndpoint->listAll();\n\n /**\n * Assertions.\n */\n $this->assertNotEmpty($response);\n\n $this->assertArrayHasKey('status', $response);\n $this->assertTrue($response['status']);\n\n $this->assertArrayHasKey('data', $response);\n $this->assertNotEmpty($response['data']);\n\n $this->assertArrayHasKey('company_id', $response['data'][0]);\n $this->assertSame(4564658766, $response['data'][0]['company_id']);\n\n $this->assertArrayHasKey('name', $response['data'][0]);\n $this->assertSame('My Test Key', $response['data'][0]['name']);\n\n $this->assertArrayHasKey('slug', $response['data'][0]);\n $this->assertSame('my-test-key', $response['data'][0]['slug']);\n\n $this->assertArrayHasKey('public', $response['data'][0]);\n $this->assertSame('4c9184f37cff01bcdc32dc486ec36961', $response['data'][0]['public']);\n\n $this->assertArrayHasKey('private', $response['data'][0]);\n $this->assertSame('2c17c6393771ee3048ae34d6b380c5ec', $response['data'][0]['private']);\n\n $this->assertInternalType('int', $response['data'][0]['production']);\n $this->assertSame(0, $response['data'][0]['production']);\n\n $this->assertInternalType('int', $response['data'][0]['special']);\n $this->assertSame(1, $response['data'][0]['special']);\n\n $this->assertInternalType('int', $response['data'][0]['created_at']);\n $this->assertInternalType('int', $response['data'][0]['updated_at']);\n }",
"public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }",
"public function testMultiple() {\n $client = new Client();\n $request = $client->get('http://web/v1/combined/CRESTOR/BENICAR/ASPIRIN');\n $response = $request;\n $this->assertEquals(200, $response->getStatusCode());\n }",
"public function testAvailable()\n {\n $response = $this->json('GET', '/api/list');\n\n $this->assertEquals(200, $response->status());\n\n\n }",
"public function test_can_get_all_todos_paginated()\n {\n $this->withoutExceptionHandling();\n\n $response = $this->get('/api/todos');\n $response->assertJson($response->decodeResponseJson());\n $response->assertStatus(200);\n }",
"public function test_index_rest()\n {\n $item = Rest::factory()->create();\n $response = $this->get('/api/v1/rest');\n $response->assertStatus(200);\n $response->assertJsonFragment([\n 'message' => $item->message,\n 'url' => $item->url\n ]);\n }",
"public function testIndex(){\n\t\t\n\t\t$this->mock->shouldReceive('all')->once();\n\n\t\t$this->call('GET', 'users'); //get: Method , user: url\n\n\t\t$this->assertResponseOk();\n\t}",
"public function testGetSuppliersUsingGET()\n {\n }",
"public function testGetAccountsUsingGET()\n {\n }",
"public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }",
"public function test_list()\n {\n $response = $this->get('/api/employees');\n\n $response->assertStatus(200);\n }",
"public function testRetrieveTheProductList(): void\n {\n $response = $this->request('GET', '/api/products');\n $json = json_decode($response->getContent(), true);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('application/json; charset=utf-8', $response->headers->get('Content-Type'));\n\n $this->assertCount(10, $json);\n\n foreach ($json as $key => $value) {\n $this->assertArrayHasKey('id', $json[$key]);\n $this->assertArrayHasKey('name', $json[$key]);\n $this->assertArrayHasKey('description', $json[$key]);\n $this->assertArrayHasKey('price', $json[$key]);\n $this->assertArrayHasKey('priceWithTax', $json[$key]);\n $this->assertArrayHasKey('category', $json[$key]);\n $this->assertArrayHasKey('id', $json[$key]['category']);\n $this->assertArrayHasKey('name', $json[$key]['category']);\n $this->assertArrayHasKey('tax', $json[$key]);\n $this->assertArrayHasKey('id', $json[$key]['tax']);\n $this->assertArrayHasKey('name', $json[$key]['tax']);\n $this->assertArrayHasKey('value', $json[$key]['tax']);\n $this->assertArrayHasKey('images', $json[$key]);\n foreach ($json[$key]['images'] as $image) {\n $this->assertArrayHasKey('id', $image);\n $this->assertArrayHasKey('fileName', $image);\n $this->assertArrayHasKey('mimeType', $image);\n }\n $this->assertArrayHasKey('updatedAt', $json[$key]);\n $this->assertArrayHasKey('createdAt', $json[$key]);\n } \n }",
"public function test_show_list_of_products()\n {\n $response = $this->getJson('/api/products');\n $response->assertStatus(200);\n }",
"public function testList()\n {\n //Tests all products\n $this->clientAuthenticated->request('GET', '/product/list');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('productId', $first);\n\n //Tests all products linked to a child\n $this->clientAuthenticated->request('GET', '/product/list/child/1');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('productId', $first);\n }",
"public function test_get()\n\t{\n\t\t$_SERVER['REQUEST_METHOD'] = 'GET';\n\n\t\tPigeon::map(function($r){\n\t\t\t$r->get('posts/(:any)', 'posts/show/$1');\n\t\t\t$r->get('posts/(:num)', 'posts#show');\n\t\t\t$r->get('posts/people', array( 'Posts', 'action' ));\n\t\t});\n\n\t\t$this->assertEquals(array( 'posts/(:any)' => 'posts/show/$1', \n\t\t\t\t\t\t\t\t 'posts/people' => 'posts/action',\n\t\t\t\t\t\t\t\t 'posts/(:num)' => 'posts/show/$1' ), Pigeon::draw());\n\t}",
"public function test_list_all_offices_paginated() {\n Office::factory(3)->create();\n\n $response = $this->get('/api/offices');\n\n $response->assertOk();\n\n // Assert the returned json data has 3 items - the ones we created above\n $response->assertJsonCount(3, 'data');\n\n // Assert atleast the ID of the first item is not null\n $this->assertNotNull($response->json('data')[0]['id']);\n\n // Assert there is meta for the paginated results. You can include links as well\n $this->assertNotNull($response->json('meta'));\n\n //dd($response->json());\n\n }",
"public function testRequestItemsUnavailable()\n {\n $response = $this->get('/api/items/unavailable');\n\n $response->assertStatus(200);\n }",
"public function get_test_http_requests()\n {\n }",
"public function testTestGetAllFilters()\n {\n // Parameters for the API call\n $type = null;\n\n // Set callback and perform API call\n self::$controller->setHttpCallBack($this->httpResponse);\n try {\n self::$controller->getAllFilters($type);\n } catch (APIException $e) {\n }\n\n // Test response code\n $this->assertEquals(\n 200,\n $this->httpResponse->getResponse()->getStatusCode(),\n \"Status is not 200\"\n );\n }",
"public function testLoaderAll()\n {\n $allItems = $this->tiresLoader->all();\n\n $this->assertContains(1,$allItems);\n $this->assertContains(2,$allItems);\n $this->assertContains(3,$allItems);\n $this->assertContains(4,$allItems);\n }"
] |
[
"0.7319049",
"0.7200814",
"0.7160691",
"0.7050792",
"0.7020079",
"0.6903622",
"0.6823919",
"0.68115354",
"0.68077993",
"0.67696106",
"0.6756455",
"0.6747637",
"0.6747249",
"0.6746995",
"0.6738464",
"0.6727913",
"0.6721891",
"0.67094153",
"0.6646932",
"0.6631128",
"0.6629592",
"0.6606557",
"0.6574698",
"0.6572052",
"0.65607",
"0.6559102",
"0.6545277",
"0.65376997",
"0.65273786",
"0.6524233"
] |
0.73360026
|
0
|
Get the downloads for a product or product variation
|
public static function get_downloads($product)
{
$downloads = array();
if ($product->is_downloadable()) {
foreach ($product->get_downloads() as $file_id => $file) {
$downloads[] = array(
'id' => $file_id, // do not cast as int as this is a hash
'name' => $file['name'],
'file' => $file['file'],
);
}
}
return $downloads;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getDownloads()\n\t{\n\t\tif (!$this->arrType['downloads'])\n\t\t{\n\t\t\t$this->arrDownloads = array();\n\t\t}\n\n\t\t// Cache downloads for this product\n\t\telseif (!is_array($this->arrDownloads))\n\t\t{\n\t\t\t$this->arrDownloads = $this->Database->execute(\"SELECT * FROM tl_iso_downloads WHERE pid={$this->arrData['id']} OR pid={$this->arrData['pid']}\")->fetchAllAssoc();\n\t\t}\n\n\t\treturn $this->arrDownloads;\n\t}",
"function edd_pup_get_all_downloads(){\r\n\r\n\t$products = get_transient( 'edd_pup_all_downloads' );\r\n\r\n\tif ( false === $products ) {\r\n\t\t$products = array();\r\n\t\t$downloads = get_posts(\tarray( 'post_type' => 'download', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC' ) );\r\n\t\tif ( !empty( $downloads ) ) {\r\n\t\t foreach ( $downloads as $download ) {\r\n\r\n\t\t $products[ $download->ID ] = $download->post_title;\r\n\r\n\t\t }\r\n\t\t}\r\n\r\n\t\tset_transient( 'edd_pup_all_downloads', $products, 60 );\r\n\t}\r\n\r\n\treturn $products;\r\n}",
"public function getDownloads($type) {\n\t\treturn StatManager::getAddonDownloads($this->id, $type);\n\t}",
"public function getDownloadsAttribute()\n {\n return $this->files\n ->where('pivot.zone', 'downloads')\n ->sortBy('pivot.id')\n ->flatten();\n }",
"public function downloads(): Collection;",
"public function getProductAttachmentURLs($id_product)\n {\n $final_attachment_data = array();\n $attachments = Product::getAttachmentsStatic((int)$this->context->language->id, $id_product);\n $count = 0;\n foreach ($attachments as $attachment) {\n $final_attachment_data[$count]['download_link'] = $this->context->link->getPageLink('attachment', true, null, \"id_attachment=\" . $attachment['id_attachment']);\n $final_attachment_data[$count]['file_size'] = Tools::formatBytes($attachment['file_size'], 2);\n $final_attachment_data[$count]['description'] = $attachment['description'];\n $final_attachment_data[$count]['file_name'] = $attachment['file_name'];\n $final_attachment_data[$count]['mime'] = $attachment['mime'];\n $final_attachment_data[$count]['display_name'] = $attachment['name'];\n $count++;\n }\n return $final_attachment_data;\n }",
"function getOfferSpecial2() {\n\t$db =& JFactory::getDBO();\n\t$query = \"SELECT p.*, pf.file_url FROM\n\t\t#__cp_category c JOIN \n\t\t(#__cp_products p JOIN\n\t\t#__cp_product_files pf ON pf.product_id = p.product_id)\n\t\tON c.category_id=p.category_id \n\t\tWHERE p.`featured` = 1 AND p.`published` = 1 \".getWhere().\" GROUP BY p.product_id\";\n\n\t$db->setQuery($query);\n\t$rows = $db->loadObjectList();\n\treturn $rows;\n}",
"public function getProductosUrl(){\n return $this->vectorUrlsProductos;\n }",
"public function getVirtualProducts()\n\t{\n\t\t$sql = '\n\t\t\tSELECT `product_id`, `download_hash`, `download_deadline`\n\t\t\tFROM `'._DB_PREFIX_.'order_detail` od\n\t\t\tWHERE od.`id_order` = '.(int)($this->id).'\n\t\t\t\tAND `download_hash` <> \\'\\'';\n\t\treturn Db::getInstance()->ExecuteS($sql);\n\t}",
"private function getDownloadableFileUrls() {\n if (!$this->wooData->getDownloadableMediaFiles()) return null;\n\n return array_map(function($mediaFile) {\n /** @var MediaFile $mediaFile */\n\n return Utils::view('site-tester.partial.attachment-item')\n ->with(['item' => $mediaFile])\n ->render();\n }, $this->wooData->getDownloadableMediaFiles());\n }",
"public function get_pdfs() {\n\t\treturn apply_filters( 'wc_product_catalog_pdfs', $this->pdfs, $this );\n\t}",
"public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}",
"public function getDownload()\n {\n return $this->download;\n }",
"function getItems()\n\t{\n\t\t$params = $this->getState()->get('params');\n\t\t$limit = $this->getState('list.limit');\n\n\t\tif ($this->_downloads === null && $category = $this->getCategory()) {\n\t\t\t\n $model = JModelLegacy::getInstance('downloads', 'JdownloadsModel', array('ignore_request' => true));\n\t\t\t\n $model->setState('params', JFactory::getApplication()->getParams());\n\t\t\t$model->setState('filter.category_id', $category->id);\n\t\t\t$model->setState('filter.published', $this->getState('filter.published'));\n\t\t\t$model->setState('filter.access', $this->getState('filter.access'));\n\t\t\t$model->setState('filter.language', $this->getState('filter.language'));\n $model->setState('list.ordering', $this->getState('list.ordering'));\n\t\t\t$model->setState('list.start', $this->getState('list.start'));\n\t\t\t$model->setState('list.direction', $this->getState('list.direction'));\n\t\t\t$model->setState('list.filter', $this->getState('list.filter'));\n\t\t\t$model->setState('list.links', $this->getState('list.links'));\n \n $model->setState('list.limit', $limit);\n\n if ($limit >= 0) {\n\t\t\t\t$this->_downloads = $model->getItems();\n\n\t\t\t\tif ($this->_downloads === false) {\n\t\t\t\t\t$this->setError($model->getError());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->_downloads=array();\n\t\t\t}\n \n $this->_pagination = $model->getPagination();\n\t\t}\n\n\t\treturn $this->_downloads;\n\t}",
"public function getProductUrls() {\n\t\t$urls = $this->crawler->filter( 'div.productInfo h3 a' )->each( function ( Crawler $node, $i ) {\n\t\t\treturn $node->attr( 'href' );\n\t\t} );\n\n\t\treturn $urls;\n\t}",
"function getAllDownloadDocuments() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `download`.*, `file`.`mime_type` FROM `download` INNER JOIN `file` ON (`download`.`file` = `file`.`sid`)');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}",
"public function productAssets()\n {\n $variations = ProductVariation::with('stocks')->get();\n $assets = $variations->sum(function ($variant) {\n return $variant->stockCount() * $variant->base_price;\n });\n\n $opAssets = $variations->sum(function ($variant) {\n return $variant->stockCount() * $variant->price;\n });\n\n return [\n 'assets' => $assets,\n 'op_asset' => $opAssets\n ];\n }",
"public function downloads() {\n\t\treturn $this->hasMany('\\App\\Models\\Download', 'episode_id', 'id');\n\t}",
"private function setDownloadOptions() {\n // If this is a recrawl, reset download settings.\n if ($this->getSaverData()->isRecrawl()) {\n $this->product->set_downloadable(false);\n $this->product->set_download_limit('');\n $this->product->set_download_expiry('');\n $this->product->set_downloads([]);\n }\n\n $isDownloadable = $this->wcData->isDownloadable();\n\n $this->product->set_downloadable($isDownloadable);\n $this->product->set_download_limit($this->wcData->getDownloadLimit());\n $this->product->set_download_expiry($this->wcData->getDownloadExpiry());\n\n // If the product is not downloadable, no need to save the files.\n if (!$isDownloadable) return;\n\n // Prepare downloadable file information in the format WooCommerce wants\n $downloadables = array_map(function($mediaFile) {\n /** @var MediaFile $mediaFile */\n return [\n 'file' => $mediaFile->getLocalUrl(),\n 'name' => $mediaFile->getMediaTitle() ?: $mediaFile->getBaseName(),\n ];\n }, $this->wcData->getDownloadableMediaFiles());\n\n // Set the downloads to the product\n $this->product->set_downloads($downloadables);\n }",
"function get_static_products() {\r\n return $this->DBObject->readCursor(\"product_actions.get_static_products\", null);\r\n }",
"function downloadable_product_type_options() {\n\tglobal $post;\n\t?>\n\t<div id=\"downloadable_product_options\" class=\"panel woocommerce_options_panel\">\n\t\t<?php\n\n\t\t\t// File URL\n\t\t\t$file_path = get_post_meta($post->ID, 'file_path', true);\n\t\t\t$field = array( 'id' => 'file_path', 'label' => __('File path', 'woothemes') );\n\t\t\techo '<p class=\"form-field\">\n\t\t\t\t<label for=\"'.$field['id'].'\">'.$field['label'].':</label>\n\t\t\t\t<span style=\"float:left\">'.ABSPATH.'</span><input type=\"text\" class=\"short\" name=\"'.$field['id'].'\" id=\"'.$field['id'].'\" value=\"'.$file_path.'\" placeholder=\"'.__('path to file on your server', 'woothemes').'\" /></p>';\n\t\t\t\t\n\t\t\t// Download Limit\n\t\t\t$download_limit = get_post_meta($post->ID, 'download_limit', true);\n\t\t\t$field = array( 'id' => 'download_limit', 'label' => __('Download Limit', 'woothemes') );\n\t\t\techo '<p class=\"form-field\">\n\t\t\t\t<label for=\"'.$field['id'].'\">'.$field['label'].':</label>\n\t\t\t\t<input type=\"text\" class=\"short\" name=\"'.$field['id'].'\" id=\"'.$field['id'].'\" value=\"'.$download_limit.'\" /> <span class=\"description\">' . __('Leave blank for unlimited re-downloads.', 'woothemes') . '</span></p>';\n\n\t\t?>\n\t</div>\n\t<?php\n}",
"public function getDownloadCount()\n\t{\n\t\treturn $this->downloads;\n\t}",
"function get_file_downloaded_url($id_emetteur) {\n $request = get_file_downloaded($id_emetteur);\n\n $file_url = '';\n\n while($result = $request->fetch()) {\n $file_url = $result['file_url'];\n }\n\n return $file_url;\n}",
"function wc_get_customer_available_downloads_newBykey( $customer_id,$orderkeydata,$productID) {\n\t$downloads = array();\n\t$_product = null;\n\t$order = null;\n\t$file_number = 0;\n\n\t// Get results from valid orders only\n\t$results = wc_get_customer_download_permissions( $customer_id );\n\n\tif ( $results ) {\n\t\tforeach ( $results as $result ) {\n\t\t\tif ( ! $order || $order->get_id() != $result->order_id ) {\n\t\t\t\t// new order\n\t\t\t\t$order = wc_get_order( $result->order_id );\n\t\t\t\t$_product = null;\n\t\t\t}\n\n\t\t\t// Make sure the order exists for this download\n\t\t\tif ( ! $order ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Downloads permitted?\n\t\t\tif ( ! $order->is_download_permitted() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$product_id = intval( $result->product_id );\n\n\t\t\tif ( ! $_product || $_product->get_id() != $product_id ) {\n\t\t\t\t// new product\n\t\t\t\t$file_number = 0;\n\t\t\t\t$_product = wc_get_product( $product_id );\n\t\t\t}\n\n\t\t\t// Check product exists and has the file\n\t\t\tif ( ! $_product || ! $_product->exists() || ! $_product->has_file( $result->download_id ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$download_file = $_product->get_file( $result->download_id );\n\n\t\t\t// Download name will be 'Product Name' for products with a single downloadable file, and 'Product Name - File X' for products with multiple files.\n\t\t\t$download_name = apply_filters(\n\t\t\t\t'woocommerce_downloadable_product_name',\n\t\t\t\t$download_file['name'],\n\t\t\t\t$_product,\n\t\t\t\t$result->download_id,\n\t\t\t\t$file_number\n\t\t\t);\n\n\t\t\t$downloads[$result->order_key][$product_id] = array(\n\t\t\t\t'download_url' => add_query_arg(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'download_file' => $product_id,\n\t\t\t\t\t\t'order' => $result->order_key,\n\t\t\t\t\t\t'email' => urlencode( $result->user_email ),\n\t\t\t\t\t\t'key' => $result->download_id,\n\t\t\t\t\t),\n\t\t\t\t\thome_url( '/' )\n\t\t\t\t),\n\t\t\t\t'download_id' => $result->download_id,\n\t\t\t\t'product_id' => $_product->get_id(),\n\t\t\t\t'product_name' => $_product->get_name(),\n\t\t\t\t'product_url' => $_product->is_visible() ? $_product->get_permalink() : '', // Since 3.3.0.\n\t\t\t\t'download_name' => $download_name,\n\t\t\t\t'order_id' => $order->get_id(),\n\t\t\t\t'order_key' => $order->get_order_key(),\n\t\t\t\t'downloads_remaining' => $result->downloads_remaining,\n\t\t\t\t'access_expires' => $result->access_expires,\n\t\t\t\t'file' => array(\n\t\t\t\t\t'name' => $download_file->get_name(),\n\t\t\t\t\t'file' => $download_file->get_file(),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t\n\t\t\t$file_number++;\n\t\t}\n\t}\n\t//echo \"<pre>\";\n\treturn $downloads[$orderkeydata][$productID];\n\n\t//return apply_filters( 'woocommerce_customer_available_downloads', $downloads, $customer_id );\n}",
"public function getVariation()\n {\n return $this->db->get($this->product_variant);\n }",
"function get_list_file_download($params) {\n $sql = \"SELECT a.file_id, b.ref_name \n FROM fa_files a\n INNER JOIN fa_file_reference b ON a.ref_id = b.ref_id\n WHERE data_id = ?\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }",
"public function showProductsFileForWget()\n\t{\n\n\t\t// cd \"products_local_storage\" && wget -O qwe.txt http://aarondev.enbe.pl/helper/showProductsFileForWget && wget -N -i qwe.txt && rm qwe.txt\n\n\t\t// cd \"products_local_storage\" && wget -O qwe.txt http://aaroftp.local/helper/showProductsFileForWget && wget -N -i qwe.txt && rm qwe.txt\n\t\t \n\t\t$sql_query = \"SELECT TRIM(TRAILING '.txt' FROM txt_file_url) as txt_file_url \";\n\t\t$sql_query .= \"FROM products \";\n\n\t\t$results = DB::select($sql_query);\n\t\tif (is_array($results)) {\n\t\t\tforeach ($results as $result) {\n\t\t\t\techo $result->txt_file_url.\".zip\\n\";\n\t\t\t\techo $result->txt_file_url.\".txt\\n\";\n\t\t\t}\n\t\t}\n\t}",
"public function getDownloadPath() {}",
"public function print_download_link_html() {\n global $post;\n if ( !$this->user_has_access_to_product( get_current_user_id(), $post->ID ) )\n return;\n\n echo do_shortcode( '[membership_download_product_links id=\"' . $post->ID . '\"]' );\n\n return;\n\n // OLD CODE\n\n $default_args = array(\n 'type' => '',\n 'link_class' => 'yith-wcmbs-button',\n 'link_title' => __( 'Download', 'yith-woocommerce-membership' )\n );\n\n $args = wp_parse_args( $args, $default_args );\n $type = $args[ 'type' ];\n $link_class = $args[ 'link_class' ];\n $link_title = $args[ 'link_title' ];\n\n $unlocked = $this->is_allowed_download() ? !$this->product_needs_credits_to_download( get_current_user_id(), $post->ID ) : true;\n $link_class .= $unlocked ? ' unlocked' : ' locked';\n\n $product_id = $post->ID;\n $product = wc_get_product( $product_id );\n $files = array();\n\n if ( $product ) {\n if ( $product->product_type != 'variable' ) {\n if ( $product->is_downloadable() ) {\n $files = $product->get_files();\n }\n } else {\n $variations = $product->get_children();\n if ( !empty( $variations ) ) {\n foreach ( $variations as $variation ) {\n $p = wc_get_product( $variation );\n if ( $p->is_downloadable() ) {\n $files = array_merge( $files, $p->get_files() );\n }\n }\n }\n }\n }\n\n if ( !empty( $files ) ) {\n $stamp = '';\n foreach ( $files as $key => $file ) {\n $link = add_query_arg( array( 'protected_file' => $key, 'product_id' => $product_id ), home_url( '/' ) );\n $name = !empty( $link_title ) ? $link_title : $file[ 'name' ];\n $title = $file[ 'name' ];\n\n $product_link = \"<a class='{$link_class}' href='{$link}' title='$title'>$name</a>\";\n if ( $type == 'list' )\n $product_link = \"<li>{$product_link}</li>\";\n\n $stamp .= $product_link;\n }\n\n if ( $type == 'list' )\n $stamp = '<ul class=\"yith-wcmbs-download-file-list\">' . $stamp . '</ul>';\n\n echo $stamp;\n }\n }",
"public function getDownloadsList($customerId);"
] |
[
"0.69692105",
"0.60376287",
"0.59513885",
"0.585497",
"0.5853088",
"0.5756023",
"0.5718176",
"0.56515837",
"0.5622653",
"0.56134737",
"0.56126004",
"0.5585659",
"0.5551963",
"0.55123794",
"0.54727566",
"0.54656357",
"0.540306",
"0.53777766",
"0.53650725",
"0.5345846",
"0.5316464",
"0.5288763",
"0.5239912",
"0.5223811",
"0.52191216",
"0.52161026",
"0.52024317",
"0.5180321",
"0.51558095",
"0.51350594"
] |
0.6454889
|
1
|
Return Live Event List By Artist
|
public function listArtistEventsBy($artist_id, $request) {
$error_messages = [];
$results = [];
$data = $request->all();
$sort_by = isset($data['sort_by']) ? trim($data['sort_by']) : 'upcoming';
$page = (isset($data['page']) && $data['page'] != '') ? trim($data['page']) : '1';
$platform = (isset($data['platform']) && $data['platform'] != '') ? strtolower(trim($data['platform'])) : 'android';
$cache_hash_key = Config::get('cache.hash_keys.artist_live_upcoming');
if(strtolower($sort_by) == 'past') {
$cache_hash_key = Config::get('cache.hash_keys.artist_live_past');
}
$cache_params = [];
$hash_name = env_cache_key( $cache_hash_key. $artist_id . ':' . $platform);
$hash_field = intval($page);
$cache_miss = false;
$cache_params['hash_name'] = $hash_name;
$cache_params['hash_field'] = (string) $hash_field;
$cache_params['expire_time'] = $this->cache_expire_time;
$results = $this->cache->getHashData($cache_params);
if(!$results) {
$results = $this->repObj->listArtistEventsBy($artist_id, $data);
if($results) {
$results = apply_cloudfront_url($results);
$cache_params['hash_field_value'] = $results;
$save_to_cache = $this->cache->saveHashData($cache_params);
$cache_miss = true;
$results = $this->cache->getHashData($cache_params);
}
}
$results['cache'] = ['hash_name' => $hash_name, 'hash_field' => $hash_field, 'cache_miss' => $cache_miss];
return ['error_messages' => $error_messages, 'results' => $results];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getArtists(){\n return Artist::all();\n }",
"public function getArtistsList() {\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tThe artists list\n\t\t$sql = <<<EOD\n\t\tSELECT\n\t\t\t{$this->wpdb->prefix}topspin_artists.id,\n\t\t\t{$this->wpdb->prefix}topspin_artists.name,\n\t\t\t{$this->wpdb->prefix}topspin_artists.avatar_image,\n\t\t\t{$this->wpdb->prefix}topspin_artists.url,\n\t\t\t{$this->wpdb->prefix}topspin_artists.description,\n\t\t\t{$this->wpdb->prefix}topspin_artists.website\n\t\tFROM {$this->wpdb->prefix}topspin_artists\n\t\tORDER BY\n\t\t\t{$this->wpdb->prefix}topspin_artists.name ASC\nEOD;\n\t\treturn $this->wpdb->get_results($this->wpdb->prepare($sql),ARRAY_A);\n\t}",
"function getAllArtist()\n {\n\n $db = dbConnect();\n\n $query = $db->query('SELECT * FROM artists');\n $artists = $query->fetchAll();\n\n return $artists;\n }",
"function mf_get_posts_connected_to_meta($meta_value, $return_array = false, $artist = false){\n\tglobal $wpdb;\n\n\t$query = \"SELECT post_id FROM $wpdb->postmeta WHERE meta_value='$meta_value'\";\n\t\n\tif($artist){\n\t\t$query = \"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key= 'mf_SALF_artist_meta_checks'\";\n\t\t\n\t\t\n\t}\n\t\n\t//run query, get list of post ID's connected to this meta\n\t$post_ID_query = $wpdb->get_results($query);\n\t\n\t$post_ID_query = remove_unpublished_posts($post_ID_query);\n\t\n\tif($artist){//removes unwanted artist events (leaves only events with artist connection)\n\t\tforeach ($post_ID_query as $k=>$v){\n\t\t\tif (!in_array($meta_value, unserialize($v->meta_value))) unset($post_ID_query[$k]);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t$_SESSION['artist_query'] = $post_ID_query;\n\t//create array $post_ID -> $permalink\n\tforeach($post_ID_query as $post){\n\t\tif(!$artists || in_array($post_id,$post_ID_query->meta_value)){\n\t\t\t\n\t\t\t$posts[$post->post_id]['link'] = get_permalink($post->post_id);\n\t\t\t$posts[$post->post_id]['title'] = get_the_title($post->post_id);\n\t\t} \n\t}\n\t\n\tif($posts===null) return false;\n\t\n\t\n\t// returns just an array, rather than a list, if selected in the $args\n\tif($return_array){\n\t\treturn $posts;\n\t}\n\t\n\tforeach ($posts as $list_element){\n\t\t$html_list .= '<li><a href=\"';\n\t\t$html_list .= $list_element['link'];\n\t\t$html_list .= '\">';\n\t\t$html_list .= $list_element['title'];\n\t\t$html_list .= '</a></li>';\n\t}\n\t////////fb::log($html_list,'Venue Debug');\n\treturn $html_list;\n}",
"public function artistIndex()\n {\n return PodcastResource::collection(\\Auth::user()->artist->podcasts()->orderBy('created_at', 'desc')->get());\n }",
"function listEventInfo() {\n\t\t$query = \"SELECT e_description, c_name, tag_name, start_datetime, end_datetime, capacity, v.name AS vname, address,o.name AS oname, v.address, v.city, v.state, v.postal_code \n\t\tFROM yam14.F_event e, yam14.F_venue v, yam14.F_category c, yam14.F_topic t, yam14.F_organizer o\n\t\tWHERE e.venue_id = v.v_id \n\t\tAND c.c_id = e.c_id \n\t\tAND t.tag_id = e.tag_id \n\t\tAND o.o_id = e.organizer_id\n\t\tAND e.e_id = $this->eid ;\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t$this->category = $row['c_name'];\n\t\t\t$this->tag = $row['tag_name'];\n\t\t\t$this->description = $row['e_description'];\n\t\t\t$this->startdate = date('l, M d, Y',strtotime($row['start_datetime']));\n\t\t\t$this->starttime = date('H:i A',strtotime($row['start_datetime']));\n\t\t\t$this->enddate = date('l, M d, Y',strtotime($row['end_datetime']));\n\t\t\t$this->endtime =date('H:i A',strtotime($row['end_datetime']));\n\t\t\t$this->capacity = $row['capacity'];\n\t\t\t$this->venue = $row['vname'];\n\t\t\t$this->address = $row['address'] . \", \" . $row['city'] . \", \" . $row['state'] . \" \" . $row['postal_code'];\n\t\t\t$this->organizer = $row['oname'];\n\t\t\techo \"<hr />\";\n\t\t\techo \"<div class=\\\"panel panel-default\\\">\";\n\t\t\techo \t\"<div class=\\\"panel-heading\\\">\";\n\t\t\techo \t\"<h3 class=\\\"panel-title\\\">Event Information</h3>\";\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"<div class=\\\"panel-body\\\">\";\n\t\t\techo \"<p><b>Description: </b>$this->description</p>\";\n\t\t\techo \t\"<p><b>Category: </b>$this->category</p>\";\n\t\t\techo \t\"<p><b>Topic: </b>$this->tag</p>\";\n\t\t\techo \t\"<p><b>Start Date: </b>$this->startdate</p>\";\n\t\t\techo \t\"<p><b>Start Time: </b>$this->starttime</p>\";\n\t\t\techo \t\"<p><b>End Date: </b>$this->enddate</p>\";\n\t\t\techo \t\"<p><b>End Time: </b>$this->endtime</p>\";\n\t\t\techo \t\"<p><b>Capacity: </b>$this->capacity</p>\";\n\t\t\techo \t\"<p><b>Organizer: </b>$this->organizer</p>\";\n\t\t\techo \t\"<p><b>Location: </b>$this->venue</p>\";\n\t\t\techo \t\"<p><b>Address: </b>$this->address</p>\";\n\t\t\t\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"</div>\";\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t}",
"function get_my_events($rama) {\r\n\t\tglobal $post;\r\n\t\t$events = new WP_Query();\r\n\t\t$events->query('post_type=Rama&showposts=5&order=desc' . $rama);\r\n\t\tif($events->found_posts>0) {\r\n\t\t\techo '<ul class=\"rama_widget\">';\r\n\t\t\t\twhile($events->have_posts()) {\r\n\t\t\t\t\t$events->the_post();\r\n\t\t\t\t\t$image = (has_post_thumbnail($post->ID)) ? get_the_post_thumbnail($post->ID) : '<div class=\"missingthumbnail\"></div>';\r\n\t\t\t\t\t$eventItem = '<li>' . $image;\r\n\t\t\t\t\t$eventItem .= '<a href=\"' . get_permalink() . '\">';\r\n\t\t\t\t\t$eventItem .= get_the_title() . '</a>';\r\n\t\t\t\t\t$eventItem .= '<span>' . get_the_excerpt() . '';\r\n\t\t\t\t\t$eventItem .= '<a class=\"widgetmore\" href=\"' . get_permalink() . '\">';\r\n\t\t\t\t\t$eventItem .= '<p>Read More... </p>' . '</a></span></li>';\r\n\t\t\t\t\techo $eventItem;\r\n\t\t\t\t}\r\n\t\t\techo '</ul>';\r\n\t\t\twp_reset_postdata();\r\n\t\t}\r\n\t}",
"public function getEvents($location) {\n \n // Create the API url\n $url = $this->getUrl('geo.getevents', array('long' => $location->getLongitude(), 'lat' => $location->getLatitude(), 'limit' => 100));\n \n // Create event objects\n $events = array();\n $json = json_decode($this->getExternalContents($url));\n foreach($json->{'events'}->{'event'} as $event) {\n $e = new Event();\n \n $venue = new Venue();\n $venue->setName($event->{'venue'}->{'name'});\n $location = new Location();\n $location->setLatitude($event->{'venue'}->{'location'}->{'geo:point'}->{'geo:lat'});\n $location->setLongitude($event->{'venue'}->{'location'}->{'geo:point'}->{'geo:long'}); \n $venue->setLocation($location);\n \n $e->setVenue($venue);\n $e->setName($event->{'title'});\n \n $attendingArtists = array();\n if(is_array($event->{'artists'}->{'artist'})) {\n foreach($event->{'artists'}->{'artist'} as $artist) {\n $a = new Artist();\n $a->setName($artist);\n $attendingArtists[] = $a;\n }\n } else if(is_string($event->{'artists'}->{'artist'})) {\n $a = new Artist();\n $a->setName($event->{'artists'}->{'artist'});\n $attendingArtists[] = $a;\n }\n \n $e->setAttendingArtists($attendingArtists);\n $e->setDatetime($event->{'startDate'});\n $e->setId($event->{'id'});\n $events[] = $e;\n }\n \n // Return the results\n return $events;\n \n }",
"public function getArtists($status);",
"public function getEventList() {\n $response = $this->client->get(\n $this->apiUrl . \"events\");\n return $response->json();\n }",
"public function artistIndex()\n {\n return SongResource::collection(auth()->user()->artist->songs);\n }",
"public function index()\n {\n return Artist::with(['user'])->get();\n }",
"public function findAllArtists()\n {\n $query = 'SELECT DISTINCT t.artist FROM ApiTracklistBundle:Track t ORDER BY t.artist';\n\n return $this->getEntityManager()\n ->createQuery($query)\n ->getResult();\n }",
"public function getArtist() {}",
"public function allArtists()\n {\n return $this->orderBy('created_at', 'desc')->paginate(10);\n }",
"function aidtransparency_print_events()\r\n{\r\n $events = new IATI_Event_Collection();\r\n if( $events->findPosts() > 0 ) :\r\n ?>\r\n <ol>\r\n <?php\r\n foreach ($events->getPosts() as $event) :\r\n ?>\r\n <li><a href=\"<?php echo get_permalink($event->ID); ?>\" title=\"<?php echo $event->post_title; ?>\"><?php echo $event->post_title; ?></a>\r\n <span class=\"when\"><?php echo $event->getWhere(); ?> </span>\r\n </li>\r\n <?php endforeach; ?>\r\n </ol>\r\n <?php endif;\r\n}",
"function fetchEventDetails($TMeventDetailsResult){\n $eventDetailsResult = array();\n $eventDetailsArray = $TMeventDetailsResult;\n //extract information\n $eventDetailsResult[\"name\"] = array_key_exists('name',$eventDetailsArray)?$eventDetailsArray[\"name\"]:\"\";\n\n //extract dates information\n $eventDetailsResult[\"date\"] = array();\n if(array_key_exists('dates',$eventDetailsArray)){\n if(array_key_exists('start',$eventDetailsArray['dates'])){\n if(array_key_exists('localDate',$eventDetailsArray[\"dates\"][\"start\"])){\n $eventDetailsResult[\"date\"][\"localDate\"] = $eventDetailsArray[\"dates\"][\"start\"][\"localDate\"];\n }\n if(array_key_exists('localDate',$eventDetailsArray[\"dates\"][\"start\"])){\n $eventDetailsResult[\"date\"][\"localTime\"] = $eventDetailsArray[\"dates\"][\"start\"][\"localTime\"];\n }\n }\n }\n\n //extract genre information\n $eventDetailsResult[\"genre\"] = array();\n if(array_key_exists('classification',$eventDetailsArray)){\n foreach($eventDetailsArray[\"classification\"] as $i => $ele){\n if(array_key_exists('segment',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"segment\"] = $ele[\"segemnt\"];\n }\n if(array_key_exists('genre',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"genre\"] = $ele[\"genre\"];\n }\n if(array_key_exists('subGenre',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"subGenre\"] = $ele[\"subGenre\"];\n }\n if(array_key_exists('type',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"type\"] = $ele[\"type\"];\n }\n if(array_key_exists('segment',$ele)) {\n $eventDetailsResult[\"genre\"][$i][\"subType\"] = $ele[\"subType\"];\n }\n }\n }\n\n //extract artist information\n $eventDetailsResult[\"artists\"] = array();\n if(array_key_exists('_embedded',$eventDetailsArray)){\n if(array_key_exists('attractions',$eventDetailsArray[\"_embedded\"])) {\n foreach ($eventDetailsArray[\"_embedded\"][\"attractions\"] as $i => $ele) {\n if(array_key_exists('name',$ele)){\n $eventDetailsResult[\"artists\"][$i][\"name\"] = $ele[\"name\"];\n }\n if(array_key_exists('url',$ele)){\n $eventDetailsResult[\"artists\"][$i][\"url\"] = $ele[\"url\"];\n }\n }\n }\n }\n\n //extract venue information\n $eventDetailsResult[\"venues\"] = array();\n if(array_key_exists(\"_embedded\",$eventDetailsArray)){\n if(array_key_exists(\"venues\",$eventDetailsArray[\"_embedded\"])){\n foreach($eventDetailsArray[\"_embedded\"][\"venues\"] as $i => $ele){\n if(array_key_exists('name',$ele)){\n $eventDetailsResult[\"venues\"][$i][\"name\"] = $ele[\"name\"];\n }\n }\n }\n }\n\n //extract price range\n $eventDetailsResult['priceRange'] = array();\n if(array_key_exists('priceRange',$eventDetailsArray)){\n foreach($eventDetailsArray[\"priceRange\"] as $i => $ele){\n if(array_key_exists('min',$ele)){\n $eventDetailsResult['priceRange'][$i][\"min\"] = $ele[\"min\"];\n }\n if(array_key_exists('max',$ele)){\n $eventDetailsResult['priceRange'][$i][\"max\"] = $ele[\"max\"];\n }\n\n }\n }\n //extract ticketStatus information\n if(array_key_exists('dates',$eventDetailsArray)){\n if(array_key_exists('status',$eventDetailsArray[\"dates\"])){\n if(array_key_exists('code',$eventDetailsArray[\"dates\"][\"status\"])){\n $eventDetailsResult[\"ticketStatus\"] = $eventDetailsArray[\"dates\"][\"status\"][\"code\"];\n }\n }\n }\n //extract seatmap\n if(array_key_exists('seatmap',$eventDetailsArray)){\n if(array_key_exists('staticUrl',$eventDetailsArray[\"seatmap\"])){\n $eventDetailsResult[\"seatmap\"] = $eventDetailsArray[\"seatmap\"][\"staticUrl\"];\n }\n\n }\n //extract buy ticket at url\n if(array_key_exists('url',$eventDetailsArray)){\n $eventDetailsResult[\"buyTicketAt\"] = $eventDetailsArray[\"url\"];\n\n }\n\n return $eventDetailsResult;\n}",
"function event_list(){\n\tglobal $DB;\n\t$currenttime = time();\n\t$query = \"SELECT * FROM {event} WHERE eventtype='site' ORDER By id DESC\";\n $result = $DB->get_records_sql($query);\n\treturn $result;\n}",
"function getEvents($date = ''){\r\n\t//Include db configuration file\r\n\tinclude 'dbConfig.php';\r\n\t$eventListHTML = '';\r\n\t$date = $date?$date:date(\"Y-m-d\");\r\n\t//Get events based on the current date\r\n\t$result = $db->query(\"SELECT title FROM cakemaker WHERE date = '\".$date.\"' AND status = 1\");\r\n\tif($result->num_rows > 0){\r\n\t\t$eventListHTML = '<h2>Events on '.date(\"l, d M Y\",strtotime($date)).'</h2>';\r\n\t\t$eventListHTML .= '<ul>';\r\n\t\twhile($row = $result->fetch_assoc()){ \r\n $eventListHTML .= '<li>'.$row['title'].'</li>';\r\n }\r\n\t\t$eventListHTML .= '</ul>';\r\n\t}\r\n\techo $eventListHTML;\r\n}",
"function artistsList()\n{\n $title=\"Velvet Records - Artists Gallery\";\n \n // Creates a new Artist model instance\n $artist = new Artist;\n\n // Gets the list of all artists\n $artists = $artist->getArtistsList();\n\n require \"views/artists/list.php\";\n}",
"public function getPlayLists();",
"function getFeaturedArtists($dom) {\n $feat = $dom->find('div.featured_artists',0);\n $artists = array();\n if ($feat != NULL && sizeof($feat) > 0) {\n foreach($feat->find('a') as $artist) {\n $artists[] = $artist->plaintext;\n }\n }\n return $artists;\n}",
"function getFeaturedArtists($dom) {\n $feat = $dom->find('div.featured_artists',0);\n $artists = array();\n if ($feat != NULL && sizeof($feat) > 0) {\n foreach($feat->find('a') as $artist) {\n $artists[] = $artist->plaintext;\n }\n }\n return $artists;\n}",
"public function index()\n {\n $artists = Artist::all();\n return new ArtistsCollection($artists);\n }",
"public function searchForPlayList();",
"function listEventTitle($e_id) {\n\t\t$e_id = mysql_real_escape_string($e_id);\n\t\t$this->eid = $e_id;\n\t\t$query = \"SELECT e_title, v.name, start_datetime, end_datetime \n\t\tFROM yam14.F_event e, yam14.F_venue v \n\t\tWHERE e.venue_id = v.v_id\n\t\tAND e_id = $this->eid;\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\n\t\t\t$this->title = $row['e_title'];\n\t\t\t$this->venue = $row['name'];\n\t\t\t$this->startdate = date('l, M d, Y',strtotime($row['start_datetime']));\n\t\t\t$this->starttime = date('H:i A',strtotime($row['start_datetime']));\n\t\t\t$this->enddate = date('l, M d, Y',strtotime($row['end_datetime']));\n\t\t\t$this->endtime =date('H:i A',strtotime($row['end_datetime']));\n\t\t\t\n\t\t\techo \"<div>\";\n\t\t\techo \"<h3>$this->title</h3>\";\n\t\t\techo \"<h4>$this->venue</h4>\";\n\t\t\techo \"<h4>From $this->startdate $this->starttime </h4><h4>To $this->enddate $this->endtime </h4>\";\n\t\t\techo \"<hr />\";\n\t\t\techo \"</div>\";\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t\t\n\t}",
"public static function getList(&$params)\n {\n // Get current date\n $curdate = JFactory::getDate('now', new DateTimeZone($params->get('timezone_events')))->format('Y-m-d');\n\n // Connect to database and build the query\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n // Select all from both tabels\n $query->select(array('a.*', 'b.*'));\n $query->from($db->quoteName('#__events', 'a'));\n\t // Inner join on event_type\n\t $query->join('INNER', $db->quoteName('#__events_types', 'b') . ' ON (' . $db->quoteName('a.event_type') . ' = ' . $db->quoteName('b.event_type') . ')');\n // Get events between start and enddate\n $query->where($db->quote($curdate) . \"BETWEEN\" . $db->quoteName('start_date') . \"AND\" . $db->quoteName('end_date'));\n // Limit on how many results\n $query->setLimit($params->get('max_events'));\n // Order ascending\n $query->order('a.start_date ASC');\n\n $db->setQuery($query);\n $events = $db->loadObjectList();\n\n return $events;\n }",
"public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }",
"public function getTopArtists ()\n {\n $lastFmService = new LastFmService;\n $limit = $this->app->request->params('limit', 20);\n $data = $lastFmService->getTopArtists($limit);\n $this->respond($data);\n }",
"public function getAllArtists() {\n\t\t$artists = $this->model->getAllArtists();\n\t\t\n\t\tif ( !$artists )\n\t\t\treturn null;\n\t\t\n\t\treturn $artists;\n\t}"
] |
[
"0.6497871",
"0.624304",
"0.6190835",
"0.59706205",
"0.59645563",
"0.59349775",
"0.58603626",
"0.5840968",
"0.5839621",
"0.5832681",
"0.58267057",
"0.5799559",
"0.5775961",
"0.5765798",
"0.5763318",
"0.575384",
"0.57527995",
"0.57328504",
"0.573062",
"0.5692943",
"0.56781834",
"0.5676882",
"0.5676882",
"0.5642195",
"0.56380045",
"0.5637046",
"0.56229025",
"0.5590181",
"0.5578135",
"0.5571586"
] |
0.65617627
|
0
|
(1.0) Get onetoone belongsTo relationship floor This device belongs to floor
|
public function floor()
{
return $this->belongsTo('App\Floor', 'FLOOR_ID' ,'FLOOR_ID');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function floor()\n {\n return $this->belongsTo('App\\Floor', 'FLOOR_ID', 'FLOOR_ID');\n }",
"public function building()\n\t{ \n\t\treturn $this->belongsTo(HafizBuilding::class);\n\t}",
"public function complex()\n\t{ \n\t\treturn $this->belongsToThrough(HafizComplex::class, HafizBuilding::class, null, '', [\n\t\t\tHafizComplex::class => 'complex_id', \n\t\t\tHafizBuilding::class=> 'building_id' \n\t\t]);\n\t}",
"public function building()\n {\n return $this->belongsToOne('App\\Building');\n }",
"public function deviceRow() : BelongsTo\n {\n return $this->belongsTo(SprDev::class, 'device');\n }",
"public function neighborhood() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\Neighborhood');\n }",
"public function building()\n {\n return $this->belongsTo('App\\Building', 'building_id');\n }",
"public function owner()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Faceofzzlandings\\Models\\Faceofzzlanding', 'faceofzzlanding_id');\n }",
"public function door()\n {\n return $this->belongsTo(DoorsModel::class, 'door_id');\n }",
"public function getRoom()\n {\n return $this->hasOne(Room::className(), ['id' => 'room_id']);\n }",
"public function getRoom()\n {\n return $this->hasOne(Room::className(), ['id' => 'room_id']);\n }",
"public function onDevices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID')->where('ONLINE_FLAG',1);\n }",
"public function getIdFloor(){\n return $this->idFloor;\n }",
"public function owner(): BelongsTo\n {\n return $this->belongsTo(Hotstream::userModel(), 'user_id');\n }",
"public function house(){\n return $this->belongsTo('App\\Models\\MasterRecords\\House');\n }",
"public function rooms()\n {\n return $this->hasMany(Room::class, 'floor_id', 'id');\n }",
"public function hosusehold()\n {\n//return $this->hasMany('App\\Child','household_id');\n\n \treturn $this->belongsTo('App\\HouseHold','household_id');\n }",
"public function getSensor()\n {\n return $this->hasOne(Sensor::className(), ['SensorID' => 'SensorID']);\n }",
"public function parent() {\n return $this->belongsTo('App\\Sensor');\n }",
"public function room()\n {\n return $this->hasOne('App\\Entities\\Room', 'id_categoria_habitacion', 'room_category_id');\n }",
"public function wall()\n {\n return $this->belongsTo(Wall::class);\n }",
"public function house()\n {\n return $this->belongsTo(House::class);\n }",
"public function telefone()\n\t{\n\t\treturn $this->belongsTo('Telefone');\n\t}",
"public function from_warehouse() {\n return $this->hasOne('App\\Models\\Warehouse', 'PK_NO', 'F_FROM_INV_WAREHOUSE_NO');\n }",
"public function owner()\n {\n return $this->belongsTo(Jetstream::userModel(), 'user_id');\n }",
"public function owner()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Partners\\Shells\\Models\\Partner', 'partner_id')->withoutGlobalScopes();\n }",
"public function devices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID');\n }",
"public function owner(): BelongsTo\n {\n return $this->belongsTo(SocialPassport::getAuthProviderModel(), 'owner_id');\n }",
"public function autoProductDivision()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\AutoProductDivision','sp_id','sp_id');\n }",
"public function central()\n {\n return $this->belongsTo('App\\CentralOffice');\n }"
] |
[
"0.72988117",
"0.6349312",
"0.62869954",
"0.6111064",
"0.6026124",
"0.5968063",
"0.59403825",
"0.5891349",
"0.5880016",
"0.5876246",
"0.5876246",
"0.5828975",
"0.5828412",
"0.5735656",
"0.56953764",
"0.5688719",
"0.5678958",
"0.56118685",
"0.5597043",
"0.5578245",
"0.55615103",
"0.55431795",
"0.5486035",
"0.5483839",
"0.5433628",
"0.5427778",
"0.54216635",
"0.5418621",
"0.5417946",
"0.5400356"
] |
0.72201324
|
1
|
(3.0) Get onetoone belongsTo relationship gateway This device belongs to gateway
|
public function gateway()
{
return $this->belongsTo('App\Gateway', 'GATEWAY_ID' ,'GATEWAY_ID');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function gateways()\n {\n return $this->hasMany('App\\Gateway', 'ROOM_ID');\n }",
"public function conductor_bus(){\n return $this->hasOne('App\\Models\\Bus','assistant_2');\n }",
"public function neighborhood() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\Neighborhood');\n }",
"public function owner(): BelongsTo\n {\n return $this->belongsTo(Hotstream::userModel(), 'user_id');\n }",
"public function deviceRow() : BelongsTo\n {\n return $this->belongsTo(SprDev::class, 'device');\n }",
"public function telefone()\n\t{\n\t\treturn $this->belongsTo('Telefone');\n\t}",
"public function relationship(){\n return $this->hasOne('App\\Relationship','id','relationship_id');\n }",
"public function getAddress()\n {\n //Read it as select * from address, person where address.relatedmodel_id = person.id AND person.id = customer.person_id\n //Thus when via is used second param in the link correspond to via column in the relation.\n return $this->hasOne(Address::className(), ['relatedmodel_id' => 'id'])\n ->where('relatedmodel = :rm AND type = :type', [':rm' => 'Person', ':type' => Address::TYPE_DEFAULT])\n ->via('person');\n }",
"public function journey() {\n return $this->hasOne('TravelingChildrenProject\\Journey', 'id', 'likes_journey');\n }",
"public function driver_bus(){\n return $this->hasOne('App\\Models\\Bus','assistant_1');\n }",
"public function ngo()\n {\n return $this->belongsTo('Ngo', 'ngo_id');\n }",
"public function belongsToRelation()\n {\n return $this->belongsTo(Relations::class)\n ->foreignKey('on_table_id');\n }",
"public function client()\n {\n return $this->belongsTo(Client::class, 'ownBy');\n }",
"public function userDevice()\n {\n return $this->hasOne(UserDevice::class);\n }",
"public function onDevices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID')->where('ONLINE_FLAG',1);\n }",
"public function getIdRelatorio0()\n {\n return $this->hasOne(Relatorio::className(), ['idRelatorio' => 'idRelatorio']);\n }",
"public function client()\n {\n return $this->belongsTo('DragonLancers\\Client');\n }",
"public function owner()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Faceofzzlandings\\Models\\Faceofzzlanding', 'faceofzzlanding_id');\n }",
"public function sysRegGateways()\n {\n return $this->hasMany('App\\Gateway', 'ROOM_ID')->where([['REG_FLAG',1],['MANUFACTURER_ID',1]]);\n }",
"public function prospecto(){\n return $this->belongsTo('App/Cliente');\n }",
"public function target()\n {\n return $this->hasMany(\\App\\Target::class)->where('is_decoy', false);\n }",
"public function journey()\n {\n return $this->belongsTo(Journey::class);\n }",
"public function complex()\n\t{ \n\t\treturn $this->belongsToThrough(HafizComplex::class, HafizBuilding::class, null, '', [\n\t\t\tHafizComplex::class => 'complex_id', \n\t\t\tHafizBuilding::class=> 'building_id' \n\t\t]);\n\t}",
"public function coordinacion()\n {\n \treturn $this->belongsTo('App\\Coordinacion','tCoordinacion_idCoordinacion', 'idCoordinacion');\n }",
"public function owner(): BelongsTo\n {\n return $this->belongsTo(SocialPassport::getAuthProviderModel(), 'owner_id');\n }",
"public function getDestination()\n {\n return $this->hasOne(Destination::className(), ['id' => 'destination_id']);\n }",
"public function product(): BelongsTo\n {\n return $this->belongsTo(ProductProxy::modelClass());\n }",
"public function owner(): BelongsTo\n {\n return $this->belongsTo(User::class, 'owner_id');\n }",
"public function building()\n\t{ \n\t\treturn $this->belongsTo(HafizBuilding::class);\n\t}",
"public function ponderacion() {\n\t\treturn $this->belongsTo('App\\Ponderacion');\n\t}"
] |
[
"0.6170367",
"0.6048963",
"0.60302097",
"0.59895283",
"0.5961767",
"0.59490955",
"0.5873303",
"0.5844141",
"0.5835872",
"0.58265394",
"0.58098334",
"0.5796327",
"0.5762428",
"0.5737722",
"0.5708012",
"0.56945145",
"0.568223",
"0.56757736",
"0.56556404",
"0.56526464",
"0.56181026",
"0.5598209",
"0.55643994",
"0.5563351",
"0.55523163",
"0.5549181",
"0.55439",
"0.5533846",
"0.55298656",
"0.54974174"
] |
0.745396
|
0
|
(4.0) Get onetomany hasMany relationship processedData This device has many processed data
|
public function processedData()
{
return $this->hasMany('App\ProcessedData', 'DEVICE_ID');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getProcessedData(Request $request){\n $deviceID = $request->DEVICE_ID;\n $floor = $request->FLOOR_ID;\n $room = $request->ROOM_ID;\n $deviceType = str_replace(' ', '_', strtolower($request->DEVICE_TYPE));\n $arrID = [];\n //change query to look for device ids with specific device type\n if ($room != '') {\n $deviceIDs = Device::where([['MANUFACTURER_ID',1], ['REG_FLAG',1],\n ['DEVICE_TYPE',$deviceType], ['ROOM_ID',$room]])\n ->select('DEVICE_ID')->get();\n }else{\n $deviceIDs = Device::where([['MANUFACTURER_ID',1], ['REG_FLAG',1],\n ['DEVICE_TYPE',$deviceType], ['FLOOR_ID',$floor]])\n ->select('DEVICE_ID')->get();\n }\n foreach($deviceIDs as $deviceID){\n array_push($arrID, $deviceID->DEVICE_ID);\n }\n //changed query to select elements in child table to optimize memory usage\n $data = ProcessedData::with(array('device'=>function($query){\n $query->select('DEVICE_ID', 'DEVICE_TYPE', 'DEVICE_NAME');\n }))->whereIn('DEVICE_ID',$arrID)->get();\n return $data;\n }",
"public function getProcessData()\n {\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 }",
"public function processTime(){\n \t return this->hasMany('App\\processTimes');\n }",
"public function device(){\n return $this->hasMany(InspectionDevice::class,'inspection_id','id');\n }",
"public function getCaptureDatas()\n {\n return $this->hasMany(CaptureData::className(), ['office_id' => 'id']);\n }",
"public function onDevices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID')->where('ONLINE_FLAG',1);\n }",
"public function getProcessedRelations()\n\t{\n\t\treturn $this->_processedRelations;\n\t}",
"public function devices()\n {\n return $this->hasMany('SimulatorOperation\\Device');\n }",
"public function getProcessedData(): object|array;",
"public function sensorsData()\n {\n return $this->hasMany('App\\SensorsData', 'el_sensor_id'); \n }",
"public function getActualOverheadServiceChargesDIA(){\n return $this->hasMany(Overhead_service_charges_dia::class, 'mfp_procurement_id', 'id'); \n }",
"public function OderDetails(){\n\t\treturn $this->hasMany('App\\OrderProduct','ID_Product');\n\t}",
"public function getDiaReleaseCommodity(){\n return $this->hasMany(Mfp_procurement_dia_release_commodity::class, 'mfp_procurement_id', 'id')->where('procurement_agent',Auth::user()->id); \n }",
"public function getActualOverheadServiceCharges(){\n return $this->hasMany(Overhead_service_charges::class, 'mfp_procurement_id', 'id'); \n }",
"public function acceso_procesamiento_datos(){\n\t\treturn $this->hasMany('App\\AccesoProcesamientoDatos', 'PDa_ID_Asp');\n\t}",
"public function fetchRelatedEagerReturnsEmptyArrayForEmptyRelationNotHasOne() {}",
"public function entity()\n {\n $data = $this->morphMany('\\ApprovalSequence\\Models\\Entity', 'entity')->get();\n $data = $data->map(function ($item) {\n return $item->entity;\n });\n return $data;\n }",
"public function incomingPaths()\n {\n return $this->hasMany(Path::class, 'last_node_id','id');\n }",
"public function objects() {\n \t// return call_user_func_array($this->belongsToMany('Object')->withPivot, static::$pivotColumns);\n return $this->belongsToMany('Object')\n ->withPivot('subdivision', 'time', 'place', 'form');\n }",
"protected function join_temporary_results($data)\n {\n $data = json_decode(json_encode($data), TRUE);\n if(array_key_exists($this->primary,$data))\n {\n $data = array($data);\n }\n foreach($this->_requested as $requested_key => $request)\n {\n $pivot_table = NULL;\n $relation = $this->_relationships[$request];\n $this->load->model($relation['foreign_model']);\n $foreign_key = $relation['foreign_key'];\n $local_key = $relation['local_key'];\n (isset($relation['pivot_table'])) ? $pivot_table = $relation['pivot_table'] : FALSE;\n $foreign_table = $relation['foreign_table'];\n $type = $relation['relation'];\n $relation_key = $relation['relation_key'];\n $local_key_values = array();\n foreach($data as $key => $element)\n {\n if(isset($element[$local_key]))\n {\n $id = $element[$local_key];\n $local_key_values[$key] = $id;\n }\n }\n if(!isset($pivot_table))\n {\n $sub_results = $this->{$relation['foreign_model']}->as_array()->where($foreign_key, $local_key_values)->get_all();\n }\n else\n {\n $this->_database->join($pivot_table, $foreign_table.'.'.$foreign_key.' = '.$pivot_table.'.'.singular($foreign_table).'_'.$foreign_key, 'right');\n $this->_database->join($this->table, $pivot_table.'.'.singular($this->table).'_'.$local_key.' = '.$this->table.'.'.$local_key,'right');\n $this->_database->where_in($this->table.'.'.$local_key,$local_key_values);\n $sub_results = $this->_database->get($foreign_table)->result_array();\n }\n\n if(isset($sub_results) && !empty($sub_results)) {\n $subs = array();\n foreach ($sub_results as $result) {\n $subs[$result[$foreign_key]][] = $result;\n }\n $sub_results = $subs;\n foreach($local_key_values as $key => $value)\n {\n if(array_key_exists($value,$sub_results))\n {\n if ($type == 'has_one')\n {\n $data[$key][$relation_key] = $sub_results[$value][0];\n }\n else\n {\n $data[$key][$relation_key] = $sub_results[$value];\n }\n }\n }\n }\n unset($this->_requested[$requested_key]);\n }\n if(sizeof($data)==1) $data = $data[0];\n return ($this->return_as == 'object') ? json_decode(json_encode($data), FALSE) : $data;\n }",
"private function processing_batch()\n\t{\n\t\t// load the sync db\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// find the most recent unprocessed shipments\n\t\t$query = ee()->sync_db->where('processed !=', '1')->order_by('id', 'asc')->get('orders_processed', 50);\n\n\t\t// create arrays for shipment ids and tracking numbers\n\t\t$ids_processed = array();\n\n\t\t// find our shipped status\n\t\t$status = Store\\Model\\Status::where('name', 'Processing')->first();\n\n\t\t// loop through each shipment\n\t\tforeach($query->result() as $processed)\n\t\t{\n\t\t\t// update the status of each order with the tracking numbers\n\t\t\t$order_object = Store\\Model\\Order::find($processed->order_id);\n\t\t\tif(!empty($order_object))\n\t\t\t{\n\t\t\t\t$order_object->updateStatus($status, 0, '');\n\t\t\t\t// add id to the processed array\n\t\t\t\t$ids_processed[] = $processed->id;\n\t\t\t}\n\t\t}\n\n\t\t// update the shipment records to indicate they've been processed\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('orders_processed');\n\t\t}\t\n\t\t\n\t}",
"public function devices(){\n return $this->belongsToMany('App\\Devices')->withTimestamps();\n }",
"public function to_process() {\n\t\tif ( false === $this->batches ) {\n\t\t\t$this->batches = $this->background_process->get_batches();\n\t\t}\n\n\t\t$to_process = array();\n\n\t\tif ( ! empty( $this->batches ) ) {\n\t\t\t$to_process = array_reduce(\n\t\t\t\t$this->batches,\n\t\t\t\tarray( $this, 'flatten_batches' ),\n\t\t\t\tarray()\n\t\t\t);\n\t\t}\n\n\t\treturn $to_process;\n\t}",
"public static function grabAllProc()\n {\n \n $Proc = Proc::all();\n\n $data = array();\n\n foreach ($Proc as $key => $value) {\n $data[$value->server_id][$key] = $value->to_array();\n \n unset($data[$value->server_id][$key]['created_at']);\n unset($data[$value->server_id][$key]['updated_at']);\n unset($data[$value->server_id][$key]['server_id']);\n unset($data[$value->server_id][$key]['proc_id']);\n }\n\n return $data;\n }",
"public function datos()\n {\n return $this->hasOne('App\\Models\\Dato', 'empleados_id');\n }",
"public function getDataForProcessing($id)\n {\n return $this->get($id, $this->processingDataBundle);\n }",
"public function getElementsCarrusel(){\n return $this->hasMany('App\\ElementCarrusel','id_circular');\n }",
"public function getMfpServiceChargesDIA(){\n return $this->hasMany(Mfp_procurement_service_charges_at_dia::class, 'mfp_procurement_id', 'id'); \n }",
"public function getRelatedCalls()\n {\n return $this->hasMany(Call::className(), ['callId' => 'relatedCallId'])->viaTable('relatedCalls', ['callId' => 'callId']);\n }"
] |
[
"0.6818332",
"0.5685901",
"0.56345814",
"0.56248415",
"0.5610246",
"0.5605989",
"0.5496923",
"0.5320384",
"0.5289723",
"0.5275004",
"0.52640355",
"0.52273566",
"0.51387936",
"0.5103989",
"0.5096579",
"0.50833035",
"0.5071364",
"0.50579613",
"0.5056978",
"0.5055313",
"0.5045224",
"0.503862",
"0.50262",
"0.5023489",
"0.5009042",
"0.5001098",
"0.50005925",
"0.49966356",
"0.4980775",
"0.4976626"
] |
0.8088869
|
0
|
(5.0) Get onetomany hasMany relationship bindings This device has many bindings
|
public function bindings()
{
return $this->hasMany('App\Binding', 'SOURCE_DEVICE_ID');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function deviceBindings()\n {\n return $this->hasMany('App\\Binding', 'TARGET_DEVICE_ID');\n }",
"public function getBindings(): array;",
"public function getBindings();",
"public function getBindings()\n {\n return $this->bindings;\n }",
"public function getBindings()\n {\n return $this->bindings;\n }",
"public function getBindings(): array\n {\n return $this->bindings;\n }",
"public function bindings();",
"protected function get_bindings(): array {\n\t\treturn [];\n\t}",
"public function getBinds(): array;",
"public function bindings(): array\n {\n return $this->bindings;\n }",
"public function onDevices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID')->where('ONLINE_FLAG',1);\n }",
"public function getWithRelations();",
"public static function getBindings(){\n //Method inherited from \\Illuminate\\Container\\Container \n return \\Illuminate\\Foundation\\Application::getBindings();\n }",
"public function getRelations();",
"public function getRelations();",
"public function getBindings()\n {\n $bindings = [];\n\n // We will run through all the bindings and pluck out\n // the component (select, where, etc.)\n foreach ($this->bindings as $component => $binding) {\n if (!empty($binding)) {\n // For every binding there could be multiple\n // values set so we need to add all of them as\n // flat $key => $value item in our $bindings.\n foreach ($binding as $key => $value) {\n $bindings[$key] = $value;\n }\n }\n }\n\n return $bindings;\n }",
"public function devices()\n {\n return $this->hasMany('SimulatorOperation\\Device');\n }",
"public function relations()\r\n {\r\n return $this->relations;\r\n }",
"public function products()\n {\n return $this->hasMany(ProductProxy::modelClass());\n }",
"public function relations()\n {\n return $this->belongsToMany(Product::class, 'product_relations', 'product_id', 'related_product_id')\n ->using(ProductRelation::class);\n }",
"public function SPOPtionRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany(SPOPtionRelation::class,'sp_id','sp_id');\n }",
"private function getAttachedKeysFromRelation($bind, string $name): ?array\n {\n if (!$bind instanceof Model) {\n return data_get($bind, $name);\n }\n\n $relation = $bind->{$name}();\n\n if ($relation instanceof BelongsToMany) {\n $relatedKeyName = $relation->getRelatedKeyName();\n\n return $relation->getBaseQuery()\n ->get($relation->getRelated()->qualifyColumn($relatedKeyName))\n ->pluck($relatedKeyName)\n ->all();\n }\n\n if ($relation instanceof MorphMany) {\n $parentKeyName = $relation->getLocalKeyName();\n\n return $relation->getBaseQuery()\n ->get($relation->getQuery()->qualifyColumn($parentKeyName))\n ->pluck($parentKeyName)\n ->all();\n }\n\n return data_get($bind, $name);\n }",
"public function buildRelations()\n {\n $this->addRelation('RemoteApp', 'Slashworks\\\\AppBundle\\\\Model\\\\RemoteApp', RelationMap::MANY_TO_ONE, array('remote_app_id' => 'id', ), 'CASCADE', 'CASCADE');\n }",
"public function getRepots()\n {\n return $this->hasMany(Repots::className(), ['id_hardware' => 'id']);\n }",
"public function getHasMany()\n {\n return $this->hasMany;\n }",
"public function relations() {\r\n\t\treturn CMap::mergeArray(parent::relations(), array(\r\n\t\t\t\"properties\" => array(self::HAS_MANY,\"APropertyModel\",\"classId\"),\r\n\t\t\t\"interfaces\" => array(self::MANY_MANY,\"AInterfaceModel\",\"classImplements(classId,implementsId)\"),\r\n\t\t));\r\n\t}",
"public function getRelations()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('relations');\n }",
"private function getBindingsCollection(): ?Collection\n\t{\n\t\treturn $this->entityObject->get($this->fieldNameMap->getBindings());\n\t}",
"protected static function _relations() {\n\n\t}",
"public function getBindingTypes();"
] |
[
"0.78350544",
"0.6617647",
"0.6470789",
"0.6238005",
"0.6238005",
"0.62075716",
"0.6124712",
"0.5982944",
"0.5962533",
"0.5947122",
"0.5929114",
"0.580984",
"0.5657321",
"0.565432",
"0.565432",
"0.563421",
"0.5592335",
"0.5545673",
"0.5531339",
"0.55156463",
"0.548749",
"0.5477601",
"0.5459673",
"0.5448425",
"0.5440906",
"0.54148185",
"0.5406129",
"0.5398103",
"0.5385446",
"0.5373303"
] |
0.76583666
|
1
|
(6.0) Get onetomany hasMany relationship deviceBindings This device has many bindings
|
public function deviceBindings()
{
return $this->hasMany('App\Binding', 'TARGET_DEVICE_ID');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function bindings()\n {\n return $this->hasMany('App\\Binding', 'SOURCE_DEVICE_ID');\n }",
"public function getBindings(): array;",
"public function getBindings();",
"public function getBindings()\n {\n return $this->bindings;\n }",
"public function getBindings()\n {\n return $this->bindings;\n }",
"public function getBindings(): array\n {\n return $this->bindings;\n }",
"public static function getBindings(){\n //Method inherited from \\Illuminate\\Container\\Container \n return \\Illuminate\\Foundation\\Application::getBindings();\n }",
"public function bindings(): array\n {\n return $this->bindings;\n }",
"public function getBindings()\n {\n $bindings = [];\n\n // We will run through all the bindings and pluck out\n // the component (select, where, etc.)\n foreach ($this->bindings as $component => $binding) {\n if (!empty($binding)) {\n // For every binding there could be multiple\n // values set so we need to add all of them as\n // flat $key => $value item in our $bindings.\n foreach ($binding as $key => $value) {\n $bindings[$key] = $value;\n }\n }\n }\n\n return $bindings;\n }",
"protected function get_bindings(): array {\n\t\treturn [];\n\t}",
"public function getPortBindings()\n {\n return $this->_portBindings;\n }",
"public function bindings();",
"public function getBinds(): array;",
"public function getAllBindings(): array\n {\n return array_merge(\n array_values($this->sockets),\n array_values($this->streams),\n array_values($this->signals),\n array_values($this->timers)\n );\n }",
"public function getBindings(int $scope): ?BindingsInterface;",
"public function onDevices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID')->where('ONLINE_FLAG',1);\n }",
"public function get_all_ip_binding(){\n return $this->query('/ip/hotspot/ip-binding/getall');\n }",
"public function devices()\n {\n return $this->hasMany('SimulatorOperation\\Device');\n }",
"protected function buildBindings(): void\n {\n $this->bindings = $this->fieldValueSet->getBoundValues();\n }",
"public function getBindingTypes();",
"public function getCardBindings(): array\n {\n return $this->data['CardBindingFileds'] ?? []; //ToDo: Check can be typo\n }",
"public function devices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID');\n }",
"private function getBindingsCollection(): ?Collection\n\t{\n\t\treturn $this->entityObject->get($this->fieldNameMap->getBindings());\n\t}",
"public function getSocketWriteBindings(): array\n {\n $output = [];\n\n foreach ($this->sockets as $id => $binding) {\n if ($binding->getIoMode() == 'w') {\n $output[$id] = $binding;\n }\n }\n\n return $output;\n }",
"public function getRootBindings();",
"private function registerBindings()\n {\n foreach($this->bindings as $key => $val)\n {\n $this->app->bind($key, $val);\n }\n }",
"public function getSocketBindings(): array\n {\n return $this->sockets;\n }",
"public function getSocketReadBindings(): array\n {\n $output = [];\n\n foreach ($this->sockets as $id => $binding) {\n if ($binding->getIoMode() == 'r') {\n $output[$id] = $binding;\n }\n }\n\n return $output;\n }",
"public function gateways()\n {\n return $this->hasMany('App\\Gateway', 'ROOM_ID');\n }",
"public function getRootBindingTypes();"
] |
[
"0.80228305",
"0.6950643",
"0.6945803",
"0.673735",
"0.673735",
"0.66765887",
"0.6172369",
"0.6127341",
"0.60674053",
"0.6041594",
"0.60259145",
"0.6004144",
"0.59774095",
"0.5907468",
"0.58646435",
"0.58139193",
"0.57626384",
"0.5698024",
"0.568741",
"0.5603176",
"0.5560675",
"0.54241747",
"0.5418953",
"0.53764504",
"0.53229994",
"0.5282134",
"0.5264916",
"0.52330285",
"0.521316",
"0.5188874"
] |
0.8713218
|
0
|
(7.0) Get columns that will be used for searching getSearchableColumns Note: Some columns may not be used for search queries, such as primary keys
|
public function getSearchableColumns()
{
return $this->searchableColumns;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function getSearchableColumns()\n {\n $columns = $this->getColumns();\n $searchable = [];\n\n foreach ($columns as $column) {\n if (!$column->searchable) {\n continue;\n }\n\n $searchable[] = $column;\n }\n\n return $searchable;\n }",
"public function searchColumns(): array\n {\n return $this->columns();\n }",
"public function searchColumns(): array\n {\n return $this->columns();\n }",
"protected function getSearchableColumns()\n {\n if ($this->searchableColumns != null) return $this->searchableColumns;\n $searchable = [];\n\n foreach ($this->searchColumns as $column) {\n if (empty($column->searchable)) {\n continue;\n }\n\n $searchable[] = $column;\n }\n $this->searchableColumns = $searchable;\n return $searchable;\n }",
"public static function searchableColumns()\n {\n return empty(static::$search)\n ? [static::newModel()->getKeyName()]\n : static::$search;\n }",
"private function searchableColumns()\n {\n return empty($this->searchables) ? array_diff($this->fillable, $this->hidden) : $this->searchables;\n }",
"public function getColumns()\n {\n return $this->allColumns ?: $this->defineListColumns();\n }",
"function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }",
"public function getSearchableColumns(): array\n {\n return array_filter($this->searchableFields);\n }",
"protected function getSearchColumns()\n {\n return [];\n }",
"function get_search_cols()\n {\n $columns = array(\n 'tag' => 'Shortcode Name',\n 'kind' => 'Kind',\n 'description' => 'Description',\n 'example' => 'Example',\n 'code' => 'Code',\n 'created_datetime' => 'Created Datetime'\n );\n return $columns;\n }",
"function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}",
"public function getColumns()\n\t{\n\t\t\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL COLUMNS FROM `$this->table`\"\n ));\n\n return $result;\n\t}",
"protected function getColumns() {\n $driver = $this->connection->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n\n // Calculate the driver class. Why don't they do this for us?\n $class = '\\\\Aura\\\\SqlSchema\\\\' . ucfirst($driver) . 'Schema';\n $schema = new $class($this->connection, new ColumnFactory());\n return array_keys($schema->fetchTableCols($this->table));\n }",
"public static function getColumns()\n {\n return array('libraryId', 'signature', 'summary', 'status', 'userId');\n }",
"public function getColumns()\n {\n if (! is_null($this->columns)) {\n return collect($this->columns);\n }\n\n return $this->columns = collect($this->rows->first())\n ->except(['created_at', 'updated_at', 'deleted_at', 'id'])\n ->keys();\n }",
"protected function get_default_search_columns()\n\t{\n\t\t$cols = parent::get_default_search_columns();\n\t\tif ($this->customfields && !isset($this->columns_to_search))\n\t\t{\n\t\t\t$cols[] = $this->extra_table.'.'.$this->extra_value;\n\t\t}\n\t\t//error_log(__METHOD__.\"() this->columns_to_search=\".array2string($this->columns_to_search).' returning '.array2string($cols));\n\t\treturn $cols;\n\t}",
"public function getColumns() {\n $columns = array();\n foreach($this->mapping as $key => $value) {\n array_push($columns, $value);\n }\n return $columns;\n }",
"public static function getColumns()\n {\n $type = static::getType();\n return $type::getColumns();\n }",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"protected function get_default_search_columns()\n\t{\n\t\t$skip_columns_with = array('_id', 'modified', 'modifier', 'status', 'cat_id', 'owner');\n\t\t$search_cols = is_null($this->columns_to_search) ? $this->db_cols : $this->columns_to_search;\n\t\t$numeric_types = array('auto', 'int', 'float', 'double');\n\n\t\t// Skip some numeric columns that don't make sense to search if we have to default to all columns\n\t\tif(is_null($this->columns_to_search))\n\t\t{\n\t\t\tforeach($search_cols as $key => &$col)\n\t\t\t{\n\t\t\t\t// If the name as given isn't a real column name, and adding the prefix doesn't help, skip it\n\t\t\t\tif(!$this->table_def['fd'][$col] && !($col = $this->prefix.array_search($col, $search_cols))) {\n\t\t\t\t\t// Can't search this column\n\t\t\t\t\tunset($search_cols[$key]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(in_array($this->table_def['fd'][$col]['type'], $numeric_types))\n\t\t\t\t{\n\t\t\t\t\tforeach($skip_columns_with as $bad)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(strpos($col, $bad) !== false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($search_cols[$key]);\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Prefix with table name to avoid ambiguity\n\t\t\t\t$col = $this->table_name.'.'.$col;\n\t\t\t}\n\t\t}\n\t\treturn $search_cols;\n\t}",
"public function getSpecificColumns()\n {\n return $this->_specificColumns;\n }",
"private function table_columns(){\n $column = array();\n $query = $this->db->select('column_name')\n ->from('information_schema.columns')\n ->where('table_name', $this::$table_name)\n ->get($this::$table_name)->result_array();\n //return individual table column\n foreach($query as $column_array){\n foreach($column_array as $column_name){\n $column[] = $column_name;\n }\n }\n return $column;\n }",
"public static function getColumns()\n {\n return array('title', 'bindingId', 'minYear', 'maxYear',\n 'preciseDate', 'placePublished', 'publisher', 'printVersion',\n 'firstPage', 'lastPage');\n }"
] |
[
"0.8265418",
"0.80336046",
"0.80336046",
"0.79569227",
"0.7913055",
"0.79040074",
"0.7783417",
"0.7748874",
"0.7734299",
"0.7717326",
"0.7707102",
"0.76645553",
"0.7622874",
"0.7516609",
"0.7506824",
"0.7500467",
"0.7496727",
"0.742829",
"0.7407835",
"0.73755383",
"0.73755383",
"0.73755383",
"0.73755383",
"0.73755383",
"0.73755383",
"0.73755383",
"0.7364946",
"0.7335204",
"0.731746",
"0.7303881"
] |
0.82982427
|
1
|
/ Smarty plugin File: function.calendar.php Type: function Name: calendar Purpose: outputs a calendar
|
function smarty_function_calendar($params, &$smarty)
{
// Start input validation
if (empty($params['url_format'])) {
trigger_error('mandatory param is empty: url_format', E_USER_ERROR);
}
if (empty($params['year'])) {
trigger_error('mandatory param is empty: year', E_USER_ERROR);
}
if (empty($params['month'])) {
trigger_error('mandatory param is empty: month', E_USER_ERROR);
}
// The 'day' param is optional.
// End input validation
$url_format = $params['url_format'];
$year = $params['year'];
$month = $params['month'];
$day = $params['day'];
if ($day != '') {
$selected_date = mktime(0, 0, 0, $month, $day, $year);
}
$prev_month_end = mktime(0, 0, 0, $month, 0, $year);
$next_month_begin = mktime(0, 0, 0, $month + 1, 1, $year);
$month_name = strftime('%B', mktime(0, 0, 0, $month, 1, $year));
$prev_month_abbrev = strftime('%b', $prev_month_end);
$prev_month_end_info = getdate($prev_month_end);
$prev_month = $prev_month_end_info['mon'];
$prev_month_year = $prev_month_end_info['year'];
$prev_month_url = strftime("$url_format", $prev_month_end);
$next_month_abbrev = strftime('%b', $next_month_begin);
$next_month_url = strftime("$url_format", $next_month_begin);
// TODO: make "week starts on" configurable: Monday vs. Sunday
$day_of_week_abbrevs = array();
for ($i = 0; $i < 7; $i++) {
$day_of_week_abbrevs[] =
smarty_function_calendar__day_of_week_abbrev($i);
}
// Build a two-dimensional array of UNIX timestamps.
$calendar = array();
// Start the first row with the final day(s) of the previous month.
$week = array();
$month_begin = mktime(0, 0, 0, $month, 1, $year);
$month_begin_day_of_week = strftime('%w', $month_begin);
$days_in_prev_month =
smarty_function_calendar__days_in_month($prev_month, $prev_month_year);
for ($day_of_week = 0;
$day_of_week < $month_begin_day_of_week;
$day_of_week++) {
$day = $days_in_prev_month - $month_begin_day_of_week + $day_of_week;
$week[] =
mktime(0, 0, 0, $month - 1, $day, $year);
}
// Fill in the days of the selected month.
$days_in_month =
smarty_function_calendar__days_in_month($month, $year);
for ($i = 1; $i <= $days_in_month; $i++) {
if ($day_of_week == 7) {
$calendar[] = $week;
// re-initialize $day_of_week and $week
$day_of_week = 0;
unset($week);
$week = array();
}
$week[] = mktime(0, 0, 0, $month, $i, $year);
$day_of_week++;
}
// Fill out the last row with the first day(s) of the next month.
for ($i = 1; $day_of_week < 7; $i++, $day_of_week++) {
$week[] = mktime(0, 0, 0, $month + 1, $i, $year);
}
$calendar[] = $week;
// Generate the URL for today, which will be null if $selected_date is
// today.
$today = getdate();
$today_date =
mktime(0, 0, 0, $today['mon'], $today['mday'], $today['year']);
if ($selected_date == $today_date) {
$today_url = '';
} else {
$today_url = strftime($url_format, $today_date);
}
/*
$calendar_smarty = new Smarty;
// Copy the configuration of the enclosing Smarty template.
$calendar_smarty->template_dir = $smarty->template_dir;
$calendar_smarty->compile_dir = $smarty->compile_dir;
$calendar_smarty->config_dir = $smarty->config_dir;
$calendar_smarty->plugins_dir = $smarty->plugins_dir;
$calendar_smarty->debugging = $smarty->debugging;
$calendar_smarty->compile_check = $smarty->compile_check;
$calendar_smarty->force_compile = $smarty->force_compile;
$calendar_smarty->cache_dir = $smarty->cache_dir;
$calendar_smarty->cache_dir = $smarty->cache_dir;
$calendar_smarty->cache_lifetime = $smarty->cache_lifetime;
*/
$smarty->assign('url_format', $url_format);
$smarty->assign('month_name', $month_name);
$smarty->assign('selected_date', $selected_date);
$smarty->assign('month', $month);
$smarty->assign('year', $year);
$smarty->assign('prev_month_end', $prev_month_end);
$smarty->assign('prev_month_abbrev', $prev_month_abbrev);
$smarty->assign('next_month_begin', $next_month_begin);
$smarty->assign('next_month_abbrev', $next_month_abbrev);
$smarty->assign('day_of_week_abbrevs', $day_of_week_abbrevs);
$smarty->assign('calendar', $calendar);
$smarty->assign('today_url', $today_url);
$smarty->display('calendar:month');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function DisplayCalendarOfEvents()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\techo \"<div id='calendar'></div>\";\t\r\n\t}",
"public function render()\r\n\t{\r\n\t\t$days = 1;\r\n\t\t$this->redirect = isset($this->redirect) ? $this->redirect: $this->getURL() ;\r\n\t\t$this->set_date();\r\n\t\t$total_days = cal_days_in_month(CAL_GREGORIAN, $this->month, $this->year);\r\n\t\t$first_spaces = date(\"w\", mktime(0, 0, 0, $this->month, 1, $this->year));\r\n\t\t$currentday = $this->UID('day');\r\n\r\n\t\tif (isset($this->inForm))\r\n\t\t{\r\n\t\t\t$CObjID = $this->UID('calendar');\r\n\t\t\t$DateString = ($this->Value()) ? '\",\"'.$this->Value() : '';\r\n\t\t\t$this->output = '<script language=\"javascript\">'.\"\\n\".'var '.$CObjID.' = new Calendar(\"'.$this->ID.$DateString.'\");'.\"\\n\"\r\n\t\t\t.$CObjID.'.currentDateStyle = \"'.$this->currentDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.selectedDateStyle = \"'.$this->selectedDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.normalDateStyle = \"'.$this->normalDateStyle.'\";'.\"\\n\"\r\n\t\t\t.$CObjID.'.setStyles();'.\"\\n\"\r\n\t\t\t.'</script>'.\"\\n\"\r\n\t\t\t.'<input type=\"hidden\" id=\"'.$CObjID.'\" name=\"'.$CObjID.'\" value=\"'.$this->Value().'\"/>'.\"\\n\";\r\n\t\t}\r\n\t\telse $this->output = '';\r\n\r\n\t\t$NavUrls = $this->url_params($this->UID('year'),$this->UID('month'),$this->UID('day'),array_keys($this->add_params_sel));\r\n\r\n\t\t$this->output.= '<table class=\"calendar\"><tr><td class=\"'.$this->navigateStyle.'\"><a id=\"'.$this->UID('navigateback').'\" class=\"'.$this->navigateStyle.'\" href=\"'.$this->getURL().\r\n\t\t\t'?'.$this->add_params_sel().'&'.$this->UID('month').'='.($this->month-1).'&'.$this->UID('year').'='.$this->year.$NavUrls.'\"><</a>\r\n\t\t </td><td id=\"'.$this->UID('Month').'\" colspan=\"5\" class=\"'.$this->monthStyle.'\">'.$this->RUS_MONTHS[date(\"n\", mktime(0, 0, 0, $this->month, 1, $this->year))-1].' '.$this->year.'\r\n\t\t </td><td class=\"'.$this->navigateStyle.'\"><a id=\"'.$this->UID('navigatenext').'\" class=\"'.$this->navigateStyle.'\" href=\"'.$this->getURL().'?'.$this->add_params_sel().'&'.$this->UID('month').'='.($this->month+1).'&'.$this->UID('year').'='.$this->year.$NavUrls.'\">></a>\r\n\t\t </td></tr><tr class=\"'.$this->daysOfTheWeekStyle.'\"><td>Ïí</td><td>Âò</td><td>Ñð</td><td>×ò</td><td>Ïò</td><td>Ñá</td><td>Âñ</td></tr>';\r\n\r\n \tfor ($Week=0;$Week<6;$Week++)\r\n \t{\r\n \t$this->output.= '<tr>';\r\n\r\n\t\t\t\tfor ($Day=0;$Day<7;$Day++)\r\n \t{\r\n\r\n\t\t\t\t\t$days++;\r\n\t\t\t\t\t$dDay = $days - $first_spaces;\r\n\t\t\t\t\t$norm_style = ($this->isDayAvailable($dDay))?$this->availDateStyle:$this->normalDateStyle;\r\n\t\t\t\t\t\r\n//\t\t\t\t\techo('dDay='.$dDay.'<br/>avail dates:');\r\n//\t\t\t\t\tforeach($this->availDates as $date)\r\n//\t\t\t\t\t\techo(date('d/m/Y',$date).'<br/>');\r\n\r\n\t\t\t\t\t$CellID = $this->UID('item['.$days.']');\r\n\r\n\t\t\t\t\tif ($days > $first_spaces && ($dDay) < $total_days + 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$LinkID = $this->UID('hlink['.$days.']');\r\n\t\t\t\t\t\t$currentSelectedDay = '<td id=\"'.$CellID.'\" class=\"'.$this->selectedDateStyle.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->selectedDateStyle.'\"';\r\n\t\t\t\t\t\t$CurrentDate = isset($_REQUEST[$currentday]) ? $_REQUEST[$currentday]: '';\r\n\r\n\t\t\t\t\t\tif ($CurrentDate == $dDay)\t$this->output.= $currentSelectedDay;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->output.='<td id=\"'.$CellID.'\" class=';\r\n\t\t\t\t\t\t\t$this->output.= ($dDay==date(\"j\") && $this->year==date(\"Y\") && $this->month==date(\"n\")) ?\r\n\t\t\t\t\t\t\t\t'\"'.$this->currentDateStyle.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->currentDateStyle.'\"' :\r\n\t\t\t\t\t\t\t\t'\"'.$norm_style.'\"><a id=\"'.$LinkID.'\" class=\"'.$this->normalDateStyle.'\"';\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif($this->isDayAvailable($dDay))\r\n\t\t\t\t\t\t\t$this->output.= 'href=\"'.$this->redirect.'?'.$this->add_params_day().'&'.$currentday.'='.$dDay.$this->url_params($currentday,array_keys($this->add_params_day)).'\">'.$dDay.'</a></td>';\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$this->output.= '>'.$dDay.'</a></td>';\r\n\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->output.='<td id=\"'.$CellID.'\" class=\"'.$this->normalDateStyle.'\"></td>'.\"\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->output.=\"</tr>\";\r\n \t}\r\n\r\n\t\t$this->output.= '</table>';\r\n\r\n\t\treturn $this->output;\r\n\t}",
"function output_calendar() // Generating calendar HTML content\r\n\t{\r\n\t\t# Apparently, it's not possible to dereference $this->callback()\r\n\t\t$cb = $this->callback;\r\n\r\n\t\t# Preliminary calculations\r\n\t\t$t = getdate(strtotime($this->date));\r\n\t\t$today = $t[\"mday\"];\r\n\t\t$year = $t[\"year\"];\r\n\t\t$month = $t[\"mon\"];\r\n\t\t# Get first day of the month (monday = 0)\r\n\t\t$first_wday = ((int) date(\"w\", mktime(0, 0, 0, $month, 1, $year))+6)%7;\r\n\t\t# Last day of the month\r\n\t\t$last_mday = (int) date(\"d\", mktime(0, 0, 0, $month+1, 0, $year));\r\n\r\n\t\t# Anchor\r\n\t\t//$this->content[].=\"<a name=\\\"calendar\\\">\";\r\n\r\n\t\t# Table\r\n\t\t$this->content[].=\"<table width=\\\"100%\\\" align=\\\"center\\\" cellpadding=\\\"0\\\" cellspacing=\\\"2\\\" class=\\\"calendar\\\">\\n\";\r\n\r\n\t\t# Table head\r\n\t\t$this->content[].=\"<tr><td colspan=\\\"7\\\" class=\\\"calendar_header\\\">{$this->month_name[$month - 1]} {$t['year']}</td></tr>\\n<tr>\\n\";\r\n\t\tfor ($j = 0;$j <= 6;$j++) {\r\n\t\t\t$this->content[].=\"<th class=\\\"calendar_title\\\">\";\r\n\t\t\t$this->content[].=\"{$this->day_name[$j]}\";\r\n\t\t\t$this->content[].=\"</th>\\n\";\r\n\t\t}\r\n\t\t$this->content[].=\"</tr>\\n\";\r\n\r\n\t\t// Day row\r\n\t\t// A month is displayed on 6 rows\r\n\t\t// except for a 28 days month starting on Monday\r\n\t\tif (($last_mday == 28) and ($first_wday == 0))\r\n\t\t$jmax = 27;\r\n\t\telse\r\n\t\t$jmax = 41;\r\n\r\n\t\tfor ($j = 0;$j <= $jmax;$j++) {\r\n\t\t\t# Start new row on Monday\r\n\t\t\tif ($j % 7 == 0)\r\n\t\t\t$this->content[].=\"<tr>\\n\";\r\n\r\n\t\t\t// Title colour for current day and checking week end days\r\n\r\n\t\t\tif (($j == $today+$first_wday-1) and ($j % 7 == 6)) // if today and weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_title_we\\\">\";\r\n\r\n\t\t\tif (($j % 7 == 6) and ($j != $today+$first_wday-1)) // if weekend day and not today\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_day_we\\\">\";\r\n\r\n\r\n\t\t\tif (($j == $today+$first_wday-1) and ($j % 7 != 6)) // if today and not weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_title\\\">\";\r\n\r\n\t\t\tif (($j % 7 != 6) and ($j != $today+$first_wday-1)) // if not today and not weekend day\r\n\t\t\t$this->content[].=\"<td class=\\\"calendar_day\\\">\";\r\n\r\n\t\t\tif (($j<$first_wday) or ($j>=$last_mday + $first_wday)) {\r\n\r\n\t\t\t\t# Empty boxes\r\n\t\t\t\t$this->content[].=\" \";\r\n\t\t\t} else {\r\n\t\t\t\tif (isset($cb))\r\n\t\t\t\techo $cb(mktime(0, 0, 0, $month, $j - $first_wday + 1, $year));\r\n\t\t\t\t$this->content[].=date($this->date_format, mktime(0, 0, 0, $month, $j - $first_wday + 1, $year));\r\n\t\t\t\tif (isset($cb))\r\n\t\t\t\t$this->content[].=\"</a>\\n\";\r\n\t\t\t}\r\n\t\t\t$this->content[].=\"</td>\\n\";\r\n\r\n\t\t\t# End of row on Sunday\r\n\t\t\tif ($j % 7 == 6)\r\n\t\t\t$this->content[].=\"</tr>\\n\";\r\n\t\t}\r\n\t\t$this->content[].=\"</table>\\n\";\r\n\t}",
"function calendar()\n{\n /*\n $groups = getAllEvents();\n $fieldsToConvert = [\"name\", \"description\", \"context\", \"status\"];\n $groups = specialCharsConvertFromAnArray($groups, $fieldsToConvert);\n displaydebug($groups);\n */\n require_once \"view/calendar.php\";\n}",
"function portal_dashboard_calendar_widget() {\n\n\techo portal_output_project_calendar();\n\n}",
"function calendar($url,$class='') {\n\n\tglobal $width;\n\tglobal $cell_width;\n\tglobal $legend_height;\n\tglobal $entry_color;\n\tglobal $entry_background_color;\n\tglobal $today_color;\n\tglobal $today_background_color;\n\tglobal $l_calendar;\n\tglobal $blog_script;\n\tglobal $lang;\n\tglobal $mysql_table;\n\t\n\tif ($_GET['date'] != '') {\n\t\t$MyDate = intval($_GET['date']);\n\t\t$year = substr($MyDate,0,4);\n\t\t$month = substr($MyDate,4,-2);\n\t} else {\n\t\t$month = date(\"n\");\n\t\t$year = date(\"Y\");\n\t}\n\t\n\t$prev = $month - 1;\n\t$next = $month + 1;\n\t$yearP = $year;\n\t$yearN = $year;\n\tif ($prev == \"0\") { $yearP--; $prev = \"12\"; }\n\tif ($prev < 10) $prev = '0'.$prev;\n\tif ($next == \"13\") { $yearN++; $next = \"1\"; }\n\tif ($next < 10) $next = '0'.$next;\n\n\t$transform_month = array(\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\");\n\t$into_month = array('Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre');\n\t\n\tfor ($l = 0; $l < 12; $l++) {\n\t\tif ($month == $transform_month[$l]) {\n\t\t\t$month_word = $into_month[$l];\n\t\t}\n\t}\n\n\t$output .= '<table style=\"width: '.$width.'; height: '.$legend_height.'\" class=\"'.$class.'\">\n\t<tr>\n\t\t<!--<td style=\"width: 10%; text-align: left;\"><a href=\"'.$url.'&date='.$yearP.$prev.'00\">«</a></td>-->\n\t\t<td colspan=\"7\"><b>'.strtoupper($month_word).' '.$year.'</b></td>\n\t\t<!--<td style=\"width: 10%; text-align: right;\"><a href=\"'.$url.'&date='.$yearN.$next.'00\">»</a></td>-->\n\t</tr>\n\t<tr align=\"center\">\n\t\t<td><b>L</b></td>\n\t\t<td><b>M</b></td>\n\t\t<td><b>M</b></td>\n\t\t<td><b>J</b></td>\n\t\t<td><b>V</b></td>\n\t\t<td><b>S</b></td>\n\t\t<td><b>D</b></td>\n\t</tr>\n\t<tr align=\"center\">';\n\t\n\t$no_days = date(\"t\", mktime(0, 0, 0, $month, 1, $year));\n\t$first_day = date(\"w\", mktime(0, 0, 0, $month, 1, $year));\n\t$today_day = date(\"j\");\n\t$today_month = date(\"n\");\n\t$today_year = date(\"Y\");\n\t\n\tif ($first_day == \"0\") $first_day = \"7\";\n\t\n\tfor ($i = 0; $i < $first_day-1; $i++) $output .= '<td style=\"width:'.$cell_width.';\"> </td>';\n\n\tfor ($i = 1; $i <= $no_days; $i++) {\n\t\t//$result = mysql_query(\"SELECT id FROM blog WHERE DAYOFMONTH(timestamp)='$i' AND MONTH(timestamp) = '$month' AND YEAR(timestamp) = '$year' ORDER BY id DESC;\");\n\t\t$selectDate = $year.$month.($i<10?'0'.$i:$i);\n\t\t$result = mysql_query(\"SELECT id FROM blog WHERE datepubli='$selectDate' LIMIT 1 \");\n\t\t$num = mysql_num_rows($result);\n\t\t//$res = mysql_fetch_array($result);\n\t\n\t\tif ($first_day == \"8\") { $first_day = \"1\"; $output .= '<tr style=\"width: '.$width.';\" align=\"center\">'; }\n\t\tif ($i < 10) $space = ' '; else $space = '';\n\t\n\t\tif ($i == $today_day && $month == $today_month && $year == $today_year) \n\t\t\t$style = 'background-color: '.$today_background_color.'; color: '.$today_color.'; font-weight: bold;';\n\t\telse $style = '';\n\t\tif (intval($_GET['date']) == $selectDate) $style .= 'border:1px solid #000000;';\n\t\t\n\t\tif ($num < 1) $output .= '<td style=\"'.$style.' width: '.$cell_width.';\">'.$i.'</td>';\n\t\telse $output .= '<td style=\"background-color:'.$entry_background_color.';'.$style.'width: '.$cell_width.';color: '.$entry_color.';\"><a href=\"'.$url.'&date='.$selectDate.'\" style=\"color: '.$today_color.'\" title=\"Voir le sujet posté à cette date\">'.$i.'</a></td>';\n\t\t\n\t\tif ($first_day == \"7\") $output .= '</tr>';\n\t\t$first_day++;\n\t}\n\t\n\t$output .= '</table>';\n\t\n\treturn $output;\n\n}",
"function portal_return_calendar_template() {\n\treturn portal_template_hierarchy( 'dashboard/components/calendar/index.php' );\n}",
"function get_calendar($initial = \\true, $display = \\true)\n {\n }",
"public function calendar()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'calendar');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | Calendar')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/calendar');\n }",
"public function getCalendar() {\n\t\t$this->setDate();\n\t\t$this->getLinks();\n\t\t $this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\n\n\t\t// Get new date array\n\t\t$newDate = getdate(mktime(0,0,0,$this->newMonth, 1, $this->newYear));\n\t\t// Calculate rest days in previous and next month\n\t\t$firstDay = $newDate['wday'];\n\t\t$firstDay = ($firstDay == 0) ? 7: $firstDay;\n\t\t$daysInMonth = cal_days_in_month ( CAL_GREGORIAN , $this->newMonth , $this->newYear );\n\t\tif($this->newMonth != 1){\n\t\t\t$daysInPrevMonth = cal_days_in_month ( CAL_GREGORIAN , $this->newMonth-1 , $this->newYear );\n\t\t}\n\t\telse if($this->newMonth == 1) {\n\t\t\t$daysInPrevMonth = cal_days_in_month ( CAL_GREGORIAN , 12 , $this->newYear-1 );\n\t\t}\n\n\t\t$lastDates = $daysInPrevMonth - $firstDay +1;\n\n\t\t// Start building table\n\t\t$table =\"<section class='calendar'><header>\" . $this->prevLink . \"<h3>\" . $newDate['month'] . \" - \" . $newDate['year'] . \"</h3>\" . $this->nextLink;\n\t\t$table .= \"</header><table><thead>\\n\";\n\t\t$table .= \"<th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th><th>Sun</th>\\n\";\n\t\t$table .= \"</thead>\\n\";\n\t\t$table .= \"<tr>\";\n\t\t\n\t\tfor ($a=1; $a < $firstDay ; $a++) { \n\t\t\t$lastDates++;\n\t\t\t$table .= \"<td class='lighter'>\" . $lastDates . \"</td>\";\n\t\t}\n\n\t\t$d = 0;\n\t\tfor ($b=0; $b < $daysInMonth ; $b++) { \n\t\t\t\n\t\t\t$d++;\n\t\t\t$DATE = date('N',mktime(0,0,0, $this->newMonth, $d, $this->newYear));\n\t\t\t\n\t\t\tif ($DATE == 1) {\n\t\t\t\t$table .= \"</tr>\\n<tr>\";\n\t\t\t}\n\n\t\t\tif (($this->newMonth == $this->currentMonth && $d == $this->currentDate && $this->newYear == $this->currentYear)) {\n\t\t\t\t$table .= \"<td><strong>\" . $d . \"</strong></td>\";\n\t\t\t}\n\t\t\telse if ($DATE == 7) {\n\t\t\t\t$table .= \"<td class='red'>\" . $d . \"</td>\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$table .= \"<td>\" . $d . \"</td>\";\n\t\t\t}\n\t\t}\n\t\t\tif ($DATE != 7) {\n\t\t\t\t$nextMonthDays = 7 - $DATE;\n\t\t\t\tfor ($c=1; $c <= $nextMonthDays ; $c++) { \n\t\t\t\t\t$table .= \"<td class='lighter'>\" . $c . \"</td>\";\n\t\t\t}\n\t}\n\t\t$table .= \"</tr></table></section>\";\n\n\t\treturn $table;\n\t}",
"function render_block_core_calendar($attributes)\n {\n }",
"protected function build_calendar()\n\t{\n\t\t//ee()->TMPL->log_item('Calendar: Building calendar output');\n\n\t\t$disable\t= array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$this->CDT->reset();\n\t\t$today_ymd\t= $this->CDT->ymd;\n\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Channel get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Collect important bits of tagdata\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Collecting tagdata');\n\n\t\t$output_at\t= '';\n\t\t$tagdata\t= ee()->TMPL->tagdata;\n\t\t$each_year\t= $each_month = $each_week = $each_day = $each_hour = $each_event = '';\n\t\t$hash_event\t= 'd38bf16a9a74c63fa5eb6d1ac082d539'.\"\\n\";\n\t\t$hash_hour\t= 'fe16402ccfad7e120a7ca3a31df3a019'.\"\\n\";\n\t\t$hash_day\t= '2aa2a1a0724182b1d876232c137a6d4f'.\"\\n\";\n\t\t$hash_week\t= 'b657210371b3e2a6f955ef6a404689de'.\"\\n\";\n\t\t$hash_month\t= 'd03207661c36a3bfd43b9dd239e41676'.\"\\n\";\n\t\t$hash_year\t= '97a92770ab082652cf662bdacc311dff'.\"\\n\";\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD .\n\t\t\t\t\t\"(.+?)\" .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\t$tagdata \t\t\t\t\t\t= str_replace( $match[0], '', $tagdata );\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Replace days of the week first, cuz they're easy\n\t\t// -------------------------------------\n\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day_of_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/' . LD . 'display_each_day_of_week' . RD .\n\t\t\t\t\t'(.*?)' .\n\t\t\t\tLD . preg_quote(T_SLASH, '/') . 'display_each_day_of_week' . RD . '/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$dow_output\t\t= '';\n\t\t\t\t$vars\t\t\t= array();\n\t\t\t\t$current_dow\t= $this->CDT->day_of_week;\n\n\t\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\t\tif ($this->CDT->day_of_week != $this->first_day_of_week)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(\n\t\t\t\t\t\t$this->first_day_of_week - $this->CDT->day_of_week\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tfor ($i = 0; $i < 7; $i++)\n\t\t\t\t{\n\t\t\t\t\tif ($i > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->add_day();\n\t\t\t\t\t}\n\n\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t'day_of_week_is_weekend'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t$this->CDT->day_of_week == 6\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'day_of_week_is_current'\t=> (\n\t\t\t\t\t\t\t$this->CDT->day_of_week == $current_dow\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t'day_of_week'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'l'),\n\t\t\t\t\t\t'day_of_week_one'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'b'),\n\t\t\t\t\t\t'day_of_week_short'\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'D'),\n\t\t\t\t\t\t'day_of_week_N'\t\t\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'N'),\n\t\t\t\t\t\t'day_of_week_number'\t=> $this->cdt_format_date_string($this->CDT->datetime_array(), 'w')\n\t\t\t\t\t);\n\n\t\t\t\t\t$dow_output .= $this->swap_vars($vars, $match[1]);\n\t\t\t\t}\n\t\t\t\t$tagdata = str_replace($match[0], $dow_output, $tagdata);\n\t\t\t}\n\t\t}\n\n\t\t$tagdata = trim($tagdata).\"\\n\";\n\n\t\t// -------------------------------------\n\t\t// Now the rest\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->var_pair['events']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'events'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'events'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_event \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_event, $tagdata);\n\t\t\t\tee()->TMPL->tagdata = $each_event;\n\t\t\t\t$output_at \t\t\t= 'event';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_hour']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_hour'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_hour'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_hour \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_hour, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'hour';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_day']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_day'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_day'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_day \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_day, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'day';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_week']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_week'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_week'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_week \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_week, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'week';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_month']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_month'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_month'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_month \t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_month, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'month';\n\t\t\t}\n\t\t}\n\n\t\tif (isset(ee()->TMPL->var_pair['display_each_year']))\n\t\t{\n\t\t\tpreg_match(\n\t\t\t\t'/'.LD.'display_each_year'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').'display_each_year'.RD.'/s',\n\t\t\t\t$tagdata,\n\t\t\t\t$match\n\t\t\t);\n\n\t\t\tif (isset($match[1]))\n\t\t\t{\n\t\t\t\t$each_year \t\t\t= trim($match[1]).\"\\n\";\n\t\t\t\t$tagdata \t\t\t= str_replace($match[0], $hash_year, $tagdata);\n\t\t\t\t$output_at \t\t\t= 'year';\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If there aren't any display_each_X var pairs, default to event\n\t\t// -------------------------------------\n\n\t\tif ($output_at == '')\n\t\t{\n\t\t\t$each_event \t= $tagdata;\n\t\t\t$tagdata \t\t= $hash_event;\n\t\t\t$output_at \t\t= 'event';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Set the default date to the start of our range\n\t\t// -------------------------------------\n\n\t\t$start_blank = (\n\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE\n\t\t);\n\n\t\t$start\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_start', 'year'),\n\t\t\t$this->P->value('date_range_start', 'month'),\n\t\t\t$this->P->value('date_range_start', 'day'),\n\t\t\t$this->P->value('date_range_start', 'hour'),\n\t\t\t$this->P->value('date_range_start', 'minute')\n\t\t);\n\n\t\t$end\t= $this->CDT->change_datetime(\n\t\t\t$this->P->value('date_range_end', 'year'),\n\t\t\t$this->P->value('date_range_end', 'month'),\n\t\t\t$this->P->value('date_range_end', 'day'),\n\t\t\t($start_blank ? '23' : $this->P->value('date_range_end', 'hour')),\n\t\t\t($start_blank ? '59' : $this->P->value('date_range_end', 'minute'))\n\t\t);\n\n\t\t$current_period_start\t= $start;\n\t\t$current_period_end\t\t= $end;\n\n\t\t$this->CDT->set_default($start);\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// If we are \"padding\" short weeks, modify our dates\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the start date backward to the first day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$old_end = $end;\n\n\t\t\tif ($start['day_of_week'] != $this->first_day_of_week)\n\t\t\t{\n\t\t\t\t$offset = ($start['day_of_week'] > $this->first_day_of_week) ?\n\t\t\t\t\t$start['day_of_week'] - $this->first_day_of_week :\n\t\t\t\t\t7 - ($this->first_day_of_week - $start['day_of_week']);\n\n\t\t\t\t$start \t= $this->CDT->add_day(-$offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Adjust the end date forward to the last day of the week, if necessary\n\t\t\t// -------------------------------------\n\n\t\t\t$last_dow = ($this->first_day_of_week > 0) ? $this->first_day_of_week - 1 : 6;\n\n\t\t\tif ($end['day_of_week'] != $last_dow)\n\t\t\t{\n\t\t\t\t$this->CDT->change_ymd($end['ymd']);\n\t\t\t\t$offset = ($end['day_of_week'] > $last_dow) ?\n\t\t\t\t\t7 - ($end['day_of_week'] - $last_dow) :\n\t\t\t\t\t$last_dow - $end['day_of_week'];\n\n\t\t\t\t$end \t= $this->CDT->add_day($offset);\n\t\t\t\t$this->CDT->reset();\n\t\t\t}\n\n\t\t\t$end['time']\t= $old_end['time'];\n\t\t\t$end['hour']\t= $old_end['hour'];\n\t\t\t$end['minute']\t= $old_end['minute'];\n\n\t\t\t$this->CDT->set_default($start);\n\t\t\t$this->P->set('date_range_start', $start);\n\t\t\t$this->P->set('date_range_end', $end);\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range start: '. $this->P->value('date_range_start', 'ymd'));\n\n\t\t//ee()->TMPL->log_item('Calendar: Date range end: '. $this->P->value('date_range_end', 'ymd'));\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t/*$category = FALSE;\n\n\t\tif (isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}*/\n\n\t\t$ids \t\t\t= $this->data->fetch_event_ids($this->P /*, $category*/);\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Fetching events. ' . count( $ids ) . ' events were found.');\n\n\t\t$entry_data \t= array();\n\t\t$events \t\t= array();\n\n\t\t// -------------------------------------\n\t\t// No events? You really need to work on your social calendar...\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// If they used a no_results tag, let 'em have it\n\t\t\t// -------------------------------------\n\n\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, going home');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() No results, but staying around for the show');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// We only care about this stuff if:\n\t\t\t// \t* there's an {event}{/event} tag pair\n\t\t\t// \t* thar be one or more xxx_has_events variables\n\t\t\t// -------------------------------------\n\n\t\t\tif ($each_event != '' OR strpos(ee()->TMPL->tagdata, '_event_total') !== FALSE)\n\t\t\t{\n\t\t\t\twhile (TRUE)\n\t\t\t\t{\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Firing up the ol Channel Module to try and process ' . count( $ids ) . ' events.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch occurrence info\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$occurrence_ids = $this->data->fetch_occurrence_entry_ids($ids);\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() ' . count( $occurrence_ids ) . ' occurrences were found.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the entry_id of the occurrence doesn't match the entry_id\n\t\t\t\t\t// of the entry, we need to fetch the occurrence data separately\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($occurrence_ids as $id => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($data as $oid => $o_entry_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($id != $o_entry_id)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ids[$o_entry_id] = $id; //$o_entry_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t\t\t\t// we will process later.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$var_dates = array(\n\t\t\t\t\t\t'event_start_date' \t=> FALSE,\n\t\t\t\t\t\t'event_start_time' \t=> FALSE,\n\t\t\t\t\t\t'event_end_date' \t=> FALSE,\n\t\t\t\t\t\t'event_end_time' \t=> FALSE\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$var_dates[$name][$k] \t\t= $v;\n\t\t\t\t\t\t\t\tee()->TMPL->var_single[$k] \t= $k;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tInvoke Channel class\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\tif ( ! class_exists('Channel') )\n\t\t\t\t\t{\n\t\t\t\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel = new Channel();\n\n\t\t\t\t\t//need to remove limit here so huge amounts of events work\n\t\t\t\t\t$channel->limit = 1000000;\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare parameters\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagparams['entry_id'] = implode('|', array_keys($ids));\n\n\t\t\t\t\tif ($this->P->value('enable') != FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (is_array($this->P->value('enable')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, $this->P->value('enable')));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tee()->TMPL->tagparams['disable'] = implode('|', array_diff($disable, array($this->P->value('enable'))));\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\tee()->TMPL->tagparams['disable'] = implode('|', $disable);\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Pre-process related data\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data( ee()->TMPL->tagdata );\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\t\t\t\t$each_event\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tee()->TMPL->var_single \t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Execute needed methods\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$channel->fetch_custom_channel_fields();\n\n\t\t\t\t\t$channel->fetch_custom_member_fields();\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Pagination Tags Parsed Out\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Querification\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//for some reason without this in EE 2.8.x\n\t\t\t\t\t//pagination has some sort of dynamic detection\n\t\t\t\t\t//that it didn't in EE 2.7 and below and hoses our\n\t\t\t\t\t//pagination setup because we are doing it\n\t\t\t\t\t//manually later as this is just data gathering\n\t\t\t\t\t//for events.\n\t\t\t\t\tif (\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.8.0', '>=') &&\n\t\t\t\t\t\tisset($channel->pagination)\n\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->pagination->paginate = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->build_sql_query();\n\n\t\t\t\t\tif ($channel->sql == '')\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel query empty');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\t\t\t\tif ($channel->query->num_rows == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Channel Module returned no results');\n\n\t\t\t\t\t\tif (ee()->TMPL->no_results != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->no_results();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module found ' . $channel->query->num_rows . ' results.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Trim IDs and build events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$new_ids = array();\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t\t\t\t}\n\n\t\t\t\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Turn these IDs into events\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$events = array();\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Beginning event creation process.');\n\n\t\t\t\t\tif ( ! class_exists('Calendar_event'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t\t\t\t}\n\n\t\t\t\t\t$calendars = array();\n\n\t\t\t\t\tforeach ($event_data as $k => $edata)\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp = new Calendar_event(\n\t\t\t\t\t\t\t$edata,\n\t\t\t\t\t\t\t$this->P->params['date_range_start']['value'],\n\t\t\t\t\t\t\t$this->P->params['date_range_end']['value']\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp->prepare_for_output();\n\t\t\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation resulted in the creation of ' . count( $events ) . ' events.');\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Event creation process finished.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Leaving so soon?\n\t\t\t\t\t// There's no point in continuing if we're just interested\n\t\t\t\t\t// in whether or not there are events on this day.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (array_keys($events) as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$entry_data[$id] = $id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because $each_event variable was empty string. ' . count( $entry_data ) . ' events were found and logged into the $entry_data array.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Nor should we stay around if there's nothing to process\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\telseif (empty($calendars))\n\t\t\t\t\t{\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Skipping further channel module processing because there were no calendars connected to the events found.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Fetch information about the calendars\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare the tagdata that will be parsed by the channel module\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$blargle = '3138ad2081984be5dea40e593fd61f87';\n\t\t\t\t\t$bleegle = '6f8de301e6e6f2cd80ad99aa3a765b31';\n\t\t\t\t\t//ee()->TMPL->tagdata = $blargle . '[' . LD . \"entry_id\" . RD . ']' . $each_event . $bleegle;\n\t\t\t\t\tee()->TMPL->tagdata = $blargle .\n\t\t\t\t\t\t'[' . LD . \"entry_id\" . RD . ']' .\n\t\t\t\t\t\tee()->TMPL->tagdata .\n\t\t\t\t\t\t$bleegle;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prep variable aliases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$variables = array(\n\t\t\t\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t\t\t\t'author'\t\t=> 'event_author',\n\t\t\t\t\t\t'status'\t\t=> 'event_status'\n\t\t\t\t\t);\n\n\t\t\t\t\t//custom variables with the letters 'url' are borked in\n\t\t\t\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t\t\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\t\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t\t);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// --------------------------------------------\n\t\t\t\t\t// Typography\n\t\t\t\t\t// --------------------------------------------\n\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t\tee()->typography->initialize();\n\t\t\t\t\tee()->typography->convert_curly = FALSE;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Add variables to the query result\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($channel->query->result as $k => $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ? $row['screen_name'] : $row['username'];\n\n\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar:build_calendar() We\\'re in the channel query result loop. Entry id is ' . $entry_id );\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Skip this result if the event data doesn't exist\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$ids[$entry_id]]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] \t= FALSE;\n\t\t\t\t\t\t$channel->query->result[$k]['event_parent_id']\t\t= ($ids[$entry_id] == $entry_id) ? 0 : $ids[$entry_id];\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// If this entry_id is not in the $events array, this is an edited occurrence\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif (! isset($events[$entry_id]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add this info to the $events array\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$events[$entry_id] = clone $events[$ids[$entry_id]];\n\n\t\t\t\t\t\t\t$channel->query->result[$k]['edited_occurrence'] = TRUE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Correct the info\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($events[$entry_id]->occurrences as $ymd => $times)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($times as $time => $data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($data['entry_id'] != $entry_id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tunset($events[$entry_id]->occurrences[$ymd][$time], $events[$entry_id]->dates[$ymd][$time]);\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{\n\t\t\t\t\t\t\t\t\t\tunset($events[$data['event_id']]->occurrences[$ymd][$time], $events[$data['event_id']]->dates[$ymd][$time]);\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// NOTE: Requires PHP >= 5.1.0\n\t\t\t\t\t\t\t$events[$entry_id]->dates = array_intersect_key($events[$entry_id]->dates, $events[$entry_id]->occurrences);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Alias\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($variables as $old => $new)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($old == 'title')\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$old]\t= ee()->typography->parse_type(\n\t\t\t\t\t\t\t\t\t$channel->query->result[$k][$old],\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'text_format' \t=> 'lite',\n\t\t\t\t\t\t\t\t\t\t'html_format' \t=> 'none',\n\t\t\t\t\t\t\t\t\t\t'auto_links' \t=> 'n',\n\t\t\t\t\t\t\t\t\t\t'allow_img_url' => 'no'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k][$new]\t= $channel->query->result[$k][$old];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Calendar variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tRedeclare\n\t\t\t\t\t//\t----------------------------------------\n\t\t\t\t\t//\tWe will reassign the $channel->query->result with our\n\t\t\t\t\t//\treordered array of values. Thank you PHP for being so fast with array loops.\n\t\t\t\t\t//\t----------------------------------------\n\n\t\t\t\t\t$super_temp_fake = $channel->query->result_array = $channel->query->result;\n\n\t\t\t\t\t$channel->fetch_categories();\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Handle {title} and {event_title} differently\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\tee()->TMPL->tagdata\t= str_replace(\n\t\t\t\t\t\tLD . 'event_title' . RD,\n\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . LD . 'entry_id' . RD,\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"ignore\" prefixes\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\t\t'calendar_ignore_',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Parse Weblog stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing Weblog stuff');\n\n\t\t\t\t\t$channel->parse_channel_entries();\n\n\t\t\t\t\tforeach ($super_temp_fake as $k => $data)\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->return_data = str_replace(\n\t\t\t\t\t\t\t'6c21bdf1bfdab13bc8df8fcfeb2763a6' . $data['entry_id'],\n\t\t\t\t\t\t\t$super_temp_fake[$k]['title'],\n\t\t\t\t\t\t\t$channel->return_data\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Related entries\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries');\n\n\t\t\t\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t\t\t\t{\n\t\t\t\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_related_entries();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Collect the parsed data for use later\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tpreg_match_all('/' . $blargle . '\\[(\\d+)\\](.*?)' . $bleegle . '/s', $channel->return_data, $matches);\n\t\t\t\t\tforeach ($matches[0] as $k => $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$entry_data[$matches[1][$k]] = $matches[2][$k];\n\t\t\t\t\t}\n\n\t\t\t\t\tunset($channel);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Stop the insanity!\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//ee()->TMPL->log_item('Calendar:build_calendar() Channel module stuff done');\n\n\t\t// -------------------------------------\n\t\t// Build the calendar\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Starting to build the calendar');\n\n\t\t$start_year\t\t= $start['year'];\n\t\t$start_month\t= $start['month'];\n\t\t$start_day\t\t= $start['day'];\n\t\t$end_year\t\t= $end['year'];\n\t\t$end_month\t\t= $end['month'];\n\t\t$end_day\t\t= $end['day'];\n\t\t$w\t\t\t\t= 0;\n\n\t\t$this->CDT->reset();\n\n\t\tif ($this->P->value('pad_short_weeks') === TRUE)\n\t\t{\n\t\t\t$week_counter = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$week_counter = ($this->CDT->day_of_week >= $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t7 + $this->CDT->day_of_week - $this->first_day_of_week;\n\t\t}\n\n\t\t$output = '';\n\t\t$week_temp = $month_temp = $year_temp = '';\n\t\t$day_count = 0;\n\n\t\t$next_CDT = $prev_CDT = $start;\n\n\t\t$all_day = array();\n\t\t$event_array = array();\n\n\t\t// -------------------------------------\n\t\t// Prepare the events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Preparing events');\n\n\t\tforeach ($events as $id => $event)\n\t\t{\n\t\t\t//prevent missing entry data from attempting to display and causing errors\n\t\t\tif ( ! isset($entry_data[$event->default_data['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($events[$id]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (empty($event->dates))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($event->dates as $ymd => $items)\n\t\t\t{\n\t\t\t\tforeach ($items as $time => $ddata)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// It was over before it started\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['end_date']['ymd'].$ddata['end_date']['time'] <\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// ...or the inverse\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'].$ddata['date']['time'] >\n\t\t\t\t\t\t $this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t $this->P->value('time_range_end', 'time'))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If the start date of the event is less than the first\n\t\t\t\t\t// day of the calendar, we've got ourselves a hangover.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($ddata['date']['ymd'] < $this->P->value('date_range_start', 'ymd'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$this->P->value('date_range_start', 'ymd')]['all_day'][$id]\t= $id;\n\t\t\t\t\t\t$events[$id]->dates[$this->P->value('date_range_start', 'ymd')]\t\t\t\t= $events[$id]->dates[$ymd];\n\t\t\t\t\t}\n\t\t\t\t\telseif ($ddata['all_day'] === TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ddata['multi_day'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$event_array[$ymd]['all_day'][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$start_hour\t= str_pad($ddata['date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$start_min\t= str_pad($ddata['date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_hour\t= str_pad($ddata['end_date']['hour'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$end_min\t= str_pad($ddata['end_date']['minute'], 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t$event_array[$ymd][$start_hour][$start_min][$end_hour][$end_min][$id] = $id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t// -------------------------------------\n\t\t\t// Aliases\n\t\t\t// -------------------------------------\n\n\t\t\t$events[$id]->default_data['first_date']\t= $events[$id]->default_data['start_date'];\n\t\t}\n\n\t\t$this->CDT->reset();\n\n\t\t// -------------------------------------\n\t\t// Prune the event array, if there's an event limit.\n\t\t// NOTE: apply_event_limit() also sorts the array for us.\n\t\t// -------------------------------------\n\n\t\t//--------------------------------------------\n\t\t//\tcount all events for tag and pagination\n\t\t//--------------------------------------------\n\n\t\t$this->event_timeframe_total = $this->count_event_results($event_array);\n\n\t\t//--------------------------------------------\n\t\t//\tpagination\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\tif ($this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> $tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_build_calendar_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_build_calendar_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//$tagdata\t\t\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$offset = (\n\t\t\tee()->TMPL->fetch_param('event_offset') ?\n\t\t\t\tee()->TMPL->fetch_param('event_offset') :\n\t\t\t\t0\n\t\t);\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\t\t$event_array = $this->apply_event_limit(\n\t\t\t$event_array,\n\t\t\t$this->P->value('event_limit'),\n\t\t\t$offset\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Loopage\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Beginning date loops');\n\n\t\t$week_event_count\t= 0;\n\t\t$event_count\t\t= 0;\n\t\t$year_tick\t\t\t= 0;\n\t\t$month_tick\t\t\t= 0;\n\n\t\tfor ($y = $start_year; $y <= $end_year; $y++)\n\t\t{\n\t\t\t$year_event_count = 0;\n\n\t\t\t//blank out\n\t\t\t$this->counted['year'] = array();\n\n\t\t\t$mx = ($y == $start_year) ? $start_month : 1;\n\t\t\t$my = ($y == $end_year) ? $end_month : 12;\n\n\t\t\t$year_ymd_cache = $this->CDT->ymd;\n\n\n\t\t\tfor ($m = $mx; $m <= $my; $m++)\n\t\t\t{\n\t\t\t\t$month_ymd_cache \t= $this->CDT->ymd;\n\n\n\t\t\t\t$month_event_count = 0;\n\n\t\t\t\t//blank out\n\t\t\t\t$this->counted['month'] = array();\n\n\t\t\t\t$dx = ($y == $start_year AND $m == $start_month) ?\n\t\t\t\t\t\t$start_day :\n\t\t\t\t\t\t1;\n\n\t\t\t\t$dy = ($y == $end_year AND $m == $end_month) ?\n\t\t\t\t\t\t$end_day :\n\t\t\t\t\t\t$this->CDT->days_in_month($m, $y);\n\n\t\t\t\tfor ($d = $dx; $d <= $dy; $d++)\n\t\t\t\t{\n\t\t\t\t\t$day_ymd_cache \t= $this->CDT->ymd;\n\t\t\t\t\t$day_tick\t\t= 0;\n\n\t\t\t\t\t$this->CDT->change_date($y, $m, $d);\n\t\t\t\t\t$this->CDT->set_default($this->CDT->date_array());\n\n\t\t\t\t\t$ymd = $this->CDT->ymd;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Prepare counts and totals, also\n\t\t\t\t\t// altered later in the loop in some cases\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_event_count = 0;\n\t\t\t\t\t$day_event_total = 0;\n\n\t\t\t\t\t//blank out\n\t\t\t\t\t$this->counted['day'] = array();\n\n\t\t\t\t\tif (! isset($event_array[$ymd])) $event_array[$ymd] = array();\n\n\t\t\t\t\t$day_event_total\t= $this->count_events(\n\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t$event_array,\n\t\t\t\t\t\t$all_day,\n\t\t\t\t\t\t'day',\n\t\t\t\t\t\t$events\n\t\t\t\t\t);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Start events for the day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Beginning ' . $ymd . count( $event_array[$ymd] ) . ' events for this day.');\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// This looks a little goofy, but it\n\t\t\t\t\t// prevents extra years/months\n\t\t\t\t\t// showing up thanks to padded weeks\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$day_count++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Week stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($week_counter % 7 == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//blank out\n\t\t\t\t\t\t$this->counted['week'] = array();\n\n\t\t\t\t\t\t$w = str_pad($this->CDT->week_number, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t}\n\n\t\t\t\t\t$week_counter++;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"next\" stuff\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$next_y = ($m == 12 AND $d == 31) ? $y+1 : $y;\n\t\t\t\t\t$next_m = ($d == $this->CDT->days_in_month()) ? $m + 1 : $m;\n\t\t\t\t\t$next_w = ($week_counter % 7 == 0) ? $w + 1 : $w;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Yodelers of Mass Destruction\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$find\t\t\t= '';\n\t\t\t\t\t$replace\t\t= '';\n\t\t\t\t\t$hour_events\t= array();\n\t\t\t\t\t$last_day\t\t= (\n\t\t\t\t\t\t$y == $end_year AND\n\t\t\t\t\t\t$m == $end_month AND\n\t\t\t\t\t\t$d == $end_day\n\t\t\t\t\t) ? TRUE : FALSE;\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Remove \"all day\" stragglers\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tforeach ($all_day as $i => $stuff)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($ymd > $stuff['end_ymd'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($all_day[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each event\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \t$each_event contains the formatting\n\t\t\t\t\t// \tto use for displaying the contents\n\t\t\t\t\t// \tof an event on a given day in the calendar.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$event_output = '';\n\n\t\t\t\t\t\tif ( ! empty($event_array[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($event_array[$ymd] as $start_hour => $sh_data)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t\t$hour_event_total\t= count($sh_data);\n\n\t\t\t\t\t\t\t\tif ($start_hour == 'all_day')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t\t\t\t$index = 0;\n\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $i => $id)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// Multi-day events get one time key, regular\n\t\t\t\t\t\t\t\t\t\t// all day events get another\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t$time_key = '00002400';\n\n\t\t\t\t\t\t\t\t\t\tif ( ! isset( $events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//so in some rare situations this\n\t\t\t\t\t\t\t\t\t\t\t//can come to us without being reset?\n\t\t\t\t\t\t\t\t\t\t\t//I hate moving pointers :p\n\t\t\t\t\t\t\t\t\t\t\treset($events[$id]->dates[$ymd]);\n\n\t\t\t\t\t\t\t\t\t\t\t$time_key = key($events[$id]->dates[$ymd]);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars($id, $events[$id], $ymd, $time_key);\n\n\t\t\t\t\t\t\t\t\t\t$vars['conditional']['event_all_day']\t= TRUE;\n\n\t\t\t\t\t\t\t\t\t\t$vars['single']\t+= array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t\t=> $this->create_count_hash('event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t\t=> $this->create_count_hash('year_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t\t=> $this->create_count_hash('month_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t\t=> $this->create_count_hash('week_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t\t=> $this->create_count_hash('day_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t\t=> $this->create_count_hash('hour_event_count'),\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index_difference' => $index - $prev_index,\n\t\t\t\t\t\t\t\t\t\t\t'all_day_event_index'\t\t=> $index++,\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['minutes'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['minutes'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['hours'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['hours'],\n\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> (isset($events[$id]->dates[$ymd][$time_key])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->dates[$ymd][$time_key]['duration']['days'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id]->default_data['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t'event_count'\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'month_event_count' \t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t// If we're outputting at the event level, then we have\n\t\t\t\t\t\t\t\t\t\t// to spit out the all day stuff here.\n\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t//shortcut\n\t\t\t\t\t\t\t\t\t\t$evtk =& $events[$id]->dates[$ymd][$time_key];\n\n\t\t\t\t\t\t\t\t\t\t$array = array(\n\t\t\t\t\t\t\t\t\t\t\t'output'\t\t\t\t\t=> $output_data,\n\t\t\t\t\t\t\t\t\t\t\t'vars'\t\t\t\t\t\t=> $vars,\n\t\t\t\t\t\t\t\t\t\t\t'first_day'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'last_day'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'start_ymd'\t\t\t\t\t=> $evtk['date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'end_ymd'\t\t\t\t\t=> $evtk['end_date']['ymd'],\n\t\t\t\t\t\t\t\t\t\t\t'time'\t\t\t\t\t\t=> $time_key,\n\t\t\t\t\t\t\t\t\t\t\t'id'\t\t\t\t\t\t=> $id,\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_minutes'\t=> $evtk['duration']['minutes'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_hours'\t\t=> $evtk['duration']['hours'],\n\t\t\t\t\t\t\t\t\t\t\t'event_duration_days'\t\t=> $evtk['duration']['days']\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t//unset($event_array[$ymd]['all_day'][$id]);\n\n\t\t\t\t\t\t\t\t\t\t$count\t\t= (empty($all_day)) ? 0 : max(array_keys($all_day));\n\t\t\t\t\t\t\t\t\t\t$inserted\t= FALSE;\n\t\t\t\t\t\t\t\t\t\t$prev_index\t= $index + 1;\n\n\t\t\t\t\t\t\t\t\t\tif (! in_array($array, $all_day))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tfor ($i = 0; $i <= $count; $i++)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t\t\t\t\t// Find a spot for this event\n\t\t\t\t\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (! isset($all_day[$i]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inserted = TRUE;\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tif ($inserted === FALSE)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$all_day[$i] = $array;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tksort($all_day);\n\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$hour_events[$start_hour] = $sh_data;\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{\n\t\t\t\t\t\t\t\t\tforeach ($sh_data as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$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\t\t$start_hour\t= str_pad($start_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_min\t= str_pad($start_min, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_hour\t= str_pad($end_hour, 2, 0, STR_PAD_LEFT);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_min\t= str_pad($end_min, 2, 0, STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$time_key = $start_hour.$start_minute.$end_hour.$end_minute;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ( ! isset($events[$id]->dates[$ymd][$time_key]))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$start_hour . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_minutes']\t= $events[$id]->dates[$ymd][$time_key]['duration']['minutes'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_hours']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['hours'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_duration_days']\t\t= $events[$id]->dates[$ymd][$time_key]['duration']['days'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t\t= $this->create_count_hash('day_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_total']\t\t\t= $day_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_total']\t\t\t= $hour_event_total;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index']\t\t= 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['all_day_event_index_difference'] = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$event_output .= $this->swap_vars($vars, $output_data);\n\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\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//parse day event counts\n\t\t\t\t\t\t\t$event_output = $this->parse_count_hashes('hour_event_count', $event_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_event;\n\t\t\t\t\t\t$replace = $event_output;\n\n\t\t\t\t\t\tif ($output_at == 'event')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// If $each_event is empty, $all_day never gets filled. Let's fix that.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_event == '' AND isset($event_array[$ymd]['all_day']))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($event_array[$ymd]['all_day'] as $id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t\t\t= (! isset( $events[$id]->dates[$ymd]['00002400'])) ?\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey($events[$id]->dates[$ymd]) :\n\t\t\t\t\t\t\t\t\t\t\t\t\t'00002400';\n\n\t\t\t\t\t\t\t$data['end_ymd']\t= $events[$id]->dates[$ymd][$time_key]['end_date']['ymd'];\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// This stuff can be gibberish since it'll never show, but we\n\t\t\t\t\t\t\t// provide it because other parts of the code expect it to exist\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$data['time']\t\t= '';\n\t\t\t\t\t\t\t$data['vars']\t\t= array();\n\t\t\t\t\t\t\t$data['first_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['last_day']\t= FALSE;\n\t\t\t\t\t\t\t$data['output']\t\t= '';\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Add the all day event\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day[]\t\t\t= $data;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$all_day_event_total\t= count($all_day);\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// \"All day\" output\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t$all_day_output = '';\n\n\t\t\t\t\tif ( ! empty($all_day))\n\t\t\t\t\t{\n\t\t\t\t\t\t$prev_index = 0;\n\t\t\t\t\t\t$hour_event_count = 0;\n\n\t\t\t\t\t\tforeach ($all_day as $all_day_data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$time_key\t= $all_day_data['time'];\n\t\t\t\t\t\t\t$vars\t\t= $all_day_data['vars'];\n\t\t\t\t\t\t\t$vars['single']['event_first_day']\t= ($ymd == $all_day_data['first_day']) ? TRUE : FALSE;\n\t\t\t\t\t\t\t$vars['single']['event_last_day']\t= ($ymd == $all_day_data['last_day']) ? TRUE : FALSE;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Process all day variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$all_day_output\t.= $this->swap_vars($vars, $all_day_data['output']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each hour\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_hour != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour_output = '';\n\t\t\t\t\t\t$hour_temp = '';\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_output = $all_day_output;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor ($i = 0; $i < 24; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$hour_temp\t\t\t= '';\n\t\t\t\t\t\t\t$hour_count\t\t\t= 0;\n\t\t\t\t\t\t\t$hour_event_count\t= 0;\n\t\t\t\t\t\t\t$h\t\t\t\t\t= str_pad($i, 2, '0', STR_PAD_LEFT);\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t\t\t$minute\t\t\t\t= '00';\n\t\t\t\t\t\t\t//$this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\n\t\t\t\t\t\t\tif (isset($hour_events[$h]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($hour_events[$h] as $start_minute => $sm_data)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($sm_data as $end_hour => $eh_data)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($eh_data as $end_minute => $event_ids)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$hour_count += count($event_ids);\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($event_ids as $id)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (isset($entry_data[$id]))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$year_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$month_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$week_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$day_event_count++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_event_count++;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars = $this->get_occurrence_vars(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$events[$id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ymd,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$h . $start_minute . $end_hour . $end_minute\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['event_count']\t\t\t= $this->create_count_hash('event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['hour_event_count']\t\t= $this->create_count_hash('hour_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['year_event_count']\t\t= $this->create_count_hash('year_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['month_event_count']\t= $this->create_count_hash('month_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['week_event_count']\t\t= $this->create_count_hash('week_event_count');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$vars['single']['day_event_count']\t\t= $this->create_count_hash('day_event_count');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t//we have to remove conditionals for these items as well\n\t\t\t\t\t\t\t\t\t\t\t\t\t//because the dummy hashes screw with them\n\t\t\t\t\t\t\t\t\t\t\t\t\t$output_data = $this->remove_post_parse_conditionals(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'event_count'\t\t\t=> $vars['single']['event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'year_event_count'\t\t=> $vars['single']['year_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'month_event_count'\t\t=> $vars['single']['month_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'week_event_count'\t\t=> $vars['single']['week_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'day_event_count'\t\t=> $vars['single']['day_event_count'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hour_event_count'\t\t=> $vars['single']['hour_event_count']\n\t\t\t\t\t\t\t\t\t\t\t\t\t), $entry_data[$id]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$hour_temp .= $this->swap_vars($vars, $output_data);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $hour_temp, $each_hour);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hour_temp = str_replace($find, $replace, $each_hour);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$vars = array();\n\t\t\t\t\t\t\t$total_events = $hour_count;\n\t\t\t\t\t\t\t$this->CDT->change_time($i, 0);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'time'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'hour'\t\t\t\t=> $h,\n\t\t\t\t\t\t\t\t'minute'\t\t\t=> $minute,\n\t\t\t\t\t\t\t\t'time'\t\t\t\t=> $h.':'.$minute,\n\t\t\t\t\t\t\t\t'hour_event_total' \t=> $total_events\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$hour_output .= $this->swap_vars($vars, $hour_temp);\n\n\t\t\t\t\t\t\t//parse day event counts\n\t\t\t\t\t\t\t$hour_output = $this->parse_count_hashes('hour_event_count', $hour_output);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$find = $hash_hour;\n\t\t\t\t\t\t$replace = $hour_output;\n\n\t\t\t\t\t\tif ($output_at == 'hour')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\n\t\t\t\t\t\t\t//ee()->TMPL->log_item('Calendar: Outputting hour data for '.$ymd);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each day\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//var_dump($this->CDT->ymd . ' OUTSIDE DAY');\n\n\t\t\t\t\tif ($each_day != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$prefix = $suffix = '';\n\n\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t// Prep day variables\n\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY');\n\n\t\t\t\t\t\t$day_output = str_replace($find, $replace, $each_day);\n\n\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(1);\n\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-2);\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 2');\n\n\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t$vars['conditional'] = array(\n\t\t\t\t\t\t\t'day_is_today'\t\t\t=> ($today_ymd == $ymd) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekend'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_is_weekday'\t\t=> ($this->CDT->day_of_week == 0 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week == 6) ? FALSE : TRUE,\n\t\t\t\t\t\t\t'day_in_current_month'\t=> ($this->CDT->month == $current_period_start['month']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_previous_month'\t=> ($this->CDT->month < $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year < $current_period_start['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t'day_in_next_month'\t\t=> ($this->CDT->month > $current_period_start['month'] OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->CDT->year > $current_period_start['year']) ? TRUE : FALSE\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t'day'\t\t\t\t\t=> $d,\n\t\t\t\t\t\t\t'prev_day'\t\t\t\t=> $prev_CDT['day'],\n\t\t\t\t\t\t\t'next_day'\t\t\t\t=> $next_CDT['day'],\n\t\t\t\t\t\t\t'day_event_total'\t\t=> $day_event_total,\n\t\t\t\t\t\t\t'all_day_event_total'\t=> $all_day_event_total\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t'day' \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t'prev_day' \t=> $prev_CDT,\n\t\t\t\t\t\t\t'next_day'\t=> $next_CDT\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$day_output = $this->parse_count_hashes('day_event_count', $this->swap_vars($vars, $day_output));\n\n\n\t\t\t\t\t\t$find = $hash_day;\n\t\t\t\t\t\t$replace = $prefix.$day_output.$suffix;\n\n\t\t\t\t\t\tif ($output_at == 'day')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting day data for '.$ymd);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' DAY 3');\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each week\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE WEEK');\n\n\t\t\t\t\tif ($each_week != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($w != $next_w OR\n\t\t\t\t\t\t\t($each_month != '' AND\n\t\t\t\t\t\t\t\t(($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t\t\t($ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd']))))) OR\n\t\t\t\t\t\t\t$last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK');\n\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$offset = ($this->CDT->day_of_week > $this->first_day_of_week) ?\n\t\t\t\t\t\t\t\t\t\t$this->CDT->day_of_week - $this->first_day_of_week :\n\t\t\t\t\t\t\t\t\t\t7 - ($this->first_day_of_week - $this->CDT->day_of_week);\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-$offset);\n\t\t\t\t\t\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' WEEK 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total \t= 0;\n\n\t\t\t\t\t\t\t//$week_count_id\t\t= 'week_event_total_' . uniqid();\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\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$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date' \t\t \t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t \t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find = $hash_week;\n\t\t\t\t\t\t\t$replace = $week_output;\n\t\t\t\t\t\t\t$week_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($end['day'] == $d AND\n\t\t\t\t\t\t\t\t$end['month'] == $m AND\n\t\t\t\t\t\t\t\t$d == $this->CDT->days_in_month($m, $y) AND\n\t\t\t\t\t\t\t\t$this->P->value('pad_short_weeks') === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$week_output = str_replace($find, $week_temp, $each_week);\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep week variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$this->CDT->add_day(-6);\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_day(7);\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_day(-14);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this week\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$week_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_week, 'week_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->add_day(6);\n\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->month, 2, '0', STR_PAD_LEFT) .\n\t\t\t\t\t\t\t\t\t\t\tstr_pad($this->CDT->day, 2, '0', STR_PAD_LEFT);\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$week_event_total += $this->count_events($k, $event_array, $all_day, 'week', $events);\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$vars = array();\n\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'week'\t\t\t\t=> $w,\n\t\t\t\t\t\t\t\t'prev_week'\t\t\t=> $prev_CDT['week_number'],\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT['week_number'],\n\t\t\t\t\t\t\t\t'week_event_total' \t=> $week_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'week' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_week' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_week'\t\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$week_output = $this->parse_count_hashes('week_event_count', $this->swap_vars($vars, $week_output));\n\n\t\t\t\t\t\t\t$find \t\t= $hash_week;\n\t\t\t\t\t\t\t$replace \t= $week_output;\n\t\t\t\t\t\t\t$week_temp \t= '';\n\n\t\t\t\t\t\t\tif ($output_at == 'week')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting week data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t$week_event_count = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$week_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each month\n\t\t\t\t\t// -------------------------------------\n\n//var_dump($this->CDT->ymd . ' OUTSIDE MONTH');\n\n\t\t\t\t\tif ($each_month != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (($m != $next_m OR $last_day === TRUE) AND\n\t\t\t\t\t\t\t(\t$ymd >= $current_period_start['ymd'] AND\n\t\t\t\t\t\t\t\t(\t($last_day === TRUE AND $ymd == $current_period_end['ymd']) OR\n\t\t\t\t\t\t\t\t\t($ymd != $current_period_end['ymd'])\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$month_output = str_replace($find, $month_temp, $each_month);\n\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t//\treset and add month because\n\t\t\t\t\t\t\t//\tthis gets 'off' some places\n\t\t\t\t\t\t\t//--------------------------------------------\n\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t//first month is correct\n\t\t\t\t\t\t\tif ($month_tick > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->CDT->add_month($month_tick);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$month_tick++;\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Prep month variables\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t//add a month\n\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_month();\n\n\t\t\t\t\t\t\t//subtract 2\n\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_month(-2);\n\n\t\t\t\t\t\t\t//add 1, now we are back where we started!\n\t\t\t\t\t\t\t$this->CDT->add_month();\n\t\t\t\t\t\t\t$this->CDT->change_date($this->CDT->year, $this->CDT->month, 1);\n\n\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t//var_dump($this->CDT->ymd . ' MONTH 2');\n\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Calculate the number of events this month\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t$month_event_total = 0;\n\n\t\t\t\t\t\t\tif (strpos($each_month, 'month_event_total') !== FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).'01';\n\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.str_pad($this->CDT->month, 2, '0', STR_PAD_LEFT).$this->CDT->days_in_month();\n\n\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$month_event_total += $this->count_events($k, $event_array, $all_day, 'month', $events);\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//$vars['conditional'] = array( 'day_in_current_month' => TRUE );\n\t\t\t\t\t\t\t$vars['single'] = array(\n\t\t\t\t\t\t\t\t'month'\t\t\t\t=> $m,\n\t\t\t\t\t\t\t\t'prev_month'\t\t=> $prev_CDT['month'],\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT['month'],\n\t\t\t\t\t\t\t\t'month_event_total' => $month_event_total\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$vars['date'] = array(\n\t\t\t\t\t\t\t\t'month' \t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t'prev_month' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t'next_month'\t\t=> $next_CDT\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$month_output \t= $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t'month_event_count',\n\t\t\t\t\t\t\t\t$this->swap_vars($vars, $month_output)\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$replace \t\t= $month_output;\n\n\t\t\t\t\t\t\t$find = $hash_month;\n\t\t\t\t\t\t\t$month_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'month')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting month data for '.$ymd);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$month_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Each year\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif ($each_year != '')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($all_day_output != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$replace = $all_day_output . $replace;\n\t\t\t\t\t\t\t$all_day_output = '';\n\t\t\t\t\t\t\tif ($each_day == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$all_day = array();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($y != $next_y OR $last_day === TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if ($last_day !== TRUE)\n\t\t\t\t\t\t\tif ($last_day == TRUE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$year_temp .= $replace;\n\n\t\t\t\t\t\t\t\t$year_output = str_replace($find, $year_temp, $each_year);\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Calculate the number of events this year\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$year_event_total = 0;\n\n\t\t\t\t\t\t\t\tif (strpos(ee()->TMPL->tagdata, 'year_event_total') !== FALSE)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$low\t= $this->CDT->year.'0101';\n\t\t\t\t\t\t\t\t\t$high\t= $this->CDT->year.'1231';\n\t\t\t\t\t\t\t\t\tforeach ($event_array as $k => $v)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($k < $low OR $k > $high)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$year_event_total += $this->count_events($k, $event_array, array(), 'year', $events);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t\t// Prep year variables\n\t\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\t\t$this->CDT->set_default($current_period_start);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t\tif ($year_tick > 1)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->CDT->add_year($year_tick);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$year_tick++;\n\n\t\t\t\t\t\t\t\t$next_CDT = $this->CDT->add_year(1);\n\t\t\t\t\t\t\t\t$prev_CDT = $this->CDT->add_year(-2);\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\n\t\t\t\t\t\t\t\t$vars = array();\n\n\t\t\t\t\t\t\t\t$vars['conditional']\t\t= array(\n\t\t\t\t\t\t\t\t\t'year_is_leap_year'\t=> $this->CDT->is_leap_year()\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['single']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year'\t\t\t\t=> $y,\n\t\t\t\t\t\t\t\t\t'prev_year'\t\t\t=> $prev_CDT['year'],\n\t\t\t\t\t\t\t\t\t'next_year'\t\t\t=> $next_CDT['year'],\n\t\t\t\t\t\t\t\t\t'year_event_total'\t=> $year_event_total\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$vars['date']\t\t\t\t= array(\n\t\t\t\t\t\t\t\t\t'year' \t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t\t\t\t\t\t'prev_year' \t\t=> $prev_CDT,\n\t\t\t\t\t\t\t\t\t'next_year' \t\t=> $next_CDT\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$year_output = $this->parse_count_hashes(\n\t\t\t\t\t\t\t\t\t'year_event_count',\n\t\t\t\t\t\t\t\t\t$this->swap_vars($vars, $year_output)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$replace = $year_output;\n\n\t\t\t\t\t\t\t\t$this->CDT->reset();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$replace = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$find = $hash_year;\n\t\t\t\t\t\t\t$year_temp = '';\n\n\t\t\t\t\t\t\tif ($output_at == 'year')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$output .= $replace;\n\t\t\t\t\t\t\t\t$replace = '';\n//ee()->TMPL->log_item('Calendar: Outputting year data for '.$ymd);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$year_temp .= $replace;\n\t\t\t\t\t\t\t$replace = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//parse day event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t\t\t\t//parse week event counts\n\t\t\t\t\t//$output = $this->parse_count_hashes('week_event_count', $output);\n\t\t\t\t}\n\n\t\t\t\t//parse month event counts\n\t\t\t\t//$output = $this->parse_count_hashes('month_event_count', $output);\n\t\t\t}\n\n\t\t\t//parse year event count\n\t\t\t//$output = $this->parse_count_hashes('year_event_count', $output);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\trunning all of these again in case\n\t\t//\tthe didn't fire. This means we\n\t\t//\tare in a straight event loop in\n\t\t//\tcal and it's probably errorsome :/\n\t\t// -------------------------------------\n\n\t\t//parse hour event counts\n\t\t$output = $this->parse_count_hashes('hour_event_count', $output);\n\n\t\t//parse day event counts\n\t\t$output = $this->parse_count_hashes('day_event_count', $output);\n\n\t\t//parse week event counts\n\t\t$output = $this->parse_count_hashes('week_event_count', $output);\n\n\t\t//parse month event counts\n\t\t$output = $this->parse_count_hashes('month_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('year_event_count', $output);\n\n\t\t//parse year event count\n\t\t$output = $this->parse_count_hashes('event_count', $output);\n\n\t\t$output = $this->swap_vars(array('single'=>array('event_total' => $event_count)), $output);\n\n\t\t$hash = 'hash_'.$output_at;\n\n\t\t$tagdata = isset($$hash) ? str_replace($$hash, $output, $tagdata) : $output;\n\n\t\t$tagdata = $this->parse_pagination($tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: All done!');\n\n\t\t// -------------------------------------\n\t\t//\tsetting everything back thats not parsed\n\t\t//\tin case people were writing it in plain text\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tthis shouldn't ever be needed, but here we are\n\t\t//--------------------------------------------\n\n\t\tif (trim($tagdata) === '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\treturn $tagdata;\n\t}",
"public static function month_calendar($day, $month, $year) {\r\n global $langDay_of_weekNames, $langMonthNames, $langToday, $langDay, $langWeek, $langMonth, $langViewShow;\r\n\r\n $calendar_content = \"\";\r\n //Handle leap year\r\n $numberofdays = array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);\r\n if (($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) {\r\n $numberofdays[2] = 29;\r\n }\r\n\r\n $eventlist = Calendar_Events::get_calendar_events(\"month\", \"$year-$month-$day\");\r\n\r\n $events = array();\r\n if ($eventlist) {\r\n foreach ($eventlist as $event) {\r\n $eventday = new DateTime($event->startdate);\r\n $eventday = $eventday->format('j');\r\n if (!array_key_exists($eventday,$events)) {\r\n $events[$eventday] = array();\r\n }\r\n array_push($events[$eventday], $event);\r\n }\r\n }\r\n\r\n //Get the first day of the month\r\n $dayone = getdate(mktime(0, 0, 0, $month, 1, $year));\r\n //Start the week on monday\r\n $startdayofweek = $dayone['wday'] <> 0 ? ($dayone['wday'] - 1) : 6;\r\n\r\n $backward = array('month'=>$month == 1 ? 12 : $month - 1, 'year' => $month == 1 ? $year - 1 : $year);\r\n $foreward = array('month'=>$month == 12 ? 1 : $month + 1, 'year' => $month == 12 ? $year + 1 : $year);\r\n\r\n $calendar_content .= '<div class=\"right\" style=\"width:100%\">'.$langViewShow.': '.\r\n '<a href=\"#\" onclick=\"show_day(selectedday, selectedmonth, selectedyear);return false;\">'.$langDay.'</a> | '.\r\n '<a href=\"#\" onclick=\"show_week(selectedday, selectedmonth, selectedyear);return false;\">'.$langWeek.'</a> | '.\r\n '<a href=\"#\" onclick=\"show_month(selectedday, selectedmonth, selectedyear);return false;\">'.$langMonth.'</a></div>';\r\n\r\n $calendar_content .= '<table width=100% class=\"title1\">';\r\n $calendar_content .= \"<tr>\";\r\n $calendar_content .= '<td width=\"250\"><a href=\"#\" onclick=\"show_month(1,'.$backward['month'].','.$backward['year'].'); return false;\">«</a></td>';\r\n $calendar_content .= \"<td class='center'><b>{$langMonthNames['long'][$month-1]} $year</b></td>\";\r\n $calendar_content .= '<td width=\"250\" class=\"right\"><a href=\"#\" onclick=\"show_month(1,'.$foreward['month'].','.$foreward['year'].'); return false;\">»</a></td>';\r\n $calendar_content .= \"</tr>\";\r\n $calendar_content .= \"</table><br />\";\r\n $calendar_content .= \"<table class='table-default'><tr class='list-header'>\";\r\n for ($ii = 1; $ii < 8; $ii++) {\r\n $calendar_content .= \"<th class='text-center'>\" . $langDay_of_weekNames['long'][$ii % 7] . \"</th>\";\r\n }\r\n $calendar_content .= \"</tr>\";\r\n $curday = -1;\r\n $today = getdate();\r\n\r\n while ($curday <= $numberofdays[$month]) {\r\n $calendar_content .= \"<tr>\";\r\n\r\n for ($ii = 0; $ii < 7; $ii++) {\r\n if (($curday == -1) && ($ii == $startdayofweek)) {\r\n $curday = 1;\r\n }\r\n if (($curday > 0) && ($curday <= $numberofdays[$month])) {\r\n $bgcolor = $ii < 5 ? \"class='alert alert-danger'\" : \"class='odd'\";\r\n $dayheader = \"$curday\";\r\n $class_style = \"class=odd\";\r\n if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {\r\n $dayheader = \"<b>$curday</b> <small>($langToday)</small>\";\r\n $class_style = \"class='today'\";\r\n }\r\n $calendar_content .= \"<td height=50 width=14% valign=top $class_style><b>$dayheader</b>\";\r\n $thisDayItems = \"\";\r\n if (array_key_exists($curday, $events)) {\r\n foreach ($events[$curday] as $ev) {\r\n $thisDayItems .= Calendar_Events::month_calendar_item($ev, Calendar_Events::$calsettings->{$ev->event_group.\"_color\"});\r\n }\r\n $calendar_content .= \"$thisDayItems</td>\";\r\n }\r\n $curday++;\r\n } else {\r\n $calendar_content .= \"<td width=14%> </td>\";\r\n }\r\n }\r\n $calendar_content .= \"</tr>\";\r\n }\r\n $calendar_content .= \"</table>\";\r\n\r\n /* Legend */\r\n $calendar_content .= Calendar_Events::calendar_legend();\r\n\r\n\r\n /*************************************** Bootstrap calendar ******************************************************/\r\n\r\n $calendar_content .= '<div id=\"bootstrapcalendar\"></div>';\r\n\r\n return $calendar_content;\r\n }",
"function ShowCalendar()\n{\n\t$str1=\"select value1 from options where name='calendar'\";\n\t$result=mysql_query($str1) or\n\t\tdie(mysql_error());\n\t$row=mysql_fetch_array($result);\n\tif ($row['value1']==1)\n\t{\n echo(\"<tr><td height='154' valign='top'><table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#F0F8FF'>\");\n echo(\"<tr><td bgcolor='\");\n\t echo(background());\n\t echo(\"' class='leftmenumainitem' width='216' valign='top'>\");\n\t\techo(\"<img src='image/point.jpg' /> \");\n\t\techo(getPara('calendar','value2'));\n\t\techo(\" </td></tr>\");\n echo(\"<tr><td height='132' align='center' valign='middle'><div align='center'>\");\n echo(\"<script language='javascript'>calendar();</script>\");\n echo(\"</div></td></tr></table></td></tr>\");\n\t}\n\n\tmysql_free_result($result);\n}",
"function calendar($date) {\r\n\t //If no parameter is passed use the current date.\r\n\t if($date == null)\r\n\t $date = getDate();\r\n\r\n\t $day \t\t\t= $date[\"mday\"];\r\n\t $month \t\t= $date[\"mon\"];\r\n\t $month_name \t= $date[\"month\"];\r\n\t $year \t\t\t= $date[\"year\"];\r\n\r\n\t $this_month \t= getDate(mktime(0, 0, 0, $month, 1, $year));\r\n\t $next_month \t= getDate(mktime(0, 0, 0, $month + 1, 1, $year));\r\n\r\n\t //Find out when this month starts and ends.\r\n\t $first_week_day = $this_month[\"wday\"];\r\n\t $days_in_this_month = round(($next_month[0] - $this_month[0]) / (60 * 60 * 24));\r\n\r\n\t $calendar_html = \"<table width='100%'>\";\r\n\t $calendar_html = $calendar_html.\"<tr>\t<td class='perp_report_header' colspan='7' /> Month: \".$month_name.\" / Year: \".$year.\"</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\";\r\n\t $calendar_html = $calendar_html.\"<tr>\t<td class='perp_report_subheader'>Sunday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Monday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Tuesday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Wednesday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Thursday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Friday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td class='perp_report_subheader'>Saterday</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t\t\t\t\t<tr>\";\r\n\r\n\t// Fill the first week of the month with the appropriate number of blanks.\r\n\t\t\t$gapcounter = 0;\r\n\t\t\tfor($week_day = 0; $week_day < $first_week_day; $week_day++) {\r\n\t\t\t\t\t$gapcounter = $gapcounter + 1;\r\n\t\t\t\t}\r\n\t\t\t$calendar_html = $calendar_html.\"<td class='perp_report_cell' colspan='\".$gapcounter.\"'></td>\";\t\r\n\t\r\n\t// Draw Calendar Elements\r\n\t\t\t// I forget!\t\t\t\t\r\n\t $week_day = $first_week_day;\r\n\t for($day_counter = 1; $day_counter <= $days_in_this_month; $day_counter++) {\r\n\t\t\t\t\t// Determine Day of the week\r\n\t\t\t\t\t$week_day %= 7;\r\n\t\t\t\t\r\n\t\t\t\t\t// If this variable equals 0, we will need to start a new row.\r\n\t\t\t\t\tif($week_day == 0) {\r\n\t\t\t\t\t\t\t$calendar_html = $calendar_html.\"</tr><tr>\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$datetopull = $year.\"/\".$month.\"/\".$day_counter;\r\n\t\t\t\t\t$innercell = \"<TABLE width='100%' style='margin-bottom:0;margin-top:0;'><tr><td class='perp_report_fieldname'>Date:</td><td class='perp_report_fieldcontent'>\".$datetopull.\"</td></tr>\";\r\n\t\t\t\t\t//Now Get inspection List for this day.....\r\n\t\t\t\t\t$objconn = mysqli_connect($GLOBALS['hostdomain'], $GLOBALS['hostusername'], $GLOBALS['passwordofdatabase'], $GLOBALS['nameofdatabase']);\t\t\t\t\t\r\n\t\t\t\t\tif (mysqli_connect_errno()) {\r\n\t\t\t\t\t\t\t// there was an error trying to connect to the mysql database\r\n\t\t\t\t\t\t\t//printf(\"connect failed: %s\\n\", mysqli_connect_error());\r\n\t\t\t\t\t\t\texit();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$sql = \"SELECT * FROM tbl_139_337_main WHERE 139337_date = '\".$datetopull.\"' ORDER BY 139337_time\";\r\n\t\t\t\t\t\t\t//echo \"The SQL Statement is :\".$sql.\"<br>\";\r\n\t\t\t\t\t\t\t$objrs = mysqli_query($objconn, $sql);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ($objrs) {\r\n\t\t\t\t\t\t\t\t\t$number_of_rows = mysqli_num_rows($objrs);\r\n\t\t\t\t\t\t\t\t\twhile ($objarray = mysqli_fetch_array($objrs, MYSQLI_ASSOC)) {\r\n\t\t\t\t\t\t\t\t\t\t$counter = $counter + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t$counter = $counter + 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t// So the Archieved or Duplicate Narrowing...\r\n\t\t\t\t\t\t\t\t\t\t\t$displayrow\t\t\t\t\t= 0;\r\n\t\t\t\t\t\t\t\t\t\t\t$displayrow_a\t\t\t\t= 0;\r\n\t\t\t\t\t\t\t\t\t\t\t$displayrow_b\t\t\t\t= 0;\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$tmpdiscrepancyid\t\t\t= $objarray['Discrepancy_id'];\r\n\t\t\t\t\t\t\t\t\t\t\t$tmpdiscrepancycondition\t= $objarray['discrepancy_checklist_id'];\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t$displayrow_a\t\t\t\t= preflights_tbl_139_337_main_a_yn($tmpdiscrepancyid,0); // 0 will not return a row even if it is archieved.\r\n\t\t\t\t\t\t\t\t\t\t\t//$displayrow_d\t\t\t\t= preflights_tbl_139_327_main_sub_d_d_yn($tmpdiscrepancyid,0); // 0 will not return a row even if it is duplicate.\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif($displayrow_a == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$displayrow = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($displayrow_d == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$displayrow = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tif($displayrow_d == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$displayrow = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($displayrow_a == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$displayrow = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tif ($displayrow == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$innercell = $innercell.\"<tr>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<form style='margin-bottom:0;' action='part139337_report_display.php' method='POST' name='reportform' id='reportform' target='WLHMWindow' onsubmit='window.open('', 'WLHMWindow', 'width=800,height=600,status=no,resizable=no,scrollbars=yes')'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td colspan='2' class='formoptionsubmit'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type='hidden' name='recordid'\tID='recordid' \t\t\tvalue=\".$tmpdiscrepancyid.\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input type='submit' value='D:\".$tmpdiscrepancyid.\"' name='b1' ID='b1' class='makebuttonlooklikelargetext' style='width:100%;'>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t$innercell = $innercell.\"</table>\";\t\r\n\t\t\t\t\tif ($counter == 0) {\r\n\t\t\t\t\t\t\t$innercell = $innercell.\"Nothing Reported\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t$calendar_html = $calendar_html.\"<td align=\\\"center\\\" valign='top' class='perp_report_activecell'> \".$innercell.\"</td>\";\r\n\t\t\t\t\t$week_day++;\r\n\t\t\t\t\t$counter = 0;\r\n\t\t\t\t}\r\n\r\n\t $calendar_html .= \"</tr>\";\r\n\t $calendar_html .= \"</table>\";\r\n\r\n\t return($calendar_html);\r\n\t }",
"public function buildCalendar(){\n\n\t\t$first_day = $this->getFirstDay();\t\t\t\t\t\t//Determine what day of the week the month starts on\n\t\t$current_number_of_days = $this->getNumberOfDays();\t\t//Determine the number of days in the month\n\n\t\t$number_of_previous_days = $first_day;\t\t\t\t\t\t\t\t\t\t//Determine the number of days needed to complete the first week\n\t\t$prev_month_number_of_days = $this->getNumberOfDays($this->getMonth()-1); \t//Determine the number of days in the previous month\n\t\t\n\t\t$_SESSION['month'] = $this->getMonth();\n\t\t$_SESSION['year'] = $this->getYear();\n\t\t$_SESSION['view'] = 'calendar';\n\n\t\tob_start();?>\n <table border=\"0\" id=\"events_calendar\">\n <?php echo $this->buildCalendarHead() ?>\n <tr id=\"events_calendar_weekdays\">\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Sunday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Sun</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">S</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Monday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Mon</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">M</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Tuesday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Tue</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">T</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Wednesday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Wed</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">W</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Thursday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Thu</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">T</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Friday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Fri</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">F</div>\n </th>\n <th>\n\t\t\t\t\t<div class=\"full_week_name\">Saturday</div>\n\t\t\t\t\t<div class=\"short_week_name\">Sat</div>\n\t\t\t\t\t<div class=\"abrev_week_name\">S</div>\n </th>\n </tr>\n <?php\n $dayCounter = 0;\t\t\t\t\t\t\t\t\t\t\t//Keeps count of the days in a week\n\n /*** PREVIOUS MONTH CELLS ***/\n for($day = $number_of_previous_days; $day >= 1; $day--){\t//For each day in the previous month needed for a full week\n $dayNumber = $prev_month_number_of_days - ($day-1);\t\t\n \n //Get full date (YYYY-MM-DD)\n $year = ($this->getPrevMonth() == 12)? ($this->getYear()-1): $this->getYear();\n $full_date = $year . '-' . $this->getPrevMonth() . '-' . $dayNumber;\n \n $dayCounter ++;\n if($dayCounter == 1){\t\t\t\t\t//Start new row\n echo '<tr>';\n }\n \n echo $this->buildCalendarCell($full_date, $dayNumber, 'prev_month');\t//Create Calendar Cell\n\n if($dayCounter == 7){\t\t\t\t\t//End new row\n echo '</tr>';\n $dayCounter = 0;\n }\n }\n\n /*** CURRENT MONTH CELLS ***/\n for($day = 1; $day <= $current_number_of_days; $day++){\t\t//For each day in the current month\n $full_date = $this->getYear() . '-' . $this->getMonth() . '-' . $day;\n $dayCounter ++;\n if($dayCounter == 1){\t\t\t\t\t//Start new row\n echo '<tr>';\n }\n\n echo $this->buildCalendarCell($full_date, $day, 'current_month');\t//Create Calendar Cell\n\n if($dayCounter == 7){\t\t\t\t\t//End new row\n echo '</tr>';\n $dayCounter = 0;\n }\n }\n\n /*** NEXT MONTH CELLS ***/\n for($day = 1; $day <= $dayCounter; $day++){\t//For each day in the current month\n //Get full date (YYYY-MM-DD)\n $year = ($this->getNextMonth() == 1)? ($this->getYear()+1): $this->getYear();\n $full_date = $year . '-' . $this->getNextMonth() . '-' . $day;\n \n $dayCounter ++;\n if($dayCounter == 1){\t\t\t\t\t//Start new row\n echo '<tr>';\n }\n\n echo $this->buildCalendarCell($full_date, $day, 'next_month');\t//Create Calendar Cell\n\n if($dayCounter == 7){\t\t\t\t\t//End new row\n echo '</tr>';\n $dayCounter = 0;\n }\n }\n ?>\n </table>\n <style>\n\t\t\t<?php \n\t\t\tforeach($this->getCategories() as $c){?>\n\t\t\t#events_calendar .event.category_<?php echo $c->getId(); ?>:before{color: <?php echo $c->getColor(); ?> !important;}\n\t\t\t<?php } ?>\n\t\t</style>\n <?php\n\t\treturn ob_get_clean();\n\t}",
"function getCalender($group, $year = '',$month = '')\n{\n $dateYear = ($year != '')?$year:date(\"Y\");\n $dateMonth = ($month != '')?$month:date(\"m\");\n $date = $dateYear.'-'.$dateMonth.'-01';\n $currentMonthFirstDay = date(\"N\",strtotime($date));\n $totalDaysOfMonth = cal_days_in_month(CAL_GREGORIAN,$dateMonth,$dateYear);\n $totalDaysOfMonthDisplay = ($currentMonthFirstDay == 1)?($totalDaysOfMonth):($totalDaysOfMonth + ($currentMonthFirstDay-1));\n $boxDisplay = ($totalDaysOfMonthDisplay <= 35)?35:42;\n?>\n <div id=\"calender_section\">\n <h2>\n\t\t\t<a href=\"javascript:void(0);\" onclick=\"getCalendar('calendar_div','<?php echo date(\"Y\"); ?>','<?php echo date(\"m\"); ?>', '<?php echo $group; ?>');\" id='today'>Today</a>\n\t \n <a href=\"javascript:void(0);\" onclick=\"getCalendar('calendar_div','<?php echo date(\"Y\",strtotime($date.' - 1 Month')); ?>','<?php echo date(\"m\",strtotime($date.' - 1 Month')); ?>', '<?php echo $group; ?>');\"><<</a>\n <select name=\"month_dropdown\" class=\"month_dropdown dropdown\"><?php echo getAllMonths($dateMonth); ?></select>\n <select name=\"year_dropdown\" class=\"year_dropdown dropdown\"><?php echo getYearList($dateYear); ?></select>\n <a href=\"javascript:void(0);\" onclick=\"getCalendar('calendar_div','<?php echo date(\"Y\",strtotime($date.' + 1 Month')); ?>','<?php echo date(\"m\",strtotime($date.' + 1 Month')); ?>', '<?php echo $group; ?>');\">>></a>\n\t\t</h2>\n <div id=\"event_list\" class=\"none\"></div>\n <div id=\"calender_section_top\">\n <ul>\n <li>Lundi</li>\n <li>Mardi</li>\n <li>Mercredi</li>\n <li>Jeudi</li>\n <li>Vendredi</li>\n <li>Samedi</li>\n <li>Dimanche</li>\n </ul>\n </div>\n <div id=\"calender_section_bot\">\n <ul>\n <?php \n $dayCount = 1; \n for($cb=1;$cb<=$boxDisplay;$cb++){\n if(($cb >= $currentMonthFirstDay || $currentMonthFirstDay == 1) && $cb <= ($totalDaysOfMonthDisplay) && $dayCount <= ($totalDaysOfMonth)){\n //Current date\n $currentDate = $dayCount.'-'.$dateMonth.'-'.$dateYear;\n //Define date cell color\n if(strtotime($currentDate) == strtotime(date(\"Y-m-d\"))){\n echo '<li date=\"'.$currentDate.'\" class=\"grey date_cell\">';\n }else{\n echo '<li date=\"'.$currentDate.'\" class=\"date_cell\">';\n }\n //Date cell\n\t\t\t\t\t\techo '<span>';\n echo $dayCount;\n echo '</span>';\n echo getEvents($currentDate, $group);\n \n echo '</li>';\n $dayCount++;\n ?>\n <?php }else{ ?>\n <li class='empty'><span> </span></li>\n <?php } } ?>\n </ul>\n </div>\n </div>\n\n <script type=\"text/javascript\">\n\n\t var mouseUpped = false;\n\t var mouseDowned = false;\n\t \n\t\tfunction getCalendar(target_div,year,month, group){\n $.ajax({\n type:'POST',\n url:'functions.php',\n data:'func=getCalender&group='+group+'&year='+year+'&month='+month,\n success:function(html){\n $('#'+target_div).html(html);\n }\n });\n }\n \n $('.month_dropdown').on('change',function(){\n getCalendar('calendar_div',$('.year_dropdown').val(),$('.month_dropdown').val());\n });\n $('.year_dropdown').on('change',function(){\n\t\t\tgetCalendar('calendar_div',$('.year_dropdown').val(),$('.month_dropdown').val());\n });\n\t\t\n $('.date_cell').mousedown(function(){\n\t\t\tmouseDowned = true;\n\t\t\t/*Si la souris a été relevée, alors on a déjà fait une sélection. On recommence\n\t\t\tdonc une nouvelle sélection, et on remet mouseUpped à false*/\n\t\t\tif(mouseUpped == true){\n\t\t\t\t$('.selected').removeClass('selected');\n\t\t\t\tmouseUpped = false;\n\t\t\t}\n\t\t\t$(this).toggleClass('selected'); \n\t\t\t/*Début de la sélection*/\n });\n\t\t$('.date_cell').mouseenter(function(){\n\t\t\tif(($(this).prev().hasClass('selected')) && (mouseUpped == false)){\n\t\t\t\t$(this).toggleClass('selected');\n\t\t\t}else{\n\t\t\t\t/*Si le li d'avant n'est pas selected, on a sauté une ligne\n\t\t\t\tdonc il fait tous les sélectionner*/\n\t\t\t\tif((mouseUpped == false) && mouseDowned == true){\n\t\t\t\t\tvar index_debut = $('.selected').last().index();\n\t\t\t\t\tvar index_fin = $(this).index();\n\t\t\t\t\tfor(var i=(index_debut+1); i<=index_fin; i++){\n\t\t\t\t\t\t//On ajoute la class selected aux élements précédents;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*Pendant de la selection*/\t\t\t\n });\n\t\t$('.date_cell').mouseup(function(){\n\t\t\tmouseUpped=true;\n\t\t\t/*Fin de la selection*/\t\t\t\n });\n </script>\n<?php\n}",
"public function buildCalendarList(){\n\t\t\n\t\t$first_day = $this->getFirstDay();\t\t\t\t\t\t//Determine what day of the week the month starts on\n\t\t$current_number_of_days = $this->getNumberOfDays();\t\t//Determine the number of days in the month\n\n\t\t$number_of_previous_days = $first_day;\t\t\t\t\t\t\t\t\t\t//Determine the number of days needed to complete the first week\n\t\t$prev_month_number_of_days = $this->getNumberOfDays($this->getMonth()-1); \t//Determine the number of days in the previous month\n\t\t\n\t\t$_SESSION['month'] = $this->getMonth();\n\t\t$_SESSION['year'] = $this->getYear();\n\t\t$_SESSION['view'] = 'list';\n\t\t\n\t\tob_start();?>\n <table border=\"0\" id=\"events_calendar\" class=\"calendar_list\">\n <?php echo $this->buildCalendarHead() ?>\n <tr>\n <td>\n <?php \n /*** CURRENT MONTH CELLS ***/\n $first_day = $this->getYear() . '-' . $this->getMonth() . '-01';\n $last_day = $this->getYear() . '-' . $this->getMonth() . '-' . $current_number_of_days;\n \n $object = $this->events_ob;\n $month_events = new $object();\n $month_events = $month_events->fetchAll(\"WHERE DATE(\" . $this->events_end_date_field . \") >= '\" . $first_day . \"' AND DATE(\" . $this->events_end_date_field . \") <= '\" . $last_day . \"'\", \"ORDER BY `\" . $this->events_end_date_field . \"` DESC\");\n \n if(count($month_events) > 0){\n for($day = 1; $day <= $current_number_of_days; $day++){\t\t//For each day in the current month\n $full_date = $this->getYear() . '-' . $this->getMonth() . '-' . $day;\n \n $events = $this->buildDayList($full_date);\t//get events for each day\n if(strlen(trim($events))){\n ?>\n <div class=\"day\">\n <?php echo $events; ?>\n </div>\n <?php\n }\n }\n }\n else{?>\n \t\t<h5><?php echo 'No events in ' . $this->getMonthName() . ' ' . $this->getYear();?></h5>\n <?php\n }\n ?> \n </td>\n </tr>\n </table>\n <?php\n return ob_get_clean();\n\t}",
"function display_day()\n{\n global $phpcid, $phpc_cal, $phpc_script, $phpcdb, $day, $month, $year;\n\n\t$monthname = month_name($month);\n\n $results = $phpcdb->get_occurrences_by_date($phpcid, $year, $month, $day);\n\n\t$have_events = false;\n\n\t$html_table = tag('table', attributes('class=\"phpc-main\"'),\n\t\t\ttag('caption', \"$day $monthname $year\"),\n\t\t\ttag('thead',\n\t\t\t\ttag('tr',\n\t\t\t\t\ttag('th', __('Title')),\n\t\t\t\t\ttag('th', __('Time')),\n\t\t\t\t\ttag('th', __('Description'))\n\t\t\t\t )));\n\tif($phpc_cal->can_modify()) {\n\t\t$html_table->add(tag('tfoot',\n\t\t\t\t\ttag('tr',\n\t\t\t\t\t\ttag('td',\n\t\t\t\t\t\t\tattributes('colspan=\"4\"'),\n\t\t\t\t\t\t\tcreate_hidden('action', 'event_delete'),\n\t\t\t\t\t\t\tcreate_hidden('day', $day),\n\t\t\t\t\t\t\tcreate_hidden('month', $month),\n\t\t\t\t\t\t\tcreate_hidden('year', $year),\n\t\t\t\t\t\t\tcreate_submit(__('Delete Selected'))))));\n\t}\n\n\t$html_body = tag('tbody');\n\n\twhile($row = $results->fetch_assoc()) {\n\t\n\t\t$event = new PhpcOccurrence($row);\n\n\t\tif(!$event->can_read())\n\t\t\tcontinue;\n\n\t\t$have_events = true;\n\n\t\t$eid = $event->get_eid();\n\t\t$oid = $event->get_oid();\n\n\t\t$html_subject = tag('td');\n\n\t\tif($event->can_modify()) {\n\t\t\t$html_subject->add(create_checkbox('eid[]',\n\t\t\t\t\t\t$eid));\n\t\t}\n\n\t\t$html_subject->add(create_occurrence_link(tag('strong',\n\t\t\t\t\t\t$event->get_subject()),\n\t\t\t\t\t'display_event', $oid));\n\n\t\tif($event->can_modify()) {\n\t\t\t$html_subject->add(\" (\");\n\t\t\t$html_subject->add(create_event_link(\n\t\t\t\t\t\t__('Modify'), 'event_form',\n\t\t\t\t\t\t$eid));\n\t\t\t$html_subject->add(')');\n\t\t}\n\n\t\t$html_body->add(tag('tr',\n\t\t\t\t\t$html_subject,\n\t\t\t\t\ttag('td', $event->get_time_span_string()),\n\t\t\t\t\ttag('td', attributes('class=\"phpc-desc\"'), $event->get_desc())));\n\t}\n\n\t$html_table->add($html_body);\n\n\tif($phpc_cal->can_modify()) {\n\t\t$output = tag('form',\n\t\t\t\tattributes(\"action=\\\"$phpc_script\\\"\"),\n\t\t\t\t$html_table);\n\t} else {\n\t\t$output = $html_table;\n\t}\n\n\tif(!$have_events)\n\t\t$output = tag('h2', __('No events on this day.'));\n\n\treturn tag('', create_day_menu(), $output);\n}",
"public function render()\n {\n $this->prepareVars();\n return $this->makePartial('calendar');\n }",
"public static function day_calendar($day, $month, $year) {\r\n global $langNoEvents, $langDay, $langWeek, $langMonth, $langViewShow;\r\n\r\n $calendar_content = \"\";\r\n if (is_null($day)) {\r\n $day = 1;\r\n }\r\n $nextdaydate = new DateTime(\"$year-$month-$day\");\r\n $nextdaydate->add(new DateInterval('P1D'));\r\n $previousdaydate = new DateTime(\"$year-$month-$day\");\r\n $previousdaydate->sub(new DateInterval('P1D'));\r\n\r\n $thisday = new DateTime(\"$year-$month-$day\");\r\n $daydescription = ucfirst(format_locale_date($thisday->getTimestamp()));\r\n\r\n $backward = array('day'=>$previousdaydate->format('d'), 'month'=>$previousdaydate->format('m'), 'year' => $previousdaydate->format('Y'));\r\n $foreward = array('day'=>$nextdaydate->format('d'), 'month'=>$nextdaydate->format('m'), 'year' => $nextdaydate->format('Y'));\r\n\r\n $calendar_content .= '<div class=\"right\" style=\"width:100%\">'.$langViewShow.': '.\r\n '<a href=\"#\" onclick=\"show_day(selectedday, selectedmonth, selectedyear);return false;\">'.$langDay.'</a> | '.\r\n '<a href=\"#\" onclick=\"show_week(selectedday, selectedmonth, selectedyear);return false;\">'.$langWeek.'</a> | '.\r\n '<a href=\"#\" onclick=\"show_month(selectedday, selectedmonth, selectedyear);return false;\">'.$langMonth.'</a></div>';\r\n\r\n $calendar_content .= \"<table class='table-default'>\";\r\n $calendar_content .= \"<tr>\";\r\n $calendar_content .= '<td width=\"25\"><a href=\"#\" onclick=\"show_day('.$backward['day'].','.$backward['month'].','.$backward['year'].'); return false;\">«</a></td>';\r\n $calendar_content .= \"<td class='center'><b>$daydescription</b></td>\";\r\n $calendar_content .= '<td width=\"25\" class=\"right\"><a href=\"#\" onclick=\"show_day('.$foreward['day'].','.$foreward['month'].','.$foreward['year'].'); return false;\">»</a></td>';\r\n $calendar_content .= \"</tr>\";\r\n $calendar_content .= \"</table>\";\r\n\r\n $eventlist = Calendar_Events::get_calendar_events(\"day\", \"$year-$month-$day\");\r\n $calendar_content .= \"<table class='table-default'>\";\r\n\r\n $curhour = 0;\r\n $now = getdate();\r\n $today = new DateTime($now['year'].'-'.$now['mon'].'-'.$now['mday'].' '.$now['hours'].':'.$now['minutes']);\r\n if ($now['year'].'-'.$now['mon'].'-'.$now['mday'] == \"$year-$month-$day\") {\r\n $thisdayistoday = true;\r\n }\r\n else{\r\n $thisdayistoday = false;\r\n }\r\n $thishour = new DateTime($today->format('Y-m-d H:00'));\r\n $cursorhour = new DateTime(\"$year-$month-$day 00:00\");\r\n $curstarthour = \"\";\r\n\r\n foreach ($eventlist as $thisevent) {\r\n $thiseventstart = new DateTime($thisevent->start);\r\n $thiseventhour = new DateTime($thiseventstart->format('Y-m-d H:00'));\r\n if ($curstarthour != $thiseventhour) { //event date changed\r\n while($cursorhour < $thiseventhour) {\r\n if ($thisdayistoday && $thishour>=$cursorhour && intval($cursorhour->diff($thishour,true)->format('%h'))<6)\r\n $class = 'today';\r\n else\r\n $class = 'monthLabel';\r\n $calendar_content .= \"<tr><td colspan='3' class='$class'>\" . \" <b>\" . ucfirst($cursorhour->format('H:i')) . \"</b></td></tr>\";\r\n if (intval($cursorhour->diff($thiseventhour,true)->format('%h'))>6) {\r\n $calendar_content .= \"<tr><td colspan='3'>$langNoEvents</td></tr>\";\r\n }\r\n $cursorhour->add(new DateInterval('PT6H'));\r\n $curhour += 6;\r\n }\r\n\r\n if ($thisdayistoday && $thishour>=$cursorhour && intval($cursorhour->diff($thishour,true)->format('%h'))<6)\r\n $class = 'today';\r\n else\r\n $class = 'monthLabel';\r\n //No hour tr for the event\r\n //$calendar_content .= \"<tr><td colspan='3' class='$class'>\" . \" <b>\" . ucfirst($thiseventhour->format('H:i')) . \"</b></td></tr>\";\r\n if ($cursorhour <= $thiseventhour) {\r\n $cursorhour->add(new DateInterval('PT6H'));\r\n $curhour += 6;\r\n }\r\n }\r\n $calendar_content .= Calendar_Events::day_calendar_item($thisevent, 'even');\r\n $curstarthour = $thiseventhour;\r\n }\r\n /* Fill with empty days*/\r\n for($i=$curhour;$i<24;$i+=6) {\r\n if ($thisdayistoday && $thishour>=$cursorhour && intval($cursorhour->diff($thishour,true)->format('%h'))<6)\r\n $class = 'today';\r\n else\r\n $class = 'monthLabel';\r\n $calendar_content .= \"<tr><td colspan='3' class='$class'>\" . \" <b>\" . ucfirst($cursorhour->format('H:i')) . \"</b></td></tr>\";\r\n $calendar_content .= \"<tr><td colspan='3'>$langNoEvents</td></tr>\";\r\n $cursorhour->add(new DateInterval('PT6H'));\r\n }\r\n $calendar_content .= \"</table>\";\r\n /* Legend */\r\n $calendar_content .= Calendar_Events::calendar_legend();\r\n\r\n return $calendar_content;\r\n }",
"public function getCalendarPage();",
"function calendar ($whereto=\"./index.php\") {\n global $_GET, $_SERVER;\n $currMonth = ($_GET['month']) ? $_GET['month'] : date(\"n\"); # numeric calendar month\n $currYear = ($_GET['year']) ? $_GET['year'] : date(\"Y\");\n $tm = mktime(0, 0, 0, ($currMonth +$shifted), 1, $currYear);\n $dim = date(\"t\", $tm); # days in month\n $dow = date(\"w\", $tm); # day of week month starts on\n $txm = date(\"F\", $tm); # text name of month\n $pMon = date(\"M\", mktime(0, 0, 0, $currMonth-1, 1, $currYear));\n $nMon = date(\"M\", mktime(0, 0, 0, $currMonth+1, 1, $currYear));\n $cal .= \" <tr><td><br/></td></tr>\\n<tr><th>$txm $currYear</th></tr>\\n<tr><td>\";\n $cal .= \"<table class='cal' width='15%'>\\n <tr>\";\n foreach (array(\"S\",\"M\",\"T\",\"W\",\"T\",\"F\",\"S\") as $k => $v) { $cal .= \"<th>$v</th>\"; }\n $cal .= \"</tr>\\n\";\n $day = \" \";\n for ($row=0; $row<6; $row++) {\n $cal .= \" <tr>\";\n for ($col=0; $col<7; $col++) {\n if (($row == 0) && ($col == $dow)) { $day = 1; }\n if (is_numeric($day)) {\n $dday = ($day < 10) ? \"0$day\" : $day;\n $link = \"?date=$currYear-\".(($currMonth<10)?\"0\":\"\").\"$currMonth-$dday\";\n $cal .= \"<td><a href='$link'>$dday</a></td>\";\n $day++;\n } else {\n $cal .= \"<td> </td>\";\n }\n if ($day > $dim) { $day = \" \"; }\n }\n $cal .= \"</tr>\\n\";\n if ($day >= $dim) { break; }\n }\n $cal .= \" <tr>\\n <td colspan='7' nowrap>\\n\";\n $cal .= \" <a href='?year=\".($currYear-1).\"'>\".substr(($currYear-1),2).\"</a> \\n\";\n $cal .= \" <a href='?month=\".((($currMonth -1) < 1)?12:$currMonth -1).\"&year=\" .((($currMonth -1) < 1)?$currYear -1:$currYear).\"'>$pMon</a>\";\n if (!(($currMonth == date(\"n\")) && ($currYear == date(\"Y\")))) {\n $cal .= \" <a href='?month=\".date(\"n\").\"&year=\".date(\"Y\").\"'>Home</a>\";\n } else {\n $cal .= \" -- \";\n }\n $cal .= \" \\n <a href='?month=\".((($currMonth +1) > 12)?1:$currMonth +1).\"&year=\".((($currMonth +1) > 12)?$currYear +1:$currYear).\"'>$nMon</a> \\n\";\n $cal .= \" <a href='?year=\".($currYear+1).\"'>\".substr(($currYear+1),2).\"</a>\\n\";\n $cal .= \" </td>\\n </tr>\\n</table>\\n\";\n $cal .= \"<!-- end calendar -->\\n\";\n return $cal;\n}",
"function toICS() {\r\n require_once BPSP_PLUGIN_DIR . '/schedules/iCalcreator.class.php';\r\n global $bp;\r\n define( 'ICAL_LANG', get_bloginfo( 'language' ) );\r\n \r\n $cal = new vcalendar();\r\n $cal->setConfig( 'unique_id', str_replace( 'http://', '', get_bloginfo( 'siteurl' ) ) );\r\n $cal->setConfig( 'filename', $bp->groups->current_group->slug );\r\n $cal->setProperty( 'X-WR-CALNAME', __( 'Calendar for: ', 'bpsp' ) . $bp->groups->current_group->name );\r\n $cal->setProperty( 'X-WR-CALDESC', $bp->groups->current_group->description );\r\n $cal->setProperty( 'X-WR-TIMEZONE', get_option('timezone_string') );\r\n \r\n $schedules = $this->has_schedules();\r\n $assignments = BPSP_Assignments::has_assignments();\r\n $entries = array_merge( $assignments, $schedules );\r\n foreach ( $entries as $entry ) {\r\n setup_postdata( $entry );\r\n \r\n $e = new vevent();\r\n \r\n if( $entry->post_type == \"schedule\" )\r\n $date = getdate( strtotime( $entry->start_date ) );\r\n elseif( $entry->post_type == \"assignment\" )\r\n $date = getdate( strtotime( $entry->post_date ) );\r\n $dtstart['year'] = $date['year'];\r\n $dtstart['month'] = $date['mon'];\r\n $dtstart['day'] = $date['mday'];\r\n $dtstart['hour'] = $date['hours'];\r\n $dtstart['min'] = $date['minutes'];\r\n $dtstart['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtstart', $dtstart );\r\n \r\n $e->setProperty( 'description', get_the_content() . \"\\n\\n\" . $entry->permalink );\r\n \r\n if( !empty( $entry->location ) )\r\n $e->setProperty( 'location', $entry->location );\r\n \r\n if( $entry->post_type == \"assignment\" )\r\n $entry->end_date = $entry->due_date; // make assignments compatible with schedule parser\r\n \r\n if( !empty( $entry->end_date ) ) {\r\n $date = getdate( strtotime( $entry->end_date ) );\r\n $dtend['year'] = $date['year'];\r\n $dtend['month'] = $date['mon'];\r\n $dtend['day'] = $date['mday'];\r\n $dtend['hour'] = $date['hours'];\r\n $dtend['min'] = $date['minutes'];\r\n $dtend['sec'] = $date['seconds'];\r\n $e->setProperty( 'dtend', $dtend );\r\n } else\r\n $e->setProperty( 'duration', 0, 1, 0 ); // Assume it's an one day event\r\n \r\n $e->setProperty( 'summary', get_the_title( $entry->ID ) );\r\n $e->setProperty( 'status', 'CONFIRMED' );\r\n \r\n $cal->setComponent( $e );\r\n }\r\n \r\n header(\"HTTP/1.1 200 OK\");\r\n die( $cal->returnCalendar() );\r\n }",
"public function calendars()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name' => 'category',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'site_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_id',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'integer',\n\t\t\t\t'min_value' => 1,\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'calendar_name',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'not' => TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'status',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'string',\n\t\t\t\t'multi' => TRUE,\n\t\t\t\t'default' => 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_start',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => 'date_range_end',\n\t\t\t\t'required' => FALSE,\n\t\t\t\t'type' => 'date'\n\t\t\t)\n\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND\n\t\t\t$this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name(\n\t\t\t\t$this->P->value('calendar_name'),\n\t\t\t\tNULL,\n\t\t\t\t$this->P->params['calendar_name']['details']['not']\n\t\t\t);\n\n\t\t\tif ( empty( $ids ) )\n\t\t\t{\n\t\t\t\t//ee()->TMPL->log_item('Calendar: No results for\n\t\t\t\t//calendar name provided, bailing');\n\t\t\t\treturn $this->no_results();\n\t\t\t}\n\n\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Fetch the basics\n\t\t// -------------------------------------\n\n\t\t$data = $this->data->fetch_calendars_basics(\n\t\t\t$this->P->value('site_id'),\n\t\t\t$this->P->value('calendar_id'),\n\t\t\t$this->P->params['calendar_id']['details']['not']\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// If no data, then give 'em no_results\n\t\t// -------------------------------------\n\n\t\tif (($total_results = count($data)) == 0)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Ensure date_range_start <= date_range_end\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\tif ($this->P->value('date_range_start', 'ymd') > $this->P->value('date_range_end', 'ymd'))\n\t\t\t{\n\t\t\t\t$temp = $this->P->params['date_range_start']['value'];\n\t\t\t\t$this->P->set('date_range_start', $this->P->params['date_range_end']['value']);\n\t\t\t\t$this->P->set('date_range_end', $temp);\n\t\t\t\tunset($temp);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// This will come in handy later\n\t\t// -------------------------------------\n\n\t\t$calendar_array = array();\n\t\tforeach ($data as $k => $arr)\n\t\t{\n\t\t\t$calendar_array[] = $arr['calendar_id'];\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Date range params? Then we need to do a lot more work.\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('date_range_start') !== FALSE OR\n\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Calculating date ranges');\n\t\t\t$min = ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') :\n\t\t\t\t\t\t0;\n\n\t\t\t$max = ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t0;\n\n\t\t\t$calendar_array = $this->data->fetch_calendars_with_events_in_date_range(\n\t\t\t\t$min,\n\t\t\t\t$max,\n\t\t\t\t$calendar_array,\n\t\t\t\t$this->P->value('status')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No calendars? No results.\n\t\t// -------------------------------------\n\n\t\tif (empty($calendar_array))\n\t\t{\n//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel();\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] = implode('|', $calendar_array);\n\t\tee()->TMPL->tagparams['channel'] = CALENDAR_CALENDARS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t\tee()->TMPL->var_single = array_merge(\n\t\t\t\tee()->TMPL->var_single,\n\t\t\t\tee()->TMPL->related_markers\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_calendars_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_calendars_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_calendars_channel_query', $channel->query, $calendar_array);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Inject Calendar-specific variables\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding Calendar variables');\n\n\t\t$aliases = array(\n\t\t\t'title'\t\t\t=> 'calendar_title',\n\t\t\t'url_title'\t\t=> 'calendar_url_title',\n\t\t\t'entry_id'\t\t=> 'calendar_id',\n\t\t\t'author_id'\t\t=> 'calendar_author_id',\n\t\t\t'author'\t\t=> 'calendar_author',\n\t\t\t'status'\t\t=> 'calendar_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$aliases['url_title'] = 'calendar_borked_title';\n\n\t\t\tee()->TMPL->var_single['calendar_borked_title'] = 'calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t$row['screen_name'] : $row['username'];\n\n\t\t\tforeach ($aliases as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t//\tWe will reassign the $channel->query->result with our\n\t\t//\treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\n\n\t\t$channel->parse_channel_entries();\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t$channel = $this->add_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via Weblog module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $channel->return_data;\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t//on the off chance someone just wrote the word\n\t\t//'calendar_url_title', we should fix that before\n\t\t//output. (See above calendar_url_title fix)\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_borked_title' . RD,\n\t\t\t\t\t'\"calendar_borked_title\"',\n\t\t\t\t\t\"'calendar_borked_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'calendar_url_title' . RD,\n\t\t\t\t\t'\"calendar_url_title\"',\n\t\t\t\t\t\"'calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\n\t}",
"function displayCurrentMonthCalenderAsTable()\n{\nglobal $year; // this year\nglobal $month; // this month\nglobal $id;\n$day=1; // start from first of month\nglobal $crypted;\nglobal $month_caption; // caption to table\n$lastmonth = $month - 1;\n$nextmonth = $month +1;\n$lastyear = $year - 1;\n$nextyear = $year + 1;\necho \"<table summary=\\\"Monthly calendar\\\" onMouseover= changeto('#CCCCCC') onMouseout= changeback('white') width = 757 cellspacing= 2 cellpadding= 2 id= ignore class=\\\"sk_bok_green\\\">\n<caption ><a href=comm.php?crypted=$_GET[crypted]&calender&lastyear=$lastyear ><font color=green>Last Year</font></a> <a href=comm.php?crypted=$_GET[crypted]&calender&last=$lastmonth&year=$year><font color=green>Last Month</a> <b>[$month_caption ]</b> <a href=comm.php?crypted=$_GET[crypted]&calender&next=$nextmonth&year=$year><font color= green>Next Month</font></a> <a href=comm.php?crypted=$_GET[crypted]&calender&lastyear=$nextyear><font color= green>Next Year<font></a></caption>\n<tr align=center id=ignore>\n<th width =308 id=ignore bgcolor=#FFC56C ><font color =Red>Sun</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Mon</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Tue</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Wed</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Thu</font></th>\n<th width =308 id=ignore bgcolor=#FFC56C><font color =Green>Fri</font></th> \n<th width =308 id=ignore bgcolor=#FFC56C><font color =blue>Sat</font></th> \n</tr>\\n\"; \n\n$ts = mktime(0,0,0,$month,$day,$year); // unix timestamp of the first day of current month\n$weekday_first_day = date(\"w\",$ts); // which is the weekday of the first day of week 0-Sunday 6-Saturday\n//$my_format = date(\"d-m-Y\");\n$slot=0;\n\nprint \"<tr align=center >\\n\"; // First row starts\nfor($i=0;$i<$weekday_first_day;$i++) // Pad the first few rows(slots)\n{\nprint \" <td id=ignore width =308></td>\"; // Empty slots \n$slot++;\n}\n\tif($day == '')\n\t{\n\t\t$ig = 'ignore';\n\t\techo \">>\";\n\t}\n\nwhile(checkdate($month,$day,$year) && $date<32) // till there are valid days in current month\n{\nif($slot == 7) // if we moved past saturday\n{\n$slot = 0; // reset and move back to sunday\nprint \"</tr>\\n\"; // end of this row\nprint \"<tr align=center width =50>\\n\"; // move on to next row\n\n}\n\t//$system_date = '$day-$month-$year';\n\t//$db_date = date('d-m-Y',$day $month $year);\n\t$system_date = mktime(0, 0, 0, $month, $day, $year);\n\t$db_date = date('d-m-Y',$system_date);\n\t$db_date_search = explode('-',$db_date);\n\t//print_r($db_date_search);\n\t$search_date = mktime(0, 0, 0, $month, $day);\n\t$search_date = sprintf(date('d-m-',$search_date));\n\t$month_no = $db_date_search[1];\n\t $query =\"select * from calender_event where active = '1' and day = '$db_date_search[0]' and `month_no` = '$month_no' and year = '$db_date_search[2]' \";\n\t\n\t$result = mysql_query($query) or die(mysql_error());\n\t$count = mysql_num_rows($result);\n\t/* echo $query;\n\techo $count; */\n\t$tr = 0;\n\t\n\tif($count != '0')\n\t{\t$msg .= \"<table id=ignore width=100%>\";\n\t\twhile($row=mysql_fetch_array($result))\n\t\t{\n\t\t\n\t\tif($row[popup] =='1')\n\t\t{\n\t\t\t$popup_link = \" onmouseout=\\\"hideTooltip()\\\" onmouseover=\\\"showTooltip(event,'$row[pop_msg]'\";\n\t\t\n\t\t}else\n\t\t{\n\t\t\t$popup_link =\"\";\n\t\t}\n\t\t\n\t\t$msg .= \"<tr ><td id=ignore bgcolor=green>$row[heading]</td></tr><tr><td id=ignore bgcolor=white><a href=\\\"comm.php?crypted=$_GET[crypted]&last=$month_no&year=$db_date_search[2]&calender&edit_event=$row[sno]\\\" $popup_link);return false\\\">$row[details]</a></td></tr>\";\n\t\t}\n\t\t$msg .= \"</table>\";\n\t}else\n\t{\n\t\t$msg ='';\n\t\n\t}\n\t//chking all db\n\t$color = \"bgcolor = white\";\n\techo \"<td $color id=$idd width =308 hight=308><DIV align=center id= tips><a href = #><font color=black><a href=comm.php?crypted=$_GET[crypted]&last=$month_no&year=$db_date_search[2]&calender&add_event=$db_date_search[0]-$db_date_search[1]-$db_date_search[2]>$day</a> </font>\n\t\t\n\t\t \";\n\t\n\t\n\t\techo \"</div ></a>$msg</div ></td>\";\n$msg ='';\n\t\n\n$day++;\n$slot++;\n}\n\nif($slot>0) // have we started off a new last row \n{\nwhile($slot<7) // padding at the end to complete the last row table\n{\nprint \" <td id=ignore></td>\"; // empty slots\n$slot++;\n}\nprint \"\\n</tr>\\n\"; // close out last row\n}\nprint '</table>'; //end of table\n}",
"function calendar1($date){ //get \"from\" date\r\n\t\t\t$myCalendar = new tc_calendar(\"date1\", true, false);\r\n\t\t\t$myCalendar->setIcon(\"calendar/images/iconCalendar.gif\");\r\n\t\t\t$myCalendar->setPath(\"calendar/\");\r\n\t\t\t$myCalendar->setYearInterval(1970, 2020);\r\n\t\t\t$myCalendar->setAlignment('left', 'bottom');\r\n\t\t\tif($date!=\"\"){\r\n\t\t\t\t$myCalendar->setDate(Date(\"d\",strtotime($date)),Date(\"m\",strtotime($date)),Date(\"Y\",strtotime($date)));\r\n\t\t\t}\r\n\t\t\t$myCalendar->setOnChange(\"calculate()\");\t\r\n\t\t\t$myCalendar->writeScript();\r\n\t}",
"function MakeCalendarGrid(){\n //get our days\n $intMonthDays = cal_days_in_month(CAL_GREGORIAN, $this->intMonth, $this->intYear);\n $intDayCounter = 0;\n $arrMonthAttributes = array('colspan'=>'7');\n //make our parent calendar table\n $objCalendarParent = $this->objCalendar->AddChildNode($this->objCalendar->objHTML,'', 'table');\n //let's make our header\n $objHeaderRow = $this->objCalendar->AddChildNode($objCalendarParent,'', 'tr');\n //establish our base attributes\n for($intWeekDay=0;$intWeekDay<7;$intWeekDay++){\n $strDay = date('l', strtotime(\"Sunday +{$intWeekDay} days\"));\n $this->objCalendar->AddChildNode($objHeaderRow,$strDay, 'th',array('class'=>'weekday'));\n }\n //get the starting date\n $intMonthStart = date('N', strtotime($this->intYear.'-'.$this->intMonth.'-1'));\n $intMonthStart++;\n //avoid empty rows\n if($intMonthStart == 8)\n $intMonthStart = 1;\n //make our days now\n for($intDay=1;$intDay<($intMonthDays + $intMonthStart);$intDay++){\n $arrDateAttributes = array('onclick'=>'SelectDay(this);');\n if($intDayCounter === 0){\n //make our new week\n $objWeekRow = $this->objCalendar->AddChildNode($objCalendarParent,'', 'tr');\n $arrDateAttributes['class'] = 'calendarday weekend';\n }\n else if($intDayCounter === 6)\n $arrDateAttributes['class'] = 'calendarday weekend';\n else if($intDay == date('j'))\n $arrDateAttributes['class'] = 'calendarday today';\n else\n $arrDateAttributes['class'] = 'calendarday weekday';\n $intDayCounter++;\n //reset our week now\n if($intDayCounter == 7)\n $intDayCounter = 0;\n if($intDay < $intMonthStart){\n unset($arrDateAttributes['onclick']);\n $this->objCalendar->AddChildNode($objWeekRow,' ', 'td',$arrDateAttributes);\n continue 1;\n }\n $arrDateAttributes['id'] = ($intDay - ($intMonthStart - 1)).'-'.$this->arrCalendarProperties['calendarid'];\n //make our day now\n $this->objCalendar->AddChildNode($objWeekRow,($intDay - ($intMonthStart - 1)), 'td',$arrDateAttributes);\n }\n return TRUE;\n }",
"public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }",
"function getCalender($year = '', $month = '') {\n $dateYear = ($year != '') ? $year : date(\"Y\");\n $dateMonth = ($month != '') ? $month : date(\"m\");\n $date = $dateYear . '-' . $dateMonth . '-01';\n $currentMonthFirstDay = date(\"N\", strtotime($date));\n $totalDaysOfMonth = cal_days_in_month(CAL_GREGORIAN, $dateMonth, $dateYear);\n $totalDaysOfMonthDisplay = ($currentMonthFirstDay == 7) ? ($totalDaysOfMonth) : ($totalDaysOfMonth + $currentMonthFirstDay);\n $boxDisplay = ($totalDaysOfMonthDisplay <= 35) ? 35 : 42;\n ?>\n <div id='calendar_section'>\n <div id=\"calender_section\" class=\"month\">\n <table>\n <ul>\n <h2 name=\"month_dropdown\" disabled=\"\" class=\"month_dropdown dropdown\" value='<?php echo getAllMonths($dateMonth); ?>'>\n <?php\n if ($dateMonth === \"01\") {\n echo \"January\";\n } elseif ($dateMonth === \"02\") {\n echo \"February\";\n } elseif ($dateMonth === \"03\") {\n echo \"March\";\n } elseif ($dateMonth === \"04\") {\n echo \"April\";\n } elseif ($dateMonth === \"05\") {\n echo \"May\";\n } elseif ($dateMonth === \"06\") {\n echo \"June\";\n } elseif ($dateMonth == \"07\") {\n echo \"July\";\n } elseif ($dateMonth === \"08\") {\n echo \"August\";\n } elseif ($dateMonth === \"09\") {\n echo \"September\";\n } elseif ($dateMonth === \"10\") {\n echo \"October\";\n } elseif ($dateMonth === \"11\") {\n echo \"November\";\n } elseif ($dateMonth === \"12\") {\n echo \"December\";\n }\n ?> <?php echo ' ' .($dateYear); ?></h2>\n \n </ul>\n </table>\n\n <div id=\"calender_section_top\">\n <ul>\n <li>Sun</li>\n <li>Mon</li>\n <li>Tue</li>\n <li>Wed</li>\n <li>Thu</li>\n <li>Fri</li>\n <li>Sat</li>\n </ul>\n </div>\n <div id=\"calender_section_bot\">\n <ul>\n <?php\n $dayCount = 1;\n\n\n $time_slot = ($_GET['time_slot']);\n $med = ($_GET['med']);\n $res = ($_GET['res']);\n $emp = ($_GET['emp']);\n for ($cb = 1; $cb <= $boxDisplay; $cb++) {\n if (($cb >= $currentMonthFirstDay + 1 || $currentMonthFirstDay == 7) && $cb <= ($totalDaysOfMonthDisplay)) {\n //Current date\n if ($dayCount <= 9) {\n $currentDate = $dateYear . '-' . $dateMonth . '-' . '0' . $dayCount;\n ;\n } else {\n $currentDate = $dateYear . '-' . $dateMonth . '-' . $dayCount;\n }\n\n $eventNum = 0;\n //Include con configuration file\n include 'config.php';\n //Get number of events based on the current date\n $result = $con->query(\"SELECT * FROM med_records WHERE entry_date = '\" . $currentDate . \"' AND time_slot = '\" . $time_slot . \"' AND med_name = '$med'\");\n $eventNum = $result->num_rows;\n $eventrow = mysqli_fetch_array($result);\n //Define date cell color\n if (strtotime($currentDate) == strtotime(date(\"Y-m-d\"))) {\n echo '<li date=\"' . $currentDate . '\" class=\"grey date_cell\" >';\n } elseif ($eventNum > 0) {\n echo '<li date=\"' . $currentDate . '\" class=\"light_sky date_cell\" >';\n } else {\n echo '<li date=\"' . $currentDate . '\" class=\"date_cell\" >';\n }\n //Date cell\n echo '<span>';\n if ($eventNum > 0) {\n echo '<input class=\"calendar_button\" type=\"button\" id=' . $currentDate . ' name=\"date[]\" value=' . $dayCount . ' \">';\n echo '<strong class=\"existRecord\" >';\n echo $eventrow['status'];\n echo '</strong>';\n } else {\n echo '<input class=\"calendar_button\" type=\"button\" id=' . $currentDate . ' name=\"date[]\" value=' . $dayCount . ' onclick=\"MedRecordEntryModalOpen(this.id)\">';\n }\n echo '</span>';\n\n\n echo '</li>';\n $dayCount++;\n ?>\n <?php } else { ?>\n <li><span></span></li>\n <?php\n }\n }\n ?>\n </ul></div>\n </div>\n </div>\n <?php\n}"
] |
[
"0.73782176",
"0.7375063",
"0.72124064",
"0.7075841",
"0.70722395",
"0.70400065",
"0.7018329",
"0.6954972",
"0.69401884",
"0.6914334",
"0.6908487",
"0.68542796",
"0.6840325",
"0.68358904",
"0.68004346",
"0.6748415",
"0.6717309",
"0.6696532",
"0.6662829",
"0.66619265",
"0.6649508",
"0.6643381",
"0.6629417",
"0.6615955",
"0.6591509",
"0.6573651",
"0.6571062",
"0.65686524",
"0.65620303",
"0.6450328"
] |
0.7707064
|
0
|
Store a newly created League in storage.
|
public function store(CreateLeagueRequest $request)
{
$input = $request->all();
$league = $this->leagueRepository->create($input);
Flash::success('League saved successfully.');
return redirect(route('league.leagues.index'));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function store(LeagueRequest $request)\n {\n $model = League::create(['league_title' => $request->input('league')]);\n CountryLeague::create([\n 'league_id' => $model->id,\n 'country_id' => $request->input('country_id'),\n ]);\n\n return redirect(route('leagues.index'))->with('success',\n 'Your record has been successfully saved');\n }",
"public function store(Request $request)\n {\n $validate = $request->validate([\n 'title' => 'required|max:50',\n 'description' => 'required|max:100',\n ]);\n\n $league = new League;\n $league->uuid = Str::uuid();\n $league->title = $validate['title'];\n $league->description = $validate['description'];\n $league->save();\n return response($league, 201);\n }",
"public function store(Request $request)\n {\n // Validate form inputs\n $validator = Validator::make($request->all(), [\n 'name' => 'required|string|max:255',\n ]);\n\n if ($validator->fails()) {\n return redirect(route('my-leagues.index'))\n ->with('error', 'The league name you entered was invalid.');\n }\n\n // Create new league record\n $league = new League;\n $league->name = $request->name;\n $league->league_admin_id = $request->user()->id;\n $league->save();\n\n // Create team record for user in new league\n $team = new Team;\n $team->manager_id = $request->user()->id;\n $team->league_id = $league->id;\n $team->save();\n\n return redirect(route('my-leagues.show', [$league->id]));\n }",
"public function store(TeamRequest $request) {\n\t\tDB::beginTransaction();\n\t\ttry {\n\t\t\t$input = $request->all();\n\t\t\t$team = Team::create($input);\n\t\t\tif ($input['id_leader']) {\n\t\t\t\tUser::find($input['id_leader'])->update(['team_id' => $team->id]);\n\t\t\t}\n\n\t\t\tDB::commit();\n\t\t\t$teams = Team::with(['teamParent', 'leader'])->latest()->get();\n\t\t\treturn response()->json(['status' => 'success', 'message' => 'Add New Team Successfully!', 'teams' => $teams]);\n\t\t} catch (\\Exception $e) {\n\t\t\t\\Log::info($e);\n\t\t\tDB::rollBack();\n\t\t\treturn response()->json(['status' => 'error', 'message' => 'Add New Team Failed!']);\n\t\t}\n\t}",
"public function store(Request $request)\n {\n $team = Team::create($request->all());\n $team->save();\n return redirect('/teams');\n }",
"public function store(Teams $team, TeamRequest $request)\n {\n $input = $request->all();\n\n/*\n\n if ($request->team_lead) {\n $team_lead = $request->team_lead;\n } else {\n $team_lead = null;\n }\n $team->team_lead = $team_lead;\n try {\n /* Check whether function success or not * /\n $team->fill($request->except('team_lead'))->save();\n /* redirect to Index page with Success Message * /\n return redirect('teams')->with('success', 'Teams Created Successfully');\n } catch (Exception $e) {\n /* redirect to Index page with Fails Message * /\n return redirect('teams')->with('fails', 'Teams can not Create'.'<li>'.$e->errorInfo[2].'</li>');\n }\n*/\n\n\n\n $teams = $this->teamRepository->create($input);\n\n Flash::success('Team saved successfully.');\n\n return redirect(route('backend.teams.index'));\n }",
"public function store(Request $request)\n {\n $team_name = $request->input( 'teamName', false );\n $team_logo = $request->input( 'teamLogo', false );\n $players_to_add = $request->input( 'freeAgents', false );\n\n $team = new Team;\n\n $team->team_name = $team_name;\n $team->team_logo = $team_logo;\n\n if ( $team->save() ) {\n foreach ( $players_to_add as $player_id ) {\n $team->players()->attach( $player_id );\n }\n }\n\n return redirect( '/project-1/teams' );\n }",
"public function store(Request $request)\n {\n $team = new Team;\n\n $team->photo = $this->upload($request, $folder = 'teams', $fieldName = 'photo');\n\n $team->title = $request->title;\n $team->designation = $request->slug;\n $team->slug = $request->slug;\n $team->fb = $request->fblink;\n $team->linkedin = $request->LinkedIn;\n $team->insta = $request->Instalink;\n $team->gplus = $request->gpluslink;\n $team->content = $request->content;\n $team->order = $request->order;\n $team->homepage = $request->homepage;\n $team->status = $request->status;\n $team->user_id = $request->user()->id;\n $team->save();\n return redirect()->route('team.index')->with('success', 'Team Created successfully');\n }",
"public function store(Request $request)\n {\n request()->validate([\n 'team_name' => 'required\"unique:teams',\n 'user_id' => 'required',\n 'status' => 'required',\n 'team_user' => 'required',\n ]);\n Team::create($request->except(['team_user','_token']));\n\n // finding team\n $team = Team::where('team_name',$request->team_name)->first();\n $a = 0;\n\n foreach ($request->team_user as $key => $value) {\n ++$a;\n $teamuser[$a] = new TeamUser();\n $teamuser[$a]->user_id = $value;\n $teamuser[$a]->team_id = $team->id;\n $teamuser[$a]->salon_id = $request->salon_id;\n $teamuser[$a]->shop_id = $request->shop_id;\n $teamuser[$a]->company_id = $request->company_id;\n $teamuser[$a]->status = $request->status;\n $teamuser[$a]->save();\n }\n return redirect()->route('home')->with('success','Team saved successfully!');\n }",
"public function store(Request $request)\n {\n // $this->validate($request, [\n // 'year_id' => 'required',\n // 'name' => 'required',\n // ]);\n\n // $team = Team::create([\n // 'year_id' => request('year_id'),\n // 'name' => request('name'),\n // ]);\n\n // session()->flash('message', \"Team {$team->name} has been created.\");\n return redirect('/admin/teams');\n }",
"public function store(Request $request)\n {\n $filename = $request->logo->getClientOriginalName();\n $path = $request->logo->storeAs('tournaments', $filename);\n $tournament = new Tournament();\n $tournament->name = $request->name;\n $tournament->golfcourse_id = $request->golfcourse_id;\n $tournament->start_date = $request->start_date;\n $tournament->type = $request->type;\n $tournament->visibility = $request->visibility;\n $tournament->division = $request->division;\n $tournament->logo = $filename;\n\n $tournament->save();\n\n if (Auth::user()) {\n Session::flash('alert-success', trans('tournaments.create_tournament'));\n return redirect('/tournaments');\n }\n }",
"public function store(Request $request)\n {\n $userId = Auth::user()->id;\n\n $team = new Team();\n $team->name = request('name');\n $team->user_id = $userId;\n $team->save();\n\n return redirect('/player/teams')->with('mssg','The team has been created');\n }",
"public function store(TeamRequest $request)\n {\n $request->storeTeam();\n Alert::success('Success', 'Member Inserted Successfully');\n return redirect()->route('team.index');\n }",
"public function store(StoreTeam $request)\n {\n $group = new Team();\n $group->team_name = $request->team_name;\n $group->save();\n\n return Reply::redirect(route('admin.teams.index'), 'Group created successfully.');\n }",
"public function store(TeamRequest $request)\n {\n // fetch the data\n $data = $request->input('data');\n\n // check paid\n if ($data['attributes']['paid'] == true) {\n // make sure the user is an admin to set paid == true\n $authUser = JWTAuth::parseToken()->authenticate();\n if ($authUser->role != 'admin') {\n $data['attributes']['paid'] = false;\n }\n }\n\n // create the team\n $team = new Team($data['attributes']);\n\n // set the user relation\n $team->user_id = $data['relationships']['user']['data']['id'];\n $team->save();\n\n // generate resource\n $resource = new Item($team, new TeamTransformer(), 'teams');\n\n return $this->jsonResponse($resource, 201);\n }",
"public function store(TeamRequest $request)\n {\n $team = Team::create($request->all());\n\n event(new AssignUserToTeamEvent($team));\n\n session()->flash('success-message', Lang::get('teams.successAddTeam'));\n\n return redirect()->route('teams.index');\n }",
"public function store(CreateGameFormRequest $request)\n {\n $existingGame = Game::where('name', '=', $request->get('name'))->first();\n if($existingGame !== null)\n {\n \\Auth::user()->games()->save($existingGame);\n } else {\n $game = new Game;\n $game->name = $request->get('name');\n $game->save();\n\n $genre = Genre::find($request->get('genreId'));\n $game->genres()->save($genre);\n \\Auth::user()->games()->save($game);\n }\n\n return view('games.store');\n }",
"public function store(Request $request)\n {\n if($request->isMethod('post')) {\n $inputs = $request->except('_token');\n\n $validator = (new BdTeam)->validateTeams($inputs);\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator->messages())->withInput($inputs);\n }\n\n $userId = \\Auth::id();\n $user = User::find($userId);\n\n $inputs['department_id'] = $user->employeeProfile->department_id;\n\n try {\n \\DB::beginTransaction();\n\n $teamInputs = [\n 'department_id' => $inputs['department_id'],\n 'name' => $inputs['name'],\n 'team_type' => $inputs['team_type'],\n 'isactive' => 1,\n 'created_by' => $userId,\n ];\n\n $team = BdTeam::create($teamInputs);\n\n if(!empty($team) && !empty($inputs['user']['id'])) {\n\n $users = $inputs['user'];\n $userIds = $users['id'];\n\n foreach ($userIds as $key => $id) { \n $teamMembers = [];\n\n $teamMembers['bd_team_id'] = $team->id;\n\n $teamMembers['user_id'] = $id;\n\n if(isset($users['role'][$id])) {\n $teamMembers['team_role_id'] = $users['role'][$id];\n }\n\n $teamMembers['isactive'] = 1;\n\n $teamMembersId = (new BdTeamMember)->store($teamMembers);\n }\n }\n\n \\DB::commit();\n $message = 'Team Created Successfully.';\n return redirect()->route('bd-team.index')->withSuccess($message);\n } catch (\\PDOException $e) {\n \\DB::rollBack();\n\n return redirect()->back()->withError('Database Error: The team could not be saved.')->withInput($inputs);\n } catch (\\Exception $e) {\n \\DB::rollBack();\n\n /// $e->getMessage()\n return redirect()->back()->withError('Error code 500: internal server error.')->withInput($inputs);\n }\n }\n }",
"public function store()\n\t{\n\t\tif(Auth::check()) {\n\t\t\t$user = User::find(Auth::user()->id);\n if($user->team_id == 0) {\n\n if($user->qp < 100) {\n return Redirect::to('/teams/create')\n ->withInput()\n ->with('error', 'You do not have enough QP!');\n }\n\n $input = Input::all();\n $validation = Validator::make($input, Team::$rules);\n if ($validation->passes())\n {\n $clean_team_name = str_replace(\" \", \"\", Input::get('teamname'));\n $clean_team_name = strtolower($clean_team_name);\n $clean_team_name = mb_strtolower($clean_team_name, 'UTF-8');\n\n // Is Team name taken?\n $check_teams = Team::where(\"region\", \"=\", Input::get('region'))->where(\"clean_name\", \"=\", $clean_team_name)->count();\n if($check_teams > 0) {\n return Redirect::to(\"/teams/create\")->with(\"error\", \"This Team name is already taken\");\n }\n\n $team = new Team;\n $team->user_id = Auth::user()->id;\n $team->team_level_id = 1;\n $team->exp = 0;\n $team->name = Input::get('teamname');\n $team->clean_name = $clean_team_name;\n $team->region = Input::get('region');\n $team->website = Input::get('website');\n if (Input::hasFile('logo'))\n {\n if(Input::file('logo')->getClientSize() > 1048576) {\n return Redirect::to('/teams/create')\n ->withInput()\n ->withErrors($validation)\n ->with('error', 'The maximum size for images is 1 MB!');\n }\n $extension = Input::file('logo')->getClientOriginalExtension();\n Input::file('logo')->move(public_path().\"/img/teams/logo/\", Input::get('region').\"_\".$clean_team_name.\".\".$extension);\n $team->logo = Input::get('region').\"_\".$clean_team_name.\".\".$extension;\n } else {\n $team->logo = \"default.jpg\";\n }\n\n\n if(Input::get('description') == \"\") {\n $team->description = \"\";\n } else {\n $team->description = Input::get('description');\n }\n $team->save();\n $user->team_id = $team->id;\n $user->qp = $user->qp - 100;\n $user->save();\n\n return Redirect::to(\"/teams/\".$team->region.\"/\".$team->clean_name)->with('success', 'Your Team has been created');\n\n } else {\n return Redirect::to('/teams/create')\n ->withInput()\n ->withErrors($validation)\n ->with('error', 'There were validation errors.');\n }\n\n } else {\n return Redirect::to(\"/teams/\".$user->team->region.\"/\".$user->team->clean_name)->with('error', 'Your already have a team');\n }\n\n\t\t} else {\n\t\t\treturn Redirect::to(\"/login\");\n\t\t}\n\t}",
"public function store(Request $request): Response\n {\n $data = $request->validate([\n 'name' => ['bail', 'required', 'string', 'min:3', 'max:60'],\n 'email' => ['bail', 'required', 'string', 'email', 'max:200', 'unique:users'],\n 'password' => ['bail', 'required', 'string', 'min:8', \"max:30\"],\n 'team_name' => ['bail',\"sometimes\", 'required', 'string', 'min:3', 'max:60','unique:teams,name'],\n 'team_country' => ['bail',\"sometimes\", 'required', 'string', 'min:3', 'max:60'],\n\n ]);\n\n $user = User::create([\n \"name\" => $data['name'],\n \"email\" => $data['email'],\n \"password\" => Hash::make($data['password']),\n ]);\n\n\n $faker = \\Faker\\Factory::create();\n\n $team = Team::create([\n \"user_id\" => $user->id,\n \"country\" => $request->input(\"team_country\",$faker->country),\n \"name\" => $request->input(\"team_name\",$faker->name.\" FC\"),\n ]);\n\n $this->generatePlayers($team->id);\n\n $team->load(\"players\");\n\n\n $user->setRelation(\"team\",$team);\n\n\n\n return response($user, 201);\n }",
"public function store(Request $request)\n { \n $team = new TeamModel;\n $validate = Validator::make($request->all(), $team->validation());\n if ($validate->fails()) {\n return back()->withInput()->withErrors($validate);\n }\n \n $team->fill($request->all())->save();\n\n if ($request->team_member) {\n $team_member = array();\n foreach ($request->team_member as $key => $value) {\n $team_member[$key]['team_id'] = $team->team_id;\n $team_member[$key]['team_member_id'] = $value;\n }\n TeamMemberModel::insert($team_member);\n }\n\n Toastr::success('Team Created Successfully', '', [\"positionClass\" => \"toast-top-right\"]);\n return back();\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'name' =>'required',\n 'club_id'=>'required'\n ]);\n\n $team = new Team([\n 'name' => $request->get('name'),\n 'club_id' => $request->get('club_id'),\n ]);\n $team->save();\n return redirect('/teams')->with('success', 'Team added!');\n }",
"public function store(Request $request)\n {\n request()->validate(Team::$rules);\n\n $teams = Team::create($request->all());\n\n return redirect()->route('team.index')\n ->with('success', 'Team created successfully.');\n }",
"public function store(Request $request)\n {\n \n $id=array('userid' => \\Auth::user()->id);\n \n \n $team= Team::create(array_merge($id,request([\n 'name',\n 'race',\n 'reroll',\n 'rerollValue',\n 'fanfactor',\n 'assistantCoach',\n 'cheerleader',\n 'apothecary',\n 'teamValue',\n 'treasury'\n ])));\n\n//create een playernr voor elke speler tot/met nr 16\n $i=1;\n while($i<=16) \n {\n Player::create([\n \n 'team_id' => $team->id,\n 'playernr' => $i, \n ]); \n $i++;\n }\n\n return redirect('/team');\n }",
"public function store(Request $request)\n {\n // return $request->TeamA;\n // now to check where is the teamA and teamB in the database\n if (isset($request->TeamA) && isset($request->TeamB)) {\n $getTeamA = Team::where('name',$request->TeamA)->first();\n $getTeamB = Team::where('name',$request->TeamB)->first();\n $getTeamA->verses = $request->TeamB;\n $getTeamB->verses = $request->TeamA;\n $getTeamA->save();\n $getTeamB->save();\n // return $getTeamA;\n\n }\n if (isset($request->name)) {\n // validation\n $validatedData = $request->validate([\n 'name' => 'required|unique:teams|max:255'\n ]);\n if ($validatedData) {\n\n // save the data in the teams table\n $team = new Team();\n $team->user_id = auth()->user()->id;\n $team->name = $request->name;\n $team->save();\n\n // return $team;\n }else {\n $errors = $validator->errors();\n return $errors;\n }\n }\n\n }",
"public function store(Request $request)\n {\n //\n\n team::create($request->all());\n return \"data inserted successfully\";\n\n /* DB::table('players')->insert([\n 'p_name'=>$request->p_name,\n 'player_position'=>$request->player_position,\n 'player_number' =>$request->player_number,\n 'status'=>$request->status,\n ]);*/\n \n return redirect('/dashboard');\n }",
"public function store(Request $request)\n {\n\n /*\n * Summoner name is received from input,\n * if info already exists locally, create Summoner Model using it,\n * otherwise create and store new summoner from Riot API response.\n */\n $summonerName = $request->name;\n\n $response = $this->fetchSummoners($summonerName);\n\n //Create Summoner model from summonerArray.\n if(!empty($response['summoners'])){\n\n foreach($response['summoners'] as $summoner){\n Summoner::create($summoner);\n }\n\n }\n\n if($response['headers'] == 'Success') {\n\n return redirect('/summoner/'.$summonerName);\n\n }else{\n\n $request->session()->flash('error', 'Summoner Not Found');\n return back();\n }\n\n }",
"public function store()\n {\n $this->validate($this->request, Team::CREATE_TEAM_RULES);\n\n $user = $this->user->createUser($this->request->all());\n\n $teamRequestData = collect($this->request->all())->put('user_id', $user->id);\n $team = $this->team->postTeam($teamRequestData);\n\n $this->createAdminsRole($team);\n\n return redirect()->route('home')->with([\n 'alert' => 'Team successfully created. Now login to your team!',\n 'alert_type' => 'success',\n ]);\n }",
"public function store(PlayerRequest $request)\n {\n $player = Team::create($request->validated());\n return response()->json($player, Response::HTTP_CREATED);\n }",
"public function store()\n\t{\n\t\t$input = Input::all(); $input = General::unsetByKeyStartStr(\"/arena/\", $input);\n\n\n\n\n\t\t$validation = Validator::make($input, Tournamenttype::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$this->tournamenttype->create($input);\n\n\t\t\treturn Redirect::route('tournamenttypes.index');\n\t\t}\n\n\t\treturn Redirect::route('tournamenttypes.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}"
] |
[
"0.6897398",
"0.6766979",
"0.6744701",
"0.642094",
"0.64095056",
"0.6380998",
"0.6234239",
"0.62009",
"0.61499953",
"0.6138093",
"0.6130111",
"0.6117915",
"0.6104289",
"0.60909134",
"0.60882485",
"0.6048713",
"0.6025507",
"0.6017237",
"0.60113573",
"0.60088575",
"0.60045815",
"0.5996824",
"0.5986148",
"0.5964712",
"0.59378815",
"0.5927318",
"0.59244543",
"0.5923381",
"0.59206676",
"0.5911347"
] |
0.72778493
|
0
|
Creation tree path after insert.
|
public function afterInsert(): void
{
if ($this->owner->getAttribute($this->ownerParentIdAttribute)) {
$this->addTreePathOwnerToParents();
}
$this->addTreePathOwnerToOwner();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract public function insert ( \\Hoa\\Tree\\Generic $child );",
"public function insertByPath(&$curr_node, $path='', $array=null)\n {\n if (is_string($path)) {\n $p = explode('/', $path);\n $n = array_shift($p);\n if ($curr_node instanceof Node) {\n $curr_name = $curr_node->getName();\n }\n if ($curr_name === $n) {\n if (isset($p[0])) {\n $n = $p[0];\n }\n if ($next_node = $curr_node->getNode($n)) {\n $next_node = $next_node;\n } else {\n $next_node = $curr_node;\n }\n \n } else {\n $new_node = self::build($n);\n $new_node->setData($array);\n $curr_node->insert($new_node);\n $next_node = $new_node;\n }\n if ($n !== '') {\n $remaining_path = implode('/', $p);\n while (count($p) > 0) {\n return $this->insertByPath($next_node, $remaining_path, $array);\n }\n }\n }\n }",
"function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}",
"public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}",
"function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }",
"function create(){\n //\n //create the insert \n $insert = new insert($this);\n //\n //Execute the the insert\n $insert->query($this->entity->get_parent());\n }",
"public function insertNode($pid = 1){\n $query = \"\n INSERT INTO `structure`\n (`pid`)\n VALUES\n ('\" . $pid . \"')\n \";\n mysql_query($query);\n\n $id = mysql_insert_id();\n\n $query = \"\n INSERT INTO `structure_data`\n (`id`, `pid`)\n VALUES\n (\" . intval($id) . \", \" . intval($pid) . \")\n \";\n\n mysql_query($query);\n\n $part = $this->checkPart($id, $id);\n $path = $this->getNodePath($id, '', $part);\n\n if($id > 1 && $pid >= 1){\n $new_item_name = $this->new_node_prefix.\" \".$id;\n }else{\n $new_item_name = $this->root_node_name;\n };\n\n //Get all neighbours\n $query = \"\n SELECT `sort`, `id`\n FROM `structure_data`\n WHERE `pid` = \". intval($pid) .\" && `id` != \" . intval($id) . \"\n ORDER BY `sort` ASC\n \";\n\n $result = mysql_query($query);\n\n $sort = 1;\n\n while($row = mysql_fetch_assoc($result)){\n $sort += 1;\n\n $query = \"UPDATE `structure_data` SET `sort` = \" . intval($sort) . \" WHERE `id` = \" . intval($row['id']);\n\n mysql_query($query);\n }\n\n $query = \"\n UPDATE\n `structure_data`\n SET\n `part` = '\".$part.\"',\n `path` = '\".$path.\"',\n `name` = '\".$new_item_name.\"',\n `sort` = 1\n WHERE\n `id` = \".$id;\n\n mysql_query($query);\n\n return $id;\n }",
"function insert_root($data)\n\t{\n\t\t$table = $this->tree_table;\n\n\t\t$this->_lock_tree_table();\n\n\t\tif($this->get_root() != false) \n\t\t{\n\t\t\t$this->_unlock_tree_table();\n\t\t\treturn false;\n\t\t}\n\t\t$data = $this->_sanitize_data( $data );\n\t\t$data['depth'] = 0;\n\t\t$data = array_merge( $data, array('lft' => 1, 'rgt' => 2) );\n\t\tunset($data['node_id']);\n\n\t\tif(!isset($data['moved']))\n\t\t{\n\t\t\t$data['moved'] = 0;\n\t\t}\n\t\t\n\t\tee()->db->insert( $this->tree_table, $data );\n\t\t$this->_unlock_tree_table();\n\t\treturn true;\n\t}",
"function insert($mysqli,$parent,$name){\n $sql=\"insert into root (name,parent,lft,rgt) values('$name','$parent',0,0) \";\n $res=$mysqli->query($sql);\n if($res){\n echo \"添加成功!\";\n }\n}",
"function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}",
"private function _getTree($create = false) {}",
"protected function createPathIfNeeded() {}",
"protected function _getTree($create = false) {}",
"function create_root_node($values, $id = false, $first = false, $pos = NESE_MOVE_AFTER)\r\n\t{\r\n\t\t$this->_verify_user_values($values); \r\n\t\t// If they specified an id, see if the parent is valid\r\n\t\tif (!$first && ($id && !$parent = $this->get_node($id)))\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \n\t\telseif ($first && $id)\r\n\t\t{ \n \tdebug :: write_notice('these 2 params don\\'t make sense together',\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('first' => $first, 'id' => $id)\r\n \t);\r\n\t\t} \n\t\telseif (!$first && !$id)\r\n\t\t{ \r\n\t\t\t// If no id was specified, then determine order\r\n\t\t\t$parent = array();\r\n\t\t\tif ($pos == NESE_MOVE_BEFORE)\r\n\t\t\t{\r\n\t\t\t\t$parent['ordr'] = 1;\r\n\t\t\t} elseif ($pos == NESE_MOVE_AFTER)\r\n\t\t\t{ \r\n\t\t\t\t// Put it at the end of the tree\r\n\t\t\t\t$qry = sprintf('SELECT MAX(ordr) as m FROM %s WHERE l=1',\r\n\t\t\t\t\t$this->_node_table);\n\t\t\t\t\t\n\t\t\t\t$this->db->sql_exec($qry);\r\n\t\t\t\t$tmp_order = $this->db->fetch_row(); \r\n\t\t\t\t// If null, then it's the first one\r\n\t\t\t\t$parent['ordr'] = isset($tmp_order['m']) ? $tmp_order['m'] : 0;\r\n\t\t\t} \r\n\t\t} \r\n\t\t// Try to aquire a table lock\r\n\t\t$lock = $this->_set_lock();\r\n\r\n\t\t$sql = array();\r\n\t\t$insert_data = array();\r\n\t\t$insert_data['level'] = 1; \r\n\t\t// Shall we delete the existing tree (reinit)\r\n\t\tif ($first)\r\n\t\t{\r\n\t\t\t$this->db->sql_delete($this->_node_table);\r\n\t\t\t$insert_data['ordr'] = 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{ \r\n\t\t\t// Let's open a gap for the new node\r\n\t\t\tif ($pos == NESE_MOVE_AFTER)\r\n\t\t\t{\n\t\t\t\t$insert_data['ordr'] = $parent['ordr'] + 1;\r\n\t\t\t\t$sql[] = sprintf('UPDATE %s SET ordr=ordr+1 WHERE l=1 AND ordr > %s',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$parent['ordr']);\r\n\t\t\t} \n\t\t\telseif ($pos == NESE_MOVE_BEFORE)\r\n\t\t\t{\r\n\t\t\t\t$insert_data['ordr'] = $parent['ordr'];\r\n\t\t\t\t$sql[] = sprintf('UPDATE %s SET ordr=ordr+1 WHERE l=1 AND ordr >= %s',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\n\t\t\t\t\t\t\t\t\t\t\t\t\t$parent['ordr']);\r\n\t\t\t} \r\n\t\t} \r\n\r\n\t\t$insert_data['parent_id'] = 0;\n\t\t\r\n\t\t// Sequence of node id (equals to root id in this case\r\n\t\tif (!$this->_dumb_mode \n\t\t\t\t|| !isset($values['id'])\n\t\t\t\t|| !isset($values['root_id']))\r\n\t\t{\r\n\t\t\t$insert_data['root_id'] = \n\t\t\t$insert_data['id'] = \n\t\t\t$node_id =\n\t\t\t$this->db->get_max_column_value($this->_node_table, 'id') + 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$node_id = $values['id'];\r\n\t\t} \r\n\t\t// Left/Right values for rootnodes\r\n\t\t$insert_data['l'] = 1;\r\n\t\t$insert_data['r'] = 2; \r\n\t\t// Transform the node data hash to a sql_exec\r\n\t\tif (!$qr = $this->_values2insert_query($values, $insert_data))\r\n\t\t{\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn false;\r\n\t\t} \r\n\t\t// Insert the new node\r\n\t\t$sql[] = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->_node_table, implode(', ', array_keys($qr)), implode(', ', $qr));\r\n\r\n\t\tforeach ($sql as $qry)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($qry);\r\n\t\t} \n\t\t\r\n\t\t$this->_release_lock();\n\t\t\r\n\t\treturn $node_id;\r\n\t}",
"public function testNewNodeInsertAfterLastChild()\n {\n $model4 = Animal::findOne(4);\n \n $model = new Animal();\n $model->name = 'new'; \n \n $this->assertTrue($model->insertAfter($model4));\n $model4->refresh();\n \n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(5, $model->weight); \n \n $this->assertEquals(4, $model4->weight); \n }",
"private function insertCloneFolder()\n {\n global $boot;\n $coreIP = $boot->env('coreIP');\n\n if (file_exists($this->rootDir . \"/inserts/$this->oldName\")) ZFileHelper::copyDirectory($this->rootDir . \"/inserts/$this->oldName\", $this->rootDir . \"/inserts/$this->newName\");\n\n $sub_dirs = glob($this->rootDir . \"/inserts/$this->newName/*\");\n\n foreach ($sub_dirs as $dir) {\n if ($dir !== null && is_file($dir)) {\n $content = file_get_contents($dir);\n $replace = [\n $this->oldName => $this->newName\n ];\n $content = strtr($content, $replace);\n file_put_contents($dir, $content);\n }\n }\n\n $newdb = $this->dbname;\n $data = require $this->rootDir . '/configs/data/' . $this->oldName . '.php';\n $source = $data['components']['db']['dbName'];\n\n $file = $this->rootDir . '/configs/data/' . $this->newName . '.php';\n $file_content = file_get_contents($file);\n $replace = [\n $source => $newdb\n ];\n\n $content = strtr($file_content, $replace);\n file_put_contents($file, $content);\n\n }",
"public function insert($path, $values);",
"public function addAction(){\n\t\t$this->assign('roots', $this->roots);\n\t\t$this->assign('parents', $this->parents);\n\t}",
"private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}",
"protected function addTreePathOwnerToParents(): void\n {\n foreach ($this->getTreePathParents() as $treePath) {\n $this->saveTreePathModel(\n $treePath->parent_id,\n $this->owner->id,\n $this->owner->getAttribute($this->ownerParentIdAttribute),\n $treePath->parent_level,\n $treePath->child_level + 1\n );\n }\n }",
"public function testNewNodeInsertBeforeFirstChild()\n {\n $model1 = Animal::findOne(1);\n $model4 = Animal::findOne(4);\n \n $model = new Animal();\n $model->name = 'new'; \n \n $this->assertTrue($model->insertBefore($model1));\n $model1->refresh();\n $model4->refresh();\n \n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(1, $model->weight); \n \n $this->assertEquals(2, $model1->weight); \n $this->assertEquals(5, $model4->weight); \n }",
"public static function putPathItem(&$pdo_stmt, $id, $pid, $order, $level)\n\t{\n\t\tif ($pdo_stmt instanceof PDOStatement) {\n\t\t\t$pdo_stmt->bindValue(':id', $id);\n\t\t\t$pdo_stmt->bindValue(':parent', $pid);\n\t\t\t$pdo_stmt->bindValue(':order', $order);\n\t\t\t$pdo_stmt->bindValue(':level', $level);\n\t\t\tif (!$pdo_stmt->execute()) {\n\t\t\t\t/*$str = 'id: ' . $id . ', parent: ' . $pid . ', order: ' . $order . ', level: ' . $level;\n\t\t\t\tthrow new Exception ('Error when adding paths: ' . $str);*/\n\t\t\t}\n\t\t}\n\t}",
"protected function ancestorsBeforeSave()\r\n {\r\n if (empty($this->type)) {\r\n $this->type = $this->__type;\r\n }\r\n \r\n if (empty($this->parent) || $this->parent == \"null\")\r\n {\r\n $this->parent = null;\r\n } else {\r\n $this->parent = new \\MongoId((string) $this->parent);\r\n }\r\n \r\n $this->path = $this->ancestorsGeneratePath( $this->slug, $this->parent );\r\n \r\n if (empty($this->ancestors) && !empty($this->parent))\r\n {\r\n $parent_title = null;\r\n $parent_slug = null;\r\n $parent_path = null;\r\n $parent_ancestors = array();\r\n \r\n $parent = (new static)->setState('filter.id', $this->parent)->getItem();\r\n if (!empty($parent->title))\r\n {\r\n $parent_title = $parent->title;\r\n }\r\n if (!empty($parent->slug))\r\n {\r\n $parent_slug = $parent->slug;\r\n }\r\n if (!empty($parent->path))\r\n {\r\n $parent_path = $parent->path;\r\n }\r\n if (!empty($parent->ancestors))\r\n {\r\n $parent_ancestors = $parent->ancestors;\r\n }\r\n \r\n $this->ancestors = $parent_ancestors;\r\n $this->ancestors[] = array(\r\n 'id' => $this->parent,\r\n 'slug' => $parent_slug,\r\n 'title' => $parent_title\r\n );\r\n }\r\n \r\n if (empty($this->parent) || $this->parent == \"null\")\r\n {\r\n $this->ancestors = array();\r\n }\r\n \r\n return parent::beforeSave();\r\n }",
"function insert($word){\n\t\tinsert($root,$word);\n\t}",
"public function testRootAddNewNode()\n {\n $model6 = Animal::findOne(6);\n $root = $model6->getRoot();\n \n $model = new Animal();\n $model->name = 'new';\n \n $this->assertTrue($root->add($model));\n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(5, $model->weight);\n \n }",
"abstract protected function generatePath(PersistEvent $event);",
"function create($dataInfo)\n {\n $this->db->trans_start();\n $parent = $this->getById($dataInfo['parent_id']);\n $dataInfo['level'] = $parent->level + 1;\n $this->db->insert($this->tablename, $dataInfo);\n \n $insert_id = $this->db->insert_id();\n \n $this->refreshDestination();\n \n $this->db->trans_complete();\n\n return $insert_id;\n }",
"public function testNodeinsertAsChildAtPositionToNewNode()\n {\n $this->haveFixture('animal', 'an_addon', false);\n \n $model13 = Animal::findOne(13);\n $model = new Animal(['name' => 'new']);\n \n $this->expectExceptionMessage('You cannot add nodes to a new node');\n $model13->insertAsChildAtPosition($model, 3);\n }",
"public function form_hierarchy_insert($form_id,$uuid){\n $res = $this->form_details($form_id);\n $this->db->insert('form_hierarchy',\n array('form_hierarchy_name' => $res->form_name.' Work Flow',\n 'form_id'=>$form_id,\n 'uuid'=>$uuid\n )\n );\n return $this->db->insert_id();\n }",
"private function ReadPathTree()\n\t{\n\t\t$this->pathTreeRead = true;\n\n\t\tif (empty($this->path)) {\n\t\t\t/* this is a top level tree, it has no subpath */\n\t\t\treturn;\n\t\t}\n\n\t\t$path = $this->path;\n\n\t\twhile (($pos = strrpos($path, '/')) !== false) {\n\t\t\t$path = substr($path, 0, $pos);\n\t\t\t$pathhash = $this->commit->PathToHash($path);\n\t\t\tif (!empty($pathhash)) {\n\t\t\t\t$parent = $this->GetProject()->GetTree($pathhash);\n\t\t\t\t$parent->SetPath($path);\n\t\t\t\t$this->pathTree[] = $parent;\n\t\t\t}\n\t\t}\n\n\t\tif (count($this->pathTree) > 0) {\n\t\t\t$this->pathTree = array_reverse($this->pathTree);\n\t\t}\n\t}"
] |
[
"0.61646545",
"0.6141036",
"0.6044556",
"0.5948572",
"0.59138584",
"0.5913384",
"0.58467",
"0.57375586",
"0.5732535",
"0.5700076",
"0.56840265",
"0.56762046",
"0.5601517",
"0.5596161",
"0.55884814",
"0.5519444",
"0.5474597",
"0.5454845",
"0.54448116",
"0.54018027",
"0.5399804",
"0.5386497",
"0.53590494",
"0.5309873",
"0.53072655",
"0.5275952",
"0.527094",
"0.526386",
"0.5257349",
"0.525705"
] |
0.6859053
|
0
|
Creates parentchild relationships for the owner.
|
protected function addTreePathOwnerToParents(): void
{
foreach ($this->getTreePathParents() as $treePath) {
$this->saveTreePathModel(
$treePath->parent_id,
$this->owner->id,
$this->owner->getAttribute($this->ownerParentIdAttribute),
$treePath->parent_level,
$treePath->child_level + 1
);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function parents()\n {\n return $this->belongsToMany(Node::class, 'rbac_edges','child_id','parent_id')\n ->as('edge')->using(Edge::class);\n }",
"public function parents()\n {\n return $this->belongsTo(ParentModel::class, 'parent_id');\n }",
"public function makeParent(): void\n {\n $this->parent = null;\n }",
"public function __construct ($owner, $parent, $child) {\n $this->id = $owner;\n $this->owner = $owner;\n $this->parent = $parent;\n $this->child = $child;\n $this->childs = array();\n }",
"public function childs(){\n return $this->hasMany('App\\Item', 'parent_id');\n }",
"public function childs() {\n return $this->hasMany(Worker::class,'parent_id','id') ;\n }",
"function _make_relation($parents)\n {\n if(count($parents)<1)\n return array();\n $children = array();\n // first pass - collect children\n $field_parent_id =$this->field_parent_id ;\n foreach ($parents as $t)\n {\n $pt = $t->$field_parent_id ;\n $list = @$children[$pt] ? $children[$pt] : array();\n array_push($list, $t);\n $children[$pt] = $list;\n\n }\n //echo \"<br>---list Child----<br>\";\n //print_r($children);\n return $children;\n }",
"public function withParent()\r\n {\r\n $owner=$this->getOwner();\r\n $db=$owner->getDbConnection();\r\n $criteria = $owner->getDbCriteria();\r\n\r\n $criteria->select .= ', `parent`.ID as `parent_id`';\r\n\r\n $select =\r\n ' SELECT * from ' . $db->quoteColumnName($owner->tableName()) .\r\n ' WHERE ' . $db->quoteColumnName($owner->tableName()) . '.ROOT = ' . $owner->root .\r\n ' ORDER BY ' . $db->quoteColumnName($owner->tableName()) . '.LFT DESC';\r\n\r\n $criteria->join .=\r\n 'LEFT JOIN ('.$select.') `parent` ' .\r\n 'ON (`parent`.LFT < `t`.LFT AND `parent`.RGT > `t`.RGT)';\r\n\r\n $criteria->group = '`t`.ID';\r\n\r\n return $owner;\r\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 }",
"public function parent()\n {\n return $this->hasOne($this,'id', 'parent_id');\n }",
"public function Parents(){\n return $this->hasOne('padre','membresia_id');\n }",
"public function create( $parent ){\n $p = ( is_array( $parent ) ) ? $parent[\"parent\"] : $parent ;\n\t\t$this->data = array( \"parent\" => $p );\n\t\treturn $this->edit( 0 );\n\t}",
"public function children(){\n return $this->hasMany(self::class, 'parent_id');\n }",
"public function childs()\n {\n return $this->hasMany(Category::class, 'procreator_id')->orderBy('index');\n }",
"function _setParent($parent_srl, $child_index, &$target)\n\t{\n\t\t$child_srl = $this->itemKeyList[$child_index];\n\t\t$this->checked[$child_srl] = 1;\n\n\t\t$child_node = new stdClass();\n\t\t$child_node->node = $child_srl;\n\t\t$child_node->parent_node = $parent_srl;\n\t\t$child_node->child = array();\n\t\t$target->child[] = $child_node;\n\n\t\twhile(count($this->map[$child_srl]))\n\t\t{\n\t\t\t$this->_setParent($child_srl, array_shift($this->map[$child_srl]), $child_node);\n\t\t}\n\t\t//return $target;\n\t}",
"function set_parent($value) {\n $this->set_mapped_property('parent', $value);\n }",
"function setParent(IBabylonModel $parent);",
"public function setParent(self $parent, string $parentAssociationMapping): void;",
"public function getParents() {}",
"private function setParentChildrenClass() {\n $tmp_schemedata = $this->schemedata;\n \n // replace parents with primary key.\n foreach($this->schemedata as $index => $class) {\n $parents = array();\n $see = array();\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $parent) {\n $tmp = $tmp_class['pkFields'];\n $tmp_cols = $cols;\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n $key = array_shift($tmp_cols);\n $tmp2[$key] = $val;\n }\n $parents[$tmp_class['name']] = $tmp2;\n $see[] = $tmp_class['name'];\n }\n }\n }\n $this->schemedata[$index]['parents'] = $parents;\n $this->schemedata[$index]['see'] = $see;\n }\n\n // children\n foreach($this->schemedata as $index => $class) {\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $this->schemedata[$parent]['table']) {\n if ($class['type'] != 'TO' AND $class['type'] != 'TS' AND $class['type'] != 'TB') {\n $tmp = $class['parents']; // children's parent def\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n if($key == $tmp_class['name']) {\n $tmp2 = $val;\n }\n }\n if($class['name']) {\n $this->schemedata[$tmp_class['name']]['children'][$class['name']] = $tmp2;\n $this->schemedata[$tmp_class['name']]['see'][] = $class['name'];\n } else {\n $this->schemedata[$tmp_class['name']]['children'][$index] = $tmp2;\n }\n }\n }\n }\n }\n }\n\n // relationships\n foreach($this->schemedata as $class) {\n if ($class['type'] == 'TO' OR $class['type'] == 'TS' OR $class['type'] == 'TB') {\n foreach ($class['parents'] as $parent=>$pkFields) {\n if(!isset($this->schemedata[$parent]['relationships'])) {\n $this->schemedata[$parent]['relationships'] = array();\n }\n // add parent to another parent list getter\n foreach ($class['parents'] as $p=>$fs) {\n if ($parent != $p) {\n $type = 'List';\n $mname = '';\n foreach($fs as $k => $v) {\n $name = $k;\n }\n foreach($class['params'] as $param) {\n if($name == $param['name']) {\n $type = ($param['pair']=='N')?'List':'Class';\n break;\n }\n }\n\n $this->schemedata[$parent]['relationships'][$p]= array(\n 'table' => $class['table'],\n 'myFields' => $pkFields,\n 'fields' => $fs,\n 'type' => $type\n );\n }\n }\n }\n }\n }\n\n // rewrite relation key for parents, children and relations\n foreach($this->schemedata as $key => $class) {\n // parent\n foreach($class['parents'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$k2) {\n unset($this->schemedata[$key]['parents'][$k1][$k2]);\n $this->schemedata[$key]['parents'][$k1][$param['mname']] = $value;\n break;\n }\n }\n }\n }\n // children\n foreach($class['children'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['children'][$k1][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n // relations\n if(isset($class['relationships'])) {\n foreach($class['relationships'] as $k1 => $values) {\n foreach($values['myFields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['myFields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n foreach($values['fields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['fields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n }\n }\n }",
"public function childItems(){\n return $this->hasMany('App\\Item', 'parent_id')->with('childs');\n }",
"public static function newFromParent($parent)\n {\n return static::noConstraints(function() use ($parent) {\n return new BelongsTo(\n $parent->getQuery(),\n $parent->getParent(),\n static::getParentPropertyValue($parent, 'foreignKey'),\n static::getParentPropertyValue($parent, 'ownerKey'),\n method_exists($parent, 'getRelationName') ? $parent->getRelationName() : static::getParentPropertyValue($parent, 'relation')\n );\n });\n }",
"public function parent(){\n return $this->belongsTo(self::class, 'parent_id');\n }",
"public function testParentRelation($actor)\n {\n $newSon = factory(\\eddie\\Models\\Actor::class)->make();\n $newSon->parent()->associate($actor);\n $newSon->save();\n\n $this->assertEquals($actor->id, $newSon->parent_id);\n $this->assertEquals($newSon->id, $actor->sons->get('0')->id);\n\n return ['parent' => $actor, 'son' => $newSon];\n }",
"public function parentOf($parent){\n\t\t/*$parents = func_get_args();\n\t\tforeach($parents as $parent){\n\t\t\tif(!in_array($parent, $this->_parentOf)){\n\t\t\t\t$this->_parentOf[] = $parent;\n\t\t\t}\n\t\t}*/\n\t}",
"public function parent() {\n return $this->belongsTo(self::class, 'parent_id');\n }",
"public function parent(): BelongsTo\n\t{\n\t\treturn $this->belongsTo('App\\Models\\Album', 'parent_id', 'id');\n\t}",
"public function parent(): BelongsTo\n\t{\n\t\treturn $this->belongsTo('App\\Models\\BaseAlbumImpl', 'parent_id', 'id');\n\t}",
"public function children()\n {\n return $this->hasMany('App\\Models\\Child');\n }",
"public function beforeSave()\n {\n foreach ($this->relations as $rel) {\n if ($this->_settings[$rel['name']][0] === CActiveRecord::MANY_MANY ||\n $this->_settings[$rel['name']][0] === CActiveRecord::HAS_MANY\n ) {\n foreach ($this->owner->$rel['name'] as $m) {\n $m->save();\n }\n } elseif ($this->_settings[$rel['name']][0] === CActiveRecord::HAS_ONE) {\n $this->owner->{$rel['name']}->save();\n } elseif ($this->_settings[$rel['name']][0] === CActiveRecord::BELONGS_TO) {\n if ($this->owner->$rel['name'] === null) {\n // Set link ID attribute of owner model as null.\n $this->owner->setAttribute($this->_settings[$rel['name']][2], null);\n } else {\n // Save related model.\n $this->owner->{$rel['name']}->save();\n // Set link ID attribute of owner model as new relation ID.\n $this->owner->setAttribute($this->_settings[$rel['name']][2], $this->owner->{$rel['name']}->id);\n }\n }\n }\n }"
] |
[
"0.58826876",
"0.5858584",
"0.5802022",
"0.56551164",
"0.5493788",
"0.5482298",
"0.54794574",
"0.5469215",
"0.5458449",
"0.5408583",
"0.5383206",
"0.5329376",
"0.5320936",
"0.5294681",
"0.5284221",
"0.5280576",
"0.5264277",
"0.5261679",
"0.5260134",
"0.5252716",
"0.5251701",
"0.52379525",
"0.5231639",
"0.5227198",
"0.52155346",
"0.5213549",
"0.52088356",
"0.52000177",
"0.51912224",
"0.51744044"
] |
0.61648643
|
0
|
Create TreePath Model Object.
|
protected function addTreePathModelObject(): AbstractTreePath
{
return Yii::createObject($this->treePathModelClass);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function createModel()\n {\n return new LeafModel();\n }",
"public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}",
"public function actionCreate()\n {\n $model = new Trees();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }",
"function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }",
"protected function createModel()\n {\n $model = new EventProcessingSubLeafModel();\n $model->instantEvent->attachHandler(function(){\n $this->model->output = \"instant\";\n });\n $model->delayedEvent->attachHandler(function(){\n $this->runBeforeRender(function(){\n $this->model->output = \"delayed\";\n });\n });\n return $model;\n }",
"protected function createObjectFromRow($row) {\n return new Tree($row);\n }",
"private function model()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR;\n $class_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n\n $tmp = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $tmp = join('_', $tmp);\n $class_name .= ApplicationHelpers::camelize($tmp);\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n $class_name .= ucfirst(strtolower($this->args['name']));\n\n $args = array(\n \"class_name\" => ucfirst(strtolower($this->args['name'])),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_model'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n );\n\n $template = new TemplateScanner(\"model\", $args);\n $model = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Model already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $model))\n {\n $message .= 'Created model: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create model: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the migration for the new model\n $this->migration();\n\n return;\n }",
"public function createStructure($path);",
"public function GetPathTree()\n\t{\n\t\tif (!$this->pathTreeRead)\n\t\t\t$this->ReadPathTree();\n\n\t\treturn $this->pathTree;\n\t}",
"protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }",
"private function _getTree($create = false) {}",
"protected function createObjectFromRequest($dh) {\n $attr = array();\n $attr[\"id\"] = $dh->getParameter(\"treeid\");\n $attr[\"taxon_id\"] = $dh->getParameter(\"taxonid\");\n $attr[\"dbh\"] = $dh->getParameter(\"dbh\");\n $attr[\"lat\"] = $dh->getParameter(\"lat\");\n $attr[\"lng\"] = $dh->getParameter(\"lng\");\n $attr[\"layers\"] = $dh->getParameter(\"layers\");\n \n return new Tree($attr);\n }",
"public static function createFromPath($_path)\n {\n $pathRecord = ($_path instanceof Path) ? $_path : new Path(array(\n 'flatpath' => $_path\n ));\n \n return $pathRecord;\n }",
"function __construct() {\n $this->root = new TrieNode(); // 构建根节点\n }",
"public function getTree()\n {\n return $this->hasOne(Tree::className(), ['id' => 'tree_id']);\n }",
"public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}",
"protected function _getTree($create = false) {}",
"protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }",
"function getMakeModelTree($makeModelRequest) {\r\r\n\t\tif($makeModelRequest == null) {\r\r\n\t\t\tthrow new InvalidArgumentException(\"makeModelRequest\");\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t$url_string = 'https://gateway.developer.telekom.com/plone/autoscout24/rest';\r\r\n\t\t\r\r\n\t\t$url_string .= '/'.$this->environment;\r\r\n\t\t$url_string .= '/makeModelTree';\r\r\n\r\r\n\t\t\r\r\n\t\t\t\r\r\n\t\t$request_array = array();\r\r\n\t\t\t\r\r\n\t\t\t\r\r\n\t\tif($makeModelRequest != null) {\r\r\n\t\t\t$request_array = AutoScout24DataFactory::jsonizeMakeModelRequest($makeModelRequest);\r\r\n\t\t}\r\r\n\t\t\r\r\n\r\r\n\t\t$curl_session = curl_init($url_string);\r\r\n\t\t\r\r\n\t\t$curl_options = array(\r\r\n\t\t\tCURLOPT_CUSTOMREQUEST => 'POST',\r\r\n\t\t\tCURLOPT_RETURNTRANSFER => true,\r\r\n\t\t\tCURLOPT_SSL_VERIFYPEER => false,\r\r\n\t\t\tCURLOPT_HTTPHEADER => array(\r\r\n\t\t\t\t'Authorization: TAuth realm=\"https://odg.t-online.de\",tauth_token=\"'.$this->token_getter->getToken()->getToken().'\"',\r\r\n\t\t\t\t'User-Agent: Telekom PHP SDK/3.1.10',\r\r\n\t\t\t\t'Accept: application/json',\r\r\n\t\t\t\t'Content-Type: application/json'\r\r\n\t\t\t),\r\r\n\t\t\tCURLOPT_POSTFIELDS => $request_array\r\r\n\t\t);\r\r\n\t\t\r\r\n\t\tif($this->additional_curl_options != null) {\r\r\n\t\t\t$curl_options = $curl_options + $this->additional_curl_options;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\tcurl_setopt_array($curl_session, $curl_options);\r\r\n\t\t\r\r\n\t\t$curl_response = curl_exec($curl_session);\r\r\n\t\t\r\r\n\t\tif($curl_response !== false) {\r\r\n\t\t\treturn AutoScout24DataFactory::createGetMakeModelTreeResponse($curl_response);\r\r\n\t\t} else {\r\r\n\t\t\tthrow new Exception(curl_error($curl_session));\r\r\n\t\t}\r\r\n\t}",
"private function _getTree()\r\n {\r\n $items = $this->setArray($this->getItems());\r\n $tree = $this->_buildTree($items);\r\n return $tree;\r\n }",
"public function buildMenuTree()\n {\n $menu = new Menu\\Menu('menuTree');\n\n // Top level.\n $this->p1 = $menu->addItem(new Menu\\Item('p.1'));\n $this->p2 = $menu->addItem(new Menu\\Item('p.2'));\n\n // First level (p1).\n $this->c11 = $this->p1->addChild(new Menu\\Item('c.1.1'));\n $this->c12 = $this->p1->addChild(new Menu\\Item('c.1.2'));\n\n // First level (p2).\n $this->c21 = $this->p2->addChild(new Menu\\Item('c.2.1'));\n $this->c22 = $this->p2->addChild(new Menu\\Item('c.2.2'));\n $this->c23 = $this->p2->addChild(new Menu\\Item('c.2.3'));\n\n // Second level (c.1.1).\n $this->c111 = $this->c11->addChild(new Menu\\Item('c.1.1'));\n }",
"public function createModel()\n {\n }",
"public static function getInstance()\n {\n return Tree::getInstance();\n }",
"public function create()\n {\n $node_first = SystemNode::where(['pid' => 0])->get()->toArray();\n $node_first[] = ['id' => 0, 'name' => '一级目录'];\n $node_first = array_column($node_first, 'name', 'id');\n ksort($node_first);\n return view('SystemNode.create')->with(compact('node_first'));\n }",
"public function testRootAddNewNode()\n {\n $model6 = Animal::findOne(6);\n $root = $model6->getRoot();\n \n $model = new Animal();\n $model->name = 'new';\n \n $this->assertTrue($root->add($model));\n $this->assertSame('', $model->path);\n $this->assertEquals(1, $model->level);\n $this->assertEquals(5, $model->weight);\n \n }",
"public function _getObjectPath(){\n if(null === $this->_path || !$this->_path instanceof Path){\n $this->_path = New Path();\n }\n return $this->_path;\n }",
"public function __construct(string $rootPath){\n\n // TODO - implement this class and tests\n }",
"protected function Form_Create() {\n\t\t\t$this->dtgTrees = new TreeDataGrid($this);\n\n\t\t\t// Style the DataGrid (if desired)\n\t\t\t$this->dtgTrees->CssClass = 'datagrid';\n\t\t\t$this->dtgTrees->AlternateRowStyle->CssClass = 'alternate';\n\n\t\t\t// Add Pagination (if desired)\n\t\t\t$this->dtgTrees->Paginator = new QPaginator($this->dtgTrees);\n\t\t\t$this->dtgTrees->ItemsPerPage = 20;\n\n\t\t\t// Use the MetaDataGrid functionality to add Columns for this datagrid\n\n\t\t\t// Create an Edit Column\n\t\t\t$strEditPageUrl = __VIRTUAL_DIRECTORY__ . __FORM_DRAFTS__ . '/tree_edit.php';\n\t\t\t$this->dtgTrees->MetaAddEditLinkColumn($strEditPageUrl, 'Edit', 'Edit');\n\n\t\t\t// Create the Other Columns (note that you can use strings for tree's properties, or you\n\t\t\t// can traverse down QQN::tree() to display fields that are down the hierarchy)\n\t\t\t$this->dtgTrees->MetaAddColumn('Idtree');\n\t\t\t$this->dtgTrees->MetaAddColumn(QQN::Tree()->SpeciesIdspeciesObject);\n\t\t\t$this->dtgTrees->MetaAddColumn('Longitude');\n\t\t\t$this->dtgTrees->MetaAddColumn('Latitude');\n\t\t\t$this->dtgTrees->MetaAddColumn('Age');\n\t\t\t$this->dtgTrees->MetaAddColumn('Identifier');\n\t\t}"
] |
[
"0.68628293",
"0.5895826",
"0.5708257",
"0.5627915",
"0.5627915",
"0.5551363",
"0.55489135",
"0.55102575",
"0.5440616",
"0.53605235",
"0.53533155",
"0.53301716",
"0.5294319",
"0.5282327",
"0.5269212",
"0.5255705",
"0.5241937",
"0.52346504",
"0.52308697",
"0.52099997",
"0.5188431",
"0.5188128",
"0.51878095",
"0.51804215",
"0.5169566",
"0.5166312",
"0.5106379",
"0.5083232",
"0.5077678",
"0.5076281"
] |
0.74110097
|
0
|
Returns the parent level.
|
protected function getParentLevel(): ?int
{
if (empty($this->owner->getAttribute($this->ownerParentIdAttribute))) {
return 0;
}
return $this->treePathModelClass::find()
->select('parent_level')
->byParentId($this->owner->getAttribute($this->ownerParentIdAttribute))
->byChildId($this->owner->getAttribute($this->ownerParentIdAttribute))
->scalar();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function get_parent()\r\n {\r\n return $this->parent;\r\n }",
"public function get_parent() {\n\t\treturn $this->parent();\n\t}",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return $this->get(self::_LEVEL);\n }",
"public function getLevel()\n {\n return isset($this->level) ? $this->level : null;\n }",
"function get_parent() {\n return $this->get_mapped_property('parent');\n }",
"function get_parent()\r\n {\r\n return $this->parent;\r\n }",
"function get_parent()\r\n {\r\n return $this->parent;\r\n }",
"public function getLevel() {\n\t\treturn isset($this->level) ? (int) $this->level : 1;\n\t}",
"public function getParentID()\n {\n return $this->parent_id;\n }",
"public function parent()\n {\n if ( !$this->loaded )\n $this->reload();\n\n if ($this->is_root())\n return NULL;\n\n if ( ! in_array('parent', $this->_objects) )\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->primary_column = $this->parent_key\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n\n $result = $this->_db->query($sql);\n\n $this->_objects['parent'] = $this->factory_set($result)[0];\n }\n\n return $this->_objects['parent'];\n }",
"public function parent()\r\n\t{\r\n\t\treturn $this->parent;\r\n\t}",
"public function getParent_id() {\n\t\treturn $this->parent_id;\n\t}",
"public function GetLevel()\n {\n return $this->level;\n }",
"function parentID( )\r\n {\r\n return $this->ParentID;\r\n }",
"public function get_parent_id() {\n\t\treturn $this->post->post_parent;\n\t}",
"function getLevel() {\n\t\treturn $this->_level;\n\t}",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel()\n {\n return $this->level;\n }",
"public function getLevel() : int\n\t{\n\t\treturn $this->level;\n\t}",
"private function getCurrentParent()\n {\n return $this->getCurrentCategory()->getParentCategory();\n }"
] |
[
"0.7632918",
"0.76291865",
"0.75017107",
"0.75017107",
"0.75017107",
"0.75017107",
"0.75017107",
"0.75017107",
"0.74771345",
"0.74711186",
"0.74213105",
"0.74213105",
"0.73526573",
"0.7329338",
"0.731363",
"0.73110026",
"0.72656363",
"0.72578573",
"0.7230072",
"0.7227511",
"0.7227422",
"0.72030085",
"0.72030085",
"0.72030085",
"0.72030085",
"0.72030085",
"0.72030085",
"0.72030085",
"0.7202194",
"0.7192971"
] |
0.7822647
|
0
|
The default deletion type does not delete the owner if there are children.
|
protected function deletionType0(): void
{
if ($this->childs()->count()) {
throw new LogicException('You can’t delete the owner, he has childs.');
}
$this->removeTreePathByIds($this->owner->id);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function forceDelete();",
"public function forceDelete()\n {\n //\n }",
"protected function _delete()\r\n {\r\n parent::_delete();\r\n }",
"public abstract function delete();",
"function afterDelete() {\n \t\t$this->_ownerModel->deleteAll(array(\n \t\t\t\t'model' => $this->_Model->alias,\n \t\t\t\t'foreign_key' => $this->_Model->id,\n \t\t\t\t$this->settings[$this->_Model->alias]['userPrimaryKey'] => $this->_User,\n \t\t));\n\t\t}",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"public function onBeforeDelete();",
"public function beforeDelete(): void\n {\n switch ($this->deletionType) {\n case self::DELETION_TYPE_1:\n $this->deletionType1();\n break;\n case self::DELETION_TYPE_0:\n default:\n $this->deletionType0();\n break;\n }\n }",
"abstract protected function delete ();",
"abstract function delete();",
"public function delete(Model $parent);",
"public function isDelete();",
"function deleteChild($type=null,$dq=null){\n\t\treturn $this->api->deleteObj($api->childDQ($dq,$this->id,$types));\n\t}",
"protected function _delete()\n {\n return parent::_delete();\n }",
"protected function delete() {\n\t}",
"public function preDelete() { }",
"abstract public function shouldIDelete();",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}",
"public function delete() {}",
"public function delete()\n {\n if($this->contactable!=null)\n {\n $this->contactable->delete(); \n }else\n {\n parent::delete(); \n } \n }",
"protected function _preDelete() {}",
"public function delete()\n {\n return parent::delete();\n }",
"public function delete();",
"public function delete();",
"public function delete();"
] |
[
"0.67713284",
"0.6402472",
"0.63038653",
"0.6170063",
"0.6111405",
"0.6104518",
"0.6104518",
"0.6104518",
"0.6104518",
"0.6090738",
"0.6078902",
"0.604034",
"0.6039492",
"0.60387766",
"0.60325944",
"0.6015465",
"0.601408",
"0.59803796",
"0.59730697",
"0.59646523",
"0.59547704",
"0.5954366",
"0.59539944",
"0.59539944",
"0.591723",
"0.5915386",
"0.59131634",
"0.5911594",
"0.5911594",
"0.5911594"
] |
0.68984187
|
0
|
Updates the tree path after updating the parent.
|
public function afterUpdate(): void
{
if ($this->oldParentId != $this->owner->getAttribute($this->ownerParentIdAttribute)) {
$this->rebuildTreePath();
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function drev_sync_path_menu_update_menu($tree, $parent_alias = NULL) {\n \n foreach($tree as $item) {\n \n // Update the item\n $new_parent_alias = drev_sync_path_menu_update_menu_item($item, $parent_alias);\n \n // And go deeper if we can...\n if(!empty($item['below'])) {\n drev_sync_path_menu_update_menu($item['below'], $new_parent_alias);\n }\n }\n \n}",
"protected function addTreePathOwnerToParents(): void\n {\n foreach ($this->getTreePathParents() as $treePath) {\n $this->saveTreePathModel(\n $treePath->parent_id,\n $this->owner->id,\n $this->owner->getAttribute($this->ownerParentIdAttribute),\n $treePath->parent_level,\n $treePath->child_level + 1\n );\n }\n }",
"public function update($parent)\n {\n }",
"public function update($parent)\n\t{\n\t}",
"public function updateChildPaths($oldpath){\n\t\t$db = new DB_WE();\n\t\tif($this->IsFolder && $oldpath != '' && $oldpath != '/' && $oldpath != $this->Path){\n\t\t\t$result = $db->getAllq('SELECT ' . $this->_primaryKey . ' FROM ' . $this->_table . ' WHERE Path like \"' . $db->escape($oldpath . '%') . '\" AND ' . $this->_primaryKey . ' !=' . intval($this->{$this->_primaryKey}));\n\t\t\tforeach($result as $row){\n\t\t\t\t$updateFields = array('Path' => $this->_evalPath($row[$this->_primaryKey]));\n\t\t\t\t$cond = $this->_primaryKey . '=' . intval($row[$this->_primaryKey]);\n\t\t\t\t$db->update($this->_table, $updateFields, $cond);\n\t\t\t}\n\t\t}\n\t}",
"private function ReadPathTree()\n\t{\n\t\t$this->pathTreeRead = true;\n\n\t\tif (empty($this->path)) {\n\t\t\t/* this is a top level tree, it has no subpath */\n\t\t\treturn;\n\t\t}\n\n\t\t$path = $this->path;\n\n\t\twhile (($pos = strrpos($path, '/')) !== false) {\n\t\t\t$path = substr($path, 0, $pos);\n\t\t\t$pathhash = $this->commit->PathToHash($path);\n\t\t\tif (!empty($pathhash)) {\n\t\t\t\t$parent = $this->GetProject()->GetTree($pathhash);\n\t\t\t\t$parent->SetPath($path);\n\t\t\t\t$this->pathTree[] = $parent;\n\t\t\t}\n\t\t}\n\n\t\tif (count($this->pathTree) > 0) {\n\t\t\t$this->pathTree = array_reverse($this->pathTree);\n\t\t}\n\t}",
"private function updatePathByParent($category)\n {\n $select = $this->getConnection()->select()\n ->from([$this->getTable(self::MAIN_TABLE_NAME)], [CategoryInterface::PATH])\n ->where(CategoryInterface::CATEGORY_ID . ' = ?', $category->getParentId());\n\n $parentCategoryPath = $select->getConnection()->fetchOne($select);\n\n $this->getConnection()->update(\n $this->getTable(self::MAIN_TABLE_NAME),\n [CategoryInterface::PATH => $parentCategoryPath . '/' . $category->getCategoryId()],\n [CategoryInterface::CATEGORY_ID . ' = ?' => $category->getCategoryId()]\n );\n }",
"public function updateAliasAndPath(Category $parent = null)\n {\n $this->makeAliasAndPath($parent);\n $this->update(false, ['alias', 'path']);\n\n if ($this->isLeaf()) {\n return;\n }\n\n foreach ($this->children(1)->all() as $object) {\n $object->updateAliasAndPath($this);\n }\n }",
"public function setTreeParent($row){\n $this->treeParentRow = $row;\n return;\n }",
"public function updateRootline() {}",
"function _modifyTree () {\r\n return true;\r\n }",
"public function updateDepth()\n {\n $parent = $this->ParentComment();\n if ($parent && $parent->exists()) {\n $parent->updateDepth();\n $this->Depth = $parent->Depth + 1;\n } else {\n $this->Depth = 1;\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}",
"protected function changePath()\n {\n chdir(base_path());\n }",
"function drev_sync_path_menu_update_menu_item($item, $parent_alias = NULL) {\n \n require_once(drupal_get_path('module', 'pathauto') . '/pathauto.inc');\n \n $link = $item['link'];\n $alias = '';\n \n // Start alias with parent's alias if we have a parent...\n if($parent_alias) {\n $alias .= $parent_alias . '/';\n }\n \n // For nodes use node the node title to generate alias..\n if($link['router_path'] == 'node/%') {\n $nid = end(explode('/', $link['link_path']));\n $node = node_load($nid);\n $title = $node->title;\n $alias .= pathauto_cleanstring($title);\n \n // For others, use the menu title.\n } else {\n $alias .= pathauto_cleanstring($link['link_title']);\n }\n \n // Delete the existing alias if we found one.\n $existing_alias = _pathauto_existing_alias_data($link['link_path']);\n if($existing_alias) {\n foreach($existing_alias as $pid => $old_alias) {\n path_delete($pid);\n }\n }\n\n // Save the new path...\n $path = array(\n 'source' => $link['link_path'],\n 'alias' => $alias,\n );\n path_save($path);\n \n drush_log(dt(\"Updated path for menu item {$link['link_path']} to {$alias}.\"), 'success');\n \n // Return so new alias can be set as the parent alias for this\n // menu item's children.\n return $alias;\n}",
"private function recursiveUpdatePath($tree, $path, $entityManager)\n {\n foreach ($tree as $node) {\n $node->setPath($path . '/' . $node->getAlias());\n $entityManager->persist($node);\n if (count($node->getChildren()) != 0) {\n $this->recursiveUpdatePath($node->getChildren()->toArray(), $node->getPath(), $entityManager);\n }\n }\n return true;\n }",
"function fc_update_parent_links()\n{\n $db = new PHPWS_DB('images');\n $db->addWhere('url', 'parent');\n $db->addValue('url', NULL);\n PHPWS_Error::logIfError($db->update());\n\n // remove superfluous column\n PHPWS_Error::logIfError($db->dropTableColumn('parent_id'));\n}",
"private function brokeTree()\n {\n $i = 0;\n foreach ($this->nodeIdList as $node) {\n $this->getDb()->createCommand()->update(\n self::tableName(),\n [\n $this->leftAttribute => ++$i,\n $this->rightAttribute => ++$i,\n $this->depthAttribute => 0,\n '_tree' => $this->globalParentNode,\n ],\n ['=', 'id', $node]\n )->query();\n }\n }",
"public static function updateParent($product_token,$update_data)\n\t{\n DB::table('product')\n ->where('product_token', $product_token)\n\t ->where('language_code', '!=', 'en')\n\t ->where('product_page_parent','!=', 0)\n ->update($update_data);\n }",
"private function setPath($id){\n $query = \"\n UPDATE\n `structure_data`\n SET\n `path` = '\".$this->getNodePath($id).\"'\n WHERE\n `id` = \".$id.\"\n \";\n mysql_query($query);\n }",
"function set_parent($value) {\n $this->set_mapped_property('parent', $value);\n }",
"public function setParent(Module_Node_Model $parent = null);",
"public function beforeSave()\n {\n $this->rebuildTree();\n }",
"public function generate_parent(){\n\n // kode rekening\n $kode_rekening = KodeRekening::where(\"is_deleted\", 0)->get(); // collection semua data di databse\n\n // supaya tidak semua data di update, hanya yang perlu saja yang di update\n $data_to_update = [];\n //looping\n foreach($kode_rekening as $idx => $row){\n // array data yang perlu di update\n $new_data_update = [];\n\n // mencari parent dari kode rekening yang sedang di loop , contoh 41 | saya mencari parent si 41 dari seluruh data di database\n $find_parent = $this->find_parent($kode_rekening, $row->kode_rekening);\n\n if($find_parent != null){\n $new_data_update = [\n \"parent_id\" => $find_parent->id,\n 'id' => $row->id\n ];\n\n $data_to_update[] = $new_data_update;\n }\n }\n\n //generate query update case\n $update_string = \"UPDATE mst_kode_rekening\n SET parent_id = CASE\";\n\n $id_where = [];\n foreach($data_to_update as $idx => $row){\n $update_string .= \" WHEN id = \". $row[\"id\"] .\" THEN \".$row[\"parent_id\"].\" \";\n $id_where[] = $row[\"id\"];\n }\n $update_string .=\"\n END\n WHERE id IN (\".implode($id_where, \",\").\")\";\n DB::update($update_string);\n\n // set tidak punya parent maka saya set level 1\n DB::update(\"UPDATE mst_kode_rekening SET level = 1 WHERE parent_id = 0 \");\n //indikator lamun misalna si data masih punya child , contoh , saya di level 1 , check level 2 aya teu\n $have_child = true;\n //set default level 1\n $level = 1; // <-- 2\n // while\n while($have_child){\n //ieu pengecekan level selanjutnya\n $get_child = collect(DB::select(DB::raw(\"SELECT COUNT(*) count FROM mst_kode_rekening WHERE parent_id IN (SELECT id FROM mst_kode_rekening WHERE level = {$level})\")))->first();\n\n if($get_child->count > 0){\n $next_level = $level+1;\n DB::update(\"UPDATE mst_kode_rekening SET level = {$next_level} WHERE parent_id in (SELECT id FROM mst_kode_rekening WHERE level = {$level})\");\n $level++;\n } else {\n $have_child = false;\n }\n }\n\n // update anu parent_id na 0 == 1\n // select * from mst_kode_rekening where parent_id = (id = level 1) update jadi level 2\n // select * from mst_kode_rekening where parent_id = (id = level 2) update jadi level 3\n\n //query == null\n }",
"public function updateTree($aro_model = null, $aro_id = null) {\n\t\t\n\t\t\n\t\tif(!empty($aro_model)) $this->CcConfigAco->aro_model = $aro_model;\n\t\tif(!empty($aro_id)) $this->CcConfigAco->aro_id = $aro_id;\n\t\t$this->CcConfigAco->updateTree();\n\t\t\n\t\t$this->redirect('index');\n\t}",
"public function update($parent) {\n\t\t// remove depricated language files\n\t\t$this->deleteUnexistingFiles();\n\t}",
"function update($parent) \n\t{\n\t\t// $parent is the class calling this method\n\t\t$this->_createTable();\n\t\t$file_list = $this->_copyIncludeFiles();\n\t\t\n\t\tif( $file_list ) $msg .= \"<h3>成功複製更新檔案</h3><ul>{$file_list}</ul><br /><br />\" ;\n\t\t\n\t\techo '<p>' . '更新成功'. '</p>'.$msg;\n\t\t//JFolder::copy( JPATH_PLUGINS.DS.'system'.DS.'asikart_easyset' , JPATH_ROOT.DS.'easyset' , '' , true );\n\t}",
"private function setPathR($id){\n $branch = $this->getChildrens($id);\n\n if(!empty($branch)){\n foreach($branch as $item){\n $this->setPath($item['node']['id']);\n $this->setPathR($item['node']['id']);\n };\n };\n }",
"public function pathUpdate()\n {\n $posts = DB::table('posts')->where('path', null)->get();\n foreach ($posts as $key) {\n $slug = $this->create_slug($key->title);\n DB::table('posts')->where('title', $key->title)\n ->update([\n 'path' => $slug,\n ]);\n }\n\n Session::flash('Success', 'All paths updated.');\n\n return redirect()->back();\n }",
"function admin_updatePathway( $path, $name )\n{\n\tglobal $g_admin_pathway;\n\n\t$new_pos = count($g_admin_pathway);\n\n\t$g_admin_pathway[$new_pos]['url' ] = $path;\n\t$g_admin_pathway[$new_pos]['name'] = $name;\n}"
] |
[
"0.69311494",
"0.65326005",
"0.6530891",
"0.64316267",
"0.64054203",
"0.61273193",
"0.6070147",
"0.6016994",
"0.5983431",
"0.5934392",
"0.5833913",
"0.5828533",
"0.5716173",
"0.56879807",
"0.56839544",
"0.56395537",
"0.5636769",
"0.56339014",
"0.5613148",
"0.5597349",
"0.55971926",
"0.55962616",
"0.55850863",
"0.551927",
"0.55146885",
"0.5507738",
"0.54828596",
"0.5482494",
"0.5479242",
"0.547304"
] |
0.74768287
|
0
|
Remove tree path by ids.
|
protected function removeTreePathByIds($ids): void
{
$this->treePathModelClass::deleteAll(
[
'child_id' => $ids,
]
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function remove($ids);",
"function tree_delete_rec($id) {\n global $CFG, $DB;\n\n $deleted = array();\n if (empty($id)) return $deleted; \n\n // echo \"deleting $id<br/>\";\n // getting all subnodes to delete if is tree.\n if ($istree) {\n $sql = \"\n SELECT \n id\n FROM \n {{$table}cognitivefactory_opdata}\n WHERE\n operatorid = 'hierarchize' AND\n itemdest = {$id}\n \";\n // deleting subnodes if any\n if ($subs = $DB->get_record_sql($sql)) {\n foreach ($subs as $aSub) {\n $deleted = array_merge($deleted, tree_delete_rec($aSub->id));\n }\n }\n }\n // deleting current node\n $DB->delete_records('cognitivefactory_opdata', array('id' => $id)); \n $deleted[] = $id;\n return $deleted;\n}",
"public function remove($id, $recursive = false);",
"private function delSubs($id){\n\t\t$db = Zend_Registry::get('db');\n\t\t$select = $db->select()\n\t\t\t\t\t->from('pages')\n\t\t\t\t\t->where('parent_id = ?',$id);\n\t\t$results = $db->fetchAll($select);\n\t\tif($results){\n\t\t\t$db->delete('pages',array(\n\t\t\t\t'id = ?' => $results[id],\n\t\t\t));\n\t\t\t$db->delete('routes',array(\n\t\t\t\t'type = ?' => 'content',\n\t\t\t\t'seg_id = ?' => $results[id],\n\t\t\t));\n\t\t\t// recurse through possible child items\n\t\t\t$this->delSubs($results[id]);\n\t\t}\n\t}",
"public function removeByPathRemovesCorrectPathDataProvider() {}",
"public static function remove($ids) {\n if ((! is_array($ids)) && ($ids == self::ALL)) {\n $url = self::_buildUrl(null,null);\n } else {\n $url = self::_buildUrl('id',$ids);\n }\n try {\n $rsp = XN_REST::delete($url);\n } catch (XN_Exception $e) {\n // 404 == didn't remove anything\n if ($e->getCode() != 404) {\n throw $e;\n }\n }\n }",
"function deleteIds ($ids) {\r\n $this->delete($this->tableName, $this->_id . ' in (' . implode(',', $ids) . ')');\r\n }",
"private function removeFromArray(array &$array, array $path): void\n {\n $previous = null;\n $tmp = &$array;\n\n foreach ($path as $node) {\n $previous = &$tmp;\n $tmp = &$tmp[$node];\n }\n\n if (null !== $previous && true === isset($node)) {\n unset($previous[$node]);\n }\n }",
"public function remove($ids) {\n\t\tif(!is_array($ids)) {\n\t\t\t$ids = array($ids);\n\t\t}\n\t\t$ids = array_map('intval', $ids);\n\t\tforeach($ids as $id) {\n\t\t\t$this->removeById($id);\n\t\t}\n\t}",
"public function removeStudentsFromPath($path_id, array $user_ids) {\n return $this->get('remove_students_from_path', ['path_id' => $path_id, 'user_ids' => $user_ids]);\n }",
"function deleteObjTree($types=null,$dq=null){\n\t\t// You should limit by specifying list of allowed types.\n\t\t//\n\t\t// For your safety - $types is required by this function. Always list allowed\n\t\t// types to avoid disaster just because someone added a new relation type\n\t\t// with incorrect linknig\n\t\t$obj_pool = $this->loadChild($types,$dq);\n\n\t\tforeach($obj_pool as $obj){\n\t\t\t$obj->deleteObjTree($types,$dq);\n\t\t}\n\t\t$this->destroy();\n\t}",
"public function undelete(array $ids);",
"private function unsetItemByPath(array $path, array &$data): void\n {\n $path = $this->updatePathValues($path);\n\n $dataElement =& $data;\n $lastItemKey = array_pop($path);\n\n foreach ($path as $key) {\n $dataElement =& $dataElement[\"nodes\"][$key];\n }\n\n $dataElement[\"nodes\"][$lastItemKey] = null;\n }",
"protected function deleteChildren() {}",
"public function deleteNode($id){\n $branch = $this->getChildrens($id);\n\n if(!empty($branch)){\n foreach($branch as $item){\n $this->deleteNode($item['node']['id']);\n };\n };\n\n $query = \"\n DELETE FROM\n `structure`\n WHERE\n `id` = \".$id.\"\n \";\n mysql_query($query);\n\n\n $query = \"\n DELETE FROM\n `structure_data`\n WHERE\n `id` = \".$id.\"\n \";\n mysql_query($query);\n\n }",
"public static function removeByIds($ids)\n {\n $idList = array();\n if (is_array($ids))\n {\n $idList = array_merge($idList, $ids);\n }\n else\n {\n $idList[] = $ids;\n }\n\n $cond = array( 'id' => array( $idList ) );\n eZPersistentObject::removeObject( self::definition(), $cond );\n }",
"private function setPathR($id){\n $branch = $this->getChildrens($id);\n\n if(!empty($branch)){\n foreach($branch as $item){\n $this->setPath($item['node']['id']);\n $this->setPathR($item['node']['id']);\n };\n };\n }",
"public function removeTaxonomyPath($path);",
"public static function removePathItem($item)\n\t{\n\t\t$sql = \"DELETE FROM \" . self::$PathTable . \" WHERE id={$item} OR parent={$item};\";\n\t\t$stmt = self::$modx->prepare($sql);\n\t\t$stmt->execute();\n\t\t$stmt->closeCursor();\n\t}",
"public function unique_folder_tree( $tree ) {\n\n\t\tfor ( $i = 0; $i < count( $tree ); $i ++ ) {\n\n\t\t\t$duplicate = null;\n\n\t\t\tfor ( $ii = $i + 1; $ii < count( $tree ); $ii ++ ) {\n\t\t\t\tif ( strcmp( $tree[ $ii ]['id'], $tree[ $i ]['id'] ) === 0 ) {\n\t\t\t\t\t$duplicate = $ii;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! is_null( $duplicate ) ) {\n\t\t\t\tarray_splice( $tree, $duplicate, 1 );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $tree;\n\n\t}",
"function automap_filter_tree($allowed_ids, &$obj, $directions = null) {\n // Is the current object allowed to remain on the map on its own?\n $remain = isset($allowed_ids[$obj['object_id']]);\n\n if($directions == null) {\n $directions = array('parents', 'childs');\n }\n\n // Loop both directions\n foreach($directions as $dir) {\n foreach($obj['.'.$dir] AS $rel_id => &$rel) {\n // Or does a relative allow this object to remain on the map?\n $rel_remain = automap_filter_tree($allowed_ids, $rel, array($dir));\n\n // If there is no reason for this relative to remain on the map, remove it here\n if(!$rel_remain) {\n unset($obj['.'.$dir][$rel_id]);\n } else {\n // If at least one rel is allowed to remain, the ancestor must stay\n $remain = true;\n }\n }\n }\n\n return $remain;\n}",
"public function destroy($id)\n {\n $tree = Tree::find($id);\n foreach($tree->multipleImage as $data){\n if(file_exists(public_path('uploads/tree/'.$data->tree_image))){\n unlink(public_path('uploads/tree/'.$data->tree_image));\n }\n $data->delete();\n }\n $tree->delete();\n return back()->with('bad_status', 'Tree has been Deleted!');\n }",
"public function mass_unremove_group()\n {\n $ids = json_decode($this->input->post('ids'), true); //convert json into array\n foreach ($ids as $id) {\n $resultat = $this->m_feuille_controle->unremove_group($id);\n }\n }",
"public function deleteLineItems(array $ids);",
"function subtree_ids($id) {\n\t\t// zjistim idcka kategorii v podstromu\n\t\t$category_ids = $this->children($id);\n\t\t$category_ids = Set::extract('/Category/id', $category_ids);\n\t\t\n\t\t$category_ids[] = $id;\n\t\t\n\t\treturn $category_ids;\n\t}",
"public function delete($ids)\n\t{\n\t\t$conditions = array();\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$conditions[] = 'id = ' . (int) $id;\n\t\t}\n\n\t\t$query = $this->db->getQuery(true);\n\n\t\t$query->delete('#__monitor_projects')\n\t\t\t->where($conditions, 'OR');\n\n\t\t$this->db->setQuery($query);\n\n\t\t$this->db->execute();\n\t}",
"public function deleteByFileIds()\n\t{\n\t\tif ( isset( \\IPS\\Request::i()->fileIds ) )\n\t\t{\n\t\t\t$ids = \\IPS\\Request::i()->fileIds;\n\t\t\t\n\t\t\tif ( ! \\is_array( $ids ) )\n\t\t\t{\n\t\t\t\t$try = json_decode( $ids, TRUE );\n\t\t\t\t\n\t\t\t\tif ( ! \\is_array( $try ) )\n\t\t\t\t{\n\t\t\t\t\t$ids = array( $ids );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ids = $try;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( \\count( $ids ) )\n\t\t\t{\n\t\t\t\t\\IPS\\cms\\Media::deleteByFileIds( $ids );\n\t\t\t}\n\t\t}\n\t}",
"public function rm(array &$array, string $path): void\n {\n // This way it will trigger an error if the calculated value is not correct\n $node = null;\n $propertyPath = new PropertyPathBuilder($path);\n $parentLevel = null;\n $currentLevel = &$array;\n $nodes = $propertyPath->getPropertyPath();\n\n if ( ! $nodes instanceof PropertyPathInterface) {\n throw new \\InvalidArgumentException(sprintf('The path \"%s\" doesn\\'t contain any node.', $path));\n }\n\n /** @var string $node */\n foreach ($nodes->getElements() as &$node) {\n $parentLevel = &$currentLevel;\n $currentLevel = &$currentLevel[$node];\n }\n\n if (null !== $parentLevel) {\n unset($parentLevel[$node]);\n }\n }",
"static function del(array &$data, $path) {\n\t\t$keys = explode('.', $path);\n\t\t$last = array_pop($keys);\n\t\tforeach($keys as $k){\n\t\t\tif(isset($data[$k]) && is_array($data[$k])){\n\t\t\t\t$data = & $data[$k];\n\t\t\t}else{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tunset($data[$last]);\n\t}",
"public function delete_directions($id);"
] |
[
"0.6270165",
"0.6194292",
"0.6066862",
"0.60548174",
"0.58779025",
"0.58317536",
"0.5788572",
"0.5753026",
"0.573368",
"0.5706002",
"0.56883955",
"0.5655395",
"0.5626482",
"0.56145024",
"0.56077933",
"0.5597805",
"0.5570342",
"0.5558665",
"0.54790115",
"0.54609257",
"0.5451645",
"0.5450806",
"0.54442054",
"0.5407744",
"0.53978574",
"0.53953415",
"0.53848445",
"0.5382166",
"0.53629917",
"0.5341011"
] |
0.7833796
|
0
|
Send message to given phone number
|
public function send($message, $to_phone);
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function send(string $phone)\n {\n }",
"function send($mobile, $message);",
"function sendSMS($client, $number, $message) {\r\n $client->messages->create(\r\n $number,\r\n array(\r\n \"from\" => \"+16474901643\",\r\n \"body\" => \"Reminder: \".$message\r\n )\r\n );\r\n}",
"function sendMessage($to, $message) {\n\trequire 'lib/Services/Twilio.php';\n\n\t// Twilio REST API version\n\t$version = \"2010-04-01\";\n\n\t// Set our Account SID and AuthToken\n\t$sid = 'ACf8a0a193958a8a46f2dbb700d73efa13';\n\t$token = '0e5008a58d3d5d02cb188c41706e95a0';\n\n\t// A phone number you have previously validated with Twilio\n\t$phonenumber = '12345423138';\n\n\t//to number\n \t$tonum = \"+1\" . $to;\n\n\t// Instantiate a new Twilio Rest Client\n\t$client = new Services_Twilio($sid, $token, $version);\n\n\ttry {\n\t\t// Initiate a new outbound call\n\t\t$call = $client->account->messages->sendMessage(\n\t\t\t$phonenumber, // The number of the phone initiating the call\n\t\t\t$tonum, // The number of the phone receiving call\n\t\t\t$message\n\t\t);\n\t\techo 'Sent message: ';\n\n\n\t} catch (Exception $e) {\n\t\techo 'Error: ' . $e->getMessage();\n\t}\n\n}",
"public function sendSMS($number, $message) {\n return $this->_post(\n $this->_serverPath['sendSMS'],\n array(\n 'phoneNumber' => $this->_formatNumber($number),\n 'text' => $message\n )\n );\n\t}",
"function sendMessage($msg) {\n // Your Account SID and Auth Token from twilio.com/console\n $sid = '<YOUR OWN TWILIO ACCOUNTSID>';\n $token = '<YOUR OWN TWILIO TOKEN>>';\n $client = new Client($sid, $token);\n try {\n $client->messages->create(\n // the number you'd like to send the message to\n '<TWILIIO RECEIPIENT>',\n array(\n // A Twilio phone number you purchased at twilio.com/console\n 'from' => '<TWILIO NUMBER THAT YOU HAVE BEEN GIVEN>',\n // the body of the text message you'd like to send\n 'body' => $msg\n )\n );\n echo \"Sms sent with msg :\\n\".$msg;\n } catch (TwilioException $e){\n echo \"Could not send. Twilio replied with: \" . $e;\n } \n}",
"public function sendSMS($telephone, $message) {\n\t\t\t\n\t\t\tif ($telephone[0] != \"0\") {\n\t\t\t\t$telephone = \"0\".str_replace(\" \",\"\",$telephone);\n\t\t\t}\n\t\t\t\n\t\t\tsite::log(\"Sent an SMS to \".$telephone);\t\t\t\n\t\t\t\n\t\t\t$itaggapi = \"https://secure.itagg.com/smsg/sms.mes\";\n\t\t\t$params=\"usr=cashltd&pwd=qwerty123&from=cash-ltd&to=\".$telephone.\"&type=text&route=7&txt=\".$message;\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $itaggapi); curl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n\t\t\t$returned = curl_exec ($ch);\n\t\t\tcurl_close ($ch);\n\t\t\t// print($returned); // This will be the OK / error message\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"public function send_sms($phone, $message)\n {\n $phone = '254731090832';\n $sms = 'Test messange';\n $senderID = 'SPEEDBALL';\n\n $login = 'SPEEDBALL';\n $password = 's12345';\n\n $clientsmsID = rand(1000, 9999);\n\n $xml_data = '<?xml version=\"1.0\"?><smslist><sms><user>' . $login . '</user><password>' . $password . '</password><message>' . $sms . '</message><mobiles>' . $phone . '</mobiles><senderid>' . $senderID . '</senderid><clientsmsid>' . $clientsmsID . '</clientsmsid></sms></smslist>';\n\n $URL = \"http://messaging.advantasms.com/bulksms/sendsms.jsp?\";\n\n $ch = curl_init($URL);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"$xml_data\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n curl_close($ch);\n\n // return $output;\n }",
"function sendMessageToNumber($number, $message, $client, $myNumber) {\n if ($number != \"\" && $number != NULL && strlen($number) >= 10) {\n $client->account->messages->create(array( \n 'To' => $number, \n 'From' => $myNumber, \n 'Body' => $message, \n ));\n }\n else {\n \n echo \"Cannot send number to null or blank number\";\n }\n}",
"function send_sms($fromNumber){\n global $platform, $RECIPIENT;\n try {\n $requestBody = array(\n 'from' => array ('phoneNumber' => $fromNumber),\n 'to' => array( array('phoneNumber' => $RECIPIENT) ),\n // To send group messaging, add more (max 10 recipients) 'phoneNumber' object. E.g.\n /*\n 'to' => array(\n array('phoneNumber' => $RECIPIENT),\n array('phoneNumber' => 'Recipient-Phone-Number')\n ),\n */\n 'text' => 'Hello World!'\n );\n $endpoint = \"/account/~/extension/~/sms\";\n $resp = $platform->post($endpoint, $requestBody);\n $jsonObj = $resp->json();\n print(\"SMS sent. Message id: \" . $jsonObj->id . PHP_EOL);\n check_message_status($jsonObj->id);\n } catch (\\RingCentral\\SDK\\Http\\ApiException $e) {\n exit(\"Error message: \" . $e->message . PHP_EOL);\n }\n}",
"function sendText($phoneNumber, $textString)\n{\n $textString = urlencode($textString);\n $phoneNumber = intval($phoneNumber);\n $url = 'https://api.mogreet.com/moms/transaction.send?client_id=1316&token=dbd7557a6a9d09ab13fda4b5337bc9c7&campaign_id=28420&to=' . $phoneNumber . '&message=' . $textString . '&format=json';\n $ch = curl_init($url);\n $response = curl_exec($ch);\n curl_close($ch);\n}",
"public function sendSMS($Phoneno,$Message)\n\t{\n //Your authentication key\n $authKey = \"191431AStibz285a4f14b4\";\n\n //Multiple mobiles numbers separated by comma\n $mobileNumber = \"$Phoneno\";\n\n //Sender ID,While using route4 sender id should be 6 characters long.\n $senderId = \"TTNULM\";\n\n //Your message to send, Add URL encoding here.\n $message = urlencode($Message);\n\n //Define route\n $route = \"transactional\";\n\n //Prepare you post parameters\n $postData = array(\n 'authkey' => $authKey,\n 'mobiles' => $mobileNumber,\n 'message' => $message,\n 'sender' => $senderId,\n 'route' => $route\n );\n\n //API URL\n $url=\"https://control.msg91.com/api/sendhttp.php\";\n\n // init the resource\n $ch = curl_init();\n curl_setopt_array($ch, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $postData\n //,CURLOPT_FOLLOWLOCATION => true\n ));\n\n\n //Ignore SSL certificate verification\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n\n //get response\n $output = curl_exec($ch);\n\n //Print error if any\n if(curl_errno($ch))\n {\n echo 'error:' . curl_error($ch);\n }\n\n curl_close($ch);\n\t}",
"public static function send_message($number=\"\", $message=\"\"){\n //encode test message\n $encoded_message = urlencode($message);\n\n //parameterized string for sending message\n $send_string = self::$api.\"From=\".self::$from.\"&To={$number}\".\n \"&Content={$encoded_message}\".\"&ClientId=\".self::$client_id.\n \"&ClientSecret=\".self::$client_secret.\"&RegisteredDelivery=\".\n self::$registered_delivery;\n\n //initialising library for data transfer\n $curl = curl_init();\n curl_setopt_array( $curl,\n array( CURLOPT_URL => $send_string, CURLOPT_RETURNTRANSFER => true,\n CURLOPT_CUSTOMREQUEST => \"GET\"));\n\n //executing the transfer\n $response = curl_exec($curl);\n\n //fetching error if any\n $error = curl_error($curl);\n\n if($error){\n echo \"CURL ERROR #:\". $error;\n } else {\n return $response;\n }\n }",
"function sendSmsMessage($in_phoneNumber, $in_msg)\n\t{\n\t\t//http://api.clickatell.com/http/sendmsg?user=sadasow&password=cogb0e25&api_id=3376817&to=221775312740&text=Message\n\n\t\t//en local via frontlinesms\n\t\t//$url = '/send/sms/'.urlencode(utf8_encode($in_phoneNumber)).'/'.urlencode(utf8_encode($in_msg));\n\t\t//$results = file('http://localhost:8011'.$url);\n\n\t\t//via clickatell\n\t\t$url = urlencode(utf8_encode($in_phoneNumber)).'&text='.urlencode(utf8_encode($in_msg));\n\t\t$results = file('http://api.clickatell.com/http/sendmsg?user=sadasow&password=cogb0e25&api_id=3376817&to='.$url);\n\n\n\t}",
"function send_sms($phoneNo=\"\",$messageText)\r\n\t{\r\n\t\t\t \r\n\t\t\t//Your authentication key\r\n\t\t\t$authKey = \"37734AfiN59oTS557ae3d9\";\r\n\t\t\t \r\n\t\t\t//Multiple mobiles numbers separated by comma\r\n\t\t\t$mobileNumber = $phoneNo;\r\n\t\t\t \r\n\t\t\t//Sender ID,While using route4 sender id should be 6 characters long.\r\n\t\t\t$senderId = \"EOKLER\";\r\n\t\t\t \r\n\t\t\t//Your message to send, Add URL encoding here.\r\n\t\t\t$message = urlencode($messageText);\r\n\t\t\t \r\n\t\t\t//Define route\r\n\t\t\t$route = \"2\";\r\n\t\t\t//Prepare you post parameters\r\n\t\t\t$postData = array(\r\n\t\t\t\t\t'authkey' => $authKey,\r\n\t\t\t\t\t'mobiles' => $mobileNumber,\r\n\t\t\t\t\t'message' => $message,\r\n\t\t\t\t\t'sender' => $senderId,\r\n\t\t\t\t\t'route' => $route\r\n\t\t\t);\r\n\t\t\t \r\n\t\t\t//API URL\r\n\t\t\t$url=\"https://control.msg91.com/sendhttp.php\";\r\n\t\t\t \r\n\t\t\t// init the resource\r\n\t\t\t$ch = curl_init();\r\n\t\t\tcurl_setopt_array($ch, array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => true,\r\n\t\t\tCURLOPT_POST => true,\r\n\t\t\tCURLOPT_POSTFIELDS => $postData\r\n\t\t\t//,CURLOPT_FOLLOWLOCATION => true\r\n\t\t\t));\r\n\t\t\t \r\n\t\t\t//Ignore SSL certificate verification\r\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n\t\t\t//get response\r\n\t\t\t$output = curl_exec($ch);\r\n\t\t\t \r\n\t\t\t//Print error if any\r\n\t\t\tif(curl_errno($ch))\r\n\t\t\t{\r\n\t\t\t\techo 'error:' . curl_error($ch);\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\tcurl_close($ch);\r\n\t\t\treturn $output;\r\n\t\t}",
"public function askPhoneNumber()\n {\n $this->ask('Ваш номер телефона', function (Answer $answer) {\n\n try {\n $contact = $answer->getMessage()->getContact()->getPhoneNumber();\n $this->getBot()->userStorage()->save([\n 'phone_number' => $contact\n ]);\n }catch (\\Exception $e){\n $contact = $answer->getMessage()->getText();\n $this->getBot()->userStorage()->save([\n 'phone_number' => $contact\n ]);\n }\n\n $this->askLocation();\n }, [\n 'reply_markup' => json_encode([\n 'keyboard' => [\n [\n ['text' => 'Отправить контакт', 'request_contact' => true]\n ]\n ],\n 'one_time_keyboard' => true,\n 'resize_keyboard' => true\n ])\n ]);\n }",
"public function sendMessage( $phone_number, $msg_text, $when=NULL ) {\n\t\tif( empty($phone_number) || empty($msg_text) ) return;\n\t\t\n\t\treturn $this->_send( '/sms/send', $phone_number, $msg_text, $when );\n\t}",
"function esms_services_send_message($message, $number, $type) {\n return esms_send_message($message, $number, $type);\n}",
"function L_sendSms ($msg, $id, $numberto) {\n\t\t\n\t\t$result = false;\n\t\t\n\t\t$ch = curl_init(\"http://sms.ru/sms/send\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, array(\n\n\t\t\t\"api_id\"\t\t=>\t$id,\n\t\t\t\"to\"\t\t\t=>\t$numberto,\n\t\t\t\"text\"\t\t=>\ticonv(\"windows-1251\",\"utf-8\",$msg)\n\n\t\t));\n\t\t\n\t\t$body = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t($body != false) ? $result = true : $result = false;\n\t\t\n\t\treturn $result;\n\t\t\n\t}",
"function send_sms($to, $message) {\n\n\tLOG_MSG('INFO',\"send_sms(): START to=[$to]\");\n\n\t// Retrieve SMS Gateway Details\n\t$smsgateway_resp=db_lib_smsgateway_select();\n\tif ( $smsgateway_resp[0]['STATUS'] != 'OK' ) {\n\t\tLOG_MSG('ERROR',\"send_sms(): Error loading sms gateway\");\n\t}\n\n\t// Send SMS only if Gateway is found\n\tif ( $smsgateway_resp[0]['NROWS'] == 1 ) {\n\t\t$plain_message=$message;\n\t\t$smsgateway_id=$smsgateway_resp[0]['smsgateway_id'];\n\n\t\t$status='FAILED';\n\t\t$username=$smsgateway_resp[0]['username'];\n\t\t$password=$smsgateway_resp[0]['password'];\n\t\t$api_key=$smsgateway_resp[0]['api_key'];\n\t\t$default_sender_id=$smsgateway_resp[0]['default_sender_id'];\n\t\t$to=urlencode($to);\n\t\t$message=urlencode($message);\n\t\t$gateway_url=$smsgateway_resp[0]['gateway_url'];\n\n\t\t// Generate the URL base on the provider\n\t\tif ( $smsgateway_resp[0]['name'] == 'SolutionsInfini' ) {\n\t\t\t// http://alerts.sinfini.com/api/web2sms.php?workingkey=##API_KEY##&sender=##DEFAULT_SENDER_ID##&to=##MOBILE_TO##&message=##MESSAGE##\n\t\t\t$search=array('##API_KEY##', '##DEFAULT_SENDER_ID##', '##MOBILE_TO##', '##MESSAGE##');\n\t\t\t$replace=array($api_key, $default_sender_id, $to, $message);\n\t\t\t$url=str_replace($search,$replace,$gateway_url);\n\t\t} elseif ( $smsgateway_resp[0]['name'] == 'SMSGupshup' ) {\n\t\t\t// http://enterprise.smsgupshup.com/GatewayAPI/rest?method=SendMessage&send_to=##MOBILE_TO##&msg=##MESSAGE##&msg_type=TEXT&userid=##USERNAME##&auth_scheme=plain&password=##PASSWORD##&v=1.1&format=text\t\n\t\t\t$search=array('##USERNAME##', '##PASSWORD##', '##MOBILE_TO##', '##MESSAGE##');\n\t\t\t$replace=array($username, $password, $to, $message);\n\t\t\t$url=str_replace($search,$replace,$gateway_url);\n\t\t}\n\n\t\t// Send SMS\n\t\t$ch=curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response=curl_exec($ch);\n\t\tcurl_close($ch); \n\t\tif ( strpos($response,'GID') ) $status='SUCCESS';\n\t\tLOG_MSG('INFO',\"send_sms(): $response\");\n\n\t\t// Add SMS Sent Details\n\t\t$smssent_resp=db_smssent_insert(\n\t\t\t\t\t\t\t$smsgateway_id,\n\t\t\t\t\t\t\t$default_sender_id,\n\t\t\t\t\t\t\t$to,\n\t\t\t\t\t\t\t$plain_message,\n\t\t\t\t\t\t\t$url,\n\t\t\t\t\t\t\t$response,\n\t\t\t\t\t\t\t$status);\n\t\tif ( $smssent_resp['STATUS'] != 'OK' ) {\n\t\t\tLOG_MSG('ERROR',\"send_sms(): Error while inserting in SMSSent talble from=[$from] to=[$to]\");\n\t\t}\n\t}\n\n\tLOG_MSG('INFO',\"send_sms(): END\");\n\treturn true;\n}",
"public function sendSms($number, $message)\n {\n $params = http_build_query(\n array(\n 'action' => 'sendsms',\n 'lgn' => $this->config['login'],\n 'pwd' => $this->config['password'],\n 'msg' => MessageHelper::treatMessage($message),\n 'numbers' => $number,\n )\n );\n\n return CurlHelper::send(self::URL . '?' . $params);\n }",
"protected function sendNumberRequest( string $number ) : void\n {\n $message = \"SEND \" . $this->id . \" 1 \" . $number;\n $this->sendRequest($message);\n }",
"function send_sms($message,$to,$from=null){\n if($from && strlen($from)>11){\n $from = substr($from,0,11);\n }\n $url = $this->api_base_url.\"/messages?app_id=\".$this->app_id.\"&app_secret=\".base64_encode($this->app_secret);\n $data['to'] = $to; \n $data['from']= $from;\n $data['message'] = $message;\n\n $this->result = $this->send_request($url, \"POST\", [],$data, true);\n return ($this->result->success && $this->result->message==\"MESSAGE SENT.\");\n }",
"public function send($mobile,$message){\n\t\t\t\t$this->_mobile = $mobile;\n\t\t\t\t$this->_message = $message;\n\t\t\t\t\n\t\t\t\t// API call to send sms\n\t\t\t\t// Here we are using \"REDSMS.IN\" as our SMS provider . . \t\t\t\n\t\t\t\t$sms = new SMS('test', '123', 'TESTIN'); // first argument is username, second is password, third is Sender ID!!\n\t\t\t\tif($sms->send($this->_mobile, $this->_message)){\n\t\t\t\t\treturn 1; // SENT Successfully!!\n\t\t\t\t}\n\t\t\t\t// If there is some with the SMS API, (Here we are using REDSMS.IN!), We handle the error as below:\n\t\t\t\telse{\n\t\t\t\t\techo 'Red SMS ERROR : ' . $sms->error;\n\t\t\t\t\tSession::delete('OTPCode');\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}",
"public function sendContactMessage(Contact $contact);",
"public function sendText($num, $msg)\n\t{\n\t\t$this->_twilio->account->messages->create(array(\n\t\t\t\"To\" => $num,\n\t\t\t\"From\" => $this->config[\"twilio\"][\"number\"],\n\t\t\t\"Body\" => $msg,\n\t\t));\n\t}",
"public function sendSMS($data)\n {\n Mobily::send($data['mobile'], $data['message']);\n }",
"public function send_sms($to, $message)\n\t{\n\t\t// Are there multiple receivers?\n\t\tif(is_array($to)) $to = implode(',', $to);\n\t\t\n\t\t// Prepare the message\n\t\t//$message = urlencode($message);\n\t\t\n\t\t// Build the request\n\t\t/*$request_old = array(\n\t\t\t\t\t'sender_id'\t=> $this->sms['sender_id'],\n\t\t\t\t\t'token' => $this->sms['token'],\n\t\t\t\t\t'msisdn'\t=> $to,\n\t\t\t\t\t'text'\t\t=> $message,\n 'route' => 'TRANS',\n 'unicode' =>'false',\n 'flash' =>'false'\n //'time' => 200812110950,//date('YmdHi'),\n //'senderid' => 'testSenderID'\n\t\t\t\t);\n */\n \n $request = array(\t\n\t\t\t\t\t'username' => $this->sms['username'],\n 'password' => $this->sms['password'],\n\t\t\t\t\t'type'\t => '0',\n\t\t\t\t\t'dlr'\t => '1',\n\t\t\t\t\t'destination'\t=> $to,\n 'source'\t=> $this->sms['sender_id'],\n\t\t\t\t\t'message'\t=> $message\n );\n \n \n\t\t\n\t\t// cUrl is the preferred method to send the request\n\t\tif($this->curl){\n\t\t\t$ch = curl_init($this->url . '?' . http_build_query($request));\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t//curl_setopt($ch, CURLOPT_TIMEOUT, '5');\n\t\t\t//curl_setopt($ch, CURLOPT_POST, 1);\n\t\t\t//curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n\t\t\t$result = trim(curl_exec($ch));\n \n\t\t} else {\n\t\t\t$request = $this->url . '?' . http_build_query($request);\n\t\t\t$result = file_get_contents($request);\n\t\t}\n\t\t\n\t\t$this->last_reply = $result;\n\t\t\n\t\t// If the reply wasn't empty, it shouldn't contain errors\n\t\tif(!empty($this->last_reply)){\n\t\t\treturn !preg_match(\"/ERR/\", $this->last_reply);\n\t\t}\n\t\t\n\t\t// The reply was empty\n\t\treturn FALSE;\n\t}",
"function send_sms($msg,$phone_number){\r\n /**\r\n * This is for Twilo\r\n */\r\n if(config('sms-gateway',1) == 1){\r\n //require_once path('plugins/sms/pages/Twilio.php');\r\n $sid = config('twilio-account-id',''); // Your Account SID from www.twilio.com/user/account\r\n $token = config('twilio-token-id',''); // Your Auth Token from www.twilio.com/user/account\r\n\r\n // Get the PHP helper library from twilio.com/docs/php/install\r\n //$client = new Services_Twilio($sid, $token);\r\n //$sms = $client->account->sms_messages->create(config('from-twilio-number',''),$phone_number, $msg, array());\r\n\r\n //using curl\r\n $ch = curl_init('https://api.twilio.com/2010-04-01/Accounts/'.$sid.'/Messages.json');\r\n $data = array(\r\n 'To' => $phone_number,\r\n 'From' => config('from-twilio-number',''),\r\n 'Body' => $msg,\r\n );\r\n $auth = $sid .\":\". $token;\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_USERPWD, $auth);\r\n curl_setopt($ch, CURLOPT_USERAGENT , 'Mozilla 5.0');\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n }\r\n elseif(config('sms-gateway',1) == 2){\r\n //46elks\r\n $url = 'https://api.46elks.com/a1/SMS';\r\n $username = config('46elks_app_id');\r\n $password = config('46elks_api_password');\r\n $sms = array('from' => config('sms-from','Lightedphp'),\r\n 'to' => $phone_number,\r\n 'message' => $msg);\r\n\r\n $context = stream_context_create(array(\r\n 'http' => array(\r\n 'method' => 'POST',\r\n 'header' => \"Authorization: Basic \".\r\n base64_encode($username.':'.$password). \"\\r\\n\".\r\n \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n 'content' => http_build_query($sms),\r\n 'timeout' => 10\r\n )\r\n ));\r\n $response = file_get_contents($url, false, $context);\r\n }\r\n elseif(config('sms-gateway',1) == 3){\r\n $url = 'http://api.clickatell.com/http/sendmsg';\r\n $user = config('clickatell-username','');\r\n $password = config('clickatell-password','');\r\n $api_id = config('clickatell-app_id');\r\n $to = $phone_number;\r\n $text = $msg;\r\n $data = array(\r\n 'user' => $user,\r\n 'password'=>$password,\r\n 'api_id'=>$api_id,\r\n 'to'=>$to,\r\n 'text' => $text\r\n );\r\n\r\n // use key 'http' even if you send the request to https://...\r\n $options = array(\r\n 'http' => array(\r\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n 'method' => 'POST',\r\n 'content' => http_build_query($data)\r\n )\r\n );\r\n $context = stream_context_create($options);\r\n $result = file_get_contents($url, false, $context);\r\n if ($result === FALSE) { /* Handle error */ }\r\n return $result;\r\n // return var_dump($result);\r\n }\r\n elseif(config('sms-gateway',4) == 4){\r\n //echo \"Quick sms\";\r\n $url = 'http://www.quicksms1.com/api/sendsms.php';\r\n $user = config('quicksms_username','');\r\n $password = config('quicksms_password','');\r\n $to = $phone_number;\r\n $text = $msg;\r\n $data = array(\r\n 'username' => $user,\r\n 'password'=>$password,\r\n 'sender'=>config('sms-from','Betayan'),\r\n 'message'=>$text,\r\n 'recipient'=>$to,\r\n 'convert'=> 1\r\n );\r\n\r\n // use key 'http' even if you send the request to https://...\r\n $options = array(\r\n 'http' => array(\r\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n 'method' => 'POST',\r\n 'content' => http_build_query($data)\r\n )\r\n );\r\n $context = stream_context_create($options);\r\n $result = file_get_contents($url, false, $context);\r\n\r\n return $result;\r\n // print_r($result);\r\n // exit;\r\n }elseif(config('sms-gateway',1) == 10){\r\n //Text local\r\n $apiKey = config('text-local-api-key','');\r\n $apiKey = urlencode($apiKey);\r\n\r\n // Message details\r\n $numbers = array($phone_number);\r\n $sender = urlencode(config('sms-from','LightedPHP'));\r\n $message = rawurlencode($msg);\r\n\r\n $numbers = implode(',', $numbers);\r\n\r\n // Prepare data for POST request\r\n $data = array('apikey' => $apiKey, 'numbers' => $numbers, \"sender\" => $sender, \"message\" => $message);\r\n\r\n // Send the POST request with cURL\r\n $ch = curl_init('https://api.textlocal.in/send/');\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n // Process your response here\r\n print_r($response);die();\r\n\r\n }\r\n return true;\r\n}",
"function send($number, $message = 'This is a test message', $test = 0){\n\t\t\n\t\t$message = urlencode($message);\n\t\t\n\t\t// Prepare data for POST request\n\t\t$data = \"uname=\".$this->username.\"&pword=\".$this->password.\"&message=\".$message.\"&from=\".$this->from.\"&selectednums=\".$number.\"&info=1&test=\".$test;\n\t\t\n\t\t// Send the POST request with cURL\n\t\t$ch = curl_init($this->apiUrl);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tif(curl_exec($ch)){ //This is the result from Txtlocal\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\t\t\n\t\t}\n\t}"
] |
[
"0.77217644",
"0.7593866",
"0.7270233",
"0.7197894",
"0.7135952",
"0.7100668",
"0.7094956",
"0.70720005",
"0.7049782",
"0.70005345",
"0.69964683",
"0.69235563",
"0.6886794",
"0.6862211",
"0.68184596",
"0.68160784",
"0.67933863",
"0.6779262",
"0.6762309",
"0.67582864",
"0.6747199",
"0.6725311",
"0.6674936",
"0.66641474",
"0.66606635",
"0.66456634",
"0.663961",
"0.6635513",
"0.6633463",
"0.6617422"
] |
0.8439632
|
0
|
Clean URI to keep only true URI, delete script folders and put array keys to 0
|
private function cleanRequestURI()
{
for ($i = 0; $i < sizeof($this->scriptPath); $i++)
{
if ($this->explodedURI[$i] == $this->scriptPath[$i])
{
unset($this->explodedURI[$i]);
}
}
$this->explodedURI = array_values($this->explodedURI);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function cleanUri(){\n return preg_replace('/[^\\da-z\\-\\/\\_]/i', '', filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL));\n }",
"private function fixUri(){\n\t\t$this->uri = rtrim($this->uri,'/');\n\t}",
"function cleanPath($path) {\n // files////janko/mika\n\n while (strpos($path, \"//\") !== FALSE) {\n $path = str_replace(\"//\", \"/\", $path);\n }\n\n return $path;\n}",
"private static function _cleanUri($request_uri)\n {\n //removes everything after, and including, the ?\n $clean_uri = strpos($request_uri,'?') > 0 ? substr($request_uri,0,strpos($request_uri,'?')) : $request_uri;\n\n //remove any unwanted characters\n $clean_uri = Scrubber::washAlphaNumeric($clean_uri,array('-','/','.'));\n\n $paths = explode('/',$clean_uri);\n $count = 0;\n $uri_path = '';\n \n // rebuild path removing extra / and ignoring .\n if (is_array($paths)) {\n foreach ($paths as $path) {\n if (trim($path) && strpos($path,'.') === FALSE) {\n $uri_path .= $path.\"/\";\n }\n }\n } \n\n //remove the final trailing /\n return trim($uri_path) ? substr($uri_path,0,strlen($uri_path)-1) : $uri_path;\n }",
"private function prepareRuta(){\n\t\t$this->uriArray = array_slice(explode('/',$this->uri), $this->webPathNumber,3);\n\t}",
"function getRootUrl($url, $remove_scheme, $remove_www, $remove_path, $remove_last_slash)\n {\n if (filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED))\n {\n $url_array=parse_url($url); //parse URL into arrays like $url_array['scheme'], $url_array['host'], etc\n\n $url=str_ireplace($url_array['scheme'].\"://\", \"\", $url); //make URL without scheme, so no :// is included when searching for first or last /\n\n if ($remove_path==1) //remove everything after FIRST / in URL, so it becomes \"real\" root URL\n {\n $first_slash_position=stripos($url, \"/\"); //find FIRST slash - the end of root URL\n if ($first_slash_position>0) //cut URL up to FIRST slash\n {\n $url=substr($url, 0, $first_slash_position+1);\n }\n }\n else //remove everything after LAST / in URL, so it becomes \"normal\" root URL\n {\n $last_slash_position=strripos($url, \"/\"); //find LAST slash - the end of root URL\n if ($last_slash_position>0) //cut URL up to LAST slash\n {\n $url=substr($url, 0, $last_slash_position+1);\n }\n }\n\n if ($remove_scheme!=1) //scheme was already removed, add it again\n {\n $url=$url_array['scheme'].\"://\".$url;\n }\n\n if ($remove_www==1) //remove www.\n {\n $url=str_ireplace(\"www.\", \"\", $url);\n }\n\n if ($remove_last_slash==1) //remove / from the end of URL if it exists\n {\n while (substr($url, -1)==\"/\") //use cycle in case URL already contained multiple // at the end\n {\n $url=substr($url, 0, -1);\n }\n }\n }\n\n return trim($url);\n }",
"private function normalize()\n {\n $finalUri = '';\n $siteName = '';\n $baseUri = server(\"request_uri\");\n $freeGet = explode(\"?\", $baseUri);\n if (count7($freeGet) > 1) {\n static::$freeGet = $freeGet[1];\n } else {\n static::$freeGet = '';\n }\n $indexFolder = WingedLib::explodePath(WingedLib::clearDocumentRoot());\n $indexFolder = end($indexFolder);\n $explodedUri = WingedLib::explodePath($freeGet[0]);\n $rootFoundInUri = false;\n if ($indexFolder && $explodedUri) {\n if (in_array($indexFolder, $explodedUri)) {\n $rootFoundInUri = true;\n }\n }\n static::$host = WingedLib::convertslash(server(\"server_name\"));\n if (is_int(stripos(static::$host, 'www.'))) {\n static::$haveWwwInRequest = true;\n }\n $changeConcat = false;\n if ($explodedUri) {\n foreach ($explodedUri as $uri) {\n if (!$changeConcat && $rootFoundInUri) {\n $siteName .= '/' . $uri;\n } else {\n $finalUri .= '/' . $uri;\n }\n if ($uri === $indexFolder) {\n $changeConcat = true;\n }\n }\n }\n $siteName = WingedLib::clearPath($siteName);\n $finalUri = WingedLib::normalizePath($finalUri);\n static::$https = \"https://\" . static::$host . '/' . $siteName . \"/\";\n static::$http = \"http://\" . static::$host . '/' . $siteName . \"/\";\n static::$uri = $finalUri;\n if (count7($freeGet) > 1) {\n static::$pureUri = $finalUri . '?' . $freeGet[1];\n } else {\n static::$pureUri = $finalUri;\n }\n if (server('https')) {\n if (server('https') != 'off') {\n static::$protocol = static::$https;\n static::$haveHttpsProtocolInRequest = true;\n } else {\n static::$protocol = static::$http;\n static::$haveHttpsProtocolInRequest = false;\n }\n } else {\n static::$protocol = static::$http;\n static::$haveHttpsProtocolInRequest = false;\n }\n if (server('http_x_forwarded_proto') != false) {\n if (server('http_x_forwarded_proto') === 'https') {\n static::$haveHttpsProtocolInRequest = true;\n static::$protocol = static::$https;\n }\n }\n return $this;\n }",
"function cleanSlash($str){\n $str = implode(\"/\", explode(\"\\\\\", $str));\n while( count(explode(\"//\", $str)) > 1){\n $str = implode(\"/\", explode(\"//\", $str));\n }\n\n return $str;\n}",
"protected static function cleanURI( $uri )\n {\n return preg_replace( '/(^\\/)|(\\/$)/', '', $uri );\n }",
"function ahr_remove_rules_htaccess() {\r\n \r\n $root_dir = get_home_path();\r\n $file = $root_dir . '.htaccess';\r\n $file_content = file_get_contents( $file );\r\n \r\n $random_anchor_number = get_option( 'ahr-random-anchor-number' );\r\n $start_string = \"# Begin Advanced https redirection $random_anchor_number\";\r\n $end_string = \"# End Advanced https redirection $random_anchor_number\";\r\n $regex_pattern = \"/$start_string(.*?)$end_string/s\";\r\n \r\n preg_match( $regex_pattern, $file_content, $match );\r\n \r\n if ( $match[ 1 ] !== null ) {\r\n \r\n $file_content = str_replace( $match[ 1 ], '', $file_content );\r\n $file_content = str_replace( $start_string, '', $file_content );\r\n $file_content = str_replace( $end_string, '', $file_content );\r\n \r\n }\r\n \r\n $file_content = rtrim( $file_content );\r\n file_put_contents( $file, $file_content );\r\n \r\n}",
"private function normalizeExtension()\n {\n $explodedUri = WingedLib::explodePath(static::$uri);\n $dir = WingedLib::normalizePath();\n $beforeConcatDir = WingedLib::normalizePath();\n if ($explodedUri) {\n foreach ($explodedUri as $key => $uriPart) {\n $dir .= $uriPart;\n $dir = WingedLib::normalizePath($dir);\n if (is_directory(WingedLib::clearPath(DOCUMENT_ROOT . $dir) . '/')) {\n unset($explodedUri[$key]);\n $beforeConcatDir = $dir;\n }\n }\n static::$parent = $beforeConcatDir;\n $beforeConcatDir = WingedLib::clearPath($beforeConcatDir);\n\n static::$parentUri = WingedLib::clearPath(WingedLib::clearPath(str_replace($beforeConcatDir, '', static::$uri)));\n if (!static::$parentUri) {\n static::$parentUri = './';\n } else {\n static::$parentUri = './' . static::$parentUri . '/';\n }\n\n if (static::$uri != static::$parentUri) {\n $explodedUri = WingedLib::explodePath(static::$parentUri);\n }\n\n static::$httpsParent = static::$https . $beforeConcatDir . '/';\n static::$httpParent = static::$http . $beforeConcatDir . '/';\n static::$protocolParent = static::$protocol . $beforeConcatDir . '/';\n\n if (static::$freeGet != '') {\n static::$fullUrlProvider = static::$protocol . WingedLib::clearPath(static::$pureUri) . '?' . static::$freeGet;\n } else {\n static::$fullUrlProvider = static::$protocol . WingedLib::clearPath(static::$pureUri);\n }\n if (count7($explodedUri) == 0) {\n static::$controllerName = 'IndexController';\n static::$controllerAction = 'actionIndex';\n static::$isIndex = true;\n } else {\n $explodedUri = array_values($explodedUri);\n $page = $explodedUri[0];\n unset($explodedUri[0]);\n $uriParameters = [];\n foreach ($explodedUri as $key => $value) {\n array_push($uriParameters, $value);\n }\n static::$controllerName = Formater::camelCaseClass($page) . 'Controller';\n if (count($uriParameters) > 0) {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($uriParameters[0]);\n } else {\n static::$controllerAction = 'actionIndex';\n }\n static::$isIndex = true;\n static::$uriParameters = $uriParameters;\n }\n } else {\n static::$parentUri = './';\n static::$httpsParent = static::$https;\n static::$httpParent = static::$http;\n static::$protocolParent = static::$protocol;\n if (static::$freeGet != '') {\n static::$fullUrlProvider = static::$protocol . WingedLib::clearPath(static::$pureUri) . '?' . static::$freeGet;\n } else {\n static::$fullUrlProvider = static::$protocol . WingedLib::clearPath(static::$pureUri);\n }\n static::$isIndex = true;\n static::$controllerName = 'IndexController';\n static::$controllerAction = 'actionIndex';\n static::$parent = './';\n }\n return $this;\n }",
"private function fixWebPath(){\n\t\t$webPathMembers = explode('/', SpanArt::$WEB_PATH);\n\t\t$this->webPathNumber = count($webPathMembers);\n\t}",
"function cleanPath($dir)\r\n{\r\n\t$dir = str_replace('[', '\\[', $dir);\r\n\t$dir = str_replace(']', '\\]', $dir);\r\n\t$dir = str_replace('\\[', '[[]', $dir);\r\n\t$dir = str_replace('\\]', '[]]', $dir);\r\n\t$dir = str_replace('&', '\\&', $dir);\r\n\treturn $dir;\r\n}",
"function remove_dot_segments( $path ) {\n //It excludes any parameters if added to absolute url and provides baseurl\n $inSegs = preg_split( '!/!u', $path );\n $outSegs = array( );\n foreach ( $inSegs as $seg )\n {\n if ( empty( $seg ) || $seg == '.' ) {\n continue;\n }\n if ( $seg == '..' ) {\n array_pop( $outSegs );\n }\n else {\n array_push( $outSegs, $seg );\n }\n }\n $outPath = implode( '/', $outSegs );\n if ( isset($path[0]) && $path[0] == '/' ) {\n $outPath = '/' . $outPath;\n }\n if ( $outPath != '/' &&\n (mb_strlen($path)-1) == mb_strrpos( $path, '/', 'UTF-8' ) ) {\n $outPath .= '/';\n }\n $outPath = str_replace('http:/', 'http://', $outPath);\n $outPath = str_replace('https:/', 'https://', $outPath);\n $outPath = str_replace(':///', '://', $outPath);\n return rawurldecode($outPath);\n }",
"function cleanCache($type=null) {\n\t\t$path = str_replace(url_to_('/',true), Liber::conf('APP_ROOT'), rawurldecode($this->urlPattern));\n\t\tif ( $type ) {\n\t\t\treturn parent::clean( $path.$type.'.xml' );\n\t\t} else {\n\t\t\tforeach( Array('rss2', 'atom') as $filename) {\n\t\t\t\tparent::clean( $path.$filename.'.xml' );\n\t\t\t}\n\t\t}\n\t}",
"function normalize($url) {\n\t\t//$result = preg_replace('%(?<!:/|[^/])/|(?<=&)&|&$|%', '', $url);\n\t\t$result=str_replace(array('://','//',':::'),array(':::','/','://'),$url);\n\t\treturn $result;\n\t}",
"public function parseURI() {\n $uri = explode(\"/\", $this->getRequestURI());\n $rootDIR = array_search($this->getProjectDIR(), $uri);\n\n return array_splice($uri, ($rootDIR+1));\n }",
"private function _sanitize($path) {\n\t\t$path = str_replace('\\\\', '/', $path);\n\t\twhile (strpos($path, '//')) {\n\t\t\t$path = str_replace('//', '/', $path);\n\t\t}\n\t\t\n\t\treturn ($path);\n\t}",
"function strip_File($FileName) {\n\t//$arrItems = array(\" \", \"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"(\",\")\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$arrItems = array(\"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$FileName = str_replace($arrItems, \"_\", $FileName);\n\t$FileName = urldecode($FileName);\n\t$FileName = str_replace(\"%\", \"_\", $FileName);\n\treturn $FileName;\n}",
"public static function normalizeURI($uri)\n{\nreturn str_replace('\\\\','/',$uri);\n}",
"function shNormalizeNonSefUrl($url)\n{\n\t$uri = new JURI($url);\n\tshNormalizeNonSefUri($uri);\n\treturn $uri->toString(array('path', 'query', 'fragment'));\n\n}",
"function prepare_feed_path()\n {\n $url = parse_url($this->feed_url);\n $path = explode(\"/\", $url[\"path\"]);\n $size = sizeof($path);\n if($size>4)\n {\n $path[$size-1] = \"full\";\n $path[$size-2] = \"private\";\n $path = implode(\"/\", $path);\n }\n $this->feed_path_prepared = $path;\n }",
"function clean_request_uri($uri) {\n if (FALSE !== ($pos = strpos($uri, '?'))) {\n $uri = substr($uri, 0, $pos);\n }\n return ltrim($uri, '/');\n }",
"function kc_strip_dangerous_protocols($uri) {\n static $allowed_protocols;\n\n if (!isset($allowed_protocols)) {\n $allowed_protocols = array_flip(array('ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'tel', 'telnet', 'webcal'));\n }\n\n // Iteratively remove any invalid protocol found.\n do {\n $before = $uri;\n $colonpos = strpos($uri, ':');\n if ($colonpos > 0) {\n // We found a colon, possibly a protocol. Verify.\n $protocol = substr($uri, 0, $colonpos);\n // If a colon is preceded by a slash, question mark or hash, it cannot\n // possibly be part of the URL scheme. This must be a relative URL, which\n // inherits the (safe) protocol of the base document.\n if (preg_match('![/?#]!', $protocol)) {\n break;\n }\n // Check if this is a disallowed protocol. Per RFC2616, section 3.2.3\n // (URI Comparison) scheme comparison must be case-insensitive.\n if (!isset($allowed_protocols[strtolower($protocol)])) {\n $uri = substr($uri, $colonpos + 1);\n }\n }\n } while ($before != $uri);\n\n return $uri;\n}",
"private function preprocessUri(string $uri)\n {\n $this->uri = $uri;\n if (strpos($uri, '?') !== false) {\n list($this->rawPath, $queryStr) = explode('?', $uri, 2);\n if ($queryStr) {\n parse_str($queryStr, $this->query);\n }\n } else {\n $this->rawPath = $uri;\n }\n\n $baseUri = $this->getBaseUri();\n $trimmedPath = Strings::removePrefix($this->rawPath, $baseUri);\n if ($baseUri && $trimmedPath == $this->rawPath) { // nothing was trimmed...\n throw new Exception(\"Given URI path '$this->rawPath' is not prefixed with base URI path '$baseUri'.\");\n }\n\n $this->path = array_values(array_filter(explode('/', $trimmedPath)));\n\n if ($this->path && is_dir($this->getPath())) {\n $this->path[] = 'index'; // default file in a directory\n }\n }",
"function spartan_head_cleanup() {\n\t// EditURI link\n\tremove_action( 'wp_head', 'rsd_link' );\n\t// windows live writer\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t// index link\n\tremove_action( 'wp_head', 'index_rel_link' );\n\t// previous link\n\tremove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );\n\t// start link\n\tremove_action( 'wp_head', 'start_post_rel_link', 10, 0 );\n\t// links for adjacent posts\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );\n\t// WP version\n\tremove_action( 'wp_head', 'wp_generator' );\n // remove WP version from css\n add_filter( 'style_loader_src', 'spartan_remove_wp_ver_css_js', 9999 );\n // remove Wp version from scripts\n add_filter( 'script_loader_src', 'spartan_remove_wp_ver_css_js', 9999 );\n\n}",
"public function clearRootAssetMappings();",
"function path_clean($path){\n $path = trim($path);\n $path = str_replace(\"/\",\"\\\\\",$path); // this kills me\n while (strstr($path,\"\\\\\\\\\")) $path = str_replace(\"\\\\\\\\\",\"\\\\\",$path);\n return $path;\n}",
"private function _clean_paths()\n {\n $path_vars = array('dash_path', 'asset_path', 'css_path', 'js_path', 'dash_fldr', 'dash', 'img_path', 'file_path', 'oop_path');\n\n foreach ($path_vars as $var) {\n $this->$var = trim($this->$var);\n }\n }",
"function cleanup_default_rewrite_rules( $rules ) {\n foreach ( $rules as $regex => $query ) {\n if ( strpos( $regex, 'attachment' ) || strpos( $query, 'attachment' ) ) {\n unset( $rules[ $regex ] );\n }\n }\n\n return $rules;\n}"
] |
[
"0.6321798",
"0.611352",
"0.5855571",
"0.5832056",
"0.5793398",
"0.56289124",
"0.56020874",
"0.5601848",
"0.5589342",
"0.55844176",
"0.55585897",
"0.5533815",
"0.5488179",
"0.54852206",
"0.5479955",
"0.5467555",
"0.5425764",
"0.54145586",
"0.5407215",
"0.54049534",
"0.5401746",
"0.53915256",
"0.5374014",
"0.5349786",
"0.53486997",
"0.53373134",
"0.532196",
"0.5321371",
"0.5300763",
"0.52843595"
] |
0.700693
|
0
|
show timeline if user is authenticated
|
public function index() {
if (Auth::check()) {
// get the statuses (own and from friends)
// (but filter out the replies - see Status model!)
$statuses =
Status::notReply()
->where(
function($query) {
return $query->where('user_id', Auth::user()->id)
->orWhereIn('user_id', Auth::user()->friends()->lists('id'));
})
->orderBy('created_at', 'desc')
->paginate(10);
// provide statuses and replies to the view
return view('timeline.index')
->with('statuses', $statuses);
}
// for guests, simply show the home page
return view('home');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function index()\n {\n $user_id = auth()->user()->id;\n $user = User::find($user_id);\n return view('timeline')->with('user',$user);\n }",
"function timeline()\n\t{\n\t\t$this->load->view('orientacao/timeline');\n\t}",
"public function information() \n\t{\n UserModel::authentication();\n\n\t\t//get the activity\n\t\t$timeline = ActivityModel::timeline();\n\t\t\n $this->View->Render('user/timeline', ['timeline' => $timeline]);\n }",
"public function timeline()\n {\n return view('pages.example_pages.timeline');\n }",
"public function index()\n {\n\n if (Session::has('oauth_request_token')){\n\n $credentials = Twitter::getCredentials();\n\n if (is_object($credentials) && !isset($credentials->error))\n {\n $feeds = Twitter::getUserTimeline(['count' => 20, 'format' => 'json']);\n $tweets = json_decode($feeds, true);\n return view('home',$tweets);\n }\n else\n {\n return redirect(\"/feeds\");\n }\n }\n else\n {\n return redirect(\"/feeds\");\n }\n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=>['showTimeline']]);//except those methods, non authed user cannot access\n\n }",
"public function userTimeline($user, $options = []);",
"public function twitterUserTimeLine(Request $request)\n {\n $name = $request->name;\n session(['name' => $name]);\n\n //$data = Twitter::getHomeTimeline(['count' => 10, 'format' => 'array']);\n $data = Twitter::getUserTimeline(['screen_name' => $name, 'count' => 20, 'format' => 'array']);\n\n\n //dd($data);\n\n return view('twitter',compact('data'));\n }",
"public function profileActivityLogAction()\r\n {\r\n $em = $this->getDoctrine()->getEntityManager();\r\n\r\n $tbUserActivities = $em->getRepository('YilinkerCoreBundle:UserActivityHistory');\r\n $user = $this->getUser();\r\n $timeline = $tbUserActivities->getTimelinedActivities($user->getId());\r\n\r\n $data = compact('timeline');\r\n\r\n return $this->render('YilinkerFrontendBundle:Profile:profile_activity_log.html.twig', $data);\r\n }",
"function timelineold($userName = false){\n $sk = array();\n $uid = $this->session->userdata('user_id');\n \n if(!empty($userName))\n {\n $uid = $userName;\n $sk['timeline']['wall_user_id'] = $userName;//TIMELINE ID IS USER_ID and is double md5 ed\n }\n // Login verification and user stats update \n \n $sk['logged'] = false;\n $user = null;\n $config['site_url'] = base_url();\n $config['theme_url'] = '';\n $config['script_path'] = str_replace('index.php', '', $_SERVER['PHP_SELF']);\n $config['ajax_path'] = base_url() . 'ajax/socialAjax';\n $sk['config'] = $config;\n $privacyArray='';\n if ($this->socialkit->SK_isLogged()) {\n $user = $this->socialkit->SK_getUser($uid, true);\n if(!isset($user) || empty($user)){\n show_404();\n }\n //echo '<pre>'; print_r($user); die;\n if (!empty($user['id']) && $user['type'] == \"user\") {\n $sk['user'] = $user; \n $privacyArray = $this->model_user->getPrivacyOptions();\n $sk['privacyArray'] = $privacyArray; \n $sk['logged'] = true;\n }\n $data['sk'] = $sk;\n $data['privacyArray'] = $privacyArray;\n //pr($sk); die;\n $this->load->view('user/timeline', $data); \n } else {\n redirect(base_url('login').'?url='.base64_encode(uri_string()) );\n }\n }",
"public function index(): AnonymousResourceCollection\n {\n return TimelineResource::collection(\n $this->user->timeline()\n ->with(['pictures', 'videos', 'geo', 'links'])\n ->paginate(request()->get('per_page') ?? 15)->appends(request()->all())\n );\n }",
"public function viewAction()\n {\n // Check front disable\n if ($this->config('disable_front')) {\n return $this->jumpToDenied(__('View information is disable'));\n }\n\n $page = $this->params('page', 1);\n $limit = Pi::config('list_limit', 'user');\n $offset = (int)($page - 1) * $limit;\n $uid = _get('uid');\n\n Pi::service('authentication')->requireLogin();\n\n // Get timeline\n $count = Pi::api('timeline', 'user')->getCount($uid);\n $timeline = Pi::api('timeline', 'user')->get($uid, $limit, $offset);\n\n // Get timeline meta list\n $timelineMetaList = Pi::api('timeline', 'user')->getList();\n\n // Set timeline meta\n foreach ($timeline as &$item) {\n if (!isset($timelineMetaList[$item['timeline']])) {\n continue;\n }\n $item['icon'] = $timelineMetaList[$item['timeline']]['icon'];\n $item['title'] = $timelineMetaList[$item['timeline']]['title'];\n }\n\n // Get user base info\n $user = Pi::api('user', 'user')->get(\n $uid,\n ['name', 'country', 'city', 'time_activated'],\n true,\n true\n );\n $user['name'] = isset($user['name']) ? $user['name'] : null;\n\n // Set paginator\n $paginatorOption = [\n 'count' => $count,\n 'limit' => $limit,\n 'page' => $page,\n 'controller' => 'home',\n 'action' => 'view',\n 'uid' => $uid,\n ];\n $paginator = $this->setPaginator($paginatorOption);\n\n $this->view()->assign([\n 'uid' => $uid,\n 'name' => 'homepage',\n 'timeline' => $timeline,\n 'paginator' => $paginator,\n 'user' => $user,\n ]);\n\n $this->view()->setTemplate('home-index');\n $this->view()->assign('view', true);\n $this->view()->headTitle(sprintf(__('%s activities'), $user['name']));\n $this->view()->headdescription(sprintf(__('View %s activities'), $user['name']), 'set');\n $this->view()->headkeywords($this->config('head_keywords'), 'set');\n }",
"public function timeline() {\n // Include all the user's posts\n $ids = $this->follows()->pluck('id');\n $ids->push($this->id);\n // And the posts from the people that he/she follows\n return Post::whereIn('user_id', $ids)\n ->withLikes()\n ->latest()\n ->paginate(10);\n }",
"function timeline($userName = false, $page=1)\n {\n $userInfo = array(); \n if(!empty($userName)){\n $uid = $userName;\n $userInfo['timeline']['wall_user_id'] = $userName;//TIMELINE ID IS USER_ID and is double md5 ed\n } else {\n\t\t\t$uid = MD5(MD5($this->session->userdata('user_id')));\n\t\t\t$userInfo['timeline']['wall_user_id'] = MD5(MD5($this->session->userdata('user_id')));//TIMELINE ID IS USER_ID and is double md5 ed\n\t\t}\n // Login verification and user stats update \n $userInfo['logged'] =false;\n $user =null;\n $config['site_url'] =base_url();\n $config['theme_url'] ='';\n $config['script_path'] =str_replace('index.php', '', $_SERVER['PHP_SELF']);\n $config['ajax_path'] =base_url() . 'ajax/socialAjax';\n $userInfo['config'] =$config;\n if ($this->socialkit->SK_isLogged()) {\n $user = $this->socialkit->SK_getUser($uid, true);\n if(!isset($user) || empty($user)){\n show_404();\n }\n if (!empty($user['id']) && $user['type'] == \"user\") { \n $leftBarSide = $this->commonTimelineQry($uid);\n $userInfo['user'] = $user; \n $userInfo['logged'] = true;\n \n ### Posted Jobs ###\n $perpage = 10;\n $page = ($this->uri->segment(4)) ? $this->uri->segment(4) : 1; \n $offset = ($page - 1) * $perpage;\n $totalRecQry = $this->module->getCustomQryRow(\"SELECT COUNT(*) as numRows FROM jobs_list WHERE jobs_list.status='1' AND jobs_list.added_by='0' AND md5(md5(jobs_list.userid)) = '\".$uid.\"'\");\n $totalRecords = $totalRecQry['numRows'];\n $jobPosted = $this->jobs_model->postedJobList($offset,$perpage,$uid,'yes',true); \n \n }\n\t\t\t$userInfo['privacyArray'] = $this->model_user->getPrivacyOptions();\n\t\t\t\n $data = array(\n 'userInfo'=>$userInfo,\n 'totalRecords'=>$totalRecords,\n 'timelineJobInfo'=>$jobPosted\n );\t\t\t\t\n $data = array_merge($data,$leftBarSide);\n $this->load->view('user/timelinenew', $data); \n } else {\n redirect(base_url('login').'?url='.base64_encode(uri_string()));\n }\n }",
"public function index()\n {\n $perpage = isset($_GET['perpage'])?$_GET['perpage']:5;\n $pertanyaan = Pertanyaan::orderBy('created_at', 'desc')->paginate($perpage);\n // $get = Pertanyaan::status();\n return view('pertanyaan.timeline', compact('pertanyaan','perpage'));\n }",
"function alltimeAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\n\t\t$oView = new userView($this);\n\t\t$oView->showAlltimeLeaderboard();\n\t}",
"public function getEdittimeline(){\n\n\t\t$room_type_id = Session::get('room_id');\n\t\t$service_id = Session::get('service_id');\n\n\t\t$start = Calendar::where('room_type_id','=',$room_type_id)\n\t\t\t\t\t->where('service_id','=',$service_id)\n\t\t\t\t\t->orderBy('start_date')\n\t\t\t\t\t->select('start_date')\n\t\t\t\t\t->first();\n\t\t$end = Calendar::where('room_type_id','=',$room_type_id)\n\t\t\t\t\t->where('service_id','=',$service_id)\n\t\t\t\t\t->orderBy('start_date', 'DESC')\n\t\t\t\t\t->select('start_date')\n\t\t\t\t\t->first();\n\t\treturn View::make('calendar.edittimeline')\n\t\t\t->with('room_type_id', $room_type_id)\n\t\t\t->with('service_id', $service_id )\n\t\t\t->with('start', $start)\n\t\t\t->with('end', $end);\n\t}",
"public function timeline_tasks()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user);\n\n $task = factory(Task::class)->create();\n \n// $task = Task::create([\n// 'name' => 'New Task',\n// 'description' => 'prova',\n// 'completed' => true,\n// 'user_id' => $user->id\n// ]);\n \n// $task2 = Task::find($task->id);\n\n $response = $this->get('tasks/timeline');\n\n $task_event = TaskEvent::all();\n\n $response->assertSuccessful();\n $response->assertViewIs('tasks.timeline');\n $response->assertViewHas('task_event', $task_event);\n $response->assertSee(\"User \".$user->name.\" created task \".$task->name.\" at \".$task->created_at);\n $response->assertSee(\"User \".$user->name.\" updated task \".$task->name);\n $response->assertSee(\"User \".$user->name.\" deleted task \".$task->name);\n }",
"public function index()\n {\n $user = Auth::user();\n\n if($user->hasRole('student')){\n $dashboard = Dashboard::firstOrCreate([\n 'class_id'=>$user->class_id,\n 'session_id' => $user->session_id\n ]);\n $posts = $dashboard->posts()->orderBy('created_at','desc')->paginate();\n return view('student.dashboard', compact('posts'));\n }\n if($user->hasRole('teacher')){\n return view('teacher.dashboard');\n }\n\n }",
"public function homeTimeline($options = []);",
"function __construct() {\n parent::__construct();\n $CI = & get_instance();\n $currentUser = $CI->session->userdata(\"currentUser\");\n $currentUser['loggedIn'] = $CI->session->userdata(\"loggedIn\");\n if ($currentUser['loggedIn'] == TRUE) {\n redirect(base_url('Profile/timeline'));\n }\n else {\n return TRUE;\n }\n }",
"public function show()\n {\n $user = auth()->user();\n if ($user->user_type === 'admin' || $user->user_type === 'super_admin') {\n\n $condition = [\n ['deleted_at', null]\n ];\n $live_streams = $this->live_stream->get_all($condition);\n } else {\n\n $condition = [\n ['user_id', $user->unique_id]\n ];\n $live_streams = $this->live_stream->get_all($condition);\n }\n $view = [\n 'live_streams' => $live_streams,\n 'user' => $user,\n ];\n\n return view('dashboard.view_live_streams', $view);\n }",
"function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }",
"public function activities() {\n \n // Verify if is a team's member\n if ( $this->session->userdata( 'member' ) && !get_user_option('display_activities') ) {\n redirect('user/app/dashboard');\n }\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n // Load view/user/activities.php file\n $this->body = 'user/activities';\n $this->user_layout();\n }",
"public function getTwitterTimeline($username){\n $perpage = 5;\n //Define response array\n $response = array(\n \"success\" => false,\n \"message\" => \"\",\n \"data\"=>array()\n );\n \n $user = User::where(\"username\",\"=\",$username)->first();\n \n //Checking if user exist in database\n if( !$user instanceof User){\n $response[\"message\"] =trans(\"app.user_no_exist\");\n return Response::json($response);\n }\n\n //Is no owner, can't view hidden tweets\n\n if (!Auth::guest() && Auth::user()->id != $user->id) {\n $tweets = $user->get_tweets($perpage, true)->toArray();\n } else {\n $tweets = $user->get_tweets($perpage)->toArray();\n }\n $response[\"message\"] = trans(\"app.loaded_tweets\",array(\"count\"=>count($tweets[\"data\"] )));\n $response[\"success\"] = true;\n $response[\"data\"] = $tweets;\n return Response::json($response);\n }",
"public function index() {\n \tif(!$this->user)\n \t\n \t{\n \t\t\n \t\t echo \"Members only. <a href='/users/login'>Login</a>\";\n \n \t\t # Return will force this method to exit here so the rest of the code won't be executed and the profile view won't be displayed.\n \t\t return false;\n\t\n\t }\n\t \t\t\n\t\t# Any method that loads a view will commonly start with this\n\t\t# First, set the content of the template with a view file\n\t\t\t$this->template->content = View::instance('v_calendar');\n\t\t# Now set the <title> tag\n\t\t\t$this->template->title = \"Event Calendar of \".$this->user->first_name;\t\t\n\t\n\t\t# If this view needs any JS or CSS files, \n\t\t# add their paths to this array so they will get loaded in the head\n\t\t\t$client_files = Array(\n\t\t\t\t\t\t\"\"\n\t );\n\t \n\t \t$this->template->client_files = Utils::load_client_files($client_files); \n\t \t\t\n\t\t# Render the view\n\t\t\techo $this->template;\n\n\t}",
"public function index()\n\t{\n// if( ! Auth::check() ) return Redirect::home();\n\n $statuses = $this->statusesRepository->getFeedForUser(Auth::user());\n\n return View::make('statuses.index', compact('statuses'));\n\t}",
"public function index()\n {\n if (!Sentry::check()) {\n // User is not logged in, or is not activated\n return Redirect::route('landing');\n } else {\n return View::make('calendar.index');\n }\n }",
"function loggedin() {\n $this->checkAccess('user',false,false);\n\n $template = new Template;\n $user = new User($this->db);\n\n //get user details\n $user->getByEmail($this->f3->get('SESSION.email'));\n $this->f3->set('user', $user);\n\n //get user followers\n $this->f3->set('followers', $user->getUserFollowers($this->f3->get('SESSION.cid'))[0]);\n\n //get user waiting position\n $this->f3->set('waitrank', $user->getUserWaitPosition($this->f3->get('SESSION.cid'))[0]);\n\n echo $template->render('header.html');\n echo $template->render('user/user.html');\n echo $template->render('footer.html');\n }",
"public function index()\n {\n $user_id=auth()->user()->id;\n $user=User::find($user_id);\n return view('dashboard')->with('posts',$user->posts);\n /* $user_status=auth()->user()->status;\n if ($user_status == 1){\n $user_id=auth()->user()->id;\n $user=User::find($user_id);\n return view('dashboard')->with('posts',$user->posts);\n }else{\n // return redirect('/pages');\n //Auth::guard()->logout(); \n $message=\"You account has not yet been activated or has been suspended\";\n return view('pages.index')->with('message',$message);\n }*/\n }"
] |
[
"0.7102361",
"0.6572226",
"0.6555817",
"0.6537162",
"0.64338726",
"0.63542575",
"0.6208031",
"0.62060237",
"0.6161497",
"0.6125815",
"0.608175",
"0.6073835",
"0.6030593",
"0.60299206",
"0.5875722",
"0.5867382",
"0.57843953",
"0.5781685",
"0.5758633",
"0.5729637",
"0.5695631",
"0.56917167",
"0.5679757",
"0.5676593",
"0.56483936",
"0.56435996",
"0.5633346",
"0.5572348",
"0.55719805",
"0.55700445"
] |
0.66265607
|
1
|
Create the user model test subject.
|
public function createUser()
{
$this->user = factory(Easel\Models\User::class)->create();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testCreateSubject()\n {\n echo \"\\nTesting Subject creation...\";\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }",
"public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }",
"public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance(['_getArgsForDefinition']);\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME, $subject,\n 'Subject is not a valid instance'\n );\n }",
"public function testCreateUser()\n {\n }",
"protected function setUp()\n {\n parent::setUp();\n\n $this->userModel = $this->createUser([\n 'email' => '[email protected]',\n 'name' => 'John Doe'\n ]);\n }",
"public function setUp() {\n $this->user = new \\App\\Models\\User;\n }",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'Subject is not a valid instance.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Modular\\Module\\ModuleInterface',\n $subject,\n 'Test subject does not implement expected interface.'\n );\n }",
"function &buildTestSubject($type, $class) {\n\t\tClassRegistry::flush();\n\t\tApp::import($type, $class);\n\t\t$class = $this->getRealClassName($type, $class);\n\t\tif (strtolower($type) == 'model') {\n\t\t\t$instance =& ClassRegistry::init($class);\n\t\t} else {\n\t\t\t$instance =& new $class();\n\t\t}\n\t\treturn $instance;\n\t}",
"public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Output\\TemplateInterface',\n $subject,\n 'Test subject does not implement expected parent interface.'\n );\n }",
"public function run()\n {\n //Provisional\n $subject = new \\App\\Subject();\n $subject->name = 'Soporte Técnico';\n $subject->save();\n\n $subject = new \\App\\Subject();\n $subject->name = 'Ofimática';\n $subject->save();\n\n $subject = new \\App\\Subject();\n $subject->name = 'Metodología de la Programación';\n $subject->save();\n }",
"public function actionCreate() {\n $test = $this->tests->add($this->user->id);\n $values['test_id'] = $test->id;\n $this->questions->add($values);\n $this->redirect('Test:edit', $test->id);\n }",
"public function create()\n\t{\n // Just hard coding some arbitrary value for now...\n $test = new Test;\n $test->email = '[email protected]';\n\n if($test->save()) {\n return 'Saved.';\n }\n\t}",
"public function run()\n {\n $teacher = Role::whereName('teacher')->first();\n $subject1 = Subject::whereName('Advanced Physics')->first();\n $subject2 = Subject::whereName('Ordinary Physics')->first();\n $subject3 = Subject::whereName('Ordinary Biology')->first();\n User::create([\n 'last_name' => 'Magezi',\n 'first_name' => 'Peter',\n 'given_name' => 'Clever',\n 'email' => '[email protected]',\n 'username' => 'mpc1',\n 'slug' => 'magezi',\n 'password' => '123456',\n 'remember_token' => Str::random(10)\n ]);\n $user = new User();\n $user->where('email', '[email protected]')->first()->roles()->detach($teacher);\n $user->where('email', '[email protected]')->first()->roles()->attach($teacher);\n\n $user->where('email', '[email protected]')->first()->subjects()->detach([$subject1->id, $subject2->id, $subject3->id]);\n $user->where('email', '[email protected]')->first()->subjects()->attach([$subject1->id, $subject2->id, $subject3->id]);\n }",
"protected function setupUser(): void\n {\n $this->createTestUser(true, true);\n\n // Create test role\n $fm = $this->ci->factory;\n $fm->create(Group::class, [\n 'slug' => 'foo',\n 'name' => 'bar',\n ]);\n }",
"public function createUser(){\n\n $t = new QuestionsModel();\n $questions = $t->where([\"test_id\" => $_POST[\"test_id\"]]);\n\n $amount = 0;\n\n if($questions) {\n $amount = count($questions);\n }\n\n $params = [\n \"user_name\" => $_POST[\"user_name\"],\n \"test_id\" => $_POST[\"test_id\"],\n \"test_key\" => $_POST[\"hash\"],\n \"test_length\" => $amount\n ];\n\n $u = new UserModel();\n $entry = $u->insert($params);\n\n $response = [\n \"success\" => 1,\n \"payload\" => $entry\n ];\n\n die(json_encode($response));\n }",
"public function setup(): void\n {\n\n parent::setUp();\n $this->user = factory(User::class)->create();\n $this->course = factory(Course::class)->create(['user_id' => $this->user->id]);\n $this->student_user = factory(User::class)->create();\n $this->student_user->role = 3;\n\n $this->student_user_2 = factory(User::class)->create();\n $this->student_user_2->role = 3;\n $this->student_user_ids = [$this->student_user->id, $this->student_user_2->id];\n $this->section = factory(Section::class)->create(['course_id' => $this->course->id]);\n\n $this->assignment = factory(Assignment::class)->create(['course_id' => $this->course->id]);\n $this->assignUserToAssignment($this->assignment->id, 'course', $this->course->id);\n $this->assign_tos = [\n [\n 'groups' => [['value' => ['course_id' => $this->course->id], 'text' => 'Everybody']],\n 'available_from' => '2020-06-10 09:00:00',\n 'available_from_date' => '2020-06-10',\n 'available_from_time' => '09:00:00',\n 'due' => '2020-06-12 09:00:00',\n 'due_date' => '2020-06-12',\n 'due_time' => '09:00:00',\n 'final_submission_deadline' => '2021-06-12 09:00:00',\n 'final_submission_deadline_date' => '2021-06-12',\n 'final_submission_deadline_time' => '09:00:00'\n ]\n ];\n $this->assignment_info = ['course_id' => $this->course->id,\n 'name' => 'First Assignment',\n 'assign_tos' => $this->assign_tos,\n 'scoring_type' => 'p',\n 'source' => 'a',\n 'default_points_per_question' => 2,\n 'students_can_view_assignment_statistics' => 0,\n 'include_in_weighted_average' => 1,\n 'late_policy' => 'not accepted',\n 'assessment_type' => 'delayed',\n 'default_open_ended_submission_type' => 'file',\n 'instructions' => 'Some instructions',\n \"number_of_randomized_assessments\" => null,\n 'notifications' => 1,\n 'assignment_group_id' => 1,\n 'file_upload_mode' => 'both'];\n\n foreach ($this->assign_tos[0]['groups'] as $key => $group) {\n $group_info = [\"groups_$key\" => ['Everybody'],\n \"due_$key\" => '2020-06-12 09:00:00',\n \"due_date_$key\" => '2020-06-12',\n \"due_time_$key\" => '09:00:00',\n \"available_from_$key\" => '2020-06-10',\n \"available_from_date_$key\" => '2020-06-12',\n \"available_from_time_$key\" => '09:00:00',\n \"final_submission_deadline_date_$key\" => '2021-06-12',\n \"final_submission_deadline_time_$key\" => '09:00:00'];\n foreach ($group_info as $info_key => $info_value) {\n $this->assignment_info[$info_key] = $info_value;\n }\n }\n\n\n $this->question = factory(Question::class)->create(['page_id' => 1]);\n\n\n $this->assignment_question_id = DB::table('assignment_question')->insertGetId([\n 'assignment_id' => $this->assignment->id,\n 'question_id' => $this->question->id,\n 'points' => 10,\n 'order' => 1,\n 'open_ended_submission_type' => 'file'\n ]);\n\n }",
"public function testCreate()\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n //test creation as admin\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with admin');\n\n //test creation as user\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with user');\n\n\n\n }",
"public function run()\n {\n Subject::factory()->times(count(SubjectFactory::$subjects))->create();\n }",
"public function testMeetingCreatePost()\n {\n $user = factory(App\\User::class)->create();\n }",
"public function testCreateTestSuite()\n {\n Artisan::call('migrate');\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->seePageIs('/library')\n ->click('#newSuite')\n ->seePageIs('/library/testsuite/create')\n ->type('TestSuite1', 'name')\n ->type('someDescription', 'description')\n ->type('someGoals', 'goals')\n ->press('submit');\n\n $this->seeInDatabase('TestSuite', [\n 'Name' => 'TestSuite1',\n 'TestSuiteDocumentation' => 'someDescription',\n 'TestSuiteGoals' => 'someGoals'\n ]);\n }",
"public function test_user_sync_on_pm_user_create() {\n global $CFG, $DB;\n require_once($CFG->dirroot.'/course/lib.php');\n require_once($CFG->dirroot.'/elis/program/lib/setup.php');\n require_once(elispm::lib('data/classmoodlecourse.class.php'));\n require_once(elispm::lib('data/course.class.php'));\n require_once(elispm::lib('data/pmclass.class.php'));\n require_once(elispm::lib('data/user.class.php'));\n\n // Configure the elis enrolment plugin.\n $roleid = $DB->get_field('role', 'id', array(), IGNORE_MULTIPLE);\n set_config('roleid', $roleid, 'enrol_elis');\n\n $user = new user(array(\n 'idnumber' => 'testuseridnumber',\n 'username' => 'testuserusername',\n 'firstname' => 'testuserfirstname',\n 'lastname' => 'testuserlastname',\n 'email' => '[email protected]',\n 'country' => 'CA'\n ));\n $user->save();\n\n $course = new course(array(\n 'name' => 'testcoursename',\n 'idnumber' => 'testcourseidnumber',\n 'syllabus' => ''\n ));\n $course->save();\n\n $class = new pmclass(array('courseid' => $course->id, 'idnumber' => 'testclassidnumber'));\n $class->save();\n\n $category = new stdClass;\n $category->name = 'testcategoryname';\n $category->id = $DB->insert_record('course_categories', $category);\n // Create the associated context.\n context_coursecat::instance($category->id);\n\n $mdlcourse = new stdClass;\n $mdlcourse->category = $category->id;\n $mdlcourse->fullname = 'testcoursefullname';\n $mdlcourse = create_course($mdlcourse);\n\n // Associate class instance to Moodle course.\n $classmoodlecourse = new classmoodlecourse(array('classid' => $class->id, 'moodlecourseid' => $mdlcourse->id));\n $classmoodlecourse->save();\n\n // Run the enrolment create action.\n $record = new stdClass;\n $record->context = 'class_testclassidnumber';\n $record->user_username = 'testuserusername';\n\n $importplugin = rlip_dataplugin_factory::factory('rlipimport_version1elis');\n $importplugin->fslogger = new silent_fslogger(null);\n $importplugin->class_enrolment_create($record, 'bogus', 'testclassidnumber');\n\n // Validate the enrolment.\n $enrolid = $DB->get_field('enrol', 'id', array('enrol' => 'elis', 'courseid' => $mdlcourse->id));\n $this->assertNotEquals(false, $enrolid);\n\n $mdluserid = $DB->get_field('user', 'id', array('username' => 'testuserusername'));\n $this->assertNotEquals(false, $mdluserid);\n\n $this->assertTrue($DB->record_exists('user_enrolments', array(\n 'enrolid' => $enrolid,\n 'userid' => $mdluserid\n )));\n\n // Validate the role assignment.\n $mdlcoursecontext = context_course::instance($mdlcourse->id);\n $this->assertTrue($DB->record_exists('role_assignments', array(\n 'roleid' => $roleid,\n 'contextid' => $mdlcoursecontext->id,\n 'userid' => $mdluserid\n )));\n }",
"public function actionCreate()\n\t{\n\t\t$this->subPageTitle = 'Thêm mới giáo viên';\n\t\t$model = new User;\n\t\t$teacher = new Teacher; \n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\t\t$classSubjects = Subject::model()->generateSubjects();\n\t\t$abilitySubjects = $teacher->abilitySubjects();//Subjects ability of teacher\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$teacher_values = $_POST['User'];//Teacher values\n\t\t\t$teacher_profile_values = $_POST['Teacher'];//Teacher profile values\n\t\t\tif(isset($_POST['abilitySubjects'])){\n\t\t\t\t$abilitySubjects = $_POST['abilitySubjects'];//Subject ability\n\t\t\t}\n\t\t\t$teacher_values['role'] = User::ROLE_TEACHER;\n\t\t\tif(trim($teacher_values['birthday'])==''){\n\t\t\t\tunset($teacher_values['birthday']);\n\t\t\t}\n\t\t\t$model->attributes = $teacher_values;\n\t\t\t$model->passwordSave = $teacher_values['password'];\n\t\t\t$common = new Common();\n\t\t\t$dir = \"media/uploads/profiles\";\n\t\t\t$profilePicture = $common->uploadProfilePicture(\"profilePicture\",$dir);\n\t\t\tif($profilePicture !== false){\n\t\t\t\t$model->profile_picture=$profilePicture;\n\t\t\t}\n $transaction = Yii::app()->db->beginTransaction();\n try{\n if($model->save()){\n $teacher->attributes = $teacher_profile_values;\n $teacher->user_id = $model->id;\n if($teacher->save()){\n $teacher->saveAbilitySubjects($abilitySubjects);\n $transaction->commit();\n $this->redirect(array('index'));\n } else {\n throw new Exception('teacher_not_saved');\n }\n } else {\n throw new Exception('user_not_saved');\n }\n } catch(Exception $e){\n $transaction->rollback();\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'teacher'=>$teacher,\n\t\t\t'classSubjects' => $classSubjects,\n\t\t\t'abilitySubjects' => $abilitySubjects,\n\t\t));\n\t}",
"public function testShouldCreateANewUser()\n {\n $user = factory(User::class)->create();\n\n $role = Role::where(\"name\", \"admin\")->first();\n $user->attachRole($role);\n\n $this->actingAs($user);\n\n $invitationLink = (new CreateInvitationLinkService($user))->execute([\n \"type\" => \"STUDENT\",\n ]);\n\n $createdUser = (new CreateUserService())->execute([\n \"name\" => $this->faker->name,\n \"email\" => $this->faker->unique()->safeEmail,\n \"password\" => \"12345678\",\n \"hash\" => $invitationLink->hash,\n ]);\n\n $this->assertTrue(is_numeric($createdUser->id));\n }",
"public static function createTestUser()\n\t{\n\t\tKinvey::setAuthMode('app');\n\t\t$user = new User();\n\t\t$user->setRawAttributes(array(\n\t\t\t'email'\t => '[email protected]',\n\t\t\t'first_name'=> 'Test',\n\t\t\t'last_name' => 'Guy',\n\t\t\t'password' \t=> str_random(8),\n\t\t\t'original' => 'baz'\n\t\t));\n\t\t$user->save();\n\t\tKinvey::setAuthMode('admin');\n\t\treturn $user;\n\t}",
"public function testCreateUser()\n {\n $num = rand(10, 1000);\n $userData = [\n \"name\" => \"John Doe $num\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345\",\n \"org_id\" => 1\n ];\n $this->json('POST', 'api/user/create', $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }",
"public function create()\n {\n $users = User::all();\n $teachers = [];\n foreach($users as $user){\n if($user->hasRole('Teacher')){\n $teachers[] = $user;\n }\n }\n\n $teachers = array_pluck($teachers, 'email', 'id');\n\n $classrooms = Classroom::all();\n $classrooms = array_pluck($classrooms, 'name', 'id');\n\n\n return view('subject.create')->withTeachers($teachers)->withClassrooms($classrooms);\n }",
"public function create()\r\n {\r\n $this->isExistsSchoolSubject()\r\n ->isNameAlpha()\r\n ->setResult()\r\n ->addSchoolSubject()\r\n ->sendResult();\r\n }",
"public function testCreateUser()\n {\n /** @var Role $role */\n// $role = Role::query()->where('name', 'root')->get();\n// $user = User::query()->create([\n// 'name' => 'white',\n// 'email' => '[email protected]',\n// 'password' => '123456',\n// ]);\n// $role = Role::query()->where('id', 1)->get();\n// /** @var Permission $permission */\n// $permission = Permission::query()->where('name','edit articles')->get();\n// /** @var User $user */\n// $user = User::query()->where('name', 'white')->get();\n// $role->givePermissionTo('edit articles');\n// $setRoot = $permission->assignRole('whitess');\n// dd($setRoot);\n }"
] |
[
"0.6300981",
"0.62122726",
"0.62122726",
"0.61048394",
"0.60893285",
"0.60661143",
"0.6032001",
"0.60203415",
"0.60144466",
"0.5989078",
"0.5972455",
"0.5971135",
"0.594066",
"0.593179",
"0.593123",
"0.59170747",
"0.58973366",
"0.5865762",
"0.5863531",
"0.58620274",
"0.58592504",
"0.58509356",
"0.58417845",
"0.5816541",
"0.580855",
"0.5798698",
"0.57735366",
"0.5767617",
"0.5757023",
"0.5753366"
] |
0.6266191
|
1
|
End: function modify_team DELETE TEAM
|
function delete_team($teamname) {
$qDelete = "DELETE FROM authteam WHERE teamname='$teamname'";
$qUpdateUser = "UPDATE authuser SET team='Ungrouped' WHERE team='$teamname'";
if ($teamname == "Admin") {
return "Admin team cannot be deleted.";
} elseif ($teamname == "Ungrouped") {
return "Ungrouped team cannot be deleted.";
} elseif ($teamname == "Temporary") {
return "Temporary team cannot be deleted.";
}
$link = new mysqli($this->HOST, $this->USERNAME, $this->PASSWORD, $this->DBNAME);
if ($link->connect_error) {
die("Error al conectarse a la BD $dbname: " . $mysqli->connect_error);
}
// OLD CODE - DO NOTE REMOVE
// $result = mysql_db_query($this->DBNAME, $qUpdateUser);
// REVISED CODE
$result = $link->query($qUpdateUser);
// OLD CODE - DO NOT REMOVE
// $result = mysql_db_query($this->DBNAME, $qDelete);
// REVISED CODE
$result = $link->query($qDelete);
return $link->error;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function teamdelete(){\n $this->auth(COMP_ADM_LEVEL);\n $team_id = $this->uri->segment(3);\n $contest_id = urldecode($this->uri->segment(4));\n $this->m_key->removeTeam($team_id);\n $this->m_team->delete($team_id, $contest_id);\n $this->teams($contest_id);\n }",
"public function destroy(Team $team)\n {\n //\n }",
"public function destroy(Team $team)\n {\n //\n }",
"public function destroy(Team $team)\n {\n //\n }",
"public function destroy(Team $team)\n {\n //\n }",
"public function destroy(Team $team)\n {\n //\n }",
"function delete($teamID) {\n\n if (!$this->correct_permissions('admin')) {\n redirect(base_url() . 'admin/team');\n }\n\n $this->spletka_m->team_m->delete($teamID);\n redirect(base_url() . 'admin/team');\n }",
"function removeuserfromteam(){\n $this->auth(COMP_ADM_LEVEL);\n $key_id = $this->uri->segment(3);\n $team_id = $this->uri->segment(4);\n $contest_id = $this->uri->segment(5);\n $this->m_key->removeUserByKeyId($key_id);\n $this->teamedit($team_id);\n }",
"function deleteTeamFromPartition() {\n global $connection_production;\n if (isset($_POST['delete_team_partition'])) {\n $post_partition_id_set = $_POST['partition_id_set'];\n $team_id = $_POST['team_id'];\n $p_f_sm_id = $_POST['p_f_sm_id'];\n\n $sql_delete_p_f_sm_id = \"DELETE FROM partition_franchise_sm WHERE id=?\";\n\n $stmt_delete_p_f_sm_id = $connection_production->prepare($sql_delete_p_f_sm_id);\n $stmt_delete_p_f_sm_id->bind_param(\"i\", $p_f_sm_id);\n $stmt_delete_p_f_sm_id->execute();\n $last_delete_p_f_sm_id = $connection_production->insert_id;\n $stmt_delete_p_f_sm_id->close();\n\n $update_string = 'partition: '.$post_partition_id_set.' deleted team parition association id: '.$p_f_sm_id.', removed team id: '.$team_id;\n insertChange($_SESSION['account_id'], 'partition', 'delete team', $post_partition_id_set, $update_string);\n header(\"location: categories.php?source=update_partition&partition_id=\".$post_partition_id_set.\"#partition_teams\");\n }\n }",
"public function deleteTeam($id){\n $sqlQuery = \"DELETE FROM Teams WHERE teamID = :teamID\";\n $statement = $this->_dbHandle->prepare($sqlQuery);\n\n $statement->bindValue(\":teamID\", $id, PDO::PARAM_INT);\n $statement->execute();\n $this->_dbInstance->destruct();\n\n }",
"public function destroy(HelpdeskTeam $team)\n {\n //\n }",
"public function destroy(team_members $team_members)\n {\n //\n }",
"public function remove_team($team_id)\n {\n if ($this->CreateTeamModel->remove_team($team_id)) {\n echo '<script>alert(\"Team has been deleted successfully!\");</script>';\n $this->data['teams'] = $this->CreateTeamModel->get_teams();\n $this->load->view('create_team_view',$this->data);\n } else {\n echo '<script>alert(\"Team deletion failed!\");</script>';\n $this->data['teams'] = $this->CreateTeamModel->get_teams();\n $this->load->view('create_team_view',$this->data);\n }\n }",
"public function delete($id)\n {\n $this->db->where('id',$id);\n return $this->db->delete('team');\n }",
"public function deleteLeague($league);",
"public function remove_member($team_id,$user_id,$project_id)\n {\n if ($this->CreateTeamModel->remove_member($team_id,$user_id,$project_id)== 1) {\n\n echo '<script>alert(\"Team Member has been removed successfully!\");</script>';\n redirect(base_url().'team/view/'.$team_id);\n \n } else {\n echo '<script>alert(\"Team Member removal failed!\");</script>';\n redirect(base_url().'team/view/'.$team_id);\n }\n }",
"public function destroy($id){\n $team = Team::findOrFail($id);\n if($team->delete())\n {\n session()->flash('success_msg_table', 'Team Deleted Successfully.');\n }\n else{\n session()->flash('fail_msg_table', 'Deletion failed.');\n }\n }",
"function updateUsersTeam($teamIds, $user)\n{\n global $db;\n try {\n $teams = \"DELETE FROM team_users \n WHERE user_id = '\". $user .\"'\";\n \n $statement = $db->prepare($teams);\n $statement->execute(); \n addUsersTeams($teamIds,$user);\n } catch (Exception $exception) {\n throw new Exception($exception->getMessage());\n } \n}",
"public function destroy(team $team)\n {\n $team->delete();\n \n return redirect('/team');\n }",
"public function testDeleteValidTeam() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"team\");\n\n\t\t// create a new Team and insert to into mySQL\n\t\t$team = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID, $this->VALID_TEAMCITY, $this->VALID_TEAMNAME);\n\t\t$team->insert($this->getPDO());\n\n\t\t// delete the Team from mySQL\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"team\"));\n\t\t$team->delete($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the Team does not exist\n\t\t$pdoTeam = Team::getTeamByTeamId($this->getPDO(), $team->getTeamId());\n\t\t$this->assertNull($pdoTeam);\n\t\t$this->assertEquals($numRows, $this->getConnection()->getRowCount(\"team\"));\n\t}",
"public function destroy($id)\n {\n// $user = User::find(2);\n// \\Auth::user()->impersonate($user);\n if (Gate::allows('team-delete')) {\n $team = Team::find($id);\n $team->delete();\n return redirect('/teams')->with('success', 'Team deleted!');\n }else{\n return redirect('/teams')->withErrors('Not allowed!');\n }\n\n }",
"public function destroy(TeamService $teamService)\n {\n //\n }",
"public function destroy(Teamrequest $teamrequest)\n {\n if (Auth::user()->role == 2 || Auth::user()->id === $teamrequest->team->creator->id || $teamrequest->rejected === 0){\n $teamrequest->delete();\n }\n return(redirect(route('teams.one', $teamrequest->team->id)));\n }",
"public function testDeleteInvalidTeam() {\n\t\t// create a new Team and try to delete it without actually inserting it\n\t\t$team = new Team(null, $this->sport->getSportId(), $this->VALID_TEAMAPIID, $this->VALID_TEAMCITY, $this->VALID_TEAMNAME);\n\t\t$team->delete($this->getPDO());\n\t}",
"public function updateTeam($team)\n\t{\n\t}",
"public function destroy(Team $team)\n {\n $user = auth()->User();\n $this->authorize('godView', $user);\n $team->delete();\n }",
"public function destroy($id)\n {\n $team =Team::find($id);\n $counter=Team::all();\n //this checks if the selected entry to be deleted is actually present\n if($team==null){\n return redirect('/Team')->with('error','There was an error while deleting from the database, the error is now fixed.');\n }\n else{\n if(Storage::delete('public/team_pic/'.$team->picture)){\n $team->delete();\n return redirect('Viewall/All_team')->with('success','Team member Removed');\n }\n if(count($counter)<1){\n return redirect('/Team')->with('error','Team empty');\n }\n else{\n return redirect('/FennTech')->with('error','Team memeber deleted');\n }\n }\n }",
"public function delete_about_us_team_member_info($id){\r\n $query = \"DELETE FROM tbl_aboutus_team WHERE team_member_id='$id'\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $message = \"About Us Team Member Information Deleted Successfully!\";\r\n return $message;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }",
"public function destroy(Team $team)\n {\n \n try {\n if (Storage::exists($team->image)) {\n Storage::delete($team->image);\n }\n\n } catch (\\Throwable $th) { }\n \n $team->delete();\n\n return redirect(route('team.index'))->withSuccess('Member Removed Successfully');\n \n }",
"public function updateTeamToUnCertification($team);"
] |
[
"0.77240026",
"0.705849",
"0.705849",
"0.705849",
"0.705849",
"0.705849",
"0.6967703",
"0.67964894",
"0.67925805",
"0.65950173",
"0.64855355",
"0.64510614",
"0.6445702",
"0.6335856",
"0.63203",
"0.63088226",
"0.62976277",
"0.62823194",
"0.6242925",
"0.6218734",
"0.62095684",
"0.61888593",
"0.6167249",
"0.6132934",
"0.6105545",
"0.6095736",
"0.608286",
"0.6081556",
"0.6065279",
"0.6059449"
] |
0.707249
|
1
|
Get the ParsedClass instance.
|
public function getParsedClass()
{
return $this->_parsedClass;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getClass()\n {\n return $this->refl->isAbstract()\n ? null\n : new ParsedClass(\n (string) $this->refl->getDocComment(),\n $this->getCleanReflectionName(),\n $this->refl->getNamespaceName(),\n $this->getMethods()\n );\n }",
"public function get_class() {\n\t\tif ( ! $this->is_class_set ) {\n\t\t\t$this->set_class( $this->derive_class() );\n\t\t}\n\t\treturn $this->class;\n\t}",
"public function getInstance()\n\t{\n\t\tif($this->classname === null) {\n\t\t\tthrow new BuildException('The classname attribute must be specified');\n\t\t}\n\t\t\n\t\tif($this->instance === null) {\n\t\t\ttry {\n\t\t\t\tPhing::import($this->classname, $this->classpath);\n\t\t\t}\n\t\t\tcatch (BuildException $be) {\n\t\t\t\t/* Cannot import the file. */\n\t\t\t\tthrow new BuildException(sprintf('Object from class %s cannot be instantiated', $this->classname), $be);\n\t\t\t}\n\t\t\t\n\t\t\t$class = $this->classname;\n\t\t\t$this->instance = new $class();\n\t\t}\n\t\treturn $this->instance;\n\t}",
"protected function getParserService()\n {\n $class = $this->getParameter('parser.class');\n $instance = new $class($this->getI18nService());\n\n return $instance;\n }",
"public function fetchClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n $cls_name = $this->getClassName();\n if (empty($this->class_reflection) && !empty($cls_name)) {\n $this->class_reflection = new \\ReflectionClass($cls_name);\n }\n return $this->class_reflection;\n }",
"public function get_class_reflector() {\n\t\tif ( ! $this->is_class_reflector_set ) {\n\t\t\t$this->set_class_reflector( $this->derive_class_reflector() );\n\t\t}\n\t\treturn $this->class_reflector;\n\t}",
"public function getClass() : ?string\n {\n\n return $this->parsed['class'];\n }",
"public static function fetch()\n {\n if (!isset(self::$instance)) {\n $c = __CLASS__;\n self::$instance = new $c;\n }\n\n return self::$instance;\n }",
"protected function derive_class_reflector() {\n\t\ttry {\n\t\t\t$class_reflector = $this->is_class_reference() ? new ReflectionClass( $this->get_class() ) : null;\n\t\t} catch ( ReflectionException $exception ) {\n\t\t\t$class_reflector = null;\n\t\t}\n\t\treturn $class_reflector;\n\t}",
"public function getReflectionClass();",
"public function getClass() {\r\n\t\treturn $this->class;\r\n\t}",
"public function getReflectionClass()\n {\n return new \\ReflectionClass($this->getName());\n }",
"public function get_class()\n {\n return $this->class;\n }",
"function &_getParserInstance(){\n if($this->parserInstance==NULL)\n $this->parserInstance = new Parser();\n return $this->parserInstance;\n }",
"public function getReflected(): ReflectionClass\n {\n return $this->reflected;\n }",
"public function getClass() {\n return $this->class;\n }",
"public function getClass()\n {\n if (is_null($this->_class)) {\n $this->_class = $this->_getClassName();\n }\n return $this->_class;\n }",
"public function fetch_class()\n\t{\n\t\treturn $this->route_stack[self::SEG_CLASS];\n\t}",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }",
"public function getClass()\n {\n return $this->class;\n }"
] |
[
"0.7315457",
"0.62955207",
"0.6124868",
"0.60459495",
"0.603492",
"0.5954517",
"0.595106",
"0.59403175",
"0.58707005",
"0.5867851",
"0.5804126",
"0.57563365",
"0.5732969",
"0.57226336",
"0.5721525",
"0.57129323",
"0.57027054",
"0.56720805",
"0.5656656",
"0.5650149",
"0.5650149",
"0.5650149",
"0.5650149",
"0.5650149",
"0.5650149",
"0.5650149",
"0.5650149",
"0.5650149",
"0.5650149",
"0.5650149"
] |
0.8105553
|
0
|
Internal method that does the actual parsing of class properties.
|
private function _parseClass()
{
// check which interfaces are implemented
$interfaces = $this->_reflectionClass->getInterfaceNames();
foreach ($interfaces as $i) {
if ($i == 'Webiny\Component\Rest\Interfaces\AccessInterface') {
$this->_parsedClass->accessInterface = true;
}
if ($i == 'Webiny\Component\Rest\Interfaces\CacheKeyInterface') {
$this->_parsedClass->cacheKeyInterface = true;
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function parseProperties(): void\n {\n $properties = $this->extractProperties();\n\n foreach ($properties as $property)\n {\n if ($property['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($property['docblock']['doc_line_start'],\n $property['docblock']['doc_line_end'],\n $property['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertProperty($this->clsId,\n $docId,\n $property['name'],\n Cast::toManInt($property['is_static']),\n $property['visibility'],\n $property['value'],\n $property['start'],\n $property['end']);\n }\n }",
"public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }",
"protected function parse()\n {\n\t$event_lines = explode(HCAL_LINE_SPLITER, $this->_Content);\n\n\tforeach ($event_lines as $line)\n\t{\n\t $result = $this->parseProperty($line);\n\t $this->_Properties[$result['name']] = $result['value'];\n\t}\n }",
"private function _getSettings()\n {\n $properties = $this->_class->getProperties();\n foreach ($properties as $property) {\n $prop = new Property($property);\n $prop->fillSettings($this->_reflect);\n }\n if (empty($this->_reflect->listField)) {\n $keys = array_keys($this->_reflect->fields);\n $this->_reflect->listField = array_shift($keys);\n }\n $this->_reflect->fieldNames = array_keys($this->_reflect->fields);\n }",
"private function readLoaderProperties()\n {\n // Read all properties of the loader.\n foreach ((new \\ReflectionClass($this->loader))->getProperties(\\ReflectionProperty::IS_PRIVATE) as $property) {\n $this->properties[$property->name] = static::getObjectAttribute($this->loader, $property->name);\n }\n }",
"protected function parse() {}",
"abstract protected function getProperties();",
"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 }",
"function parse() {\n\t\t$this->parse_zones($this->get_product_text());\n\n\t\t// STEP 2: Parse out VTEC\n\t\t$this->parse_vtec();\n\n\t\t// STEP 3: Relay readiness\n\t\t$this->properties['relay'] = true;\n\n\t\t// FINAL: Return the properties array\n\t\treturn $this->properties;\n\t}",
"abstract protected function get_properties();",
"private function process_line($line)\n\t{\n\t\tswitch($this->_state)\n\t\t{\n\t\t\tcase self::START:\n\t\t\t\tif(preg_match('/<h1>Class[ \\t]+(.+?)<\\/h1>/', $line, $matches))\n\t\t\t\t{\n\t\t\t\t\t$this->log(2, \" Class \".$matches[1]);\n\t\t\t\t\t$this->_cur_class = new ClassDef($matches[1]);\n\t\t\t\t\t$this->_state = self::IN_CLASS;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase self::IN_CLASS:\n\t\t\t\tif(preg_match('/Extends:.*<a ext:cls=\\\"(.+?)\\\"/', $line, $matches))\n\t\t\t\t{\n\t\t\t\t\t$this->log(2, \" :: Extends \".$matches[1]);\n\t\t\t\t\t$this->_cur_class->set_parent_class_name($matches[1]);\n\t\t\t\t}\n\t\t\t\telse if(preg_match('/<h2>(Config Options|Public Properties)<\\/h2>/', $line, $matches))\t\t\n\t\t\t\t{\n\t\t\t\t\t$this->_state = self::IN_PROPERTIES;\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tcase self::IN_PROPERTIES:\n\t\t\t\t// TODO Differentiate between:\n\t\t\t\t// - Config Options\n\t\t\t\t// - Public Properties\n\t\t\t\tif(preg_match('/<b>(.+)<\\/b>[ \\t]*:[ \\t]*([A-Za-z0-9\\.\\/]+?)[ \\t]*<div class=\\\"mdesc\\\">/', $line, $matches))\n\t\t\t\t{\n\t\t\t\t\t$this->log(3, \" Property: \".$matches[1].\" (\".$matches[2].\")\");\n\t\t\t\t\t// TODO Handle default\n\t\t\t\t\t$class_name_parts = explode('.', $this->_cur_class->get_name());\t\t\t\t\t\n\t\t\t\t\t$property_name = &$matches[1];\n\t\t\t\t\t$static_property = false;\n\t\t\t\t\tif(false !== strpos($property_name, '.'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$property_name_parts = explode('.', $property_name);\n\t\t\t\t\t\t$c_c_n_p = count($class_name_parts);\n\t\t\t\t\t\t$c_p_n_p = count($property_name_parts);\n\t\t\t\t\t\t$offset = ($class_name_parts[0]=='Ext' ? 1 : 0);\n\t\t\t\t\t\tfor($i=0;$i<$c_c_n_p-$offset; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($class_name_parts[$i+$offset] == $property_name_parts[0])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$offset += $i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($c_c_n_p-$offset < $c_p_n_p)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$static_property = true;\n\t\t\t\t\t\t\tfor($i=0; $i<$c_c_n_p-$offset; $i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($class_name_parts[$i+$offset] != $property_name_parts[$i])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$static_property = false;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$this->_cur_class->set_property($property_name, '', $static_property, $matches[2]);\n\t\t\t\t}\n\t\t\t\telse if(preg_match('/<h2>Public Methods<\\/h2>/', $line, $matches))\t\t\n\t\t\t\t{\n\t\t\t\t\t$this->_state = self::IN_METHODS;\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tcase self::IN_METHODS:\n\t\t\t\tif(preg_match('/<b>(.+)<\\/b>(.+)[ \\t]*<div class=\\\"mdesc\\\">/', $line, $matches))\n\t\t\t\t{\n\t\t\t\t\t// Extract parameters\n\t\t\t\t\t$raw_parameters_array = explode(',', $matches[2]);\n\t\t\t\t\t$method_name = $matches[1];\n\t\t\t\t\t$this->log(3, \" Method: \".$matches[1]);\n\t\t\t\t\t$args = array();\n\t\t\t\t\tforeach($raw_parameters_array as $raw_parameter)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(preg_match(\"/(\\[*)<code>([A-Za-z0-9\\.\\/]+)[ \\t]+(.+)<\\/code>/\", $raw_parameter, $matches))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->log(4, \" \".$matches[2].\": \".$matches[1].$matches[3]);\n\t\t\t\t\t\t\tif(false !== strpos($matches[3], 'etc.'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// TODO Handle variable number of arguments\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{\n\t\t\t\t\t\t\t\tif(!ctype_alnum($matches[3][0]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$arg_type = $this->normalize_arg_type($matches[3]);\n\t\t\t\t\t\t\t\t\t$matches[3] = $matches[2];\n\t\t\t\t\t\t\t\t\t$matches[2] = $arg_type;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(false !== strpos($matches[3], '.'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// FIXME This assumes that we are only using internal consts...tssk tssk\n\t\t\t\t\t\t\t\t\t// On 2nd thought: ORLY?\n\t\t\t\t\t\t\t\t\tlist(, $arg_name) = explode('.', $matches[3]);\n\t\t\t\t\t\t\t\t\t$matches[3] = 'const_'.$arg_name;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reserved keywords\n\t\t\t\t\t\t\t\tif(in_array($matches[3], self::$RESERVED))\n\t\t\t\t\t\t\t\t\t$matches[3] = self::PREFIX.$matches[3];\n\t\t\t\t\t\t\t\t$args[$matches[3]] = new ArgDef($matches[3], $matches[2], ($matches[1]=='['));\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$class_name_parts = explode('.', $this->_cur_class->get_name());\n\t\t\t\t\t// Build constructor comparison object and compare\n\t\t\t\t\t$constructor = false;\n\t\t\t\t\t$method_name_parts = explode('.', $method_name);\n\t\t\t\t\t$c_c_n_p = count($class_name_parts);\n\t\t\t\t\t$c_m_n_p = count($method_name_parts);\n\t\t\t\t\tif($c_m_n_p <= $c_c_n_p)\n\t\t\t\t\t{\n\t\t\t\t\t\t$constructor = true;\n\t\t\t\t\t\tfor($i=1; $i<=$c_m_n_p; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($class_name_parts[$c_c_n_p-$i] != $method_name_parts[$c_m_n_p-$i])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$constructor = false;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($constructor)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_cur_class->set_constructor_args($args);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$static_method = false;\n\t\t\t\t\t\t$offset = ($class_name_parts[0]=='Ext' ? 1 : 0);\n\t\t\t\t\t\tfor($i=0;$i<$c_c_n_p-$offset; $i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($class_name_parts[$i+$offset] == $method_name_parts[0])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$offset += $i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($c_c_n_p-$offset < $c_m_n_p)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$static_method = true;\n\t\t\t\t\t\t\tfor($i=0; $i<$c_c_n_p-$offset; $i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($class_name_parts[$i+$offset] != $method_name_parts[$i])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$static_method = false;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\n\n\t\t\t\t\t\tif($c_m_n_p>1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($class_name_parts[$c_c_n_p-1] == $method_name_parts[0])\n\t\t\t\t\t\t\t\t$static_method = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!$static_method) $static_method = $this->is_special_case_static($method_name);\n\t\t\t\t\t\t$this->_cur_class->set_method($method_name, $args, $static_method);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(preg_match('/<h2>Public Events<\\/h2>/', $line, $matches))\t\t\n\t\t\t\t{\n\t\t\t\t\t// TODO Hmm this is dirty.\n\t\t\t\t\t$this->_classes[$this->_cur_class->get_name()] = $this->_cur_class;\n\t\t\t\t\t$this->_cur_class = null;\n\t\t\t\t\t$this->_state = self::START;\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private function _parseClassDoc()\n {\n $doc = self::parseDocComment($this->_class->getDocComment());\n if (!empty($doc['property-read'])) {\n foreach ($doc['property-read'] as $property) {\n $matches = null;\n if (preg_match(self::PROPERTY_REGEX, $property, $matches)) {\n $this->_reflect->lazy[$matches[2]] = $matches[1];\n }\n }\n }\n $dbName = null;\n $prefix = '';\n if (!empty($doc)) {\n $dbName = getKey($doc, 'db-database');\n $prefix = getKey($doc, 'db-prefix', '');\n }\n $this->_reflect->dbName = $dbName;\n return $prefix;\n }",
"protected function buildPropertyInfo() {\n }",
"protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }",
"abstract protected function properties();",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"public function postLoad()\n {\n // Ensure class content are known\n $data = (array) $this->_data;\n foreach ($data as $dataEntry) {\n $type = key($dataEntry);\n\n $dataEntry = array_pop($dataEntry);\n if (true === is_array($dataEntry)) {\n $type = key($dataEntry);\n }\n\n if ($type !== 'scalar' && $type !== 'array') {\n self::getFullClassname($type);\n }\n }\n\n parent::postLoad();\n }",
"private function parseProperties(\\ReflectionClass $reflection, HaxeClass $haxeClass)\n {\n // Retrieves information about properties/attributes.\n foreach ($reflection->getProperties() as $attribute) {\n // Inherited method not write there.\n if ($attribute->getDeclaringClass()->getName() != $this->context->getFullClassName()) {\n continue;\n }\n\n $haxeAttribute = new HaxeAttribute();\n $haxeAttribute\n ->setName($attribute->getName())\n ->setIsStatic($attribute->isStatic())\n ->setVisibility($attribute->isPrivate()\n ? HaxeAttribute::ATTRIBUTE_VISIBILITY_PRIVATE\n : HaxeAttribute::ATTRIBUTE_VISIBILITY_PUBLIC\n )\n ->setType(DocParser::getVarType($attribute->getDocComment())\n ? HaxeMapping::getHaxeType(DocParser::getVarType($attribute->getDocComment()))\n : Context::DEFAULT_TYPE\n )\n ;\n\n $haxeClass->addAttribute($haxeAttribute);\n }\n }",
"abstract protected function splitPropertyParts(string $property, string $resourceClass): array;",
"protected function processProperties($data)\n {\n\n // Will hold the properties we are sending back\n $properties = [];\n\n // All of these are split on space\n $items = explode(' ', $data);\n\n // Iterate over the items\n foreach ($items as $item) {\n // Explode and make sure we always have 2 items in the array\n list($key, $value) = array_pad(explode('=', $item, 2), 2, '');\n\n // Convert spaces and other character changes\n $properties[$key] = utf8_encode(str_replace(\n [\n '\\\\s', // Translate spaces\n ],\n [\n ' ',\n ],\n $value\n ));\n }\n\n return $properties;\n }",
"abstract public function getProperties();",
"protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }",
"abstract public function processClass (ReflectionClass $class);",
"protected function loadClassProperties($ar = array(null))\r\n {\r\n //var_dump(get_object_vars(get_class($this)));\r\n if (!$ar)\r\n return false;\r\n foreach ($ar as $key => $value) {\r\n\r\n $this->$key = $value;\r\n }\r\n }",
"protected function mapProperties() : void {\n\t\t$this->propertyActions['translate'] = array();\n\t\t$properties = $this->reflectionClass->getProperties();\n\t\tforeach ($properties as $property) {\n\t\t\t$annotation = $this->annotationReader->getPropertyAnnotation($property, 'Henri\\Framework\\Annotations\\Annotation\\DBRecord');\n\t\t\tif (isset($property->name) && $annotation && isset($annotation->name)) {\n\t\t\t\t$this->propertyMap[$property->name] = $annotation->name;\n\n\t\t\t\t$propertyProps = new \\stdClass();\n\t\t\t\t$propertyProps->name = $annotation->name;\n\t\t\t\t$propertyProps->type = isset($annotation->type) && !empty($annotation->type) ? $annotation->type : 'text';\n\t\t\t\t$propertyProps->length = $annotation->length;\n\t\t\t\t$propertyProps->primary = $annotation->primary;\n\t\t\t\t$propertyProps->translate = $annotation->translate;\n\t\t\t\t$propertyProps->empty = $annotation->empty;\n\t\t\t\t$propertyProps->unique = $annotation->unique ?? false;\n\t\t\t\t$this->propertyProps[$property->name] = $propertyProps;\n\t\t\t}\n\n\t\t\tif (isset($property->name) && $annotation && isset($annotation->translate) && !empty($annotation->translate)) {\n\t\t\t\t// Set translate actions\n\t\t\t\t$this->propertyActions['translate'][$property->name] = $annotation->translate;\n\t\t\t}\n\n\t\t\t// Check for primary key\n\t\t\tif (isset($property->name) && $annotation && isset($annotation->primary)) {\n\t\t\t\tif ($annotation->primary && isset($this->primaryKey)) {\n\t\t\t\t\tthrow new Exception('Multiple primary keys found', 500);\n\t\t\t\t}\n\n\t\t\t\tif ($annotation->primary) {\n\t\t\t\t\t$this->primaryKey = $property->name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function initProps()\n {\n foreach ($this->cmds as $key => $parseValues) {\n $this->props[$key] = false;\n }\n\n foreach ($this->flags as $key => $parseValues) {\n $this->props[$key] = false;\n }\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }"
] |
[
"0.6932638",
"0.6279018",
"0.6042303",
"0.5847231",
"0.5825462",
"0.5767628",
"0.57584804",
"0.57279325",
"0.5686709",
"0.56583303",
"0.56295544",
"0.56136495",
"0.552877",
"0.55218613",
"0.5487818",
"0.54862887",
"0.54456526",
"0.5443485",
"0.5428307",
"0.53605783",
"0.53511906",
"0.53463537",
"0.5325153",
"0.52706605",
"0.5255383",
"0.5224167",
"0.5209795",
"0.5209795",
"0.5208315",
"0.5207919"
] |
0.6393684
|
1
|
Parsed the class methods and assigns them to the ParsedClass instance.
|
private function _parseMethods()
{
$methods = $this->_reflectionClass->getMethods();
if (!is_array($methods) || count($methods) < 1) {
throw new RestException('Parser: The class "' . $this->_class . '" doesn\'t have any methods defined.');
}
foreach ($methods as $m) {
if ($m->isPublic()) {
$methodParser = new MethodParser($this->_class, $m, $this->_normalize);
$parsedMethod = $methodParser->parse();
if ($parsedMethod) {
$this->_parsedClass->addApiMethod($parsedMethod);
}
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function parseMethods(): void\n {\n $methods = $this->extractMethods();\n\n foreach ($methods as $method)\n {\n if ($method['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($method['docblock']['doc_line_start'],\n $method['docblock']['doc_line_end'],\n $method['docblock']['doc_docblock']);\n }\n\n $mthId = PhpAutoDoc::$dl->padClassInsertMethod($this->clsId,\n $docId,\n $method['name'],\n Cast::toManInt($method['is_abstract']),\n Cast::toManInt(mb_strtolower($method['name'])=='__construct'),\n Cast::toManInt(mb_strtolower($method['name'])=='__destruct'),\n Cast::toManInt($method['is_final']),\n Cast::toManInt($method['is_static']),\n $method['visibility'],\n $method['start'],\n $method['end']);\n\n $this->parseMethodArguments($mthId, $method['tokens']);\n }\n }",
"private function _parseClass()\n {\n // check which interfaces are implemented\n $interfaces = $this->_reflectionClass->getInterfaceNames();\n foreach ($interfaces as $i) {\n if ($i == 'Webiny\\Component\\Rest\\Interfaces\\AccessInterface') {\n $this->_parsedClass->accessInterface = true;\n }\n\n if ($i == 'Webiny\\Component\\Rest\\Interfaces\\CacheKeyInterface') {\n $this->_parsedClass->cacheKeyInterface = true;\n }\n }\n }",
"private function parseMethods(\\ReflectionClass $reflection, HaxeClass $haxeClass)\n {\n // Retrieves information about methods\n foreach ($reflection->getMethods() as $method) {\n // Inherited method not write there.\n if ($method->getDeclaringClass()->getName() != $this->context->getFullClassName()) {\n continue;\n }\n\n $code = $this->data;\n $astParser = new AstParser(array_splice(\n $code,\n $method->getStartLine(),\n $method->getEndLine() - $method->getStartLine()\n ));\n\n $haxeMethod = new HaxeMethod();\n $haxeMethod\n ->setName($method->getName() != '__construct' ? $method->getName() : 'new') // new in haxe\n ->setIsStatic($method->isStatic())\n ->setVisibility($method->isPrivate()\n ? HaxeMethod::METHOD_VISIBILITY_PRIVATE\n : HaxeMethod::METHOD_VISIBILITY_PUBLIC\n )\n ;\n\n // Default context that contains everything needed for the code parsing\n $defaultParseContext = [\n 'method_name' => $method->getName(),\n 'variables' => []\n ];\n\n $this->parseArguments($method, $haxeMethod, $defaultParseContext);\n\n try {\n $haxeMethod->setBody($astParser->process($defaultParseContext));\n } catch (ParserException $ex) {\n $this->errors = array_merge($this->errors, $ex->getErrors());\n }\n\n $haxeMethod->setReturnType($method->hasReturnType()\n ? HaxeMapping::getHaxeType($method->getReturnType())\n : ($astParser->getHasReturn() ? Context::DEFAULT_TYPE : Context::NO_TYPE)\n );\n\n $haxeClass->addMethod($haxeMethod);\n }\n }",
"public function testParseClassMethod()\n {\n $file = '#test';\n $rule = [\n 'directive' => '~#test(\\s*\\(((.*))\\))?~',\n 'replace' => \\Caprice\\Directives\\PhpDirective::class,\n ];\n $extras = []; // extra needed parameters like paths \n\n $out = $this->parser->parse($file, $rule, $extras);\n\n $this->assertSame('<?php ', $out);\n }",
"protected function parseMethod() {\n $reader = $this->reader; // alias in local\n\n $method = new Method;\n $method->name = $this->mangleMethodName($reader->getAttribute('name'));\n $method->identifier = $reader->getAttribute('c:identifier');\n if($reader->getAttribute('throws')) {\n $method->throws = 1;\n }\n\n do {\n // parameter handling goes here\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'parameter') {\n $method->args[] = $this->parseParameter();\n // if return-type name == the class name this is a constructor\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'return-value') {\n $method->returnValue = $this->parseReturn();\n // this will get a doc node if it exists\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'doc') {\n $method->doc = $reader->readString();\n // this will ALWAYS stop our loop\n } elseif($reader->nodeType == XMLReader::END_ELEMENT && $reader->name == 'method') {\n break;\n }\n } while($reader->read());\n\n /* if the name of the method is ONLY free or destroy - this is a free */\n if (empty($method->args) && $method->name === 'free' || $method->name === 'destroy') {\n $e = new FreeObjectHandlerException();\n $e->method = $method;\n throw $e;\n }\n\n return $method;\n }",
"protected function parseFunctionAsMethod(Klass $class) {\n $reader = $this->reader; // alias in local\n\n $method = new Method;\n $method->name = $this->mangleMethodName($reader->getAttribute('name'));\n $method->identifier = $reader->getAttribute('c:identifier');\n\n do {\n // if return-type name == the class name this is a constructor\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'return-value') {\n $method->returnValue = $this->parseReturn();\n // constructor guessing - new, alloc\n if($class->hasConstructor == false && $class->name === $method->returnValue->type &&\n (stripos($method->name, 'new') === 0 ||\n stripos($method->name, 'alloc') === 0)) {\n $method->isConstructor = true;\n $method->name = '__construct';\n $class->hasConstructor = true;\n }\n // parameter handling goes here\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'parameter') {\n $method->args[] = $this->parseParameter();\n // this will get a doc node if it exists\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'doc') {\n $method->doc = $reader->readString();\n // this will ALWAYS stop our loop\n } elseif($reader->nodeType == XMLReader::END_ELEMENT && $reader->name == 'function') {\n break;\n }\n } while($reader->read());\n\n /* There is a special case here, if the method is a constructor, and the constructor takes no arguments\n * then we want the construct to happen in the create object handler instead\n */\n if ($method->isConstructor && empty($method->args)) {\n $e = new CreateObjectHandlerException();\n $e->method = $method;\n throw $e;\n }\n\n return $method;\n }",
"function reflect() {\n $return = array();\n $class = new \\ReflectionClass($this->testingClass);\n $return []= $class;\n\n if (func_num_args() > 0) {\n $args = func_get_args();\n\n foreach ($args as $name) {\n if (Text::beginsWith($name, 'method:')) {\n $property = $class->getMethod(Text::getSubstringAfter($name, 'method:'));\n }\n else {\n $property = $class->getProperty($name);\n }\n $property->setAccessible(true);\n $return []= $property;\n }\n }\n if (count($return) === 1) {\n return $class;\n }\n return $return;\n }",
"public function getMethods($class);",
"public function getParsedClass()\n {\n return $this->_parsedClass;\n }",
"function get_class_methods() {\n\t\t$args = func_get_args();\n\t\t$result=call_user_func_array(\"get_class_methods\", $args);\n\t\tif (is_array($result))\n\t\t\tforeach ($result as $key=>$value) {\n\t\t\t\t$result[$key]=strtolower($value);\n\t\t\t}\n\t\treturn $result;\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 }",
"abstract public function processClass (ReflectionClass $class);",
"abstract public function processMethod (ReflectionMethod $met, $className);",
"function populate_method_info() {\n\n $method_info = array();\n\n // get functions\n $all_functions = get_defined_functions();\n $internal_functions = $all_functions[\"internal\"];\n\n foreach ($internal_functions as $function) {\n // populate new method record\n $function_record = array();\n $function_record[CLASS_NAME] = \"Function\";\n $function_record[METHOD_NAME] = $function;\n $function_record[IS_TESTED] = \"no\";\n $function_record[TESTS] = \"\";\n $function_record[IS_DUPLICATE] = false;\n\n // record the extension that the function belongs to\n $reflectionFunction = new ReflectionFunction($function);\n $extension = $reflectionFunction->getExtension();\n if ($extension != null) {\n $function_record[EXTENSION_NAME] = $extension->getName();\n } else {\n $function_record[EXTENSION_NAME] = \"\";\n }\n // insert new method record into info array\n $method_info[] = $function_record;\n }\n\n // get methods\n $all_classes = get_declared_classes();\n foreach ($all_classes as $class) {\n $reflectionClass = new ReflectionClass($class);\n $methods = $reflectionClass->getMethods();\n foreach ($methods as $method) {\n // populate new method record\n $new_method_record = array();\n $new_method_record[CLASS_NAME] = $reflectionClass->getName();\n $new_method_record[METHOD_NAME] = $method->getName();\n $new_method_record[IS_TESTED] = \"no\";\n $new_method_record[TESTS] = \"\";\n\n $extension = $reflectionClass->getExtension();\n if ($extension != null) {\n $new_method_record[EXTENSION_NAME] = $extension->getName();\n } else {\n $new_method_record[EXTENSION_NAME] = \"\";\n }\n\n // check for duplicate method names\n $new_method_record[IS_DUPLICATE] = false;\n foreach ($method_info as &$current_record) {\n if (strcmp($current_record[METHOD_NAME], $new_method_record[METHOD_NAME]) == 0) {\n $new_method_record[IS_DUPLICATE] = true;\n $current_record[IS_DUPLICATE] = true;\n }\n }\n // insert new method record into info array\n $method_info[] = $new_method_record;\n }\n }\n\n return $method_info;\n}",
"private function extractMethods(): array\n {\n $methods = [];\n\n $tokens = $this->tokens->findFirstCurlyParenthesizedBlock();\n $tokens = $tokens->withoutBlocks();\n\n preg_match_all('/(?<docblock>T_DOC_COMMENT )?(?<qualifiers>(T_FINAL |T_ABSTRACT |T_PUBLIC |T_PROTECTED |T_PRIVATE |T_STATIC ))*(T_FUNCTION )(?<name>T_STRING )\\( \\) (: (?<return>T_[A-Z0-9]* ))?({ } |; )/',\n $tokens->asString(),\n $matches,\n PREG_OFFSET_CAPTURE | PREG_SET_ORDER);\n\n foreach ($matches as $match)\n {\n $methodTokens = TokenMatchHelper::codeBlock($match, $tokens, $this->tokens);\n $lines = $methodTokens->lines();\n\n $methods[] = ['docblock' => TokenMatchHelper::docblockDetails($match, $tokens),\n 'name' => TokenMatchHelper::code('name', $match, $tokens),\n 'is_abstract' => TokenMatchHelper::isAbstract($match),\n 'is_final' => TokenMatchHelper::isFinal($match),\n 'is_static' => TokenMatchHelper::isStatic($match),\n 'visibility' => TokenMatchHelper::visibility($match),\n 'return' => TokenMatchHelper::code('return', $match, $tokens),\n 'start' => $lines['start'],\n 'end' => $lines['end'],\n 'tokens' => $methodTokens];\n }\n\n return $methods;\n }",
"protected function getMethodsAnnotationsByClass($class) : \\stdClass {\n\t\t$reflection = $this->containerService->getReflectionClass($class);\n\t\t$methods = $reflection->getMethods();\n\t\t$classMethods = new \\stdClass();\n\t\t$classMethods->name = $class;\n\t\t$classMethods->methods = array();\n\n\t\tif (!is_array($methods) || empty($methods)) {\n\t\t\t$classMethods->methods = false;\n\t\t\treturn $classMethods;\n\t\t}\n\n\t\tforeach ($methods as $method) {\n\t\t\t$method_annotations = $this->annotationReader->getMethodAnnotations($method);\n\t\t\tif (empty($method_annotations)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$methodAnnotionsObject = new \\stdClass();\n\t\t\t$methodAnnotionsObject->name = $method->name;\n\t\t\t$methodAnnotionsObject->annotations = array();\n\t\t\tforeach ($method_annotations as $key => $annotation) {\n\t\t\t\t$annotationType = get_class($annotation);\n\t\t\t\t$annotationName = explode('\\\\', $annotationType);\n\t\t\t\t$annotationName = end($annotationName);\n\t\t\t\t$annotationObject = new \\stdClass();\n\t\t\t\t$annotationObject->name = $annotationName;\n\t\t\t\t$annotationObject->type = $annotationType;\n\t\t\t\t$annotationObject->vars = array();\n\t\t\t\tforeach (get_object_vars($annotation) as $var => $value) {\n\t\t\t\t\t$annotationObject->vars[$var] = $value;\n\t\t\t\t}\n\t\t\t\t$methodAnnotionsObject->annotations[$annotationName] = $annotationObject;\n\t\t\t}\n\n\t\t\t$classMethods->methods[$methodAnnotionsObject->name] = $methodAnnotionsObject;\n\t\t}\n\n\t\treturn $classMethods;\n\t}",
"private function parsePath() {\r\n\t\t// Get the path from PATH_INFO\r\n\t\tif( $this->input('server', 'PATH_INFO') !== null\r\n\t\t && !empty( $this->input('server', 'PATH_INFO') )\r\n\t\t && trim($this->input('server', 'PATH_INFO'), '/') !== '' ) {\r\n\t\t\t$path = trim($this->input('server', 'PATH_INFO'), '/');\r\n\t\t} else {\r\n\t\t // PATH_INFO does not exist, use index\r\n\t\t\t$path = 'index';\r\n\t\t}\r\n\r\n\t\t// Replace any dangerous characters and make everything lower case\r\n\t\t$path = strtolower(preg_replace('/[^a-z\\/]/i', '', $path));\r\n\t\t\r\n\t\t// Remove the \"api\" prefix if there is one\r\n\t\tif(strpos($path, '/api') === 0) {\r\n\t\t $path = substr($path, 4);\r\n\t\t}\r\n\t\t\r\n\t\t// Parse the class\r\n\t\tif( count(explode('/', $path)) === 1 ) { // If there's only the class\r\n\t\t\t$class = $path;\r\n\t\t\t\t\r\n\t\t\t$this->method = 'index';\r\n\t\t}\r\n\t\telse { // Otherwise both the class and method exist\r\n\t\t\t$class = substr($path, 0, strlen( basename($path) ) * -1); // Get the path only (without the method)\r\n\t\t\t\t\r\n\t\t\t// Set the method\r\n\t\t\t$this->method = basename($path);\r\n\t\t}\r\n\t\t\r\n\t\t// Replace '/' with capitalization for every first letter in the path\r\n\t\tforeach( explode('/', trim($class, '/')) as $value ) {\r\n\t\t\t$this->class .= ucfirst($value);\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t// 'Add 'Actions' prefix so there will be no mistakes including the class\r\n\t\t$this->class = 'Actions' . $this->class;\r\n\t}",
"protected function instanceMethods()\n\t{\n\t\treturn collect($this->stack)->reverse()\n\t\t\t->map(fn($call) => $this->instanceMethodAst(...$call))\n\t\t\t->toArray();\n\t}",
"public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }",
"protected function init()\n {\n $classParser = $this->getContainer()->get('classParser');\n $classParser->setAllowedMethods( array($this->allowedMethod) );\n $this->data = $classParser->getData($this->paths, $this->cacheFile);\n }",
"protected function invokeParserMethod()\n\t{\n\t\t$http_method = ucfirst(strtolower($this->request->getMethod()));\n\t\t$method = \"parse{$http_method}Response\";\n\t\t\n\t\tif (method_exists($this, $method)) {\n\t\t\treturn $this->{$method}();\n\t\t}\n\t}",
"function sourceArray($srcClassName) {\n // Returns an array which contains method source and args.\n\n $ref = new ReflectionClass($srcClassName);\n\n $refMethods = $ref->getMethods();\n // Possible replacement: get_class_methods()?\n\n $objectArray = array();\n foreach ($refMethods as $refMethod) {\n $method = $refMethod->name;\n\n // Get a string of a method's source, in a single line.\n // XXX: Y u no cache file\n $filename = $refMethod->getFileName();\n if (!empty($filename)) {\n $source = getSource($srcClassName, $method, $filename);\n } else {\n // We presume that if no filename is found, the method is\n // built-in and we are unconcerned with it\n debugMsg(\"Skipping builtin method $method\");\n continue;\n }\n \n // Check to determine whether the method being inspected is static\n $isStatic = $refMethod->isStatic();\n\n // Get a comma-seperated string of parameters, wrap them in\n // a method definition. Note that all your methods\n // just became public.\n $params = prepareParametersString($refMethod, false); \n $paramsDefault = prepareParametersString($refMethod); \n if ($isStatic) {\n // unconfirmed as of yet\n $methodHeader = \"public static function $method({$paramsDefault})\";\n } else {\n $methodHeader = \"public function $method({$paramsDefault})\";\n }\n\n // Return the two components mentioned above, indexed by method name\n // XXX: Only send one of the params vars, processing on other end\n $objectArray[$method] = array(\"params\" => $params, \"paramsDefault\" => $paramsDefault, 'methodHeader' => $methodHeader, 'src' => $source, 'isStatic' => $isStatic);\n }\n return $objectArray;\n}",
"public function getClassRoutes() {\r\n\t\t$routes = array();\r\n\t\tforeach (get_declared_classes() as $class) {\r\n\t\t\t$reflector = new \\ReflectionClass($class);\r\n\t\t\tif (!$reflector->isUserDefined()) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t$docblock = $reflector->getDocComment();\r\n\t\t\t$classAnnotations = $this->parseAnnotations($docblock);\r\n\r\n\t\t\tforeach ($reflector->getMethods() as $method) {\r\n\t\t\t\t$docblock = $method->getDocComment();\r\n\t\t\t\t$methodName = $method->getName();\r\n\r\n\t\t\t\t$annotations = $this->parseAnnotations($docblock);\r\n\t\t\t\tif (!array_key_exists('route', $annotations)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Merge class + method annotations\r\n\t\t\t\t$route = $classAnnotations['route'] . $annotations['route'];\r\n\t\t\t\t$annotations = array_merge($classAnnotations, $annotations);\r\n\t\t\t\t$annotations['route'] = $route;\r\n\r\n\t\t\t\t$route = $this->compileRoute($annotations['route']);\r\n\t\t\t\t$function = array($class, $methodName);\r\n\t\t\t\t$routes[] = array($route, $function, $annotations);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $routes;\r\n\t}",
"public function __invoke(string $class, string $method): array\n {\n try {\n $this->classes[$class] = $this->classes[$class] ?? new ReflectionClass($class);\n if (!isset($this->cache[$class][$method])) {\n $this->cache[$class][$method] = DefaultResponse::add(\n $this->getReflect($this->classes[$class], $method)\n );\n }\n } catch (Exception $e) {\n $this->cache[$class][$method] = DefaultResponse::add([\n 'summary' => 'unretrievable definition',\n 'description' => \"$class::$method could not be reflected on.\\n$e\",\n ]);\n }\n return $this->cache[$class][$method];\n }",
"protected function parseOverridenMethod() {\n if (!$this->isPost()) {\n return;\n }\n\n $headerNames = array(\n 'X-HTTP-Method-Override',\n 'X-HTTP-Method',\n 'X-Method-Override',\n );\n\n foreach ($headerNames as $headerName) {\n $header = $this->headers->getHeader('X-HTTP-Method-Override');\n if (!$header) {\n continue;\n }\n\n $this->setMethod($header->getValue());\n\n break;\n }\n }",
"protected function parse() {}",
"public function methods();",
"public function populateMethodCache()\n {\n foreach ($this->getPluginHandler()->getPlugins() as $plugin) {\n $reflector = new ReflectionClass($plugin);\n foreach ($reflector->getMethods() as $method) {\n $name = $method->getName();\n if (strpos($name, self::METHOD_PREFIX) === 0\n && !isset($this->methods[$name])\n ) {\n $this->methods[$name] = array(\n 'total' => $method->getNumberOfParameters(),\n 'required' => $method->getNumberOfRequiredParameters()\n );\n }\n }\n }\n }",
"protected function _classSectionMethods($class, $methods) { if (isset($methods) && is_array($methods)) { // YES\n // TODO: Move to the Flag to Configuration File\n $config_sortMethods = true; // Sort Class or Interface Methods?\n if ($config_sortMethods) {\n ksort($methods);\n }\n\n foreach ($methods as $name => $method) {\n // Process Class Metho\n $this->_statementMethod($class, $name, $method);\n }\n }\n }",
"public function parse()\n {\n }"
] |
[
"0.69331956",
"0.66659415",
"0.64238495",
"0.6295878",
"0.6145635",
"0.5734242",
"0.5711702",
"0.5602077",
"0.55648106",
"0.5533846",
"0.5439709",
"0.5398972",
"0.53596145",
"0.5310982",
"0.5309922",
"0.5290179",
"0.52773976",
"0.5226892",
"0.5223264",
"0.5166934",
"0.5160639",
"0.5159358",
"0.51577324",
"0.5147077",
"0.5115009",
"0.51106596",
"0.5110484",
"0.51086384",
"0.5057845",
"0.502933"
] |
0.68302464
|
1
|
CREATE TABLE IF NOT EXISTS `autorisation$name` ( `id` int(10) NOT NULL AUTO_INCREMENT, `comptes` int(11) NOT NULL, `controller` varchar(200) NOT NULL, `voir` tinyint(4) DEFAULT 1, `ajouter` tinyint(4) DEFAULT 0, `modifier` tinyint(4) DEFAULT 0, `effacer` tinyint(4) DEFAULT 0, `active` tinyint(4) DEFAULT 1, `date_ajoute` datetime NOT NULL, `date_modifier` datetime NOT NULL, PRIMARY KEY (`id`), KEY `autorisation_$id` (`comptes`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TABLE `autorisation$name` ADD CONSTRAINT `autorisation_$id` FOREIGN KEY (`comptes`) REFERENCES `comptes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
protected function create_autorisation(string $nametable)
{
//singltone ==>dejat set $pathconfig
$exists = $this->hasTable(self::Prefixe . $nametable);
if (!$exists) {
$this->table(
self::Prefixe . $nametable,
HTML_Phinx::id_default()
)
->addColumn(HTML_Phinx::id())
->addColumn(HTML_Phinx::select('comptes'))
->addColumn(HTML_Phinx::text_master('controller'))
->addColumn(HTML_Phinx::checkBox($this->getAction()->name_show()))
->addColumn(HTML_Phinx::checkBox($this->getAction()->name_add()))
->addColumn(HTML_Phinx::checkBox($this->getAction()->name_update()))
->addColumn(HTML_Phinx::checkBox($this->getAction()->name_delete()))
->addColumn(HTML_Phinx::datetime('date_ajoute'))
->addColumn(HTML_Phinx::datetime('date_modifier'))
->addForeignKey('comptes', 'comptes', 'id', ['delete' => 'CASCADE', 'update' => 'CASCADE'])
->create();
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function tbl_guiones_registro_afectacion() {\r\n\t\t\t$this->guiones_registro_afectacion = $this->esquema->createTable('GUIONES_REGISTRO_AFECTACION');\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la afectacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_afectacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"public function alter(){\n $tabla = '';\n if(!empty($_POST)){\n if( isset( $_POST['agrcol_tabla'] ) ):\n $tabla = $_POST['agrcol_tabla'];\n $col = $_POST['agrcol_col'];\n $after = $_POST['agrcol_after'];\n endif;\n } \n\n if($tabla!=''):\n $inic = $col;\n $tablas = '';\n $type = '';\n $fk = '';\n $creartablas='';\n\n if( stristr($col, '_id' ) ) $tablas = str_replace('_id', '', $col);\n if( stristr($col, '_id' ) ) $type = ' INTEGER(10)'; \n if( stristr($col, '_fecha') ) $type = ' DATE'; \n if( stristr($col, '_nro' ) ) $type = ' INTEGER(10)'; \n if( stristr($col, '_texto') ) $type = ' TEXT'; \n if($type=='') $type = ' VARCHAR(255)'; \n\n $alter = 'ALTER TABLE '.$tabla.' ADD '.$col.' '.$type.' AFTER '.$after.';';\n\n if($tablas!=''):\n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$tablas.' ( ';\n $creartablas.= ' id_'.$tablas.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$tablas.' VARCHAR(99) ';\n $creartablas.= ', detail_'.$tablas.' VARCHAR(99) ';\n $creartablas.= '); ';\n $alter.= 'ALTER TABLE '.$tabla.' ADD FOREIGN KEY ('.$tablas.'_id) REFERENCES '.$tablas.'(id_'.$tablas.');';\n endif;\n $a = $creartablas.$alter;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n return $re;\n endif; \n }",
"public function createTable(){\nreturn $this->pdo->exec(\n\"CREATE TABLE `sottocategoria` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `codice_categoria` varchar(3) NOT NULL,\n `codice` varchar(3) NOT NULL,\n `descrizione` varchar(80) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `index_codice_cat` (`codice_categoria`),\n KEY `index_codice` (`codice`),\n CONSTRAINT `fk_categoriasottocategoria_1` FOREIGN KEY (`codice_categoria`) REFERENCES `categoria` (`codice`) ON DELETE NO ACTION ON UPDATE NO ACTION\n) ENGINE=InnoDB DEFAULT CHARSET=latin1\"\n);\n}",
"public function up(){\n $this->dbforge->add_field([\n 'id' => [\n 'type' => \"INT\",\n 'auto_increment' => true,\n 'null' => false\n ],\n 'email' => [\n 'type' => \"VARCHAR\",\n 'constraint' => \"255\",\n 'null'=> false\n ],\n 'nome' => [\n 'type' => \"VARCHAR\",\n 'constraint' => \"255\",\n 'null'=> false\n ],\n 'senha' => [\n 'type' => \"VARCHAR\",\n 'constraint' => \"255\",\n 'null'=> false\n ]\n ]);\n $this->dbforge->add_key(\"id\", true);\n $this->dbforge->create_table(\"usuarios\");\n #cria tabela de categorias\n $this->dbforge->add_field([\n 'id' => [\n 'type' => \"INT\",\n 'auto_increment' => true,\n 'null' => false\n ],\n 'nome'=> [\n 'type' => \"VARCHAR\",\n 'constraint' => \"255\",\n 'null' => false,\n ],\n 'saldo' => [\n 'type' => 'decimal',\n 'constraint' => \"10, 2\",\n 'null' => false\n ],\n 'usuario_id' => [\n 'type' => \"INT\",\n 'null' => false\n ]\n ]);\n $this->dbforge->add_key(\"id\", true);\n $this->dbforge->create_table(\"categorias\");\n #cria tabela lançamentos\n $this->dbforge->add_field([\n 'id'=> [\n 'type' => 'INT',\n 'auto_increment' => true,\n 'null' => false\n ],\n 'valor' => [\n 'type' => 'decimal',\n 'constraint' => '10, 2',\n 'null' => false\n ],\n 'operacao' => [\n 'type' => 'VARCHAR',\n 'constraint' => '255',\n 'null' => false\n ],\n 'descricao' => [\n 'type' => 'TEXT',\n 'null' => false\n ],\n 'data' => [\n 'type' => 'date',\n 'null' => false\n ],\n 'usuario_id' => [\n 'type' => 'INT',\n 'null' => false\n ],\n 'categoria_id' => [\n 'type' => 'INT',\n 'null' => false\n ]\n\n ]);\n $this->dbforge->add_key(\"id\", true);\n $this->dbforge->create_table(\"lancamentos\");\n\n }",
"public function create(){\n $alter = '';\n $crear = '';\n $creartablas = '';\n\n $a = '';\n if(!empty($_POST)){\n if( isset($_POST['creartabla']) )\n $a = $_POST['creartabla'];\n }\n if($a!=''):\n $array = explode(',', $a);\n $crear = '';\n $tablas = array();\n foreach ($array as $v): \n $v = trim($v);\n $inic = $crear;\n if( stristr($v, 'id_') ){ \n $tabla = str_replace('id_', '', $v);\n $crear.= 'CREATE TABLE IF NOT EXISTS '.$tabla.' ( ';\n $crear.= ' id_'.$tabla.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n }\n if( stristr( $v, '_id') ){\n $tablas[] = str_replace('_id', '', $v);\n $crear.= ','.$v.' INTEGER(10)'; \n } \n\n if( stristr($v, 'fecha' )or stristr($v, 'fecha') ) $crear.= ','.$v.' DATE NOT NULL '; \n if( stristr($v, '_nro' ) or stristr($v, 'nro_' ) ) $crear.= ','.$v.' INTEGER(10) NOT NULL '; \n if( stristr($v, 'text' ) or stristr($v, 'texto' ) ) $crear.= ','.$v.' TEXT NOT NULL COMMENT \\'col:12\\' '; \n if( stristr($v, 'timestamp' ) ) $crear.= ','.$v.' TIMESTAMP DEFAULT CURRENT_TIMESTAMP '; \n if($inic==$crear) $crear.= ','.$v.' VARCHAR(255) NOT NULL '; \n \n \n endforeach;\n\n $fk = '';\n $creartablas ='';\n foreach ($tablas as $value):\n $fk.=', FOREIGN KEY('.$value.'_id) REFERENCES '.$value.'(id_'.$value.') '; \n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$value.' ( ';\n $creartablas.= ' id_'.$value.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$value.' VARCHAR(99) NOT NULL';\n $creartablas.= ', detail_'.$value.' VARCHAR(99) NOT NULL ';\n $creartablas.= ') ENGINE = InnoDB; ';\n endforeach;\n $crear .= $fk.') ENGINE = InnoDB;';\n\n $a = $creartablas.$crear;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n $tables = $this -> Tables_model -> table_name();\n $this->session->set_userdata('tables', $tables);\n return $re;\n endif;\n }",
"public function up()\n {\n Schema::create('ordenes_urgentes_cuatro', function (Blueprint $table) {\n $table->bigIncrements('id');\n $table->bigInteger('ordenes_id')->unsigned();\n $table->dateTime('fecha');\n $table->boolean('activo');\n \n $table->foreign('ordenes_id')->references('id')->on('ordenes');\n });\n }",
"private function tbl_guiones() {\r\n\t\t\t$this->guiones = $this->esquema->createTable('GUIONES');\r\n\t\t\t$this->guiones->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la plantilla del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones->addColumn('PLANTILLA', 'text', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => false,\r\n\t\t\t\t'comment' => 'plantilla del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del Guion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"private function tbl_guiones_registro_ubicacion() {\r\n\t\t\t$this->guiones_registro_ubicacion = $this->esquema->createTable('GUIONES_REGISTRO_UBICACION');\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la ubicacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la ubicacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la ubicacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_ubicacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"private function tbl_usuarios_cargo() {\r\n\t\t\t$this->usuarios_cargo = $this->esquema->createTable('USUARIOS_CARGO');\r\n\t\t\t$this->usuarios_cargo->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Cargo'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_cargo->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre del Cargo'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_cargo->setPrimaryKey(array('ID'));\r\n\t\t}",
"public function acfedu_check_table() {\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\tob_start();\n\t\t\t\tglobal $wpdb;\n\t\t\t\t?>\n\t\t\t\tCREATE TABLE <?php echo $wpdb->prefix; ?>faculty (\n\t\t\t\t\tid int(6) unsigned NOT NULL auto_increment,\n\t\t\t\t\tfaculty_name varchar(50) NULL,\n\t\t\t\t\tuniv_code varchar(10) NULL,\n\t\t\t\t\tuniv_name varchar(50) NULL,\n\t\t\t\t\tcountry_code varchar(2) NULL,\n\t\t\t\t\tcountry varchar(50) NULL,\n\t\t\t\t\tprice decimal(10) NULL,\n\t\t\t\t\tPRIMARY KEY (id)\n\t\t\t\t)\n COLLATE <?php echo $wpdb->collate; ?>;\n\t\t\t\t<?php\n\t\t\t\t$sql = ob_get_clean();\n\t\t\t\tdbDelta( $sql );\n\n\t\t\t}",
"private function tbl_usuarios_empresa() {\r\n\t\t\t$this->usuarios_empresa = $this->esquema->createTable('USUARIOS_EMPRESA');\r\n\t\t\t$this->usuarios_empresa->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la Empresa'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la Empresa'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Estado de la Empresa [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios_empresa->setPrimaryKey(array('ID'));\r\n\t\t\t$this->usuarios_empresa->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"public function up(){\n $this->dbforge->add_field(array( //creacion del vector que contiene los campos de la tabla\n 'CGNW_PK' => array( //columna CGNW_PK tipo int, tamaño 10, auto icremental, solo positivos\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'CGNW_FK_news' => array( //columna CGNW_FK_news tipo int, tamaño 10, auto icremental, solo positivos\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n ),\n \n 'CGNW_FK_subcategories' => array( //columna CGNW_FK_subcategories tipo int, tamaño 10, auto icremental, solo positivos\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n ),\n ));\n $this->dbforge->add_key('CGNW_PK', TRUE); //agregar atributo de llave primaria al campo CGNW_PK \n $this->dbforge->create_table('subcategories_news'); //creacion de la tabla users_members_cicles con los atributos y columnas\n \n \n $this->dbforge->add_column('subcategories_news',[\n 'CONSTRAINT CGNW_FK_news FOREIGN KEY(CGNW_FK_news) REFERENCES news(NEWS_PK)',\n ]); //creacion de relacion a la tabla news\n $this->dbforge->add_column('subcategories_news',[\n 'CONSTRAINT CGNW_FK_subcategories FOREIGN KEY(CGNW_FK_subcategories) REFERENCES subcategories(SBCG_PK)',\n ]); //creacion de relacion a la tabla subcategories \n }",
"function spipmine_declarer_tables_auxiliaires($tables_auxiliaires){\r\n\t// permettant le lien entre les rubriques et les clients\r\n\t$spipmine_clients_rubriques = array(\r\n\t\t\"id_rubrique\"\t\t\t=>\t\"int(11) NOT NULL\",\r\n\t\t\"id_client\"\t\t\t\t=>\t\"int(11) NOT NULL\"\r\n\t);\r\n\t$spipmine_clients_rubriques_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_rubrique\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_clients_rubriques'] = array(\r\n\t\t'field' => &$spipmine_clients_rubriques,\r\n\t\t'key' => &$spipmine_clients_rubriques_key\r\n\t);\r\n\r\n\r\n\t// structure de la table spipmine_lignes_factures\r\n\t// liée à la table spipmine_factures\r\n\t$spipmine_lignes_facture = array(\r\n\t\t\"id_ligne\"\t\t\t\t=>\t\"int(11) NOT NULL auto_increment\",\r\n\t\t\"id_facture\"\t\t\t=>\t\"int(11) default NULL\",\r\n\t\t\"position\"\t\t\t\t=>\t\"int(11) default NULL\",\r\n\t\t\"quantite\"\t\t\t\t=>\t\"float default NULL\",\r\n\t\t\"unite\"\t\t\t\t\t=>\t\"varchar(50) default NULL\",\r\n\t\t\"designation\"\t\t\t=>\t\"text default NULL\",\r\n\t\t\"prix_unitaire_ht\"\t\t=>\t\"int(11) default NULL\",\r\n\t\t\"commentaire\"\t\t\t=>\t\"mediumtext\"\r\n\t);\r\n\t$spipmine_lignes_facture_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_ligne\",\r\n\t\t\"KEY id_facture\"\t\t=>\t\"id_facture\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_lignes_facture'] = array(\r\n\t\t'field' => &$spipmine_lignes_facture,\r\n\t\t'key' => &$spipmine_lignes_facture_key\r\n\t);\r\n\r\n\r\n\r\n\t// structure de la table spipmine_types_actions\r\n\t$spipmine_types_actions = array(\r\n\t\t\"id_type_action\"\t\t=>\t\"int(11) NOT NULL auto_increment\",\r\n\t\t\"nom_type_action\"\t\t=>\t\"varchar(255) default NULL\",\r\n\t\t\"commentaires\"\t\t\t=>\t\"mediumtext\"\r\n\t);\r\n\t$spipmine_types_actions_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_type_action\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_types_actions'] = array(\r\n\t\t'field' => &$spipmine_types_actions,\r\n\t\t'key' => &$spipmine_types_actions_key\r\n\t);\r\n\r\n\r\n\t\r\n\t// structure de la table spipmine_types_documents\r\n\t$spipmine_types_documents = array(\r\n\t\t\"id_type_document\"\t\t=>\t\"int(11) NOT NULL auto_increment\",\r\n\t\t\"nom_type_document\"\t\t=>\t\"varchar(50) default NULL\"\r\n\t);\r\n\t$spipmine_types_documents_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_type_document\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_types_documents'] = array(\r\n\t\t'field' => &$spipmine_types_documents,\r\n\t\t'key' => &$spipmine_types_documents_key\r\n\t);\r\n\r\n\t\r\n\t\r\n\t// structure de la table spipmine_types_livrables\r\n\t$spipmine_types_livrables = array(\r\n\t\t\"id_type_livrable\"\t\t=>\t\"int(11) NOT NULL auto_increment\",\r\n\t\t\"nom_type_livrable\"\t\t=>\t\"varchar(50) default NULL\"\r\n\t);\r\n\t$spipmine_types_livrables_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_type_livrable\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_types_livrables'] = array(\r\n\t\t'field' => &$spipmine_types_livrables,\r\n\t\t'key' => &$spipmine_types_livrables_key\r\n\t);\r\n\r\n\t\r\n\t\r\n\t// structure de la table spipmine_types_prestations\r\n\t$spipmine_types_prestations = array(\r\n\t\t\"id_type_presta\"\t\t=>\t\"int(11) NOT NULL auto_increment\",\r\n\t\t\"nom_type_presta\"\t\t=>\t\"varchar(50) default NULL\",\r\n\t\t\"commentaires\"\t\t\t=>\t\"mediumtext\"\r\n\t);\r\n\t$spipmine_types_prestations_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_type_presta\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_types_prestations'] = array(\r\n\t\t'field' => &$spipmine_types_prestations,\r\n\t\t'key' => &$spipmine_types_prestations_key\r\n\t);\r\n\r\n\t\r\n\t\r\n\t// structure de la table spipmine_types_facturation\r\n\t$spipmine_types_facturation = array(\r\n\t\t\"id_type_facturation\"\t=>\t\"int(11) NOT NULL auto_increment\",\r\n\t\t\"nom_type_facturation\"\t=>\t\"varchar(50) default NULL\",\r\n\t\t\"commentaires\"\t\t\t=>\t\"mediumtext\"\r\n\t);\r\n\t$spipmine_types_facturation_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_type_facturation\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_types_facturation'] = array(\r\n\t\t'field' => &$spipmine_types_facturation,\r\n\t\t'key' => &$spipmine_types_facturation_key\r\n\t);\r\n\r\n\r\n\t// structure de la table spipmine_types_status\r\n\t$spipmine_types_status = array(\r\n\t\t\"id_type_status\"\t\t=>\t\"int(11) NOT NULL auto_increment\",\r\n\t\t\"nom_type_status\"\t\t=>\t\"varchar(50) default NULL\",\r\n\t\t\"commentaires\"\t\t\t=>\t\"mediumtext\"\r\n\t);\r\n\t$spipmine_types_status_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_type_status\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_types_status'] = array(\r\n\t\t'field' => &$spipmine_types_status,\r\n\t\t'key' => &$spipmine_types_status_key\r\n\t);\r\n\r\n\t// structure de la table spipmine_types_reglements\r\n\t$spipmine_types_reglements = array(\r\n\t\t\"id_type_reglement\"\t\t=>\t\"int(11) NOT NULL auto_increment\",\r\n\t\t\"nom_type_reglement\"\t=>\t\"varchar(50) default NULL\",\r\n\t\t\"commentaires\"\t\t\t=>\t\"mediumtext\"\r\n\t);\r\n\t$spipmine_types_reglements_key = array(\r\n\t\t\"PRIMARY KEY\"\t\t\t=>\t\"id_type_reglement\"\r\n\t);\r\n\t$tables_auxiliaires['spipmine_types_reglements'] = array(\r\n\t\t'field' => &$spipmine_types_reglements,\r\n\t\t'key' => &$spipmine_types_reglements_key\r\n\t);\r\n\r\n\t\r\n\treturn $tables_auxiliaires;\r\n}",
"function archobjet_autoriser() {\n}",
"private function tbl_guiones_registro() {\r\n\t\t\t$this->guiones_registro = $this->esquema->createTable('GUIONES_REGISTRO');\r\n\t\t\t$this->guiones_registro->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('FECHA', 'datetime', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'comment' => 'Fecha de ingreso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('USUARIO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del usuario del registro [ID de la tabla USUARIOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('TIPO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de registro [ID de la tabla GUIONES_REGISTRO_TIPO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AFECTACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion del registro [ID de la tabla GUIONES_REGISTRO_AFECTACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AVISO', 'bigint', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'default' => 0,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Numero del aviso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('UBICACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la UBICACION del registro [ID de la tabla GUIONES_REGISTRO_UBICACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->usuarios, array('USUARIO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_tipo, array('TIPO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_afectacion, array('AFECTACION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_ubicacion, array('UBICACION'), array('ID'), $this->opcForeign);\r\n\t\t}",
"private function tbl_guiones_registro_hfc() {\r\n\t\t\t$this->guiones_registro_hfc = $this->esquema->createTable('GUIONES_REGISTRO_HFC');\r\n\t\t\t$this->guiones_registro_hfc->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro del guion HFC'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->addColumn('REGISTRO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro [ID de la tabla GUIONES_REGISTRO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->addColumn('INTERMITENCIA', 'boolean', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'default ' => '0', \r\n\t\t\t\t'comment' => 'Determina la intermitencia del servicio, 0 => NO, 1 => SI'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->addColumn('GUION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Guion [ID de la tabla GUIONES]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->addColumn('PRIORIDAD', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la prioridad del Guion [ID de la tabla GUIONES_REGISTRO_NODOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_hfc->addForeignKeyConstraint($this->guiones_registro, array('REGISTRO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro_hfc->addForeignKeyConstraint($this->guiones, array('GUION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro_hfc->addForeignKeyConstraint($this->guiones_prioridades, array('PRIORIDAD'), array('ID'), $this->opcForeign);\r\n\t\t}",
"public function change()\n {\n $table = $this->table('libros');\n $table->addColumn('autor', 'string', [\n 'default' => null,\n 'limit' => 100,\n 'null' => true,\n ]);\n $table->addColumn('titulo', 'string', [\n 'default' => null,\n 'limit' => 150,\n 'null' => true,\n ]);\n $table->addColumn('traductor', 'string', [\n 'default' => null,\n 'limit' => 100,\n 'null' => true,\n ]);\n $table->addColumn('ciudad', 'string', [\n 'default' => null,\n 'limit' => 50,\n 'null' => true,\n ]);\n $table->addColumn('anio_edicion', 'integer', [\n 'default' => null,\n 'null' => true,\n ]);\n $table->addColumn('edicion', 'string', [\n 'default' => null,\n 'limit' => 10,\n 'null' => true,\n ]);\n $table->addColumn('primera_edicion', 'integer', [\n 'default' => null,\n 'null' => true,\n ]);\n $table->addColumn('editorial', 'string', [\n 'default' => null,\n 'limit' => 50,\n 'null' => true,\n ]);\n $table->addColumn('tema_id', 'integer', [\n 'default' => null,\n 'null' => true,\n ]);\n $table->addColumn('tipo', 'string', [\n 'default' => null,\n 'limit' => 10,\n 'null' => true,\n ]);\n $table->addColumn('topografia', 'string', [\n 'default' => null,\n 'limit' => 15,\n 'null' => true,\n ]);\n $table->addColumn('paginas', 'integer', [\n 'default' => null,\n 'null' => true,\n ]);\n $table->addColumn('tomos', 'integer', [\n 'default' => null,\n 'null' => true,\n ]);\n $table->addColumn('idioma', 'string', [\n 'default' => null,\n 'limit' => 20,\n 'null' => true,\n ]);\n $table->addColumn('observaciones', 'text', [\n 'default' => null,\n 'null' => true,\n ]);\n $table->addColumn('baja', 'boolean', [\n 'default' => null,\n 'null' => true,\n ]);\n $table->addColumn('created', 'datetime', [\n 'default' => null,\n 'null' => false,\n ]);\n $table->addColumn('modified', 'datetime', [\n 'default' => null,\n 'null' => false,\n ]);\n\n $table->create();\n\n $current_timestamp = Carbon::now();\n // Inserta artículos de la base de datos antigua\n $this->execute('insert into libros (id, autor, titulo, traductor, ciudad, anio_edicion, edicion, primera_edicion, editorial, tema_id, tipo, topografia, paginas, tomos, idioma, observaciones, baja, created, modified) select id, lAutor, lTitulo, lTraductor, lCiudad, lAnioEdicion, lEdicion, lPrimeraEdicion, lEditorial, subtema_id+30, lTipo, lTopografia, lPaginas, lTomos, lIdioma, lObservaciones, lBaja, \"' . $current_timestamp . '\", \"' . $current_timestamp . '\" from old_libros');\n }",
"function ajoue_proprietaire($nom,$CA,$debut_contrat,$fin_contrat)\r\n{ $BDD=ouverture_BDD_Intranet_Admin();\r\n\r\n if(exist($BDD,\"proprietaire\",\"nom\",$nom)){echo \"nom deja pris\";return;}\r\n\r\n $SQL=\"INSERT INTO `proprietaire` (`ID`, `nom`, `CA`, `debut_contrat`, `fin_contrat`) VALUES (NULL, '\".$nom.\"', '\".$CA.\"', '\".$debut_contrat.\"', '\".$fin_contrat.\"')\";\r\n\r\n $result = $BDD->query ($SQL);\r\n\r\n if (!$result)\r\n {echo \"<br>SQL : \".$SQL.\"<br>\";\r\n die('<br>Requête invalide ajoue_equipe : ' . mysql_error());}\r\n}",
"function Forms_creer_donnee($id_form,$c = NULL, $rang=NULL){\n\tinclude_spip('inc/autoriser');\n\tif (!autoriser('creer','donnee',0,NULL,array('id_form'=>$id_form)))\n\t\treturn array(0,_L(\"droits insuffisants pour creer une donnee dans table $id_form\"));\n\tinclude_spip('inc/forms');\n\t$new = 0;\n\t$erreur = array();\n\tForms_enregistrer_reponse_formulaire($id_form, $new, $erreur, $reponse, '', '' , $c, $rang);\n\treturn array($new,$erreur);\n}",
"function citrace_pre_edition($tableau){\n\tstatic $actions = array();\n\tif (isset($tableau['args']['table'])){\n\t\t$table = $tableau['args']['table'];\n\t\tif ($actions AND isset($tableau['args']['action']) AND in_array($table.'/'.$tableau['args']['action'],$actions)) \n\t\t\treturn $tableau;\n\t\telse\n\t\t\t$actions[] = $table.'/'.$tableau['args']['action'];\n\t}\n\n\t// changement de rubrique pour un article publie\n\tif (isset($tableau['args']['action']) AND $tableau['args']['action']=='instituer' \n\t AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_articles') {\n\t \t$id_article = intval($tableau['args']['id_objet']);\n\t\t if ($id_article>0) {\n\t\t\t\tinclude_spip('inc/texte');\n\t\t\t\t$row = sql_fetsel('*', 'spip_articles', 'id_article='.$id_article);\n\t\t\t\tif ($row){\n\t\t\t\t\t$old_rubrique = $row['id_rubrique'];\n\t\t\t\t\tif ($row['statut']=='publie'){\n\t\t\t\t\t\t$new_rubrique = (isset($tableau['data']['id_rubrique']) ? intval($tableau['data']['id_rubrique']) : 0);\n\t\t\n\t\t\t \t\tif ($new_rubrique>=1 AND $new_rubrique!=$old_rubrique){\n\t\t\t\t\t\t\t$commentaire = '('.interdire_scripts(supprimer_numero($row['titre'])).')'.\" - id_rubrique_new:\".$new_rubrique.\" - id_rubrique_old:\".$old_rubrique;\n\t\t\t\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t\t\t\t$citrace('article', $id_article, 'changement de rubrique pour article', $commentaire, $new_rubrique);\n\t\t\t \t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }\t\n\n\t// changement de statut ou de l'email d'un auteur\n\tif (isset($tableau['args']['action']) \n\t AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_auteurs') {\n\n \t$id_auteur = intval($tableau['args']['id_objet']);\n\t if ($id_auteur>0) {\n\t\t\tinclude_spip('inc/texte');\n\t\t\t$row = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$id_auteur);\n\t\t\tif ($row){\n\t\t\t\t// changement de statut d'un auteur\n\t\t\t\tif ($tableau['args']['action']=='instituer'){\n\t\t\t\t\t$old_statut = $row['statut'];\n\t\t\t\t\t$new_statut = (isset($tableau['data']['statut']) ? $tableau['data']['statut'] : '');\n\t\t\t\t\t$old_webmestre = $row['webmestre'];\n\t\t\t\t\t$new_webmestre = (isset($tableau['data']['webmestre']) ? $tableau['data']['webmestre'] : '');\n\t\n\t\t \t\tif ($new_statut AND $new_statut!=$old_statut){\n\t\t\t\t\t\t$commentaire = interdire_scripts(supprimer_numero($row['nom']))\n\t\t\t\t\t\t.' ('.interdire_scripts($row['email']).')'\n\t\t\t\t\t\t.\" - statut_new:\".$new_statut.\" - statut_old:\".$old_statut \n\t\t\t\t\t\t.\" - webmestre_new:\".$new_webmestre.\" - webmestre_old:\".$old_webmestre;\n\t\t\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t\t\t$citrace('auteur', $id_auteur, \"changement de statut pour l'auteur\", $commentaire);\n\t\t \t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// modifier l'email d'un auteur\n\t\t\t\tif ($tableau['args']['action']=='modifier'){\n\t\t\t\t\t$old_email = $row['email'];\n\t\t\t\t\t$new_email = (isset($tableau['data']['email']) ? $tableau['data']['email'] : '');\n\t\n\t\t \t\tif ($new_email!=$old_email){\n\t\t\t\t\t\t$commentaire = '('.interdire_scripts(supprimer_numero($row['nom'])).')'\n\t\t\t\t\t\t.\" - email_new:\".$new_email.\" - email_old:\".$old_email; \n\t\t\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t\t\t$citrace('auteur', $id_auteur, \"changement d'email pour l'auteur\", $commentaire);\n\t\t \t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\t\n \n\t// changement de date de publication (ou de depublication) d'un article\n\tif (isset($tableau['args']['action']) \n\t AND isset($tableau['args']['table']) AND $tableau['args']['table']=='spip_articles') {\n\t \t$id_article = intval($tableau['args']['id_objet']);\n\t\t if ($id_article>0) {\n\t\t \t// lors du changement de statut, la date de publication est tracee par le pipeline post_edition\n\t\t \t// aussi ne pas doublonner\n\t \t\tif (!isset($tableau['data']['statut']) OR !isset($tableau['args']['statut_ancien']) OR $tableau['data']['statut'] == $tableau['args']['statut_ancien']){\n\t\t\t\t\tinclude_spip('inc/texte');\n\t\t\t\t\t$row = sql_fetsel('*', 'spip_articles', 'id_article='.$id_article);\n\t\t\t\t\t$date_old = $row['date'];\n\t\t\t\t\t$id_rubrique = $row['id_rubrique'];\n\t\t\t\t\n\t\t\t\t\tif (isset($tableau['data']['date']) AND $date_old != $tableau['data']['date']){\n\t\t\t\t\t\t$article_msg = '('.interdire_scripts(supprimer_numero($row['titre'])).')'.\" - id_rubrique:\".$id_rubrique;\n\t\t\t\t\t\t$article_msg .= \" - date_publication:\".$tableau['data']['date'].\" - date_publication_old:\".$date_old.\" (meta post_dates :\".$GLOBALS['meta'][\"post_dates\"].\")\";\n\t\t\t\t\t\t$citrace = charger_fonction('citrace', 'inc');\n\t\t\t\t\t\t$citrace('article', $id_article, 'modifier_date', $article_msg, $id_rubrique);\t\t\t\t\t\n\t\t\t\t\t}\n\t \t\t}\n\t\t }\n }\n\n\treturn $tableau;\n}",
"public function change()\n {\n $table = $this->table('erc_users', ['id' => true, 'primary_key' => ['id']]); \n $table->addColumn('nik', 'string', ['null'=>true, 'limit' => 50])\n ->addColumn('full_name', 'string', ['null'=>true,'limit' => 50])\n ->addColumn('email', 'string', ['limit' => 50])\n ->addColumn('password', 'string', ['null' => true])\n ->addColumn('avatar', 'string', ['null' => true])\n ->addColumn('avatar_dir', 'string', ['null' => true])\n ->addColumn('phone_number', 'string', ['null'=>true,'limit' => 50])\n ->addColumn('token', 'string', ['default' => null, 'limit' => 255, 'null' => true,])\n ->addColumn('token_expires', 'datetime', ['default' => null, 'limit' => null, 'null' => true,])\n ->addColumn('api_token', 'string', ['default' => null, 'limit' => 255, 'null' => true,])\n ->addColumn('activation_date', 'datetime', ['default' => null, 'limit' => null, 'null' => true,])\n ->addColumn('tos_date', 'datetime', ['default' => null, 'limit' => null, 'null' => true,])\n ->addColumn('active', 'boolean', ['null' => false, 'default' => false])\n ->addColumn('slug', 'string', ['null' => false])\n ->addColumn('company_id', 'integer', ['null'=>true])\n ->addColumn('branch_id', 'integer', ['null'=>true])\n ->addColumn('is_superuser', 'boolean', ['null' => false, 'default' => false])\n ->addColumn('created_by', 'integer', ['null'=>true])\n ->addColumn('created_at', 'timestamp')\n ->addColumn('updated_at', 'timestamp')\n ->addColumn('last_updated_by', 'integer', ['null' => true, 'limit'=>15])\n ->addIndex('slug',['unique'=>1])\n ->addIndex('company_id')\n ->addIndex('branch_id')\n ->addIndex('email',['unique'=>1])\n ->addIndex('nik',['unique'=>1])\n ->create();\n }",
"public function crearSchema(){\n $sql = \"SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;\n SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;\n SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';\n\n CREATE SCHEMA IF NOT EXISTS `moto_market` DEFAULT CHARACTER SET latin1 ;\n USE `moto_market` ;\n\n\n CREATE TABLE IF NOT EXISTS `moto_market`.`cilindrados` (\n `cilindrado_id` INT(11) NOT NULL,\n `cilindrado` VARCHAR(100) NOT NULL,\n PRIMARY KEY (`cilindrado_id`))\n ENGINE = InnoDB\n DEFAULT CHARACTER SET = latin1;\n\n\n CREATE TABLE IF NOT EXISTS `moto_market`.`estilos` (\n `estilos_id` INT(11) NOT NULL AUTO_INCREMENT,\n `estilo` VARCHAR(100) CHARACTER SET 'latin1' NOT NULL,\n PRIMARY KEY (`estilos_id`))\n ENGINE = InnoDB\n DEFAULT CHARACTER SET = utf8;\n\n CREATE TABLE IF NOT EXISTS `moto_market`.`marcas` (\n `marca_id` INT(11) NOT NULL AUTO_INCREMENT,\n `nombre` VARCHAR(100) NOT NULL,\n PRIMARY KEY (`marca_id`))\n ENGINE = InnoDB\n DEFAULT CHARACTER SET = latin1;\n\n CREATE TABLE IF NOT EXISTS `moto_market`.`motos` (\n `id` INT(11) NOT NULL AUTO_INCREMENT,\n `anio` DATE NOT NULL,\n `precio` INT(11) NOT NULL,\n `estilo_id` VARCHAR(45) NOT NULL,\n `cilindrado_id` VARCHAR(45) NOT NULL,\n `marca_id` VARCHAR(45) NOT NULL,\n PRIMARY KEY (`id`))\n ENGINE = InnoDB\n DEFAULT CHARACTER SET = latin1;\n\n CREATE TABLE IF NOT EXISTS `moto_market`.`usuarios` (\n `id_usuarios` INT(11) NOT NULL AUTO_INCREMENT,\n `usuario` VARCHAR(45) NOT NULL,\n `password` VARCHAR(100) NOT NULL,\n `email` VARCHAR(45) NOT NULL,\n `nombre` VARCHAR(45) NOT NULL,\n `apellido` VARCHAR(45) NOT NULL,\n `ruta_avatar` VARCHAR(100) NULL DEFAULT NULL,\n PRIMARY KEY (`id_usuarios`))\n ENGINE = InnoDB\n AUTO_INCREMENT = 0\n DEFAULT CHARACTER SET = latin1;\n\n SET SQL_MODE=@OLD_SQL_MODE;\n SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;\n SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;\";\n\n $this->db->prepare($sql)->execute();\n }",
"function creaTablaPartidos(){\r\n // Create connection\r\n $conn = dameConexion();//new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Conexión fallida: \" . $conn->connect_error);\r\n }\r\n \r\n // sql to create table carta (Nombre, Coleccion, Imagen, fecha, entrada)\r\n $sql = \"CREATE TABLE partidos (\r\n id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\r\n Local VARCHAR(15) NOT NULL,\r\n Visitante VARCHAR(15),\r\n Resultado VARCHAR(5),\r\n Entrada INT(6)\r\n )\";\r\n \r\n if ($conn->query($sql) === TRUE) {\r\n echo \"Tabla creada correctamente\";\r\n } else {\r\n \r\n //echo \"Error creando la tabla: \" . $conn->error;\r\n }\r\n \r\n $conn->close();\r\n}",
"public function up()\n {\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Categoria_id' => array(\n 'type' => 'INT',\n 'constraint' => 2,\n ),\n 'Titulo_curso' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100\n ),\n 'Duracion' => array(\n 'type' => 'INT',\n 'constraint' => 2,\n ),\n 'Descripcion_corta' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Objetivos_curso' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Descripcion_larga' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Info_privada' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Costo_normal' => array(\n 'type' => 'INT',\n 'constraint' => 5,\n ),\n 'Script_pago_normal' => array(\n 'type' => 'text',\n ),\n 'Costo_promocional' => array(\n 'type' => 'INT',\n 'constraint' => 5,\n 'null' => TRUE,\n ),\n 'Info_promocional' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Script_pago_promocional' => array(\n 'type' => 'text',\n 'null' => TRUE,\n ),\n 'Imagen' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Video_youtube' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Fecha_ult_actualizacion_curso' => array(\n 'type' => 'TIMESTAMP',\n 'null' => TRUE,\n ),\n 'Fecha__actualizacion_modulos' => array(\n 'type' => 'DATE',\n 'null' => TRUE,\n ),\n 'Usuario_creador_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Ult_usuario_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Visible' => array(\n 'type' => 'INT',\n 'constraint' => 1,\n 'null' => TRUE,\n ),\n\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_cursos');\n\n /// tbl_cursos_modulos - tabla donde se registran los modulos de los cursos creados\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Curso_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Titulo_modulo' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100\n ),\n 'Descripcion_modulo' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Contenido_html' => array(\n 'type' => 'LONGTEXT',\n 'null' => TRUE,\n ),\n 'Imagen' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Url_archivo' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Fecha_ult_actualizacion' => array(\n 'type' => 'TIMESTAMP',\n 'null' => TRUE,\n ),\n 'Usuario_creador_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Ult_usuario_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Visible' => array(\n 'type' => 'INT',\n 'constraint' => 1,\n 'null' => TRUE,\n ),\n\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_cursos_modulos');\n\n /// tbl_cursos_categorias - tabla donde se registran los modulos de los cursos creados\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Nombre_categoria' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100\n ),\n 'Descripcion' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Visible' => array(\n 'type' => 'INT',\n 'constraint' => 1,\n ),\n\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_cursos_categorias');\n\n /// tbl_cursos_examen - tabla donde se registran los examenes de los modulos de los cursos creados\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Curso_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Modulo_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Titulo_examen' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100\n ),\n 'Descripcion_examen' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Contenido_html' => array(\n 'type' => 'LONGTEXT',\n 'null' => TRUE,\n ),\n 'Imagen' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Url_archivo' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Fecha_ult_actualizacion' => array(\n 'type' => 'TIMESTAMP',\n 'null' => TRUE,\n ),\n 'Usuario_creador_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Ult_usuario_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Visible' => array(\n 'type' => 'INT',\n 'constraint' => 1,\n 'null' => TRUE,\n ),\n\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_cursos_examen');\n\n /// tbl_cursos_alumnos - tabla donde se vinculas los alumnos a los cursos creados\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Curso_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Profesor_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Alumno_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Fecha_inicio' => array(\n 'type' => 'DATE'\n ),\n 'Fecha_finalizacion' => array(\n 'type' => 'DATE',\n 'null' => TRUE,\n ),\n 'Estado' => array(\n 'type' => 'INT',\n 'constraint' => 1\n ),\n 'Nota_final' => array(\n 'type' => 'INT',\n 'constraint' => 2,\n 'null' => TRUE,\n ),\n 'Monto_abonado' => array(\n 'type' => 'INT',\n 'constraint' => 5,\n 'null' => TRUE,\n ),\n 'Url_archivo' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Observaciones' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Fecha_ult_actualizacion' => array(\n 'type' => 'TIMESTAMP',\n 'null' => TRUE,\n ),\n 'Usuario_creador_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Ult_usuario_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Visible' => array(\n 'type' => 'INT',\n 'constraint' => 1,\n 'null' => TRUE,\n ),\n\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_cursos_alumnos');\n\n /// tbl_cursos_examen_alumno - tabla donde se registran los resultados de los examenes de los modulos de los cursos creados\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Examen_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Curso_alumno_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Modulo_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Fecha_habilitado' => array(\n 'type' => 'DATE'\n ),\n 'Fecha_realizado' => array(\n 'type' => 'DATE',\n 'null' => TRUE,\n ),\n 'Fecha_corregido' => array(\n 'type' => 'DATE',\n 'null' => TRUE,\n ),\n 'Respuesta_html' => array(\n 'type' => 'LONGTEXT',\n 'null' => TRUE,\n ),\n\n\n 'Url_archivo' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Estado' => array(\n 'type' => 'INT',\n 'constraint' => 1,\n ),\n 'Nota' => array(\n 'type' => 'INT',\n 'constraint' => 2,\n 'null' => TRUE,\n ),\n\n\n 'Observaciones' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Observaciones_correccion' => array(\n 'type' => 'TEXT',\n 'null' => TRUE,\n ),\n 'Fecha_ult_actualizacion' => array(\n 'type' => 'TIMESTAMP',\n 'null' => TRUE,\n ),\n 'Usuario_creador_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Ult_usuario_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Visible' => array(\n 'type' => 'INT',\n 'constraint' => 1,\n 'null' => TRUE,\n ),\n\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_cursos_examen_alumno');\n\n /// tbl_cursos_alumnos_seguimiento - tabla donde se lleva un seguimiento del alumno en cada curso\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Usuario_seguimiento_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Curso_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Fecha' => array(\n 'type' => 'DATE'\n ),\n 'URL_imagen' => array(\n 'type' => 'VARCHAR',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Descripcion' => array(\n 'type' => 'TEXT',\n 'constraint' => 100,\n ),\n 'Usuario_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Visible' => array(\n 'type' => 'TINYINT',\n 'constraint' => 1,\n 'null' => TRUE,\n ),\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_cursos_alumnos_seguimiento');\n\n /// tbl_mensajes - mensajes entre profesores y alumnos\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Emisor_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Receptor_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Fecha_envio' => array(\n 'type' => 'DATE'\n ),\n 'Fecha_leido' => array(\n 'type' => 'DATE',\n 'null' => TRUE,\n ),\n 'URL_adjunto' => array(\n 'type' => 'varchar',\n 'constraint' => 100,\n 'null' => TRUE,\n ),\n 'Contenido' => array(\n 'type' => 'TEXT',\n 'constraint' => 100,\n ),\n 'Visible' => array(\n 'type' => 'TINYINT',\n 'constraint' => 1,\n 'null' => TRUE,\n ),\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_mensajes');\n\n /// tbl_cursos_seguimiento - mensajes entre profesores y alumnos\n $this->dbforge->add_field(array(\n 'Id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n 'unsigned' => TRUE,\n 'auto_increment' => TRUE\n ),\n 'Curso_seguimiento_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Fecha' => array(\n 'type' => 'DATE'\n ),\n 'Url_archivo' => array(\n 'type' => 'varchar',\n 'null' => TRUE,\n ),\n 'Descripcion' => array(\n 'type' => 'TEXT',\n 'constraint' => 100,\n ),\n 'Usuario_id' => array(\n 'type' => 'INT',\n 'constraint' => 10,\n ),\n 'Visible' => array(\n 'type' => 'TINYINT',\n 'constraint' => 1,\n 'null' => TRUE,\n ),\n ));\n $this->dbforge->add_key('Id', TRUE);\n $this->dbforge->create_table('tbl_cursos_seguimiento');\n }",
"function formulaires_editer_composition_objet_charger($type,$id){\n\t$valeurs = array();\n\t$table_objet_sql = table_objet_sql($type);\n\t$id_table_objet = id_table_objet($type);\n\t$valeurs[$id_table_objet] = intval($id);\n\n\t$row = sql_fetsel('composition,composition_lock',$table_objet_sql,\"$id_table_objet=\".intval($id));\n\tif (!autoriser('styliser',$type,$id,NULL,array('row'=>$row))){\n\t\t$valeurs['editable'] = false;\n\t}\n\telse {\n\n\t\tif ($type=='rubrique'){\n\t\t\t$config_accueil = true;\n\t\t\tif (isset($GLOBALS['meta']['compositions'])){\n\t\t\t\t$config = unserialize($GLOBALS['meta']['compositions']);\n\t\t\t\t$config_accueil = $config['utiliser_article_accueil'] != 'non';\n\t\t\t}\n\t\t\tif ($config_accueil){\n\t\t\t\t$valeurs['id_article_accueil'] = sql_getfetsel('id_article_accueil',$table_objet_sql,\"$id_table_objet=\".intval($id));\n\t\t\t\t$valeurs['id_article_accueil'] = $valeurs['id_article_accueil'] ? $valeurs['id_article_accueil'] : '0';\n\t\t\t}\n\t\t}\n\t\t$valeurs['composition'] = $row['composition'];\n\t\t$valeurs['composition_lock'] = $row['composition_lock'];\n\n\t\t$valeurs['compositions'] = compositions_lister_disponibles($type);\n\t\t$valeurs['compositions'] = reset($valeurs['compositions']); // on ne regarde qu'un seul type\n\t\tif (is_array($valeurs['compositions']) AND !isset($valeurs['compositions'][''])){\n\t\t\t$valeurs['compositions'] = array_merge(\n\t\t\t\tarray(''=>array('nom'=>_T('compositions:label_pas_de_composition'),'description'=>'','icon'=>'','configuration'=>'')),\n\t\t\t\t$valeurs['compositions']\n\t\t\t);\n\t\t}\n\t\t$valeurs['_hidden'] = \"<input type='hidden' name='$id_table_objet' value='$id' />\";\n\n\t\tif (!is_array($valeurs['compositions']) AND !isset($valeurs['id_article_accueil']))\n\t\t\t$valeurs['editable'] = false;\n\t}\n\n\treturn $valeurs;\n}",
"public function up(){\r\n $this->dbforge->add_field(array( //creacion del vector que contiene los campos de la tabla\r\n 'SCHO_PK' => array( //columna SCHO_PK tipo int, tamaño 10, auto icremental, solo positivos\r\n 'type' => 'INT',\r\n 'constraint' => 10,\r\n 'unsigned' => TRUE,\r\n 'auto_increment' => TRUE\r\n ),\r\n 'SCHO_identification' => array( //columna SCHO_PK tipo int, tamaño 10, auto icremental, solo positivos\r\n 'type' => 'INT',\r\n 'constraint' => 10,\r\n 'unsigned' => TRUE,\r\n ),\r\n 'SCHO_name_long' => array( //columna SCHO_username tipo VARCHAR, tamaño 45\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n ),\r\n 'SCHO_name_short' => array( //columna SCHO_username tipo VARCHAR, tamaño 45\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n ),\r\n 'SCHO_initials' => array( //columna SCHO_names tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),\r\n 'SCHO_telephone' => array( //columna SCHO_lastnames tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),'SCHO_facebook' => array( //columna SCHO_lastnames tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),'SCHO_instagram' => array( //columna SCHO_lastnames tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),'SCHO_youtube' => array( //columna SCHO_lastnames tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),\r\n 'SCHO_email' => array( //columna SCHO_email tipo VARCHAR, tamaño 45,no vacio\r\n 'type' => 'VARCHAR',\r\n 'constraint' => '45',\r\n 'null' => TRUE,\r\n ),\r\n 'SCHO_date_create' => array( //columna SCHO_address tipo VARCHAR, tamaño 45\r\n 'type' => 'DATETIME',\r\n ),\r\n 'SCHO_date_update' => array( //columna SCHO_telephone tipo VARCHAR, tamaño 45\r\n 'type' => 'DATETIME',\r\n ),\r\n 'SCHO_PK_create' => array( //columna SCHO_address tipo VARCHAR, tamaño 45\r\n 'type' => 'INT',\r\n ),\r\n 'SCHO_PK_update' => array( //columna SCHO_telephone tipo VARCHAR, tamaño 45\r\n 'type' => 'INT',\r\n ),\r\n 'SCHO_FK_state' => array( //columna SCHO_FK_state tipo int, tamaño 10, solo positivos\r\n 'type' => 'INT',\r\n 'constraint' => 10,\r\n 'unsigned' => TRUE,\r\n ),\r\n ));\r\n $this->dbforge->add_key('SCHO_PK', TRUE); //agregar atributo de llave primaria al campo SCHO_PK \r\n $this->dbforge->create_table('schools'); //creacion de la tabla users con los atributos y columnas\r\n $this->dbforge->add_column('schools',[\r\n 'CONSTRAINT SCHO_FK_state FOREIGN KEY(SCHO_FK_state) REFERENCES states_schools(STSC_PK)',\r\n ]); //creacion de relacion a la tabla genders\r\n }",
"private function tbl_guiones_asignacion() {\r\n\t\t\t$this->guiones_asignacion = $this->esquema->createTable('GUIONES_ASIGNACION');\r\n\t\t\t$this->guiones_asignacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de asignación del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_asignacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la asignacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_asignacion->addColumn('GUION', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del del guion [ID de la tabla de GUIONES]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_asignacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la asignacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_asignacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_asignacion->addForeignKeyConstraint($this->guiones, array('GUION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_asignacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"private function tbl_guiones_prioridades() {\r\n\t\t\t$this->guiones_prioridades = $this->esquema->createTable('GUIONES_PRIORIDADES');\r\n\t\t\t$this->guiones_prioridades->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la prioridad del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_prioridades->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la prioridad'\r\n\t\t\t));\r\n\t\t\t$this->guiones_prioridades->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la prioridad [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_prioridades->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_prioridades->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"public function renetid(){\n\n global $conn;\n\n $request_renet = \"ALTER TABLE langue AUTO_INCREMENT = 1\";\n $request_delete = \"DELETE FROM `langue`\"; \n\n $conn->query($request_delete);\n $conn->query($request_renet);\n\n }",
"public function ajoutPublication($auteurs, $titre_article, $reference_publication, $annee, $categorie, $lieu = null, $statut){\n $publicationInseree = new Publication(null, $auteurs, $titre_article, $reference_publication, $annee, $statut, $categorie, $lieu);\n if($this->verificationPublicationBase($publicationInseree)){\n throw new Exception(\"Publication déja présente\");\n }\n\t\t\t//On insère d'abord la publication dans la table Publication\n $reqInsertion= 'INSERT INTO Publication(id, titre_article, reference_publication, annee, categorie, lieu, statut, date_ajout) VALUES(?, ?, ?, ?, ?, ?, ?, ?)';\n $this->executerRequete($reqInsertion, array(NULL, $titre_article, $reference_publication, $annee, $categorie, $lieu, $statut, date(\"Y-m-d\"))); \n //On récupère l'id de la publication que l'on viens d'inserer\n $reqIdPublication = 'SELECT LAST_INSERT_ID()'; \n $idPublications = $this->executerRequete($reqIdPublication);\n $idPublication = $idPublications->fetch()[0];\n $place = 1;\n\t\t\tforeach($auteurs as $auteur){\n //On verifie que l'auteur n'est pas déja présent dans la BDD\n //Si il ne l'est pas on l'ajoute\n if(!$this->verificationAuteurBase($auteur)){\n $this->ajouterChercheur($auteur);\n //On récupère l'ID de l'auteur que l'on viens d'inserer\n $reqIdAuteur = 'SELECT LAST_INSERT_ID()';\n $idAuteurs = $this->executerRequete($reqIdAuteur);\n $idAuteur = $idAuteurs->fetch()[0];\n }\n //Si il l'est on recupère son id\n else{\n $idAuteur = $this->verificationAuteurBase($auteur);\n }\n //On insère dans la table rédige les couples idAuteur/idPublication\n\t\t $reqInsRedige = 'INSERT INTO redige(Publication_id, Auteur_id, place) VALUES(?, ?, ?)'; \n\t\t\t $this->executerRequete($reqInsRedige, array($idPublication, $idAuteur, $place));\n $place++;\n\t\t\t}\n\t\t}"
] |
[
"0.616233",
"0.604121",
"0.5994878",
"0.58563983",
"0.58187693",
"0.58114564",
"0.5754159",
"0.5753158",
"0.57471275",
"0.5696903",
"0.5655678",
"0.56334394",
"0.56130326",
"0.5608147",
"0.5590468",
"0.5572281",
"0.5547044",
"0.55249095",
"0.5519859",
"0.54876536",
"0.5487081",
"0.54278845",
"0.54105264",
"0.5409768",
"0.5407412",
"0.54052085",
"0.5401502",
"0.5394167",
"0.5391338",
"0.53897053"
] |
0.64532685
|
0
|
Lists all companyStatus entities.
|
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$companyStatuses = $em->getRepository('AppBundle:CompanyStatus')->findBy(array('isDeleted' => false), array('position' => 'ASC'));
return [
'companyStatuses' => $companyStatuses,
];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function allCompanies()\n {\n return Company::all();\n }",
"public function getAllStatus()\n {\n return OrderStatus::all();\n }",
"public function index()\n {\n return Company::all();\n }",
"public function index()\n {\n return Company::all();\n }",
"public function index()\n {\n return AccStatus::all();\n }",
"public function index()\n {\n $data = CallStatus::all();\n\n return $this->showAll($data,CallStatus::class);\n }",
"public function list(Request $request) {\n $section = $this->section;\n $input_all = collect($request->all());\n $filters = $this->parseFilters($input_all);\n\n $companies = $this->model::search( $filters );\n if ( !$companies ) {\n return CDataGrid::getResponse( [], 0, 0 );\n }\n\n $data = [];\n foreach ( $companies['result'] as $i => $company) {\n $checked = $company->status ? ' checked=\"\"' : \"\";\n $data[] = [\n $company->name,\n $company->phone,\n $company->status ? '<div class=\"badge badge-success\">Active</div>' : '<div class=\"badge badge-danger\">Inactive</div>',\n $this->components->groupButton(\n [\n [\n 'title' => 'View',\n 'url' => route($section->slug.'.show', $company->id),\n 'icon' => 'fa fa-eye',\n 'permission' => 'view-company',\n 'attributes' => [\n 'class' => 'btn-success'\n ]\n ],[\n 'title' => 'Edit',\n 'url' => route($section->slug.'.edit', $company->id),\n 'icon' => 'fa fa-pencil',\n 'permission' => 'edit-company',\n 'attributes' => [\n 'class' => 'btn-info'\n ]\n ],[\n 'title' => 'Trash',\n 'url' => route($section->slug.'.destroy', $company->id),\n 'icon' => 'fa fa-trash',\n 'permission' => 'delete-company',\n 'attributes' => [\n 'class' => ' grid-action-archive btn-danger',\n 'data-id' => $company->id,\n 'data-name' => $company->name\n ]\n ],\n ]\n )\n ];\n }\n\n return CDataGrid::getResponse( $data, $companies['total'] );\n }",
"public function getAllActive()\n {\n\n $qb = $this->createQueryBuilder('u')->select('u')\n ->andWhere('u.isDeleted =:is_deleted')\n ->andWhere('u.status =:status')\n ->setParameters(array(\n 'is_deleted' => false,\n 'status' => $this->sm->active()\n ));\n $qb->orderBy('u.company', 'DESC');\n return $qb->getQuery()->getResult();\n }",
"public function getStatusesList(){\n return $this->_get(1);\n }",
"function GetProjectStatuses()\n\t{\n\t\t$result = $this->sendRequest(\"GetProjectStatuses\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function getStatuses() {\n\t}",
"public function index()\n {\n\n $statusRepo = new StatusRepository();\n $out = $statusRepo->getStatusAll();\n return $this->respondWithData($out);\n }",
"static public function Get_All_Status_Triggers($company_id)\n\t{\n\t\t$db = ECash::getMasterDb();\n\t\t\n\t\t$query = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\t\t\t\tSELECT dp.*\n\t\t\t\t\tFROM\n\t\t\t\t\t\tdocument_process AS dp\n\t\t\t\t\tINNER JOIN document_list AS dl ON dp.document_list_id=dl.document_list_id\n\t\t\t\t\tWHERE dl.company_id={$company_id}\n\t\t\t\t\t\";\n\t\t\n\t\t$q_obj = $db->Query($query);\n\n\t\t$retval = array();\n\t\twhile( $row = $q_obj->fetch(PDO::FETCH_OBJ) ) \n\t\t{\n\t\t\tif(!is_array($retval[$row->current_application_status_id]))\n\t\t\t{\n\t\t\t\t$retval[$row->current_application_status_id] = array();\n\t\t\t\t$retval[$row->current_application_status_id][$row->application_status_id] = array();\n\t\t\t} elseif(!is_array($retval[$row->current_application_status_id][$row->application_status_id])) {\n\t\t\t\t$retval[$row->current_application_status_id][$row->application_status_id] = array();\n\t\t\t}\n\t\t\t$retval[$row->current_application_status_id][$row->application_status_id][$row->document_list_id] = true;\n\t\t}\n\t\treturn $retval;\n\t}",
"public function index()\n {\n $company = $this->repository->all();\n return $company;\n }",
"public static function allStatuses()\n {\n $statuses = ProductOrderStatus::all();\n return $statuses;\n }",
"public function companylist() {\r\n $companies = $this->model->getCompanies();\r\n return $this->view('company/companylist', $companies);\r\n }",
"static public function Get_All_Status_Triggers($company_id)\n\t{\n\t\t$db = ECash_Config::getMasterDbConnection();\n\t\t\n\t\t$query = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\t\t\t\tSELECT dp.*\n\t\t\t\t\tFROM\n\t\t\t\t\t\tdocument_process AS dp\n\t\t\t\t\tINNER JOIN document_list AS dl ON dp.document_list_id=dl.document_list_id\n\t\t\t\t\tWHERE dl.company_id={$company_id}\n\t\t\t\t\t\";\n\t\t\n\t\t$q_obj = $db->Query($query);\n\n\t\t$retval = array();\n\t\twhile( $row = $q_obj->fetch(PDO::FETCH_OBJ) ) \n\t\t{\n\t\t\tif(!is_array($retval[$row->current_application_status_id]))\n\t\t\t{\n\t\t\t\t$retval[$row->current_application_status_id] = array();\n\t\t\t\t$retval[$row->current_application_status_id][$row->application_status_id] = array();\n\t\t\t} elseif(!is_array($retval[$row->current_application_status_id][$row->application_status_id])) {\n\t\t\t\t$retval[$row->current_application_status_id][$row->application_status_id] = array();\n\t\t\t}\n\t\t\t$retval[$row->current_application_status_id][$row->application_status_id][$row->document_list_id] = true;\n\t\t}\n\t\treturn $retval;\n\t}",
"public static function all()\n {\n $sql = new Sql();\n\n $results = $sql->select(\"SELECT * FROM tbl_status\");\n\n return $results;\n }",
"public function getStatuses()\n {\n $endpoint = $this->endpoints['getStatuses'];\n return $this->sendRequest($endpoint['method'], $endpoint['uri']);\n }",
"public function indexCompany()\n {\n return TimelineResource::collection(\n $this->user->company->timeline()\n ->with(['pictures', 'videos', 'geo', 'links'])\n ->paginate(request()->get('per_page') ?? 15)->appends(request()->all())\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SiteSavalizeBundle:Company')->findAll();\n\n return $this->render('SiteSavalizeBundle:Company:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function companies(): Collection\n {\n return Company::all();\n }",
"public function getStates() {\n return $this->createQuery()\n ->select(\"DISTINCT c.state\")\n ->from(\"Companies_Model_Company c\")\n ->whereIn(\"c.status\", Companies_Model_Company::getActiveStatuses())\n ->andWhere(\"c.local_business\")\n ->orderBy(\"c.state ASC\")\n ->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n }",
"public function index()\n {\n $this->authorize('viewAny', Status::class);\n return Status::all();\n }",
"public function actionIndex()\n {\n $searchModel = new CompanySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new CompanySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function list() {\n \n $companies = Companies::all();\n $companies->load('hasUserCompany'); \n // return response()->json($companies);\n\n return response()->json(['companies' => $companies]);\n }",
"public function getAllStatus()\n {\n $sql = \"SELECT s.id, s.status_name , s.color FROM status AS s ORDER BY s.id ASC\";\n $query = $this->db->prepare($sql);\n $query->execute();\n\n // fetchAll() is the PDO method that gets all result rows, here in object-style because we defined this in\n // core/controller.php! If you prefer to get an associative array as the result, then do\n // $query->fetchAll(PDO::FETCH_ASSOC); or change core/controller.php's PDO options to\n // $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC ...\n return $query->fetchAll();\n }",
"public static function getStatuses()\n {\n $sql = 'SELECT * FROM location_status';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }",
"public function getCertStatuses() {\n $dql = \"SELECT c from CertificationStatus c\";\n $certStatuses = $this->em\n ->createQuery($dql)\n ->getResult();\n return $certStatuses;\n }"
] |
[
"0.6046334",
"0.602086",
"0.59819096",
"0.59819096",
"0.5886414",
"0.5830753",
"0.5820058",
"0.5808514",
"0.57897437",
"0.57866114",
"0.5768027",
"0.5757444",
"0.5732084",
"0.5723859",
"0.5718735",
"0.5717709",
"0.5703822",
"0.5703575",
"0.5662385",
"0.5660657",
"0.56270605",
"0.5613873",
"0.5612617",
"0.56110907",
"0.5598227",
"0.5598227",
"0.5598005",
"0.55603385",
"0.55580306",
"0.5538484"
] |
0.7256766
|
0
|
Get progress of import task
|
public function progressTask()
{
// get request vars
$id = Request::getInt('id', 0);
// create import model object
$import = Import::oneOrFail($id);
// get the lastest run
$run = $import->runs()
->whereEquals('import_id', $import->get('id'))
->ordered()
->row();
// build array of data to return
$data = array(
'processed' => $run->get('processed', 0),
'total' => $run->get('count', 0)
);
// return progress update
echo json_encode($data);
exit();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getProgress();",
"function getProgress() ;",
"public function getProgress()\n {\n return $this->get(self::_PROGRESS);\n }",
"public function getProgress()\n {\n return $this->get(self::_PROGRESS);\n }",
"public function getProgress()\n {\n return $this->progress;\n }",
"protected function getProgressHelper() {}",
"public function getProgress()\n\t{\n\t\treturn 0;\n\t}",
"public function progress(): int\n {\n return $this->pluck('progress');\n }",
"function getThumbProgress()\n {\n // release the locks, session not needed\n $session = \\cmsSession::getInstance();\n $session->releaseLocks();\n session_write_close();\n \n $key = isset($_GET['key']) ? $_GET['key'] : '';\n $processFile = $session->getTempPath() .'/progress' . $key . '.txt';\n \n $process = 0;\n if (file_exists($processFile)) {\n $process = file_get_contents($processFile);\n if ($process == 100) {\n \\Cx\\Lib\\FileSystem\\FileSystem::delete_file($processFile);\n }\n }\n \n echo $process;\n die;\n }",
"public function processImport(array $options = array()) {\n if ($this->enabled) {\n $return = MigrationBase::RESULT_COMPLETED;\n if (method_exists($this, 'import')) {\n $this->options = $options;\n if (!isset($options['force'])) {\n if (!$this->dependenciesComplete()) {\n return MigrationBase::RESULT_SKIPPED;\n }\n }\n $this->beginProcess(MigrationBase::STATUS_IMPORTING);\n try {\n $return = $this->import();\n }\n catch (Exception $exception) {\n // If something bad happened, make sure we clear the semaphore\n $this->endProcess();\n throw $exception;\n }\n\n if ($return == MigrationBase::RESULT_COMPLETED && isset($this->total_successes)) {\n $overallThroughput = round(60*$this->total_successes / (microtime(TRUE) - $this->starttime));\n }\n else {\n $overallThroughput = 0;\n }\n $this->endProcess($overallThroughput);\n }\n }\n else {\n $return = MigrationBase::RESULT_DISABLED;\n }\n return $return;\n }",
"public function getStageProgress()\n {\n return $this->get(self::_STAGE_PROGRESS);\n }",
"public function progressAction()\n {\n if (!$this->getRequest()->isXmlHttpRequest()) {\n throw new Zend_Controller_Request_Exception('Not an AJAX request detected');\n }\n\n $uploadId = $this->getRequest()->getParam('id');\n\n // this is the function that actually reads the status of uploading\n $data = uploadprogress_get_info($uploadId);\n\n $bytesTotal = $bytesUploaded = 0;\n\n if (null !== $data) {\n $bytesTotal = $data['bytes_total'];\n $bytesUploaded = $data['bytes_uploaded'];\n }\n\n $adapter = new Zend_ProgressBar_Adapter_JsPull();\n $progressBar = new Zend_ProgressBar($adapter, 0, $bytesTotal, 'uploadProgress');\n\n if ($bytesTotal === $bytesUploaded) {\n $progressBar->finish();\n } else {\n $progressBar->update($bytesUploaded);\n }\n }",
"public function getEncoderServiceJobProgress()\n {\n return $this->encoderServiceJobProgress;\n }",
"public function getProgressOk(): int\n {\n return $this->progress_ok;\n }",
"public function progressFinish() {}",
"public function getItemProgress() : int\n {\n return $this->itemProgress;\n }",
"public function getProgressWait(): int\n {\n return $this->progress_wait;\n }",
"public function getImportCount();",
"public function incrementImportCount();",
"function show_migrate_multisite_files_progress( $current, $total ) {\n echo \"<span style='position: absolute;z-index:$current;background:#F1F1F1;'>Parsing Blog \" . $current . ' - ' . round($current / $total * 100) . \"% Complete</span>\";\n echo(str_repeat(' ', 256));\n if (@ob_get_contents()) {\n @ob_end_flush();\n }\n flush();\n}",
"public function getProgressError(): int\n {\n return $this->progress_error;\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}",
"function durp_import_batch_run(&$context) {\n $queue = DrupalQueue::get('durp');\n\n if (empty($context['sandbox'])) {\n $context['sandbox']['done'] = 0;\n $context['sandbox']['max'] = $queue->numberOfItems();\n }\n\n if ($item = $queue->claimItem()) {\n _durp_map_node($item->data->id, $item->data->xml);\n $queue->deleteItem($item);\n ++$context['sandbox']['done'];\n }\n else {\n $context['sandbox']['max'] = $context['sandbox']['done'];\n }\n\n $context['message'] = t('Imported @count items.', array(\n '@count' => $context['sandbox']['done'],\n ));\n $context['finished'] = $context['sandbox']['done'] >= $context['sandbox']['max'];\n if ($context['finished']) {\n $context['results']['count'] = $context['sandbox']['done'];\n }\n}",
"public function getInProgressCount()\n {\n return $this->in_progress_count;\n }",
"public function getStepProgression()\n {\n return $this->stepProgression;\n }",
"public function getFileUploadInProgressCount() : int\n {\n return $this->fileUploadInProgressCount;\n }",
"protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }",
"public static function import_process() {}",
"public function execute()\n {\n return $this->resultJsonFactory->create()->setData([\n 'status' => $this->backgroundProcessHelper->setCount($this->config->getTotalCustomersForImport())\n ->setCurrent($this->config->getImportProgress())\n ->getCurrentState(),\n ]);\n }",
"private function loadProgress() {\n // Check if progress is stores\n if (!file_exists($this->storeagePath . '/progress.json')) {\n // Not saved, start from scratch\n $chapter = 0;\n $section = 0;\n }\n else {\n // Might be saved, fetch data and try to parse\n $progress = array();\n $progress_json = json_decode(file_get_contents($this->storeagePath . '/progress.json'), true);\n\n // Check chapter\n if (isset($progress_json['chapter'])) {\n $chapter = $progress_json['chapter'];\n }\n else {\n $chapter = 0;\n }\n\n // Check section\n if (isset($progress_json['section'])) {\n $section = $progress_json['section'];\n }\n else {\n $section = 0;\n }\n }\n\n $this->saveProgress($chapter, $section);\n }"
] |
[
"0.7428593",
"0.7320271",
"0.6813871",
"0.6813871",
"0.68020236",
"0.67280924",
"0.6553368",
"0.64204407",
"0.6233722",
"0.62271875",
"0.6144829",
"0.61418486",
"0.6121049",
"0.61103344",
"0.60945976",
"0.60802996",
"0.60671324",
"0.60437804",
"0.6029934",
"0.60026014",
"0.583792",
"0.5823772",
"0.58076626",
"0.57806116",
"0.5736806",
"0.57332844",
"0.5680064",
"0.5679394",
"0.5679044",
"0.5675934"
] |
0.7790269
|
0
|
Method to create import filespace if needed
|
private function _createImportFilespace(\Hubzero\Content\Import\Model\Import $import)
{
// Upload path
$uploadPath = $import->fileSpacePath();
// If we dont have a filespace, create it
if (!is_dir($uploadPath))
{
if (!Filesystem::makeDirectory($uploadPath))
{
$this->setError(Lang::txt('Failed to create target upload path "%s".', $uploadPath));
return false;
}
}
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function prepareImport();",
"protected function initializeImport() {}",
"private function auto_create(){\n\n if ( $this->firebug ) \\FB::info(get_called_class().\": auto creating file\");\n\n $root = $this->use_codeza_root ? (string)new Code_Alchemy_Root_Path() : '';\n\n $filename = $root . $this->template_file;\n\n if ( file_exists($filename) && ! file_exists($this->file_path)) {\n\n $copier = new Smart_File_Copier($filename,$this->file_path,$this->string_replacements,false);\n\n $copier->copy();\n\n }\n\n\n\n }",
"public function import();",
"public function import()\n {\n \n }",
"public function import(): void;",
"protected function createFile() {}",
"protected abstract function importCreate($entity);",
"public function createBaseFilesAndFolders()\n {\n $this\n ->createRootFolder()\n ->createRelsFolderAndFile()\n ->createDocPropsFolderAndFiles()\n ->createXlFolderAndSubFolders();\n }",
"public static function import_process() {}",
"public function prepareImportContent();",
"protected function initializeFileStorages() {}",
"function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}",
"function bfImport() {\n\t\t$this->__construct();\n\t}",
"function importSchema(){\n\t\t\t$this->exportsSchema = false;\n\t\t}",
"function importFile()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',NOTSET,'any');\t\t\n\n\t\tfor( $i = 0 ; $i < $_SESSION['import']['count'] ; $i++ )\n\t\t\t$args->set( 'f'.$i, NOTSET, 'any');\n\n\t\t$args = $args->get(func_get_args());\t\n\r\n\t\t$this->load_specific_xsl();\r\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \r\n\r\n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display \n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) )\r\n {\r\n\t\t\t$args['key'] = 'Error';\r\n $error = ERROR_PERMISSION_WRITE_DENIED;\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Error':\r\n\t\t\t\tmessagebox( $error, ERROR);\r\n\t\t\t\t$result['action']['import'] = 'importFile';\r\n\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\r\n\t\t\tcase 'importFile':\r\n\n\t\t\t\t// we create a temporay table to host the records\n\t\t\t\t/*\n\t\t\t\tif ( ($tmpTable = $this->createTMP()) == NULL )\n\t\t\t\t{\n\t messagebox( 'Can\\'t import these datas', ERROR);\t\n\t\t\t\t\treturn $this->upload();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\r\n \t\t\t\t$fp = fopen( $_SESSION['import']['tmp_name'], \"r\"); //open the file\n \t\t\t\t$filesize = filesize( $_SESSION['import']['tmp_name']);\n \t\t\t\t\n \t\t\t\tif( $_SESSION['import']['header'] == 1 )\t// there is a header\n \t\t\t\t{\n\t \t\t\t\t$header = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"'); \n\t\t\t\t}\n\n\t\t\t\t$this->error = array();\n\t\t\t\t\n\t\t\t\t$row=1;\n\t\t\t\twhile ( ($record = fgetcsv( $fp, $filesize, $_SESSION['import']['format_id'],'\"')) !== FALSE && $row < IMPORT_MAX_LINES) \n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$converted = array();\n\t\t\t\t\tforeach($record as $key => $value)\n\t\t\t\t\t\t$converted[$args['f'.$key]] = sanitize($value, 'string'); \t\t\t\t\t\t\n\t\t\t\t\n\t //$this->insertRecord( $tmpTable, $converted, $row);\t\t\t\n\t\t\t\t\t$this->importSpecific( $tmpTable, $converted);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$row++;\t \t\t\n\t\t\t\t}\t\n\t\t\t\t\t\t\t\n\t\t\t\tfclose($fp);\n\t\t\t\tunlink( $_SESSION['import']['tmp_name']);\n\n\t\t\t\t//now we do application specific import process\n\t\t\t\t//$result['import']['specific'] = $this->importSpecific( $tmpTable);\n\t\t\t\t\n\t\t\t\t$result['import']['rows'] = $row-1; \t\t\r\n\t\t\t\t$result['import']['specific'] = $this->specific;\t\t\t\t\t\t\t\t\r\n\t\t\t\t$result['action']['import'] = 'importFile';\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\n return $result;\r\n }",
"function upload()\r\n {\r\n\t\t$args = new safe_args();\r\n\t\t$args->set('key',\t\t\tNOTSET,'any');\r\n\t\t$args->set('format_id', \tNOTSET,'any');\t\t\n\t\t$args->set('filename', \t\tNOTSET,'any');\t\t\r\n\t\t$args->set('userfile', \t\tNOTSET,'any');\t// must be the same declares in $_Files['userfile']\t\n\t\t$args->set('header', \t\t0,'any');\t\n\t\t$args->set('duplicate', \tNOTSET,'any');\n\t\t$args->set('related', \t\tNOTSET,'any');\t\t\t\t\t\t\t\r\n\t\t$args = $args->get(func_get_args());\r\n\n $GLOBALS['appshore']->add_xsl('lib.import');\r\n $GLOBALS['appshore']->add_xsl('lib.base'); \n \n // set up the different files format supported\n\t\t$fileFormat = array(\r\n\t array ( 'format_id' => ',', \t\t'format_name' => lang('Generic CSV file with comma delimiter')),\r\n\t array ( 'format_id' => ';', \t\t'format_name' => lang('Generic CSV file with semicolon delimiter')),\r\n\t array ( 'format_id' => ' ', \t\t'format_name' => lang('Generic CSV file with space delimiter')),\r\n\t array ( 'format_id' => chr(9), \t\t'format_name' => lang('Generic CSV file with tab delimiter')),\n\t //array ( 'format_id' => 'xls2002', 'format_name' => lang('MS Excel 2002 file (.xls)')),\t \n\t //array ( 'format_id' => 'access', \t'format_name' => lang('MS Access 2002 file')),\t \t \n\t //array ( 'format_id' => 'xml', \t'format_name' => lang('XML file'))\t \r\n\t ); \n\t \n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display\r\n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) || !$GLOBALS['appshore']->rbac->checkPermissionOnFeature($this->appRole, 'import'))\r\n {\r\n\t\t\tmessagebox( ERROR_PERMISSION_DENIED, ERROR);\r\n\t\t\treturn execMethod( $this->appName.'.base.start', null, true);\r\n }\r\n\r\n \t\tswitch($args['key'])\r\n\t\t{\r\n\t\t\tcase 'Next':\r\n\t\t\t\r\n\t\t\t\tif ( $args['header'] != 1)\r\n\t\t\t\t\t$args['header'] = 0;\n\t\t\t\tif ( $args['duplicate'] != 1)\r\n\t\t\t\t\t$args['duplicate'] = 0;\t\t\n\t\t\t\tif ( $args['related'] != 1)\r\n\t\t\t\t\t$args['related'] = 0;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t// test if upload gone well\r\n\t\t\t\tif (is_uploaded_file( $_FILES['userfile']['tmp_name']))\n\t\t\t\t{ \n\t\t\t\t\tmove_uploaded_file( $_FILES['userfile']['tmp_name'], $_FILES['userfile']['tmp_name'].'.imp');\n\t\t\t\t\t$args['tmp_name'] = $_FILES['userfile']['tmp_name'].'.imp';\n\t\t\t\t\t$_SESSION['import']['format_id'] = $args['format_id'] ;\n\t\t\t\t\t$_SESSION['import']['filename'] = $args['filename'];\t\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['userfile'] = $_FILES['userfile']['name'];\t\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['tmp_name'] = $_FILES['userfile']['tmp_name'].'.imp';\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['header'] = $args['header'];\n\t\t\t\t\t\n\t\t\t\t\tif( $this->isDuplicate )\t\t\n\t\t\t\t\t\t$_SESSION['import']['duplicate'] = $args['duplicate'];\t\n\t\t\t\t\telse\n\t\t\t\t\t\tunset($_SESSION['import']['duplicate']);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tif( $this->isRelated )\t\t\n\t\t\t\t\t\t$_SESSION['import']['related'] = $args['related'];\t\n\t\t\t\t\telse\n\t\t\t\t\t\tunset($_SESSION['import']['related']);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tunset( $args['key']);\t\t\t\t\t\t\n\t\t\t\t\t$result = $this->selectFields( $args);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t messagebox( ERROR_INVALID_DATA, ERROR);\t\n\t $result['error']['userfile'] = ERROR_MANDATORY_FIELD;\t\t\t\t\n\t\t\t\t\t$result['action']['import'] = 'upload';\n\t\t\t\t\t$result['format'] = $fileFormat;\t\n\t\t\t\t}\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\r\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\r\n\t\t\t\t$result['action']['import'] = 'upload';\n\t\t\t\t$result['format'] = $fileFormat;\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\n\t\t\t\t$result['import']['isDuplicate'] = $this->isDuplicate;\t\n\t\t\t\t$result['import']['isRelated'] = $this->isRelated;\t\t\t\t\t\t\n\t\t\t\tbreak;\r\n\t\t}\n\t\t\r\r\n return $result;\r\n }",
"protected function initStorageObjects() {}",
"protected function initStorageObjects() {}",
"protected function initStorageObjects() {}",
"private function packFiles()\n {\n // load core\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../core/components/' . self::PKG_NAME,\n 'target' => \"return MODX_CORE_PATH . 'components/';\"\n ]\n ]));\n\n // load assets\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../assets/components/' . self::PKG_NAME,\n 'target' => \"return MODX_ASSETS_PATH . 'components/';\"\n ]\n ]));\n }",
"function _fillFiles()\n\t{\n\t\t// directory from which we import (real path)\n\t\t$importDirectory = ereg_replace(\n\t\t\t\t\"^(.*)/$\", \n\t\t\t\t'\\1', \n\t\t\t\tereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . $this->from);\n\t\t\n\t\t// when running on windows we have to change slashes to backslashes\n\t\tif (runAtWin()) {\n\t\t\t$importDirectory = str_replace(\"/\", \"\\\\\", $importDirectory);\n\t\t}\n\t\t$this->_files = array();\n\t\t$this->_depth = 0;\n\t\t$this->_postProcess = array();\n\t\t$this->_fillDirectories($importDirectory);\n\t\t// sort it so that webEdition files are at the end (that templates know about css and js files)\n\t\t\n\n\t\t$tmp = array();\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"folder\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] != \"folder\" && $e[\"contentType\"] != \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_files = $tmp;\n\t\t\n\t\tforeach ($this->_postProcess as $e) {\n\t\t\tarray_push($this->_files, $e);\n\t\t}\n\t}",
"public function newImportProcesses()\n {\n \n }",
"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 }",
"public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}",
"public function createStorage();",
"protected function importDatabaseData() {}",
"protected function getFileFactory() {}",
"function _fillDirectories($importDirectory)\n\t{\n\t\t\n\t\t@set_time_limit(60);\n\t\t\n\t\t$weDirectory = ereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . \"/webEdition\";\n\t\tif ($importDirectory == $weDirectory) { // we do not import stuff from the webEdition home dir\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// go throuh all files of the directory\n\t\t$d = dir($importDirectory);\n\t\twhile (false !== ($entry = $d->read())) {\n\t\t\tif ($entry == '.' || $entry == '..' || ((strlen($entry) >= 2) && substr($entry, 0, 2) == \"._\"))\n\t\t\t\tcontinue;\n\t\t\t\t// now we have to check if the file should be imported\n\t\t\t$PathOfEntry = $importDirectory . $this->_slash . $entry;\n\t\t\tif (!is_dir($PathOfEntry) && ($this->maxSize && (filesize($PathOfEntry) > (abs($this->maxSize) * 1024 * 1024))))\n\t\t\t\tcontinue;\n\t\t\t$contentType = getContentTypeFromFile($PathOfEntry);\n\t\t\t$importIt = false;\n\t\t\t\n\t\t\tswitch ($contentType) {\n\t\t\t\tcase \"image/*\" :\n\t\t\t\t\tif ($this->images) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/html\" :\n\t\t\t\t\tif ($this->htmlPages) {\n\t\t\t\t\t\tif ($this->createWePages) {\n\t\t\t\t\t\t\t$contentType = \"text/webedition\";\n\t\t\t\t\t\t\t// webEdition files needs to be post processed (external links => internal links)\n\t\t\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t\t\t$this->_postProcess, \n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\t\t\t\"contentType\" => \"post/process\", \n\t\t\t\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\t\t\t\"destDirID\" => $this->to\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"application/x-shockwave-flash\" :\n\t\t\t\t\tif ($this->flashmovies) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"video/quicktime\" :\n\t\t\t\t\tif ($this->quicktime) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/js\" :\n\t\t\t\t\tif ($this->js) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/plain\" :\n\t\t\t\t\tif ($this->text) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/css\" :\n\t\t\t\t\tif ($this->css) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"folder\" :\n\t\t\t\t\t$importIt = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tif ($this->other) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif ($importIt) {\n\t\t\t\tarray_push(\n\t\t\t\t\t\t$this->_files, \n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\"contentType\" => $contentType, \n\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\"destDirID\" => $this->to, \n\t\t\t\t\t\t\t\t\"sameName\" => $this->sameName, \n\t\t\t\t\t\t\t\t\"thumbs\" => $this->thumbs, \n\t\t\t\t\t\t\t\t\"width\" => $this->width, \n\t\t\t\t\t\t\t\t\"height\" => $this->height, \n\t\t\t\t\t\t\t\t\"widthSelect\" => $this->widthSelect, \n\t\t\t\t\t\t\t\t\"heightSelect\" => $this->heightSelect, \n\t\t\t\t\t\t\t\t\"keepRatio\" => $this->keepRatio, \n\t\t\t\t\t\t\t\t\"quality\" => $this->quality, \n\t\t\t\t\t\t\t\t\"degrees\" => $this->degrees, \n\t\t\t\t\t\t\t\t\"importMetadata\" => $this->importMetadata\n\t\t\t\t\t\t));\n\t\t\t}\n\t\t\tif ($contentType == \"folder\") {\n\t\t\t\tif (($this->depth == -1) || (abs($this->depth) > $this->_depth)) {\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t$this->_files, \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\t\"contentType\" => $contentType, \n\t\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\t\"destDirID\" => $this->to, \n\t\t\t\t\t\t\t\t\t\"sameName\" => $this->sameName, \n\t\t\t\t\t\t\t\t\t\"thumbs\" => \"\", \n\t\t\t\t\t\t\t\t\t\"width\" => \"\", \n\t\t\t\t\t\t\t\t\t\"height\" => \"\", \n\t\t\t\t\t\t\t\t\t\"widthSelect\" => \"\", \n\t\t\t\t\t\t\t\t\t\"heightSelect\" => \"\", \n\t\t\t\t\t\t\t\t\t\"keepRatio\" => \"\", \n\t\t\t\t\t\t\t\t\t\"quality\" => \"\", \n\t\t\t\t\t\t\t\t\t\"degrees\" => \"\", \n\t\t\t\t\t\t\t\t\t\"importMetadata\" => 0\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$this->_depth++;\n\t\t\t\t\t$this->_fillDirectories($PathOfEntry);\n\t\t\t\t\t$this->_depth--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t}",
"public function create_from_file($file);"
] |
[
"0.638357",
"0.60275",
"0.5998203",
"0.5988178",
"0.5783736",
"0.57520336",
"0.57081413",
"0.56964654",
"0.5695874",
"0.5673395",
"0.5663597",
"0.56164265",
"0.55917555",
"0.553662",
"0.5472598",
"0.5467497",
"0.54354465",
"0.5394031",
"0.5393692",
"0.5393692",
"0.5384158",
"0.5371937",
"0.53718656",
"0.53573227",
"0.5354819",
"0.5348497",
"0.5328694",
"0.53097576",
"0.5265203",
"0.52578044"
] |
0.62370735
|
1
|
Quote a value for a CSV file
|
public static function quoteCsv($val)
{
if (!isset($val))
{
return '';
}
if (strpos($val, "\n") !== false || strpos($val, ',') !== false)
{
return '"' . str_replace(array('\\', '"'), array('\\\\', '""'), $val) . '"';
}
return $val;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function quote($value) {\n\t\treturn $this -> getAdapter() -> quote($value);\n\t}",
"function add_quote($value) {\n\t\treturn '\"' . addslashes($value) . '\"';\n\t}",
"function _replaceQuoteCSV($string){\r\n //also remove newlines\r\n $string = preg_replace('/\\s+/', ' ', trim($string));\r\n return '\"'.str_replace('\"', \"'\", $string).'\"';\r\n }",
"public function quoteCsvRow($vals)\n\t{\n\t\treturn implode(',', array_map(array($this, 'quoteCsv'), $vals)) . \"\\n\";\n\t}",
"static function quote($value)\n\t{\n\t\treturn \"'\" . str_replace(\"'\", \"\\\\'\", $value) . \"'\";\n\t}",
"protected function _quote($value) {\n if (is_int($value)) {\n return $value;\n } elseif (is_float($value)) {\n return sprintf('%F', $value);\n }\n return \"'\" . addcslashes($value, \"\\000\\n\\r\\\\'\\\"\\032\") . \"'\";\n }",
"public function quote($value) {\n $connection = $this -> connect();\n return \"'\" . $connection -> real_escape_string($value) . \"'\";\n }",
"function getcsv_custom2(&$value,$key){\n $value = str_getcsv($value,\".\",\"'\");\n}",
"static protected function _quote($value)\n {\n if (is_int($value)) {\n return $value;\n } elseif (is_float($value)) {\n return sprintf('%F', $value);\n }\n return \"'\" . addcslashes($value, \"\\000\\n\\r\\\\'\\\"\\032\") . \"'\";\n }",
"public function quote($value) {\n\t\t$connection = $this -> connect();\n\t\treturn \"'\" . $connection -> real_escape_string($value) . \"'\";\n\t}",
"public function quote($value)\n\t{\n\t\treturn $this->c->quote($value);\n\t}",
"private function quoted(string $value): string\n {\n return sprintf('\\'%s\\'', $value);\n }",
"function csv_encode( $list )\n {\n $string = null;\n if( $fp = fopen(\"php://temp\", \"r+\") )\n {\n fputscv($fp, $list, $delimiter = ',', $enclosure = '\"');\n rewind($fp);\n $string = retrim(fgets($fp), \"\\n\");\n fclose($fp);\n }\n \n return $string;\n }",
"public function quote($value) {\n $connection = $this->connect();\n return \"'\" . $connection->real_escape_string($value) . \"'\";\n }",
"public function getCsvString() {\n return $this->data;\n }",
"function echocsv($fields)\r\n{\r\n $separator = '';\r\n foreach ($fields as $field) {\r\n if (preg_match('/\\\\r|\\\\n|,|\"/', $field)) {\r\n $field = '\"' . str_replace('\"', '\"\"', $field) . '\"';\r\n }\r\n echo $separator . $field;\r\n $separator = ',';\r\n }\r\n echo \"\\r\\n\";\r\n}",
"public function pdoQuoteValue($value)\n\t{\n\t\t$pdo = $this->getPdo();\n\t\treturn $pdo->quote($value);\n\t}",
"private function fputcsvCustom($filePointer,$dataArray,$delimiter=\";\",$enclosure=\"\\\"\")\n {\n $string = \"\";\n\n // for each array element, which represents a line in the csv file...\n foreach($dataArray as $trsKey => $trsValue) {\n\n $elems = array($trsKey, $trsValue);\n // No leading delimiter\n $writeDelimiter = FALSE;\n\n foreach($elems as $dataElement){\n // Replaces a double quote with two double quotes\n $dataElement=str_replace(\"\\\"\", \"\\\"\\\"\", $dataElement);\n\n // Adds a delimiter before each field (except the first)\n if($writeDelimiter) $string .= $delimiter;\n\n // Encloses each field with $enclosure and adds it to the string\n $string .= $enclosure . $dataElement . $enclosure;\n\n // Delimiters are used every time except the first.\n $writeDelimiter = TRUE;\n }\n // Append new line\n $string .= \"\\n\";\n\n } // end foreach($dataArray as $line)\n\n // Write the string to the file\n fwrite($filePointer,$string);\n }",
"public function toCSV();",
"function savefile($fname, $val){\n$fp = fopen($fname, 'a');\nfputcsv($fp, $val);\nfclose($fp);\n}",
"abstract public function quoteString($value);",
"static function asStringCSV($input) {\n\t\treturn Re::stringCSV($input);\n\t}",
"private function sputcsv($row, $delimiter = ',', $enclosure = '\"', $eol = \"\\n\")\n {\n static $fp = false;\n if ($fp === false)\n {\n $fp = fopen('php://temp', 'r+'); // see http://php.net/manual/en/wrappers.php.php - yes there are 2 '.php's on the end.\n // NB: anything you read/write to/from 'php://temp' is specific to this filehandle\n }\n else\n {\n rewind($fp);\n }\n \n if (fputcsv($fp, $row, $delimiter, $enclosure) === false)\n {\n return false;\n }\n \n rewind($fp);\n $csv = fgets($fp);\n \n if ($eol != PHP_EOL)\n {\n $csv = substr($csv, 0, (0 - strlen(PHP_EOL))) . $eol;\n }\n \n return $csv;\n }",
"public static function quote($value) {\n $connection = self::getConnection();\n return $connection -> quote($value);\n }",
"protected function quoteValue($value)\n {\n if (is_numeric($value)) {\n return $value;\n }\n\n if ('\"' !== substr($value, 0, 1)) {\n $value = '\"'.$value;\n }\n\n if ('\"' !== substr($value, -1, 1)) {\n $value .= '\"';\n }\n\n return $value;\n }",
"public function quote($value, string $column = ''): string {\n if ($value instanceof Literal) {\n /* @var Literal $value */\n return $value->getValue($this, $column);\n } else {\n return $this->getPDO()->quote($value);\n }\n }",
"public function quote($value){\n $connection = $this -> connect();\n return pg_escape_literal($value);\n }",
"function WriteCSVFile($csv_file,$vars)\n{\n global $SPECIAL_FIELDS,$SPECIAL_VALUES;\n\n\t\t//\n\t\t// create an array of column values in the order specified\n\t\t// in $SPECIAL_VALUES[\"csvcolumns\"]\n\t\t//\n\t$column_list = $SPECIAL_VALUES[\"csvcolumns\"];\n\tif (!isset($column_list) || empty($column_list) || !is_string($column_list))\n\t\treturn;\n\tif (!isset($csv_file) || empty($csv_file) || !is_string($csv_file))\n\t\treturn;\n\n@\t$fp = fopen($csv_file,\"a\");\n\tif (!$fp)\n\t\treturn;\n\n\t$column_list = explode(\",\",$column_list);\n\t$n_columns = count($column_list);\n\n\tif (filesize($csv_file) == 0)\n\t{\n\t\tfor ($ii = 0 ; $ii < $n_columns ; $ii++)\n\t\t{\n\t\t\tfwrite($fp,\"\\\"\".$column_list[$ii].\"\\\"\");\n\t\t\tif ($ii < $n_columns-1)\n\t\t\t\tfwrite($fp,\",\");\n\t\t}\n\t\tfwrite($fp,\"\\n\");\n\t}\n\n//\t$debug = \"\";\n//\t$debug .= \"gpc -> \".get_magic_quotes_gpc().\"\\n\";\n//\t$debug .= \"runtime -> \".get_magic_quotes_runtime().\"\\n\";\n\tfor ($ii = 0 ; $ii < $n_columns ; $ii++)\n\t{\n\t\t$value = $vars[$column_list[$ii]];\n if (is_string($value))\n //\n // truncate the string\n //\n \t$value = substr($value,0,MAXSTRING);\n\t\t$value = trim($value);\n\t\tif (LIMITED_IMPORT)\n\t\t{\n\t\t\t\t//\n\t\t\t\t// the target database doesn't understand escapes, so\n\t\t\t\t// remove slashes, and double quotes, and newlines\n\t\t\t\t//\n\t\t\t$value = Strip($value);\n\t\t}\n//\t\t$debug .= $column_list[$ii].\" => \".$value.\"\\n\";\n\t\tfwrite($fp,\"\\\"\".$value.\"\\\"\");\n\t\tif ($ii < $n_columns-1)\n\t\t\tfwrite($fp,\",\");\n\t}\n\tfwrite($fp,\"\\n\");\n\tfclose($fp);\n//\tCreatePage($debug);\n//\texit;\n}",
"private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }",
"function getcsv_custom(&$value,$key){\n $value = str_getcsv($value,\".\");\n}"
] |
[
"0.65913194",
"0.65911204",
"0.65660006",
"0.65521395",
"0.64287883",
"0.64205986",
"0.634259",
"0.6319609",
"0.63183737",
"0.6271651",
"0.6268322",
"0.6262306",
"0.6219461",
"0.6163626",
"0.6152123",
"0.6122823",
"0.6098834",
"0.60671437",
"0.6004545",
"0.6002873",
"0.59988075",
"0.5991624",
"0.59842914",
"0.5937972",
"0.591226",
"0.58968604",
"0.58686185",
"0.5857041",
"0.5838099",
"0.57928413"
] |
0.75419897
|
0
|
Quote a CSV row
|
public function quoteCsvRow($vals)
{
return implode(',', array_map(array($this, 'quoteCsv'), $vals)) . "\n";
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function quoteCsv($val)\n\t{\n\t\tif (!isset($val))\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\tif (strpos($val, \"\\n\") !== false || strpos($val, ',') !== false)\n\t\t{\n\t\t\treturn '\"' . str_replace(array('\\\\', '\"'), array('\\\\\\\\', '\"\"'), $val) . '\"';\n\t\t}\n\n\t\treturn $val;\n\t}",
"function _replaceQuoteCSV($string){\r\n //also remove newlines\r\n $string = preg_replace('/\\s+/', ' ', trim($string));\r\n return '\"'.str_replace('\"', \"'\", $string).'\"';\r\n }",
"private function sputcsv($row, $delimiter = ',', $enclosure = '\"', $eol = \"\\n\")\n {\n static $fp = false;\n if ($fp === false)\n {\n $fp = fopen('php://temp', 'r+'); // see http://php.net/manual/en/wrappers.php.php - yes there are 2 '.php's on the end.\n // NB: anything you read/write to/from 'php://temp' is specific to this filehandle\n }\n else\n {\n rewind($fp);\n }\n \n if (fputcsv($fp, $row, $delimiter, $enclosure) === false)\n {\n return false;\n }\n \n rewind($fp);\n $csv = fgets($fp);\n \n if ($eol != PHP_EOL)\n {\n $csv = substr($csv, 0, (0 - strlen(PHP_EOL))) . $eol;\n }\n \n return $csv;\n }",
"private function printCsvRow($row) {\n\t\t$string = '';\n\t\tforeach ($row as $value) {\n\t\t\t// remove line-breaks and whitespace at the start end end of a value and unify the values a little bit with the uppercase function (located in functions.php) and add a seperator after each value\n\t\t\t$string .= uppercase(trim(preg_replace('/\\s+/', ' ', $value))).$this->seperator;\t\t\t\n\t\t}\n\t\t$string .= \"\\n\";\n\t\treturn $string;\n\t}",
"public function sputcsv(Array $row, $delimiter = ',', $enclosure = '\"', $eol = \"\\n\")\n {\n static $fp = false;\n if ($fp === false)\n {\n $fp = fopen('php://temp', 'r+'); // see http://php.net/manual/en/wrappers.php.php - yes there are 2 '.php's on the end.\n // NB: anything you read/write to/from 'php://temp' is specific to this filehandle\n }\n else\n {\n rewind($fp);\n }\n \n if (fputcsv($fp, $row, $delimiter, $enclosure) === false)\n {\n return false;\n }\n \n rewind($fp);\n $csv = fgets($fp);\n \n if ($eol != PHP_EOL)\n {\n $csv = substr($csv, 0, (0 - strlen(PHP_EOL))) . $eol;\n }\n \n return $csv;\n }",
"function echocsv($fields)\r\n{\r\n $separator = '';\r\n foreach ($fields as $field) {\r\n if (preg_match('/\\\\r|\\\\n|,|\"/', $field)) {\r\n $field = '\"' . str_replace('\"', '\"\"', $field) . '\"';\r\n }\r\n echo $separator . $field;\r\n $separator = ',';\r\n }\r\n echo \"\\r\\n\";\r\n}",
"protected function addHeaderRowToCSV() {}",
"function &processCSVRow($row, $quoteAll = FALSE, $separator = \";\")\n\t{\n\t\t$resultarray = array();\n\t\tforeach ($row as $rowindex => $entry)\n\t\t{\n\t\t\tif(is_array($entry))\n\t\t\t{\n\t\t\t\t$entry = implode(\"/\", $entry);\n\t\t\t}\t\t\t\n\t\t\t$surround = FALSE;\n\t\t\tif ($quoteAll)\n\t\t\t{\n\t\t\t\t$surround = TRUE;\n\t\t\t}\n\t\t\tif (strpos($entry, \"\\\"\") !== FALSE)\n\t\t\t{\n\t\t\t\t$entry = str_replace(\"\\\"\", \"\\\"\\\"\", $entry);\n\t\t\t\t$surround = TRUE;\n\t\t\t}\n\t\t\tif (strpos($entry, $separator) !== FALSE)\n\t\t\t{\n\t\t\t\t$surround = TRUE;\n\t\t\t}\n\t\t\t// replace all CR LF with LF (for Excel for Windows compatibility\n\t\t\t$entry = str_replace(chr(13).chr(10), chr(10), $entry);\n\t\t\tif ($surround)\n\t\t\t{\n\t\t\t\t$resultarray[$rowindex] = utf8_decode(\"\\\"\" . $entry . \"\\\"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$resultarray[$rowindex] = utf8_decode($entry);\n\t\t\t}\n\t\t}\n\t\treturn $resultarray;\n\t}",
"static function asStringCSV($input) {\n\t\treturn Re::stringCSV($input);\n\t}",
"public function print_csv_rows() {\n\n\t\t$row_data = '';\n\t\t$data = $this->get_data();\n\t\t$cols = $this->get_csv_cols();\n\n\t\tif ( $data ) {\n\n\t\t\t// Output each row\n\t\t\tforeach ( $data as $row ) {\n\t\t\t\t$i = 1;\n\t\t\t\tforeach ( $row as $col_id => $column ) {\n\t\t\t\t\t// Make sure the column is valid\n\t\t\t\t\tif ( array_key_exists( $col_id, $cols ) ) {\n\t\t\t\t\t\t$row_data .= '\"' . preg_replace( '/\"/', \"'\", $column ) . '\"';\n\t\t\t\t\t\t$row_data .= $i == count( $cols ) ? '' : ',';\n\t\t\t\t\t\t$i ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$row_data .= \"\\r\\n\";\n\t\t\t}\n\n\t\t\t$this->stash_step_data( $row_data );\n\n\t\t\treturn $row_data;\n\t\t}\n\n\t\treturn false;\n\t}",
"private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }",
"public function quote($value) {\n\t\treturn $this -> getAdapter() -> quote($value);\n\t}",
"function add_quote($line)\r\n{\r\n $line = trim($line);\r\n if ($line[0] != '\"')\r\n $new_line = '\"';\r\n else \r\n $new_line = '';\r\n\r\n $inquote = false;\r\n for ($i = 0; $i < strlen($line); $i++){\r\n if ($line[$i] == '\"'){//碰到引号\r\n if ($inquote == false){ //如果不在引号内\r\n $inquote = true;\r\n $new_line .= '\"';\r\n continue;\r\n } else { //在引号内\r\n if ($i + 1 < strlen($line) && $line[$i+1] == '\"'){ //处理双引号\r\n $new_line .= '\"\"';\r\n $i++;\r\n continue;\r\n } else { //引号关闭\r\n $inquote = false;\r\n $new_line .= '\"';\r\n }\r\n }\r\n } else if ($line[$i] == ','){ //碰到逗号\r\n if ($inquote == true){ //如果在引号内 \r\n $new_line .= ',';\r\n } else { //不在引号内的逗号\r\n if ($line[$i-1] != '\"'){\r\n $new_line .= '\"';\r\n }\r\n $new_line .= ',';\r\n if ($i + 1 < strlen($line) && $line[$i+1] != '\"'){\r\n $new_line .= '\"';\r\n } else if ($i + 1 >= strlen($line)){\r\n $new_line .= '\"\"';\r\n }\r\n }\r\n } else if ($line[$i] == \"'\"){\r\n $new_line .= \"'\";\r\n } else {\r\n $new_line .= $line[$i];\r\n }\r\n }\r\n\r\n return $new_line;\r\n}",
"function getTransCsvHeader($row, $prefix = array())\n{\n foreach ($row as $k => $v) {\n if (strlen($k) > 1 && substr($k, 0, 1) != '_') {\n $prefix[] = $k;\n }\n }\n foreach ($prefix as $k => $v) {\n $prefix[$k] = str_replace('\"', '\\\"', $v);\n }\n return implode(',', $prefix) . \"\\n\";\n}",
"private function writeToCSV(array $row) {\n\t\tif (!$this->file) {\n\t\t\t$this->openFile();\n\t\t}\n\n\t\treturn fputcsv($this->file, $row);\n\t}",
"public function getCsvString() {\n return $this->data;\n }",
"public function dumpCSV($rows,$headers,$delimiter=';',$enclosure='\"',$encloseAll=true) {\n $numColumns = count($headers);\n $numRows = count($rows);\n foreach($headers as $key=>$val)\n if (is_numeric($key)) {\n $headers[$val]=ucfirst($val);\n unset($headers[$key]);\n }\n $out = array();\n for ($i = 0; $i <= $numRows; $i++) {\n $line = array();\n for ($c = 0; $c <= $numColumns; $c++) {\n $ckey = key($headers);\n $field='';\n if ($i==0)\n $field = current($headers);\n elseif (isset($rows[$i-1][$ckey]))\n $field = trim($rows[$i-1][$ckey]);\n if (is_array($field))\n $field = json_encode($field);\n if (empty($field) && $field !== 0)\n $line[] = '';\n elseif ($encloseAll || preg_match('/(?:'.preg_quote($delimiter, '/').'|'.\n preg_quote($enclosure, '/').'|\\s)/', $field))\n $line[] = $enclosure.str_replace($enclosure, $enclosure.$enclosure, $field).$enclosure;\n else\n $line[] = $field;\n next($headers);\n }\n $out[] = implode($delimiter, $line);\n reset($headers);\n }\n return implode(\"\\n\",$out);\n }",
"public function prepareRow($row) {\t \n\t//change the options of csv (Once,Twice,More than 15 times,11 - 15 times,6 - 10 times,3 times) with our new option value \n if ($row->email) {\n\t\t//$row->email = \"temp\".$row->email;\n\t\t$row->email = $row->email;\n }\n if ($row->username) {\n\t\t//$row->username = \"temp\".$row->username;\n\t\t$row->username = $row->username;\n }\n }",
"function add_quote($value) {\n\t\treturn '\"' . addslashes($value) . '\"';\n\t}",
"function DbCsv($res, $sep, $quotes, $outfile, $head) {\n\n\t// The CSV file is created and opened\n\t$csvfile = fopen($outfile, \"w\");\n\n\t// Add column header, if desired\n\tif($head){\n\t\t$csv = \"\";\n\t\tfor ($i = 0; $i < DbNumFields($res); ++$i) {\n\t\t\tif($quotes == \"on\") $csv .= \"\\\"\";\n\t\t\t$csv .= DbFieldName($res, $i);\n\t\t\techo \"$csv \";\n\t\t\tif($quotes == \"on\") $csv .= \"\\\"\";\n\t\t\t$csv .= $sep;\n\t\t}\n\t\t// The last separator of a line is always cut off\n\t\t$csv = trim($csv, $sep);\n\n\t\t// For each row a single line of the file is used\n\t\t$csv .= \"\\n\";\n\n\t\t// After having prepared the CSV row, it is written to the file\n\t\tfwrite($csvfile, $csv);\n\t}\n\n\t// The rows of the given result are processed one after the other\n\twhile($row = DbFetchArray($res)) {\n\t\t$csv = \"\";\n\t\t// Each element is added to the string individually\n\t\tforeach($row as $id => $field) {\n\t\t\tif(preg_match($ipmatch,$id) ){$field = long2ip($field);}\n\t\t\tif(preg_match($timatch,$id) ){$field = date($_SESSION['timf'],$field);}\n\t\t\t// If quotes are wished, they are put around the element\n\t\t\tif($quotes == \"on\") $csv .= \"\\\"\";\n\t\t\t$csv .= $field;\n\t\t\tif($quotes == \"on\") $csv .= \"\\\"\";\n\t\t\t$csv .= $sep;\n\t\t}\n\t\t// The last separator of a line is always cut off\n\t\t$csv = trim($csv, $sep);\n\n\t\t// For each row a single line of the file is used\n\t\t$csv .= \"\\r\\n\";\n\n\t\t// After having prepared the CSV row, it is written to the file\n\t\tfwrite($csvfile, $csv);\n\t}\n\n\t// When finished, the CSV file is closed\n\tfclose($csvfile);\n}",
"function array_to_csv($array, $header_row = true, $col_sep = \",\", $row_sep = \"\\n\", $qut = '\"')\n{\n\tif (!is_array($array) or !is_array($array[0])) return false;\n\t$output = '';\n\t//Header row.\n\tif ($header_row)\n\t{\n\t\tforeach ($array[0] as $key => $val)\n\t\t{\n\t\t\t//Escaping quotes.\n\t\t\t$key = str_replace($qut, \"$qut$qut\", $key);\n\t\t\t$output .= \"$col_sep$qut$key$qut\";\n\t\t}\n\t\t$output = substr($output, 1).\"\\n\";\n\t}\n\t//Data rows.\n\tforeach ($array as $key => $val)\n\t{\n\t\t$tmp = '';\n\t\tforeach ($val as $cell_key => $cell_val)\n\t\t{\n\t\t\t//Escaping quotes.\n\t\t\t$cell_val = str_replace($qut, \"$qut$qut\", $cell_val);\n\t\t\t$tmp .= \"$col_sep$qut$cell_val$qut\";\n\t\t}\n\t\t$output .= substr($tmp, 1).$row_sep;\n\t}\n\t\n // return $output;\n // Added trim, remove trailing \\n \n\treturn rtrim($output, $row_sep);\n}",
"protected function quote_escaped()\n {\n }",
"function csv_encode( $list )\n {\n $string = null;\n if( $fp = fopen(\"php://temp\", \"r+\") )\n {\n fputscv($fp, $list, $delimiter = ',', $enclosure = '\"');\n rewind($fp);\n $string = retrim(fgets($fp), \"\\n\");\n fclose($fp);\n }\n \n return $string;\n }",
"public function fputcsv($fields, $delimiter = null, $enclosure = null)\n {\n $this->defaultCsvControl($delimiter, $enclosure);\n\n if ($this->isSpecial()) {\n $line = $this->getTempLine($fields, $delimiter, $enclosure);\n\n // fputcsv() hardcodes \"\\n\" as a new line character\n if ($this->newline !== \"\\n\") {\n $line = rtrim($line, \"\\n\") . $this->newline;\n }\n\n return $this->fwrite($line);\n }\n\n return parent::fputcsv($fields, $delimiter, $enclosure);\n }",
"private function prepareValuesRow(): string\n {\n $values = [];\n foreach ($this->storage as $key => $value) {\n $values[] = \"('{$key}', '{$value}')\";\n }\n\n return implode(', ', $values);\n }",
"public function setQuoteChar(string $quoteChar): CsvImport\n {\n $this->quoteChar = $quoteChar;\n return $this;\n }",
"private function fputcsvCustom($filePointer,$dataArray,$delimiter=\";\",$enclosure=\"\\\"\")\n {\n $string = \"\";\n\n // for each array element, which represents a line in the csv file...\n foreach($dataArray as $trsKey => $trsValue) {\n\n $elems = array($trsKey, $trsValue);\n // No leading delimiter\n $writeDelimiter = FALSE;\n\n foreach($elems as $dataElement){\n // Replaces a double quote with two double quotes\n $dataElement=str_replace(\"\\\"\", \"\\\"\\\"\", $dataElement);\n\n // Adds a delimiter before each field (except the first)\n if($writeDelimiter) $string .= $delimiter;\n\n // Encloses each field with $enclosure and adds it to the string\n $string .= $enclosure . $dataElement . $enclosure;\n\n // Delimiters are used every time except the first.\n $writeDelimiter = TRUE;\n }\n // Append new line\n $string .= \"\\n\";\n\n } // end foreach($dataArray as $line)\n\n // Write the string to the file\n fwrite($filePointer,$string);\n }",
"public static function setQuoteSeparator() {\n if (is_null(self::$quoteSeparator)) {\n switch(self::$connector->getAttribute(PDO::ATTR_DRIVER_NAME)) {\n case 'pgsql':\n case 'sqlsrv':\n case 'dblib':\n case 'mssql':\n case 'sybase':\n self::$quoteSeparator = '\"';\n break;\n case 'mysql':\n case 'sqlite':\n case 'sqlite2':\n default:\n self::$quoteSeparator = '`';\n }\n }\n }",
"static function quote($value)\n\t{\n\t\treturn \"'\" . str_replace(\"'\", \"\\\\'\", $value) . \"'\";\n\t}",
"public function quote($value){\n $connection = $this -> connect();\n return pg_escape_literal($value);\n }"
] |
[
"0.72952616",
"0.6728817",
"0.67087096",
"0.6299758",
"0.6248503",
"0.62174106",
"0.5962991",
"0.59593666",
"0.5951948",
"0.59132904",
"0.5892304",
"0.58802456",
"0.58540297",
"0.58460367",
"0.58077335",
"0.5755857",
"0.57305235",
"0.56916857",
"0.5667598",
"0.56252736",
"0.5600917",
"0.55748093",
"0.5567272",
"0.5556444",
"0.5527376",
"0.55147296",
"0.55057615",
"0.5485136",
"0.54815555",
"0.5480054"
] |
0.7296372
|
0
|
Plugin Name: Easy table content helper Description: Helper plugin to extend easy table content plugin functionality. It shows table content in horizontal manner as a secondary menu. Author: 1naveengiri Author URI: Version: 0.1 Function to add content before the page content
|
function buddy_add_horizonal_table_content(){
echo do_shortcode('[ez-toc]');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function tt_add_menu_items(){\n\tadd_menu_page('Example Plugin List Table', 'List Table Example', 'activate_plugins', 'tt_list_test', 'tt_render_list_page');\n}",
"public function add_menu() {\n\t\tadd_menu_page( 'Custom Table', 'Custom Table', 'manage_options', 'custom-table', [ $this, 'display_page_contents' ] );\n\t}",
"function hybrid_get_utility_before_content() {\n\tget_sidebar( 'before-content' );\n}",
"function udesign_page_content_before() {\r\n do_action('udesign_page_content_before');\r\n}",
"function tanvas_product_showcase_table_shortcode($args, $content=''){\n $out = '<table class=\"product-info\"><tbody>';\n $out .= do_shortcode($content);\n $out .= '</tbody></table>';\n return $out;\n}",
"function admin_template($content=\"\",$titlebar=\"\",$titlepage=\"\",$user=\"\",$menu=\"\",$plugin=\"\"){\n \n $titlebar = ($titlebar!=\"\") ? $titlebar : \"\";\n\t$titlepage = ($titlepage!=\"\") ? $titlepage : \"\";\n $plugin\t = ($plugin!=\"\") ? $plugin : \"\";\n $menu\t = ($menu!=\"\") ? $menu : \"\";\n $content\t= ($content!=\"\") ? $content : \"\";\n\n \n$menu = '\n<div class=\"menu-bar header-sm-height\" data-pages-init=\\'horizontal-menu\\' data-hide-extra-li=\"0\">\n <a href=\"#\" class=\"btn-link toggle-sidebar hidden-lg-up pg pg-close\" data-toggle=\"horizontal-menu\">\n </a>\n <ul>\n <li class=\" active\">\n <a href=\"home.php\">Dashboard</a>\n </li>\n <li>\n <a href=\"list_member.php\"><span class=\"title\">Members</span></a>\n </li>\n <li>\n <a href=\"javascript:;\"><span class=\"title\">Products</span>\n <span class=\" arrow\"></span></a>\n <ul class=\"\">\n <li class=\"\">\n <a href=\"list_products.php\">List Products</a>\n </li>\n <li class=\"\">\n <a href=\"list_categories.php\">List Categories</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"list_sub_categories.php\">Sub Categories</a>\n </li>\n \n \n </ul>\n </li>\n \n <li class=\"\">\n <a href=\"list_transaction.php\">List Transaction</a>\n </li>\n \n </li>\n\t\t\t<li>\n <a href=\"javascript:;\"><span class=\"title\">Pages</span>\n <span class=\" arrow\"></span></a>\n <ul class=\"\">\n <li class=\"\">\n <a href=\"about_us.php\">About Us</a>\n </li>\n <li class=\"\">\n <a href=\"production.php\">Production</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"buyers_guide.php\">Buyers Guide</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"custom_guide.php\">Custom Guide</a>\n </li>\n\t\t\t\t<li class=\"\">\n <a href=\"payment_guide.php\">Payment Guide</a>\n </li>\n </ul>\n </li>\n\t\t\t<li>\n <a href=\"list_contact_us.php\">Incoming Contact Us</a>\n </li>\n \n </ul>\n <a href=\"#\" class=\"search-link d-flex justify-content-between align-items-center hidden-lg-up\" data-toggle=\"search\">Tap here to search <i class=\"pg-search float-right\"></i></a>\n </div>\n';\n \n \n$template = '\n<!DOCTYPE html>\n<html>\n <head>\n <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\n <meta charset=\"utf-8\" />\n <title>'.$titlebar.' Seagods Wetsuit</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no\" />\n <link rel=\"apple-touch-icon\" href=\"pages/ico/60.png\">\n <link rel=\"apple-touch-icon\" sizes=\"76x76\" href=\"pages/ico/76.png\">\n <link rel=\"apple-touch-icon\" sizes=\"120x120\" href=\"pages/ico/120.png\">\n <link rel=\"apple-touch-icon\" sizes=\"152x152\" href=\"pages/ico/152.png\">\n <link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\" />\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n <meta name=\"apple-touch-fullscreen\" content=\"yes\">\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"default\">\n <meta content=\"\" name=\"description\" />\n <meta content=\"\" name=\"author\" />\n <link href=\"assets/plugins/pace/pace-theme-flash.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/bootstrap/css/bootstrap.min.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/font-awesome/css/font-awesome.css\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"assets/plugins/jquery-scrollbar/jquery.scrollbar.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"assets/plugins/select2/css/select2.min.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"assets/plugins/switchery/css/switchery.min.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n <link href=\"pages/css/pages-icons.css\" rel=\"stylesheet\" type=\"text/css\">\n <link class=\"main-stylesheet\" href=\"pages/css/pages.css\" rel=\"stylesheet\" type=\"text/css\" />\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"assets/css/paging.css\">\n\t\n\n\t\n\n\t'.$plugin.'\n </head>\n <body class=\"fixed-header horizontal-menu horizontal-app-menu dashboard\">\n <!-- START HEADER -->\n <div class=\"header\">\n <div class=\"container\">\n <div class=\"header-inner header-md-height\">\n <a href=\"#\" class=\"btn-link toggle-sidebar hidden-lg-up pg pg-menu\" data-toggle=\"horizontal-menu\">\n </a>\n <div class=\"\">\n <a href=\"#\" class=\"search-link hidden-md-down\" data-toggle=\"search\"></a>\n </div>\n <div class=\"d-flex align-items-center\">\n <!-- START User Info-->\n <div class=\"pull-left p-r-10 fs-14 font-heading hidden-md-down\">\n <span class=\"semi-bold\">'.$user.'</span>\n </div>\n <div class=\"dropdown pull-right sm-m-r-5\">\n <button class=\"profile-dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n <span >\n <img src=\"assets/img/s-logo.png\" alt=\"\" width=\"32px\" >\n </span>\n </button>\n <div class=\"dropdown-menu dropdown-menu-right profile-dropdown\" role=\"menu\">\n <!--<a href=\"#\" class=\"dropdown-item\"><i class=\"pg-settings_small\"></i> Settings</a>\n <a href=\"#\" class=\"dropdown-item\"><i class=\"pg-outdent\"></i> Feedback</a>\n <a href=\"#\" class=\"dropdown-item\"><i class=\"pg-signals\"></i> Help</a>-->\n <a href=\"logout.php\" class=\"clearfix bg-master-lighter dropdown-item\">\n <span class=\"pull-left\">Logout</span>\n <span class=\"pull-right\"><i class=\"pg-power\"></i></span>\n </a>\n </div>\n </div>\n <!-- END User Info\n <a href=\"#\" class=\"header-icon pg pg-alt_menu btn-link m-l-10 sm-no-margin d-inline-block\" data-toggle=\"quickview\" data-toggle-element=\"#quickview\"></a>\n --></div>\n </div>\n <div class=\"header-inner justify-content-start header-lg-height title-bar\">\n <div class=\"brand inline align-self-end\">\n <img src=\"assets/img/s-logo.png\" style=\"width:35px;\" >\n </div>\n <h2 class=\"page-title align-self-end\">\n '.$titlepage.'\n </h2>\n </div>\n '.$menu.'\n </div>\n </div>\n\t\n\t<div class=\"page-container \">\n <!-- START PAGE CONTENT WRAPPER -->\n <div class=\"page-content-wrapper \">\n <!-- START PAGE CONTENT -->\n <div class=\"content sm-gutter\">\n <!-- START JUMBOTRON -->\n <div data-pages=\"parallax\">\n <div class=\" container no-padding container-fixed-lg\">\n <div class=\"inner\">\n <!-- START BREADCRUMB -->\n <ol class=\"breadcrumb\">\n <li class=\"breadcrumb-item\"><a href=\"home.php\">Home</a></li>\n <li class=\"breadcrumb-item active\">'.$titlepage.'</li>\n </ol>\n </div>\n </div>\n </div>\n\t\n '.$content.'\n\t\n\t<br><br>\n\t <div class=\" container container-fixed-lg footer\">\n <div class=\"copyright sm-text-center\">\n <p class=\"small no-margin pull-left sm-pull-reset\">\n <span class=\"hint-text\">SeaGods Administrator Page © 2018 </span>\n <span class=\"font-montserrat\"></span>.\n <span class=\"hint-text\">All rights reserved. </span>\n <span class=\"sm-block\"><a href=\"#\" class=\"m-l-10 m-r-10\">Terms of use</a> <span class=\"muted\">|</span> <a href=\"#\" class=\"m-l-10\">Privacy Policy</a></span>\n </p>\n <p class=\"small no-margin pull-right sm-pull-reset\">\n Supported by <span class=\"hint-text\"> XtremeWeb Solution</span>\n </p>\n <div class=\"clearfix\"></div>\n </div>\n </div>\n <!-- END COPYRIGHT -->\n </div>\n <!-- END PAGE CONTENT WRAPPER -->\n </div>\n\t\n <!-- END PAGE CONTAINER -->\n <!--START QUICKVIEW -->\n <div id=\"quickview\" class=\"quickview-wrapper\" data-pages=\"quickview\">\n \n </div>\n \n \n <!-- END QUICKVIEW-->\n <!-- START OVERLAY -->\n <div class=\"overlay hide\" data-pages=\"search\">\n <!-- BEGIN Overlay Content !-->\n <div class=\"overlay-content has-results m-t-20\">\n <!-- BEGIN Overlay Header !-->\n <div class=\"container-fluid\">\n <!-- BEGIN Overlay Logo !\n <img class=\"overlay-brand\" src=\"assets/img/logo.png\" alt=\"logo\" data-src=\"assets/img/logo.png\" data-src-retina=\"assets/img/logo_2x.png\" width=\"78\" height=\"22\">\n <!-- END Overlay Logo !-->\n <!-- BEGIN Overlay Close !-->\n <a href=\"#\" class=\"close-icon-light overlay-close text-black fs-16\">\n <i class=\"pg-close\"></i>\n </a>\n <!-- END Overlay Close !-->\n </div>\n <!-- END Overlay Header !-->\n <div class=\"container-fluid\">\n <!-- BEGIN Overlay Controls !-->\n <input id=\"overlay-search\" class=\"no-border overlay-search bg-transparent\" placeholder=\"Search...\" autocomplete=\"off\" spellcheck=\"false\">\n <br>\n <div class=\"inline-block\">\n <div class=\"checkbox right\">\n <input id=\"checkboxn\" type=\"checkbox\" value=\"1\" checked=\"checked\">\n <label for=\"checkboxn\"><i class=\"fa fa-search\"></i> Search within page</label>\n </div>\n </div>\n <div class=\"inline-block m-l-10\">\n <p class=\"fs-13\">Press enter to search</p>\n </div>\n <!-- END Overlay Controls !-->\n </div>\n <!-- BEGIN Overlay Search Results, This part is for demo purpose, you can add anything you like !-->\n <div class=\"container-fluid\">\n <span>\n <strong>suggestions :</strong>\n </span>\n <span id=\"overlay-suggestions\"></span>\n <br>\n <div class=\"search-results m-t-40\">\n <p class=\"bold\">Pages Search Results</p>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n <!-- BEGIN Search Result Item !-->\n \n <!-- END Search Result Item !-->\n </div>\n \n </div>\n </div>\n </div>\n <!-- END Overlay Search Results !-->\n </div>\n <!-- END Overlay Content !-->\n </div>\n <!-- END OVERLAY -->\n <!-- BEGIN VENDOR JS -->\n <script src=\"assets/plugins/feather-icons/feather.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/pace/pace.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery/jquery-1.11.1.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/modernizr.custom.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-ui/jquery-ui.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/tether/js/tether.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/bootstrap/js/bootstrap.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery/jquery-easy.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-unveil/jquery.unveil.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-ios-list/jquery.ioslist.min.js\" type=\"text/javascript\"></script>\n <script src=\"assets/plugins/jquery-actual/jquery.actual.min.js\"></script>\n <script src=\"assets/plugins/jquery-scrollbar/jquery.scrollbar.min.js\"></script>\n <script type=\"text/javascript\" src=\"assets/plugins/select2/js/select2.full.min.js\"></script>\n <script type=\"text/javascript\" src=\"assets/plugins/classie/classie.js\"></script>\n <script src=\"assets/plugins/switchery/js/switchery.min.js\" type=\"text/javascript\"></script>\n <!-- END VENDOR JS -->\n <!-- BEGIN CORE TEMPLATE JS -->\n <script src=\"pages/js/pages.min.js\"></script>\n <!-- END CORE TEMPLATE JS -->\n <!-- BEGIN PAGE LEVEL JS -->\n <script src=\"assets/js/scripts.js\" type=\"text/javascript\"></script>\n\t\n\t \n </body>\n</html>\n\n\n';\n\nreturn $template;\n}",
"function getTableWrapping($content) {\n }",
"function the_table ( $content ) {\n return $content .= '<table>\n <tr><th>Column 1</th><th>Column 2</th<</tr>\n <tr><td>Column 1 Text 1</td><td>Column 2 Text 1</td></tr>\n <tr><td>Column 1 Text 2</td><td>Column 2 Text 2</td></tr>\n </table>';\n}",
"function udesign_home_page_content_before() {\r\n do_action('udesign_home_page_content_before');\r\n}",
"function tpl_add_content()\n\t{\n\t\treturn true;\n\t}",
"function display_plugins_table()\n {\n }",
"function create_tbl_woo2app_mainpage(){\r global $wpdb;\r $charset_collate = $wpdb->get_charset_collate();\r $table_name = $wpdb->prefix . 'woo2app_mainpage';\r $sql = \"CREATE TABLE $table_name (\r\t\t\tmp_id bigint(20) NOT NULL AUTO_INCREMENT,\r\t\t\tPRIMARY key(mp_id),\r\t\t\tmp_title varchar(100) NOT NULL,\r\t\t\tmp_type tinyint(4) NOT NULL ,\r\t\t\tmp_value text NOT NULL ,\r\t\t\tmp_showtype tinyint(4) NOT NULL,\r\t\t\tmp_pic text NOT NULL,\r\t\t\tmp_order bigint(20),\r\t\t\tmp_sort text NULL \r\t\t) $charset_collate;\";\r require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r dbDelta( $sql );\r add_option( 'woo2app_version', '1.3' );\r }",
"public function prePageContent();",
"function my_admin_page_contents() {\n\t\t?>\n\t\t\t<h1>\n\t\t\t\tPage d'aministration du plugin de création de formulaire\n\t\t\t\t\n\t\t\t</h1>\n\t\t<?php\n\t}",
"public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollection_add_list', array('content' => $content));\n }",
"function okrs_add_table_row($row ,$aRow)\n{\n\n $CI = &get_instance();\n $CI->load->model('okr/okr_model');\n\n if($aRow['rel_type'] == 'okrs'){\n $okrs = $CI->okr_model->get_okrs($aRow['rel_id']);\n if ($okrs) {\n\n $str = '<span class=\"hide\"> - </span><a class=\"text-muted task-table-related\" data-toggle=\"tooltip\" title=\"' . _l('task_related_to') . '\" href=\"' . admin_url('okr/show_detail_node/' . $okrs->id) . '\">' . $okrs->your_target . '</a><br />';\n\n $row[2] = $row[2].$str;\n }\n\n }\n\n return $row;\n}",
"function plugin_postinstall_nexcontent($pi_name)\r\n{\r\n global $_DB_dbms, $_CONF, $_DB_table_prefix, $_TABLES ;\r\n\r\n $sql= \"INSERT INTO {$_TABLES['nexcontent_pages']} (id,pid,type,pageorder,name,blockformat,heading,content,meta_description,meta_keywords) VALUES (1, 0, 'category', '10', 'frontpage', 'none', 'Front Page Folder', 'Create a page under this folder if you want to have a page loaded as the frontpage', '', '');\";\r\n DB_query($sql);\r\n\r\n return true;\r\n}",
"function siteorigin_panels_add_help_tab_content(){\n\tinclude 'tpl/help.php';\n}",
"protected function defaultdata()\n {\n // create one page with 2 columns and some content\n $page = array('title' => $this->__('Content introduction page'),\n 'urlname' => $this->__('content-introduction-page'),\n 'layout' => 'Column2d6238',\n 'setLeft' => '0',\n 'setRight' => '1',\n 'language' => ZLanguage::getLanguageCode());\n\n // Insert the default page\n if (!($obj = DBUtil::insertObject($page, 'content_page'))) {\n LogUtil::registerStatus($this->__('Warning! Could not create the default Content introductory page.'));\n } else {\n // create the contentitems for this page\n $content = array();\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '0',\n 'position' => '0',\n 'module' => 'Content',\n 'type' => 'Heading',\n 'data' => serialize(array('text' => $this->__('A Content page consists of various content items in a chosen layout'),\n 'headerSize' => 'h3')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '1',\n 'position' => '0',\n 'module' => 'Content',\n 'type' => 'Html',\n 'data' => serialize(array('text' => $this->__('<p>Each created page has a specific layout, like 1 column with and without a header, 2 columns, 3 columns. The chosen layout contains various content areas. In each area you can place 1 or more content items of various kinds like:</p> <ul> <li>HTML text;</li> <li>YouTube videos;</li> <li>Google maps;</li> <li>Flickr photos;</li> <li>RSS feeds;</li> <li>Computer Code;</li> <li>the output of another Zikula module.</li> </ul> <p>Within these content areas you can sort the content items by means of drag & drop.<br /> You can make an unlimited number of pages and structure them hierarchical. Your page structure can be displayed in a multi level menu in your website.</p>'),\n 'inputType' => 'text')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '1',\n 'position' => '1',\n 'module' => 'Content',\n 'type' => 'Html',\n 'data' => serialize(array('text' => $this->__('<p><strong>This is a second HTML text content item in the left column</strong><br /> Content is an extendible module. You can create your own content plugins and layouts and other Zikula modules can also offer content items. The News published module for instance has a Content plugin for a list of the latest articles.</p>'),\n 'inputType' => 'text')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '2',\n 'position' => '0',\n 'module' => 'Content',\n 'type' => 'Quote',\n 'data' => serialize(array('text' => $this->__('No matter what your needs, Zikula can provide the solution.'),\n 'source' => 'http://zikula.org', 'desc' => 'Zikula homepage')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '2',\n 'position' => '1',\n 'module' => 'Content',\n 'type' => 'ComputerCode',\n 'data' => serialize(array('text' => $this->__('$this->doAction($var); // just some code'))));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '2',\n 'position' => '2',\n 'module' => 'Content',\n 'type' => 'Html',\n 'data' => serialize(array('text' => $this->__('<p>So you see that you can place all kinds of content on the page in your own style and liking. This makes Content a really powerful module.</p> <p>This page uses the <strong>2 column (62|38) layout</strong> which has a header, 2 colums with 62% width on the left and 38% width on the right and a footer</p>'),\n 'inputType' => 'text')));\n $content[] = array('pageId' => $obj['id'],\n 'areaIndex' => '3',\n 'position' => '0',\n 'module' => 'Content',\n 'type' => 'Html',\n 'data' => serialize(array('text' => $this->__('This <strong>footer</strong> finishes of this introduction page. Good luck with using Content. The <a href=\"index.php?module=content&type=admin\">Edit Contents</a> interface lets you edit or delete this introduction page. In the <a href=\"index.php?module=content&type=admin\">administration</a> interface you can further control the Content module.'),\n 'inputType' => 'text')));\n\n // write the items to the dbase\n foreach ($content as $contentitem) {\n DBUtil::insertObject($contentitem, 'content_content');\n }\n }\n }",
"function maenna_aboutcontent($Row = '', $button = false) {\n global $redirect;\n $data_type = 'highlights';\n $section = 'highlights';\n $panel = \"two_columns\";\n\n\n\t$template = \"<h2>Why We Like This Opportunity</h2><p><br></p><h3>Low Leverage</h3><p>Discuss the amount of loans and the terms of such loans (interest rate, duration, collateral if any etc.) as well as the amount of equity capital the business has on its balance sheet.</p><h3>Cash Flows</h3><p>Discuss the size of free cash flows the business generates. Also discuss the annual cash requirements of the business for operations, capital expenditures and similar uses.</p><h3>Collateral, Returns</h3><p>What is the range of interest or return investors expect to make?</p><h3>Growth</h3><p>What is the company’s revenue and profit growth rate for the last year and the last 5 years? How is this expected to change in the next year and 5 years?</p><h3>Business Model</h3><p>Describe what the company offers, to whom and why. Also describe how the company makes money and the size of expenses it incurs to generate that revenue. Discuss what the company does better than other similar companies in its market that gives the company an advantage to sell more of its products/services?</p><h3>Experienced Team</h3><p>Discuss the backgrounds of the people running the company</p><p><br></p><h2>Risks</h2><p><br></p><ul><li>Default risks</li></ul><p>What is the risk that the company may be unable to meet its debt obligations and how does the company mitigate the risk?</p><ul><li>Operational risks</li></ul><p>What are the risks of providing the company’s products and services at the highest quality standard and the fastest speed customers demand and how does the company manage this risk?</p><ul><li>Competition</li></ul><p>How does the company mitigate the risk of other companies providing the same service or product or customers not moving to a replacement product?</p><ul><li>Market risks</li></ul><p>Discuss how the value of the business may be adversely impacted by the market and the economic condition you operate in</p><ul><li>Other uncontrollable risks</li></ul><p>Discuss operating and non-operating risks that the company is unable to control and what may protect investors from such risks.</p><p><br></p><h2>Deal Summary</h2><p><br></p><p>Discuss what the investment is, who the issuer is and if such investment is funded or not. If the investment is a loan, discuss the total loan amount, interest rate, the expected repayment date, collateral if any and the value of such collateral. If the investment is equity, discuss if it is dividend paying, frequency of such dividends, how the investor is to be compensated for his/her investment. If the investment is pooled with other investors, discuss how this is done, how many investors, how such investors are represented and the monitoring and reporting of performance during the term of the investment. Please discuss details of the investment and the mechanics for return distribution as clearly as possible while maintaining the actual name of the company for privacy.</p><p><br></p><h3>What protects my interest</h3><p>Discuss the value of the collaterals and the specific description of each collateral and its value. If the investment is to be protected by the value of the company and its assets, discuss the value of these assets, what lien such assets may have on them, the market value of these assets and how such value is determined.</p><h3>Payment mechanism</h3><p>Discuss how investors are scheduled to receive regular monthly interest or dividend payments, the annualized target rate for such interest or dividend over the investment’s expected term of x months / years. Also discuss the maturity date of the loan when the Principal is expected to be repaid or the exit mechanism to provide liquidity and return of capital. In the event payments are transferable to investor’s related party pursuant to specific deal terms, discuss how such transfers may occur as applicable.</p><h3>Originator background</h3><p>Discuss the background of the company, the originator of the deal and his/her track record and how such track record is established to vet this opportunity.</p>\";\n\t$template = require __DIR__ . '/templates/about.php';\n\t$content = \"<input type='hidden' id='project_id' value='\". $Row->project_id . \"'>\n\t<div class='act-content'>\n <form method='post' action='' enctype='mutipart/form-data' onsubmit='onSubmit()'>\n \t\t<div class='content_box' style='margin-top:20px;margin-left:-10px;'><div class='box_title shaded_title'>ADD PUBLIC PITCH OR TEASER</div></div>\n \t\t<div class='entry'><div class='entry-content'>\n <div class=\\\"document-editor\\\">\n <div class=\\\"toolbar-container1\\\"></div>\n <div class=\\\"content-container\\\">\n <input type='hidden' name='mission' id='mission'>\";\n\tif($Row->mission_temp){\n\t $content .= \"<div id=\\\"mission_editor\\\" style='height: 350px; overflow-y: auto;'>\" . $Row->mission_temp . \"</div>\";\n\t} else {\n if ($Row->mission == null || $Row->mission == '<p><br data-cke-filler=\"true\"></p>')\n $content .= \"<div id=\\\"mission_editor\\\" style='height: 350px; overflow-y: auto;'>\" . $template . \"</div>\";\n else\n $content .= \"<div id=\\\"mission_editor\\\" style='height: 350px; overflow-y: auto;'>\" . str_ireplace('<br data-cke-filler=\"true\">', '', $Row->mission) . \"</div>\";\n }\n\t$content .= \"</div>\n </div>\n </div>\n </div>\n <p> </p>\n \t\t<div class='content_box' style='width:auto;'><div class='box_title shaded_title' style='margin-left:-10px;'>ADD PRIVATE INFORMATION FOR SELECT INTERESTED PARTIES</div></div>\n \t\t<div class='entry'><div class='entry-content'>\n <div class=\\\"document-editor\\\">\n <div class=\\\"toolbar-container2\\\"></div>\n <div class=\\\"content-container\\\">\n <input type='hidden' name='goal' id='goal'>\";\n if($Row->goal_temp){\n $content .= \"<div id=\\\"goal_editor\\\" style='height: 350px; overflow-y: auto;'>\" . str_ireplace('<br data-cke-filler=\"true\">', '', $Row->goal_temp) . \"</div>\";\n } else {\n $content .= \"<div id=\\\"goal_editor\\\" style='height: 350px; overflow-y: auto;'>\" . str_ireplace('<br data-cke-filler=\"true\">', '', $Row->goal) . \"</div>\";\n }\n $content .= \"</div>\n </div>\n </div>\n </div>\n <input type='hidden' value='0' id='temp_save' name='temp_save'>\n <div class='changing-link'>\n <a href='$redirect&panel=${panel}§ion=${section}&view=add&datatype=$data_type'>Add Highlights</a>\n </div\n <div class='changing-link'>\n <a href='$redirect&panel=${panel}§ion=${section}&view=list&datatype=$data_type'>List Highlights</a>\n </div>\n \t\t<div style=\\\"margin-top:8px;\\\" align='center'>\n \t\t\t<input type='button' value='Save' onclick='onlySave(this)' class='button'>\n \t\t\t<input type='submit' value='Publish' class='button'>\";\n if(!$button) $content .= \"<input type='button' value='Cancel' onclick='redirect();' class='button'>\";\n $content .= \"</div>\n \t</form>\n </div>\";\n\t$content .= \"<style>\n p {\n font-size: 16px;\n }\n h2 {\n font-size: 24px;\n font-family: Lato Black;\n color: #929497;\n }\n h3 {\n font-size: 20px;\n font-family: Lato Light;\n color: #929497;\n }\n h4 {\n font-size: 12px;\n font-family: Lato Regular;\n color: #929497;\n }\n #mission_editor, #goal_editor{\n border: 1px solid #c4c4c4;\n\t\t\tborder-top:none;\n }\n #mission_editor ol, #goal_editor ol {\n list-style: none;\n\t\t\tcounter-reset: item;\n\t\t\tcolor: #686b83 !important;\n }\n #mission_editor ol li, #goal_editor ol li {\n counter-increment: item;\n margin-bottom: 5px;\n margin-left: 10px;\n font-size: 15px;\n\t\t\tfont-family: Lato Light;\n\t\t\tcolor: #686b83 !important;\n }\n #mission_editor ol li:before, #goal_editor ol li:before {\n content: counter(item);\n color: #00A2BF;\n font-family: Lato Black;\n font-size: 17px;\n width: 1.2em;\n display: inline-block;\n font-weight: bold;\n }\n #mission_editor ul li, #goal_editor ul li {\n margin-left: 10px;\n padding: 0 0 .2em 0;\n background: none;\n list-style: none;\n font-size: 15px;\n\t\t\tfont-family: Lato Light;\n\t\t\tcolor: #686b83 !important;\n }\n #mission_editor ul li:before, #goal_editor ul li:before {\n content: '•';\n color: #00A2BF;\n font-weight: bold;\n\t\t\tfont-size: 17px;\n\t\t\tfont-family: Lato Black;\n\t\t\t\t \n }\n .ck.ck-custom-heading, .ck.ck-heading_heading-h1, .ck.ck-heading_heading-h2, .ck.ck-heading_heading-h4, .ck.ck-heading_paragraph-p-1, .ck.ck-heading_paragraph-p-2, .about-company-h1, .about-company-h2, .about-company-h4, .about-company-p1, .about-company-p2 {\n color: #929497;\n }\n .ck.ck-heading_heading-h1, .about-company-h1 {\n font-family: Lato Black !important;\n font-size: 22pt !important;\n\t\t\tfont-weight: normal !important;\n\t\t\tline-height: 35px;\n }\n .ck.ck-heading_heading-h2, .about-company-h2 {\n font-family: 'Lato Light';\n font-size: 22pt !important;\n \tfont-weight: normal !important;\n \tline-height: 32px;\n }\n .ck.ck-heading_heading-h4, .about-company-h4 {\n\t\t\tcolor: #686b83 !important;\n font-family: 'Lato Light';\n\t\t\tfont-size: 12pt !important;\n\t\t\t\n }\n .ck.ck-heading_paragraph-p-1, .about-company-p1, #mission_editor p:not([class]), #goal_editor p:not([class]) {\n font-family: 'LatoRegular';\n font-size: 15px !important;\n \t// font-weight: bold !important;\n\t\t\tline-height: 28px;\n\t\t\tcolor: #686b83 !important;\n }\n .ck.ck-heading_paragraph-p-2, .about-company-p2 {\n font-family: Lato Light !important;\n font-size: 15px !important;\n font-weight: normal !important;\n\t\t}\n\t\t.ck.ck-heading_paragraph-p-3, .about-company-p3 {\n font-family: 'LatoRegular'!important;\n font-size: 15pt !important;\n font-weight: normal !important;\n }\n /*br[data-cke-filler] {\n display: none;\n visibility: hidden;\n }*/\n\n </style>\";\n\t$content .= \"<script>\n var pTags = document.getElementById('mission_editor').getElementsByTagName('p');\n for (var i = 0; i < pTags.length; i ++) {\n if (pTags[i].firstChild != null && pTags[i].firstChild.nodeName == 'BR') {\n pTags[i].innerHTML = '';\n // console.log(pTags[i])\n }\n }\n var project_id = document.getElementById('project_id').value;\n var fontOptions = {\n options: [\n\n { model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading-h1', view: {\n name: 'h1',\n classes: 'about-company-h1'\n } },\n { model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading-h2', view: {\n name: 'h2',\n classes: 'about-company-h2'\n } },\n { model: 'heading3', title: 'Paragraph 1', class: 'ck-heading_paragraph-p-1', view: {\n name: 'p',\n classes: 'about-company-p1'\n } },\n { model: 'heading4', title: 'Paragraph 2', class: 'ck-heading_paragraph-p-2', view: {\n name: 'p',\n classes: 'about-company-p2'\n\t\t\t\t\t}, converterPriority: 'high' },\n\t\t\t\t\t// { model: 'heading5', title: 'Paragraph 3', class: 'ck-heading_paragraph-p-3', view: {\n // name: 'p',\n // classes: 'about-company-p3'\n // }, converterPriority: 'high' },\n { model: 'footnote', title: 'Footnote', class: 'ck-heading_heading-h4', view: {\n name: 'h4',\n classes: 'about-company-h4'\n }}\n ]\n };\n var fontSize = {\n options: [12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32]\n };\n DecoupledEditor\n .create( document.querySelector( '#mission_editor' ), {\n // fontSize: fontSize,\n heading: fontOptions,\n toolbar: [ 'heading', '|', 'bold', 'italic', '|', 'alignment', '|', 'numberedlist', 'bulletedlist', '|', 'imageupload', 'mediaembed' ],\n// simpleUpload: {\n// // The URL that the images are uploaded to.\n// uploadUrl: '/themes/maennaco/images/project/',\n//\n// // Headers sent along with the XMLHttpRequest to the upload server.\n// headers: {\n// }\n// }\n ckfinder: {\n uploadUrl: '/themes/maennaco/includes/cropper.php/?command=uploadImage&id='+project_id,\n\n options: {\n resourceType: 'Images'\n }\n }\n } )\n .then( editor => {\n// window.editor = editor;\n\n const toolbarContainer = document.querySelector( '.toolbar-container1' );\n\n toolbarContainer.prepend( editor.ui.view.toolbar.element );\n\n window.editor = editor;\n } )\n .catch( err => {\n console.error( err.stack );\n } );\n\n DecoupledEditor\n .create( document.querySelector( '#goal_editor' ), {\n // fontSize: fontSize,\n heading: fontOptions,\n toolbar: [ 'heading', '|', 'bold', 'italic', '|', 'alignment', '|', 'numberedlist', 'bulletedlist', '|', 'imageupload', 'mediaembed' ]\n } )\n .then( editor => {\n// window.editor = editor;\n\n const toolbarContainer = document.querySelector( '.toolbar-container2' );\n\n toolbarContainer.prepend( editor.ui.view.toolbar.element );\n\n window.editor = editor;\n } )\n .catch( err => {\n console.error( err.stack );\n } );\n\n\n function onSubmit() {\n// if (valid_form('mission') && valid_form('goal')) {\n if (document.getElementById('mission_editor').lastElementChild.innerHTML == 'media widget')\n document.getElementById('mission_editor').lastElementChild.remove();\n document.getElementById('mission').value = document.getElementById('mission_editor').innerHTML;\n\n if (document.getElementById('goal_editor').lastElementChild.innerHTML == 'media widget')\n document.getElementById('goal_editor').lastElementChild.remove();\n document.getElementById('goal').value = document.getElementById('goal_editor').innerHTML;\n// }\n }\n </script>\";\n\techo $content;\n}",
"public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollectionitem_add_list', array('content' => $content));\n }",
"function add_sub_row($selector, $row = \\false, $post_id = \\false)\n{\n}",
"function wp_admin_bar_new_content_menu($wp_admin_bar)\n {\n }",
"function hybrid_get_utility_after_content() {\n\tget_sidebar( 'after-content' );\n}",
"public function add_content() {\n $data['title'] = translate('add') . \" \" . translate('content_management');\n $this->load->view('admin/master/add_update_content', $data);\n }",
"function extra_tablenav( $which ) {\n if ( $which == \"top\" ){\n //The code that goes before the table is here\n echo \"<h2>Funny Quotes<a href='admin.php?page=add_funny_quotes' class='add-new-h2'>+ Ajouter une nouvelle citation</a></h2>\";\n }\n }",
"function jardiwinery_body_add_toc() {\n\t\tif (jardiwinery_get_custom_option('menu_toc_home')=='yes' && function_exists('jardiwinery_sc_anchor'))\n\t\t\tjardiwinery_show_layout(jardiwinery_sc_anchor(array(\n\t\t\t\t'id' => \"toc_home\",\n\t\t\t\t'title' => esc_html__('Home', 'jardiwinery'),\n\t\t\t\t'description' => esc_html__('{{Return to Home}} - ||navigate to home page of the site', 'jardiwinery'),\n\t\t\t\t'icon' => \"icon-home\",\n\t\t\t\t'separator' => \"yes\",\n\t\t\t\t'url' => esc_url(home_url('/'))\n\t\t\t\t)\n\t\t\t)); \n\t\tif (jardiwinery_get_custom_option('menu_toc_top')=='yes' && function_exists('jardiwinery_sc_anchor'))\n\t\t\tjardiwinery_show_layout(jardiwinery_sc_anchor(array(\n\t\t\t\t'id' => \"toc_top\",\n\t\t\t\t'title' => esc_html__('To Top', 'jardiwinery'),\n\t\t\t\t'description' => esc_html__('{{Back to top}} - ||scroll to top of the page', 'jardiwinery'),\n\t\t\t\t'icon' => \"icon-double-up\",\n\t\t\t\t'separator' => \"yes\")\n\t\t\t\t)); \n\t}",
"function webpinas_glf_data_table_handler()\n{\n global $wpdb;\n\n $table = new Custom_Table_webpinas_glf_Plugin();\n $table->prepare_items();\n\n $message = '';\n if ('delete' === $table->current_action()) {\n $message = '<div class=\"updated below-h2\" id=\"message\"><p>' . sprintf(__('Items deleted: %d', 'custom_table_example'), count($_REQUEST['id'])) . '</p></div>';\n }\n ?>\n\n<div class=\"wrap\">\n\n <div class=\"icon32 icon32-posts-post\" id=\"icon-edit\"><br></div>\n <h2><?php _e('Form Submissions')?> \n <!--<a class=\"add-new-h2\" href=\"<?php echo get_admin_url(get_current_blog_id(), 'admin.php?page=exc_quote_form');?>\"><?php _e('Add new', 'custom_table_example')?></a>-->\n </h2>\n <?php echo $message; ?>\n \n<!--<form method=\"get\">\n <input type=\"hidden\" name=\"page\" value=\"\">\n<?php $table->dropdown_search_user( __( 'Search User' ), 'user_sort' ); ?>\n</form>-->\n\n <form id=\"persons-table\" method=\"GET\">\n <input type=\"hidden\" name=\"page\" value=\"<?php echo $_REQUEST['page'] ?>\"/>\n <?php $table->display() ?>\n </form>\n\n</div>\n\n<?php \n}",
"function setup_simple_content_table() {\n global $wpdb;\n\n $table_name = $wpdb->prefix . 'content_submissions';\n\n $sql = \"CREATE TABLE $table_name (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n name varchar (100) NOT NULL,\n email varchar (100) NOT NULL,\n content varchar (200) NOT NULL,\n PRIMARY KEY (id)\n )\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta($sql);\n}",
"function admin_section_builder($data,$args) {echo '<div class=\"options-description\" style=\"padding:10px; line-height: 1.6;\">' . $args['args']['description'] . '</div><table class=\"form-table\">'; do_settings_fields( $this->page, $args['args']['section'] ); echo '</table>';}"
] |
[
"0.6591094",
"0.61715096",
"0.6156237",
"0.6092518",
"0.60669553",
"0.59770477",
"0.59765005",
"0.59390235",
"0.59026706",
"0.58977324",
"0.5891201",
"0.5879989",
"0.58726436",
"0.58600616",
"0.58331716",
"0.5828439",
"0.57974696",
"0.5772282",
"0.5764522",
"0.5709216",
"0.570684",
"0.57010746",
"0.5700607",
"0.5695056",
"0.5692258",
"0.5673637",
"0.5667835",
"0.5666132",
"0.5642842",
"0.563668"
] |
0.76299745
|
0
|
Utility function to execute curl and create capture response information.
|
private function exec_curl( $ch ) {
$response = array();
$response[ 'body' ] = curl_exec( $ch );
$response[ 'status' ] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$this->log( 'exec_curl response: ' . print_r( $response, true ) );
curl_close( $ch );
return $response;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function parse_curl_response()\n {\n $this->status_code = curl_getinfo($this->curl_handle, CURLINFO_HTTP_CODE);\n #$this->http_info = array_merge($this->http_info, curl_getinfo($this->curl_handle));\n\n $header_size = curl_getinfo($this->curl_handle, CURLINFO_HEADER_SIZE);\n\n // Capture the HTTP response headers\n $this->http_response_headers = substr($this->curl_response, 0, $header_size);\n\n // Capture the HTTP response body\n $this->http_body = substr($this->curl_response, $header_size);\n\n if(!$this->do_not_exit)\n {\n $this->_check_valid_response($this->http_body);\n }\n //close connection\n curl_close($this->curl_handle);\n }",
"protected function _exec() {\r\n $response = curl_exec($this->_curl);\r\n $httpStatusCode = $this->getOption(CURLINFO_HTTP_CODE);\r\n $httpError = in_array(floor($httpStatusCode / 100), array(4, 5));\r\n if($httpError) {\r\n $this->_error = \"Http Error Status Code {$httpStatusCode}\";\r\n }\r\n\r\n $curlError = !(curl_errno($this->_curl) === 0);\r\n if($curlError) {\r\n $this->_error = curl_error($this->_curl);\r\n }\r\n return $response;\r\n }",
"public function sendCurl() {\n\t\t$this->curlResponse = $this->curl->exec();\n\t}",
"function basicCurl($curlURL) {\n $url = $curlURL;\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_URL, $url);\n curl_setopt($cURL, CURLOPT_HTTPGET, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ));\n curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($cURL, CURLOPT_USERAGENT, \"spider\");\n $result = curl_exec($cURL);\n \nif ($result === FALSE) {\n return \"cURL Error: \" . curl_error($cURL);\n} else {\n\treturn $result;\n}\n curl_close($cURL);\n \n}",
"function __curl_exec($req) {\n\t\t\tcurl_setopt($req, CURLOPT_FOLLOWLOCATION, FALSE);\n\t\t\tcurl_setopt($req, CURLOPT_HEADER, TRUE);\n\t\t\tcurl_setopt($req, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t\t$data = curl_exec($req);\n\t\t\t$code = curl_getinfo($req, CURLINFO_HTTP_CODE);\n\t\t\t\n\t\t\t/* get the header and body */\n\t\t\tlist($header, $body) = explode(\"\\r\\n\\r\\n\", $data);\n\n\t\t\tif ($code >= 300) {\n\t\t\t\t/* error result, throw an exception */\n\t\t\t\tthrow new Exception(\"HTTP Result $code:\\n\". $data);\n\t\t\t}\n\t\t\t\n\t\t\t/* return code, header and body */\n\t\t\treturn Array($code, $body, $header);\n\t\t}",
"function run_curl($p_path) {\r\n\r\n global $CURL_OPTIONS;\r\n\r\n $tp_result = array();\r\n $tp_curl = curl_init($p_path);\r\n curl_setopt_array($tp_curl, $CURL_OPTIONS);\r\n $tp_result['content'] = curl_exec($tp_curl);\r\n $tp_result['code'] = curl_getinfo($tp_curl, CURLINFO_HTTP_CODE);\r\n curl_close($tp_curl);\r\n return $tp_result;\r\n\r\n}",
"function execCurl($url) {\n\t//echo \"<br> URL: $url <br>\";\n\t\n\t$curl = curl_init();\n\t\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_RETURNTRANSFER => true,\n\t\tCURLOPT_HEADER => false)\n\t);\n\t\n\t$curl_response = curl_exec($curl);\n\t\n\t$curl_errno = curl_errno($curl);\n $curl_error = curl_error($curl);\n\t\n\tif (curl_error($curl) || $curl_response === false || $curl_errno > 0)\n {\n $info = curl_getinfo($curl);\n echo 'error occured during curl exec - ' . var_export($info) ;\n echo '<br> error -----------> '. $curl_error; \n curl_close($curl);\n }\n \n curl_close($curl);\n\treturn $curl_response;\n}",
"protected function execCurl() \n\t{\t\t\t\n\t\tif ( $this->sandbox == true )\n\t\t{\n\t\t\t$server = $this->_server['sandbox'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$server = $this->_server['live'];\n\t\t}\n\n\t\t$url = $server . $this->adhocPostUrl;\n\t\t\n\t\t$headers = array(\n\t\t\t'Content-type: application/x-www-form-urlencoded',\n\t\t\t'Authorization: GoogleLogin auth=' . $this->getAuthToken(),\n\t\t\t'developerToken: ' . $this->developerToken,\n\t\t\t'clientCustomerId: ' . $this->clientCustomerId,\n\t\t\t'returnMoneyInMicros: true',\n\t\t\t\t\t\t\n\t\t);\n\n\t\t$data = '__rdxml=' . urlencode( $this->__rdxml );\n\t\t\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_POST, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $data );\n\t\tcurl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE );\n\t\tcurl_setopt( $ch, CURLOPT_HEADER, FALSE );\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, TRUE );\n\t\tcurl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );\n\t\t\n\t\t$response = curl_exec( $ch );\n\t\t$httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\t$error = curl_error( $ch );\n\t\tcurl_close( $ch );\n\t\t\n\t\tif( $httpCode == 200 || $httpCode == 403 )\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( !empty( $error ) )\n\t\t\t{\n\t\t\t\tthrow new exception( $httpCode . ' - ' . $error );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new exception( $httpCode . ' - Unknow error occurred while post operation.' ); \n\t\t\t}\n\t\t}\n\t}",
"function funExecuteCurl($ch){\n return curl_exec($ch);\n\n}",
"public function execute() {\n $body = curl_exec($this->_handle); \n $status = curl_getinfo($this->_handle, CURLINFO_HTTP_CODE);\n return array(\n 'body' => $body,\n 'status' => $status\n );\n }",
"function curl_URL_call($url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $output;\n}",
"function exec() {\r\n return curl_exec($this->curl);\r\n }",
"function curlWrap($url, $json)\n{\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n curl_setopt($ch, CURLOPT_URL, ZDURL . $url);\n curl_setopt($ch, CURLOPT_USERPWD, ZDUSER . \"/token:\" . ZDAPIKEY);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-type: application/json'\n ));\n curl_setopt($ch, CURLOPT_USERAGENT, \"MozillaXYZ/1.0\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\n $info = curl_getinfo($ch);\n $output = curl_exec($ch);\n curl_close($ch);\n $decoded = json_decode($output);\n return $decoded;\n\n $info = curl_getinfo($ch);\n return $info;\n\n}",
"public function exec()\n {\n return curl_exec($this->curl);\n }",
"public function exec()\n {\n return curl_exec($this->curl);\n }",
"public function execQuery()\n{\n\n $url = $this->getURL();\n // create curl resource \n $ch = curl_init(); \n\n //return the transfer as a string \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt( $ch, CURLOPT_USERAGENT, \"MyUserAgent\" );\n\n // set url \n curl_setopt($ch, CURLOPT_URL, $url);\n\n // $output contains the output string \n $result = curl_exec($ch); \n\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); \n\n // Check if any error occurred\n if(curl_errno($ch))\n {\n echo 'Curl error: ' . curl_error($ch);\n }\n // close curl resource to free up system resources \n curl_close($ch); \n\n return $result;\n}",
"function http_response($url, $opts = array()) {\n $url = preg_replace('/ /', '%20', $url);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_USERAGENT, \"uw_transparancy, toolserver.org wikiproject parser\");\n $output = curl_exec($ch);\n // Check for errors\n if (curl_errno($ch)) {\n wpLog(\"Curl error: \" . curl_error($ch));\n return http_response($url);\n }\n\n curl_close($ch);\n\n return $output;\n}",
"protected function _ProcessDataCurl(){\n\t\t$url = $this->_url;\n\t\t$args = $this->_args;\n\t\t$encod = isset($args['encod']) ? $args['encod'] : \"gzip\";\n\t\t$timeout_con = isset($args['timeout_con']) ? $args['timeout_con'] : 5;\n\t\t$timeout_res = isset($args['timeout_res']) ? $args['timeout_res'] : 10;\n\t\t$max_redir = isset($args['max_redir']) ? $args['max_redir'] : 3;\n\n\t\tif($url == false){\n\t\t\treturn null;\n\t\t}\n\t\telse{\n\t\t\t$options = array(\n\t\t\t\tCURLOPT_RETURNTRANSFER => true, // return web page\n\t\t\t\tCURLOPT_HEADER => false, // don't return headers\n\t\t\t\tCURLOPT_FOLLOWLOCATION => true, // follow redirects\n\t\t\t\tCURLOPT_ENCODING => $encod, // handle all encodings\n\t\t\t\tCURLOPT_AUTOREFERER => true, // set referer on redirect\n\t\t\t\tCURLOPT_CONNECTTIMEOUT => $timeout_con, // timeout on connect\n\t\t\t\tCURLOPT_TIMEOUT => $timeout_res, // timeout on response\n\t\t\t\tCURLOPT_MAXREDIRS => $max_redir, // stop after 10 redirects\n\t\t\t\tCURLOPT_SSL_VERIFYHOST => 0, // disable SSL verification host\n\t\t\t\tCURLOPT_SSL_VERIFYPEER => false, // skip SSL verifier\n\t\t\t);\n\n\t\t\t$curl = curl_init();\n\t\t\t\n\t\t\tif(isset($args['uAgent'])){\n\t\t\t\t$options[CURLOPT_USERAGENT] = $args['uAgent']; // who am i\n\t\t\t}\n\n\t\t\tif(isset($args['refer'])){\n\t\t\t\t$options[CURLOPT_REFERER] = $args['refer']; // detect domain come from request\n\t\t\t}\n\n\t\t\tif(isset($args['auth'])){\n\t\t\t\t$options[CURLOPT_USERPWD] = $args['auth']; // detect domain come from request\n\t\t\t\t$options[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC; // set HTTP authorization\n\t\t\t}\n\n\t\t\t$options[CURLOPT_URL] = $url; \n\t\t\tcurl_setopt_array($curl, $options);\n\n\t\t\t$result = curl_exec($curl);\n\n\t\t\tif($result !== false){\n\n\t\t\t\t$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); \n\n\t\t\t\tif( in_array($statusCode, range(200,306)) ){\n\t\t\t\t\treturn $result;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tcurl_close($curl);\n\t\t}\n\t}",
"function curl($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $output = curl_exec($ch); \n curl_close($ch); \n return $output;\n}",
"private static function execCurl($full_url, $type,\n $headers, $post_data = null) {\n $curl_request = self::getCurlRequestType($type);\n\n if ($post_data !== null) {\n if ($type !== 'POST') {\n throw new Exception('Cannot post field data with non-POST request!');\n }\n }\n\n $session = curl_init($full_url);\n curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($session, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($session, $curl_request, true);\n if ($post_data !== null) {\n curl_setopt($session, CURLOPT_POSTFIELDS, $post_data);\n }\n\n // Do it\n $server_output = curl_exec($session);\n curl_close($session);\n\n if ($server_output === false) {\n throw new Exception(\"Couldn't make cURL request!\");\n }\n\n return $server_output;\n }",
"function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL \n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL \n return $data; // Returning the data from the function \n }",
"function curlGet($url){\n $ch = curl_init();\n\n //setting curl options\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_URL, $url);\n /*\n Additional curl_setopt\n CURLOPT_USERAGENT \n CURLOPT_HTTPHEADER\n */\n $result = curl_exec($ch);\n \n //$httpResponse = curl_getinfo($ch,CURLINFO_HTTP_CODE);\n //echo $httpResponse;\n\n curl_close($ch);\n return $result;\n }",
"function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n CURLOPT_SSL_VERIFYPEER => false,\n //CURLOPT_HTTPHEADER => array('Content-type: \"text/plain; charset=UTF-8\"'),\n );\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }",
"function curl($url, $post_fields = null, $return_headers = false)\n {\n global $standard_headers;\n global $cookie;\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $standard_headers);\n curl_setopt($ch, CURLOPT_COOKIE, $cookie);\n\n if($return_headers == true) {\n curl_setopt($ch, CURLOPT_HEADER, 1);\n }\n\n if(!is_null($post_fields)) {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_fields));\n } else {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n }\n\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }",
"function curl($url,$opt=[],$curl_info=false){\n $ch = curl_init();\n//2.设置URL和相应的选项\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n if(!empty($opt)){\n curl_setopt_array($ch,$opt);\n }\n//3.抓取URL并把它传递给浏览器\n $res = curl_exec($ch);\n// echo curl_getinfo($ch)['total_time'].'<br/>';\n\n if($curl_info === true){\n return curl_getinfo($ch);\n }\n //4.关闭cURL资源,并且释放系统资源\n curl_close($ch);\n return json_decode($res,true);\n}",
"function curl_query($curl) {\n $response = curl_exec($curl);\n\n if (!is_string($response)) {\n error('Failed to execute cURL query for ' . spy($curl) . '.');\n }\n\n return $response;\n}",
"function doCurl ($url, $options) {\n\tglobal $adminName, $adminPass, $verbose, $doe;\n\t\n\t$options = $options +\n\t\t\t array(CURLOPT_RETURNTRANSFER => true,\n\t\t\t\t\t CURLOPT_USERPWD => $adminName . \":\" . $adminPass,\n\t\t\t\t\t CURLOPT_HTTPHEADER => array('OCS-APIRequest:true', 'Accept: application/json'),\n\t\t\t );\n\n\tif ($verbose > 2) {\n\t\t$options = $options +\n\t\t\t\t array(CURLOPT_VERBOSE => TRUE,\n\t\t\t\t\t\t CURLOPT_HEADER => TRUE\n\t\t\t\t );\n\t}\n\n\t$ch = curl_init($url);\n\n \tcurl_setopt_array( $ch, $options);\n\t\n// For use with Charles proxy:\n// \tcurl_setopt($ch, CURLOPT_PROXYPORT, '8888');\n// \tcurl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');\n// \tcurl_setopt($ch, CURLOPT_PROXY, '127.0.0.1');\n\n $response = curl_exec($ch);\n //print_r($response);\n $response = json_decode($response);\n //print_r($response);\n\n $statuscode = $response->{'ocs'}->{'meta'}->statuscode;\n\n \n if($statuscode != \"100\"){\n echo $statuscode;\n echo $response->{'ocs'}->{'meta'}->message;\n return $statuscode;\n exit(1);\n }\n\n if($response === false) {\n echo 'Curl error: ' . curl_error($ch) . \"\\n\";\n\t\texit(1);\n\t}\n\t\n\tcurl_close($ch);\n \n\t/* An error causes an exit\n\tif (preg_match(\"~<statuscode>(\\d+)</statuscode>~\", $response, $matches)) {\n $responseCode = $matches[1]; // what's the status code\n //echo $matches[3];\n //echo \"<h3>\" . $response . \"</h3>\";\n if ($responseCode == '404') {\n return \"2\";\n exit(2);\n } elseif ($responseCode != '100') {\n echo \"1Error response code; exiting\\n$response\\n\";\n\t\t\texit(1);\n\t\t}\n\t}\n\telse { // something is definitely wrong\n echo \"No statuscode response; exiting:\\n$response\\n\";\n \n\t\texit(1);\n\t}\n */\n\t// What sort of response do we want to give\n//\tif ($verbose == 1) { echo \"Response code from server: $responseCode\\n\"; }\n\t//if ($verbose == 1) { echo \"\\n\"; }\n\t//if ($verbose > 1) { echo \"Response from server:\\n$response\\n\\n\"; }\n\n\treturn $response;\n}",
"private function execute() {\n\t\t// Max exec time of 1 minute.\n\t\tset_time_limit(60);\n\t\t// Open cURL request\n\t\t$curl_session = curl_init();\n\n\t\t// Set the url to post request to\n\t\tcurl_setopt ($curl_session, CURLOPT_URL, $this->url);\n\t\t// cURL params\n\t\tcurl_setopt ($curl_session, CURLOPT_HEADER, 0);\n\t\tcurl_setopt ($curl_session, CURLOPT_POST, 1);\n\t\t// Pass it the query string we created from $this->data earlier\n\t\tcurl_setopt ($curl_session, CURLOPT_POSTFIELDS, $this->curl_str);\n\t\t// Return the result instead of print\n\t\tcurl_setopt($curl_session, CURLOPT_RETURNTRANSFER,1);\n\t\t// Set a cURL timeout of 30 seconds\n\t\tcurl_setopt($curl_session, CURLOPT_TIMEOUT,30);\n\t\tcurl_setopt($curl_session, CURLOPT_SSL_VERIFYPEER, FALSE);\n\n\t\t// Send the request and convert the return value to an array\n\t\t$response = preg_split('/$\\R?^/m',curl_exec($curl_session));\n\n\t\t// Check that it actually reached the SagePay server\n\t\t// If it didn't, set the status as FAIL and the error as the cURL error\n\t\tif (curl_error($curl_session)){\n\t\t\t$this->status = 'FAIL';\n\t\t\t$this->error = curl_error($curl_session);\n\t\t}\n\n\t\t// Close the cURL session\n\t\tcurl_close ($curl_session);\n\n\t\t// Turn the response into an associative array\n\t\tfor ($i=0; $i < count($response); $i++) {\n\t\t\t// Find position of first \"=\" character\n\t\t\t$splitAt = strpos($response[$i], '=');\n\t\t\t// Create an associative array\n\t\t\t$this->response[trim(substr($response[$i], 0, $splitAt))] = trim(substr($response[$i], ($splitAt+1)));\n\t\t}\n\n\t\t// Return values. Assign stuff based on the return 'Status' value from SagePay\n\t\tswitch($this->response['Status']) {\n\t\t\tcase 'OK':\n\t\t\t\t// Transactino made succssfully\n\t\t\t\t$this->status = 'success';\n\t\t\t\t$_SESSION['transaction']['VPSTxId'] = $this->response['VPSTxId']; // assign the VPSTxId to a session variable for storing if need be\n\t\t\t\t$_SESSION['transaction']['TxAuthNo'] = $this->response['TxAuthNo']; // assign the TxAuthNo to a session variable for storing if need be\n\t\t\t\tbreak;\n\t\t\tcase '3DAUTH':\n\t\t\t\t// Transaction required 3D Secure authentication\n\t\t\t\t// The request will return two parameters that need to be passed with the 3D Secure\n\t\t\t\t$this->acsurl = $this->response['ACSURL']; // the url to request for 3D Secure\n\t\t\t\t$this->pareq = $this->response['PAReq']; // param to pass to 3D Secure\n\t\t\t\t$this->md = $this->response['MD']; // param to pass to 3D Secure\n\t\t\t\t$this->status = '3dAuth'; // set $this->status to '3dAuth' so your controller knows how to handle it\n\t\t\t\tbreak;\n\t\t\tcase 'REJECTED':\n\t\t\t\t// errors for if the card is declined\n\t\t\t\t$this->status = 'declined';\n\t\t\t\t$this->error = 'Your payment was not authorised by your bank or your card details where incorrect.';\n\t\t\t\tbreak;\n\t\t\tcase 'NOTAUTHED':\n\t\t\t\t// errors for if their card doesn't authenticate\n\t\t\t\t$this->status = 'notauthed';\n\t\t\t\t$this->error = 'Your payment was not authorised by your bank or your card details where incorrect.';\n\t\t\t\tbreak;\n\t\t\tcase 'INVALID':\n\t\t\t\t// errors for if the user provides incorrect card data\n\t\t\t\t$this->status = 'invalid';\n\t\t\t\t$this->error = 'One or more of your card details where invalid. Please try again.';\n\t\t\t\tbreak;\n\t\t\tcase 'FAIL':\n\t\t\t\t// errors for if the transaction fails for any reason\n\t\t\t\t$this->status = 'fail';\n\t\t\t\t$this->error = 'An unexpected error has occurred. Please try again.';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// default error if none of the above conditions are met\n\t\t\t\t$this->status = 'error';\n\t\t\t\t$this->error = 'An error has occurred. Please try again.';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// set error sessions if the request failed or was declined to be handled by controller\n\t\tif($this->status !== 'success') {\n\t\t\t$_SESSION['error']['status'] = $this->status;\n\t\t\t$_SESSION['error']['description'] = $this->error;\n\t\t}\n\t}",
"public function curl_scrap() {\n\t\tif (!isset($this->url)) return false;\n\n\t\t$curl_session = curl_init($this->url);\n\n\t\t// CURLOPT_RETURNTRANSFER this option means that the curl_exec must put the output in a var instead of only printing it.\n\t\tcurl_setopt($curl_session, CURLOPT_RETURNTRANSFER, true);\n\n\t\t// CURLOPT_FILETIME this option means that the scraping will occur whilst retrieving the modification time of the remote file scrapped\n\t\tcurl_setopt($curl_session, CURLINFO_FILETIME, true);\n\t\t\n\t\t$scrapped_page = curl_exec($curl_session);\n\t\tif (curl_errno($curl_session))\n\t\t\t//kill the script and throw an error if there is an error in curl_exec;\n\t\t\tdie('An error occured while scraping: '.$this->url.' ERROR::'. curl_error($curl_session).\"\\n\");\n\n\t\t$filetime = curl_getinfo($curl_session, CURLINFO_FILETIME); //unix time or -1 if undef\n\t\tcurl_close($curl_session);\n\n\t\treturn $scrapped_page? array(\n\t\t\t\t\t'scrapped_page' => $scrapped_page,\n\t\t\t\t\t'filetime' => $filetime,\n\t\t\t\t):\n\t\t\t\tfalse;\n\t}",
"private function sendCurl($url) {\n $handle = curl_init();\n $opts = curl_setopt_array($handle, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://' . $url . \"&method=CURL\",\n CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $this->payload\n ));\n // Send the request & save response to $resp\n $exec = curl_exec($handle);\n // Close request to clear up some resources\n $close = curl_close($handle);\n\n //$json_array = json_decode($exec, TRUE);\n\n if($this->testing) echo \"<hr /><h1>JSON RESPONSE:</h1><br />$exec <hr />\";\n }"
] |
[
"0.6846617",
"0.64879614",
"0.6458604",
"0.64372385",
"0.6312255",
"0.6312213",
"0.62336046",
"0.62167",
"0.6101748",
"0.60895234",
"0.60843015",
"0.60774344",
"0.6070913",
"0.60644186",
"0.60644186",
"0.6047771",
"0.6042505",
"0.6037466",
"0.6030119",
"0.60188067",
"0.5994329",
"0.598451",
"0.5970985",
"0.5960502",
"0.5950166",
"0.5937642",
"0.5935008",
"0.5926581",
"0.5923838",
"0.59231764"
] |
0.6531995
|
1
|
adds `provisionwith` option to vagrant provision
|
public function provisionWith($provisioners)
{
$this->option('--provision-with ' . $provisioners);
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setProvisionbrutto($provisionbrutto)\n {\n $this->provisionbrutto = $provisionbrutto;\n return $this;\n }",
"public function setProvisionAmount(float $provision_amount): self\n {\n $this->provision_amount = $provision_amount;\n\n return $this;\n }",
"public function provision($request);",
"public function provision(): Status;",
"protected function configure()\n {\n $this->addOption(\n 'v|version', '-s',\n 'The version of the template that is to be installed; optional if '\n .'project is installed with PEAR'\n );\n }",
"public function activateVersionPress()\n {\n $activateCommand = 'wp plugin activate versionpress';\n $this->exec($activateCommand);\n }",
"public function setProvisionTeilen(\\MediaStoreNet\\OpenImmo\\Classes\\ProvisionTeilen $provisionTeilen)\n {\n $this->provisionTeilen = $provisionTeilen;\n return $this;\n }",
"function configure_propack() {\n global $quotepress_plugin;\n $quotepress_plugin->propack_enabled = true;\n }",
"public function provision()\n {\n $this->assignRootPassword();\n\n $databaseInstanceConfig = new DatabaseInstanceConfig($this);\n\n $operation = $this->client()->createDatabaseInstance($databaseInstanceConfig);\n $this->update(['operation_name' => $operation['name']]);\n\n $this->setCreating();\n\n MonitorDatabaseInstanceCreation::dispatch($this);\n }",
"public function initializeVersionPress()\n {\n $this->runWpCliCommand('plugin', 'activate', ['versionpress']);\n $this->runWpCliCommand('vp', 'activate', ['yes' => null]);\n }",
"public function setProvisionnetto(\\MediaStoreNet\\OpenImmo\\Classes\\Provisionnetto $provisionnetto)\n {\n $this->provisionnetto = $provisionnetto;\n return $this;\n }",
"function wpcom_vip_add_loaded_plugin( $plugin ) {\n\tglobal $vip_loaded_plugins;\n\n\tif ( ! isset( $vip_loaded_plugins ) )\n\t\t$vip_loaded_plugins = array();\n\n\tarray_push( $vip_loaded_plugins, $plugin );\n}",
"public function up() {\n\n\t\tif ( $this->skip_this_migration ) {\n\t\t\tEE::debug( 'Skipping add-ext-config-8.0 update migration as it is not needed.' );\n\n\t\t\treturn;\n\t\t}\n\n\t\t$os = php_uname( 'v' );\n\t\t$ip_command_present = EE::launch( 'command -v ip' )->return_code === 0;\n\n\t\tif ( ( strpos( $os, 'Ubuntu') !== false || strpos( $os, 'Debian' ) !== false )\n\t\t\t&& ! $ip_command_present ) {\n\t\t\tEE::exec( 'bash -c \\'if command -v apt; then apt install -y iproute2; fi\\'' );\n\t\t}\n\t}",
"public function installVirtuoso()\n {\n $this->span(\"Option not supported for this Linux distribution and version.\", 'error');\n }",
"public function up()\n {\n // Client ID of Vimeo app\n Config::get()->create('VIMEO_CLIENT_ID', [\n 'value' => '',\n 'type' => 'string',\n 'range' => 'global',\n 'section' => 'externalvideos',\n 'description' => 'Client-ID der in Vimeo erstellten App'\n ]);\n // Client ID of Vimeo app\n Config::get()->create('VIMEO_CLIENT_SECRET', [\n 'value' => '',\n 'type' => 'string',\n 'range' => 'global',\n 'section' => 'externalvideos',\n 'description' => 'Client Secret der in Vimeo erstellten App'\n ]);\n // Authorization code as provided by Vimeo after OAuth authorization\n Config::get()->create('VIMEO_AUTHORIZATION_CODE', [\n 'value' => '',\n 'type' => 'string',\n 'range' => 'global',\n 'section' => 'externalvideos',\n 'description' => 'OAuth-Code bei erfolgter Authentifizierung'\n ]);\n // Authorization code as provided by Vimeo after OAuth authorization\n Config::get()->create('VIMEO_ACCESS_TOKEN', [\n 'value' => '',\n 'type' => 'string',\n 'range' => 'global',\n 'section' => 'externalvideos',\n 'description' => 'Access Token zur Authentifizierung bei Vimeo'\n ]);\n // Callback URL for authentication requests\n Config::get()->create('VIMEO_CALLBACK_URL', [\n 'value' => URLHelper::getLink('plugins.php/externalvideos/vimeo/callback'),\n 'type' => 'string',\n 'range' => 'global',\n 'section' => 'externalvideos',\n 'description' => 'Callback URL nach erfolgter Authentifizierung'\n ]);\n }",
"public function configurePackage(Package $package): void\n {\n $package\n ->name('laravel-viper')\n ->hasConfigFile(\"viper\")\n ->hasCommand(ViperLogin::class)\n ->hasCommand(ViperRefresh::class);\n\n $this->app->alias(LaravelViper::class, 'laravel-viper');\n\n $this->app->singleton(ViperConfig::class, function () {\n return new LaravelViperConfig(strval(config('viper.api_token')));\n });\n }",
"public function setProvisionspflichtig($provisionspflichtig)\n {\n $this->provisionspflichtig = $provisionspflichtig;\n return $this;\n }",
"public function setProvincia($provincia) {\n\t\t$this->provincia = $provincia;\n\t}",
"protected function configure()\n {\n $this->setName('networking:initcms:install')\n ->setDescription(\n \"Install the Networking Init cms: create update schema, load fixtures, create super user, dump assetic resources\"\n )\n ->addOption('username', '', InputOption::VALUE_REQUIRED, 'username of the to be created super user')\n ->addOption('email', '', InputOption::VALUE_REQUIRED, 'the email address of the to be created super user')\n ->addOption('password', '', InputOption::VALUE_REQUIRED, 'password of the to be created super user');\n\n }",
"protected function configure()\n {\n $this->setName('tangoman:privileges')\n ->setDescription('Creates default privileges');\n }",
"protected function configure(): void\n {\n parent::configure();\n\n $this->setName('data-fixture:import')\n ->setDescription('Import Data Fixtures')\n ->setHelp('The import command Imports data-fixtures')\n ->addOption('append', null, InputOption::VALUE_NONE, 'Append data to existing data.');\n\n if (null !== $this->purger) {\n $this->addOption(\n 'purge-with-truncate',\n null,\n InputOption::VALUE_NONE,\n 'Truncate tables before inserting data'\n );\n }\n }",
"public function appendValueSetProvisions(\\Amp\\Validator\\ValueSetProvision $value)\n {\n return $this->append(self::VALUE_SET_PROVISIONS, $value);\n }",
"function install_new_vps($IDVPS, $connection, $OS, $hostname, $disque, $ip, $swap, $memoire, $cpu, $passroot)\n{\n\t//On suprrime et r�installe le serveur--------------------------------------------------------------------------------\n\t\n\t//Commande � ex�cuter\n\t//$command = '/usr/bin/pvectl vzcreate '.$IDVPS.' --disk '.$disque.' --ostemplate '.$OS.' --hostname '.$hostname.' --nameserver 127.0.0.1 --nameserver 213.186.33.99 --searchdomain ovh.net --onboot no --ipset '.$ip.' --swap '.$swap.' --mem '.$memoire.' --cpus '.$cpu.' && vzctl restart '.$IDVPS.' && vzctl set '.$IDVPS.' --userpasswd root:'.$passroot;\n$command='/usr/bin/pvectl create -vmid '.$IDVPS.' -ostemplate '.$OS.' -disk '.$disque.' -hostname '.$hostname.' -nameserver 156.154.70.1 -nameserver 156.154.71.1 -searchdomain heberge-hd.net -onboot 1 -ip_address '.$ip.' -swap '.$swap.' -memory '.$memoire.' -cpus '.$cpu.' -password '.$passroot.' && sleep 10 && vzctl start '.$IDVPS;\n$command0='sleep 10 && vzctl exec '.$IDVPS.' echo -e \"auto eth0 \\niface eth0 inet static \\n\\taddress '.$ip.' \\n\\tnetmask 255.255.255.0 \\n\\tgateway 192.168.5.1 \\n\\tbroadcast 192.168.5.255\" > /etc/network/interfaces';\n\n //On lance la commande\n $stream = ssh2_exec($connection, $command);\n stream_set_blocking($stream, true);\n\n $stream0 = ssh2_exec($connection, $command0);\n stream_set_blocking($stream0, true);\n\t//R�cup�re le r�sultat\n\t$rep=\"\";\n\twhile($line = fgets($stream)){\n\t\t$rep.=$line;\t\n\t}\n\t//Ferme la connection\n\tfclose($stream);\n\tfclose($stream0);\n\n\t\n\tif($stream!=false){\n\t\treturn true;\n\t}else{$ok=stripos($rep,\"Container start in progress\");\n\t$time=time();\n\t$message = mysql_real_escape_string('Le '.date('d/m/y - H:i:s').' le VPS '.$hostname.' ('.$IDVPS.') est passer en erreur lors de sa réinstallation.\n\t\tVoici le message : '.$rep.'\n\n\t\tCommande : \n\t\t'.$command_stop.'');\n\t$IDVPS = mysql_real_escape_string($IDVPS);\n\t$time = mysql_real_escape_string($time);\n\tmysql_query(\"INSERT INTO `warning` ( `id` , `id_client` , `ip` , `message` , `page` , `time` , `type`, `TYPE_W`)\nVALUES (\nNULL , '\".$IDVPS.\"', 'IP', '\".$message.\"', '', '\".$time.\"', 'W_ERREUR_SETUP_VPS', 'VPS'\n)\");\n\t\treturn false;\n\t}\n\t\n}",
"function harvest_handle_on_project_options(&$options, &$project, &$logged_user)\n{\n\tif($logged_user->getSystemPermission('can_submit_harvest') && $logged_user->getSystemPermission('project_management'))\n\t{\n\t\t$options->add('harvest', array\n\t\t(\n\t\t\t'text'\t=> lang('Harvest Settings'),\n\t\t\t'url'\t=> assemble_url('project_harvest', array('project_id' => $project->getId())),\n\t\t));\n\t}\n}",
"public function configure()\n {\n $this->setName('reserve:all')\n ->setDescription('Generate backups of your folders and databases.')\n ->addOption('folders', 'f', InputOption::VALUE_NONE, 'Don\\'t include folders.')\n ->addOption('bzip', 'b', InputOption::VALUE_NONE, 'Use bzip to archive folders.')\n ->addOption('databases', 'd', InputOption::VALUE_NONE, 'Don\\'t include databases.')\n ->addOption('gzip', 'g', InputOption::VALUE_NONE, 'Use gzip to archive databases.')\n ->addOption('all', 'a', InputOption::VALUE_NONE, 'Dump all accessible databases in a single file.');\n }",
"function install() {\n\t\t$config ['username'] = '';\n\t\t$config ['password'] = '';\n\t\t;\n\t\t$config ['signature'] = '';\n\t\t$config ['currency'] = 'EUR'; // default\n\t\t\n\n\t\t$config ['SANDBOX'] = true;\n\t\t\n\t\t$config ['enabled'] = \"0\";\n\t\t\n\t\t//not normally user configurable\n\t\t$config ['return_url'] = \"\";\n\t\t$config ['cancel_url'] = \"\";\n\t\t\n\t\t$this->CI->Settings_model->save_settings ( 'bnp_parisbas', $config );\n\t}",
"function activate() {\n\t\t\tadd_option('h2utp_options', json_encode($this->options));\n\t\t}",
"public function setProvincia($provincia) {\n $this->provincia = $provincia;\n return true;\n }",
"function seed_csp4_activation(){\r\n // Store the plugin version when initial install occurred.\r\n $has_seed_csp4_settings_content = get_option('seed_csp4_settings_content');\r\n if(!empty($has_seed_csp4_settings_content)){\r\n add_option( 'seed_csp4_initial_version', 0, '', false );\r\n }else{\r\n add_option( 'seed_csp4_initial_version', SEED_CSP4_VERSION, '', false );\r\n }\r\n \r\n\r\n // Store the plugin version activated to reference with upgrades.\r\n update_option( 'seed_csp4_version', SEED_CSP4_VERSION, false );\r\n\trequire_once( 'inc/default-settings.php' );\r\n\tadd_option('seed_csp4_settings_content',unserialize($seed_csp4_settings_deafults['seed_csp4_settings_content']));\r\n\tadd_option('seed_csp4_settings_design',unserialize($seed_csp4_settings_deafults['seed_csp4_settings_design']));\r\n\tadd_option('seed_csp4_settings_advanced',unserialize($seed_csp4_settings_deafults['seed_csp4_settings_advanced']));\r\n}",
"function plgVmDeclarePluginParamsPaymentVM3( &$data) {\r\n\t\treturn $this->declarePluginParams('payment', $data);\r\n\t}"
] |
[
"0.49589783",
"0.4847432",
"0.47129634",
"0.46488294",
"0.4540888",
"0.44286418",
"0.4384757",
"0.4332208",
"0.42925835",
"0.4285789",
"0.41738158",
"0.41704994",
"0.41412193",
"0.41329175",
"0.4068883",
"0.40649647",
"0.40228978",
"0.40220764",
"0.39967534",
"0.39946902",
"0.3979429",
"0.39720672",
"0.39681256",
"0.39448032",
"0.39248317",
"0.39113614",
"0.39074457",
"0.39071485",
"0.38902724",
"0.38817143"
] |
0.5853101
|
0
|
Return the default table name for this meta.
|
public function getDefaultTableName(): string
{
return \implode('_', \array_map(function ($element) {
return Str::plural($element);
}, \array_merge(
\is_null($this->getModelGroup()) ? [] : \explode('_', $this->getModelGroup()),
['pivot'],
\explode('_', $this->modelName),
)));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function get_table_name()\n {\n global $table_prefix;\n global $wpdb;\n $prefix = $table_prefix;\n if ($wpdb != null && $wpdb->prefix != null) {\n $prefix = $wpdb->prefix;\n }\n return apply_filters('ngg_datamapper_table_name', $prefix . $this->_object_name, $this->_object_name);\n }",
"function get_table_name() {\n\n\t\tglobal $wpdb;\n\n\t\treturn $wpdb->prefix . $this->table_name;\n\t}",
"public function get_table_name(){\n return $this->table_name();\n }",
"public function get_table_name()\n {\n return $this->prefix . $this->table;\n }",
"public static function getTableName()\n {\n return _DB_PREFIX_ . self::$definition['table'];\n }",
"public static function get_table_name()\n {\n return self::TABLE_NAME;\n }",
"protected function table () : string {\n return $this->guessName();\n }",
"public function get_table_name() {\n return $this->table_name;\n }",
"function get_table_name () {\r\n\t\treturn $this->wpdb->prefix . $this->_table_name;\r\n\t}",
"private static function get_table_name() {\n\n $class = get_called_class();\n\n return strtolower($class);\n\n }",
"protected static function get_table_name() {\n return null;\n }",
"function table_name() {\n\t\tif ($this->table) {\n\t\t\treturn $this->table;\n\t\t} else {\n\t\t\treturn $this->_get_type();\n\t\t}\n\n\t}",
"public static function tablename() {\n return self::TABLE;\n }",
"protected function getTableName(): string {\n return self::TABLE_NAME;\n }",
"public function table() {\n\t\treturn static::$table ?: strtolower(Str::plural(class_basename($this)));\n\t}",
"public function getTableSingular()\n {\n if (($table = Str::snake(class_basename($this))) == 'model' && $this->table) {\n $table = Str::singular($this->table);\n }\n\n return $table;\n }",
"public static function getTableName()\n {\n return self::getConfig()->get('scheme/tableName');\n }",
"public function getTableName(): string\n {\n return $this->tableNames[0];\n }",
"public function getTableName()\n {\n return $this->__get(\"table_name\");\n }",
"public function getTable()\n\t{\n\t\treturn empty($this->table) ? $this->table = Db_Inflector::pluralize($this->getSingular()) : $this->table;\n\t}",
"public function getTableName()\n\t{\n\t\treturn $this->getPrefix().$this->tableName;\n\t}",
"public function getTableName()\n {\n return $this->table_name;\n }",
"public function getTableName()\n {\n return $this->table_name;\n }",
"public function getTableName()\n {\n return $this->table_name;\n }",
"public function getTableName() {\n\t\treturn $this -> _name;\n\t}",
"public function getTableName( )\n {\n return $this->table_name;\n }",
"public function getTableName(){\r\n\t\treturn strtolower(get_class($this));\r\n\t}",
"private static function getTableName() {\n global $wpdb;\n return $wpdb->prefix . self::$NOTIFICATION_TABLE_NAME;\n }",
"public static function getTableName(){\n\t\treturn self::$table_name;\n\t}",
"public function table_name()\n\t{\n\t\treturn $this->table_name;\n\t}"
] |
[
"0.77122426",
"0.762114",
"0.7595007",
"0.7572677",
"0.7562311",
"0.75504106",
"0.75473154",
"0.7510391",
"0.75024724",
"0.74940234",
"0.74703217",
"0.7448616",
"0.74453014",
"0.74388343",
"0.7428446",
"0.74064666",
"0.7391836",
"0.73849016",
"0.7373338",
"0.735044",
"0.7325354",
"0.7293505",
"0.7293505",
"0.7293505",
"0.7283712",
"0.7278474",
"0.72685117",
"0.7264927",
"0.72579616",
"0.7251825"
] |
0.8468371
|
0
|
Indicate the this meta is a pivot one.
|
public function isPivot(): bool
{
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function hasPivotData(): bool;",
"protected function isColumnPivot($column)\n {\n if (!isset($column->relation) || $column->relation != 'pivot') {\n return false;\n }\n\n return true;\n }",
"protected function isColumnPivot($column)\n {\n if (!isset($column->relation) || $column->relation != 'pivot') {\n return false;\n }\n\n return true;\n }",
"function hasMeta() {\n return $this->imageMeta->hasMeta();\n }",
"public function hasModelPivotData(Model $model): bool;",
"public function meta() {\n\t\tif ($this->isEditable()) {\n\t\t\treturn $this->parent->editables($this->parsedVarName);\n\t\t}\n\t\tif ($this->isViewable()) {\n\t\t\treturn $this->parent->viewables($this->parsedVarName);\n\t\t}\n\t\treturn false;\n\t}",
"public function isPivotTable($newStatus = false)\n {\n $oldStatus = $this->isPivotTable;\n\n if (func_num_args()) {\n $this->isPivotTable = $newStatus;\n } // if\n\n return $oldStatus;\n }",
"function is_movie() {\n return is_singular( array( 'movie' ) );\n }",
"public function meta_type();",
"public function getAllowPivotTables(): ?bool {\n $val = $this->getBackingStore()->get('allowPivotTables');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'allowPivotTables'\");\n }",
"public function getPivots(): array\n {\n return $this->pivots;\n }",
"public function exists()\n {\n return ! is_null($this->first([Grammar::VIRTUAL_META_ID_COLUMN]));\n }",
"private function askPivots()\n {\n foreach ($this->generator->pivots as $k => $pivot) {\n //If it's only one choice\n if (count($pivot) == 1) {\n $table = implode(\"_\", $pivot[0]);\n if (!$this->confirm(\"Is `{$table}` a pivot table?\", true)) {\n $this->generator->regulars[] = $table;\n unset($pivot);\n }\n }\n //If there's more than one choice\n else {\n $confirmed = false;\n $uncertain = [];\n\n //First round\n for ($i = 0; $i < count($pivot) && $confirmed; $i++) {\n $table = implode(\"_\", $pivot[$i]);\n if ($this->confirm(\"Is `{$table}` a pivot table?\", true)) {\n $confirmed = true;\n }\n else {\n $uncertain[] = $table;\n }\n }\n\n //Confirmed, forget about the other ones\n if ($confirmed) {\n for ($j = $i+1; $j < count($pivot); $j++) {\n unset($pivot[$j]);\n }\n }\n //None of them are pivots\n else {\n unset($pivot);\n }\n\n //Second round\n $confirmed = false;\n for ($i = 0; $i < count($uncertain) && $confirmed; $i++) {\n $table = $uncertain[$i];\n if ($this->confirm(\"Is `{$table}` a regular table?\", true)) {\n $this->generator->regulars[] = $table;\n $confirmed = true;\n }\n }\n }\n }\n\n //Re-arrange pivots\n foreach ($this->generator->pivots as $k => $pivot) {\n $this->generator->pivots[$k] = array_values($pivot);\n }\n }",
"public function hasMetaTag(): bool\n {\n return $this->hasMeta($this->meta_id);\n }",
"protected function pivotTable()\n {\n return $this->orm->database($this->definition[ORM::R_DATABASE])->table(\n $this->definition[RecordEntity::PIVOT_TABLE]\n );\n }",
"public function needsLaravelModel()\n {\n return !$this->isPivotTable() || count($this->fields) > 2;\n }",
"protected function get_meta_type()\n {\n }",
"protected function get_meta_type()\n {\n }",
"protected function get_meta_type()\n {\n }",
"protected function get_meta_type()\n {\n }",
"function is_video_taxonomy() {\n return is_tax( get_object_taxonomies( 'video' ) );\n }",
"protected abstract function get_meta_type();",
"public function metaable()\n {\n return $this->morphTo();\n }",
"public function addPivot(Pivot $pivot): PivotValueable;",
"public function isPlanificado(){\n return ($this->tipoLote == TipoLote::PLANIFICACION);\n }",
"public function getModelPivotData(Model $model): ?Pivot;",
"public function meta_type()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}",
"public function getPivot() {\n return new_copy($this->pivot_);\n }",
"public function getPivotData(): Collection;",
"public function meta()\n {\n return $this->meta;\n }"
] |
[
"0.71136916",
"0.6319915",
"0.6319915",
"0.5912071",
"0.58999884",
"0.55519456",
"0.5544307",
"0.54494864",
"0.5409153",
"0.5334487",
"0.53322536",
"0.5302813",
"0.52581084",
"0.5199349",
"0.5179676",
"0.5178338",
"0.5145623",
"0.5145623",
"0.5145623",
"0.5145623",
"0.51320475",
"0.50952953",
"0.50892144",
"0.5055708",
"0.50498676",
"0.5048231",
"0.50466865",
"0.5045292",
"0.5038568",
"0.5029522"
] |
0.77967584
|
0
|
Return all foreign pivots.
|
public function getPivots(): array
{
return $this->pivots;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getPersonaPivots()\n {\n return $this->Personas_->merge($this->Parents_);\n }",
"public function objects() {\n \t// return call_user_func_array($this->belongsToMany('Object')->withPivot, static::$pivotColumns);\n return $this->belongsToMany('Object')\n ->withPivot('subdivision', 'time', 'place', 'form');\n }",
"public function pivot()\n {\n $pivot = new Pivot($this->joining, $this->model->connection());\n return new HasMany($this->base, $pivot, $this->foreign_key());\n }",
"public function getPivotData(): Collection;",
"protected function getAliasedPivotColumns()\n {\n $defaults = array (\n $this->foreignKey,\n $this->otherKey\n );\n $columns = array ();\n foreach ( array_merge ( $defaults, $this->pivotColumns ) as $column ) {\n $columns [] = $this->table . '.' . $column . ' as pivot_' . $column;\n }\n return array_unique ( $columns );\n }",
"public function getForeignKeys()\n {\n return $this->parentTable->getColumnForeignKeys($this->name);\n }",
"public function pivot($pivot)\n {\n return $this->pivots($pivot,$pivot);\n }",
"public function getForeignKeys(){\n \n }",
"private function askPivots()\n {\n foreach ($this->generator->pivots as $k => $pivot) {\n //If it's only one choice\n if (count($pivot) == 1) {\n $table = implode(\"_\", $pivot[0]);\n if (!$this->confirm(\"Is `{$table}` a pivot table?\", true)) {\n $this->generator->regulars[] = $table;\n unset($pivot);\n }\n }\n //If there's more than one choice\n else {\n $confirmed = false;\n $uncertain = [];\n\n //First round\n for ($i = 0; $i < count($pivot) && $confirmed; $i++) {\n $table = implode(\"_\", $pivot[$i]);\n if ($this->confirm(\"Is `{$table}` a pivot table?\", true)) {\n $confirmed = true;\n }\n else {\n $uncertain[] = $table;\n }\n }\n\n //Confirmed, forget about the other ones\n if ($confirmed) {\n for ($j = $i+1; $j < count($pivot); $j++) {\n unset($pivot[$j]);\n }\n }\n //None of them are pivots\n else {\n unset($pivot);\n }\n\n //Second round\n $confirmed = false;\n for ($i = 0; $i < count($uncertain) && $confirmed; $i++) {\n $table = $uncertain[$i];\n if ($this->confirm(\"Is `{$table}` a regular table?\", true)) {\n $this->generator->regulars[] = $table;\n $confirmed = true;\n }\n }\n }\n }\n\n //Re-arrange pivots\n foreach ($this->generator->pivots as $k => $pivot) {\n $this->generator->pivots[$k] = array_values($pivot);\n }\n }",
"public function pivot($pivot)\n {\n return $this->pivots($pivot, $pivot);\n }",
"public function getForeignKeys()\n {\n $return = [];\n $table = $this->getName();\n\n /** @var Base $call */\n foreach ($this->getGenericCalls() as $call) {\n if (isset($call->on) && $call->on !== $table) {\n $return[(string)$call->on] = $call;\n } // if\n } // foreach\n\n return $return;\n }",
"public function getPivot() {\n return new_copy($this->pivot_);\n }",
"public function definitions()\n {\n\t\treturn $this->belongsToMany('App\\Definition')->wherePivot('user_id', Auth::id())->orderBy('title');\n }",
"public static function getResolveForeignIdFields();",
"public function pagos()\n {\n return $this->belongsToMany('DSIproject\\Pago', 'alumno_pago')\n ->withPivot('pago')\n ->withTimestamps();\n }",
"public function getForeignReferList()\n\t{\n\t\treturn Yii::app()->db->createCommand()->select('code as key, printable_name as title')->from(self::tableName())->queryAll();\n\t}",
"protected function pivotTable()\n {\n return $this->orm->database($this->definition[ORM::R_DATABASE])->table(\n $this->definition[RecordEntity::PIVOT_TABLE]\n );\n }",
"public function vacant(){\n\n return $this->belongsToMany('App\\Office')\n ->withPivot('user_id','active')\n ->where('user_id','=',null)\n ->leftJoin('users','user_id','users.id')\n ->select('offices.id','offices.name','users.name as pivot_user_name');\n }",
"public function figures() \n {\n return $this->belongsToMany('App\\Models\\WorldExpansion\\Figure', 'event_figures')->withPivot('id');\n }",
"public function listForeignKeys()\n {\n $tables = $this->schema->listTables();\n $foreignKeys = [];\n foreach ($tables as $table) {\n foreach ($table->getForeignKeys() as $foreignKey) {\n array_push($foreignKeys, $foreignKey);\n }\n }\n\n return $foreignKeys;\n }",
"public function domains()\n {\n\t\t// Second argument is the name of pivot table.\n\t\t// Third & forth arguments are the names of foreign keys.\n return $this->belongsToMany('Domain', 'domain_user', 'user_id', 'domain_id')->withTimestamps();\n }",
"public function sigs()\n {\n return $this->belongsToMany('App\\Sig', 'sig_users')\n ->withPivot('main')->withTimestamps();\n }",
"public function getRelAll ()\n {\n \treturn ($this->db_object->getRowsAll (\"Select * from \".$this->table_prefix.$this->quiz_tables['rel']));\n }",
"public function printingTypes() {\n return $this->belongsToMany('Rockit\\Models\\PrintingType', 'printings')->withTrashed()\n ->withPivot('source', 'nb_copies', 'nb_copies_surplus');\n }",
"public function getPersonas()\n {\n $pivot = $this->Personas_->filter(function ($persona) {\n return $persona->approved;\n })->pluckNamed('User');\n $parents = $this->Parents_->filter(function ($persona) {\n return $persona->approved;\n })->pluckNamed('Parent');\n return $pivot->merge($parents);\n }",
"public function get_related_tables(){\n\t\treturn $this->related;\n\t}",
"public function heads()\n {\n return $this->belongsToMany(User::class,'department_head', 'department_id','user_id')\n ->withPivot('main');\n }",
"public function resolve() : array\n {\n $parents = collect(Arr::pluck($this->keys, 'parent'));\n\n return $this->builder->withoutGlobalScopes()->withCount($this->relation)\n ->findMany($parents->pluck('id'))\n ->mapWithKeys(function ($post) {\n $property = \"{$this->relation}_count\";\n\n return [$post->getKey() => $post->{$property}];\n })\n ->all();\n }",
"public function listReferences()\n {\n $schema = $this->fetchDatabase();\n\n $references = $this->fetchAll(\"SELECT\n kcu.referenced_table_name, \n kcu.referenced_column_name,\n kcu.table_name AS foreign_table_name, \n kcu.column_name AS foreign_column_name, \n kcu.constraint_name\n FROM\n information_schema.key_column_usage kcu\n WHERE\n kcu.referenced_table_name IS NOT NULL\n AND kcu.table_schema = '{$schema}'\n ORDER BY kcu.referenced_table_name, kcu.referenced_column_name\n \");\n\n $grouped = [];\n foreach ($references as $reference) {\n $grouped[$reference['referenced_table_name']][] = $reference;\n }\n\n return $grouped;\n }",
"public function relationships()\n {\n return $this->fields->reject(function($field) {\n return is_null($field->type()->getRelationship());\n });\n }"
] |
[
"0.6390487",
"0.6292822",
"0.61611277",
"0.6154115",
"0.60528934",
"0.6041544",
"0.58440846",
"0.58308977",
"0.57660747",
"0.57505405",
"0.5714207",
"0.5631064",
"0.558445",
"0.55488586",
"0.5544954",
"0.5516897",
"0.54478705",
"0.5418862",
"0.5396572",
"0.5379373",
"0.5373691",
"0.5348953",
"0.53331196",
"0.527855",
"0.52756613",
"0.5258859",
"0.52588296",
"0.525491",
"0.52172273",
"0.520828"
] |
0.6858154
|
0
|
protected $player1; protected $player2;
|
public function __construct()
{
$this->matchFinished = false;
//$this->player1 = new Player('A');
//$this->player2 = new Player('B');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function PlayerVO(){ }",
"public function setPlayer(Player $player);",
"public function getPlayer();",
"function __construct($team1, $team2) {\n $this->team1 = $team1;\n $this->team2 = $team2; \n }",
"public function __construct()\n {\n //$this->player=$player;\n //$this->dealer=$dealer;\n $this->deck=new Deck();\n $this->deck->shuffle();\n $this->player= new Player($this->deck);\n $this->dealer= new Dealer($this->deck);\n\n }",
"function __construct($param1, $param2)\n{\npublic $username = \"Guest\";\n}",
"public function get_player_fk(){ return $this->_player_fk; }",
"public function players(){\n return $this->playerX()->merge($this.$this->playerO());\n }",
"public function players()\n {\n return $this;\n }",
"public function player() : Player\n {\n return $this->player;\n }",
"public function player()\n\t{\n\t\treturn $this->belongsTo('App\\Player');\n\t}",
"public function playerX(){\n return $this->hasOne(\"App\\Models\\Auth\\User\", \"id\", \"player_x_id\");\n }",
"public function getPlayers ()\r\n {\r\n return $this->players;\r\n }",
"public function __construct(\\App\\Player $player)\n {\n $this->player = $player;\n }",
"public function player()\n {\n return $this->belongsTo('App\\Player');\n }",
"public function player()\n {\n return $this->belongsTo(Player::class);\n }",
"public function player()\n {\n return $this->belongsTo(Player::class);\n }",
"public function get_players()\n {\n return $this->players;\n }",
"public function getPlayer()\n {\n return $this->player;\n }",
"public function getPlayer()\n {\n return $this->player;\n }",
"public function getPlayer()\n {\n return $this->player;\n }",
"public function __construct()\n {\n $this->cpu = new CPU();\n $this->player = new Player();\n }",
"public function getPlayers();",
"public function getPlayers();",
"public function race_alien()\r\n{\r\n return $this->_race_alien;\r\n}",
"function __construct($player) {\n\t\t\t$this->name = $player['Name'];\n\t\t\t$this->team = $player['Team'];\n\t\t\t$this->gp = $player['GP'];\n\t\t\t$this->min = $player['Min'];\n\t\t\t$this->fg = $player['Pct-FG'];\n\t\t\t$this->pt = $player['Pct-3PT'];\n\t\t\t$this->ft = $player['Pct-FT'];\n\t\t\t$this->rebound = $player['Tot-Rb'];\n\t\t\t$this->ppg = $player['PPG'];\n\t\t\t$this->ast = $player['Ast'];\n\t\t}",
"public function getPlayer()\n\t{\n\t\treturn $this->player;\n\t}",
"public function authPlayer()\n {\n $player = Player::where(array('name'=>Input::get('name'),'password' => md5(Input::get('password'))))->get();\n if($player->isEmpty())\n {\n return \"false\";\n }\n else{\n $playerattr = File::get(public_path().'/playerattr.json');\n $player = $player->toArray();\n foreach(json_decode($playerattr,true) as $key => $value){\n if($value['id'] === $player[0]['id']){\n $player[0]['defence_set_length'] = $value['defence_set_length'];\n break;\n }\n }\n return $player[0];\n }\n }",
"public function getPlayerName(){\n\t\treturn $this->playerName;\n\t}",
"public function getPlayers(): array;"
] |
[
"0.62964076",
"0.60827297",
"0.60610205",
"0.6005266",
"0.597411",
"0.5858223",
"0.5840682",
"0.57526004",
"0.5666428",
"0.566192",
"0.56575936",
"0.5641901",
"0.5600708",
"0.558867",
"0.5580111",
"0.55237764",
"0.55237764",
"0.55211115",
"0.5514331",
"0.5514331",
"0.5514331",
"0.55008096",
"0.5468533",
"0.5468533",
"0.5463051",
"0.5450569",
"0.54380155",
"0.5415491",
"0.53968865",
"0.53783697"
] |
0.64693815
|
0
|
Get questions related to Specific Video Spec NONE
|
public function get_video_question($params, /** @noinspection PhpUnusedParameterInspection */
$options = [])
{
// Validate
$v = $this->validator($params);
$v->set_rules('video_id', '動画ID', 'required');
if (FALSE === $v->run()) {
return $v->error_json();
}
$this->load->model('question_model');
$res = $this->question_model
->with_video_id((int) $params['video_id'])
->all();
return $this->true_json([
'total' => COUNT($res),
'items' => $this->build_responses($res)
]);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getQuestions()\n {\n if (!empty($this->questionsMetadata)) {\n foreach ($this->questions as $question) {\n /** @var Question $question */\n $data = $question->get_data();\n $metadata = $data->get_metadata();\n\n if (!isset($metadata)) {\n $qtype = $data->get_type();\n // HACK: longtextV2 doesn't have a corresponding entity, so force it to use the similar longtext one\n if ($qtype === 'longtextV2') {\n $qtype = 'longtext';\n }\n $metadataClass = '\\\\LearnosityQti\\\\Entities\\\\QuestionTypes\\\\'.$qtype.'_metadata';\n $metadata = new $metadataClass();\n $data->set_metadata($metadata);\n }\n\n $this->populateQuestionMetadata($metadata, $this->questionsMetadata);\n }\n }\n return array_merge(array_values($this->questions), $this->getRubricQuestions());\n }",
"function getQuestions($extra = null) {\n\t\treturn $this->getQuestionsRelatedByQuizId($extra);\n\t}",
"function getQuestions()\n\t{\n\t\treturn $this->aQuestion;\n\t}",
"public function getPreDefinedQuestions()\n {\n return [\n \"1\" => \"Select a Security Question\",\n \"2\" => \"What was your childhood nickname?\",\n \"3\" => \"What is the name of your favorite childhood friend?\",\n \"4\" => \"What was the name of your first stuffed animal?\",\n \"5\" => \"Where were you when you had your first kiss?\",\n \"6\" => \"What is the name of the company of your first job?\",\n \"7\" => \"What was your favorite place to visit as a child?\",\n \"8\" => \"What was your dream job as a child?\",\n \"9\" => \"What is your preferred musical genre?\",\n \"10\" => \"What is your favorite team?\",\n \"11\" => \"What is your father\\\"s middle name?\"\n ];\n }",
"public function getQuestions()\n {\n return $this->questions;\n }",
"public function getQuestions()\n {\n return $this->questions;\n }",
"public function optionalMode(): array\n { \n $rows = $this->conn()\n ->run(\"SELECT \n questions.id, \n questions.question, \n options.content, \n options.is_correct \n FROM questions \n RIGHT JOIN options \n ON options.question_id = questions.id \n LIMIT 40\")\n ->fetchAll(\\PDO::FETCH_ASSOC);\n \n $questions = [];\n\n foreach($rows as $row){ \n $questions[$row['id']]['question'] = $row['question'];\n $questions[$row['id']]['options'][] = [\n 'content' => $row['content'],\n 'is_correct' => $row['is_correct'],\n ];\n if($row['is_correct']){\n $questions[$row['id']]['answer'] = $row['content'];\n }\n }\n\n $response['data'] = array_values($questions);\n $response['total'] = count($response['data']);\n\n return $response; \n\n }",
"public function test_all_questions_and_answers_route_when_questioner_has_sitewide_role() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n $roleid = $DB->get_field('role', 'id', array('shortname' => 'manager'));\n $this->getDataGenerator()->role_assign($roleid, $user->id);\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n $this->setUser($user);\n $client = new Client($this->_app);\n $client->request('GET', '/api/v1/' . $videoquanda->id . '/questions');\n $json = $client->getResponse()->getContent();\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $array = (array) json_decode($json);\n $this->assertCount(1, $array);\n }",
"private function getQuestion($uuid = NULL , $weekSend = NULL)\n\t\t{\n\t\t\t$returnArr = array();\n\t\t\t$questionArr = $this->Student_survey_model->getQuestions('Survey' , $uuid , $weekSend);\n\t\t\treturn $questionArr;\n\t\t}",
"public function get_questions() {\n return $this->questions;\n }",
"function showQuestions()\n\t{\n\t\tif($this->TotalQuestions > 0)\n\t\t{#be certain there are questions\n\t\t\tforeach($this->aQuestion as $question)\n\t\t\t{#print data for each \n\t\t\t\techo $question->Number . ') '; # We're using new Number property instead of id - v2\n\t\t\t\techo $question->Text . ' ';\n\t\t\t\tif($question->Description != ''){echo '(' . $question->Description . ')';}\n\t\t\t\techo '<br />';\n\t\t\t\t$question->showAnswers() . '<br />'; #display array of answer objects\n\t\t\t}\n\t\t}else{\n\t\t\techo 'There are currently no questions for this survey.';\t\n\t\t}\n\t}",
"public function getQuestions() {\r\n\t\treturn $this->questions;\r\n\t}",
"public function getQuestion()\n {\n // TODO: Implement getQuestion() method.\n }",
"public function getQuestions()\n {\n return DB::table('questionbank_quizzes')\n ->where('quize_id','=',$this->id)\n ->orderBy('subject_id')\n ->get();\n }",
"public function get_research_questions()\n\t{\n\t\treturn $this->research_questions;\n\t}",
"public function question($id)\n {\n //\n $questions = UserQuestion::with(['user','question','answer'])->where('video_id',$id)->orderBy('created_at','DESC')->paginate(50);\n // dd($questions);\n return view('Push::videos.question', compact(['questions']));\n }",
"public function getVoterMeetingQuestions()\n {\n return $this->hasMany(VoterMeetingQuestion::className(), ['meeting_voter_id' => 'id']);\n }",
"public function questions() {\n $questions = DB::select('select Question, AnswerType, rowid from Questions WHERE AnswerType<>\"mcq-radio\" AND AnswerType<>\"mcq-dropDown\";');\n\n // Obtain a list of all questions that are mcq\n $MCQ = DB::select('select Question, AnswerType, rowid from Questions WHERE AnswerType=\"mcq-radio\" OR AnswerType=\"mcq-dropDown\";');\n $mcqOptions = DB::select('select Qid, mcqOption from mcqOptions');\n\n return view('userResponseArea', compact(['questions','MCQ', 'mcqOptions']));\n }",
"public function getQuestions() {\r\n\t\t\treturn $this->_arrQuestions;\r\n\t\t}",
"public function getQuestions() {\n\t\t$fields = $this->Fields();\n\t\t// remove EditableFormStep\n\t\t$fields = $fields->exclude('ClassName', 'EditableFormStep');\n\t\t// return fields\n\t\treturn $fields;\n\t}",
"public function showQuestions()\n\t{\n\t\t$program = $this->schoolService->findProgramById($this->profile->program_id);\n\t\t$data = array(\n\t\t\t'answers' => $this->profileService->getAnswersForProfile($this->profile)->toArray(),\n\t\t\t'profile' => $this->profile,\n\t\t\t'program' => $program,\n\t\t\t'questionMax' => Config::get('profile.questions.max'),\n\t\t\t'questions' => $this->profileService->getQuestionsForType($program->type_id)->lists('label', 'id')\n\t\t);\n\n\t\treturn new QuestionView($data);\n\t}",
"function getQuestionsQuery(Query $q = null) {\n\t\treturn $this->getForeignObjectsQuery('question', 'quiz_id','id', $q);\n\t}",
"public function getAnswers();",
"public function test_export_matching() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'match';\n $qdata->name = 'Matching question';\n $qdata->questiontext = 'Match the upper and lower case letters.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'The answer is A -> a, B -> b and C -> c.';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 23;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->shuffleanswers = 1;\n $qdata->options->correctfeedback = 'Well done.';\n $qdata->options->correctfeedbackformat = FORMAT_HTML;\n $qdata->options->partiallycorrectfeedback = 'Not entirely.';\n $qdata->options->partiallycorrectfeedbackformat = FORMAT_HTML;\n $qdata->options->shownumcorrect = false;\n $qdata->options->incorrectfeedback = 'Completely wrong!';\n $qdata->options->incorrectfeedbackformat = FORMAT_HTML;\n \n $subq1 = new stdClass();\n $subq1->id = -4;\n $subq1->questiontext = 'A';\n $subq1->questiontextformat = FORMAT_HTML;\n $subq1->answertext = 'a';\n \n $subq2 = new stdClass();\n $subq2->id = -3;\n $subq2->questiontext = 'B';\n $subq2->questiontextformat = FORMAT_HTML;\n $subq2->answertext = 'b';\n \n $subq3 = new stdClass();\n $subq3->id = -2;\n $subq3->questiontext = 'C';\n $subq3->questiontextformat = FORMAT_HTML;\n $subq3->answertext = 'c';\n \n $subq4 = new stdClass();\n $subq4->id = -1;\n $subq4->questiontext = '';\n $subq4->questiontextformat = FORMAT_HTML;\n $subq4->answertext = 'd';\n \n $qdata->options->subquestions = array(\n $subq1, $subq2, $subq3, $subq4);\n \n $qdata->hints = array(\n new question_hint_with_parts(0, 'Hint 1', FORMAT_HTML, true, false),\n new question_hint_with_parts(0, '', FORMAT_HTML, true, true),\n );\n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/><file href=\"page1.svg\"/><file href=\"page2.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/><file href=\"page1.svg\"/><file href=\"page2.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(3, $import_data->pages);\n \n // Test first page\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata1 = '<votemetadata><questiontext format=\"choice\" labelstyle=\"upper-alpha\"';\n $expectedvotemetadata2 = 'points=\"23\" tags=\"\" explanation=\"The answer is A -$gt; a, B -$gt; b and C -$gt; c.\" mathgradingoption=\"\" likert=\"false\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n //$this->assert_same_xml($expectedvotemetadata, $votemetadata);\n //$this->assertStringStartsWith($expectedvotemetadata1, $votemetadata);\n //$this->assertStringEndsWith($expectedvotemetadata2, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n //$this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Match the upper and lower case letters.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertStringStartsWith($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'a';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'b';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'c';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'd';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test second page\n \n $page = $import_data->pages[1];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata1 = '<votemetadata><questiontext format=\"choice\" labelstyle=\"upper-alpha\"';\n $expectedvotemetadata2 = 'points=\"23\" tags=\"\" explanation=\"The answer is A -$gt; a, B -$gt; b and C -$gt; c.\" mathgradingoption=\"\" likert=\"false\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n //$this->assert_same_xml($expectedvotemetadata, $votemetadata);\n //$this->assertStringStartsWith($expectedvotemetadata1, $votemetadata);\n //$this->assertStringEndsWith($expectedvotemetadata2, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '2';\n $questionnumber = strip_tags($question->text[0]->asXML());\n //$this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Match the upper and lower case letters.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertStringStartsWith($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'a';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'b';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'c';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'd';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test third page\n \n $page = $import_data->pages[2];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata1 = '<votemetadata><questiontext format=\"choice\" labelstyle=\"upper-alpha\"';\n $expectedvotemetadata2 = 'points=\"23\" tags=\"\" explanation=\"The answer is A -$gt; a, B -$gt; b and C -$gt; c.\" mathgradingoption=\"\" likert=\"false\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n //$this->assert_same_xml($expectedvotemetadata, $votemetadata);\n //$this->assertStringStartsWith($expectedvotemetadata1, $votemetadata);\n //$this->assertStringEndsWith($expectedvotemetadata2, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '3';\n $questionnumber = strip_tags($question->text[0]->asXML());\n //$this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Match the upper and lower case letters.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertStringStartsWith($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'a';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'b';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'c';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'd';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n \n }",
"public function test_all_questions_and_answers_route_when_questioner_is_admin() {\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // enrolment\n $this->getDataGenerator()->enrol_user($user->id, $course->id);\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, 2, $now, $now + 1, 2, 'dummy text'),\n array(2, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n $this->setAdminUser();\n $client = new Client($this->_app);\n $client->request('GET', '/api/v1/' . $videoquanda->id . '/questions');\n $json = $client->getResponse()->getContent();\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $array = (array) json_decode($json);\n $this->assertCount(2, $array);\n }",
"public function displayQuestions() {\n $listQuestions = array();\n $sql = 'SELECT `id`, `question`, `picture` FROM `' . self::PREFIX . 'question`';\n $result = $this->db->query($sql);\n $listQuestions = $result->fetchAll(PDO::FETCH_OBJ);\n return $listQuestions;\n }",
"public function getQuestions()\n {\n $title = \"Questions\";\n $subtitle = \"Here you will find all the questions!\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the questions\n $questions = $this->di->get(\"questionModel\")->getQuestions();\n\n // Get number of answers\n $answers = [];\n foreach ($questions as $question) {\n $ans = $this->di->get(\"answerModel\")->getAnswersWhere(\"questionId\", $question->id);\n $answers[$question->id] = count($ans);\n }\n\n $data = [\n \"questions\" => $questions,\n \"subtitle\" => $subtitle,\n \"noOfAnswers\" => $answers,\n ];\n\n $view->add(\"pages/questions\", $data);\n $pageRender->renderPage([\"title\" => $title]);\n }",
"public function questions()\n {\n\n $client = new \\GuzzleHttp\\Client();\n\n $request = $client->get('http://localhost/quizci/questions');\n $response = $request->getBody()->getContents();\n\n $res_json_decode = json_decode($response);\n $data_collection = collect($res_json_decode->questions);\n //dd($data_collect);\n\n return View('admin.pages.questions', compact('data_collection'));\n }",
"function getOpts(){\n $q = getPublicQ();\n $q = Question::find($q[rand(0,sizeof($q) > 1 ? sizeof($q)-1 : 0)]);\n\n if($q->type == \"open\"){\n return [$q, null];\n }\n\n $ans = Option::all()->where('question_id', $q->id)->pluck('id');\n return sizeof($ans) > 1 ? [$q, Option::find($ans[0])->option] : getOpts();\n}",
"public function showResults(){\n $this->extractQuestions();\n }"
] |
[
"0.5786088",
"0.5772284",
"0.56704307",
"0.5514774",
"0.5508215",
"0.5508215",
"0.54921776",
"0.5488733",
"0.5480007",
"0.54771227",
"0.54714507",
"0.54570895",
"0.5448242",
"0.54430336",
"0.53858566",
"0.53765965",
"0.537376",
"0.5357171",
"0.53389233",
"0.53349763",
"0.5327947",
"0.5285596",
"0.52847177",
"0.52511907",
"0.52508044",
"0.5238772",
"0.52267236",
"0.5194093",
"0.5180427",
"0.5168968"
] |
0.59584594
|
0
|
Set the provided Form to the CompositeValidator and each Validator that has been added.
|
public function setForm($form)
{
foreach ($this->getValidators() as $validator) {
$validator->setForm($form);
}
return parent::setForm($form);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function _processForm() {\n\t\t$formValidators = $this->getElement()->getValidators();\n\n\t\t$constraints = array();\n\t\tforeach ($formValidators as $validator) {\n\t\t\t$situations = array();\n\t\t\t$conditions = array();\n\t\t\tif (isset($validator['situations'])) {\n\t\t\t\tforeach ($validator['situations'] as $name => $validators) {\n\t\t\t\t\t$situations[$name] = $this->_generateClientSideValidation($name, $this->_convertFormValidation($validators), false);\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($validator['conditions'] as $name => $validators) {\n\t\t\t\t// Make the field trigger itself.\n\t\t\t\tif (!array_key_exists($name, $this->_validationTriggers)) {\n\t\t\t\t\t$this->_validationTriggers[$name] = array();\n\t\t\t\t}\n\t\t\t\t$this->_validationTriggers[$name][$name] = true;\n\n\t\t\t\t$clientsideValidation = $this->_generateClientSideValidation($name, $this->_convertFormValidation($validators));\n\t\t\t\tif (isset($validator['message'])) {\n\t\t\t\t\tforeach ($clientsideValidation as $rule => & $message) {\n\t\t\t\t\t\t$message = $validator['message'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->_validatedFields[$name][] = array(\n\t\t\t\t\t'situations' => $situations,\n\t\t\t\t\t'conditions' => array($name => $clientsideValidation)\n\t\t\t\t);\n\n\t\t\t\t// Now ensure that each element that determines whether the condition needs to be satisfied trigger the checks on this element.\n\t\t\t\tforeach (array_keys($situations) as $trigger) {\n\t\t\t\t\t$this->_validationTriggers[$trigger][$name] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function addFormValidators() {\n \t}",
"public function prepareValidators()\n {\n $validators = $this->getValidatorBuilder()->build();\n\n if (!$validators) return;\n\n foreach($validators as $validator)\n $this->validators[] = $validator;\n }",
"public function registerWriteValidators()\n {\n Form_Validator::registerValidators(\n $this->createForm(),\n $this->getContainer()->getValidationManager(),\n array() //?\n );\n }",
"public function validate()\n {\n $this->resetResult();\n\n // This CompositeValidator has been disabled in full\n if (!$this->getEnabled()) {\n return $this->result;\n }\n\n foreach ($this->getValidators() as $validator) {\n // validate() will return a ValidationResult, and we will combine this with the result we already have\n $this->getResult()->combineAnd($validator->validate());\n }\n\n return $this->result;\n }",
"function ValidateBeforeAdd(){\n $this->validator->ValidateForm($this->_data, true);\n }",
"public function mergeConstraints(FormInterface &$form)\n {\n $metaData = null;\n $dataClass = $form->getConfig()->getDataClass();\n\n if ($dataClass != '') {\n $metaData = $this->validator->getMetadataFor($dataClass);\n }\n\n if ($metaData instanceof ClassMetadata) {\n /**\n * @var FormInterface $child\n */\n foreach ($form->all() as $child) {\n $options = $child->getConfig()->getOptions();\n $name = $child->getConfig()->getName();\n $type = $child->getConfig()->getType()->getName();\n\n if (isset($options['constraints'])) {\n $existingConstraints = $options['constraints'];\n $extractedConstraints = $this->extractPropertyConstraints($name, $metaData);\n\n // Merge all constraints\n $options['constraints'] = array_merge($existingConstraints, $extractedConstraints);\n }\n\n $form->add($name, $type, $options);\n }\n }\n }",
"public function setup()\n {\n parent::setup();\n \n $formClass = $this->getChildFormClass();\n $collection = $this->getParentObject()->{$this->getRelationAlias()};\n $nbChilds = 0;\n $min = $this->getMinNbChilds();\n $max = $this->getMaxNbChilds();\n \n if ($min > $max && $max > 0)\n throw new RuntimeException('min cannot be greater than max.');\n \n // embed forms for each child element that is already persisted\n foreach ($collection as $childObject)\n {\n $form = new $formClass($childObject);\n $pk = $childObject->identifier();\n \n if ($childObject->exists() === false)\n throw new RuntimeException('Transient child objects are not supported.');\n \n if (count($pk) !== 1)\n throw new RuntimeException('Composite primary keys are not supported.');\n \n $this->embedForm(self::PERSISTENT_PREFIX.reset($pk), $form);\n $nbChilds += 1;\n }\n \n // embed as many additional forms as are needed to reach the minimum\n // number of required child objects\n for (; $nbChilds < $min; $nbChilds += 1)\n {\n $form = new $formClass($collection->get(null));\n $this->embedForm(self::TRANSIENT_PREFIX.$nbChilds, $form);\n }\n \n $this->validatorSchema->setPostValidator(new sfValidatorCallback(array(\n 'callback' => array($this, 'validateLogic'),\n )));\n }",
"public function embedWidgetIntoForm(sfForm &$form) {\n\n\n $widgetSchema = $form->getWidgetSchema();\n $validatorSchema = $form->getValidatorSchema();\n\n $widgetSchema[$this->attributes['id']] = $this;\n $widgetSchema[$this->attributes['id']]->setLabel(ucwords(str_replace(\"_\", \" \", $this->attributes['id'])));\n \n $required = \n// $validatorSchema[$this->attributes['id']] = new ohrmValidatorDateRange(array(), array(\"invalid\" => \"Insert a correct date\"));\n// $validatorSchema[$this->attributes['id']] = new sfValidatorPass();\n// $validatorSchema->setPostValidator(new ohrmValidatorSchemaDateRange($this->attributes['id'], ohrmValidatorSchemaDateRange::LESS_THAN_EQUAL, $this->attributes['id'],\n// array('throw_global_error' => true),\n// array('invalid' => 'The from date (\"%left_field%\") must be before the to date (\"%right_field%\")')\n// ));\n\n $requiredMessage = __(ValidationMessages::REQUIRED);\n $validatorSchema[$this->attributes['id']] = new ohrmValidatorConditionalFilter(array(), array('required' => $requiredMessage));\n \n }",
"public function setValidators($validators)\r\n\t{\r\n\t\t$this->_validators=$validators;\r\n\t}",
"protected function setForm(Form $form) {\n $fields = array();\n $hiddenFields = array();\n\n $fieldIterator = $form->getFields()->getIterator();\n foreach ($fieldIterator as $fieldName => $field) {\n if ($field instanceof SubmitField) {\n continue;\n }\n\n if (!($field instanceof HiddenField)) {\n $fields[$fieldName] = $fieldName;\n continue;\n }\n\n if ($fieldName == Form::SUBMIT_NAME . $form->getName()) {\n continue;\n }\n\n $hiddenFields[$fieldName] = $fieldName;\n }\n\n if ($form instanceof ScaffoldForm) {\n $fieldLabels = $form->getFieldLabels();\n } else {\n $fieldLabels = array();\n }\n\n $this->set('form', $form);\n $this->set('fields', $fields);\n $this->set('hiddenFields', $hiddenFields);\n $this->set('fieldLabels', $fieldLabels);\n }",
"public function setForm(Form $form)\n {\n parent::setForm($form);\n $form->setAttr('enctype', Form::ENCTYPE_MULTIPART);\n \n // load any uploaded files if available\n $request = \\Tk\\Request::createFromGlobals();\n $this->uploadedFiles = $request->getUploadedFile(str_replace('.', '_', $this->getName()));\n\n if (!is_array($this->uploadedFiles)) $this->uploadedFiles = array($this->uploadedFiles);\n if (count($this->uploadedFiles) && ($this->uploadedFiles[0] == null || $this->uploadedFiles[0]->getError() == \\UPLOAD_ERR_NO_FILE)) {\n $this->uploadedFiles = array();\n }\n \n return $this;\n }",
"public function setValidators(array $amValidators)\n {\n\t\t$this->ssInvalidDateMessage = $amValidators['booking_date_past']['invalid'];\n\t\t\n BaseFacilityBookingForm::setValidators(\n\t \tarray(\n\t\t\t\t'title' \t\t\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n 'surname'\t\t\t\t=> new sfValidatorString( \n \t\t\t\t\t\t\t\tarray('required' => true, 'trim' => true),\n \t\t\t\t\t\t\t\tarray('required' => $amValidators['surname']['required'])\n\t\t\t\t\t\t\t\t\t\t\t\t),\n 'first_name'\t\t\t=> new sfValidatorString( \n \t\t\t\t\t\t\t\tarray('required' => true, 'trim' => true),\n \t\t\t\t\t\t\t\tarray('required' => $amValidators['first_name']['required'])\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t'email' \t\t\t=> new sfValidatorEmail(\n \t\tarray('required' => false, 'trim' => true),\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray('invalid' => $amValidators['email']['invalid'])\n \t\t),\n\t\t\t\t'middle_name' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'telephone' \t\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'mobile' \t\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'address' \t\t\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'suburb_town' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'state' \t\t\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'postal_code' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'fax' \t\t\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'area_code' \t\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'fax_area_code' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'chapel' \t\t\t=> new sfValidatorChoice(\n \t\tarray('required' => false, 'choices' => array_keys($this->amStatus))\n \t\t),\n\t\t\t\t'chapel_time_from' => new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'chapel_time_to' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'chapel_cost' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'room' \t\t\t=> new sfValidatorChoice(\n \t\tarray('required' => false, 'choices' => array_keys($this->amStatus))\n \t\t),\n\t\t\t\t'room_time_from' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'room_time_to' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'room_cost' \t\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'no_of_rooms' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'special_instruction'\t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t),\n\t\t\t\t'receipt_number' \t=> new sfValidatorString(\n \t\tarray('required' => false, 'trim' => true)\n \t\t)\n\t\t\t)\n );\n\t\t\n\t\tif(sfContext::getInstance()->getUser()->isSuperAdmin())\n\t\t{\n\t\t\t$this->validatorSchema['country_id'] = new sfValidatorChoice(\n \t\tarray('required' => true, 'choices' => array_keys($this->asCountryList)),\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray('required'=> $amValidators['country_id']['required'])\n \t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->validatorSchema['country_id']\t= new sfValidatorDoctrineChoice(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('model'=>'Country','multiple'=>false,'required'=>false));\n\n\t\t\t$this->validatorSchema['cem_cemetery_id'] = new sfValidatorString(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t$this->validatorSchema['chapel_grouplist'] = new sfValidatorChoice(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('multiple' => true, 'choices' => array_keys($this->amAllChapelTypes), 'required' => false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$this->validatorSchema['room_grouplist'] = new sfValidatorChoice(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('multiple' => true, 'choices' => array_keys($this->amAllRoomTypes), 'required' => false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t} \t\t\n\t\t\n\t\t\n\t\t\n\t\tif($this->isNew())\n\t\t{\n\t\t\t$this->validatorSchema['chapel_time_from'] = new sfValidatorAnd(array(new sfValidatorDate(), new sfValidatorCallback(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('callback'=> array($this,'checkValidDate')),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('invalid'=> $amValidators['booking_invalid_date']['invalid']))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t$this->validatorSchema['chapel_time_to'] = new sfValidatorAnd(array(new sfValidatorDate(), new sfValidatorCallback(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('callback'=> array($this,'checkValidDate')),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('invalid'=> $amValidators['booking_invalid_date']['invalid']))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t$this->validatorSchema['room_time_from'] = new sfValidatorAnd(array(new sfValidatorDate(), new sfValidatorCallback(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('callback'=> array($this,'checkValidDate')),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('invalid'=> $amValidators['booking_invalid_date']['invalid']))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t$this->validatorSchema['room_time_to'] = new sfValidatorAnd(array(new sfValidatorDate(), new sfValidatorCallback(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('callback'=> array($this,'checkValidDate')),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('invalid'=> $amValidators['booking_invalid_date']['invalid']))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n }",
"public function using(Validator $validator): void {\r\n\r\n $this -> fieldCollection = array_merge($validator -> fieldCollection, $this -> fieldCollection);\r\n $this -> fieldNames = array_merge($validator -> fieldNames, $this -> fieldNames);\r\n $this -> extendCollection = array_merge($validator -> extendCollection, $this -> extendCollection);\r\n $this -> middleware = array_merge($validator -> middleware, $this -> middleware);\r\n $this -> bail = $validator -> bail;\r\n $this -> combine = $validator -> combine;\r\n }",
"public function setValidators(array $validators);",
"public function validate() {\n // loop through validators and run them\n foreach($this->form_fields as $field) {\n $field->valid = TRUE;\n // validate required items\n if ($field->required) {\n if ((strlen($field->value) == 0) || (empty($field->value)) || (is_null($field->value)) ) {\n $field->valid = FALSE; $this->form_errors++; \n if ((isset($field->default_error)) && (!empty($field->default_error))) {\n $field->error = $field->default_error;\n }\n else {\n $field->error = \"This field is required\";\n }\n }\n }\n // run validators for items that are not already failed\n if (($field->valid) && (!empty($field->validator)) && (is_array($field->validator))) {\n\n // skip empty fields\n if (empty($field->value)) { continue; }\n\n foreach($field->validator as $validator) {\n // run the function\n if (call_user_func($validator['func'],$field->value)) {\n $field->valid = TRUE;\n }\n else {\n $field->valid = FALSE; $this->form_errors++; \n if ((isset($validator['message'])) && (!empty($validator['message']))) {\n $field->error = $validator['message'];\n }\n else if ((isset($field->default_error)) && (!empty($field->default_error))) {\n $field->error = $field->default_error;\n }\n else {\n $field->error = \"This field contains an invalid value\";\n }\n // break out of the loop. No need to continue with validations if one has failed\n break;\n }\n }\n }\n $this->form_validated = TRUE;\n // run the post validate method to levy modifications against the validated input\n $this->postValidate();\n }\n return;\n }",
"protected function ValidateFormParameters()\n {\n new ValidateFormParameters($this->form_parameters);\n\n return $this;\n }",
"protected function _setForm()\n\t{\t\n\t\t$controller = $this->getActionController();\n\t\t\n\t\t$this->_setViewFormData($controller)\n\t\t\t ->_setViewErrors($controller)\n\t\t\t ->_setViewWarnings($controller);\n\t\t\t\n\t}",
"function _setFormElements() {\n\t\t$jobCategories = $this->Job->JobCategory->find('list');\n\t\t$jobLocations = $this->Job->JobLocation->find('list');\n\t\t$this->set(compact('jobCategories', 'jobLocations'));\n\t}",
"protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix(self::HTML_ID_PREFIX);\n $integrationData = $this->_coreRegistry->registry(\n Integration::REGISTRY_KEY_CURRENT_INTEGRATION\n );\n $this->_addGeneralFieldset($form, $integrationData);\n if (isset($integrationData['integration_id'])) {\n $integrationStores = $this->integrationStoresRepository->getListByIntegration(\n $integrationData['integration_id']\n );\n $integrationData['integration_stores'] = $integrationStores;\n }\n $form->addValues($integrationData);\n $this->setForm($form);\n return $this;\n }",
"protected function _prepareForm() {\r\n $model = Mage::getModel('attributeSplash/rule');\r\n $form = new Varien_Data_Form();\r\n\r\n $form->setHtmlIdPrefix('rule_');\r\n $form->setFieldNameSuffix('splash');\r\n\r\n $renderer = Mage::getBlockSingleton('adminhtml/widget_form_renderer_fieldset')\r\n ->setTemplate('promo/fieldset.phtml')\r\n ->setNewChildUrl($this->getUrl('*/promo_catalog/newConditionHtml/form/rule_conditions_fieldset'));\r\n\r\n $fieldset = $form->addFieldset('conditions_fieldset', array(\r\n 'legend'=>Mage::helper('catalogrule')->__('Conditions (leave blank for all products)'))\r\n )->setRenderer($renderer);\r\n\r\n $fieldset->addField('conditions', 'text', array(\r\n 'name' => 'conditions',\r\n 'label' => Mage::helper('catalogrule')->__('Conditions'),\r\n 'title' => Mage::helper('catalogrule')->__('Conditions'),\r\n 'required' => true,\r\n ))->setRule($model)->setRenderer(Mage::getBlockSingleton('rule/conditions'));\r\n \r\n $form->setValues($this->_getFormData());\r\n\r\n $this->setForm($form);\r\n\r\n return $this;\r\n }",
"public function testSetValidators()\n\t{\n\t\t$sampleValidator = new SampleValidator();\n\t\t$validatorSet = new ValidatorSet();\n\n\t\t$this->assertTrue(method_exists($validatorSet, 'add'));\n\t\t$this->assertTrue(method_exists($validatorSet, 'get'));\n\n\t\t$validatorSet->add([$sampleValidator]);\n\n\t\t$this->assertEquals($validatorSet->get()[0], $sampleValidator);\n\t}",
"function getValidators() {\n $extra_validators = array();\n \n foreach ($this->_widgets as $oWidget) {\n $res = $oWidget->getValidators();\n \n if (!is_null($res)) {\n if (is_array($res)) {\n $extra_validators = kt_array_merge($extra_validators, $res);\n } else {\n $extra_validators[] = $res;\n }\n }\n }\n \n $oVF =& KTValidatorFactory::getSingleton(); \n return array($oVF->get('ktcore.validators.fieldset', array(\n 'test' => $this->sBasename, \n 'validators' => &$extra_validators,\n )));\n }",
"public function preSetData(FormEvent $event)\n {\n /** @var FlexibleValueInterface $value */\n $value = $event->getData();\n $form = $event->getForm();\n\n // skip form creation with no data\n if (null === $value) {\n return;\n }\n\n $attributeTypeAlias = $value->getAttribute()->getAttributeType();\n $attributeType = $this->attributeTypeFactory->get($attributeTypeAlias);\n /** @var FormInterface $valueForm */\n $valueForm = $attributeType->buildValueFormType($this->factory, $value);\n\n // Initialize subforms which connected to flexible entities\n $dataClass = $valueForm->getConfig()->getDataClass();\n if (is_subclass_of($dataClass, 'Oro\\Bundle\\FlexibleEntityBundle\\Model\\FlexibleInterface')) {\n $flexibleManager = $this->flexibleManagerRegistry->getManager($dataClass);\n $entity = $flexibleManager->createFlexible();\n $valueForm->setData($entity);\n }\n\n $form->add($valueForm);\n }",
"public function validate(): void\n {\n $this->validatingValue = method_exists($this, 'getValue') ? $this->getValue() : $this->validatingValue;\n\n /**\n * Executes each of the validation closures in reversed order only if the $validatingChain\n * property isn't empty.\n */\n if (!empty($this->validatingChain)) {\n foreach (array_reverse($this->validatingChain) as $function) {\n $function();\n }\n }\n }",
"public function form_set($form) {\n\t\t\t\t$this->form = $form;\n\t\t\t}",
"private function validateForm(): void\n { if ($this->form->isSubmitted()) {\n // get the status\n $status = $this->getRequest()->request->has('saveAsDraft') ? 'draft' : 'active';\n\n // cleanup the submitted fields, ignore fields that were added by hackers\n $this->form->cleanupFields();\n\n // validate fields\n $this->form->getField('title')->isFilled(BL::err('TitleIsRequired'));\n $this->form->getField('text')->isFilled(BL::err('FieldIsRequired'));\n $this->form->getField('publish_on_date')->isValid(BL::err('DateIsInvalid'));\n $this->form->getField('publish_on_time')->isValid(BL::err('TimeIsInvalid'));\n $this->form->getField('category_id')->isFilled(BL::err('FieldIsRequired'));\n if ($this->form->getField('category_id')->getValue() == 'new_category') {\n $this->form->getField('category_id')->addError(BL::err('FieldIsRequired'));\n }\n\n // validate meta\n $this->meta->validate();\n\n if ($this->form->isCorrect()) {\n // build item\n $item = [\n 'id' => (int) BackendBlogModel::getMaximumId() + 1,\n 'meta_id' => $this->meta->save(),\n 'category_id' => (int) $this->form->getField('category_id')->getValue(),\n 'user_id' => $this->form->getField('user_id')->getValue(),\n 'language' => BL::getWorkingLanguage(),\n 'title' => $this->form->getField('title')->getValue(),\n 'introduction' => $this->form->getField('introduction')->getValue(),\n 'text' => $this->form->getField('text')->getValue(),\n 'publish_on' => BackendModel::getUTCDate(\n null,\n BackendModel::getUTCTimestamp(\n $this->form->getField('publish_on_date'),\n $this->form->getField('publish_on_time')\n )\n ),\n 'created_on' => BackendModel::getUTCDate(),\n 'hidden' => $this->form->getField('hidden')->getValue(),\n 'allow_comments' => $this->form->getField('allow_comments')->getChecked(),\n 'num_comments' => 0,\n 'status' => $status,\n ];\n $item['edited_on'] = $item['created_on'];\n\n // insert the item\n $item['revision_id'] = BackendBlogModel::insert($item);\n\n if ($this->imageIsAllowed) {\n // the image path\n $imagePath = FRONTEND_FILES_PATH . '/Blog/images';\n\n // create folders if needed\n $filesystem = new Filesystem();\n $filesystem->mkdir([$imagePath . '/source', $imagePath . '/128x128']);\n\n // image provided?\n if ($this->form->getField('image')->isFilled()) {\n // build the image name\n $item['image'] = $this->meta->getUrl()\n . '-' . BL::getWorkingLanguage()\n . '-' . $item['revision_id']\n . '.' . $this->form->getField('image')->getExtension();\n\n // upload the image & generate thumbnails\n $this->form->getField('image')->generateThumbnails($imagePath, $item['image']);\n\n // add the image to the database without changing the revision id\n BackendBlogModel::updateRevision($item['revision_id'], ['image' => $item['image']]);\n }\n }\n\n // save the tags\n BackendTagsModel::saveTags($item['id'], $this->form->getField('tags')->getValue(), $this->url->getModule());\n\n // active\n if ($item['status'] == 'active') {\n // add search index\n BackendSearchModel::saveIndex($this->getModule(), $item['id'], ['title' => $item['title'], 'text' => $item['text']]);\n\n // everything is saved, so redirect to the overview\n $this->redirect(BackendModel::createUrlForAction('Index') . '&report=added&var=' . rawurlencode($item['title']) . '&highlight=row-' . $item['revision_id']);\n } elseif ($item['status'] == 'draft') {\n // draft: everything is saved, so redirect to the edit action\n $this->redirect(BackendModel::createUrlForAction('Edit') . '&report=saved-as-draft&var=' . rawurlencode($item['title']) . '&id=' . $item['id'] . '&draft=' . $item['revision_id'] . '&highlight=row-' . $item['revision_id']);\n }\n }\n }\n }",
"protected function regenerateFormControls()\n\t{\n\t\t$form = $this->getForm();\n\n\t\t// regenerate checker's checkbox controls\n\t\tif ($this->hasOperations()) {\n\t\t\t$values = $form->getValues();\n\n\t\t\t$form->removeComponent($form['checker']);\n\t\t\t$sub = $form->addContainer('checker');\n\t\t\tforeach ($this->getRows() as $row) {\n\t\t\t\t$sub->addCheckbox($row[$this->keyName], $row[$this->keyName]);\n\t\t\t}\n\n\t\t\tif (!empty($values['checker'])) {\n\t\t\t\t$form->setDefaults(array('checker' => $values['checker']));\n\t\t\t}\n\t\t}\n\n\t\t// for selectbox filter controls update values if was filtered over column\n\t\tif ($this->hasFilters()) {\n\t\t\tparse_str($this->filters, $list);\n\n\t\t\tforeach ($this->getFilters() as $filter) {\n\t\t\t\tif ($filter instanceof SelectboxFilter) {\n\t\t\t\t\t$filter->generateItems();\n\t\t\t\t}\n\n\t\t\t\tif ($this->filters === $this->defaultFilters && ($filter->value !== NULL || $filter->value !== '')) {\n\t\t\t\t\tif (!in_array($filter->getName(), array_keys($list))) $filter->value = NULL;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// page input & items selectbox\n\t\t$form['page']->setValue($this->paginator->page); // intentionally page from paginator\n\t\t$form['items']->setValue($this->paginator->itemsPerPage);\n\t}",
"public function setValidator(\\Closure $validator, $applyToCurrent = true)\n {\n $collection = array();\n\n // apply validator to each element in collection\n if ($applyToCurrent == true) {\n foreach ($this->collection as $key => $elmt) {\n if ($validator($elmt) == true) {\n $collection[$key] = $elmt;\n }\n }\n }\n\n $this->collection = $collection;\n $this->validator = $validator;\n\n return $this;\n }",
"public function validate(): FormRequestHandlerInterface\n {\n $this->form->setValues($this->body);\n $this->errors = container_resolve(FormValidatorInterface::class, [$this->form])\n ->validate()\n ->getErrors();\n return $this;\n }"
] |
[
"0.6397",
"0.6101553",
"0.60211635",
"0.5804281",
"0.55666953",
"0.53944457",
"0.53926736",
"0.53384197",
"0.52321804",
"0.52016133",
"0.5177355",
"0.516199",
"0.5158548",
"0.51542395",
"0.5152687",
"0.51437575",
"0.51391715",
"0.50818145",
"0.5078886",
"0.5068776",
"0.5065443",
"0.5015871",
"0.5006715",
"0.50065744",
"0.4983724",
"0.49779397",
"0.4955635",
"0.49448287",
"0.49245626",
"0.49244806"
] |
0.6877142
|
0
|
Returns any errors there may be. This method considers the enabled status of the CompositeValidator as a whole (exiting early if the Composite is disabled), as well as the enabled status of each individual Validator.
|
public function validate()
{
$this->resetResult();
// This CompositeValidator has been disabled in full
if (!$this->getEnabled()) {
return $this->result;
}
foreach ($this->getValidators() as $validator) {
// validate() will return a ValidationResult, and we will combine this with the result we already have
$this->getResult()->combineAnd($validator->validate());
}
return $this->result;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFailedValidators() {\n return $this->failedValidators;\n }",
"public function validation_errors()\n\t{\n\t\t$errors = array();\n\n\t\tforeach ($this->validators as $fld=>$arr)\n\t\t{\n\t\t\tforeach ($arr as $vl)\n\t\t\t{\n\t\t\t\t$vl->page = $this;\n\n\t\t\t\tif (!$vl->validate($fld, $this->vars))\n\t\t\t\t{\n\t\t\t\t\t$errors[$fld] = $vl->error_message($fld, $this->vars);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $errors;\n\t}",
"public function validateAll()\n {\n $errorMsgs = array();\n return $errorMsgs;\n }",
"public function getErrors()\r\n\t\t{\r\n\t\t\treturn $this->_controlErrors;\r\n\t\t}",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function getErrors(){\n if( !isset($this->openForm) ) return false;\n if( !is_bool($this->openForm) && !is_array($this->openForm) )\n return self::getFormErrors($this->openForm);\n if( is_array($this->openForm) )\n return self::getFormErrors($this->openForm['formid']);\n return false;\n }",
"public function getErrors()\n\t{\n\t\t$errors = array();\n\t\t/** @var Miao_Form_Control $control */\n\t\t/** @var Miao_Form_Validate $validator */\n\t\tforeach ( $this->getControls() as $control )\n\t\t{\n\t\t\tif ( !$control->isValid() )\n\t\t\t{\n\t\t\t\t$validator = $control->error();\n\t\t\t\t$errors[] = array(\n\t\t\t\t\t'name' => $control->getName(),\n\t\t\t\t\t'error' => $validator->getMessage() );\n\t\t\t}\n\t\t}\n\t\treturn $errors;\n\t}",
"public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}",
"public function getValidationErrors() {\n\t\treturn $this->_validationErrors;\n\t}",
"public function getErrors()\n {\n return $this->validator->errors();\n }",
"protected function Form_Validate() {\n // By default, we report that Custom Validations passed\n $blnToReturn = true;\n\n // Custom Validation Rules\n // TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n $blnFocused = false;\n foreach ($this->GetErrorControls() as $objControl) {\n // Set Focus to the top-most invalid control\n if (!$blnFocused) {\n $objControl->Focus();\n $blnFocused = true;\n }\n\n // Blink on ALL invalid controls\n $objControl->Blink();\n }\n\n return $blnToReturn;\n }",
"protected function Form_Validate() {\n // By default, we report that Custom Validations passed\n $blnToReturn = true;\n\n // Custom Validation Rules\n // TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n $blnFocused = false;\n foreach ($this->GetErrorControls() as $objControl) {\n // Set Focus to the top-most invalid control\n if (!$blnFocused) {\n $objControl->Focus();\n $blnFocused = true;\n }\n\n // Blink on ALL invalid controls\n $objControl->Blink();\n }\n\n return $blnToReturn;\n }",
"public function getValidationErrors()\n\t{\n\t\treturn $this->validationErrors;\n\t}",
"protected function getValidationErrors()\n {\n return $this->validation->errors();\n }",
"public function getErrors()\n {\n return $this->_arrValidationErrors;\n }",
"public function getValidationErrors();",
"public function getValidationErrors();",
"public function getErrors()\n\t{\n\t\t// do an image validation\n\t\tif($this->isFilled())\n\t\t{\n\t\t\t$this->isAllowedExtension(array('jpg', 'jpeg', 'gif', 'png'), FL::err('JPGGIFAndPNGOnly'));\n\t\t\t$this->isAllowedMimeType(array('image/jpeg', 'image/gif', 'image/png'), FL::err('JPGGIFAndPNGOnly'));\n\t\t}\n\n\t\treturn $this->errors;\n\t}",
"public function errors()\n {\n return $this->validator->errors();\n }",
"public function errors()\n {\n return $this->validator->errors();\n }",
"public function errors()\n {\n return $this->validator->errors();\n }",
"public function errors()\n {\n return $this->validator->errors();\n }",
"public function getValidationErrors() {\n if (true == ($this->validation instanceof Validation)) {\n return $this->validation->getErrors();\n }\n\n return array();\n }",
"public function getAllerrors() {\n return $this->errors;\n }",
"public function get_errors() {\n\t\treturn empty( $this->errors ) ? false : $this->errors;\n\t}",
"public function getValidationErrors() {\n\t\treturn (array)$this -> _errors;\n\t}",
"public function getErrors() {\r\n return $this->pdocrudErrCtrl->getErrors();\r\n }",
"public function getErrors()\n {\n return $this->processerrors;\n }"
] |
[
"0.65420556",
"0.64502895",
"0.6370279",
"0.6309253",
"0.62860966",
"0.61955875",
"0.6189128",
"0.61803603",
"0.6154338",
"0.6125149",
"0.6114807",
"0.61102337",
"0.6103417",
"0.6094561",
"0.60743123",
"0.6065356",
"0.60555375",
"0.60512453",
"0.60512453",
"0.60459876",
"0.60297495",
"0.60297495",
"0.60297495",
"0.60297495",
"0.60222435",
"0.6021032",
"0.6007213",
"0.5959839",
"0.592503",
"0.59106094"
] |
0.7060257
|
0
|
Return all Validators that match a certain class name. EG: RequiredFields::class The keys for the return array match the keys in the unfiltered array. You cannot assume the keys will be sequential or that the first key will be ZERO.
|
public function getValidatorsByType(string $className): array
{
$validators = [];
foreach ($this->getValidators() as $key => $validator) {
if (!$validator instanceof $className) {
continue;
}
$validators[$key] = $validator;
}
return $validators;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getValidClasses(): array\n {\n return $this->validClasses;\n }",
"private function getConstraints($class)\n {\n $validations = array();\n\n $metadata = $this->container\n ->get('validator')\n ->getMetadataFactory()\n ->getMetadataFor($class);\n\n $constrainedProperties = $metadata->getConstrainedProperties();\n \n foreach($constrainedProperties as $constrainedProperty)\n {\n $propertyMetadata = $metadata->getPropertyMetadata($constrainedProperty);\n $constraints = $propertyMetadata[0]->constraints;\n $outputConstraintsCollection=[];\n foreach($constraints as $constraint)\n {\n $class = new \\ReflectionObject($constraint);\n $constraintName = $class->getShortName();\n $constraintParameter = null;\n\n switch ($constraintName) \n {\n// case \"NotBlank\":\n case \"Choice\":\n $outputConstraintsCollection[$constraintName] = $constraint;\n break;\n }\n }\n $validations[$constrainedProperty] = $outputConstraintsCollection;\n }\n return $validations;\n }",
"static function get_validation_classes() {\n\t\tif (count(self::$validation_classes) == 0) {\n\n\t\t\t$methodClasses = ClassInfo::subclassesFor('FMValidationMethod');\n\t\t\t$methods = array();\n\n\t\t\tforeach($methodClasses as $class) {\n\t\t\t\tif ($class != 'FMValidationMethod') {\n\t\t\t\t\t$singleton = singleton($class);\n\t\t\t\t\tif ($singleton->ruleName == '') {\n\t\t\t\t\t\ttrigger_error('Validation class '.$class.' has no $ruleName', E_USER_WARNING);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($methods[$singleton->ruleName])) {\n\t\t\t\t\t\ttrigger_error('Validation class with ruleName '.$singleton->ruleName.' already exists ('.$class.' & '.$methods[$singleton->ruleName]->class.')', E_USER_WARNING);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$methods[$singleton->ruleName] = $class;\n\t\t\t\t}\n\t\t\t}\n\t\t\tself::$validation_classes = $methods;\n\t\t}\n\n\t\treturn self::$validation_classes;\n\t}",
"public function getValidators();",
"public function getValidators();",
"public function getValidators();",
"public function getFieldsByClass($className)\n {\n $result = [];\n\n foreach ($this->fields as $field) {\n if ($field instanceof $className ||\n get_class($field) == $className ||\n (new \\ReflectionClass($field))->getShortName() == $className\n ) {\n $result[] = $field;\n }\n }\n\n return $result;\n }",
"public static function getValidateFields($className){\n $propertyList = array();\n\n if (class_exists($className)){\n $object = new $className();\n $reflect = new ReflectionObject($object);\n\n // Check if the property is accessible\n $publicProperties = $reflect->getProperties(ReflectionProperty::IS_PUBLIC);\n foreach ($publicProperties as $property)\n {\n $propertyName = $property->getName();\n if ((!in_array($propertyName, AddressFormat::$forbiddenPropertyList)) &&\n (!preg_match('#id|id_\\w#', $propertyName)))\n $propertyList[] = $propertyName;\n }\n unset($object);\n unset($reflect);\n }\n return $propertyList;\n }",
"public function getValidators() {}",
"public static function validators() {\n return [\n 'status' => 'validateStatus',\n 'quota' => 'validateQuota'\n ];\n }",
"public static function validators() {\n return [\n 'status' => 'validateStatus',\n 'time' => 'validateTime'\n ];\n }",
"public function getSearchFields($class);",
"function getValidators() {\n $extra_validators = array();\n \n foreach ($this->_widgets as $oWidget) {\n $res = $oWidget->getValidators();\n \n if (!is_null($res)) {\n if (is_array($res)) {\n $extra_validators = kt_array_merge($extra_validators, $res);\n } else {\n $extra_validators[] = $res;\n }\n }\n }\n \n $oVF =& KTValidatorFactory::getSingleton(); \n return array($oVF->get('ktcore.validators.fieldset', array(\n 'test' => $this->sBasename, \n 'validators' => &$extra_validators,\n )));\n }",
"abstract protected function getAdditionalValidators(): array;",
"public static function validators() {\n return [\n 'application_id' => 'validateApplicationId',\n 'is_default' => 'validateIsDefault',\n 'role' => 'validateRole',\n 'type' => 'validateType',\n '_issues' => 'validateIssues'\n ];\n }",
"public function getValidators()\n\t{\n\t\treturn array();\n\t}",
"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 }",
"protected function getClassesToScan()\n\t{\n\t\t$classes = [];\n\n\t\tforeach ($this->scan as $class)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$classes[] = new ReflectionClass($class);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t//\n\t\t\t}\n\t\t}\n\n\t\treturn $classes;\n\t}",
"public static final function getKeys($class)\n {\n if (!is_subclass_of($class, __CLASS__))\n throw new OrmInputException('Supply a subclass of '.__CLASS__);\n\n $const = sprintf('%s::%s_keys', $class, $class);\n if (!defined($const))\n return array(self::AUTO_PROPERTY_ID);\n\n $keys = array_unique(explode(',', constant($const)));\n\n foreach ($keys as $key)\n if (!in_array($key, self::getProperties($class)))\n throw new OrmInputException(\"$key is not a member of class $class\");\n\n return $keys;\n }",
"public function generateClass($className)\n {\n $data = array();\n\n $metadata = $this->metadataFactory->getClassMetadata($className);\n $properties = $metadata->getConstrainedProperties();\n\n foreach ($properties as $property) {\n $data[$property] = array();\n $constraintsList = $metadata->getMemberMetadatas($property);\n foreach ($constraintsList as $constraints) {\n foreach ($constraints->constraints as $constraint) {\n $const = clone $constraint;\n if ($this->translator) {\n $const->message = $this->translator->trans($const->message, array(), 'validations', $this->defaultLocale);\n }\n $data[$property][$this->getConstraintName($const)] = $const;\n }\n }\n }\n\n return $data;\n }",
"public static function validators() {\n return [\n 'tenant_id' => 'validateTenantId',\n 'expires_in' => 'validateExpiresIn',\n 'scopes' => 'validateScopes'\n ];\n }",
"public function getValidators()\n {\n $validators = parent::getValidators();\n if ($this->internalValue != null) {\n if ($this->internalMultiSelect) {\n // field may contain more than one value\n $validators[] = new CsvListValidator(array('message' => $this->internalValidationMessage,\n 'domain'=>array_keys($this->internalOptionList)));\n } else {\n // single value selection\n $validators[] = new InclusionIn(array('message' => $this->internalValidationMessage,\n 'domain'=>array_keys($this->internalOptionList)));\n }\n }\n return $validators;\n }",
"static function get_validation_methods() {\n\t\tif (count(self::$validation_methods) == 0) {\n\t\t\t\n\t\t\t$methodCLasses = ClassInfo::subclassesFor('FMValidationMethod');\n\t\t\t$methods = array();\n\t\t\t\n\t\t\tforeach($methodCLasses as $class) {\n\t\t\t\tif ($class != 'FMValidationMethod') {\n\t\t\t\t\t$singleton = singleton($class);\n\t\t\t\t\tif ($singleton->name == '') {\n\t\t\t\t\t\ttrigger_error('Validation class '.$class.' has no $name');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($methods[$singleton->name])) {\n\t\t\t\t\t\ttrigger_error('Validation class with name '.$singleton->name.' already exists ('.$class.' & '.$methods[$singleton->name]->class.')');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$methods[$singleton->name] = $singleton;\n\t\t\t\t}\n\t\t\t}\n\t\t\tself::$validation_methods = $methods;\n\t\t}\n\t\t\n\t\treturn self::$validation_methods;\n\t}",
"private function loadValidationClassMap(Finder $finder)\n {\n $classMap = [];\n foreach ($finder as $file) {\n $document = new \\DOMDocument();\n $document->load($file);\n\n $xpath = new \\DOMXPath($document);\n $xpath->registerNamespace('constraint', 'http://symfony.com/schema/dic/constraint-mapping');\n\n $classMap = array_reduce(\n iterator_to_array($xpath->query('//constraint:class')),\n function (array $classMap, \\DOMElement $element) {\n $classMap[$element->getAttribute('name')] = $element;\n return $classMap;\n },\n $classMap\n );\n }\n\n return $classMap;\n }",
"protected function scanClass()\n {\n return $this->scanInput('/^\\.([\\w-]+)/', 'class');\n }",
"public function provideValidator()\n {\n return [\n [[111111, 234567], true],\n [[222222, 111111], false],\n [[\"12345v\", 234567], false],\n [[123456, \"12345b\"], false],\n [['asdfgh', 'asdfgh'], false]\n ];\n }",
"protected function getRequiredUseClasses(array $fields, $withAuth)\n {\n $commands = [];\n if ($withAuth) {\n $commands[] = $this->getUseClassCommand('Auth');\n }\n\n foreach ($fields as $field) {\n // Extract the name spaces fromt he custom rules\n $customRules = $this->extractCustomValidationRules($field->getValidationRule());\n $namespaces = $this->extractCustomValidationNamespaces($customRules);\n foreach ($namespaces as $namespace) {\n $commands[] = $this->getUseClassCommand($namespace);\n }\n }\n\n usort($commands, function ($a, $b) {\n return strlen($a) - strlen($b);\n });\n\n return implode(PHP_EOL, array_unique($commands));\n }",
"public function getCMSValidator()\n {\n return RequiredFields::create([\n 'ClassName'\n ]);\n }",
"public function getRequiredFields($filter) {\n $requirements = [];\n if (array_key_exists('base', $this->requirements)) {\n $requirements = array_merge($requirements, $this->requirements['base']);\n }\n if (array_key_exists($filter, $this->requirements)) {\n $requirements = array_merge($requirements, $this->requirements[$filter]);\n }\n return array_unique($requirements);\n }",
"public function getAll($keysOnly = false, $className = null) {}"
] |
[
"0.61748344",
"0.5820805",
"0.5808381",
"0.5713209",
"0.5713209",
"0.5713209",
"0.5606597",
"0.54960334",
"0.543371",
"0.54161555",
"0.5413481",
"0.53990054",
"0.53788656",
"0.5331739",
"0.53295314",
"0.5308982",
"0.52750003",
"0.5265112",
"0.5214685",
"0.52050376",
"0.51976186",
"0.51883423",
"0.5102029",
"0.508899",
"0.50868636",
"0.50839466",
"0.50704116",
"0.5067319",
"0.503651",
"0.50263715"
] |
0.66422963
|
0
|
Each Validator is aware of whether or not it can be cached. If even one Validator cannot be cached, then the CompositeValidator as a whole also cannot be cached.
|
public function canBeCached(): bool
{
foreach ($this->getValidators() as $validator) {
if (!$validator->canBeCached()) {
return false;
}
}
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function getCache_ValidatorService()\n {\n return $this->services['cache.validator'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('k0V7XpDK96', 0, 'MYfBg2oUlptyQ7C3Ob4WQe', (__DIR__.'/pools'), $this->get('monolog.logger.cache', ContainerInterface::NULL_ON_INVALID_REFERENCE));\n }",
"public function validate()\n {\n $this->resetResult();\n\n // This CompositeValidator has been disabled in full\n if (!$this->getEnabled()) {\n return $this->result;\n }\n\n foreach ($this->getValidators() as $validator) {\n // validate() will return a ValidationResult, and we will combine this with the result we already have\n $this->getResult()->combineAnd($validator->validate());\n }\n\n return $this->result;\n }",
"protected function canBeCached()\n {\n if ($this->getSecurityToken()->isEnabled()) {\n return false;\n }\n\n if ($this->FormMethod() !== 'GET') {\n return false;\n }\n\n $validator = $this->getValidator();\n\n if (!$validator) {\n return true;\n }\n\n return $validator->canBeCached();\n }",
"public function prepareValidators()\n {\n $validators = $this->getValidatorBuilder()->build();\n\n if (!$validators) return;\n\n foreach($validators as $validator)\n $this->validators[] = $validator;\n }",
"public function validators()\n {\n if (is_null($this->validatorRequests)) {\n $this->validatorRequests = new ValidatorRequests($this->client);\n }\n\n return $this->validatorRequests;\n }",
"public function can_cache() {\n return $this->valid;\n }",
"public function get_css_cache_invalidated(): bool{\n\t\t\t// false = cache valid\n\n\t\t\tif($this->module_css_cache_invalidated !== NULL){\n\t\t\t\treturn $this->module_css_cache_invalidated; // status already retrieved\n\t\t\t}\n\n\t\t\tif(!isset(static::$list[$this->get_UID()]['cache'][ 'invalidated' ])){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // setting not saved yet\n\t\t\t}\n\n\t\t\tif(is_admin() && intval(static::$list[$this->get_UID()]['cache'][ 'invalidated' ]['gutenberg']->get_data()) === 1){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // cache is invalidated\n\t\t\t}\n\t\t\tif(!is_admin() && intval(static::$list[$this->get_UID()]['cache'][ 'invalidated' ]['frontend']->get_data()) === 1){\n\t\t\t\t$this->module_css_cache_invalidated = true;\n\t\t\t\treturn true; // cache is invalidated\n\t\t\t}\n\n\t\t\t$this->module_css_cache_invalidated = false;\n\t\t\treturn false; // cache is valid\n\t\t}",
"function validator() {\n if ($this->validator) return $this->validator;\n $options = array();\n foreach ($this->fields_options as $field => $field_options) {\n if (!@$field_options['validation']) continue;\n $options[$field] = $field_options['validation'];\n }\n return $this->validator = new xValidatorStore($options, $_REQUEST);\n }",
"abstract protected function getClearingValidator(): ValidatorInterface;",
"public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Atezate\\\\Validator\\Cubos')) {\n\n $this->setValidator(new \\Atezate\\Validator\\Cubos);\n }\n }\n\n return $this->_validator;\n }",
"public function getValidators()\n {\n $validators = parent::getValidators();\n if ($this->internalValue != null) {\n if ($this->internalMultiSelect) {\n // field may contain more than one value\n $validators[] = new CsvListValidator(array('message' => $this->internalValidationMessage,\n 'domain'=>array_keys($this->internalOptionList)));\n } else {\n // single value selection\n $validators[] = new InclusionIn(array('message' => $this->internalValidationMessage,\n 'domain'=>array_keys($this->internalOptionList)));\n }\n }\n return $validators;\n }",
"protected function initCache()\n {\n $this->di->set('viewCache', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $frontend = new FrontOutput(['lifetime' => $config->get('viewCache')->lifetime]);\n\n $config = $config->get('viewCache')->toArray();\n $backend = '\\Phalcon\\Cache\\Backend\\\\' . $config['backend'];\n unset($config['backend'], $config['lifetime']);\n\n return new $backend($frontend, $config);\n });\n\n $this->di->setShared('modelsCache', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $frontend = '\\Phalcon\\Cache\\Frontend\\\\' . $config->get('modelsCache')->frontend;\n $frontend = new $frontend(['lifetime' => $config->get('modelsCache')->lifetime]);\n\n $config = $config->get('modelsCache')->toArray();\n $backend = '\\Phalcon\\Cache\\Backend\\\\' . $config['backend'];\n unset($config['backend'], $config['lifetime'], $config['frontend']);\n\n return new $backend($frontend, $config);\n });\n\n $this->di->setShared('dataCache', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $frontend = '\\Phalcon\\Cache\\Frontend\\\\' . $config->get('dataCache')->frontend;\n $frontend = new $frontend(['lifetime' => $config->get('dataCache')->lifetime]);\n\n $config = $config->get('dataCache')->toArray();\n $backend = '\\Phalcon\\Cache\\Backend\\\\' . $config['backend'];\n unset($config['backend'], $config['lifetime'], $config['frontend']);\n\n return new $backend($frontend, $config);\n });\n }",
"public function getValidators() {}",
"public function cacheRevalidationDataProvider() {\n\t\treturn array (\n\t\t\t\t// Forces revalidation that passes\n\t\t\t\tarray (\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\"Pragma: no-cache\\r\\n\\r\\n\",\n\t\t\t\t\t\t\"HTTP/1.1 200 OK\\r\\nDate: \" . $this->getHttpDate ( '-100 hours' ) . \"\\r\\nContent-Length: 4\\r\\n\\r\\nData\",\n\t\t\t\t\t\t\"HTTP/1.1 304 NOT MODIFIED\\r\\nCache-Control: max-age=2000000\\r\\nContent-Length: 0\\r\\n\\r\\n\" \n\t\t\t\t),\n\t\t\t\t// Forces revalidation that overwrites what is in cache\n\t\t\t\tarray (\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\"\\r\\n\",\n\t\t\t\t\t\t\"HTTP/1.1 200 OK\\r\\nCache-Control: must-revalidate, no-cache\\r\\nDate: \" . $this->getHttpDate ( '-10 hours' ) . \"\\r\\nContent-Length: 4\\r\\n\\r\\nData\",\n\t\t\t\t\t\t\"HTTP/1.1 200 OK\\r\\nContent-Length: 5\\r\\n\\r\\nDatas\",\n\t\t\t\t\t\t\"HTTP/1.1 200 OK\\r\\nContent-Length: 5\\r\\nDate: \" . $this->getHttpDate ( 'now' ) . \"\\r\\n\\r\\nDatas\" \n\t\t\t\t),\n\t\t\t\t// Throws an exception during revalidation\n\t\t\t\tarray (\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\"\\r\\n\",\n\t\t\t\t\t\t\"HTTP/1.1 200 OK\\r\\nCache-Control: no-cache\\r\\nDate: \" . $this->getHttpDate ( '-3 hours' ) . \"\\r\\n\\r\\nData\",\n\t\t\t\t\t\t\"HTTP/1.1 500 INTERNAL SERVER ERROR\\r\\nContent-Length: 0\\r\\n\\r\\n\" \n\t\t\t\t),\n\t\t\t\t// ETag mismatch\n\t\t\t\tarray (\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\"\\r\\n\",\n\t\t\t\t\t\t\"HTTP/1.1 200 OK\\r\\nCache-Control: no-cache\\r\\nETag: \\\"123\\\"\\r\\nDate: \" . $this->getHttpDate ( '-10 hours' ) . \"\\r\\n\\r\\nData\",\n\t\t\t\t\t\t\"HTTP/1.1 304 NOT MODIFIED\\r\\nETag: \\\"123456\\\"\\r\\n\\r\\n\" \n\t\t\t\t) \n\t\t);\n\t}",
"function _can_cache() {\n\t\treturn true;\n\t}",
"protected static function validator() {\n\t\tif (empty(self::$validate)) {\n\t\t\tself::$validate = new MpoValidator();\n\t\t}\n\t\treturn self::$validate;\n\t}",
"public function getCacheInvalidator();",
"abstract protected function getAdditionalValidators(): array;",
"function getValidators() {\n $extra_validators = array();\n \n foreach ($this->_widgets as $oWidget) {\n $res = $oWidget->getValidators();\n \n if (!is_null($res)) {\n if (is_array($res)) {\n $extra_validators = kt_array_merge($extra_validators, $res);\n } else {\n $extra_validators[] = $res;\n }\n }\n }\n \n $oVF =& KTValidatorFactory::getSingleton(); \n return array($oVF->get('ktcore.validators.fieldset', array(\n 'test' => $this->sBasename, \n 'validators' => &$extra_validators,\n )));\n }",
"protected function get9c2345652e8ae3f87ba009d0f8fedee27bb751398014908e9ab2fb6d5bf1300f(): \\Viserio\\Component\\Validation\\Validator\n {\n return $this->services[\\Viserio\\Contract\\Validation\\Validator::class] = new \\Viserio\\Component\\Validation\\Validator();\n }",
"public function getValidators()\r\n\t{\r\n\t\treturn $this->_validators;\r\n\t}",
"public function getValidators();",
"public function getValidators();",
"public function getValidators();",
"public function getValidators()\n\t{\n\t\treturn $this->_validators;\n\t}",
"public function getDataValidatorCollection(): ValidatorCollection {\n\n return $this->dataValidatorCollection;\n\n }",
"public function addDefaultCacheableDependencies() {\n $request = \\Drupal::request();\n $groups = normalize_header($request->headers->get('X-Consumer-Groups', 'user'));\n $view_unpublished = in_array('view-unpublished-content', $groups);\n $this->setVary('Accept');\n $max_age = $view_unpublished ? 0 : Settings::get('jcms_rest_cache_max_age', Cache::PERMANENT);\n\n $build = [\n '#cache' => [\n 'contexts' => ['url',\n 'user.permissions',\n 'headers:X-Consumer-Groups',\n 'headers:Accept',\n 'headers:If-None-Match',\n 'headers:If-Modified-Since',\n ],\n 'max-age' => $max_age,\n ],\n ];\n\n $cache_metadata = CacheableMetadata::createFromRenderArray($build);\n $this->addCacheableDependency($cache_metadata);\n\n $this->headers->addCacheControlDirective('max-age', $max_age);\n\n if ($view_unpublished) {\n $this->setPrivate();\n $this->headers->addCacheControlDirective('must-revalidate');\n }\n else {\n $this->setPublic();\n $this->headers->addCacheControlDirective('stale-while-revalidate', 300);\n $this->headers->addCacheControlDirective('stale-if-error', 86400);\n $this->setEtag(md5($this->getContent()));\n $this->isNotModified($request);\n }\n }",
"public function getValidators()\n {\n return $this->validators;\n }",
"public function __call($validator, array $args = array())\n {\n if (!$this->lastAccessed) {\n throw new Exception('Adding validation rules prior to selecting a validator on a map is ambiguous. First access a validator, then you may add rules.');\n }\n return $this->addValidatorTo($validator, $args, $this->lastAccessed);\n }",
"public function getValidators()\n\t{\n\t\treturn $this->validators;\n\t}"
] |
[
"0.6428272",
"0.5855572",
"0.5381706",
"0.526919",
"0.5259244",
"0.518074",
"0.5179819",
"0.51365757",
"0.5071542",
"0.5068683",
"0.5008456",
"0.49863148",
"0.49823564",
"0.49667847",
"0.491619",
"0.4904371",
"0.48868635",
"0.48470363",
"0.48261854",
"0.48002827",
"0.4794555",
"0.4786904",
"0.4786904",
"0.4786904",
"0.47519287",
"0.47352466",
"0.47331965",
"0.47227845",
"0.47170296",
"0.4697569"
] |
0.6775543
|
0
|
Import an array into a schema
|
public function importSchemaArray(array $schemaArray)
{
$tables = array();
$sequences = array();
$this->schemaArray = $schemaArray;
foreach ($schemaArray as $type => $entity) {
switch ($type) {
case 'tables':
$tables = $this->importTables($entity);
break;
case 'sequence':
$sequences = $this->importSequences($entity);
break;
}
}
return new Schema($tables, $sequences);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function importFrom(array $data);",
"function import(array $data);",
"public function importArray($data);",
"public function fromArray(array $data);",
"public function fromArray(array $data);",
"public function fromArray(array $arrayData);",
"public function loadFromArray($array){\n\t\t\tforeach ($array as $key => $value) {//iterate given array key=>values\n\t\t\t\tif(in_array($key, $this->columns) || in_array($key, $this->keys)){//if this key belongs to the valid columns\n\t\t\t\t\t$this->__set($key, $value);//save it\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function import(array $data): void;",
"public function from(array $input);",
"public static function fromArray(array $data);",
"public static function arraySchema(array $array)\n {\n while (true) {\n $new_array = $array;\n array_walk($new_array, function(Generator &$generator) {\n $value = $generator->current();\n $generator->next();\n $generator = $value;\n });\n yield $new_array;\n }\n }",
"public function testOneDimensionalArrayInput() {\n $source = ['foo' => 'bar'];\n $this->expectException(MigrateException::class);\n $this->expectExceptionMessage('The input should be an array of arrays');\n $this->plugin->transform($source, $this->migrateExecutable, $this->row, 'destination_property');\n }",
"private function array_diff_schema(array $array)\r\n {\r\n $schema = $this->schema();\r\n $retval = array();\r\n foreach($schema as $field => $metadata){\r\n if( isset($array[$field]) )\r\n $retval[$field] = $array[$field];\r\n }\r\n return $retval;\r\n }",
"public function testImportDataValidationArray()\n {\n $this->commonNamespaces->add('foo', 'http://foo/');\n\n $selectAll = 'SELECT * FROM <'. $this->testGraph .'> WHERE {?s ?p ?o.}';\n\n $startResource = $this->nodeFactory->createNamedNode($this->testGraph .'res1');\n\n $this->assertCountStatementIterator(0, $this->store->query($selectAll));\n\n $this->fixture->importDataValidationArray(\n array(\n 'rdf:type' => 'foo:User',\n 'foo:has-rights' => array(\n array(\n 'rdfs:label' => 'foo',\n 'foo:knows' => array(\n 'http://rdf/type' => 'http://foaf/Person'\n )\n ),\n array(\n 'rdfs:label' => 'bar',\n 'foo:a-number' => 43\n )\n )\n ),\n $startResource,\n $this->testGraph\n );\n\n $this->assertCountStatementIterator(8, $this->store->query($selectAll));\n\n // get referenced blank node\n $result = $this->store->query('SELECT * FROM <'. $this->testGraph .'> WHERE {<'.$startResource.'> ?p ?o.}');\n $blankNode1 = array_values($result->getArrayCopy())[1]['o'];\n $blankNode2 = array_values($result->getArrayCopy())[2]['o'];\n\n $result = $this->store->query('SELECT * FROM <'. $this->testGraph .'> WHERE {<'.$blankNode1.'> ?p ?o.}');\n $blankNode3 = $result->getArrayCopy()[1]['o'];\n\n // expect\n $expectedResult = new SetResultImpl(array(\n array(\n 's' => $startResource,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('rdf') .'type'),\n 'o' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'User')\n ),\n // has-rights entry 1\n array(\n 's' => $startResource,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'has-rights'),\n 'o' => $blankNode1\n ),\n array(\n 's' => $blankNode1,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('rdfs') .'label'),\n 'o' => $this->nodeFactory->createLiteral('foo')\n ),\n array(\n 's' => $blankNode1,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'knows'),\n 'o' => $blankNode3\n ),\n // sub reference\n array(\n 's' => $blankNode3,\n 'p' => $this->nodeFactory->createNamedNode('http://rdf/type'),\n 'o' => $this->nodeFactory->createNamedNode('http://foaf/Person')\n ),\n // has-rights entry 2\n array(\n 's' => $startResource,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'has-rights'),\n 'o' => $blankNode2\n ),\n array(\n 's' => $blankNode2,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('rdfs') .'label'),\n 'o' => $this->nodeFactory->createLiteral('bar')\n ),\n array(\n 's' => $blankNode2,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'a-number'),\n 'o' => $this->nodeFactory->createLiteral('43')\n ),\n ));\n $expectedResult->setVariables(array('s', 'p', 'o'));\n\n $this->assertSetIteratorEquals(\n $expectedResult,\n $this->store->query($selectAll)\n );\n }",
"protected function normalizeSchema(array $schema): array\n {\n $result = [];\n foreach ($schema as $field => $definition) {\n //Short definition\n if (is_string($definition)) {\n if (class_exists($definition)) {\n //Singular nested model\n $result[$field] = [\n 'class' => $definition,\n 'source' => null,\n 'origin' => $field,\n 'multiple' => false\n ];\n } else {\n //Simple scalar field definition\n list($source, $origin) = $this->parseDefinition($field, $definition);\n $result[$field] = compact('source', 'origin');\n }\n\n continue;\n }\n\n //Complex definition\n if (is_array($definition)) {\n if (!empty($definition[self::DATA_ORIGIN])) {\n $origin = $definition[self::DATA_ORIGIN];\n\n //[class, 'data:something.*']\n $multiple = strpos($origin, '.*') !== false;\n $origin = rtrim($origin, '.*');\n } else {\n $origin = $field;\n $multiple = true;\n }\n\n // print_r()\n\n //Array of models (default isolation prefix)\n $map = [\n 'class' => $definition[self::NESTED_CLASS],\n 'source' => null,\n 'origin' => $origin,\n 'multiple' => $multiple\n ];\n\n if ($multiple && !empty($definition[self::ITERATION_SOURCE])) {\n //When multiple records we might have iteration flag\n $map['iterate'] = $definition[self::ITERATION_SOURCE];\n } else {\n //Default iteration over origin\n $map['iterate'] = $map['origin'];\n }\n\n $result[$field] = $map;\n }\n }\n\n return $result;\n }",
"public function import(array $array): \\WPKG\\Interfaces\\Packages\n {\n $packages = new \\WPKG\\Packages();\n\n // If we have main structure mode\n if (isset($array['@attributes'])) {\n // Parse single package\n $this->parse_package($packages, $array);\n } else {\n // Parse array of packages\n foreach ($array as $item) {\n $this->parse_package($packages, $item);\n }\n }\n\n return $packages;\n }",
"public function schema();",
"function populateFromArray(array $arr);",
"function populateFromArray(array $arr);",
"public function parseFromArray()\n {\n $this->value = $this->reader->next();\n }",
"public function fromArray(array $array){\n if(array_key_exists($this->idField, $array)){//verifica se possui id se sim seta o id;\n $this->{$this->idField} = $array[$this->idField];\n }\n $this->content = $array;\n }",
"public static function fromData(array $data);",
"public function fromArray(array $data)\n {\n parent::fromArray($data);\n $this->parseDynamicProperties($data);\n }",
"public static function createSchema(): array\n {\n return [\n 'type' => 'string',\n 'minLength' => 0,\n 'maxLength' => 65535,\n 'example' => 'Lorem Ipsum',\n ];\n }",
"public function meta(array $meta): ISchemaBuilder;",
"function importSchema(){\n\t\t\t$this->exportsSchema = false;\n\t\t}",
"public function ParseFromArray() {\n $this->value = $this->reader->next();\n $this->clean();\n }",
"private function dataConvert($array)\n {\n $result = false;\n if(count($array) && isset($array[0]) && is_array($array[0]))\n {\n $class = get_class($this);\n foreach($array as $arr)\n {\n $result[] = new $class((int) $arr[$this->primaryName]);\n }\n }\n else if(count($array))\n {\n $class = get_class($this);\n $result = new $class((int) $array[$this->primaryName]);\n }\n return $result;\n }",
"public function addRowsFromSimpleArray($array)\n {\n if (count($array) === 0) {\n return;\n }\n\n // we define an exception we may throw if at one point we notice that we cannot handle the data structure\n $e = new Exception(\" Data structure returned is not convertible in the requested format.\" .\n \" Try to call this method with the parameters '&format=original&serialize=1'\" .\n \"; you will get the original php data structure serialized.\" .\n \" The data structure looks like this: \\n \\$data = \" . var_export($array, true) . \"; \");\n\n\n // first pass to see if the array has the structure\n // array(col1_name => val1, col2_name => val2, etc.)\n // with val* that are never arrays (only strings/numbers/bool/etc.)\n // if we detect such a \"simple\" data structure we convert it to a row with the correct columns' names\n $thisIsNotThatSimple = false;\n\n foreach ($array as $columnValue) {\n if (is_array($columnValue) || is_object($columnValue)) {\n $thisIsNotThatSimple = true;\n break;\n }\n }\n if ($thisIsNotThatSimple === false) {\n // case when the array is indexed by the default numeric index\n if (array_keys($array) == array_keys(array_fill(0, count($array), true))) {\n foreach ($array as $row) {\n $this->addRow(new Piwik_DataTable_Row(array(Piwik_DataTable_Row::COLUMNS => array($row))));\n }\n } else {\n $this->addRow(new Piwik_DataTable_Row(array(Piwik_DataTable_Row::COLUMNS => $array)));\n }\n // we have converted our simple array to one single row\n // => we exit the method as the job is now finished\n return;\n }\n\n foreach ($array as $key => $row) {\n // stuff that looks like a line\n if (is_array($row)) {\n /**\n * We make sure we can convert this PHP array without losing information.\n * We are able to convert only simple php array (no strings keys, no sub arrays, etc.)\n *\n */\n\n // if the key is a string it means that some information was contained in this key.\n // it cannot be lost during the conversion. Because we are not able to handle properly\n // this key, we throw an explicit exception.\n if (is_string($key)) {\n throw $e;\n }\n // if any of the sub elements of row is an array we cannot handle this data structure...\n foreach ($row as $subRow) {\n if (is_array($subRow)) {\n throw $e;\n }\n }\n $row = new Piwik_DataTable_Row(array(Piwik_DataTable_Row::COLUMNS => $row));\n } // other (string, numbers...) => we build a line from this value\n else {\n $row = new Piwik_DataTable_Row(array(Piwik_DataTable_Row::COLUMNS => array($key => $row)));\n }\n $this->addRow($row);\n }\n }",
"public function arrayToObject($array): static;"
] |
[
"0.68859154",
"0.6763403",
"0.66221213",
"0.6036444",
"0.6036444",
"0.6024483",
"0.5979696",
"0.59485394",
"0.57933646",
"0.56064415",
"0.5589222",
"0.5561158",
"0.5514064",
"0.5458698",
"0.5443257",
"0.544115",
"0.54255587",
"0.5415816",
"0.5415816",
"0.53958845",
"0.5362562",
"0.5355447",
"0.534804",
"0.5343042",
"0.53426224",
"0.533707",
"0.53254765",
"0.5280137",
"0.52711385",
"0.5255624"
] |
0.6847396
|
1
|
Check if emails address are set
|
private function checkEmailSettings(): bool
{
return (is_array($this->properties['mail_recipients']) || is_array($this->properties['mail_bcc']));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function hasEmailAddress()\n {\n return $this->_hasVar('user_email') && $this->_getVar('user_email');\n }",
"public function hasEmail() {\n return $this->_has(4);\n }",
"public function isAtLeastOneKnownEmailAddress($_);",
"public function emailEntryIsValid() {\r\n \r\n $email = $this->getEmail();\r\n \r\n if ( empty($email) ) {\r\n $this->errors[\"email\"] = \"Email is missing.\";\r\n } else if ( !Validator::emailIsValid($this->getEmail()) ) {\r\n $this->errors[\"email\"] = \"Email is not valid.\"; \r\n }\r\n \r\n return ( empty($this->errors[\"email\"]) ? true : false ) ;\r\n }",
"public function has_email() {\r\n $options = get_option( 'myhome_redux' );\r\n if ( array_key_exists( 'mh-agent-email_show', $options ) && empty( $options['mh-agent-email_show'] ) ) {\r\n return false;\r\n }\r\n return ! empty( $this->email );\r\n }",
"public function _check_email_exists($email = ''){\n\t\t\n\t}",
"public function isEmail();",
"public function hasEmail(): bool;",
"function _elastic_email_has_valid_settings() {\n $site_mail = variable_get('site_mail', NULL);\n $username = variable_get(ELASTIC_EMAIL_USERNAME, NULL);\n $api_key = variable_get(ELASTIC_EMAIL_API_KEY, NULL);\n\n if (is_null($site_mail) || $site_mail == '') {\n return FALSE;\n }\n if (is_null($username) || $username == '') {\n return FALSE;\n }\n if (is_null($api_key) || $api_key == '') {\n return FALSE;\n }\n return TRUE;\n}",
"private static function is_email_address(string $username)\n {\n }",
"function checkMAIL($account, $email)\n {\n while ($users = $account->fetch()) {\n if ($users['email'] == $email) {\n return true;\n }\n }\n return false;\n }",
"public function isCheckEmail()\n {\n if( (!$this -> zgloszePozniej) && ($this -> emailAtt2User == '') ) :\n return false;\n endif;\n return true;\n }",
"function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}",
"public function hasContactEmail() {\n\t\treturn $this->contactEmail !== null;\n\t}",
"public function verifyContainsEmail(): bool\n {\n $words = explode(' ', $this->input);\n foreach ($words as $word) {\n if (static::isValidEmail($word)) {\n return true;\n }\n }\n \n return false;\n }",
"public function email_check($str) {\n //if(!empty($str) && $this->get_by(\"email\", $str))\n // return FALSE;\n return TRUE;\n }",
"public function isEmail()\n {\n return filter_var($this->_value, FILTER_VALIDATE_EMAIL);\n }",
"public function testMyGmailAddressIsEvaluatedAsTrue()\n {\n $this->assertTrue(EmailValidator::validate(\"[email protected]\"));\n }",
"public function is_valid_email()\r\n {\r\n // email address.\r\n\r\n return (!empty($this->address) && preg_match($this->re_email, $this->address));\r\n }",
"public function emailEntryIsValid() {\r\n if (array_key_exists(\"email\", $_POST) )\r\n {\r\n if ( !Validator::emailIsValid($_POST[\"email\"]) )\r\n {\r\n $this->errors[\"email\"] = \"Email is not valid!\"; // if the email is not valid then the error will be filled with this message\r\n }\r\n }\r\n else\r\n {\r\n $this->errors[\"email\"] = \"Email is required!\"; // if the email is not entered then the error will be filled with this message\r\n }\r\n \r\n return ( empty($this->errors[\"email\"]) ? true : false ); // if there are no errors then this will return true, if the error messege is filled with something it will return false\r\n }",
"public function _check_emails($field) {\n\t\t$emails = $this->{$field};\n\t\t$err = '';\n\t\tif ($emails) {\n\t\t\t$arr = explode(\",\", $emails);\n\t\t\tforeach($arr as $email) {\n\t\t\t\t$email = trim($email);\n\t\t\t\tif (!$this->form_validation->valid_email($email)) {\n\t\t\t\t\t$err .= \"Recipient email \" . $email . \" is not valid.<br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $err;\n\t}",
"private function setEmail($param)\n {\n $this->email = $param;\n\n if (filter_var($param, FILTER_VALIDATE_EMAIL)) {\n return true;\n } else {\n return false;\n }\n }",
"private function process_email($value)\n {\n return (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n }",
"function emailOk ($email) {\r\n return filter_var($email, FILTER_VALIDATE_EMAIL);\r\n }",
"public static function email($value){\n\t\treturn (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n\t}",
"function is_email_address_unsafe($user_email)\n {\n }",
"public function checkIfEmailExists($email);",
"function isEmailAddress($field, $msg, $inner=FALSE){\n\t\t$value = $this->_getValue($field);\n\t\t$pattern =\"/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z.]{2,4}$/\";\n\t\tif(preg_match($pattern, $value)){\n\t\treturn true;\n\t\t}else{\n\t\tif($inner==FALSE){\n $this->_errorList[] = array(\"field\" => $field,\n\t\t\"value\" => $value, \"msg\" => $msg);\n\t\treturn false;\n }else{\n return false;\n }\n\t\t}\n\t}",
"private function checkEmail($data) {\n\t\tif(filter_var($data, FILTER_VALIDATE_EMAIL)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function emailExists($f): bool\n {\n $exists = false;\n if(!empty($this->load(array('email=?',$f->get('POST.login_email'))))){\n $exists = true;\n }\n return $exists;\n }"
] |
[
"0.7523305",
"0.7142451",
"0.70602167",
"0.7007984",
"0.6857006",
"0.6837056",
"0.6783906",
"0.6782888",
"0.67423046",
"0.6739507",
"0.65890807",
"0.65847975",
"0.65816605",
"0.6527485",
"0.6523064",
"0.6481505",
"0.6472178",
"0.64708495",
"0.64679456",
"0.64152646",
"0.64010817",
"0.6395714",
"0.63796717",
"0.63470083",
"0.63401073",
"0.6336272",
"0.63257056",
"0.62980604",
"0.62913114",
"0.62869143"
] |
0.7175426
|
1
|
Update the user instance, in the UserStatusCache. This is a general update method, telling the UserStatusCache to rebuild one employee record, which is then stored back to the redis instance
|
public function updateUser($employee_id)
{
$userCache = new UserStatusCache($this->cache[$this->userKey]);
$this->cache[$this->userKey] = $userCache->updateUser($employee_id);
return $this->_store();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updated(User $user)\n {\n $this->clearCache($this->key);\n }",
"public function testUpdateStatusByUserId()\n {\n $session = $this->objectManager->create(\\Magento\\Security\\Model\\AdminSessionInfo::class);\n /** @var $session \\Magento\\Security\\Model\\AdminSessionInfo */\n $session->getResource()->updateStatusByUserId(\n \\Magento\\Security\\Model\\AdminSessionInfo::LOGGED_OUT_BY_LOGIN,\n 1,\n [1],\n [1],\n '2016-01-19 12:00:00'\n );\n $collection = $session->getResourceCollection()\n ->addFieldToFilter('main_table.user_id', 1)\n ->addFieldToFilter('main_table.status', \\Magento\\Security\\Model\\AdminSessionInfo::LOGGED_OUT_BY_LOGIN)\n ->load();\n $count = $collection->count();\n $this->assertGreaterThanOrEqual(1, $count);\n }",
"public function update_account() {\n global $dbconfig;\n\n $user_id = $this->params['user_id'];\n $status = isset($this->params['status']) ? $this->params['status'] : BLOCKED;\n $account_dbobj = $this->params['account_dbobj'];\n $user_status = BLOCKED;\n $store_status = PENDING;\n\n if($status === ACTIVATED) {\n $user_status = CREATED;\n $store_status = PENDING;\n }\n\n // update users table\n $user_obj = new User($account_dbobj, $user_id);\n $user_obj->setStatus($status);\n $user_obj->save();\n\n $user = BaseModel::findCachedOne($dbconfig->account->name . \".user?id=$user_id\");\n if(!empty($user['store_id'])){\n $store_id = $user['store_id'];\n // store need to manually launch\n $store_obj = new Store($account_dbobj, $store_id);\n if($store_obj->getId()) {\n $store_obj->setStatus($store_status);\n $store_obj->save();\n if($store_status != ACTIVATED){\n GlobalProductsMapper::deleteProductsInStore($account_dbobj, $store_id);\n }\n }\n }\n }",
"function update_user_caches($user)\n {\n }",
"public function update(User $user, Employee $employee)\n {\n // Update $user authorization to update $employee here.\n return true;\n }",
"public function update()\n { if (is_null($this->id))\n trigger_error(\"User::update(): Attempt to update a User object that does not have its ID property set.\", E_USER_ERROR);\n \n // Update the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"UPDATE users SET user_name=:user_name, user_password_hash=:user_password_hash, user_email=:user_email, orcid=:orcid, orcid_code=:orcid_code, orcid_access_token=:orcid_access_token WHERE user_id = :id\";\n $st = $conn->prepare($sql);\n $st->bindValue(\":user_name\", $this->userName, PDO::PARAM_STR);\n $st->bindValue(\":user_password_hash\", $this->userPasswordHash, PDO::PARAM_STR);\n\t$st->bindValue(\":user_email\", $this->userEmail, PDO::PARAM_STR);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR);\n $st->bindValue(\":orcid_code\", $this->orcidCode, PDO::PARAM_STR);\n $st->bindValue(\":orcid_access_token\", $this->orcidAccessToken, PDO::PARAM_STR);\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }",
"public function testUpdateUser()\n {\n }",
"public function update_user_status(){\n\tif($this->session->userdata('logged_in')){\n\t\t//cleanup old logins\n\t\t$this->um_users_model->cleanup_expired_logins();\n\t\t//report the current status\n\t\t$session_data= $this->session->userdata('logged_in');\n\t\t$dbdata=array(\n\t\t\t'loggedusername'=>$session_data['username'],\n\t\t\t'ip'=>$this->session->userdata('ip_address'),\n\t\t\t'lastactivity'=>time(),\n\t\t\t'useragent'=>$this->session->userdata('user_agent'),\n\t\t\t'online'=>$this->um_users_model->get_user_online_setting($session_data['username'])\n\t\t);\n\t\t\n\t\tif($this->um_users_model->is_user_logged_in($session_data['username'])){\n\t\t\t$this->um_users_model->update_user_logged_in($session_data['username'],$dbdata);\n\t\t}else{\n\t\t\t$this->um_users_model->register_user_as_logged_in($dbdata);\n\t\t}\n\t\n\t}\n\t}",
"public function updating(User $user)\n{\n $userBeforeUpdated = $this->userRepository->find($user->id);\n\n $this->userService->trackUserActivity(Auth::id(),User::class, config('constants.TRACK_USER_FIELDS'),\n $userBeforeUpdated, $user);\n}",
"private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }",
"public function update($user)\n {\n }",
"function updateUser() {\n\t\t$rating = $this -> getTaskRating();\n\t\t$sql = \"Update Users set finishedBasic=1, userRating=userRating+\" . $rating . \" where UID= (Select t.UID from Task t WHERE t.TaskId=\" . $this -> data[0]['TaskId'] . \")\";\n\t\t$stmt = $this -> DB -> prepare($sql);\n\t\tif ($stmt -> execute()) {\n\t\t\t$this -> checkforLast();\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'to update user with TaskId=' . $this -> data[0]['TaskId'], $this -> id);\n\t\t}\n\t}",
"public function update(User $user, Employee $employee)\n {\n return $user->role == 'admin';\n }",
"public function updating(User $user)\n {\n //\n }",
"public function update(User $user): void\n {\n }",
"public function updateUser($data) {\n\t\t\n\t}",
"function update_user($user_id, $user_data) {\r\n\t\t//update user table with new values\r\n\t\ttry {\r\n\t\t\t$this->db->start_cache();\r\n\t\t\t$this->db->where('user_id', $user_id);\r\n\t\t\t$user_succes = $this->db->update('user', $user_data);\r\n\t\t\t$this->db->stop_cache();\r\n\t\t\t$this->db->flush_cache();\r\n\t\t\treturn true;\r\n\t\t} catch (Exception $e){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }",
"public function updated(User $user)\n {\n //\n }"
] |
[
"0.6298718",
"0.61957264",
"0.61507803",
"0.6100758",
"0.60406333",
"0.59774435",
"0.58933675",
"0.5801117",
"0.5796477",
"0.5773943",
"0.573352",
"0.5694264",
"0.5693654",
"0.5673879",
"0.5662777",
"0.5607955",
"0.55879724",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936",
"0.5581936"
] |
0.6971259
|
0
|
Gets the instance from redis. If null, return the initialize cache with defaults, otherwise, decode the JSON and return
|
private function _registerCache()
{
$c = $this->redis->redis->get($this->clientPrefix);
if (!$c) {
return $this->_initializeCache();
}
return json_decode($c, true, JSON_UNESCAPED_UNICODE);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"final public function get():? object\n\t{\n\t\tif ($stm = $this->_prepare('SELECT `value`,\n\t\t\t\tDATE_FORMAT(`expires`, \"%Y-%m-%dT%TZ\") AS `expires`\n\t\t\t\t FROM `Cache`\n\t\t\t\t WHERE `key` = :key\n\t\t\t\t LIMIT 1;')\n\t\t) {\n\t\t\t$stm->execute(['key' => $this->getKey()]);\n\n\t\t\tif ($result = $stm->fetchObject()) {\n\t\t\t\tprint_r($result);\n\t\t\t\treturn $result;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public function getFromCache() {}",
"private function getRedis()\r\n {\r\n if ($this->redis === null) {\r\n $this->redis = new PredisClient($this->redis_options);\r\n }\r\n\r\n return $this->redis;\r\n }",
"protected function getFromCache()\n {\n return $this->cache->get($this->getCacheKey());\n }",
"public function cache(): object\n {\n return $this->baseApp($this)->loadCache();\n }",
"public function redis_instance()\n {\n return $this->redis;\n }",
"function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }",
"public function get()\n {\n return Cache::get($this->cacheKey);\n }",
"public function factory()\n {\n $redis = new \\Redis();\n $host = $this->getConfig()->getValue(self::CONFIG_HOST);\n $port = $this->getConfig()->getValue(self::CONFIG_PORT);\n $timeout = $this->getConfig()->getValue(self::CONFIG_TIMEOUT);\n\n if ($this->getConfig()->getValueFlag(self::CONFIG_PERSISTENT)) {\n $redis->pconnect($host, $port, $timeout);\n } else {\n $redis->connect($host, $port, $timeout);\n }\n\n if ($this->getConfig()->hasValue(self::CONFIG_DATABASE)) {\n $redis->select($this->getConfig()->getValue(self::CONFIG_DATABASE));\n }\n\n return $redis;\n }",
"public function getObjFromCache($key);",
"private function getCacheServer()\n {\n /**\n * The configuration options are encapsulated in a class called RedisOptions\n * Here we setup the server configuration using the values from our config file\n */\n $redis_options = new RedisOptions();\n $redis_options->setServer(array(\n 'host' => self::$__endpoint,\n 'port' => self::$__port,\n 'timeout' => self::$__timeout\n ));\n // /**\n // * This is not required, although it will allow to store anything that can be serialized by PHP in Redis\n // */\n // $redis_options->setLibOptions ( array (\n // Redis::OPT_SERIALIZER => Redis::SERIALIZER_PHP\n // ) );\n \n /**\n * We create the cache passing the RedisOptions instance we just created\n */\n $redis_cache = new Redis($redis_options);\n \n return $redis_cache;\n }",
"protected function readFromCache()\r\n {\r\n $result = null;\r\n if(extension_loaded('apc') && ini_get('apc.enabled')) {\r\n $result = apc_fetch($this->getCacheKey());\r\n }\r\n return $result;\r\n }",
"public static function getClient(){\n $redis=new \\Redis();\n $redis->connect(self::CLIENT_CONF['host'], self::CLIENT_CONF['port']);\n $redis->auth(self::CLIENT_CONF['password']);\n return $redis;\n }",
"function getCache() {\n\t\tif (!is_a($this->_cache, 'PubObjectCache')) {\n\t\t\t// Instantiate the cache.\n\t\t\timport('classes.plugins.PubObjectCache');\n\t\t\t$this->_cache = new PubObjectCache();\n\t\t}\n\t\treturn $this->_cache;\n\t}",
"public function getCache() {\n\t\treturn $this->get('Cundd\\\\Rest\\\\Cache\\\\Cache');\n\t}",
"protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}",
"public function getCaching()\n {\n return (!is_null($this->_cache) ? $this->_cache : Cache::instance('redis'));\n }",
"public function getCache()\n\t{\n\t\tif( ! $this->cache_on)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(isset($this->cache_obj))\n\t\t{\n\t\t\treturn $this->cache_obj;\n\t\t}\n\t\t\n\t\t$class = 'Db_Cache_'.$this->cachedrv;\n\t\t\n\t\t$this->cache_obj = new $class($this->cacheopt);\n\t\t\n\t\treturn $this->cache_obj;\n\t}",
"public static function getObject()\n\t{\n\t\tif (class_exists(\"Memcache\"))\n\t\t{\n\t\t\tself::$_memcache = new Memcache;\n\t\t\tif (!self::$_memcache->connect(\"localhost\", 11211)) return self::createObject();\n\n\t\t\tif (self::$_memcache->get(\"customer_object\")) return self::$_memcache->get(\"customer_object\");\n\t\t\telse return self::createObject();\n\t\t}\n\t\telse return self::createObject();\n\t}",
"protected function get_cache() {\n\t\n // uncomment next line to flush previous cache\n\t //delete_transient($this->get_cache_id()); \n\t\n \treturn get_transient( $this->get_cache_id() ); \t \n\t}",
"protected function getObject()\n\t{\n\t\tif( !isset( $this->object ) ) {\n\t\t\t$this->object = \\Aimeos\\MAdmin\\Cache\\Manager\\Factory::createManager( $this->context )->getCache();\n\t\t}\n\n\t\treturn $this->object;\n\t}",
"function get_cache(Repository $repo) {\n $key = cache_key($repo);\n $data = get_transient($key);\n if ($data !== false) {\n return json_decode($data, true);\n }\n return false;\n}",
"public function getCache()\n\t{\n\t\treturn CacheBot::get($this->getCacheKey(), self::$objectCacheLife);\n\t}",
"public function fromCache()\n {\n try {\n $cache = $this->cache->get('config');\n\n if ($cache === false) {\n $cache = array_merge($this->_defaults, $this->getFromDb());\n $this->cache->set('config', $cache);\n }\n\n return $cache;\n }\n catch (Exception $e) {\n Log::error($e->getMessage(), null, __METHOD__);\n }\n }",
"abstract public function getCache( $cacheID = '', $unserialize = true );",
"public function resolveConnection() {\n if ( !is_null($this->redis) ) return $this->redis;\n\n $parameters = $this->parameters ?: getenv('REDIS_URL') ?: 'tcp://127.0.0.1/6379?database=0';\n\n $this->redis = new Client($parameters);\n\n return $this->redis;\n }",
"private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }",
"public static function GetConnectedInstance()\n {\n static $predis = null;\n\n if ($predis === null) {\n Predis\\Autoloader::register();\n $predis = new Predis\\Client('tcp://kong.idlemonkeys.net:6379');\n }\n \n return $predis;\n }",
"function getCache() {\n\t\t// The following line is only for classloading purposes\n\t\t$categoryEntryDao =& $this->getEntryDAO();\n\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\n\t\t// Load and return the cache, building it if necessary.\n\t\t$filename = $this->getCacheFilename();\n\t\tif (!file_exists($filename)) $this->rebuildCache();\n\t\t$contents = file_get_contents($filename);\n\t\tif ($contents) return unserialize($contents);\n\t\treturn null;\n\t}",
"protected function loadFromCache() {}"
] |
[
"0.65016353",
"0.6431258",
"0.63532627",
"0.6242545",
"0.62417674",
"0.6087946",
"0.5987125",
"0.5945368",
"0.5934931",
"0.5924502",
"0.59211254",
"0.58878374",
"0.58725595",
"0.58721983",
"0.5869368",
"0.582788",
"0.5804456",
"0.57975554",
"0.57734585",
"0.5744098",
"0.5739157",
"0.57388616",
"0.57380855",
"0.57296044",
"0.57279545",
"0.57236147",
"0.57072073",
"0.5687905",
"0.56829",
"0.56576025"
] |
0.65568906
|
0
|
checks for substring in an array
|
function substr_in_array($needle, array $haystack){
foreach($haystack as $item){
if(false !== strpos($item, $needle)){
return false;
}
}
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function array_contains_part_of_string ($string, $array) {\n\tforeach ($array as $value) {\n\t\t//if (strstr($string, $url)) { // mine version\n\t\tif (strpos($string, $value) !== FALSE) { // Yoshi version\n\t\t\treturn true;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}\n return false;\n\t\n}",
"function isstr($array, $text)\n{\nif(strpos($text, $array) === false) {\nreturn false;\n} else {\nreturn true;\n}\n}",
"function arrayContains($str, array $arr)\t{\r\n\t\t//write_log(\"Function Fired.\");\r\n\t\t$result = array_intersect($arr,explode(\" \",$str));\r\n\t\tif (count($result)==1) $result = true;\r\n\t\tif (count($result)==0) $result = false;\r\n\t\treturn $result;\r\n\t}",
"function get_array_containing_part_of_string ($string, $array) {\n\tforeach ($array as $value) {\n\t\t//if (strstr($string, $url)) { // mine version\n\t\tif (strpos($string, $value) !== FALSE) { // Yoshi version\n\t\t\treturn $value;\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t}\n return false;\n\t\n}",
"function contains($str, array $arr) {\n foreach( $arr as $a ) {\n if ( stripos($str, $a) !== false ) {\n \treturn true;\n }\n }\n return false;\n}",
"static function haveSubstring(string|array $str, string|array $substring, bool $caseSensitive = true): bool {\n if (\\is_array($str)) {\n foreach ($str as $s) {\n if (self::haveSubstring($s, $substring)) {\n return true;\n }\n }\n\n return false;\n }\n if (\\is_array($substring)) {\n foreach ($substring as $ss) {\n if (self::haveSubstring($str, $ss)) {\n return true;\n }\n }\n\n return false;\n }\n\n return (bool) preg_match('!\\\\b\\\\Q'.$substring.'\\\\E\\\\b!'.($caseSensitive ? '' : 'i'), $str);\n }",
"function search_array($string, $array) {\r\n foreach($array as $entry) {\r\n // searches substring $string in $entry\r\n if (strpos($entry, $string) !== false) {\r\n return $entry;\r\n }\r\n }\r\n }",
"protected static function multi_instring($haystack, $needle_array) {\n foreach ($needle_array as $needle) {\n if (strpos($haystack, $needle) !== false) {\n return $needle;\n }\n }\n\n return false;\n }",
"function strinarray($searchtext, $dataarray)\r\n{\r\n$i=0;\r\nforeach($dataarray as $linedata) {\r\n if(strstr($linedata,$searchtext)) break;\r\n $i++;\r\n };\r\nreturn $i;\r\n}",
"function startswith($haystack, $needle) {\n if (is_array($haystack)) {\n foreach($haystack as $hay) {\n if(substr($hay, 0, strlen($needle)) == $needle) {\n return true;\n }\n }\n //return in_array($needle, $haystack);\n return false;\n } else {\n return (substr($haystack, 0, strlen($needle)) == $needle);\n }\n}",
"function case_in_array($string,$array){\n\t\tforeach($array as $val){\n\t\t\tif(strcasecmp($string, $val) == 0) return true;\n\t\t}\n\t\treturn false;\n\t}",
"function str_contains($haystack, $needles) {\n foreach ((array) $needles as $needle) {\n if ($needle != '' && strpos($haystack, $needle) !== false) {\n return true;\n }\n }\n return false;\n}",
"public static function arrayItemInString($array, $string)\n {\n if (!Arrays::isArray($array, false)) {\n return false;\n }\n foreach ($array AS $item) {\n if (!stristr($string, $item) === false) {\n return true;\n }\n }\n\n return false;\n }",
"function _strDetect ($needles, $offset) {\r\n foreach ($needles as $needle) {\r\n $l = strlen ($needle);\r\n if (substr ($this->_text, $offset, $l) == $needle) {\r\n return $needle;\r\n }\r\n }\r\n return false;\r\n }",
"private function contains($str, array $arr)\n {\n foreach ($arr as $a) {\n if (stripos($str, $a) !== false) {\n return true;\n }\n }\n return false;\n }",
"public static function in_iarray($str, $a){\r\r\n\t\tforeach($a as $v){\r\r\n\t\t\t\r\r\n\t\t\tif(strcasecmp($str, $v)==0){return true;}\r\r\n\t\t\t\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\treturn false;\r\r\n\t}",
"function contains_all($str,array $words) {\r\n if(!is_string($str))\r\n { return false; }\r\n\r\n foreach($words as $word) {\r\n if(!is_string($word) || stripos($str,$word)===false)\r\n { return false; }\r\n }\r\n return true;\r\n}",
"function preg_match_array($regexArray, $str) {\r\n foreach ($regexArray as $p) {\r\n $trimP = trim($p);\r\n if ($trimP != '') {\r\n if (preg_match('/' . $trimP . '/', $str)) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}",
"function eregiArray ($Array, $string)\n{\n\t// loop through the array\n\tfor ($i=0; $i<count($Array); $i++)\n\t{\n\t\tif (eregi($Array[$i],$string)) return true;\n\t}\n\treturn false;\n}",
"function contains($haystack, $needles)\n{\n foreach ((array) $needles as $needle) {\n if ($needle !== '' && mb_strpos($haystack, $needle) !== false) {\n return true;\n }\n }\n return false;\n}",
"public function testAnArrayValueIsInTheHaystackCaseInsensitive()\n {\n $needle = [\"foo\"];\n $haystack = \"Foo Bar Baz\";\n $this->assertTrue(Strings::contains($haystack, $needle, false));\n }",
"function searchArray($string, $array) {\n $result = array_search($string, $array);\n if($result === false) {\n return false;\n } else {\n return true;\n }\n}",
"public static function str_istarts_with_any(string $str, array $substrings): bool\n {\n if ($str === '') {\n return false;\n }\n\n if ($substrings === []) {\n return false;\n }\n\n foreach ($substrings as &$substring) {\n if (self::str_istarts_with($str, (string) $substring)) {\n return true;\n }\n }\n\n return false;\n }",
"public function testAnArrayValueIsNotInTheHaystackCaseInsensitive()\n {\n $needle = [\"Bin\"];\n $haystack = \"foo bar baz\";\n $this->assertFalse(Strings::contains($haystack, $needle, false));\n }",
"function strpos_array(string $haystack, array $needles) {\r\n\tif(is_array($needles)) {\r\n\t\tif(count($needles) == 0)\r\n\t\t\treturn false;\r\n\t\tforeach ($needles as $str) {\r\n\t\t\tif ( is_array($str) ) {\r\n\t\t\t\t$pos = strpos_array($haystack, $str);\r\n\t\t\t} else {\r\n\t\t\t\t$pos = strpos($haystack, $str);\r\n\t\t\t}\r\n\t\t\tif ($pos !== FALSE) {\r\n\t\t\t\treturn $pos;\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\treturn strpos($haystack, $needles);\r\n\t}\r\n}",
"public static function str_starts_with_any(string $str, array $substrings): bool\n {\n if ($str === '') {\n return false;\n }\n\n if ($substrings === []) {\n return false;\n }\n\n foreach ($substrings as &$substring) {\n if (self::str_starts_with($str, (string) $substring)) {\n return true;\n }\n }\n\n return false;\n }",
"function str_in_array($needle, $haystack)\n\t{\n\n\t\tforeach($haystack as $k => $v)\n\t\t{\n\t\t\tif(strpos($v, $needle) !== false)\n\t\t\t{\n\n\t\t\t\treturn array(\n\t\t\t\t\t\"strpos\" => array(\n\t\t\t\t\t\t\"key\" => $k,\n\t\t\t\t\t\t\"pos\" => strpos($v, $needle)\n\t\t\t\t\t),\n\t\t\t\t\t\"target_full_str\" => $v\n\t\t\t\t);\n\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t}",
"function contains_word($haystack, array $needles)\n {\n foreach($needles as $a) {\n if (stripos($haystack,$a) !== false) return true;\n }\n return false;\n }",
"function in_array_nocase($needle, $haystack)\n{\n $needle = mb_strtolower($needle);\n foreach ($haystack as $value)\n if ($needle===mb_strtolower($value))\n return true;\n \n return false;\n}",
"function contains($substring, $string)\n{\n\t$pos = strpos($string, $substring);\n\tif ($pos === FALSE) {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\n}"
] |
[
"0.73388267",
"0.7300843",
"0.7022611",
"0.69680536",
"0.69110286",
"0.6648916",
"0.6603862",
"0.6534125",
"0.6533907",
"0.65057665",
"0.637638",
"0.6328634",
"0.63107437",
"0.6281194",
"0.6264901",
"0.62555754",
"0.6229908",
"0.621313",
"0.6182785",
"0.61764646",
"0.6171749",
"0.61409456",
"0.60958314",
"0.60288775",
"0.6018467",
"0.60079825",
"0.60070854",
"0.599594",
"0.5962405",
"0.5959741"
] |
0.763976
|
0
|
/ Return MySQL default port
|
public function getDefaultPort() {
return 3306;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function defaultPort()\n {\n return getservbyname($this->scheme ? $this->scheme : 'http', 'tcp');\n }",
"public function getDefaultPort()\n {\n return 5432;\n }",
"public function port() {\n return $this->db['port'];\n }",
"public function getDbPort(): string\n {\n return (string) Config::get('DB_PORT');\n }",
"static function Port ()\n\t\t{\n\t\t\tif (php_sapi_name() === \"cli\")\n\t\t\t\treturn NULL;\n\t\t\treturn isset ($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : \"\";\n\t\t}",
"public function getPort() {\n return $this->getConfig('port', $this->defaults['port']);\n }",
"protected function getDefaultPort()\n {\n return $this->scheme !== '' ? static::$defaultPorts[$this->scheme] : null;\n }",
"public function getPort()\n {\n return $this->getConfig('port');\n }",
"public function getDbPort () {\n return $this->dbPort; \n }",
"public function getPort() {\n\n if (isset($this->port)) {\n return $this->port;\n }\n\n return '27017';\n }",
"function getServerPort() {\n\t\treturn $this->getParam(self::PARAM_SERVER_PORT);\n\t}",
"static function Port()\n {\n return self::Variable('SERVER_PORT');\n }",
"public static function getPort()\n {\n return $_SERVER['SERVER_PORT'];\n }",
"protected function getDefaultPort(): string\n {\n return (string)rand(3000, 9999);\n }",
"private function setupDatabasePort()\n\t{\n\t\t$db_hostname = $this->userdata['db_hostname'];\n\n\t\tif (strpos($db_hostname, ':') !== FALSE)\n\t\t{\n\t\t\tlist($hostname, $port) = explode(':', $db_hostname);\n\n\t\t\t$this->userdata['db_hostname'] = $hostname;\n\t\t\t$this->userdata['db_port'] = $port;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->userdata['db_port'] = NULL;\n\t\t}\n\t}",
"public function getPort()\n {\n return isset($this->urlParts['port']) ? $this->urlParts['port'] : NULL;\n }",
"protected function getConfiguredOrDefaultPort() {}",
"public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }",
"public function getPort()\n {\n return isset($this->port) ? $this->port : 0;\n }",
"protected function port()\n {\n return env( 'APP_HTTP_PORT' ) != \"\" ? env( 'APP_HTTP_PORT' ) : $this->input->getOption('port');\n }",
"public function getDefaultPort() : ?int\n {\n $scheme = strtolower($this->scheme);\n\n return self::$defaultPorts[$scheme] ?? null;\n }",
"protected function port()\n {\n // return env('APP_HTTP_PORT') != \"\" ? env('APP_HTTP_PORT') : $this->input->getOption('port');\n return env('TELSTAR_LOCAL_PORT') != \"\" ? env('TELSTAR_LOCAL_PORT') : $this->input->getOption('port');\n }",
"public static function getPort()\n {\n if (!isset(self::$_data[self::KEY_PORT]))\n {\n $_port = $_SERVER[\"SERVER_PORT\"];\n if (isset($_SERVER[\"HTTP_X_FORWARDED_PORT\"]) && strlen($_SERVER[\"HTTP_X_FORWARDED_PORT\"]) > 0)\n {\n $_port = $_SERVER[\"HTTP_X_FORWARDED_PORT\"];\n }\n self::setPort($_port);\n }\n\n return self::$_data[self::KEY_PORT];\n }",
"public static function getPort() {\n\t if(!isset(self::$port)) {\n\t self::$port = isset($_SERVER['SERVER_PORT'])\n\t ? intval($_SERVER['SERVER_PORT'])\n\t : 80;\n\t }\n\t return self::$port;\n\t}",
"private function get_db_host() {\n global $CFG;\n return $CFG->dbhost;\n }",
"public function port() {\n if ($this->proxy_port)\n return $this->proxy_port;\n\n return '';\n }",
"public function getPort()\n {\n\n $scheme = $this->getScheme();\n if (empty($this->_port) || (\n (isset(self::$_defaultPorts[$scheme]) && $this->_port === self::$_defaultPorts[$scheme])\n )) {\n\n return null;\n }\n\n return $this->_port;\n }",
"public function getPort() : string\n {\n return $this->port;\n }",
"public function getDatabaseHost()\n {\n return $this->settings['db_host'];\n }",
"public function getPort()\n {\n if (is_null($this->_port)) {\n $this->_port = !self::getIsSecureConnection() && isset($_SERVER['SERVER_PORT']) ? (int) $_SERVER['SERVER_PORT'] : 80;\n }\n\n return $this->_port;\n }"
] |
[
"0.7701109",
"0.7600956",
"0.7590235",
"0.71788853",
"0.71232885",
"0.7015878",
"0.6832941",
"0.6802237",
"0.67633355",
"0.6734618",
"0.6675148",
"0.660831",
"0.6605418",
"0.6597131",
"0.6583062",
"0.65577066",
"0.6532217",
"0.6494418",
"0.6494418",
"0.6476943",
"0.6438103",
"0.6417734",
"0.64142865",
"0.63967294",
"0.63928825",
"0.6369235",
"0.6362964",
"0.635203",
"0.63393795",
"0.6309666"
] |
0.8627155
|
0
|
/ Return MySQL server version
|
public function getVersion() {
return mysql_get_server_info();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getMysqlServerVersion()\r\n {\r\n $connect = $this->container->get('doctrine.dbal.default_connection');\r\n $query = $connect->query(\"SHOW GLOBAL VARIABLES LIKE '%version%'\");\r\n while ($row = $query->fetch()) {\r\n $result[$row[\"Variable_name\"]] = $row['Value'];\r\n }\r\n $mysqlinfo = $this->makeString($result);\r\n\r\n $this->summary[\"MysqlServerVersion: \"] = \"MySQL Server Version: \\n\".$mysqlinfo .\"\\n\\n\";\r\n }",
"public static function mysqlVersion()\n {\n if (self::isEnabled('shell_exec')) {\n $raw = explode(',', shell_exec('mysql -V'));\n $raw = explode('Distrib', $raw[0]);\n return trim($raw[1]);\n } else {\n return 'Unknown';\n }\n }",
"function getMySQLVersion() { \n $output = shell_exec('mysql -V'); \n preg_match('@[0-9]+\\.[0-9]+\\.[0-9]+@', $output, $version); \n return $version[0]; \n }",
"public function getVersion()\n {\n if ( ! isset($this->dbh) || ! $this->dbh ) {\n $this->connect($this->dbuser, $this->dbpassword, $this->dbhost, $this->dbport);\n if($this->select($this->dbname,$this->encoding) == false){\n throw new \\Exception(\"dose connect mysql failed.\");\n }\n }\n\n return $this->dbh->get_server_info();\n }",
"public function GetServerVersion()\r\n {\r\n $this->checkDatabaseManager();\r\n return $this->_DatabaseHandler->server_version;\r\n }",
"function find_SQL_Version() {\n $output = shell_exec('mysql -V');\n preg_match('@[0-9]+\\.[0-9]+\\.[0-9]+@', $output, $version);\n return @$version[0] ? $version[0] : -1;\n }",
"public function getServerVersion()\n {\n return $this->connection->getAttribute(PDO::ATTR_SERVER_VERSION);\n }",
"public function getServerVersion()\n {\n return $this->pdo->getAttribute(PDO::ATTR_SERVER_VERSION);\n }",
"public function MySQL_version()\n\t{\n\t\t$name = $this->MySQL_config('version_comment');\n\t\t$version = $this->MySQL_config('version');\n\n\t\tif (!$name && !$version) {\n\t\t\treturn 'Unknown MySQL version';\n\t\t}\n\t\treturn $name . ' ' . $version;\n\t}",
"public function getServerVersion ()\n {\n $this->_connect();\n\n try\n\t\t{\n $version = $this->_connection->getAttribute(EhrlichAndreas_Db_Abstract::ATTR_SERVER_VERSION);\n }\n\t\tcatch (Exception $e)\n\t\t{\n // In case of the driver doesn't support getting attributes\n return null;\n }\n\n $matches = array();\n\n if (preg_match('/((?:[0-9]{1,2}\\.){1,3}[0-9]{1,2})/', $version, $matches))\n {\n return $matches[1];\n }\n else\n {\n return null;\n }\n }",
"public function getMysqlVersion()\r\n {\r\n $info = $this->runProcess(\"mysql -V\");\r\n\r\n $this->summary[\"MySQL version:\"] = \"MySQL version (mysql -V): \" . $info .\"\\n\\n\";\r\n }",
"public function GetSQLServerVersion()\r\n\t\t{\t\r\n\t\t\t$res = self::$SDB->getOne(\"select version()\");\r\n\t\t\t$retval = explode(\".\", $res);\r\n\t\t\treturn($retval);\r\n\t\t}",
"public function getVersion(){\n return mysqli_get_server_info( $this->resourceId );\n }",
"function sql_server_info($raw = false, $use_cache = true)\n\t{\n\t\tglobal $cache;\n\n\t\tif (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)\n\t\t{\n\t\t\t$result = @mysqli_query($this->dbh, 'SELECT VERSION() AS version');\n\t\t\t$row = @mysqli_fetch_assoc($result);\n\t\t\t@mysqli_free_result($result);\n\n\t\t\t$this->sql_server_version = $row['version'];\n\n\t\t\tif (!empty($cache) && $use_cache)\n\t\t\t{\n\t\t\t\t$cache->put('mysqli_version', $this->sql_server_version);\n\t\t\t}\n\t\t}\n\n\t\treturn ($raw) ? $this->sql_server_version : 'MySQL(i) ' . $this->sql_server_version;\n\t}",
"function getServerVersion() {\r\n\t\t\t$this->connect();\r\n\t\t\treturn 'Oracle ' . ociserverversion( $this->_conn );\r\n\t\t}",
"function getServerVersion();",
"function define_mysql_version()\n\t{\n\t\t$result = $this->db->query('SELECT VERSION() AS version');\n\t\tif ($result != FALSE && @$this->db->num_rows($result) > 0) {\n\t\t\t$row = $this->db->nqfetch($result);\n\t\t\t$match = explode('.', $row['version']);\n\t\t} else {\n\t\t\t$result = @$this->db->query('SHOW VARIABLES LIKE \\'version\\'');\n\t\t\tif ($result != FALSE && @$this->db->num_rows($result) > 0) {\n\t\t\t\t$row = $this->db->nqfetch_row($result);\n\t\t\t\t$match = explode('.', $row[1]);\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($match) || !isset($match[0])) {\n\t\t\t$match[0] = 3;\n\t\t}\n\t\tif (!isset($match[1])) {\n\t\t\t$match[1] = 21;\n\t\t}\n\t\tif (!isset($match[2])) {\n\t\t\t$match[2] = 0;\n\t\t}\n\n\t\tdefine('MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));\n\t}",
"function GetDatabaseVersion()\n\t{\n\t\tif ($this->database_version == -1) {\n\t\t\t$this->CheckCron();\n\t\t}\n\t\treturn $this->database_version;\n\t}",
"function database_get_server_info()\n {\n\t return ( function_exists('mysql_get_server_info') ? mysql_get_server_info($this->database_connection) : FALSE );\n\t}",
"static function get_db_version()\n {\n global $db;\n \n $query = mysqli_query($db, \"SELECT `version` FROM `version`\");\n $version = mysqli_fetch_array($query);\n \n return $version['version'];\n }",
"public function getServerVersion() {}",
"public function getServerVersion() {}",
"public function getEngineVersion(): ?string\n {\n try {\n $slavePdo = $this->db->getSlavePdo();\n if ($slavePdo === null) {\n return null;\n }\n\n return $slavePdo->getAttribute(PDO::ATTR_SERVER_VERSION);\n } catch (Throwable $exception) {\n return null;\n }\n }",
"function sql_get_server_info($dbh=NULL)\n {\n global $SQL_DBH;\n if (is_null($dbh))\n return $SQL_DBH->getAttribute(constant(\"PDO::ATTR_SERVER_VERSION\"));\n else\n return $dbh->getAttribute(constant(\"PDO::ATTR_SERVER_VERSION\"));\n }",
"public function getVersion()\n {\n $version = $this->getAttribute(PDO::ATTR_SERVER_VERSION);\n // clean version number from alphabetic characters\n return preg_replace('/[^0-9,.]/', '', $version);\n }",
"protected function checkMysqlVersion() {}",
"function checkMySQLVersion($needVersion)\n{\n $db = $GLOBALS['db'];\n $haveVersion = ($db->State() == 1) ? mysql_get_server_info() : mysql_get_client_info();\n\n\t\t// mysqlnd is retarded and has text at the front.\n\t\tif (strpos($haveVersion, \"mysqlnd\") === 0) {\n\n\t\t\t$version_bits = explode(\" \", $haveVersion);\n\t\t\t$haveVersion = $version_bits[1];\n\t\t}\n\n\t\t\n return (version_compare($haveVersion, $needVersion, '>'));\n}",
"public function getServerInfo() {\n\t\treturn $this->getServerVersion();\n\t}",
"public function getServerInfo(){\n return mysql_get_server_info($this->connection);\n }",
"function getServerInfo() {\n $serverInfo = mysql_get_server_info();\n return $serverInfo;\n }"
] |
[
"0.8302827",
"0.795214",
"0.78837305",
"0.7699997",
"0.76121205",
"0.75869817",
"0.75501424",
"0.7531185",
"0.7527514",
"0.74900866",
"0.748727",
"0.74074954",
"0.734661",
"0.7299141",
"0.7227404",
"0.71165437",
"0.70938796",
"0.7014156",
"0.7009294",
"0.6989695",
"0.6963222",
"0.69628006",
"0.6905365",
"0.6878013",
"0.68777895",
"0.6853024",
"0.68403804",
"0.6772539",
"0.676996",
"0.67692566"
] |
0.87235683
|
0
|
/ Note : Use options array to set exception message and / or set used method to fetch data (Ex : DB_ASSOC, DB_NUM or DB_BOTH) / Execute MySQL query
|
public function execute($sql, $options = array()) {
if (($result = @mysql_query($sql)) === false) {
if (array_key_exists('exception', $options) && $options['exception'] != '')
throw new dbException($options['exception']);
else
throw new dbException(mysql_error());
}
return $result;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function dbfetch($result, $option) {\n return mysql_fetch_array($result, $option);\n}",
"public function selectOne($sql, $options = array()) {\n if (($req = $this->execute($sql, $options)) === false)\n return false;\n\n if (in_array(DB_NUM, $options))\n $mysqlFetchCmd = 'mysql_fetch_row';\n else\n $mysqlFetchCmd = 'mysql_fetch_assoc';\n\n return $mysqlFetchCmd($req);\n }",
"public function getSQL(array $options);",
"public function find($options = null)\n\t\t{\n\t\t\t\n\t\t\t$defaults = array(\n\t\t\t\t'order_by' => null,\n\t\t\t\t'where' => null,\n\t\t\t\t'limit' => null,\n\t\t\t\t'join' => null\n\t\t\t);\n\t\t\t\n\t\t\t$options = is_array($options) ? array_merge($defaults, $options) : $defaults;\n\t\t\t\n\t\t\tif($options['where'])\n\t\t\t{\n\t\t\t\t$this->db->where($options['where']);\n\t\t\t}\n\t\t\t\n\t\t\tif($options['order_by'])\n\t\t\t{\n\t\t\t\t$this->db->order_by($options['order_by']['column'], $options['order_by']['direction']);\n\t\t\t}\n\t\t\t\n\t\t\tif($options['limit'])\n\t\t\t{\n\t\t\t\t$this->db->limit($options['limit']);\n\t\t\t}\n\t\t\t\n\t\t\tif($options['join'])\n\t\t\t{\n\t\t\t\tif($options['join']['method'])\n\t\t\t\t{\n\t\t\t\t\t$this->db->join($options['join']['table'], $options['join']['where'], $options['join']['method']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->db->join($options['join']['table'], $options['join']['where']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$ret = $this->db->get($this->record);\n\t\t\t\n\t\t\treturn $ret;\n\t\t}",
"function MySQL($options=array()){\n\t\t// validate incoming parameters\n\t\tif(count($options)<1){\n trigger_error('No connection parameters were provided');\n exit();\n }\n\t\tforeach($options as $parameter=>$value){\n if(!$parameter||!$value){\n trigger_error('Invalid connection parameter');\n exit();\n }\n $this->{$parameter}=$value;\n\t\t}\n\t\t// connect to MySQL\n\t\t$this->connectDB();\n\t}",
"function select($sql) {\n global $conn;\n\n if($result = $conn->query($sql)) {\n while($row = mysqli_fetch_assoc($result))\n $result_rows[] = $row;\n\n if($result_rows != null)\n DB::return_json($result_rows);\n\n else\n throw new Exception(\"no results\");\n } else\n throw new Exception(\"query failed\");\n }",
"public static function find($options = array(), $returnType = self::RETURN_TYPE_ALL) {\n if (empty($options['table'])) {\n $options['table'] = static::$tableName; \n }\n $sql = new Sql(static::getDb());\n $select = $sql->select()\n ->from($options['table']); \n if (!empty($options['where'])) {\n $where = array();\n foreach ($options['where'] as $property => $value) {\n if (in_array($property, static::$properties)) {\n $where[$property] = $value; \n }\n } \n if (!empty($where)) {\n $select->where($where);\n }\n } \n if (!empty($options['order'])) {\n $select->order($options['order']); \n }\n $selectString = $sql->getSqlStringForSqlObject($select);\n $result = static::getDb()->query($selectString, Adapter::QUERY_MODE_EXECUTE); \n if ($result->count() > 0) {\n return self::response($result, $returnType); \n }\n return array();\n }",
"public function execute($option = array()){\n\t$this->_cursor = $this->_dbh->prepare($this->_sql);\n\t\tif($option){\n\t\t\tfor($i = 0;$i < count($option);$i++){\n\t\t\t\t$this->_cursor->bindParam($i+1,$option[$i]);\n\t\t\t}\n\t\t}\n\t\t$this->_cursor->execute();\n\t\treturn $this->_cursor;\n\t}",
"function loadOneRow($sql,$options = []){\n $stmt = $this->prepareParams($sql,$options);\n $check = $stmt->execute();\n if($check){\n return $stmt->fetch(PDO::FETCH_OBJ);\n }\n else return false;\n }",
"function get($options = array())\n\t{\n\t\t// set an array for field querys and values\n\t\t// This allows gets with operators\n\t\t// $options = array('status >' => 5)\n\t\t$option_fields = array();\n\t\tforeach($options as $key => $value)\n\t\t{\n\t\t\t$parts = explode(' ', $key, 2);\n\n\t\t\t$field = isset($parts[0]) ? $parts[0] : '';\n\t\t\t$operator = isset($parts[1]) ? $parts[1] : '';\n\n\t\t\t$option_fields[$field]['query'] = $key;\n\t\t\t$option_fields[$field]['value'] = $value;\n\t\t}\n\n// \t\t$defaults = array(\n// \t\t\t'sort_direction' => 'asc'\n// \t\t);\n// \t\t$options = $this->_default($defaults, $options);\n\t\t\n\t\t$this->_set_editable_fields($this->primary_table);\n\t\t\n\t\tforeach ($this->fields as $field)\n\t\t{\n\t\t\tif (isset($option_fields[$field]))\n\t\t\t{\n\t\t\t\t$this->db->where($option_fields[$field]['query'], $option_fields[$field]['value']);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($options['limit']) && isset($options['offset']))\n\t\t{\n\t\t\t$this->db->limit($options['limit'], $options['offset']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (isset($options['limit']))\n\t\t\t{\n\t\t\t $this->db->limit($options['limit']);\n\t\t\t}\n\t\t}\n\n\t\tif (isset($options['sort_by']))\n\t\t{\n\t\t\t$this->db->order_by($options['sort_by'], $options['sort_direction']);\n\t\t}\n\t\t\n\t\t$query = $this->db->get($this->primary_table);\n\t\t\n\t\t// if an id was specified we know you only are retrieving a single record so we return the object\n\t\tif (isset($options[$this->primary_key]))\n\t\t{\n\t\t\treturn $query->row();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $query;\n\t\t}\n\t}",
"public static function doSelect($sql, $values = array(), $useRedis = true, $redisKey = \"\", $autoErroResponder = false , $fetchAll = true, $fetchStyle = PDO::FETCH_ASSOC)\n {\n\n //mitonim az redis estefade konim\n if(Config::$REDISENABLED) {\n\n }\n $conn = MyPDO::getInstance();\n $stmt = $conn->prepare($sql);\n $result = null;\n if($values != NULL) {\n foreach ($values as $key => $value) {\n $stmt->bindValue($key + 1, $value);\n }\n }\n try {\n $stmt->execute();\n if ($fetchAll) {\n $result = $stmt->fetchAll($fetchStyle);\n } else {\n $result = $stmt->fetch($fetchStyle);\n }\n return $result;\n } catch (\\PDOException $ex) {\n if($autoErroResponder) new Errors(\"Internal Server Error\" , false , Config::$DEBUG_MODE?$ex:\"\" );\n else return $ex;\n }\n }",
"public function loadRows($option = array()){\n\t\tif(!$option){\n\t\t\tif(!$result = $this->execute())\n\t\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tif(!$result = $this->execute($option))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn $result->fetch(PDO::FETCH_OBJ);\n\t}",
"public function execute()\n\t{\n\t\t$this->query->setFetchMode($this->fetchMode);\n\n\t\t$this->query->execute($this->params);\t\n\n\t\t// Fetch the data in the appropriate format\n\t\tswitch ($this->fetchMethod) {\n\t\t\tcase 'row':\n\t\t\t\t$this->result = $this->query->fetch();\n\t\t\t\tbreak;\n\t\t\tcase 'field':\n\t\t\t\t$this->result = $this->query->fetchColumn();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->result = $this->query->fetchAll();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function getResultOfPreparedStatement($result){\n try {\n if($result->num_rows > 0){\n $DbResult = $result->fetch_all(MYSQLI_ASSOC);\n return $DbResult;\n }\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n}",
"static function query($sql,$err_message=\"Impossibile eseguire la query\"){\n \n //open DB connection\n $mysqli = self::_DbConnect();\n \n //if there's no connection I return false\n if(!$mysqli): return false; endif;\n \n \n //capture query result into an object through Mysqli\n $result = $mysqli->query($sql);\n \n \n //if there's an error pass error message to the view and return false\n if ($mysqli->error):\n die(\n 'ERROR:'.$mysqli->error.PHP_EOL.'ERROR# '.$mysqli->errno.PHP_EOL.'SQL:'.$sql\n );\n return false;\n endif;\n \n //close connection\n mysqli_close($mysqli);\n \n if(isset($result) && is_object($result)){\n \n //if the object is empty I return false\n if (!$result || !$result->num_rows) return false;\n \n \n //generate $data array so that every Sql operation end here.\n //To better separate the DAO.\n //Every result oustide of this class will be managed as an array.\n while ($row=$result->fetch_assoc()):\n \n $Data[] = $row;\n \n endwhile;\n \n }\n \n if(isset($Data))\n return $Data;\n \n \n \n }",
"public function fetchAll($options = array(), $params = array(), $debug = false) {\r\n \t$options += $this->_fetchOptions;\r\n \t$params += $this->_fetchParams;\r\n \t\r\n \t$this->_validateFetchOptions($options);\r\n \t$this->_validateFetchParams($params);\r\n \t\r\n \t$gateway = $this->_getGateway();\r\n\t\t\r\n \t$select = $gateway->select();\r\n \t$select->from($gateway->info(Zend_Db_Table_Abstract::NAME));\r\n \t$this->_manageFetchOptions($select, $options);\r\n \t$this->_manageFetchParams($select, $params);\r\n \t\r\n \tif($debug) {\r\n\t\t\tZend_Debug::dump($select->assemble()); exit();\r\n \t}\r\n\t\t$rowset = $gateway->fetchAll($select);\r\n\t\t\r\n\t\treturn $this->_rowsetToEntites($rowset);\r\n }",
"abstract public function query($sql, $errorLevel = E_USER_ERROR);",
"function Tree_OptionsDB( $dsn , $options=array() )\n {\n $res = $this->_connectDB( $dsn );\n if( !PEAR::isError($res) )\n {\n $this->dbh->setFetchmode(DB_FETCHMODE_ASSOC);\n }\n else\n {\n return $res;\n }\n\n $this->Tree_Options( $options ); // do options afterwards since it overrules\n }",
"function db_connection($mode = 'mysql')\n {\n\n// parent::queryText('Select * from bs_users ');\n//\n// print_r('Query: '.$this->query . '<br>');\n// print_r('Exec: '.$this->sqlResult . '<br>');\n// echo '<br> Assoc: ';\n// print_r($this->sqlAssoc);\n// echo 'Row: ';\n// print_r($this->sqlRow);\n// echo '<br> Num: ';\n// print_r($this->rowCount);\n// print_r($this->sqlAffected);\n// echo '<br> Specific: ';\n// print_r($this->sqlGetField);\n// echo '<br> Escape string: ';\n// print_r(parent::sqlString('abcs'));\n// die('here');\n\n }",
"public function execute( Array $params = array() ) {\r\n \r\n // check if the query type is known / allowed\r\n try {\r\n if ( $this -> query_type == false ) {\r\n throw new Exception('query type not recognised');\r\n }\r\n }\r\n catch ( Exception $exc ) {\r\n $this -> errors['query'] = $exc -> getMessage();\r\n return $this -> respond( false);\r\n }\r\n\r\n try {\r\n if ( $this -> verifyParams( $params ) == false ) {\r\n throw new Exception('parameters supplied do not match query requirements');\r\n }\r\n }\r\n catch ( Exception $exc ) {\r\n $this -> errors['parameter'] = $exc -> getMessage();\r\n return $this -> respond( false);\r\n }\r\n\r\n try{\r\n $statement = $this -> connection -> prepare($this -> query_string);\r\n if ( !$statement ) {\r\n throw new Exception( $this -> connection -> error );\r\n }\r\n if ( count($params) > 0 ) {\r\n // build the parameter string, eg iii\r\n $param_string = $this -> buildParamString( $params );\r\n $statement -> bind_param( $param_string, ...$params );\r\n }\r\n if ( $statement -> execute() == false ) {\r\n throw new Exception('query' . $this -> connection -> error );\r\n }\r\n }\r\n catch( Exception $exc ) {\r\n $this -> errors['number'] = $this -> connection -> errno;\r\n $this -> errors['execution'] = $exc -> getMessage();\r\n return $this -> respond( false);\r\n }\r\n // get the result if the query is select\r\n \r\n if ( $this -> query_type == 'select' ) {\r\n $result = $statement -> get_result();\r\n // add result to $this -> data\r\n while( $row = $result -> fetch_assoc() ) {\r\n array_push( $this -> data, $row );\r\n }\r\n }\r\n return $this -> respond( true );\r\n }",
"abstract protected function fetchRowAssocDb();",
"function executeQuery($sql, $options = []){\n $stmt = $this->prepareParams($sql,$options);\n return $stmt->execute();\n }",
"public function fetch($query, Database_Config $databaseConfig = NULL);",
"public static function oneRow( $sql, $params =array(), $fetchStyle = PDO::FETCH_ASSOC ) {\n // public static function oneRow( $sql, $params =array(), $fetchStyle = PDO::FETCH_ASSOC ) {\n $result = null;\n try {\n $stmt = self::getPdoCon()->prepare($sql);\n $stmt->execute($params); // won't allow to pass null value , all value send as a string\n $result = $stmt->fetch($fetchStyle);\n\n\n // result 1.false 2. error occur \n // if($result === false){ $result = null ;} \n $errorInfo = self::getPdoCon()->errorInfo(); \n if($errorInfo[2] !== null ){ var_dump($errorInfo[2]); }\n\n //useful for database drivers that do not support executing a PDOStatement object\n // when a previously executed PDOStatement object still has unfetched rows\n // $stmt->closeCursor();\n }\n catch(PDOException $e) {\n self::catchException($sql, $e);\n }\n return $result;\n }",
"public function getOne($sql, $params=[]){\n try \n {\n $stmt = $this->dbh->prepare($sql);\n $stmt->execute($params);\n return $stmt->fetch();\n \n } catch (PDOException $e) \n {\n throw new Exception($e->getMessage());\n }\n\n }",
"abstract protected function _manageFetchOptions($select, $options);",
"public function fetchById($id,$options=array()) {\n\t\treturn $this->fetch(array('id' => $id));\n\t}",
"function getData($sqlStr){\n\t$conn= null;\n\t$stmt= null;\n\ttry {\n\t\t$conn = connectMySql();\n\t\t$stmt = $conn->prepare($sqlStr);\n\t\t$obj= new Object();\n\t\t// set the resulting array to associative\n\t\t$stmt->setFetchMode(PDO::FETCH_INTO, $obj);\n\t\t$stmt->execute();\n\t}\n\tcatch(PDOException $e) {\n\t\t// echo \"<script>console.log('[ERROR]\\t\" . $e->getMessage().\"')</script>\";\n\t}finally{\n\t\t$conn= null;\n\t\treturn $stmt;\n\t}\n}",
"public function select($sql)\n { \n if ($this->debug === TRUE) {\n $start = microtime(TRUE);\n }\n \n $result = mysql_query($sql, $this->link);\n \n if ($result === FALSE) {\n $errstr = \"Invalid query: \" . $sql . PHP_EOL;\n $errstr .= \"Server returned: \" . mysql_errno($this->link) . \": \" . mysql_error($this->link);\n throw new Exception($errstr);\n }\n \n if ($this->debug === TRUE) {\n $end = microtime(TRUE);\n $time = sprintf(\"%.8F\", $end - $start);\n $this->queries[] = array(\n \"sql\" => $sql,\n \"sec\" => $time\n );\n }\n \n $Result = new ResultMySQL($result);\n $Result->rewind();\n return $Result;\n }",
"function query($sql,$calculateRows=false,$fastHint=false);"
] |
[
"0.5977226",
"0.58157486",
"0.58149266",
"0.5807178",
"0.58038336",
"0.5771806",
"0.56821847",
"0.56719005",
"0.56182164",
"0.560395",
"0.55551684",
"0.55421257",
"0.5538662",
"0.5533569",
"0.5507582",
"0.54940355",
"0.5494018",
"0.54659855",
"0.54375625",
"0.5425365",
"0.53948855",
"0.5388018",
"0.5385772",
"0.53800976",
"0.5373468",
"0.535667",
"0.5351289",
"0.533084",
"0.5319093",
"0.53166014"
] |
0.6395895
|
0
|
Return $filename path located in themes folder
|
public function themes_path($filename = null)
{
return $filename ? $this->themesPath . '/' . $filename : $this->themesPath;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function get_theme_file_path($file = '')\n {\n }",
"protected function _getThemesPath()\n {\n $pathElements = array(\n dirname(__FILE__),\n '..',\n '..',\n 'public',\n 'themes'\n );\n return realpath(implode(DIRECTORY_SEPARATOR, $pathElements));\n }",
"public function getThemePath(): string;",
"protected static function get_file_path_from_theme($file_name, $template = \\false)\n {\n }",
"public function getThemePath()\n\t{\n\t\t$config = Config::getInstance();\n\t\treturn $config['path']['theme'] . $this->theme . '/';\n\t}",
"function gavern_file($path) {\n\t\tif(is_child_theme()) {\n\t\t\tif($path == false) {\n\t\t\t\treturn get_stylesheet_directory();\n\t\t\t} else {\n\t\t\t\tif(is_file(get_stylesheet_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path))) {\n\t\t\t\t\treturn get_stylesheet_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);\n\t\t\t\t} else {\n\t\t\t\t\treturn get_template_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif($path == false) {\n\t\t\t\treturn get_template_directory();\n\t\t\t} else {\n\t\t\t\treturn get_template_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path);\n\t\t\t}\n\t\t}\n\t}",
"function get_parent_theme_file_path($file = '')\n {\n }",
"function get_theme_path(){\n\tglobal $theme;\n\treturn $theme->get_theme_path();\n}",
"protected function getThemeDir()\n\t{\n\t\treturn Stringify::formatPath(get_stylesheet_directory());\n\t}",
"function theme_dir()\n{\n \n $themeActived = is_theme('Y');\n\n $folder = $themeActived['theme_directory'].DS;\n\n return app_info()['app_url'].DS.APP_PUBLIC.DS.$folder;\n\n}",
"public function get_theme_path(){\n\t\treturn $this->theme_path;\n\t}",
"function get_theme_file_uri($file = '')\n {\n }",
"public function url($filename)\r\n {\r\n // If no Theme set, return /$filename\r\n if (!$this->current()) {\r\n return \"/\" . ltrim($filename, '/');\r\n }\r\n\r\n return $this->current()->url($filename);\r\n }",
"function theme_path()\r\n{\r\n return base_path().'/cms/local/'.Cms::getCurrentTheme().'/';\r\n}",
"function get_theme_dir()\n{\n $theme = Theme::GetTheme();\n return !is_null($theme) ? $theme->GetDirectory() : '';\n}",
"public function get_theme_path() {\n return $this->_theme_path;\n }",
"public function getThemesDirectory(): string\n {\n return config('theme-system.themes_directory', resource_path('themes')) ?? resource_path('themes');\n }",
"public function getThemePath(): string\n {\n if (null === $this->themePath) {\n if ($this->isProtected()) {\n $this->themePath = $this->getProtectedThemePath();\n } elseif ($this->isValid()) {\n $this->themePath = call_user_func([$this->getClassname(), 'getThemeFolder']);\n } else {\n $this->themePath = $this->projectDir . '/themes/' . $this->getThemeName();\n }\n }\n return $this->themePath;\n }",
"public static function theme_path($theme, $file = NULL) {\n static $path = NULL;\n if ( ! isset( $path[$theme] )) {\n $path[$theme] = drupal_get_path('theme', $theme);\n }\n if ($file) {\n return $path[$theme] . \"/\" . $file;\n }\n\n return $path[$theme];\n }",
"private function theme_folder_url()\n\t{\n\t\treturn $this->sc->addon_theme_url;\n\t}",
"function themes_path($path = '')\n {\n return app('path.themes').($path ? '/'.$path : $path);\n }",
"function gavern_file_uri($path) {\n\t\tif(is_child_theme()) {\n\t\t\tif($path == false) {\n\t\t\t\treturn get_stylesheet_directory_uri();\n\t\t\t} else {\n\t\t\t\tif(is_file(get_stylesheet_directory() . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $path))) {\n\t\t\t\t\treturn get_stylesheet_directory_uri() . '/' . $path;\n\t\t\t\t} else {\n\t\t\t\t\treturn get_template_directory_uri() . '/' . $path;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif($path == false) {\n\t\t\t\treturn get_template_directory_uri();\n\t\t\t} else {\n\t\t\t\treturn get_template_directory_uri() . '/' . $path;\n\t\t\t}\n\t\t}\n\t}",
"function frame_theme_url($path = '')\n{\n return trailingslashit(get_stylesheet_directory_uri()).$path;\n}",
"public function getThemeDirectory()\n {\n return $this->config->get('dirs.view').DIRECTORY_SEPARATOR.$this->config->get('site.theme').DIRECTORY_SEPARATOR;\n }",
"protected function getThemeUrl()\n\t{\n\t\treturn get_stylesheet_directory_uri();\n\t}",
"function get_parent_theme_file_uri($file = '')\n {\n }",
"function wp_php_path ($filename, $dir=\"/wp_php/\") {\n return $dir . $filename;\n}",
"public function getPath(){\n\t\treturn \\GO::view()->getPath().'themes/'.$this->getName().'/';\n\t}",
"protected function getThemePath(string $theme_name): string {\n return \\Drupal::service('extension.list.theme')->getPath($theme_name);\n }",
"public function theme_folder_url()\n\t{\n\t\treturn $this->sc->addon_theme_url;\n\t}"
] |
[
"0.81548786",
"0.74204224",
"0.73157454",
"0.7264323",
"0.7224078",
"0.71927786",
"0.71913815",
"0.7174116",
"0.7136946",
"0.70815957",
"0.7081453",
"0.7079372",
"0.69984967",
"0.69752544",
"0.6891521",
"0.6780477",
"0.6780272",
"0.6775147",
"0.6764414",
"0.67447597",
"0.6727996",
"0.6708742",
"0.66718066",
"0.6623895",
"0.66173023",
"0.6574735",
"0.65600425",
"0.6557094",
"0.65407205",
"0.6528553"
] |
0.8271353
|
0
|
Find a theme by it's name
|
public function find($themeName)
{
// Search for registered themes
foreach ($this->themes as $theme) {
if ($theme->name == $themeName) {
return $theme;
}
}
throw new Exceptions\themeNotFound($themeName);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function findTheme($themeName);",
"public function getActiveThemeByName($theme_name);",
"public function getTheme();",
"protected function getTheme()\n\t{\n\t\treturn strtolower($this->argument('name'));\n\t}",
"public static function getTheme()\n {\n $className = static::getCalledClass();\n while (!StringHandler::endsWith($className, \"App\")) {\n $className = get_parent_class($className);\n if ($className === false) {\n $className = \"\";\n break;\n }\n if (strpos($className, \"\\\\\") !== 0) {\n $className = \"\\\\\" . $className;\n }\n }\n $theme = Kernel::getService('em')\n ->getRepository('RZ\\Roadiz\\Core\\Entities\\Theme')\n ->findOneBy(['className' => $className]);\n return $theme;\n }",
"public function getThemeName() {}",
"function theme(): Theme\n {\n if (! $name = preference('theme')) {\n throw new RuntimeException('Unable to determine the theme.');\n }\n\n if ($theme = model(ThemeModel::class)->where('name', $name)->first()) {\n return $theme;\n }\n\n throw new RuntimeException('Unable to locate the theme: ' . $name);\n }",
"public static function getTheme($id)\r\n {\r\n $db = Zend_Registry::get('db');\r\n $query = $db->select()\r\n ->from('Page_Themes', array('PT_Folder'));\r\n\r\n if (is_numeric($id) && $id > 0){\r\n $query->where('PT_ID = ?', $id);\r\n }elseif(is_string($id) && !empty ($id)){\r\n $query->where('PT_Name = ?', $id);\r\n }\r\n\r\n $theme = $db->fetchOne($query);\r\n\r\n return $theme;\r\n }",
"public function getThemeId($themename)\n {\n $theme = R::findOne('theme', 'name = ?', [$themename]);\n return $theme->id;\n }",
"function get_themes()\n {\n }",
"public function getDesignTheme();",
"public function themes()\n {\n return R::findAll('theme', 'order by name');\n }",
"public function getTheme()\n {\n return _THEME_NAME_;\n }",
"public function getThemeName(){\n\t\treturn $info->name;\n\t}",
"public static function getMyTheme()\n {\n $paramArray = (\\Config\\Site::getAllParams());\n return ($paramArray['hash'])?'Flexi':'';\n }",
"protected function getTheme()\n {\n return !empty($_GET['theme']) ? $_GET['theme'] : 'basic';\n }",
"public function getCurrentTheme() {\n\t\t\t//No usamos el getTodayAdvertisements, así nos ahorramos la hidratacion de cosas innecesarias\n\t\t\treturn ThemeQuery::create()\n\t\t\t\t->filterByBillboard($this)\n\t\t\t\t->filterByCurrent()\n\t\t\t\t->findOne();\n\t\t}",
"public function initTheme($theme_name);",
"public function getTheme(): ?Theme\n {\n $this->getStopwatch()->start('getTheme');\n /** @var ThemeResolverInterface $themeResolver */\n $themeResolver = $this->get(ThemeResolverInterface::class);\n if (null === $this->theme) {\n $className = new UnicodeString(static::getCalledClass());\n while (!$className->endsWith('App')) {\n $className = get_parent_class($className->toString());\n if ($className === false) {\n $className = new UnicodeString('');\n break;\n }\n $className = new UnicodeString($className);\n }\n $this->theme = $themeResolver->findThemeByClass($className->toString());\n }\n $this->getStopwatch()->stop('getTheme');\n return $this->theme;\n }",
"function get_theme_name(){\n\tglobal $theme;\n\treturn $theme->get_theme_name();\n}",
"public function get_theme_name(){\n\t\treturn $this->current_theme;\n\t}",
"public function getThemeName()\n {\n return $this->theme;\n }",
"public function current_theme() {\r\n\t $dataArr = array(\r\n 'theme_status' => 1\r\n );\r\n $themeDetails = $this->CI->DatabaseModel->access_database('ts_themes','select','',$dataArr);\r\n if( !empty($themeDetails) ) {\r\n return $themeDetails[0]['theme_name'];\r\n }\r\n else {\r\n return 'default';\r\n }\r\n\t}",
"public function getSelectedTheme()\n {\n $selectedTheme = OW::getConfig()->getValue('base', 'selectedTheme');\n\n if ( empty($this->themeObjects[$selectedTheme]) )\n {\n $this->themeObjects[$selectedTheme] = $this->themeService->getThemeObjectByKey(OW::getConfig()->getValue('base', 'selectedTheme'));\n }\n\n return $this->themeObjects[$selectedTheme];\n }",
"public function getCurrentTheme()\n {\n $status = $this->runWpCliCommand('theme', 'status');\n $status = preg_replace(\"/\\033\\[[^m]*m/\", '', $status); // remove formatting\n\n preg_match_all(\"/^[^A-Z]*([A-Z]+)[^a-z]+([a-z\\-]+).*$/m\", $status, $matches);\n\n foreach ($matches[1] as $lineNumber => $status) {\n if (Strings::contains($status, 'A')) {\n return $matches[2][$lineNumber];\n }\n }\n\n return null; // this should never happen, there is always some activate theme\n }",
"public function getName()\n {\n return $this->theme_name;\n }",
"public function getName(){\n\t\t$theme = \\GO::config()->allow_themes && \\GO::user() ? \\GO::user()->theme : \\GO::config()->theme;\n\t\t\n\t\tif(!file_exists(\\GO::view()->getPath().'themes/'.$theme.'/Layout.php')){\n\t\t\treturn 'Paper';\n\t\t} else {\n\t\t\treturn $theme;\n\t\t}\n\t}",
"public static function getTheme ()\n {\n $config = Zend_Registry::get('config');\n\n return $config->app->theme;\n }",
"function where_in_theme()\n\t{\n\t\t$theme = Kohana::$config->load('config')->get('assets_folder_path');\n\t\treturn $this\n\t\t\t->and_where_open()\n\t\t\t\t->where('theme', '=', $theme)\n\t\t\t\t->or_where('theme', '=', '')\n\t\t\t\t->or_where('theme', 'is', NULL)\n\t\t\t->and_where_close();\n\t}",
"private function findThemeForBlock($name, View $view)\n {\n // Search themes for current view\n if (isset($this->themes[$view])) {\n foreach ($this->themes[$view] as $theme) {\n if (in_array($name, $this->blocks[$theme])) {\n return $theme;\n }\n }\n }\n\n // Search themes for parent view\n if ($view instanceof ElementView && $view->parent && $theme = $this->findThemeForBlock($name, $view->parent)) {\n return $theme;\n }\n\n // Search default themes\n foreach ($this->defaultThemes as $theme) {\n $this->loadBlocks($theme);\n\n if (in_array($name, $this->blocks[$theme])) {\n return $theme;\n }\n }\n\n return null;\n }"
] |
[
"0.8845574",
"0.74221617",
"0.7222886",
"0.71446586",
"0.70790446",
"0.688974",
"0.6830771",
"0.6588475",
"0.65452904",
"0.65156054",
"0.64936346",
"0.6475086",
"0.6402635",
"0.63922256",
"0.6390752",
"0.6379974",
"0.63730603",
"0.63553417",
"0.6344057",
"0.6342492",
"0.6295245",
"0.6277095",
"0.6274587",
"0.6235949",
"0.6218773",
"0.62088865",
"0.62040854",
"0.61870015",
"0.61800975",
"0.6169935"
] |
0.7481864
|
1
|
Rebuilds the cache file
|
public function rebuildCache()
{
$themes = $this->scanJsonFiles();
// file_put_contents($this->cachePath, json_encode($themes, JSON_PRETTY_PRINT));
$stub = file_get_contents(__DIR__ . '/stubs/cache.stub');
$contents = str_replace('[CACHE]', var_export($themes, true), $stub);
file_put_contents($this->cachePath, $contents);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function generateInternalCache()\n\t{\n\t\t// Purge\n\t\t$this->purgeInternalCache();\n\n\t\t// Rebuild\n\t\t$this->generateConfigCache();\n\t\t$this->generateDcaCache();\n\t\t$this->generateLanguageCache();\n\t\t$this->generateDcaExtracts();\n\t}",
"public function updateCache();",
"private static function _createCacheFile() {\r\n $paths = array();\r\n $paths['apps'] = File::getDirectoriesNames(ZEEYE_APPS_PATH);\r\n $paths['libs'] = File::getDirectoriesNames(ZEEYE_LIBS_PATH);\r\n File::write(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH, '<?php ' . PHP_EOL . '$paths = ' . var_export($paths, true) . ';');\r\n self::$_hasCacheFile = true;\r\n }",
"private function write_cache() {\n if (!file_exists(CACHE_DIR))\n mkdir(CACHE_DIR, 0755, TRUE);\n\n if (is_dir(CACHE_DIR) && is_writable(CACHE_DIR)) {\n if (function_exists(\"sem_get\") && ($mutex = @sem_get(2013, 1, 0644 | IPC_CREAT, 1)) && @sem_acquire($mutex))\n file_put_contents($this->cache_file, $this->html . $this->debug) . sem_release($mutex);\n /**/\n else if (($mutex = @fopen($this->cachefile, \"w\")) && @flock($mutex, LOCK_EX))\n file_put_contents($this->cache_file, $this->html . $this->debug) . flock($mutex, LOCK_UN);\n /**/\n }\n }",
"public function rebuild()\n {\n // Don't bother if there's no cache file in config\n if (empty($this->cacheFile)) {\n throw new \\Exception(\n 'Cannot rebuild route cache because no file is provided in config.'\n );\n }\n // Get all published routes\n $routes = $this->pageModel->getPublishedRoutes();\n\n // Smash them into a pipe-separated string\n $pipedRoutes = implode('|', $routes);\n\n // Write to the cache file\n file_put_contents($this->cacheFile, $pipedRoutes);\n }",
"function refreshCache($source_file, $cache_file, $quality) {\n\tif (file_exists($cache_file)) {\n // Not modified\n if (filemtime($cache_file) >= filemtime($source_file)) {\n return $cache_file;\n }\n\n // Modified, clear it\n unlink($cache_file);\n }\n return generateImage($source_file, $cache_file, $quality);\n}",
"protected function build_sitemap_root_cache_file() {\n\n\t\t$sitemap_content = $this->build_sitemap_root();\n\n\t\t\\file_put_contents( // phpcs:ignore\n\t\t\t$this->get_sitemap_root_cache_file_path(),\n\t\t\t$sitemap_content\n\t\t);\n\n\t}",
"public function clearCache(){\n if(file_exists($this->file)){\n @unlink($this->file);\n }\n }",
"protected function update_cache(){\r\n\t\t$html = file_get_contents($this->_cfg->get('sfbaseurl'));\r\n\t\tif($html === false || !trim($html))\r\n\t\t\tthrow new Exception('Could not read SourceForge website');\r\n\t\t$mtch = null;\r\n\t\tif(!preg_match('/lazarus-(\\\\d+.\\\\d+.\\\\d+)-fpc-(\\\\d+.\\\\d+.\\\\d+)-/', $html, $mtch))\r\n\t\t\tthrow new Exception('Could not parse version from SourceForge');\r\n\t\t$data = array(\r\n\t\t\t'laz' => $mtch[1],\r\n\t\t\t'fpc' => $mtch[2],\r\n\t\t);\r\n\t\t$data = '<'.'?php return '.var_export($data, true).'; ?>';\r\n\t\tfile_put_contents($this->get_cache(), $data);\r\n\t}",
"public function clearCachefiles () {\r\n\t\r\n\t}",
"function saveAndFlushCalculationCaches() {\n\n $this->saveToFile();\n\n $file = $this->getExtractedFile();\n\n $this->flushFileCachedValues();\n\n $this->saveToFile();\n }",
"private function get_cache() {\n exit(file_get_contents($this->cache_file));\n }",
"public function saveToCacheForever();",
"public function actionRebuildCache()\n {\n foreach (Yii::app()->Modules as $id => $params)\n $this->actionDb2php(array('module' => $id));\n\n }",
"public function cleanFileCache()\n {\n if (is_callable(array('SugarAutoLoader', 'buildCache'))) {\n SugarAutoLoader::buildCache();\n } else {\n // delete dangerous files manually\n @unlink(\"cache/file_map.php\");\n @unlink(\"cache/class_map.php\");\n }\n }",
"function wp_opcache_invalidate($filepath, $force = \\false)\n {\n }",
"function recache()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&un=1\" : \"\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// Components\n\t\t//-----------------------------------------\n\t\t\n\t\t$components = $this->ipsclass->load_class( ROOT_PATH.'sources/action_admin/components.php', 'ad_components' );\n\t\t$components->components_rebuildcache();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Forum Cache\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->update_forum_cache();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Group Cache\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->cache['group_cache'] = array();\n\t\t\n\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'groups'\n\t\t\t\t\t\t\t\t\t\t) );\n\t\t$this->ipsclass->DB->exec_query();\n\t\t\n\t\twhile ( $i = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->cache['group_cache'][ $i['g_id'] ] = $i;\n\t\t}\n\t\t\n\t\t$this->ipsclass->update_cache( array( 'name' => 'group_cache', 'array' => 1, 'deletefirst' => 1 ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Settings\n\t\t//-----------------------------------------\n\t\t\n\t\t$settings = $this->ipsclass->load_class( ROOT_PATH.'sources/action_admin/settings.php', 'ad_settings' );\n\t\t$settings->setting_rebuildcache();\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&code=work&mod={$this->ipsclass->input['mod']}&step={$this->ipsclass->input['step']}{$uninstall}&st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />IPB caches updated....\" );\n\t}",
"public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}",
"public function cache($output)\n\t{\n\t\t$name = Kohana::config($this->type.'.cache_folder').'/'.md5($this->file).EXT;\n\t\t// add offset to cache file if using load() if not nested don't indent\n\t\tfile_put_contents($name, $output);\n\t\tunset($output);\n\t}",
"public function cacheInvalidate() {\n }",
"public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }",
"public function write()\n\t{\n\t\t$source = $this->compile();\n\n\t\t// file location\n\t\t$file = $this->template->getEnvironment()->getCache() . '/';\n\t\t$file .= $this->template->getEnvironment()->getCacheFilename($this->filename);\n\n\t\t// attempt to create the directory if needed\n\t\tif(!is_dir(dirname($file)))\n\t\t{\n\t\t\tmkdir(dirname($file), 0777, true);\n\t\t}\n\n\t\t// write to tempfile and rename\n\t\t$tmpFile = tempnam(dirname($file), basename($file));\n\t\tif(@file_put_contents($tmpFile, $source) !== false)\n\t\t{\n\t\t\tif(@rename($tmpFile, $file))\n\t\t\t{\n\t\t\t\tchmod($file, 0644);\n\t\t\t}\n\t\t}\n\t}",
"public function flush()\n {\n if (file_exists($this->CacheFolder . \"/\" . $this->CacheIndex)) {\n unlink($this->CacheFolder . \"/\" . $this->CacheIndex);\n touch($this->CacheFolder . \"/\" . $this->CacheIndex);\n }\n if (file_exists($this->CacheFolder . \"/\" . $this->CacheDB)) {\n unlink($this->CacheFolder . \"/\" . $this->CacheDB);\n touch($this->CacheFolder . \"/\" . $this->CacheDB);\n }\n }",
"private function generate_solr_cache()\r\n\t{\r\n\t\tfile_put_contents($this->solr_cache_file, $this->solr_stream);\r\n\t}",
"protected function setCache()\n {\n if ($this->cache) {\n $cacheFile = $this->getCacheFile();\n $this->setupCachePath($cacheFile);\n file_put_contents($cacheFile, $this->templateOutput);\n }\n }",
"protected function saveToCache() {}",
"public static function save_cache() {\n if (self::$_cache_invalid) {\n if (@file_put_contents(self::$_path_cache_file\n , serialize(self::$_abs_file_paths))) {\n error_log('failed to write absolute file path cache to: ' . self::$_path_cache_file);\n }\n }\n }",
"protected function saveToPackageCache() {}",
"function rebuild_mode($mode)\n {\n foreach ($this->globr($this->BaseDir.\"/\".$mode, \"{$mode}.source\") as $file)\n {\n $basefile = basename($file);\n $uri = str_replace($this->BaseDir, '$URI', $file);\n $uri = str_replace($basefile, \"\", $uri);\n if (file_exists(\"$file.cache\"))\n unlink(\"$file.cache\");\n print \"$file\\n\";\n ob_flush();\n flush();\n $processor = new MarkupBabelProcessor($file, $mode, $uri);\n $processor->rendme();\n }\n }",
"function mgd_cache_invalidate()\n{\n}"
] |
[
"0.6491983",
"0.6459955",
"0.64271337",
"0.64202154",
"0.6412139",
"0.6399634",
"0.6374599",
"0.63711244",
"0.6352128",
"0.63386106",
"0.62591946",
"0.6247567",
"0.6246438",
"0.6244623",
"0.62311906",
"0.62251383",
"0.6215492",
"0.6207733",
"0.6200961",
"0.61920446",
"0.6190865",
"0.6187735",
"0.61579704",
"0.61559814",
"0.6120094",
"0.6099068",
"0.6084164",
"0.6080687",
"0.60607654",
"0.6028695"
] |
0.7934182
|
0
|
Scans theme folders for theme.json files and returns an array of themes
|
public function scanJsonFiles()
{
$themes = [];
foreach (glob($this->themes_path('*'), GLOB_ONLYDIR) as $themeFolder) {
$themeFolder = realpath($themeFolder);
if (file_exists($jsonFilename = $themeFolder . '/' . 'theme.json')) {
$folders = explode(DIRECTORY_SEPARATOR, $themeFolder);
$themeName = end($folders);
// default theme settings
$defaults = [
'name' => $themeName,
'asset-path' => $themeName,
'extends' => null,
];
// If theme.json is not an empty file parse json values
$json = file_get_contents($jsonFilename);
if ($json !== "") {
$data = json_decode($json, true);
if ($data === null) {
throw new \Exception("Invalid theme.json file at [$themeFolder]");
}
} else {
$data = [];
}
// We already know views-path since we have scaned folders.
// we will overide this setting if exists
$data['views-path'] = $themeName;
$themes[] = array_merge($defaults, $data);
}
}
return $themes;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getThemes() {\n\n\t$themesPath = '../../content/themes';\n\n\t$list = scandir($themesPath);\n\t$baseUrl = \\Raindrop\\Core\\Config\\Config::item('baseUrl');\n\t$themes = [];\n\n\tif(!empty($list)) {\n\t\tunset($list[0]);\n\t\tunset($list[1]);\n\n\t\tforeach($list as $dir) {\n\t\t\t$pathThemeDir = $themesPath . '/' . $dir;\n\t\t\t$pathConfig = $pathThemeDir . '/theme.json';\n\t\t\t$pathScreen = $baseUrl . '/content/themes/' . $dir . '/screen.jpg';\n\n\t\t\tif(is_dir($pathThemeDir) and is_file($pathConfig)) {\n\t\t\t\t$config = file_get_contents($pathConfig);\n\t\t\t\t$info = json_decode($config);\n\n\t\t\t\t$info->screen = $pathScreen;\n\t\t\t\t$info->dirTheme = $dir;\n\n\t\t\t\t$themes[] = $info;\n\t\t\t}\n\t\t}\n\n\t}\n\treturn $themes;\n}",
"public static function getAllThemes()\n {\n $themes = [];\n\n foreach (scandir(self::$themeRoot) as $dir) {\n if (self::isTheme($dir)){\n $themeConfig = self::$themeRoot . $dir . '/theme.json';\n $json = file_get_contents($themeConfig);\n $decoded = json_decode($json, true);\n\n $themes[] = $decoded['name'];\n }\n\n }\n\n return $themes;\n }",
"public function get_themes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $folder = new Folder(self::PATH_THEMES);\n\n $theme_list = array();\n $folder_list = $folder->get_listing();\n\n foreach ($folder_list as $theme) {\n $file = new File(self::PATH_THEMES . '/' . $theme . '/info/info');\n\n if (!$file->exists())\n continue;\n\n // FIXME info/info -> deploy/info.php\n include self::PATH_THEMES . '/' . $theme . '/info/info';\n $theme_list[$theme] = $package;\n }\n\n // TODO: Sort by name, but key by theme directory\n return $theme_list;\n }",
"function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}",
"private function themes()\n {\n $all_plugins = json_decode(file_get_contents($this->pluginsJson))->themes;\n return $all_plugins;\n }",
"private function getThemes() {\n $path = sprintf('%s/../../%s/%s/', __DIR__, PUBLIC_PATH, THEME_PATH);\n\n $themes = scandir($path);\n\n $output = [];\n foreach($themes as $theme) {\n // Check if the theme has an info.php file a && file_exists($path.$theme.'/icon.png)nd a thumbnail\n if(file_exists($path.$theme.'/info.php') && file_exists($path.$theme.'/icon.png')) {\n // Store the theme information\n require($path.$theme.'/info.php');\n $output[$theme]['name'] = $name;\n $output[$theme]['author'] = $author;\n $output[$theme]['url'] = $url;\n $output[$theme]['version'] = $version;\n $output[$theme]['path'] = $theme;\n }\n }\n\n return $output;\n }",
"public static function scan()\n {\n if (!FS_ACCESS && Config::get('available_themes')) {\n return Config::get('available_themes');\n }\n $dir = \"themes/\";\n $scanned = scandir($dir);\n $_packages = [];\n foreach ($scanned as $folder) {\n if ($folder[0] != '.') {\n $json = $dir.$folder.'/package.json';\n if (file_exists($json)) {\n $data = json_decode(file_get_contents($json));\n if (!FS_ACCESS && isset($data->mainsite) && $data->mainsite===true) {\n continue;\n }\n @$data->title = @$data->title?? @$data->name;\n $data->package = $folder;\n $data->url = @$data->homepage?? (@$data->url?? '');\n $_packages[$folder] = $data;\n }\n }\n }\n return $_packages;\n }",
"public function scanThemes()\r\n {\r\n\r\n $parentThemes = [];\r\n $themesConfig = config('themes.themes', []);\r\n\r\n foreach ($this->loadThemesJson() as $data) {\r\n // Are theme settings overriden in config/themes.php?\r\n if (array_key_exists($data['name'], $themesConfig)) {\r\n $data = array_merge($data, $themesConfig[$data['name']]);\r\n }\r\n\r\n // Create theme\r\n $theme = new Theme(\r\n $data['name'],\r\n $data['asset-path'],\r\n $data['views-path']\r\n );\r\n\r\n // Has a parent theme? Store parent name to resolve later.\r\n if ($data['extends']) {\r\n $parentThemes[$theme->name] = $data['extends'];\r\n }\r\n\r\n // Load the rest of the values as theme Settings\r\n $theme->loadSettings($data);\r\n }\r\n\r\n // Add themes from config/themes.php\r\n foreach ($themesConfig as $themeName => $themeConfig) {\r\n\r\n // Is it an element with no values?\r\n if (is_string($themeConfig)) {\r\n $themeName = $themeConfig;\r\n $themeConfig = [];\r\n }\r\n\r\n // Create new or Update existing?\r\n if (!$this->exists($themeName)) {\r\n $theme = new Theme($themeName);\r\n } else {\r\n $theme = $this->find($themeName);\r\n }\r\n\r\n // Load Values from config/themes.php\r\n if (isset($themeConfig['asset-path'])) {\r\n $theme->assetPath = $themeConfig['asset-path'];\r\n }\r\n\r\n if (isset($themeConfig['views-path'])) {\r\n $theme->viewsPath = $themeConfig['views-path'];\r\n }\r\n\r\n if (isset($themeConfig['extends'])) {\r\n $parentThemes[$themeName] = $themeConfig['extends'];\r\n }\r\n\r\n $theme->loadSettings(array_merge($theme->settings, $themeConfig));\r\n }\r\n\r\n // All themes are loaded. Now we can assign the parents to the child-themes\r\n foreach ($parentThemes as $childName => $parentName) {\r\n $child = $this->find($childName);\r\n\r\n if ($this->exists($parentName)) {\r\n $parent = $this->find($parentName);\r\n } else {\r\n $parent = new Theme($parentName);\r\n }\r\n\r\n $child->setParent($parent);\r\n }\r\n }",
"function getThemes(){\n\t$result = array();\n\t\n\t$handle = @opendir(ROOT_PATH . 'themes');\n\t\n\twhile (false !== ($f = readdir($handle))){\n\t\tif ($f != \".\" && $f != \"..\" && $f != \"CVS\" && $f != \"index.html\" && !preg_match(\"`[.]`\", $f)){\n\t\t\tif( is_file(ROOT_PATH . 'themes' . DS . $f . DS . 'layout.tpl') ){\n\t\t\t\t$result[] = $f;\n\t\t\t}\n }\n\t}\n closedir($handle);\n\n return $result;\n}",
"function get_themes()\n\t{\n\t\t$handle = opendir($this->e107->e107_dirs['THEMES_DIRECTORY']);\n\t\t$themelist = array();\n\t\twhile ($file = readdir($handle))\n\t\t{\n\t\t\tif (is_dir($this->e107->e107_dirs['THEMES_DIRECTORY'].$file) && $file !='_blank')\n\t\t\t{\n\t\t\t\tif(is_readable(\"./{$this->e107->e107_dirs['THEMES_DIRECTORY']}{$file}/theme.xml\"))\n\t\t\t\t{\n\t\t\t\t\t$themelist[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t\treturn $themelist;\n\t}",
"public function getThemes() {\r\n\t$themes = array();\r\n $themelist = array_merge((array)glob('modules/' . $this->name . '/themes/*', GLOB_ONLYDIR), glob(PROFILE_PATH . $this->name . '/themes/*', GLOB_ONLYDIR));\r\n\tforeach ($themelist as $filename) {\r\n\t $themeName = basename($filename);\r\n\t $themes[$themeName] = $themeName;\r\n\t}\r\n\treturn $themes;\r\n }",
"public function get_themes()\n\t{\n\t\t// load the helper file\n\t\t$this->load->helper('file');\n\n\t\t// get the list of 'folders' which\n\t\t// just means we're getting a potential\n\t\t// list of new themes that's been installed\n\t\t// since we last looked at themes\n\t\t$folders = get_dir_file_info(APPPATH . 'themes/');\n\n\t\t// foreach of those folders, we're loading the class\n\t\t// from the theme_details.php file, then we pass it\n\t\t// off to the save_theme() function to deal with \n\t\t// duplicates and insert newly added themes.\n\t\tforeach ($folders as &$folder)\n\t\t{\n\t\t\t// spawn that theme class...\n\t\t\t$details = $this->spawn_class($folder['relative_path'], $folder['name']);\n\n\t\t\t// if spawn_class was a success\n\t\t\t// we'll see if it needs saving\n\t\t\tif ($details)\n\t\t\t{\n\t\t\t\t// because this pwnd me for 30 minutes\n\t\t\t\t$details->path = $folder['name'];\n\t\t\t\n\t\t\t\t// save it...\n\t\t\t\t$this->save_theme($details);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t// now that we've updated everything, let's\n\t\t// give the end user something to look at.\n\t\treturn $this->db->get($this->_table['templates'])->result();\n\t}",
"public static function all(): array\n {\n $it = new DirectoryIterator(plugins_path('/summer/login/skins'));\n $it->rewind();\n $result = [];\n foreach ($it as $fileinfo) {\n if (!$fileinfo->isDir() || $fileinfo->isDot()) {\n continue;\n }\n $theme = static::load($fileinfo->getFilename());\n $result[] = $theme;\n }\n return $result;\n }",
"private function findThemeTemplateDirs()\n {\n if ($this->theme['module'] === null) { // no module involved\n return array();\n }\n\n // setup directories & namespaces\n $themeDir = \\SimpleSAML\\Module::getModuleDir($this->theme['module']).'/themes/'.$this->theme['name'];\n $subdirs = scandir($themeDir);\n if (!$subdirs) { // no subdirectories in the theme directory, nothing to do here\n // this is probably wrong, log a message\n \\SimpleSAML\\Logger::warning('Emtpy theme directory for theme \"'.$this->theme['name'].'\".');\n return array();\n }\n\n $themeTemplateDirs = array();\n foreach ($subdirs as $entry) {\n // discard anything that's not a directory. Expression is negated to profit from lazy evaluation\n if (!($entry !== '.' && $entry !== '..' && is_dir($themeDir.'/'.$entry))) {\n continue;\n }\n\n // set correct name for the default namespace\n $ns = ($entry === 'default') ? \\Twig_Loader_Filesystem::MAIN_NAMESPACE : $entry;\n $themeTemplateDirs[] = array($ns => $themeDir.'/'.$entry);\n }\n return $themeTemplateDirs;\n }",
"protected function parseThemes()\n {\n foreach ($this->themesDirs as $dir) {\n $absDir = $this->fileLocator->locate($dir);\n $finder = Finder::create()->files()->in($absDir)->name('*.css');\n foreach ($finder as $file) {\n $this->addTheme($file->getBasename('.css'), $file->getPathname());\n }\n }\n #save to cache if env prod\n if ($this->env == 'prod') {\n $this->cacheDriver->save(static::CACHE_THEMES_NAME, $this->getThemes());\n }\n }",
"private function getAllThemeFiles(){\n\t\t$themeFolder = zweb.\"themes/\";\n\t\t$files = scandir($themeFolder.$this->theme);\n\n\t\tif(gettype($files) != \"array\") $files = array();\n\t\tforeach($files as $file){\n\t\t\tif(!is_dir($themeFolder.$file)){\n\t\t\t\t$info = pathinfo($themeFolder.$file);\n\t\t\t\t$this->$info['filename'] = $this->getThemeFile($info['filename'], @$info['extension']);\n\t\t\t}\n\t\t}\n\t}",
"public static function getThemes() {\r\n\t\t$themes = array();\r\n\r\n\t\t// Special files to ignore\r\n\t\t$ignore = array('admin.css');\r\n\r\n\t\t// Get themes corresponding to .css files.\r\n\t\t$dir = dirname(__FILE__) . '/css';\r\n\t\tif ($handle = opendir($dir)) {\r\n\t\t while (false !== ($entry = readdir($handle))) {\r\n\t\t\t if (in_array($entry, $ignore)) {\r\n\t\t\t\t continue;\r\n\t\t\t }\r\n\r\n\t\t\t $file = $dir . '/' . $entry;\r\n\t\t\t if (!is_file($file)) {\r\n\t\t\t\t continue;\r\n\t\t\t }\r\n\r\n\t\t\t // Beautify name\r\n\t\t\t $name = substr($entry, 0, -4); // Remove \".css\"\r\n\t\t\t $name = str_replace('--', ', ', $name);\r\n\t\t\t $name = str_replace('-', ' ', $name);\r\n\t\t\t\t$name = ucwords($name);\r\n\r\n\t\t\t // Add theme\r\n\t $themes[$entry] = $name;\r\n\t\t }\r\n\t\t closedir($handle);\r\n\t\t}\r\n\r\n\t\t$themes['none'] = 'None';\r\n\r\n\t\t// Sort alphabetically\r\n\t\tasort($themes);\r\n\r\n\t\treturn $themes;\r\n\t}",
"public function getRows(): array\n {\n /*\n $dir = base_path('Themes');\n $themes_dirs = File::directories($dir);\n $themes = collect($themes_dirs)->map(\n function ($item) {\n $file_json = $item.DIRECTORY_SEPARATOR.'theme.json';\n\n $json = json_decode(File::get($file_json), true);\n\n $info = pathinfo($item);\n\n return collect($json)->map(\n function ($item) {\n if (! is_string($item)) {\n return json_encode($item);\n }\n\n return $item;\n }\n )\n ->all()\n ;\n }\n )\n ->all()\n ;\n\n\n return $themes;\n */\n return ThemeService::getThemes()->all();\n }",
"public function themes()\n {\n return R::findAll('theme', 'order by name');\n }",
"function scs_get_themes()\n\t {\n\t \tglobal $scs_themes;\n\t\t$scs_themes = array();\n\t\t\n\t \t$dir = dirname(__FILE__).'/'.SCS_THEMES_DIR.'/';\n\t\tif ($handle = opendir($dir)) {\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != \".\" && $file != \"..\" && !is_file($file) && file_exists($dir.$file.'/index.php') ) {\n\t\t\t\t\t$scs_themes[] = ucfirst($file);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t }",
"public function getAllThemes();",
"public function listThemes(Request $request)\n {\n\n // list pages in the site\n $dir = app()->basePath().'/'.env('THEMES_LOCATION');\n\n // list files\n $arr = Utilities::listSpecificFiles($dir, 'theme.json');\n\n $result = array();\n\n foreach ($arr as $item) {\n\n // get contents of file\n $json = json_decode(file_get_contents($item));\n\n // get location of theme\n $temp = explode('public/themes/', $item);\n $location = substr($temp[1], 0, strpos($temp[1], '/theme.json'));\n\n $json->location = $location;\n\n array_push($result, $json);\n\n }\n\n return response()->json($result);\n\n }",
"public function get_themes_list()\n {\n $baseUrl = 'http://prismjs.com/index.html?theme=';\n\n return [\n 1 => ['name' => 'Default', 'url' => $baseUrl . 'prism', 'file' => 'prism'],\n 2 => ['name' => 'Coy', 'url' => $baseUrl . 'prism-coy', 'file' => 'prism-coy'],\n 3 => ['name' => 'Dark', 'url' => $baseUrl . 'prism-dark', 'file' => 'prism-dark'],\n 4 => ['name' => 'Okaidia', 'url' => $baseUrl . 'prism-okaidia', 'file' => 'prism-okaidia'],\n 5 => ['name' => 'Tomorrow', 'url' => $baseUrl . 'prism-tomorrow', 'file' => 'prism-tomorrow'],\n 6 => ['name' => 'Twilight', 'url' => $baseUrl . 'prism-twilight', 'file' => 'prism-twilight'],\n ];\n }",
"public static function getAllAdminThemes()\n {\n /**\n * Create an array of themes, with the directory paths\n * theme.ini files and images paths if they are present\n */\n $themes = array();\n $iterator = new VersionedDirectoryIterator(ADMIN_THEME_DIR);\n $themeDirs = $iterator->getValid();\n foreach ($themeDirs as $themeName) {\n $theme = self::getTheme($themeName);\n $theme->path = ADMIN_THEME_DIR . '/' . $themeName;\n $theme->setImage(self::THEME_IMAGE_FILE_NAME);\n $theme->setIni(self::THEME_INI_FILE_NAME);\n $theme->setConfig(self::THEME_CONFIG_FILE_NAME);\n $themes[$themeName] = $theme;\n }\n ksort($themes);\n return $themes;\n }",
"public function themes_all_json() {\n\n $theme_keys = 'IdeaSpaceVR-' . config('app.version') . '---';\n $themes = Theme::where('status', Theme::STATUS_ACTIVE)->get();\n foreach ($themes as $theme) {\n $config = json_decode($theme->config, true);\n $theme_keys = $theme_keys . $config['#theme-key'] . '-' . $config['#theme-version'] . '---';\n }\n\n if ($theme_keys != '') {\n return response()->json(['themes' => substr($theme_keys, 0, -3)]);\n } else {\n return response()->json(['themes' => '']);\n }\n }",
"public static function get_themes() {\n\t\t$themes = get_transient( self::THEMES_TRANSIENT );\n\t\tif ( false === $themes ) {\n\t\t\t$theme_data = wp_remote_get( 'https://woocommerce.com/wp-json/wccom-extensions/1.0/search?category=themes' );\n\t\t\t$themes = array();\n\n\t\t\tif ( ! is_wp_error( $theme_data ) ) {\n\t\t\t\t$theme_data = json_decode( $theme_data['body'] );\n\t\t\t\t$woo_themes = property_exists( $theme_data, 'products' ) ? $theme_data->products : array();\n\t\t\t\t$sorted_themes = self::sort_woocommerce_themes( $woo_themes );\n\n\t\t\t\tforeach ( $sorted_themes as $theme ) {\n\t\t\t\t\t$slug = sanitize_title_with_dashes( $theme->slug );\n\t\t\t\t\t$themes[ $slug ] = (array) $theme;\n\t\t\t\t\t$themes[ $slug ]['is_installed'] = false;\n\t\t\t\t\t$themes[ $slug ]['has_woocommerce_support'] = true;\n\t\t\t\t\t$themes[ $slug ]['slug'] = $slug;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$installed_themes = wp_get_themes();\n\t\t\t$active_theme = get_option( 'stylesheet' );\n\n\t\t\tforeach ( $installed_themes as $slug => $theme ) {\n\t\t\t\t$theme_data = self::get_theme_data( $theme );\n\t\t\t\t$installed_themes = wp_get_themes();\n\t\t\t\t$themes[ $slug ] = $theme_data;\n\t\t\t}\n\n\t\t\t// Add the WooCommerce support tag for default themes that don't explicitly declare support.\n\t\t\tif ( function_exists( 'wc_is_wp_default_theme_active' ) && wc_is_wp_default_theme_active() ) {\n\t\t\t\t$themes[ $active_theme ]['has_woocommerce_support'] = true;\n\t\t\t}\n\n\t\t\t$themes = array( $active_theme => $themes[ $active_theme ] ) + $themes;\n\n\t\t\tset_transient( self::THEMES_TRANSIENT, $themes, DAY_IN_SECONDS );\n\t\t}\n\n\t\t$themes = apply_filters( 'woocommerce_admin_onboarding_themes', $themes );\n\t\treturn array_values( $themes );\n\t}",
"public static function loadFromThemes()\n {\n $themePath = database_path('themes');\n $folders = scandir($themePath);\n\n foreach ($folders as $folder) {\n $fullPath = $themePath.'/'.$folder;\n\n if ($folder != '.' && $folder != '..' && is_dir($fullPath)) {\n $files = glob($fullPath . \"/index.html\");\n $content = file_get_contents($files[0]);\n preg_match_all('/(<title\\>([^<]*)\\<\\/title\\>)/i', $content, $m);\n $title = $m[2][0];\n\n // Create admin template\n $template = new self();\n $template->name = $title;\n $template->admin_id = 1;\n\n $template->loadFromDirectory($fullPath);\n }\n }\n }",
"public static function getThemes()\n {\n $themes = array();\n $themesdir = opendir('modules/Scribite/plugins/TinyMCE/vendor/tiny_mce/themes');\n while (false !== ($f = readdir($themesdir))) {\n if ($f != '.' && $f != '..' && $f != 'CVS' && !preg_match('/[.]/', $f)) {\n $themes[] = array(\n 'text' => $f,\n 'value' => $f\n );\n }\n }\n\n closedir($themesdir);\n // sort array\n asort($themes);\n\n return $themes;\n }",
"protected function loadThemes()\n {\n $finder = Finder::create()->directories()->in($this->themesPaths);\n\n foreach ($finder->getIterator() as $theme) {\n if ($theme->getRelativePath()) { // only get top level directories\n continue;\n }\n\n $themeFile = $theme->getRealPath() . '/theme.yml';\n\n if (!file_exists($themeFile)) {\n throw new \\Exception(sprintf('%s doesn\\'t exist.', $themeFile));\n }\n\n $config = (new Parser())->parse(file_get_contents($themeFile));\n\n if (!isset($config['name'])) {\n throw new \\Exception(sprintf('%s must contain a name value.', $themeFile));\n }\n\n $this->put($config['name'], new Theme($config, $theme->getRealPath()));\n }\n\n }",
"public static function loadThemes()\n {\n $themesFolder = new Folder(ROOT . DS . 'themes');\n $themes = $themesFolder->read()[0];\n $loader = require ROOT . DS . 'vendor' . DS . 'autoload.php';\n foreach ($themes as $theme) {\n $loader->addPsr4('WasabiTheme\\\\' . $theme . '\\\\', [$themesFolder->path . DS . $theme . DS . 'src']);\n Plugin::load('WasabiTheme/' . $theme, [\n 'path' => $themesFolder->path . DS . $theme . DS,\n 'bootstrap' => true,\n 'routes' => false\n ]);\n }\n }"
] |
[
"0.8207102",
"0.79541254",
"0.79295987",
"0.79103947",
"0.7853992",
"0.77057606",
"0.7662372",
"0.76221615",
"0.7570447",
"0.74533856",
"0.73229605",
"0.7315255",
"0.72631496",
"0.7233973",
"0.7074584",
"0.7070626",
"0.7048884",
"0.7035264",
"0.69457227",
"0.68655175",
"0.6794678",
"0.67769617",
"0.6769152",
"0.6728642",
"0.67263603",
"0.67115515",
"0.66655076",
"0.665744",
"0.66452396",
"0.6642332"
] |
0.8540374
|
0
|
Scan all folders inside the themes path & config/themes.php If a "theme.json" file is found then load it and setup theme
|
public function scanThemes()
{
$parentThemes = [];
$themesConfig = config('themes.themes', []);
foreach ($this->loadThemesJson() as $data) {
// Are theme settings overriden in config/themes.php?
if (array_key_exists($data['name'], $themesConfig)) {
$data = array_merge($data, $themesConfig[$data['name']]);
}
// Create theme
$theme = new Theme(
$data['name'],
$data['asset-path'],
$data['views-path']
);
// Has a parent theme? Store parent name to resolve later.
if ($data['extends']) {
$parentThemes[$theme->name] = $data['extends'];
}
// Load the rest of the values as theme Settings
$theme->loadSettings($data);
}
// Add themes from config/themes.php
foreach ($themesConfig as $themeName => $themeConfig) {
// Is it an element with no values?
if (is_string($themeConfig)) {
$themeName = $themeConfig;
$themeConfig = [];
}
// Create new or Update existing?
if (!$this->exists($themeName)) {
$theme = new Theme($themeName);
} else {
$theme = $this->find($themeName);
}
// Load Values from config/themes.php
if (isset($themeConfig['asset-path'])) {
$theme->assetPath = $themeConfig['asset-path'];
}
if (isset($themeConfig['views-path'])) {
$theme->viewsPath = $themeConfig['views-path'];
}
if (isset($themeConfig['extends'])) {
$parentThemes[$themeName] = $themeConfig['extends'];
}
$theme->loadSettings(array_merge($theme->settings, $themeConfig));
}
// All themes are loaded. Now we can assign the parents to the child-themes
foreach ($parentThemes as $childName => $parentName) {
$child = $this->find($childName);
if ($this->exists($parentName)) {
$parent = $this->find($parentName);
} else {
$parent = new Theme($parentName);
}
$child->setParent($parent);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function scanJsonFiles()\r\n {\r\n $themes = [];\r\n foreach (glob($this->themes_path('*'), GLOB_ONLYDIR) as $themeFolder) {\r\n $themeFolder = realpath($themeFolder);\r\n if (file_exists($jsonFilename = $themeFolder . '/' . 'theme.json')) {\r\n\r\n $folders = explode(DIRECTORY_SEPARATOR, $themeFolder);\r\n $themeName = end($folders);\r\n\r\n // default theme settings\r\n $defaults = [\r\n 'name' => $themeName,\r\n 'asset-path' => $themeName,\r\n 'extends' => null,\r\n ];\r\n\r\n // If theme.json is not an empty file parse json values\r\n $json = file_get_contents($jsonFilename);\r\n if ($json !== \"\") {\r\n $data = json_decode($json, true);\r\n if ($data === null) {\r\n throw new \\Exception(\"Invalid theme.json file at [$themeFolder]\");\r\n }\r\n } else {\r\n $data = [];\r\n }\r\n\r\n // We already know views-path since we have scaned folders.\r\n // we will overide this setting if exists\r\n $data['views-path'] = $themeName;\r\n\r\n $themes[] = array_merge($defaults, $data);\r\n }\r\n }\r\n return $themes;\r\n }",
"protected function loadThemes()\n {\n $finder = Finder::create()->directories()->in($this->themesPaths);\n\n foreach ($finder->getIterator() as $theme) {\n if ($theme->getRelativePath()) { // only get top level directories\n continue;\n }\n\n $themeFile = $theme->getRealPath() . '/theme.yml';\n\n if (!file_exists($themeFile)) {\n throw new \\Exception(sprintf('%s doesn\\'t exist.', $themeFile));\n }\n\n $config = (new Parser())->parse(file_get_contents($themeFile));\n\n if (!isset($config['name'])) {\n throw new \\Exception(sprintf('%s must contain a name value.', $themeFile));\n }\n\n $this->put($config['name'], new Theme($config, $theme->getRealPath()));\n }\n\n }",
"protected function parseThemes()\n {\n foreach ($this->themesDirs as $dir) {\n $absDir = $this->fileLocator->locate($dir);\n $finder = Finder::create()->files()->in($absDir)->name('*.css');\n foreach ($finder as $file) {\n $this->addTheme($file->getBasename('.css'), $file->getPathname());\n }\n }\n #save to cache if env prod\n if ($this->env == 'prod') {\n $this->cacheDriver->save(static::CACHE_THEMES_NAME, $this->getThemes());\n }\n }",
"public static function loadThemes()\n {\n $themesFolder = new Folder(ROOT . DS . 'themes');\n $themes = $themesFolder->read()[0];\n $loader = require ROOT . DS . 'vendor' . DS . 'autoload.php';\n foreach ($themes as $theme) {\n $loader->addPsr4('WasabiTheme\\\\' . $theme . '\\\\', [$themesFolder->path . DS . $theme . DS . 'src']);\n Plugin::load('WasabiTheme/' . $theme, [\n 'path' => $themesFolder->path . DS . $theme . DS,\n 'bootstrap' => true,\n 'routes' => false\n ]);\n }\n }",
"function include_config_files($themes){\n\n foreach($themes as $theme => $path){\n\n $config_path = $path->to('config') .DIRECTORY_SEPARATOR;\n \n //allow developer to replace config paths, \n //if false is returned, don't include it\n \n $scripts = $config_path .WXP::DS(\"config\\scripts.php\");\n $this->include_path($scripts, \"WXP.{$theme}.include_scripts\", function() use ($scripts){\n add_action(\"wp_enqueue_scripts\", function() use ($scripts){\n require $scripts;\n });\n });\n \n //load init file if exist\n \n $hooks = $config_path .WXP::DS(\"config/init.php\");\n $this->include_path($hooks, \"WXP.{$theme}.include_init\"); \n\n //load hooks file if exist\n \n $hooks = $config_path .WXP::DS(\"config/hooks.php\");\n $this->include_path($hooks, \"WXP.{$theme}.include_hooks\"); \n \n //load dom routes if exist\n \n $domRoutes = $config_path .WXP::DS(\"config/dom-routes.php\");\n $this->include_path($domRoutes, \"WXP.{$theme}.include_dom_routes\");\n \n //load options file if exists\n \n $theme_options = $config_path .WXP::DS(\"config/options.php\");\n $this->include_path($theme_options, \"WXP.{$theme}.include_theme_options\");\n \n //load meta boxes file if exists\n \n $meta_boxes = $config_path .WXP::DS(\"config/meta-boxes.php\");\n $this->include_path($meta_boxes, \"WXP.{$theme}.include_meta_boxes\");\n \n \n //load paths if set\n \n $t_paths = $config_path .WXP::DS(\"config/paths.php\");\n $this->include_path($t_paths, \"WXP.{$theme}.include_template_paths\");\n \n }\n }",
"public static function loadFromThemes()\n {\n $themePath = database_path('themes');\n $folders = scandir($themePath);\n\n foreach ($folders as $folder) {\n $fullPath = $themePath.'/'.$folder;\n\n if ($folder != '.' && $folder != '..' && is_dir($fullPath)) {\n $files = glob($fullPath . \"/index.html\");\n $content = file_get_contents($files[0]);\n preg_match_all('/(<title\\>([^<]*)\\<\\/title\\>)/i', $content, $m);\n $title = $m[2][0];\n\n // Create admin template\n $template = new self();\n $template->name = $title;\n $template->admin_id = 1;\n\n $template->loadFromDirectory($fullPath);\n }\n }\n }",
"public function index() {\n\n $user = Auth::user();\n\n try {\n $directories = File::directories(Theme::THEMES_DIR);\n } catch (InvalidArgumentException $e) {\n } \n \n foreach ($directories as $directory) {\n\n /* if system is windows */\n $directory = str_replace('\\\\', '/', $directory);\n\n /* if theme is invalid, there is no creation nor update of theme, but it will be removed from DB */\n if ($this->theme_validation($directory) == true) {\n\n /* if theme does not exist in DB yet, create it */ \n try {\n\n $theme = Theme::where('root_dir', $directory)->firstOrFail(); \n\n } catch (ModelNotFoundException $e) {\n\n $contents = (require($directory . '/' . Theme::CONFIG_FILE));\n\n $theme = Theme::create([\n 'root_dir' => $directory,\n 'status' => Theme::STATUS_INACTIVE,\n 'user_id' => $user->id,\n 'config' => json_encode($contents)\n ]);\n\n }\n \n try {\n\n /* add config contents after previous deactivation of theme (which empties config field) */\n $theme = Theme::where('root_dir', $directory)->firstOrFail(); \n $contents = (require($directory . '/' . Theme::CONFIG_FILE));\n $theme->config = json_encode($contents);\n\n $theme_ideaspacevr_version = substr($contents['#ideaspace-version'], 2); \n if (version_compare($theme_ideaspacevr_version, config('app.version'), '>') === true) {\n $theme->status = Theme::STATUS_INCOMPATIBLE;\n } else if ($theme->status == Theme::STATUS_INCOMPATIBLE) {\n $theme->status = Theme::STATUS_INACTIVE;\n } \n\n /* theme passed validation but has error status */\n if ($theme->status == Theme::STATUS_ERROR) {\n $theme->status = Theme::STATUS_INACTIVE;\n }\n $theme->save(); \n\n } catch (ModelNotFoundException $e) {\n }\n\n } else {\n\n try {\n $theme = Theme::where('root_dir', $directory)->firstOrFail();\n $theme->status = Theme::STATUS_ERROR;\n $theme->save();\n } catch (ModelNotFoundException $e) {\n }\n\n } /* if */\n\n } /* foreach */\n\n\n $themes = Theme::orderBy('updated_at', 'desc')->get();\n $themes_mod = array();\n\n foreach ($themes as $theme) { \n $config = json_decode($theme->config, true);\n\n if ($theme->status==Theme::STATUS_ACTIVE) {\n $status_text = trans('template_themes_config.uninstall');\n } else if ($theme->status==Theme::STATUS_INACTIVE) {\n $status_text = trans('template_themes_config.install_theme');\n } else if ($theme->status==Theme::STATUS_INCOMPATIBLE) {\n $status_text = trans('template_themes_config.incompatible_theme');\n } else {\n $status_text = trans('template_themes_config.invalid_theme');\n }\n\n $theme_mod = array();\n $theme_mod['id'] = $theme->id; \n $theme_mod['theme-name'] = $config['#theme-name']; \n $theme_mod['theme-description'] = $config['#theme-description']; \n $theme_mod['theme-version'] = $config['#theme-version']; \n $theme_mod['theme-author-name'] = $config['#theme-author-name']; \n $theme_mod['theme-author-email'] = $config['#theme-author-email']; \n $theme_mod['theme-homepage'] = $config['#theme-homepage']; \n $theme_mod['theme-keywords'] = $config['#theme-keywords']; \n //$theme_mod['theme-compatibility'] = explode(',', $config['#theme-compatibility']); \n $theme_mod['theme-view'] = $config['#theme-view']; \n\n $theme_mod['status'] = $theme->status; \n $theme_mod['status_class'] = (($theme->status==Theme::STATUS_ACTIVE)?Theme::STATUS_ACTIVE:''); \n $theme_mod['status_aria_pressed'] = (($theme->status==Theme::STATUS_ACTIVE)?'true':'false'); \n $theme_mod['status_text'] = $status_text; \n $theme_mod['screenshot'] = url($theme->root_dir . '/' . Theme::SCREENSHOT_FILE); \n\n\t\t\t\t\t\t/* if lang directory exists we assume there are language files; support legacy themes without lang files */\n\t\t\t\t\t\tif (File::exists($theme->root_dir . '/lang')) {\n\t\t\t\t\t\t\t\t$theme_mod['theme-key'] = $config['#theme-key']; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$theme_mod['theme-key'] = null; \n\t\t\t\t\t\t}\n\n $themes_mod[] = $theme_mod;\n }\n\n $vars = [ \n 'themes' => $themes_mod,\n 'js' => array(asset('public/assets/admin/themes_configuration/js/themes_configuration.js'))\n ];\n\n return view('admin.themes_config', $vars);\n }",
"private function getAllThemeFiles(){\n\t\t$themeFolder = zweb.\"themes/\";\n\t\t$files = scandir($themeFolder.$this->theme);\n\n\t\tif(gettype($files) != \"array\") $files = array();\n\t\tforeach($files as $file){\n\t\t\tif(!is_dir($themeFolder.$file)){\n\t\t\t\t$info = pathinfo($themeFolder.$file);\n\t\t\t\t$this->$info['filename'] = $this->getThemeFile($info['filename'], @$info['extension']);\n\t\t\t}\n\t\t}\n\t}",
"function load_zc_themes()\n{\n\tglobal $context;\n\tglobal $zcFunc, $zc;\n\t\n\t$edit_files = array();\n\t$context['zc']['themes'] = array();\n\t\n\tif (is_dir($zc['themes_dir']))\n\t{\n\t\tif ($dir = @opendir($zc['themes_dir']))\n\t\t{\n\t\t\twhile (($folder = readdir($dir)) !== false)\n\t\t\t{\n\t\t\t\t// skip non-folders\n\t\t\t\tif (!is_dir($zc['themes_dir'] . '/' . $folder))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// we want the theme's info file...\n\t\t\t\tif (file_exists($zc['themes_dir'] . '/' . $folder . '/info.php'))\n\t\t\t\t{\n\t\t\t\t\t$full_path = $zc['themes_dir'] . '/' . $folder . '/info.php';\n\t\t\t\t\t\n\t\t\t\t\t// get the file...\n\t\t\t\t\trequire_once($full_path);\n\t\t\t\t\n\t\t\t\t\tif (!empty($context['zc']['theme']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$theme = $context['zc']['theme'];\n\t\t\t\t\t\t// theme ID must be unique!\n\t\t\t\t\t\tif (!isset($context['zc']['themes'][$theme['id']]))\n\t\t\t\t\t\t\t$context['zc']['themes'][$theme['id']] = $theme;\n\t\t\t\t\t\t// we'll have to make it unique then...\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$old_theme_id = $theme['id'];\n\t\t\t\t\t\t\t$theme['id'] = zc_make_unique_array_key($theme['id'], array($context['zc']['themes']));\n\t\t\t\t\t\t\t$context['zc']['themes'][$theme['id']] = $theme;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!isset($edit_files[$full_path]))\n\t\t\t\t\t\t\t\t$edit_files[$full_path] = array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!isset($edit_files[$full_path]['str_replace']))\n\t\t\t\t\t\t\t\t$edit_files[$full_path]['str_replace'] = array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$edit_files[$full_path]['str_replace'][] = array('\\''. $old_theme_id .'\\'', '\\''. $theme['id'] .'\\'');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$context['zc']['themes'][$theme['id']]['file'] = $full_path;\n\t\t\t\t\t\tunset($context['zc']['theme'], $theme);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dir);\n\t\t}\n\t}\n\t\n\t$context['zc']['admin_theme_settings'] = array();\n\tif (!empty($context['zc']['themes']))\n\t\tforeach ($context['zc']['themes'] as $theme_id => $array)\n\t\t{\n\t\t\tif (!empty($array['settings']))\n\t\t\t\tforeach ($array['settings'] as $setting => $array2)\n\t\t\t\t\t// if $setting is already taken... we'll need to make a unique key...\n\t\t\t\t\tif (!isset($context['zc']['admin_theme_settings'][$setting]) && !isset($temp[$setting]))\n\t\t\t\t\t\t$temp[$setting] = '';\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_setting_key = $setting;\n\t\t\t\t\t\t$setting = zc_make_unique_array_key($setting, array($temp, $context['zc']['admin_theme_settings']));\n\t\t\t\t\t\t$context['zc']['themes'][$theme_id]['settings'][$setting] = $array2;\n\t\t\t\t\t\t$temp[$setting] = '';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isset($edit_files[$array['file']]))\n\t\t\t\t\t\t\t$edit_files[$array['file']] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isset($edit_files[$array['file']]['str_replace']))\n\t\t\t\t\t\t\t$edit_files[$array['file']]['str_replace'] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$edit_files[$array['file']]['str_replace'][] = array('\\''. $old_setting_key .'\\'', '\\''. $setting .'\\'');\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\tif (!empty($array['admin_settings']))\n\t\t\t\tforeach ($array['admin_settings'] as $setting => $array2)\n\t\t\t\t\t// make sure $setting is not already taken\n\t\t\t\t\tif (!isset($context['zc']['admin_theme_settings'][$setting]) && !isset($temp[$setting]))\n\t\t\t\t\t\t$context['zc']['admin_theme_settings'][$setting] = $array2;\n\t\t\t\t\t// we have to make a unique key...\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_setting_key = $setting;\n\t\t\t\t\t\t$setting = zc_make_unique_array_key($setting, array($temp, $context['zc']['admin_theme_settings']));\n\t\t\t\t\t\t$context['zc']['admin_theme_settings'][$setting] = $array2;\n\t\t\t\t\t\t$context['zc']['themes'][$theme_id]['admin_settings'][$setting] = $array2;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isset($edit_files[$array['file']]))\n\t\t\t\t\t\t\t$edit_files[$array['file']] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif (!isset($edit_files[$array['file']]['str_replace']))\n\t\t\t\t\t\t\t$edit_files[$array['file']]['str_replace'] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$edit_files[$array['file']]['str_replace'][] = array('\\''. $old_setting_key .'\\'', '\\''. $setting .'\\'');\n\t\t\t\t\t}\n\t\t}\n\t\t\n\t// adds the rest of the admin_theme_settings\n\tzc_prepare_admin_theme_settings_array();\n\t\t\n\t// now for admin theme settings...\n\tif (!empty($context['zc']['admin_theme_settings']))\n\t\tforeach($context['zc']['admin_theme_settings'] as $k => $array)\n\t\t{\n\t\t\t// skip base admin theme settings, because we already processed them...\n\t\t\tif (isset($context['zc']['base_admin_theme_settings'][$k]))\n\t\t\t\tcontinue;\n\t\t\n\t\t\tif (!isset($zc['settings'][$k]))\n\t\t\t\t$zc['settings'][$k] = $array['value'];\n\t\t\t\t\n\t\t\tif ($array['type'] == 'text')\n\t\t\t\t$zc['settings'][$k] = $zcFunc['un_htmlspecialchars']($zc['settings'][$k]);\n\t\t\t\t\n\t\t\tif (!empty($array['needs_explode']) && !is_array($zc['settings'][$k]))\n\t\t\t\t$zc['settings'][$k] = !empty($zc['settings'][$k]) ? explode(',', $zc['settings'][$k]) : array();\n\t\t}\n\t\t\n\tif (!empty($edit_files) && file_exists($zc['sources_dir'] . '/Subs-Files.php'))\n\t{\n\t\t// we'll need this...\n\t\trequire_once($zc['sources_dir'] . '/Subs-Files.php');\n\t\t\n\t\tif (function_exists('zcWriteChangeToFile'))\n\t\t\tforeach ($edit_files as $file => $edits)\n\t\t\t\tif (!empty($edits))\n\t\t\t\t\tzcWriteChangeToFile($file, $edits);\n\t}\n}",
"function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}",
"public function get_themes()\n\t{\n\t\t// load the helper file\n\t\t$this->load->helper('file');\n\n\t\t// get the list of 'folders' which\n\t\t// just means we're getting a potential\n\t\t// list of new themes that's been installed\n\t\t// since we last looked at themes\n\t\t$folders = get_dir_file_info(APPPATH . 'themes/');\n\n\t\t// foreach of those folders, we're loading the class\n\t\t// from the theme_details.php file, then we pass it\n\t\t// off to the save_theme() function to deal with \n\t\t// duplicates and insert newly added themes.\n\t\tforeach ($folders as &$folder)\n\t\t{\n\t\t\t// spawn that theme class...\n\t\t\t$details = $this->spawn_class($folder['relative_path'], $folder['name']);\n\n\t\t\t// if spawn_class was a success\n\t\t\t// we'll see if it needs saving\n\t\t\tif ($details)\n\t\t\t{\n\t\t\t\t// because this pwnd me for 30 minutes\n\t\t\t\t$details->path = $folder['name'];\n\t\t\t\n\t\t\t\t// save it...\n\t\t\t\t$this->save_theme($details);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t// now that we've updated everything, let's\n\t\t// give the end user something to look at.\n\t\treturn $this->db->get($this->_table['templates'])->result();\n\t}",
"public static function scan()\n {\n if (!FS_ACCESS && Config::get('available_themes')) {\n return Config::get('available_themes');\n }\n $dir = \"themes/\";\n $scanned = scandir($dir);\n $_packages = [];\n foreach ($scanned as $folder) {\n if ($folder[0] != '.') {\n $json = $dir.$folder.'/package.json';\n if (file_exists($json)) {\n $data = json_decode(file_get_contents($json));\n if (!FS_ACCESS && isset($data->mainsite) && $data->mainsite===true) {\n continue;\n }\n @$data->title = @$data->title?? @$data->name;\n $data->package = $folder;\n $data->url = @$data->homepage?? (@$data->url?? '');\n $_packages[$folder] = $data;\n }\n }\n }\n return $_packages;\n }",
"private function getDirectories()\n {\n $this->load();\n\n $this->data['themeDirectory'] = 'catalog/view/theme/default/';\n $customizedFile = $this->data['themeDirectory'] . 'stylesheet/mundipagg/mundipagg_customized.css';\n\n if (file_exists($customizedFile)) {\n $this->data['customizedFile'] = $customizedFile;\n }\n }",
"function load_local_theme_files(){\n\t$files = array(\n\t\t'classes/Site.php',\n\t\t'classes/RouteCreator.php',\n\t\t'classes/AdminOptions.php',\n\t);\n\n\tif ($files) {\n\t\tforeach ($files as $file) {\n\t\t\trequire_once($file);\n\t\t}\n\t}\n}",
"function getThemes() {\n\n\t$themesPath = '../../content/themes';\n\n\t$list = scandir($themesPath);\n\t$baseUrl = \\Raindrop\\Core\\Config\\Config::item('baseUrl');\n\t$themes = [];\n\n\tif(!empty($list)) {\n\t\tunset($list[0]);\n\t\tunset($list[1]);\n\n\t\tforeach($list as $dir) {\n\t\t\t$pathThemeDir = $themesPath . '/' . $dir;\n\t\t\t$pathConfig = $pathThemeDir . '/theme.json';\n\t\t\t$pathScreen = $baseUrl . '/content/themes/' . $dir . '/screen.jpg';\n\n\t\t\tif(is_dir($pathThemeDir) and is_file($pathConfig)) {\n\t\t\t\t$config = file_get_contents($pathConfig);\n\t\t\t\t$info = json_decode($config);\n\n\t\t\t\t$info->screen = $pathScreen;\n\t\t\t\t$info->dirTheme = $dir;\n\n\t\t\t\t$themes[] = $info;\n\t\t\t}\n\t\t}\n\n\t}\n\treturn $themes;\n}",
"protected function loadThemeLayouts()\n {\n $this->layouts = [];\n $layoutsDirectory = new DirectoryIterator($this->getFolder() . '/layouts');\n foreach ($layoutsDirectory as $entry) {\n if ($entry->isDir() && ! $entry->isDot()) {\n $layoutSlug = $entry->getFilename();\n $layout = new ThemeLayout($this, $layoutSlug);\n $this->layouts[$layoutSlug] = $layout;\n }\n }\n }",
"function find_all_themes($full_details = false)\n{\n if ($GLOBALS['IN_MINIKERNEL_VERSION']) {\n return $full_details ? array('default' => array()) : array('default' => do_lang('DEFAULT'));\n }\n\n require_code('files');\n\n $themes = array();\n $_dir = @opendir(get_file_base() . '/themes/');\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n $ini_file = get_file_base() . '/themes/' . $file . '/theme.ini';\n if ((strpos($file, '.') === false) && (is_dir(get_file_base() . '/themes/' . $file)) && (file_exists($ini_file))) {\n $details = better_parse_ini_file($ini_file);\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes[$file] = $full_details ? $details : $details['title'];\n }\n }\n closedir($_dir);\n }\n if (get_custom_file_base() != get_file_base()) {\n $_dir = @opendir(get_custom_file_base() . '/themes/');\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n $ini_file = get_custom_file_base() . '/themes/' . $file . '/theme.ini';\n if ((strpos($file, '.') === false) && (is_dir(get_custom_file_base() . '/themes/' . $file)) && (file_exists($ini_file))) {\n $details = better_parse_ini_file($ini_file);\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes[$file] = $full_details ? $details : $details['title'];\n }\n }\n closedir($_dir);\n }\n }\n if (!array_key_exists('default', $themes)) {\n $details = better_parse_ini_file(get_file_base() . '/themes/default/theme.ini');\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes['default'] = $full_details ? $details : $details['title'];\n }\n\n // Sort\n if ($full_details) {\n sort_maps_by($themes, 'title');\n } else {\n natsort($themes);\n }\n\n // Default theme should go first\n if (isset($themes['default'])) {\n $temp = $themes['default'];\n $temp_2 = $themes;\n $themes = array('default' => $temp) + $temp_2;\n }\n\n // Admin theme should go last\n if (isset($themes['admin'])) {\n $temp = $themes['admin'];\n unset($themes['admin']);\n $themes['admin'] = $temp;\n }\n\n return $themes;\n}",
"function scs_get_themes()\n\t {\n\t \tglobal $scs_themes;\n\t\t$scs_themes = array();\n\t\t\n\t \t$dir = dirname(__FILE__).'/'.SCS_THEMES_DIR.'/';\n\t\tif ($handle = opendir($dir)) {\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != \".\" && $file != \"..\" && !is_file($file) && file_exists($dir.$file.'/index.php') ) {\n\t\t\t\t\t$scs_themes[] = ucfirst($file);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t }",
"function search_theme_directories($force = \\false)\n {\n }",
"public function get_themes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $folder = new Folder(self::PATH_THEMES);\n\n $theme_list = array();\n $folder_list = $folder->get_listing();\n\n foreach ($folder_list as $theme) {\n $file = new File(self::PATH_THEMES . '/' . $theme . '/info/info');\n\n if (!$file->exists())\n continue;\n\n // FIXME info/info -> deploy/info.php\n include self::PATH_THEMES . '/' . $theme . '/info/info';\n $theme_list[$theme] = $package;\n }\n\n // TODO: Sort by name, but key by theme directory\n return $theme_list;\n }",
"public static function getAllThemes()\n {\n $themes = [];\n\n foreach (scandir(self::$themeRoot) as $dir) {\n if (self::isTheme($dir)){\n $themeConfig = self::$themeRoot . $dir . '/theme.json';\n $json = file_get_contents($themeConfig);\n $decoded = json_decode($json, true);\n\n $themes[] = $decoded['name'];\n }\n\n }\n\n return $themes;\n }",
"public static function theme(): void\n {\n $smarty = self::getInstance(Smarty::class);\n if (defined(\"_PATH_\"))\n $smarty->assign(\"base\", _PATH_);\n $smarty->assign(\"css\", _TEMPLATES_ . \"/\" . _THEME_NAME_ . \"/css\");\n $smarty->assign(\"data\", _ROOT_ . \"/../data\");\n $smarty->assign(\"root\", _ROOT_);\n $smarty->assign(\"js\", _TEMPLATES_ . \"/\" . _THEME_NAME_ . \"/js\");\n $smarty->assign(\"img\", _TEMPLATES_ . \"/\" . _THEME_NAME_ . \"/img\");\n $smarty->assign(\"template\", _THEME_);\n\n if (file_exists(_APP_ . \"/routes.php\"))\n include_once(_APP_ . \"/routes.php\");\n else\n Display::response(\"No se ha encontrado el archivo routes.php\", \"json\", 500);\n \n if (is_dir(_SRC_ . \"/Routes\"))\n foreach (glob(_SRC_ . \"/Routes/*.php\") as $routeFile)\n require_once $routeFile;\n \n \n if (file_exists(_THEMES_ . \"/\" . _THEME_NAME_ . \"/index.php\")) {\n include_once(_THEMES_ . \"/\" . _THEME_NAME_ . \"/index.php\");\n }\n }",
"private function findThemeTemplateDirs()\n {\n if ($this->theme['module'] === null) { // no module involved\n return array();\n }\n\n // setup directories & namespaces\n $themeDir = \\SimpleSAML\\Module::getModuleDir($this->theme['module']).'/themes/'.$this->theme['name'];\n $subdirs = scandir($themeDir);\n if (!$subdirs) { // no subdirectories in the theme directory, nothing to do here\n // this is probably wrong, log a message\n \\SimpleSAML\\Logger::warning('Emtpy theme directory for theme \"'.$this->theme['name'].'\".');\n return array();\n }\n\n $themeTemplateDirs = array();\n foreach ($subdirs as $entry) {\n // discard anything that's not a directory. Expression is negated to profit from lazy evaluation\n if (!($entry !== '.' && $entry !== '..' && is_dir($themeDir.'/'.$entry))) {\n continue;\n }\n\n // set correct name for the default namespace\n $ns = ($entry === 'default') ? \\Twig_Loader_Filesystem::MAIN_NAMESPACE : $entry;\n $themeTemplateDirs[] = array($ns => $themeDir.'/'.$entry);\n }\n return $themeTemplateDirs;\n }",
"private function themes()\n {\n $all_plugins = json_decode(file_get_contents($this->pluginsJson))->themes;\n return $all_plugins;\n }",
"public static function load_themes()\n\t{\n\t\t$config = Kohana::$config->load('site');\n\n\t\t//set admin theme based on path info\n\t\t$path = ltrim(Request::detect_uri(), '/');\n\t\tTheme::$is_admin = ( $path == \"admin\" || !strncmp($path, \"admin/\", 6) );\n\n\t\tif (Theme::$is_admin)\n\t\t{\n\t\t\t// Load the admin theme\n\t\t\tTheme::$admin_theme_name = $config->get('admin_theme', Theme::$admin_theme_name);\n\t\t\tTheme::$active = Theme::$admin_theme_name;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Load the site theme\n\t\t\tTheme::$site_theme_name = $config->get('theme', Theme::$site_theme_name);\n\t\t\tTheme::$active = Theme::$site_theme_name;\n\t\t}\n\t\n\t\t//Set mobile theme, if enabled and mobile request\n\t\tif(Request::is_mobile() AND $config->get('mobile_theme', FALSE))\n\t\t{\n\t\t\t// Load the mobile theme\n\t\t\tTheme::$site_theme_name = $config->get('mobile_theme', Theme::$site_theme_name);\n\t\t\tTheme::$active = Theme::$site_theme_name;\n\t\t}\n\t\n\t\t// Admins can override the site theme, temporarily. This lets us preview themes.\n\t\tif (User::is_admin() AND isset($_GET['theme']) AND $override = $_GET['theme'])\n\t\t{\n\t\t\tif (file_exists(THEMEPATH.$override))\n\t\t\t{\n\t\t\t\tTheme::$site_theme_name = $override;\n\t\t\t\tTheme::$admin_theme_name = $override;\n\t\t\t\tTheme::$active \t\t = $override;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tKohana::$log->add(LOG::ERROR, 'Missing override site theme: :theme', array(':theme' => $override));\n\t\t\t}\n\t\t}\n\n\t\t//Finally set the active theme\n\t\tTheme::set_theme();\n\t}",
"function init_theme() {\r\n\r\n\t\t$possible_names = self::get_theme_name();\r\n\r\n\t\tforeach( $possible_names as $type => $name ){\r\n\r\n\t\t\t$theme_class = \"WP_Job_Manager_Field_Editor_Themes_\" . ucfirst( $name );\r\n\r\n\t\t\tif( class_exists( $theme_class ) ) {\r\n\t\t\t\t$theme = new $theme_class();\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}",
"public function wp_themes_dir($theme = \\false)\n {\n }",
"function getThemes(){\n\t$result = array();\n\t\n\t$handle = @opendir(ROOT_PATH . 'themes');\n\t\n\twhile (false !== ($f = readdir($handle))){\n\t\tif ($f != \".\" && $f != \"..\" && $f != \"CVS\" && $f != \"index.html\" && !preg_match(\"`[.]`\", $f)){\n\t\t\tif( is_file(ROOT_PATH . 'themes' . DS . $f . DS . 'layout.tpl') ){\n\t\t\t\t$result[] = $f;\n\t\t\t}\n }\n\t}\n closedir($handle);\n\n return $result;\n}",
"function get_themes()\n\t{\n\t\t$handle = opendir($this->e107->e107_dirs['THEMES_DIRECTORY']);\n\t\t$themelist = array();\n\t\twhile ($file = readdir($handle))\n\t\t{\n\t\t\tif (is_dir($this->e107->e107_dirs['THEMES_DIRECTORY'].$file) && $file !='_blank')\n\t\t\t{\n\t\t\t\tif(is_readable(\"./{$this->e107->e107_dirs['THEMES_DIRECTORY']}{$file}/theme.xml\"))\n\t\t\t\t{\n\t\t\t\t\t$themelist[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t\treturn $themelist;\n\t}",
"public function setup_theme()\n {\n }"
] |
[
"0.79209036",
"0.74556345",
"0.7422077",
"0.7328163",
"0.72249675",
"0.71615463",
"0.70531726",
"0.70512605",
"0.7002758",
"0.69143975",
"0.6758028",
"0.6712508",
"0.66665715",
"0.66625714",
"0.6656916",
"0.6556796",
"0.65363455",
"0.6425786",
"0.6399321",
"0.63572425",
"0.6289009",
"0.62676114",
"0.62641114",
"0.6227297",
"0.6223313",
"0.62006205",
"0.6179077",
"0.6147736",
"0.6124989",
"0.6096788"
] |
0.8104486
|
0
|
/ | Blade Helper Functions | Return css link for $href
|
public function css($href)
{
return sprintf('<link media="all" type="text/css" rel="stylesheet" href="%s">', $this->url($href));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"static function css($href) {\n\t\tif (is_array($href)) {\n\t\t\t$return = '';\n\t\t\tforeach ($href as $h) $return .= self::css($h);\n\t\t\treturn $return;\n\t\t} else {\n\t\t\t//see if shortcut exists\n\t\t\t$shortcuts = config::get('css.shortcuts');\n\t\t\tif (array_key_exists($href, $shortcuts)) $href = $shortcuts[$href];\n\t\t\treturn self::tag('link', array('rel'=>'stylesheet', 'href'=>$href));\n\t\t}\n\t}",
"public function getStylesheetUrl (): string;",
"function style_cdn($path)\r\n{\r\n\t$path = (env('APP_ENV') === 'local') ? $path : env('CDN_URL') . $path;\r\n\r\n\treturn '<link media=\"all\" type=\"text/css\" rel=\"stylesheet\" href=\"' . $path . '\">';\r\n}",
"private function links()\n {\n foreach ($this->controller->links as $value)\n echo \"\\t<link rel='stylesheet' href='\" . DOMAIN . $value . \"' />\\n\";\n }",
"public function showCss()\n {\n $addon_css = $this->css->url('pagelinks.css');\n $output = '<link rel=\"stylesheet\" href=\"' . $addon_css . '\">';\n $output .= '<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css\">';\n\n return $output;\n\n }",
"public static function theme_css($href)\n {\n $href = URL::site_url(\n CI::$APP->config->item('theme_location') \n . CI::$APP->template->theme . '/'\n . self::$css_folder \n . $href\n );\n \n return Tag::css($href);\n }",
"protected function renderStylesheet(){\n \n return sprintf(\n '<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\" media=\"%s\">',\n $this->getField('url'),\n $this->getField('media','screen, projection')\n );\n \n }",
"public function getStyleUrl(){\n return \"http://localhost/dashboard/dm_chansons/src/view/style.css\";\n }",
"function link_tag( $href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE )\n\t{\n\t\t$CI =& get_instance();\n\t\t$link = '<link ';\n\n\t\tif ( is_array( $href ) )\n\t\t{\n\t\t\tforeach ( $href as $k => $v )\n\t\t\t{\n\t\t\t\tif ( $k === 'href' && ! preg_match( '#^([a-z]+:)?//#i', $v ) )\n\t\t\t\t{\n\t\t\t\t\tif ( $index_page === TRUE )\n\t\t\t\t\t{\n\t\t\t\t\t\t$link .= 'href=\"' . $CI->config->site_url( $v ) . '\" ';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$link .= 'href=\"' . $CI->config->slash_item( 'base_url' ) . $v . '\" ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$link .= $k . '=\"' . $v . '\" ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( preg_match( '#^([a-z]+:)?//#i', $href ) )\n\t\t\t{\n\t\t\t\t$link .= 'href=\"' . $href . '\" ';\n\t\t\t}\n\t\t\telseif ( $index_page === TRUE )\n\t\t\t{\n\t\t\t\t$link .= 'href=\"' . $CI->config->site_url( $href ) . '\" ';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$link .= 'href=\"' . $CI->config->slash_item( 'base_url' ) . $href . '\" ';\n\t\t\t}\n\n\t\t\t$link .= 'rel=\"' . $rel . '\" type=\"' . $type . '\" ';\n\n\t\t\tif ( $media !== '' )\n\t\t\t{\n\t\t\t\t$link .= 'media=\"' . $media . '\" ';\n\t\t\t}\n\n\t\t\tif ( $title !== '' )\n\t\t\t{\n\t\t\t\t$link .= 'title=\"' . $title . '\" ';\n\t\t\t}\n\t\t}\n\n\t\treturn $link . \"/>\\n\";\n\t}",
"function styleCurrentNavLink( $css ) {\n $here = $_SERVER['SCRIPT_NAME'];\n $bits = explode('/',$here);\n $filename = $bits[count($bits)-1];\n echo \"<style>nav a[href$='$filename'] { $css }</style>\";\n}",
"public function getCssPath();",
"public function getCssLink($htmlRelativeDir=\".\"){\n\t\treturn \"<link type=\\\"text/css\\\" media=\\\"all\\\" rel=\\\"stylesheet\\\" href=\\\"\".$this->getCss($htmlRelativeDir).\"\\\">\";\n\t}",
"function ju_link_inline(...$a) {return ju_call_a(function(string $res):string {return ju_resource_inline(\n\t$res, function(string $url):string {return ju_tag(\n\t\t'link', ['href' => $url, 'rel' => 'stylesheet', 'type' => 'text/css'], '', false\n\t);}\n\t# 2023-01-06 $a is always an array here: https://3v4l.org/K6FVO\n);}, $a);}",
"public function link($filename)\n {\n return UrlHelper::getActionUrl('sass/compiler/sass', array('filename' => $filename));\n }",
"protected function pakHrefAttr(): string\n {\n return \"href='{$this->link}'\";\n }",
"function head_css()\n{\n return get_view()->headLink() . get_view()->headStyle();\n}",
"public function style($url, $attr = array())\n\t{\n\t\t$attr = array_merge(array('media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet'), $attr);\n\t\t$attr['href'] = $url;\n\t\t\n\t\treturn $this->e('link', $attr).PHP_EOL;\n\t}",
"public function stylesheet($href)\n {\n return $this->rel('stylesheet')->href($href);\n }",
"public function get_cssAdmin(){\n \n return BASE_URL.\"wear/\".$this->back.\"/\".\"css/\";\n \n }",
"function stylesheets($dirs)\n{\n echo assets($dirs, '<link rel=\"stylesheet\" href=\"{link}\">');\n}",
"public function assets_css() {\n \n $data = '<link rel=\"stylesheet\" type=\"text/css\" href=\"//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.css?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\";\n $data .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . base_url() . 'assets/apps/dashboard/styles/css/dashboard.css?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\";\n \n if ( $this->css_urls_widgets ) {\n \n foreach ( $this->css_urls_widgets as $url ) {\n \n $data .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $url . '?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\"; \n \n }\n \n }\n \n return $data;\n \n }",
"function df_link_inline(...$a) {return df_call_a(function(string $res):string {return df_resource_inline(\n\t$res, function(string $url):string {return df_tag(\n\t\t'link', ['href' => $url, 'rel' => 'stylesheet', 'type' => 'text/css'], '', false\n\t);}\n\t# 2023-01-06 $a is always an array here: https://3v4l.org/K6FVO\n);}, $a);}",
"function link_tag(\n $href = '',\n string $rel = 'stylesheet',\n string $type = 'text/css',\n string $title = '',\n string $media = '',\n bool $indexPage = false,\n string $hreflang = ''\n ): string {\n $attributes = [];\n // extract fields if needed\n if (is_array($href)) {\n $rel = $href['rel'] ?? $rel;\n $type = $href['type'] ?? $type;\n $title = $href['title'] ?? $title;\n $media = $href['media'] ?? $media;\n $hreflang = $href['hreflang'] ?? '';\n $indexPage = $href['indexPage'] ?? $indexPage;\n $href = $href['href'] ?? '';\n }\n\n if (! preg_match('#^([a-z]+:)?//#i', $href)) {\n $attributes['href'] = $indexPage ? site_url($href) : slash_item('baseURL') . $href;\n } else {\n $attributes['href'] = $href;\n }\n\n if ($hreflang !== '') {\n $attributes['hreflang'] = $hreflang;\n }\n\n $attributes['rel'] = $rel;\n\n if ($type !== '' && $rel !== 'canonical' && $hreflang === '' && ! ($rel === 'alternate' && $media !== '')) {\n $attributes['type'] = $type;\n }\n\n if ($media !== '') {\n $attributes['media'] = $media;\n }\n\n if ($title !== '') {\n $attributes['title'] = $title;\n }\n\n return '<link' . stringify_attributes($attributes) . _solidus() . '>';\n }",
"public static function css() {\r\n\t\t\t$s = '';\r\n\t\t\tforeach(func_get_args() as $css) {\r\n\t\t\t\t$file = WEB_ROOT . '/' . $css;\r\n\t\t\t\tif(!file_exists($file)) {\r\n\t\t\t\t\tABPF::logger()->error(\"CSS file $file doesn't exist!\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$v = filemtime($file);\r\n\t\t\t\t$s .= sprintf('<link rel=\"stylesheet\" type=\"text/css\" href=\"%s/%s?v=%d\" />', BASE_URL, $css, $v);\r\n\t\t\t}\r\n\t\t\treturn $s;\r\n\t\t}",
"public static function style($url, $attributes = array()) {\n\t\t$defaults = array('media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet');\n\t\t$attributes = $attributes + $defaults;\n\t\t$url = URL::to_asset($url);\n\t\tif (substr($url, -7) == 'app.css') { $attributes[\"id\"] = 'lnk_appCSS'; } \n\t\treturn '<link href=\"'.$url.'\"'.static::attributes($attributes).'>'.PHP_EOL;\n\t}",
"public function href($href)\n {\n return $this->attribute('href', $href);\n }",
"public function appendCssUrl($url) {\n $this->appendToHead(<<<HTML\n <link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\">\nHTML\n) ;\n }",
"public function addCSS($href)\n {\n $this->css .= \"<link href=$href rel='stylesheet' />\";\n }",
"function src_inc_css(string $file) : string {\n return \"<link rel='stylesheet' href='\".$file.\"'>\";\n}",
"function href($link = false, $name = false) {\n $return = config('host') . $link;\n\n if ($name) {\n $return = '<a href=\"' . $return . '\">' . $name . '</a>';\n }\n\n return $return;\n}"
] |
[
"0.7514859",
"0.6424251",
"0.63273245",
"0.6172119",
"0.6168248",
"0.61563194",
"0.6124968",
"0.60358727",
"0.60316676",
"0.5997698",
"0.5993789",
"0.5988227",
"0.598597",
"0.59447956",
"0.5913604",
"0.58987695",
"0.5898299",
"0.5888315",
"0.5870644",
"0.5855962",
"0.5835656",
"0.58247864",
"0.58141637",
"0.580543",
"0.57652456",
"0.5764353",
"0.5754122",
"0.57535005",
"0.5729241",
"0.5707437"
] |
0.7022688
|
1
|
Return script link for $href
|
public function js($href)
{
return sprintf('<script src="%s"></script>', $this->url($href));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function getUrl() {\r\n $url = \\Nette\\Utils\\Strings::endsWith($this->url, \"/\") ? $this->url : $this->url . \"/\"; \r\n $script = \\Nette\\Utils\\Strings::startsWith($this->script, \"/\") ? $this->script : \"/\" . $this->script; \r\n \r\n return $url . $script;\r\n }",
"function getScriptUrl() ;",
"public function href();",
"protected function determineScriptUrl() {}",
"protected function determineScriptUrl() {}",
"protected function determineScriptUrl() {}",
"public function getScriptUrl() {}",
"public function getScriptUrl() {}",
"public function getScriptUrl() {}",
"public function getScriptUrl() {}",
"public function getScriptUrl() {}",
"public function getScriptUrl() {}",
"public function getScriptUrl() {}",
"public function getScriptUrl() {}",
"function href() {\n\t\t$usemodrewrite = polarbear_setting('usemodrewrite');\n\t\tif ($usemodrewrite) {\n\t\t\treturn $this->fullpath();\n\t\t} else {\n\t\t\treturn $this->templateToUse() . '?polarbear-page=' . $this->getId();\n\t\t}\n\t}",
"protected function pakHrefAttr(): string\n {\n return \"href='{$this->link}'\";\n }",
"public function script($script) {\n\t\tif (strpos($script, 'http') === false) {\n\t\t\techo \"<script src='http://\".Config::$baseurl.\"js/{$script}'></script>\";\n\t\t} else {\n\t\t\techo \"<script src='{$script}'></script>\";\n\t\t}\n\t}",
"protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $router = GeneralUtility::makeInstance(Router::class);\n $route = $router->match($routePath);\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoute($route->getOption('_identifier'));\n } elseif ($moduleName = GeneralUtility::_GP('M')) {\n $this->thisScript = BackendUtility::getModuleUrl($moduleName);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }",
"protected function determineScriptUrl()\n {\n if ($routePath = GeneralUtility::_GP('route')) {\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $this->thisScript = (string)$uriBuilder->buildUriFromRoutePath($routePath);\n } else {\n $this->thisScript = GeneralUtility::getIndpEnv('SCRIPT_NAME');\n }\n }",
"function script()\n {\n return '<script type=\"text/javascript\" src=\"' . $this->URL . '\"></script>';\n }",
"public function getUrl($script)\r\n\t{\r\n\t\tif (!array_key_exists($script, $this->url_script))\r\n\t\t{\r\n\t\t\t$msg = \"L'url pour le script $script n'existe pas ou n'est pas chargée. Vérifiez le paramétrage.\";\r\n\t\t\tCertissimLogger::insertLog(__METHOD__.' : '.__LINE__, $msg);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn $this->url_script[$script];\r\n\t}",
"protected function getScriptUrl()\n {\n return $this->getBaseUrl() . '/' . $this->baseUrl;\n }",
"public function getUrl($script) {\r\n if (!array_key_exists($script, $this->url)) {\r\n $msg = \"L'url pour le script $script n'existe pas ou n'est pas chargée. Vérifiez le paramétrage.\";\r\n insertLogKwixo(__METHOD__ . ' : ' . __LINE__, $msg);\r\n return false;\r\n }\r\n\r\n return $this->url[$script];\r\n }",
"function getLink(): string;",
"function script_url() {\n return $this->request()->script_url();\n }",
"function aitch( $href, $absolute = FALSE ){\n\t\tif( $absolute )\n\t\t\treturn AitchRef::_site_url_absolute( $href );\n\t\telse\n\t\t\treturn AitchRef::_site_url( $href );\n\t}",
"function getJavaScriptCommandForOneLink($link){\n \t\n \t$linkArray = we_SEEM::getAllHrefs($link);\n\n \t// Remove all other Stuff from the linkArray\n // Here all SEEM - Links are removed as well\n $linkArray = we_SEEM::onlyUseHyperlinks($linkArray);\n\n // if an array is returned in onlyUseHyperlinks, then parse the $code, otherwise return the same code.\n if($linkArray && is_array($linkArray)){\n\n // Remove all javascript, or target stuff, from links, they could disturb own functionality\n // Important are $linkArray[1][*] and $linkArray[4][*1]\n $linkArray = we_SEEM::cleanLinks($linkArray);\n\n // $linkArray[5] - Array of the relative translation of given Link-targets, only with webEdition-Docs\n $linkArray[5] = we_SEEM::findRelativePaths($linkArray[2]);\n\t\t\t\t\n // $linkArray[6] - Array which contains the docIds of the Documents, or -1\n $linkArray[6] = we_SEEM::getDocIDsByPaths($linkArray[5]);\n \n //\t$linkArray[7] - contains the ContentTypes of the target, or ''\n $linkArray[7] = we_SEEM::getDocContentTypesByID($linkArray[6]);\n\n $code = we_SEEM::link2we_cmd($linkArray);\n }\n \treturn $code;\n }",
"function url_for($script_path) {\n\t// adds the leading '/' if it isn't already passed through the argument\n\tif($script_path[0] != '/') {\n\t\t$script_path = \"/\" . $script_path;\n\t}\n\treturn WWW_ROOT . $script_path;\n}",
"public function getScriptUrl()\n {\n return $this->thisScript;\n }",
"function url_for($script_path) {\n //add the leading '/' if not present\n if ($script_path[0] != '/') {\n $script_path = \"/\" . $script_path;\n }\n return WWW_ROOT . $script_path;\n }"
] |
[
"0.6668095",
"0.66259503",
"0.63498396",
"0.63353276",
"0.63334626",
"0.63334626",
"0.6276282",
"0.6276282",
"0.6276282",
"0.6276282",
"0.6276282",
"0.6276282",
"0.6276282",
"0.6276282",
"0.6160151",
"0.59599316",
"0.5953263",
"0.59106237",
"0.5870102",
"0.58261865",
"0.58247083",
"0.5805118",
"0.5773413",
"0.57694244",
"0.57677096",
"0.5758596",
"0.57465535",
"0.57238233",
"0.5688327",
"0.5645184"
] |
0.6873944
|
0
|
Return the dates of the first and last blog entries 7 feb 09: created 5 jan 11: combined two functions into one
|
function blog_first_and_last_dates() {
$dates = array();
$query = "SELECT `time` FROM `blog` ORDER BY `time` ASC LIMIT 1";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
array_push($dates, $row[0]);
$query = "SELECT `time` FROM `blog` ORDER BY `time` DESC LIMIT 1";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
array_push($dates, $row[0]);
return $dates;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function getPostDateRange() {\n \n switch($this->validFilter['postDate']) {\n case 'today' :\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n break;\n\n case 'yesterday':\n $dateStart = new \\DateTime('yesterday');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = new \\DateTime('yesterday');\n $dateEnd->setTime(23, 59, 59);\n break;\n\n case 'thisWeek':\n $today = new \\DateTime();\n if('Sunday' == $today->format('l')) {\n $dateStart = clone $today;\n $dateStart->modify('Monday last week');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = $today;\n $dateEnd->setTime(23, 59, 59);\n } else {\n $dateStart = clone $today;\n $dateStart->modify('Monday this week');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = clone $today;\n $dateEnd->modify('Sunday this week');\n $dateEnd->setTime(23, 59, 59);\n }\n break;\n\n case 'lastWeek':\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateStart->sub(new \\DateInterval('P7D'));\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n break;\n\n case 'pastMonth':\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateStart->sub(new \\DateInterval('P1M'));\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n break;\n default :\n $dateStart = new \\DateTime($this->validFilter['postDate']);\n $dateStart->setTime(0, 0, 1);\n $dateEnd = new \\DateTime($this->validFilter['postDate']);\n $dateEnd->setTime(23, 59, 59);\n break;\n } // end of switch\n \n return array($dateStart, $dateEnd);\n }",
"function get_published_date($meta_object,$time){\n $date2 = \"\";\n \n for($i=0;$i<$meta_object->length;$i++){\n $meta = $meta_object->item($i);\n if($meta->getAttribute('property')==\"article:published_time\"){\n $date = $meta->getAttribute('content');\n if(!empty($date)){\n $date1 = date_create($date);\n $date2 = date_format($date1,\"Y-m-d H:i:s\");\n return $date2;\n break;\n }\n }\n }\n if(empty($date2)){\n $date = get_webpage_date($meta_object,$time);\n return $date;\n }\n}",
"function flux_get_blog_history() {\n\tglobal $wpdb;\n\n\t$query = \"SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month` FROM $wpdb->posts WHERE post_status='publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC\";\n\t$raw_history = $wpdb->get_results( $query );\n\treturn $raw_history;\n}",
"function publushDateFix($publishedDate){\n\t $publishedAt = date('Y-m-d', strtotime($publishedDate));\n$publishedAt = date_create($publishedAt);\n$today = date_create('now');\n$diff=date_diff($publishedAt,$today);\n\n//accesing days\n$days = $diff->d;\n//accesing years\n$years = $diff->y;\n//accesing months\n$months = $diff->m;\n//accesing hours\n$hours=$diff->h;\nif($months==0 AND $years!=0){\n\t\t\t\techo $years.\" Year ago \";}\n\t\t\t\telseif($years==0 AND $months!=0){ echo $months; if($months==1){ echo \" month ago \";} else { echo \" months ago \";}}\n\t\t\t\telseif($years!=0 AND $months!=0){ echo $years; if($years==1){ echo \" year ago \";} else { echo \" years ago \";}}\n\t\t\t\telseif($years==0 AND $months==0 AND $days!=0 ){ echo $days; if($days==1){ echo \" day ago \";} else { echo \" days ago \";}}\n\t\t\t\telseif($years==0 AND $months==0 AND $days==0 AND $hours!=0){ echo $hours; if($hours==1){ echo \" hour ago \";} else { echo \" hours ago \";}}\n\t \n\t }",
"function dateRange($first, $last, $format = 'm/d/Y' ) { \n\t$dates = array();\n\t$current = strtotime($first);\n\t$last = strtotime($last);\n\n\twhile( $current <= $last ) { \n\t\t$dates[] = date($format, $current);\n\t\t$current = strtotime('+1 day', $current);\n\t}\n\t\n\treturn $dates;\n}",
"function getDaysWithPosts($monthBeginn) {\n\t\t$monthEnd = $monthBeginn + ((int)date('t', $monthBeginn) * 24 * 3600);\n\n\t\t$userAgent = t3lib_div::getIndpEnv('HTTP_USER_AGENT');\n\t\tif (strstr($userAgent, 'MSIE') || strstr(strtolower($userAgent), 'camino') || strstr(strtolower($userAgent), 'safari')) {\n\t\t\t//IE, Camino, Safari\n\t\t\t$titleSeparator = \"\\n\";\n\t\t} else {\n\t\t\t//every other browser\n\t\t\t$titleSeparator = ', ';\n\t\t}\n\n\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t'title, datetime',\n\t\t\t'tt_news',\n\t\t\t'datetime > '.$monthBeginn.' AND datetime < '.$monthEnd.$this->enableFields,\n\t\t\t'datetime ASC'\n\t\t);\n\n\t\t$daysWithPosts = array();\n\t\tforeach($result as $row) {\n\t\t\t$day = date('j', $row['datetime']);\n\t\t\tif(!empty($daysWithPosts[$day])) {\n\t\t\t\t$daysWithPosts[$day] .= $titleSeparator.$row['title'];\n\t\t\t} else {\n\t\t\t\t$daysWithPosts[$day] = $row['title'];\n\t\t\t}\n\t\t}\n\n\t\treturn $daysWithPosts;\n\t}",
"function get_dates() {\n $m = date('m');\n $d = date('d');\n $y = date('Y');\n $retour['j'] = date('d/m/Y', mktime(0, 0, 0, $m, $d, $y));\n $retour['s1'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +7, $y));\n $retour['s2'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +14, $y));\n $retour['s3'] = date('d/m/Y', mktime(0, 0, 0, $m, $d +21, $y));\n $retour['m1'] = date('d/m/Y', mktime(0, 0, 0, $m +1, $d, $y));\n $retour['m2'] = date('d/m/Y', mktime(0, 0, 0, $m +2, $d, $y));\n $retour['m3'] = date('d/m/Y', mktime(0, 0, 0, $m +3, $d, $y));\n $retour['m6'] = date('d/m/Y', mktime(0, 0, 0, $m +6, $d, $y));\n $retour['m9'] = date('d/m/Y', mktime(0, 0, 0, $m +9, $d, $y));\n $retour['m12'] = date('d/m/Y', mktime(0, 0, 0, $m, $d, $y +1));\n return $retour;\n}",
"public function getPosts() {\n $db = $this->dbConnect();\n $req = $db->query('SELECT id, title, content, DATE_FORMAT(creation_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS creation_date_fr FROM posts ORDER BY creation_date DESC');\n return $req;\n }",
"function thememount_entry_date( $echo = true ) {\n\tif ( has_post_format( array( 'chat', 'status' ) ) ){\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'howes' );\n\t} else {\n\t\t$format_prefix = '%2$s';\n\t}\n\t\n\t\n\t$date = '<div class=\"thememount-post-date-wrapper\">';\n\t\t$date .= sprintf( '<div class=\"thememount-entry-date-wrapper\"><span class=\"thememount-entry-date\"><time class=\"entry-date\" datetime=\"%1$s\" >%2$s<span class=\"entry-month entry-year\">%3$s<span class=\"entry-year\">%4$s</span></span></time></span><div class=\"thememount-entry-icon\">%5$s</div></div>',\n\t\t\tget_the_date( 'c' ),\n\t\t\tget_the_date( 'j' ),\n\t\t\tget_the_date( 'M' ),\n\t\t\tget_the_date( 'Y' ),\n\t\t\tthememount_entry_icon()\n\t\t);\n\t$date .= '</div>';\n\t\n\tif ( $echo ){\n\t\techo $date;\n\t} else {\n\t\treturn $date;\n\t}\n}",
"function findArticlesByDate(array $blog, int $day, int $month, int $year): array\n{\n $date = date(\"m.d.Y\", mktime(0, 0, 0, $month, $day, $year));\n $results = [];\n foreach ($blog['article'] as $article) {\n if ($article['date'] === $date) {\n $results[] = $article;\n }\n }\n return $results;\n}",
"function getCalendar() {\n\t\t// Quick check. If we have no posts at all, abort!\n\t\t$check = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t'uid',\n\t\t\t'tt_news',\n\t\t\t'type = 3'.$this->cObj->enableFields('tt_news'),\n\t\t\t'',\n\t\t\t'datetime DESC',\n\t\t\t1\n\t\t);\n\n\t\tif(empty($check)) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// week_begins = 0 stands for sunday\n\t\t$weekBegins = $this->conf['week_begins'];\n\t\t$addHours = $this->conf['gmt_offset'];\n\t\t$addMinutes = intval(60 * ($this->conf['gmt_offset'] - $addHours));\n\n\t\t// Let's figure out where we are\n\t\t$newsGET = t3lib_div::_GET('tx_ttnews');\t\t\n\t\t$thisYear = intval( $newsGET['year'] ? \n\t\t\t$newsGET['year'] : \n\t\t\tgmdate('Y', $this->getCurrentTime() + $this->conf['gmt_offset'] * 3600)\n\t\t);\n\t\t\n\t\t$thisMonth = intval( $newsGET['month'] ? \n\t\t\t$newsGET['month'] : \n\t\t\tgmdate('n', $this->getCurrentTime() + $this->conf['gmt_offset'] * 3600)\n\t\t);\t\t\n\n\t\t$unixMonth = mktime(0, 0 , 0, $thisMonth, 1, $thisYear);\n\n\t\t// Get the next and previous month and year with at least one post\n\t\t$prevTime = $unixMonth;\n\t\t$prev = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t'datetime',\n\t\t\t'tt_news',\n\t\t\t'datetime < \\''.$prevTime.'\\''.$this->enableFields,\n\t\t\t'',\n\t\t\t'datetime DESC',\n\t\t\t1\n\t\t);\n\t\tif(!empty($prev)) {\n\t\t\t$prev = $prev[0]['datetime'];\n\t\t}\n\n\t\t$nextTime = mktime(0, 0, 0, $thisMonth + 1, 1, $thisYear);\n\t\t$next = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t'datetime',\n\t\t\t'tt_news',\n\t\t\t'datetime > \\''.$nextTime.'\\''.$this->enableFields,\n\t\t\t'',\n\t\t\t'datetime ASC',\n\t\t\t1\n\t\t);\n\t\tif(!empty($next)) {\n\t\t\t$next = $next[0]['datetime'];\n\t\t}\n\n\t\t//beginn output\n\t $content = '<table id=\"timtab-calendar\">\n\t \t<caption>'.strftime('%B', $unixMonth).' '.date('Y', $unixMonth).'</caption>\n\t \t<thead>\n\t \t<tr>';\n\n\t $week = array();\n \t$weekdays = $this->getWeekdays();\n\n \tfor($i = 0; $i <= 6; $i++) {\n \t\t$week[] = $weekdays[($i + $weekBegins) % 7];\n \t}\n \tforeach ($week as $wd) {\n \t\t$content .= \"\\n\\t\\t\\t\".'<th abbr=\"'.$wd.'\" scope=\"col\" title=\"'.$wd.'\">'.substr($wd, 0, $this->conf['weekdayNameLength']).'</th>';\n\t\t}\n\n\t\t$content .= '\n\t\t</tr>\n\t\t</thead>\n\n\t\t<tfoot>\n\t\t<tr>';\n\n\t\tif ($prev) {\n\t\t\t$content .= \"\\n\\t\\t\\t\".'<td abbr=\"'.strftime('%b', $prev).'\" colspan=\"3\" id=\"prev\">'\n\t\t\t\t\t .$this->getMonthLink($prev, $unixMonth).'</td>';\n\t\t} else {\n\t\t\t$content .= \"\\n\\t\\t\\t\".'<td colspan=\"3\" id=\"prev\" class=\"pad\"> </td>';\n\t\t}\n\n\t\t$content .= \"\\n\\t\\t\\t\".'<td class=\"pad\"> </td>';\n\n\t\tif ($next) {\n\t\t\t$content .= \"\\n\\t\\t\\t\".'<td abbr=\"'.strftime('%b', $next).'\" colspan=\"3\" id=\"next\">'\n\t\t\t\t\t .$this->getMonthLink($next, $unixMonth).'</td>';\n\t\t} else {\n\t\t\t$content .= \"\\n\\t\\t\\t\".'<td colspan=\"3\" id=\"next\" class=\"pad\"> </td>';\n\t\t}\n\n\t\t$content .= '\n\t\t</tr>\n\t\t</tfoot>\n\n\t\t<tbody>\n\t\t<tr>';\n\n\t\t// Get days with posts\n\t\t$daysWithPosts = $this->getDaysWithPosts($unixMonth);\n\n\t\t// See how much we should pad in the beginning\n\t\t$pad = $this->calendarWeekMod(date('w', $unixMonth) - $weekBegins);\n\t\tif($pad != 0) {\n\t\t\t$content .= \"\\n\\t\\t\\t\".'<td colspan=\"'.$pad.'\" class=\"pad\"> </td>';\n\t\t}\n\n\t\t$daysInMonth = intval(date('t', $unixMonth));\n\t\tfor ($day = 1; $day <= $daysInMonth; ++$day) {\n\t\t\tif(isset($newrow) && $newrow) {\n\t\t\t\t$content .= \"\\n\\t\\t</tr>\\n\\t\\t<tr>\\n\\t\\t\\t\";\n\t\t\t}\n\t\t\t$newrow = false;\n\n\t\t\tif($day == gmdate('j', (time() + ($addHours * 3600))) && $thisMonth == gmdate('m', time()+($addHours * 3600)) && $thisYear == gmdate('Y', time()+($addHours * 3600))) {\n\t\t\t\t$content .= '<td id=\"today\">';\n\t\t\t} else {\n\t\t\t\t$content .= '<td>';\n\t\t\t}\n\n\t\t\tif(array_key_exists($day, $daysWithPosts)) {\n\t\t\t\t// any posts today?\n\t\t\t\t$content .= $this->getDayLink($unixMonth, $day, $daysWithPosts[$day]);\n\t\t\t} else {\n\t\t\t\t$content .= $day;\n\t\t\t}\n\t\t\t$content .= '</td>';\n\n\t\t\tif (6 == $this->calendarWeekMod(date('w', mktime(0, 0 , 0, $thisMonth, $day, $thisYear))-$weekBegins)) {\n\t\t\t\t$newrow = true;\n\t\t\t}\n\t\t}\n\n\t\t$pad = 7 - $this->calendarWeekMod(date('w', mktime(0, 0 , 0, $thisMonth, $day, $thisYear))-$weekBegins);\n\t\tif ($pad != 0 && $pad != 7) {\n\t\t\t$content .= \"\\n\\t\\t\\t\".'<td class=\"pad\" colspan=\"'.$pad.'\"> </td>';\n\t\t}\n\n\t\t$content .= \"\\n\\t\\t</tr>\\n\\t\\t</tbody>\\n\\t\\t</table>\";\n\n\t\treturn $content;\n\t}",
"public function getBlogPostNav()\n {\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $BlogMapper = $dataMapper('BlogMapper');\n\n // Get posts\n $posts = $BlogMapper->getPosts();\n\n // Nest array by month\n $priorPosts = [];\n foreach ($posts as $post) {\n $priorPosts[(new \\DateTime($post->published_date))->format('Y-m')][] = $post;\n }\n\n return $priorPosts;\n }",
"function generate_posted_on()\n {\n $items = apply_filters('generate_header_entry_meta_items', array(\n 'date',\n 'author',\n ));\n\n foreach ($items as $item) {\n generate_do_post_meta_item($item);\n }\n }",
"function flatsome_posted_on() {\n $time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n $time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n }\n\n $time_string = sprintf( $time_string,\n esc_attr( get_the_date( 'c' ) ),\n esc_html( get_the_date() ),\n esc_attr( get_the_modified_date( 'c' ) ),\n esc_html( get_the_modified_date() )\n );\n\n $posted_on = sprintf(\n esc_html_x( 'Posted on %s', 'post date', 'flatsome' ),\n '<a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">' . $time_string . '</a>'\n );\n\n $byline = sprintf(\n esc_html_x( 'by %s', 'post author', 'flatsome' ),\n '<span class=\"meta-author vcard\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\">' . esc_html( get_the_author() ) . '</a></span>'\n );\n\n echo '<span class=\"posted-on\">' . $posted_on . '</span><span class=\"byline\"> ' . $byline . '</span>';\n\n}",
"public function get_sidebar_dates(){\n\n $html = '<tr class=\"wm-widget-sub-title\"><td>Published:</td></tr><tr class=\"wm-widget-info\"><td>';\n $html .= get_the_date() . '</td></tr>';\n\n if( strtotime( get_the_date() ) < strtotime( get_the_modified_date() ) ){\n $html .= '<tr class=\"wm-widget-sub-title\"><td>Last Updated:</td></tr><tr class=\"wm-widget-info\"><td>';\n $html .= get_the_modified_date() . '</td></tr>';\n }\n\n return $html;\n }",
"function the_date_range($start_dt,$end_dt, $one_day = false){\r\n\t\r\n\t$duration = $start_dt->diff($end_dt);\r\n\t$start = explode(\" \",$start_dt->format('l F j Y g i a'));\r\n\t$end = explode(\" \",$end_dt->format('l F j Y g i a'));\r\n\t\r\n\t//happening at the same time\r\n\tif($start == $end){\r\n\t\treturn array(\r\n\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\"%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2] //day of month\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\teo_is_all_day() ? 'all day' : time_compact_ap_format($start[4],$start[5],$start[6])\r\n\t\t);\r\n\t}\t\r\n\t//happening on the same day\r\n\telseif($start[2] == $end[2] || ($duration->days < 1 && $duration->h < 24)){\r\n\t\t//Monday, March 4; 9:00 p.m.\r\n\t\treturn array(\r\n\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\"%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2] //day of month\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\teo_is_all_day() ? 'all day' : sprintf(\r\n\t\t\t\t\"%s–%s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\t //formatted date\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n\t//happening in the same month\r\n\t//check if happening all day; if not, return eo_all_day ? : \r\n\telseif($start[1] == $end[1]){\r\n\t\treturn (eo_is_all_day() || $one_day) ? \r\n\t\tsprintf(\r\n\t\t\t\"%s %s–%s\",\r\n\t\t\t$start[1], //month\r\n\t\t\t$start[2], //day of month\r\n\t\t\t$end[2]\r\n\t\t)\r\n\t\t: \r\n\t\tarray(\r\n\t\t\t\"date\" => sprintf(\r\n\t\t\t\t\"%s %s–%s\",\r\n\t\t\t\t$start[1],\r\n\t\t\t\t$start[2],\r\n\t\t\t\t$end[2]\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t\"datetime\" => sprintf(\r\n\t\t\t\t\"%s, %s %s–%s, %s %s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t$start[1],\r\n\t\t\t\t$start[2],\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\tsprintf(\r\n\t\t\t\t\"%s–%s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\t//happening in the same year\r\n\telseif($start[3] == $end[3]){\r\n\t\treturn (eo_is_all_day() || $one_day) ?\r\n\t\t\tsprintf(\r\n\t\t\t\t\"%s, %s %s–%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2], //day of month\r\n\t\t\t\t$end[0],\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\r\n\t\t\t)\r\n\t\t\t:\r\n\t\t\tarray(\r\n\t\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s %s–%s %s\",\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"datetime\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s, %s %s–%s, %s, %s %s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\t\"time\"\t=>\tsprintf(\"%s–%s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n\t//just plain happening\r\n\r\n\telse{\r\n\t\treturn (eo_is_all_day() || $one_day) ? \r\n\t\t\tsprintf(\r\n\t\t\t\t\"%s, %s %s–%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2], //day of month\r\n\t\t\t\t$end[0],\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\r\n\t\t\t)\r\n\t\t\t:\r\n\t\t\tarray(\r\n\t\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s %s–%s, %s %s\",\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"datetime\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s, %s %s–%s, %s, %s %s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\t\"time\"\t=>\tsprintf(\"%s–%s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n}",
"function getLatestEntries()\n {\n global $_ARRAYLANG;\n\n $this->_objTpl->setTemplate($this->_strPageContent, true, true);\n\n //Show latest XX entries\n $arrEntries = $this->createEntryArray($this->_intLanguageId, 0, intval($this->_arrSettings['blog_block_messages']));\n if (count($arrEntries) > 0 && $this->_objTpl->blockExists('blogBlockEntries')) {\n $intRowClass = 1;\n\n foreach ($arrEntries as $intEntryId => $arrEntryValues) {\n $this->_objTpl->setVariable(array(\n 'TXT_BLOG_ENTRY_CATEGORIES' => $_ARRAYLANG['TXT_BLOG_HOME_CATEGORIES'],\n 'TXT_BLOG_ENTRY_TAGS' => $_ARRAYLANG['TXT_BLOG_HOME_KEYWORDS'],\n 'TXT_BLOG_ENTRY_VOTING' => $_ARRAYLANG['TXT_BLOG_HOME_VOTING'],\n 'TXT_BLOG_ENTRY_COMMENTS' => $_ARRAYLANG['TXT_BLOG_HOME_COMMENTS'],\n 'TXT_BLOG_ENTRY_LINK' => $_ARRAYLANG['TXT_BLOG_HOME_LINK']\n ));\n\n $this->_objTpl->setVariable(array(\n 'BLOG_ENTRY_ROWCLASS' => ($intRowClass % 2 == 0) ? 'row1' : 'row2',\n 'BLOG_ENTRY_ID' => $intEntryId,\n 'BLOG_ENTRY_DATE' => $arrEntryValues['time_created'],\n 'BLOG_ENTRY_AUTHOR_ID' => $arrEntryValues['user_id'],\n 'BLOG_ENTRY_AUTHOR_NAME' => $arrEntryValues['user_name'],\n 'BLOG_ENTRY_SUBJECT' => $arrEntryValues['subject'],\n 'BLOG_ENTRY_POSTED_BY' => $this->getPostedByString($arrEntryValues['user_name'], $arrEntryValues['time_created']),\n 'BLOG_ENTRY_POSTED_BY_ICON' => $this->getPostedByIcon($arrEntryValues['time_created']),\n 'BLOG_ENTRY_INTRODUCTION' => $this->getIntroductionText($arrEntryValues['translation'][$this->_intLanguageId]['content']),\n 'BLOG_ENTRY_CONTENT' => $arrEntryValues['translation'][$this->_intLanguageId]['content'],\n 'BLOG_ENTRY_CATEGORIES' => $this->getCategoryString($arrEntryValues['categories'][$this->_intLanguageId], true),\n 'BLOG_ENTRY_TAGS' => $this->getLinkedTags($arrEntryValues['translation'][$this->_intLanguageId]['tags']),\n 'BLOG_ENTRY_TAGS_ICON' => $this->getTagsIcon(),\n 'BLOG_ENTRY_COMMENTS' => $arrEntryValues['comments_active'].' '.$_ARRAYLANG['TXT_BLOG_HOME_COMMENTS'],\n 'BLOG_ENTRY_VOTING' => 'Ø '.$arrEntryValues['votes_avg'],\n 'BLOG_ENTRY_VOTING_STARS' => $this->getRatingBar($intEntryId),\n 'BLOG_ENTRY_LINK' => '<a href=\"index.php?section=Blog&cmd=details&id='.$intEntryId.'\" title=\"'.$arrEntryValues['subject'].'\">'.$_ARRAYLANG['TXT_BLOG_HOME_OPEN'].'</a>',\n 'BLOG_ENTRY_IMAGE' => ($arrEntryValues['translation'][$this->_intLanguageId]['image'] != '') ? '<img src=\"'.$arrEntryValues['translation'][$this->_intLanguageId]['image'].'\" title=\"'.$arrEntryValues['subject'].'\" alt=\"'.$arrEntryValues['subject'].'\" />' : ''\n ));\n\n $this->_objTpl->parse('blogBlockEntries');\n ++$intRowClass;\n }\n }\n\n //Show overview of categories\n $arrCategories = $this->createCategoryArray();\n\n if (count($arrCategories) > 0 && $this->_objTpl->blockExists('blogBlockCategories')) {\n //Collect active categories for the current language\n $arrCurrentLanguageCategories = array();\n foreach($arrCategories as $intCategoryId => $arrLanguageData) {\n if ($arrLanguageData[$this->_intLanguageId]['is_active']) {\n $arrCurrentLanguageCategories[$intCategoryId] = $arrLanguageData[$this->_intLanguageId]['name'];\n }\n }\n\n //Sort alphabetic\n asort($arrCurrentLanguageCategories);\n\n if (count($arrCurrentLanguageCategories)) {\n foreach($arrCurrentLanguageCategories as $intCategoryId => $strTranslation) {\n $this->_objTpl->setVariable(array(\n 'BLOG_CATEGORY_ID' => $intCategoryId,\n 'BLOG_CATEGORY_NAME' => $strTranslation,\n 'BLOG_CATEGORY_COUNT' => $this->countEntriesOfCategory($intCategoryId)\n ));\n $this->_objTpl->parse('blogBlockCategories');\n }\n }\n }\n\n //Also try to fill the other variables\n if ($this->searchKeywordInContent('BLOG_CALENDAR', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_CALENDAR', $this->getHomeCalendar()); }\n if ($this->searchKeywordInContent('BLOG_TAG_CLOUD', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_TAG_CLOUD', $this->getTagCloud()); }\n if ($this->searchKeywordInContent('BLOG_TAG_HITLIST', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_TAG_HITLIST', $this->getHomeTagHitlist()); }\n if ($this->searchKeywordInContent('BLOG_CATEGORIES_SELECT', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_CATEGORIES_SELECT', $this->getHomeCategoriesSelect()); }\n if ($this->searchKeywordInContent('BLOG_CATEGORIES_LIST', $this->_strPageContent)) { $this->_objTpl->setVariable('BLOG_CATEGORIES_LIST', $this->getHomeCategoriesList()); }\n\n return $this->_objTpl->get();\n }",
"function dynamic_date() {\n$all_posts = get_posts( 'post_status=publish&order=ASC' );\n$first_post = $all_posts[0];\n$first_date = $first_post->post_date_gmt;\nif ( substr( $first_date, 0, 4 ) == date( 'Y' ) ) {\necho date( 'Y' );\n} else {\necho substr( $first_date, 0, 4 ) . \"-\" . date( 'Y' );\n}\n}",
"function _lean_output_ago_date($date_raw, $show_date='true') {\n \n /**\n * Show Today, Yesterday or full date\n */\n $date_dd_mm_yyyy = format_date($date_raw, 'custom', 'd-m-Y');\n $todays_date = format_date(time(), 'custom', 'd-m-Y');\n $display_date = format_date($date_raw, 'custom', 'l, jS F');\n $posts_date = $date_dd_mm_yyyy;\n \n if ($todays_date == $posts_date) {\n $display_date = 'Today';\n } else {\n $dateDiff = strtotime($todays_date) - strtotime($posts_date);\n $fullDays = floor($dateDiff/(60*60*24));\n if ($fullDays <= 1) {\n $display_date = 'Yesterday';\n //} else if ($fullDays <= 6) {\n // $display_date = 'On '. format_date($date_raw, 'custom', 'l') . ',';\n //} else if (!$show_date) {\n // $display_date = '';\n }\n }\n return $display_date;\n}",
"function LatestBlogs(){\n\t\t$query = \"SELECT id, title, content, readperm, commentperm, date, category FROM blog_content WHERE uid='\".$this->id.\"' AND readperm LIKE '%\".$this->rperm.\"%' ORDER BY id ASC LIMIT 0, \".$this->showLimit;\n\t\t$result = mysqli_query($conn, $query);\n\t\t$total_entries = mysqli_num_rows($result);\n\t\tif($total_entries == 0){\n\t\t\techo \"<div class='side-body-bg'>\\n\";\n\t\t\techo \"<span class='scapmain'>\".$this->uname.\" has not made any Blog Posts.</span>\\n\";\n\t\t\techo \"</div>\\n\";\n\t\t}\n\t\telse {\n\t\t\twhile(list($id,$title,$content,$data,$category) = mysqli_fetch_array($result))\n\t\t\t{\n\t\t\t\t$subline = \"Posted by \".$this->uname.\" on mm/dd/yyyy\";\n\t\t\t\techo \"<div class='side-body-bg'>\\n\";\n\t\t\t\techo \"<span class='scapmain'><a href='/blogs/\".$this->uname.\"/$id-\".stripslashes(CleanFileName($title)).\"/'>\".stripslashes($title).\"</a></span>\\n\";\n\t\t\t\techo \"<br />\\n\";\n\t\t\t\techo \"<span class='poster'>$subline</span>\\n\";\n\t\t\t\techo \"</div>\\n\";\n\t\t\t\techo \"<div class='tbl'>$content</div>\\n\";\n\t\t\t\techo \"<br />\\n\";\n\t\t\t}\n\t\t}\n\t}",
"function accouk_homepage_latest_posts() {\n\n $args = array('post_type' => 'post', 'category_name' => 'blog', 'posts_per_page' => 4, 'orderby' => 'date', 'order' => 'DESC');\n $query = new WP_Query( $args );\n\n if ( $query->have_posts() ) {\n\n echo '<ul class=\"post-list homepage-post-list\">';\n\n \twhile ( $query->have_posts() ) {\n \t\t$query->the_post(); ?>\n\n <li>\n <a href=\"<?php the_permalink(); ?>\" title=\"<?php the_title(); ?>\">\n <div class=\"main-tile-part\">\n <?php echo accouk_post_tile_image(); ?>\n <span><h3><?php the_title(); ?></h3></span>\n </div>\n <div class=\"sub-tile-part\">\n <span class=\"excerpt\"><?php the_excerpt(); ?></span>\n <span class=\"date\"><?php echo get_the_date(); ?></span>\n <span class=\"cta\">Read Now</span>\n </div>\n </a>\n </li>\n <?php\n \t}\n\n \techo '</ul>';\n\n } else {\n \techo \"<p>Sorry, an error has occurred</p>\";\n }\n\n}",
"function ci_last_update()\n{\n\tglobal $post;\n\t$old_post = $post;\n\t$data = array();\n\t$posts = get_posts('posts_per_page=1&order=DESC&orderby=date');\n\tforeach ($posts as $post)\n\t{\n\t\tsetup_postdata($post);\t\n\t\t$data['date'] = get_the_date();\n\t\t$data['time'] = get_the_time();\n\t}\n\t$post = $old_post;\n\tsetup_postdata($post);\n\treturn $data;\n}",
"function medical_rehab_posted_on() {\r\n\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\r\n\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\r\n\t\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\r\n\t}\r\n\r\n\t$time_string = sprintf( $time_string,\r\n\t\tesc_attr( get_the_date( 'c' ) ),\r\n\t\tesc_html( get_the_date() ),\r\n\t\tesc_attr( get_the_modified_date( 'c' ) ),\r\n\t\tesc_html( get_the_modified_date() )\r\n\t);\r\n\r\n\t$posted_on = sprintf(\r\n\t\t_x( 'Posted on %s', 'post date', 'medical-rehab' ),\r\n\t\t'<a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">' . $time_string . '</a>'\r\n\t);\r\n\r\n\t$byline = sprintf(\r\n\t\t_x( 'by %s', 'post author', 'medical-rehab' ),\r\n\t\t'<span class=\"author vcard\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\">' . esc_html( get_the_author() ) . '</a></span>'\r\n\t);\r\n\r\n\techo '<span class=\"posted-on\">' . $posted_on . '</span><span class=\"byline\"> ' . $byline . '</span>';\r\n\r\n}",
"function date_compare($a, $b) {\n //var_dump($a);\n $t1 = strtotime($a);\n $t2 = strtotime($b);\n // The negative in front the result sorts by the most recent entry\n return -($t1 - $t2);\n }",
"public function dates()\n {\n \t$question_id = Question::idByName('Register Page Start Date');\n \t$dates = $this->pages()\n \t\t\t\t\t->join('htc_survey_page_questions', 'htc_survey_pages.id', '=', 'htc_survey_page_questions.htc_survey_page_id')\n \t\t\t\t->join('htc_survey_page_data', 'htc_survey_page_questions.id', '=', 'htc_survey_page_data.htc_survey_page_question_id')\n \t\t\t\t->where('question_id', $question_id)\n \t\t\t\t->lists('answer');\n if(!count($dates)>0)\n {\n \t$dates = [$this->date_submitted];\n }\n usort($dates, function($a, $b) {\n\t\t $dateTimestamp1 = strtotime($a);\n\t\t $dateTimestamp2 = strtotime($b);\n\n\t\t return $dateTimestamp1 < $dateTimestamp2 ? -1: 1;\n\t\t});\n return json_encode(['min' => $dates[0], 'max' => $dates[count($dates)-1]]);\n }",
"public function getLastPost() {\r\n $db = $this->dbConnect();\r\n $req = $db->query('SELECT id, title, content,adress_street, adress_city, DATE_FORMAT(date_creation, \\'%d/%m/%Y à %Hh%imin%ss\\') AS date_creation_fr FROM articles ORDER BY date_creation DESC LIMIT 0, 1');\r\n\r\n return $req->fetchAll();\r\n }",
"function rtheme_posted_on() {\n $time_string = '<time class=\"published update\" datetime=\"%1$s\">%2$s</time>';\n\n if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n $time_string = '<time class=\"published\" datetime=\"%1$s\">%2$s</time><time class=\"update\" datetime=\"%3$s\">%4$s</time>';\n }\n\n $time_string = sprintf( $time_string,\n esc_attr( get_the_date( DATE_W3C ) ),\n esc_attr( get_the_date() ),\n esc_attr( get_the_modified_date( DATE_W3C ) ),\n esc_attr( get_the_modified_date() )\n );\n\n $posted_on = sprintf(\n esc_html_x( 'Posted on %s', 'post date', 'rtheme' ),\n '<a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">' . $time_string . '</a>'\n );\n\n echo '<span class=\"posted-one text-secondary\"> ' . $posted_on . '</span>';\n\n}",
"public static function getCreatedDates()\n {\n return array( 'this_week' => TextHelper::_(\"COBALT_THIS_WEEK\"),\n 'last_week' => TextHelper::_(\"COBALT_LAST_WEEK\"),\n 'this_month' => TextHelper::_(\"COBALT_THIS_MONTH\"),\n 'last_month' => TextHelper::_(\"COBALT_LAST_MONTH\"),\n 'today' => TextHelper::_(\"COBALT_TODAY\"),\n 'yesterday' => TextHelper::_(\"COBALT_YESTERDAY\"), );\n }",
"public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}",
"function atarr_posted_on() {\n\t\t$time_string = '<time class=\"entry-date published updated\" datetime=\"%1$s\">%2$s</time>';\n\t\tif ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {\n\t\t\t$time_string = '<time class=\"entry-date published\" datetime=\"%1$s\">%2$s</time><time class=\"updated\" datetime=\"%3$s\">%4$s</time>';\n\t\t}\n\n\t\t$time_string = sprintf( $time_string,\n\t\t\tesc_attr( get_the_date( 'c' ) ),\n\t\t\tesc_html( get_the_date() ),\n\t\t\tesc_attr( get_the_modified_date( 'c' ) ),\n\t\t\tesc_html( get_the_modified_date() )\n\t\t);\n\n\t\t$posted_on = sprintf(\n\t\t\tesc_html_x( 'Posted on %s', 'post date', 'starry' ),\n\t\t\t'<a href=\"' . esc_url( get_permalink() ) . '\" rel=\"bookmark\">' . $time_string . '</a>'\n\t\t);\n\n\t\t$byline = sprintf(\n\t\t\tesc_html_x( 'by %s', 'post author', 'starry' ),\n\t\t\t'<span class=\"author vcard\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '\">' . esc_html( get_the_author() ) . '</a></span>'\n\t\t);\n\n\t\techo '<span class=\"posted-on\">' . $posted_on . '</span><span class=\"byline\"> ' . $byline . '</span>'; // WPCS: XSS OK.\n\n\t}"
] |
[
"0.62380487",
"0.615299",
"0.5836974",
"0.57908237",
"0.5778499",
"0.57604593",
"0.56796557",
"0.5659334",
"0.5647543",
"0.5626705",
"0.5622599",
"0.5605269",
"0.55863565",
"0.55851537",
"0.55801463",
"0.557753",
"0.5552718",
"0.554953",
"0.549085",
"0.54873246",
"0.5476557",
"0.5440871",
"0.54377115",
"0.541689",
"0.5408805",
"0.53978676",
"0.5392037",
"0.5387278",
"0.53704274",
"0.53659755"
] |
0.73462486
|
0
|
$h = haystack, $n = needle
|
function strstrb($h,$n){
return array_shift(explode($n,$h,2));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function BinarySearch($needle, $haystack)\n{\n $high = count($haystack)-1;\n $low = 0;\n \n while ($low <= $high) {\n // Integer division.\n $n = $high + $low;\n $i = ($n - ($n % 2)) / 2;\n\n if ($haystack[$i] < $needle) {\n $low = $i + 1;\n }\n elseif ($haystack[$i] > $needle) {\n $high = $i - 1;\n }\n else {\n return $i;\n }\n }\n\n return -1;\n}",
"function magicIndex($A, $start, $end){\n\n if($start > $end) return;\n\n if($start <= $end){\n $m = floor(($start+$end)/2);\n\n if($A[$m] == $m){\n return $m;\n } else{\n // search left\n $left = magicIndex($A, $start, min($A[$m], $m-1));\n if(isset($left)) return $left;\n\n // search right\n $right = magicIndex($A, max($A[$m], $m+1), $end);\n if(isset($right)) return $right;\n }\n }\n}",
"function searchI1($a, $n, $x)\n{\n \n $last = $a[$n - 1];\n // создаем гарантию что х содержится в списке\n $a[$n - 1] = $x;\n $i = 0;\n while($a[$i] != $x)\n {\n $i++;\n }\n $a[$n - 1] = $last;\n if ($i < ($n - 1) || $a[$n - 1] == $x)\n {\n return $i;\n }\n return -1;\n}",
"function binary_search($a){\n\t$c = count($a);\n\treturn binary_search_helper($a,1,$c-1);\n}",
"function binarySearch($arr, $lookfor) {\n\n $low = 0;\n $height = count($arr) - 1;\n while ($low <= $height) {\n $mid = (($low + $height) / 2);\n if ($arr[$mid] > $lookfor) {\n $height = $mid + 1;\n } elseif ($arr[$mid] < $lookfor) {\n $low = $mid + 1;\n } else {\n return $mid;\n }\n }\n return -1;\n}",
"function array_nsearch($needle, array $haystack) {\n $it = new IteratorIterator(new ArrayIterator($haystack));\n foreach($it as $key => $val) {\n if(strcasecmp($val,$needle) === 0) {\n return $key;\n }\n }\n return false;\n}",
"function binary_search($search, $array, $min, $max)\n{\n if ($min > $max) {\n return -1;\n }\n $mid = floor(($min + $max) / 2);\n if ($search === $array[$mid]) {\n return $mid;\n } else if ($search < $array[$mid]) {\n return binary_search($search, $array, $min, $mid - 1);\n } else {\n return binary_search($search, $array, $mid + 1, $max);\n }\n}",
"function strNthOccurPos($haystack, $needle, $nth=1, $insenstive=0)\n\t{\n\t //if its case insenstive, convert strings into lower case\n\t if ($insenstive) {\n\t\t $haystack=strtolower($haystack);\n\t\t $needle=strtolower($needle);\n\t }\n\t //count number of occurances\n\t $count=substr_count($haystack,$needle);\n\t\n\t //first check if the needle exists in the haystack, return false if it does not\n\t //also check if asked nth is within the count, return false if it doesnt\n\t if ($count<1 || $nth > $count) return false;\n\t\n\t\n\t //run a loop to nth number of accurance\n\t //start $pos from -1, cause we are adding 1 into it while searchig\n\t //so the very first iteration will be 0\n\t for($i=0,$pos=0,$len=0;$i<$nth;$i++)\n\t {\n\t\t //get the position of needle in haystack\n\t\t //provide starting point 0 for first time ($pos=0, $len=0)\n\t\t //provide starting point as position + length of needle for next time\n\t\t $pos=strpos($haystack,$needle,$pos+$len);\n\t\n\t\t //check the length of needle to specify in strpos\n\t\t //do this only first time\n\t\t if ($i==0) $len=strlen($needle);\n\t\t }\n\t\n\t //return the number\n\t return $pos;\n\t}",
"function strposa( $haystack, $needles = array( ), $offset = 0 ) {\n$chr = array( );\nforeach ( $needles as $needle )\n {\n $res = strpos( $haystack, $needle, $offset );\n if ( $res !== false )\n return $needle;\n }\nreturn 'no';\n}",
"function binarysearch($array, $start, $end, $value)\n{ \n //Kill if there there isn't anything to search\n if ($end < $start) { return -1; }\n \n //Get the middle of the array\n $middleindex = ceil($start + (($end-$start)/2));\n //The family that is at the middle\n $currentfamily = $array[$middleindex][\"family\"];\n //The difference between the family and the value\n $difference = strcmp($value, $currentfamily);\n \n logadd(\"Searching: i:$middleindex s:$start e:$end c:$currentfamily f:$value d:$difference\");\n \n //If there's no difference then return the index at the middle\n if ($difference == 0) { return $middleindex; }\n //If there is a difference then do a binary search on the left or right half of the array\n else if ($difference < 0) { return binarysearch ($array, $start, $middleindex - 1, $value); }\n else { return binarysearch ($array, $middleindex + 1, $end, $value); }\n}",
"function rstrpos ($haystack, $needle, $offset)\n\t{\n\t\t$size = strlen ($haystack);\n\t\t$pos = strpos (strrev($haystack), $needle, $offset);\n \tif ($pos === false) return false;\n return $size - $pos;\n\t}",
"function binaryArraySearch($haystack, $needle, $function) {\n\t$upperBound = count($haystack);\n\t$lowerBound = -1;\n\twhile (abs($upperBound-$lowerBound) > 1) {\n\t\t// pick the next element to check\n\t\t$pick = floor($lowerBound + ($upperBound-$lowerBound)/2);\n\t\t\n\t\t// check element\n\t\t$result = call_user_func($function, $needle, $haystack[$pick]);\n\t\t\n\t\t// choose next slice based on result\n\t\tif ($result == -1) { // needle is before check\n\t\t\t$upperBound = $pick;\n\t\t} else if ($result == 1) { // needle is after check\n\t\t\t$lowerBound = $pick;\n\t\t} else {\n\t\t\treturn $pick;\n\t\t}\n\t\t//echo 'trying again, range '.$lowerBound.':'.$upperBound.\"\\n\";\n\t}\n\treturn false;\n}",
"function RecursiveLinerSearch($a, $n, $x, $i)\n{\n if($i > $n)\n {\n return \"not found\"; // -1 is not-found\n }\n elseif ($i <= $n && $a[$i] == $x)\n {\n return $i;\n }\n elseif ($i <= $n && $a[$i] != $x)\n {\n return RecursiveLinerSearch($a, $n, $x, $i + 1);\n }\n return 0;\n}",
"function wsod_strposall($haystack,$needle){ \n $s=0; $i=0; \n while (is_integer($i)){ \n $i = strpos($haystack,$needle,$s); \n if (is_integer($i)) { \n $aStrPos[] = $i; \n $s = $i+strlen($needle); \n } \n } \n if (isset($aStrPos)) { \n return $aStrPos; \n } else { \n return false; \n } \n}",
"public function reversePart($lo,$hi);",
"function find_string($string, $start,$end) {\n //print \"start: $start, end: $end\\n\";\n // Simple hashing to improve speed\n if (isset($this->_HASHED[$string])) return $this->_HASHED[$string];\n\n if (abs($start-$end)<=1) {\n // we're done, if it's not it, bye bye\n $txt = $this->get_string_number($start);\n if ($string == $txt) {\n $this->_HASHED[$string] = $start;\n return $start;\n } else\n return -1;\n } elseif ($start>$end) {\n return $this->find_string($string,$end,$start);\n } else {\n $half = (int)(($start+$end)/2);\n $tst = $this->get_string_number($half);\n $cmp = strcmp($string,$tst);\n if ($cmp == 0) {\n $this->_HASHED[$string] = $half;\n return $half;\n } elseif ($cmp<0)\n return $this->find_string($string,$start,$half);\n else\n return $this->find_string($string,$half,$end);\n }\n }",
"function searchV3Recur($array, $start, $end, $value) { \n if ($start > $end) {\n return;\n }\n // get mid index.\n $mid = floor(($start + $end) / 2);\n // if 1st left < mid value:\n // left is ordered normally\n // determine which side to search\n // if value >= 1st left && value < mid\n // search left side\n // else \n // search right side\n // else\n // right is ordered normally\n // determine which side to search\n // if value >= mid+1 && value <= end\n // search right side\n // else\n // search left side\n if ($array[$mid] == $value) {\n return $mid;\n } elseif ($array[$start] < $array[$mid]) {\n // left is ordered normally\n if ($value >= $array[$start] && $value < $array[$mid]) {\n // search left side\n return searchV3Recur($array, $start, $mid-1, $value);\n } else {\n // search right side\n return searchV3Recur($array, $mid+1, $end, $value);\n }\n } elseif ($array[mid] < $array[$end]) {\n // right is ordered normally\n if ($value > $array[$mid] && $value <= $array[$end]) {\n // search right side\n return searchV3Recur($array, $mid+1, $end, $value);\n } else {\n // search left side\n return searchV3Recur($array, $start, $mid-1, $value);\n }\n } elseif ($array[$start] == $array[$mid]) {\n // left half is all repeats\n if ($array[$mid] !== $array[$right]) {\n // search right\n return searchV3Recur($array, $mid+1, $end, $value);\n } else {\n // we have to search both halves\n $result = searchV3Recur($array, $start, $mid-1, $value);\n if (empty($result)) {\n return searchV3Recur($array, $mid+1, $end, $value);\n } else {\n return $result;\n }\n }\n }\n return;\n}",
"function binary_search($args) {\n\t $low = $args['min'];\n\t $high = $args['max'];\n\t \n\t while ($high >= $low) {\n\t\t$L = floor(($low + $high) / 2);\n\n\t\t$cmd = preg_replace(\"/{$args['pattern']}/\", $L, $args['command']);\n\n\t\t$output = \"{$args['output']}.$L\";\n\t\tprint(\"$cmd >& $output \\n\");\n\t\tsystem(\"$cmd > $output 2>&1\");\n\t\t$ok = `grep 'test is OK' $output `;\n\n\t\tif ($ok) {\n\t\t\t$high = $L - 1;\n\t\t} else {\n\t\t\t$low = $L + 1;\n\t\t}\n\t }\n\t return $L;\n}",
"function getBetween($var1=\"\",$var2=\"\",$pool){\n\t$temp1 = strpos($pool,$var1)+strlen($var1);\n\t$result = substr($pool,$temp1,strlen($pool));\n\t$dd=strpos($result,$var2);\n\tif($dd == 0){\n\t$dd = strlen($result);\n\t}\n\treturn substr($result,0,$dd);\n\t}",
"function binary_search_helper($a,$lowerBound,$upperBound){\n\tif(($lowerBound +1) >= $upperBound){\n\t\t$h = array();\n\t\tforeach($a as $v){\n\t\t\tif(isset($h[$v])){\n\t\t\t\treturn $v;\n\t\t\t} else {\n\t\t\t\t$h[$v] = 0;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t} else {\n\t\t$lowerHalfCount = 0;\n\t\t// Scan and count up numbers within the range\n\t\t$lowerHalfUpperBound = floor($upperBound/2);\n\t\tforeach($a as $v){\n\t\t\tif( $lowerBound <= $v && $v <= $lowerHalfUpperBound){\n\t\t\t\t$lowerHalfCount++;\n\t\t\t}\n\t\t}\n\n\t\tif($lowerHalfCount > ($lowerHalfUpperBound-$lowerBound+1)) {\n\t\t\t$lower = binary_search_helper($a, $lowerBound, floor(($lowerHalfUpperBound/2)-1));\t\n\t\t\t$upper = binary_search_helper($a, floor($lowerHalfUpperBound/2), $lowerHalfUpperBound);\t\n\t\t\tif(is_int($lower)){\n\t\t\t\treturn $lower;\n\t\t\t}\n\t\t\treturn $upper;\n\t\t} else {\n\t\t\t$lower = binary_search_helper($a, $lowerHalfUpperBound+1, floor(($upperBound+$lowerHalfUpperBound)/2));\t\n\t\t\t$upper = binary_search_helper($a, floor(($upperBound+$lowerHalfUpperBound)/2)+1, $upperBound);\t\t\n\t\t\tif(is_int($lower)){\n\t\t\t\treturn $lower;\n\t\t\t}\n\t\t\treturn $upper;\n\t\t}\n\t}\n}",
"function multi_strpos($haystack, $needles, $sensitive = false, $offset = 0){\r\r\n\t$needles = (array)$needles;\r\r\n\r\r\n\tforeach($needles as $needle) {\r\r\n\t\t$result[$needle] = ($sensitive) ? strpos($haystack, (string)$needle, $offset) : stripos($haystack, (string)$needle, $offset);\r\r\n\t}\r\r\n\treturn $result;\r\r\n}",
"function boyermoore_search( $haystack, $needle )\n{\n /*\n * Calc string sizes\n */\n// $needle_len;\n// $haystack_len;\n $needle_len = strlen( $needle );\n $haystack_len = strlen( $haystack );\n\n /*\n * Simple checks\n */\n if( $haystack_len == 0 )\n {\n return NULL;\n }\n if( $needle_len == 0 )\n {\n return $haystack;\n }\n\n $badcharacter = array();\n $goodsuffix = array();\n /*\n * Initialize heuristics\n */\n $badcharacter[ALPHABET_SIZE];\n $goodsuffix[$needle_len + 1];\n\n prepare_badcharacter_heuristic( $needle, $needle_len, $badcharacter );\n prepare_goodsuffix_heuristic( $needle, $needle_len, $goodsuffix );\n\n /*\n * Boyer-Moore search\n */\n $s = 0;\n while( $s <= ( $haystack_len - $needle_len ))\n {\n $j = $needle_len;\n while( $j > 0 && $needle[$j - 1] == $haystack[$s + $j - 1] )\n $j--;\n\n if( $j > 0 )\n {\n $k = $badcharacter[( int ) $haystack[$s + $j - 1]];\n if( $k < ( int ) $j && ( $m = $j - $k - 1 ) > $goodsuffix[$j] ) { $s += $m; }\n else { $s += $goodsuffix[$j]; }\n }\n else\n {\n return $haystack + $s;\n }\n }\n\n return NULL;\n}",
"public function count_needles_in_haystack($needle, $HayStack){\n $counts = array_count_values($HayStack);\n return $counts[$needle];\n }",
"public static function strposX($haystack, $needle, $number)\n {\n if($number == '1')\n {\n return strpos($haystack, $needle);\n }\n elseif($number > '1')\n {\n return strpos($haystack, $needle, strposX($haystack, $needle, $number - 1) + strlen($needle));\n }\n else\n {\n return error_log('Error: Value for parameter $number is out of range');\n }\n }",
"function by_value($val1, $val2) {\n GLOBAL $RANK;\n\n return strpos($RANK, $val1) <=> strpos($RANK, $val2);\n}",
"function strposa($haystack, $needles){\n foreach($needles as $needle) {\n if(($r = strpos($haystack, $needle)) !== false) return $r;\n }\n return false;\n}",
"function strposa( $haystack, $needles = array(), $offset = 0 ) {\n\t\t$chr = array();\n\n\t\tforeach( $needles as $needle ) {\n\t\t\t$res = strpos( $haystack, $needle, $offset );\n\t\t\tif ( $res !== false ) $chr[$needle] = $res;\n\t\t}\n\n\t\tif ( empty($chr) ) return false;\n\t\t\n\t\treturn min( $chr );\n\t}",
"function strnpos($base, $str, $n) { \r\n\tif ($n <= 0 || intval($n) != $n || substr_count($base, $str) < $n) return FALSE;\r\n \r\n\t$str = strval($str);\r\n\t$len = 0;\r\n \r\n\tfor ($i=0 ; $i<$n-1 ; ++$i)\r\n\t{\r\n\t\tif ( strpos($base, $str) === FALSE ) return FALSE;\r\n\t \r\n\t\t$len += strlen( substr($base, 0, strpos($base, $str) + strlen($str)) );\r\n\t \r\n\t\t$base = substr($base, strpos($base, $str) + strlen($str) );\r\n\t}\r\n\treturn strpos($base, $str) + $len;\r\n}",
"function binarySearch($array, $searchValue){\r\n\t$min = 0;\r\n\t$max = count($array)-1;\r\n\t$guessCounter = 0;\r\n\t\r\n\twhile($max >= $min){\r\n\r\n\t\t$guessCounter++;\r\n\t\t$guess = round(($min + $max) / 2);\r\n\t\t\r\n\t\tif($searchValue === $array[$guess]){\r\n\t\t\techo 'Total number of guesses: '.$guessCounter.\"\\n\";\r\n\t\t\treturn $guess;\r\n\t\t} elseif($array[$guess] > $searchValue){\r\n\t\t\t$max = $guess - 1;\r\n\t\t} else{\r\n\t\t\t$min = $guess + 1;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn -1;\r\n}",
"function searchV2($array, $value) {\n if (empty($array) || empty($value)) {\n return;\n }\n $mid = floor((0 + sizeof($array)-1) / 2);\n $start = $mid;\n $end = $mid;\n while ($start >= 0 && $end < sizeof($array)) {\n if ($array[$start] == $value) {\n return $start;\n } elseif ($array[$end] == $value) {\n return $end;\n }\n if (isset($array[$start-1])) {\n if ($array[$start-1] < $array[$start]) {\n $start--;\n }\n } else {\n break;\n }\n if (isset($array[$end+1])) {\n if ($array[$end+1] > $array[$end]) {\n $end++;\n }\n } else {\n break;\n }\n }\n if ($start == 0) {\n return binarySearch($array, $end+1, sizeof($array)-1, $value);\n } elseif ($end == sizeof($array)-1) {\n return binarySearch($array, 0, $start-1, $value);\n }\n}"
] |
[
"0.6003949",
"0.5713571",
"0.5592024",
"0.545361",
"0.5426004",
"0.54247886",
"0.5423852",
"0.53845245",
"0.5383998",
"0.5366863",
"0.5359938",
"0.5353079",
"0.5312801",
"0.52900136",
"0.5285481",
"0.52840006",
"0.526443",
"0.52497387",
"0.51931375",
"0.517416",
"0.5075454",
"0.5065745",
"0.5060433",
"0.50598335",
"0.50534266",
"0.5049751",
"0.50356793",
"0.5003593",
"0.49779716",
"0.49677756"
] |
0.6012603
|
1
|
Onetime Utilities Modify my blog_id again! Old format: 20080813:whataday New format: 2008/08/13/whataday
|
function update_blog_id_again() {
$table = 'blog_category'; // need to do all that start with "blog"
$query = "SELECT `blog_id` FROM `" . $table . "`";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$id = str_replace(':', '/', $row[0]);
$query = "update `" . $table . "` set `blog_id` = '" . $id . "' where `blog_id` = '" . $row[0] . "'";
print $query . '<br />';
mysql_query($query);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function update_blog_id() {\n\t$table = 'blog_tags';\n\t$query = \"SELECT `blog_id` FROM `\" . $table . \"` WHERE `blog_id` not in ('2006-03-02:next-door')\";\n\t$result = mysql_query($query);\n\twhile ($row = mysql_fetch_array($result)) {\n\t\t$loc = strrchr($row[0],\"/\");\n\t\t$loc = substr($loc,1);\n\t\t$date = strrchr($row[0],\",\");\n\t\t$date = substr($date,1,10);\n\t\t$id = $date . \":\" . $loc;\n\t\t$query = \"update `\" . $table . \"` set `blog_id` = '\" . $id . \"' where `blog_id` = '\" . $row[0] . \"'\";\n\t\tprint $query . '<br />';\n\t\tmysql_query($query);\n\t}\n}",
"function refresh_blog_details($blog_id = 0)\n {\n }",
"function get_blog_id_from_url($domain, $path = '/')\n {\n }",
"function get_current_blog_id()\n {\n }",
"function refresh_blog_details( $blog_id = 0 ) {\n\t$blog_id = (int) $blog_id;\n\tif ( ! $blog_id ) {\n\t\t$blog_id = get_current_blog_id();\n\t}\n\n\tclean_blog_cache( $blog_id );\n}",
"function get_id_from_blogname($slug)\n {\n }",
"public function for_blog($blog_id = '')\n {\n }",
"function switch_blog( $blog_id ) {\n\t\t$this->reset();\n\t\t$this->_blog_id = $blog_id;\n\t}",
"public function getblogId(): Uuid {\n\t\treturn ($this->blogId);\n\t}",
"function update_blog_sql($arr,$id)\n {\n $id = (int)$id;\n mysql_query(\"UPDATE \".$this->prefix.\"blogs SET\n title = '\".$this->safe_import($arr['title']).\"',\n comments = '\".$this->safe_import($arr['comments']).\"',\n postdate = '\".$arr['timestamp'].\"',\n allow = '\".(isset($arr['allow']) ? 1 : 0).\"',\n notify = '\".(isset($arr['notify']) ? 1 : 0).\"'\n WHERE id = '$id'\n LIMIT 1\n \") or die(mysql_error());\n }",
"function wp_cache_switch_to_blog($blog_id)\n {\n }",
"public function switch_to_blog($blog_id)\n {\n }",
"function update_blog_details($blog_id, $details = array())\n {\n }",
"public function getCurrentBlogId()\n {\n return $this->wpDatabase->blogid;\n }",
"function url_to_postid($url)\n {\n }",
"function wp_cache_switch_to_blog($blog_id)\r\n\t{\r\n\t\tglobal $wp_object_cache;\r\n\t\treturn $wp_object_cache->switch_to_blog((int)$blog_id);\r\n\t}",
"function add_blog($id,$blog,$status){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->query(\"UPDATE `utilisateur` SET `fqdn_blog` = '$blog' WHERE `id_utilisateur` = $id\");\n\t\t$req = $bdd->query(\"UPDATE `utilisateur` SET `status_blog` = '$status' WHERE `id_utilisateur` = $id\");\n\t\t\n\t\t$req->closeCursor();\n\t}",
"function get_blog_permalink($blog_id, $post_id)\n {\n }",
"function dvs_change_blog_links($post_link, $id=0){\n\n $post = get_post($id);\n\n if( is_object($post) && $post->post_type == 'post'){\n return home_url('/my-prefix/'. $post->post_name.'/');\n }\n\n return $post_link;\n}",
"function ajan_get_root_blog_id() {\n\treturn (int) apply_filters( 'ajan_get_root_blog_id', (int) activitynotifications()->root_blog_id );\n}",
"function update_blog($blog_id)\n {\n $this->db->update('tbl_blog',$this, array('blog_id'=>$blog_id));\n }",
"public function column_id($blog)\n {\n }",
"static public function getBlogPid(){\n\t\tstatic $cachedPid = 0;\n\n\t\tif (isset($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_t3blog_pi1.']['blogPid']) &&\n\t\t\t\tt3blog_div::testInt($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_t3blog_pi1.']['blogPid'])) {\n\t\t\treturn $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_t3blog_pi1.']['blogPid'];\n\t\t}\n\n\t\t// get pid\n\t\tif (isset($GLOBALS['alternativeBlogPid']) && $GLOBALS['alternativeBlogPid'] > 0) {\n\t\t\treturn intval($GLOBALS['alternativeBlogPid']);\n\t\t}\n\n\t\tif ($cachedPid != 0) {\n\t\t\t$pid = $cachedPid;\n\t\t}\n\t\telse {\n\t\t\t// get the Rootline\n\t\t\t$rootline = array_reverse($GLOBALS['TSFE']->tmpl->rootLine);\n\n\t\t\t// go through rootline until a blogPid is found\n\t\t\t$pidList = array();\n\t\t\tforeach ($rootline as $page) {\n\t\t\t\t$pidList[] = $page['uid'];\n\t\t\t}\n\t\t\t$pidString = implode(',', $pidList);\n\t\t\tlist($row) = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'pages',\n\t\t\t\t'uid IN (' . $pidString . ') AND module=\\'t3blog\\'' .\n\t\t\t\t$GLOBALS['TSFE']->sys_page->enableFields('pages'),\n\t\t\t\t'', 'FIELD(uid,' . $pidString . ')', 1);\n\t\t\tif (is_array($row)) {\n\t\t\t\t$pid = $row['uid'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$pid = $GLOBALS['TSFE']->id;\n\t\t\t}\n\t\t\t$cachedPid = $pid;\n\t\t}\n\t\treturn intval($pid);\n\t}",
"public function switch_to_blog($_blog_id)\n {\n if (! function_exists('is_multisite') || ! is_multisite()) {\n return false;\n }\n\n $this->blog_prefix = $_blog_id;\n\n return true;\n }",
"function config_get_curr_blog_id () {\n\n\t\t global $current_blog;\n\n\t\t if ( isset( $current_blog ) ) {\n\n\t\t\t return $current_blog->blog_id;\n\t\t }\n\t\t else {\n\n\t\t\t return 1;\n\t\t }\n\t}",
"function get_blog_post($blog_id, $post_id)\n {\n }",
"function get_blogaddress_by_id( $blog_id ) {\n\t$bloginfo = get_site( (int) $blog_id );\n\n\tif ( empty( $bloginfo ) ) {\n\t\treturn '';\n\t}\n\n\t$scheme = parse_url( $bloginfo->home, PHP_URL_SCHEME );\n\t$scheme = empty( $scheme ) ? 'http' : $scheme;\n\n\treturn esc_url( $scheme . '://' . $bloginfo->domain . $bloginfo->path );\n}",
"function archive_blog( $blog_id )\n\t{\n\t\tupdate_blog_status( $blog_id, 'archived', '1' );\n\t}",
"public function saveBlogEntry ( $blog_title, $blog_entry ){\r\n // using placeholders to beef up form security\r\n $sql = \"INSERT INTO blog_entry_table (blog_title, blog_text)\r\n VALUES( ?, ?)\";\r\n // create an array with dynamic data: follow the order above\r\n $data = array($blog_title, $blog_entry);\r\n $statement = $this->makeStatement( $sql, $data ); \r\n \r\n // return the blog_id of the last saved blog_entry\r\n return $this->database->lastInsertId();\r\n }",
"private function _processBlog(&$aBlog)\n {\n $aBlog['user_image_path'] = Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aBlog['user_server_id'],\n 'user' => $aBlog,\n 'suffix' => '_75_square',\n 'return_url' => true\n )\n );\n $aBlog['time_stamp'] = Phpfox::getLib('date')->convertTime($aBlog['time_stamp']);\n $aBlog['text_html'] = $aBlog['text'];\n $aBlog['text'] = Phpfox::getService('accountapi.emoticon')->processEmoticon($aBlog['text']);\n $aBlog['short_text'] = $aBlog['text'];\n $aBlog['can_post_comment'] = Phpfox::getService('comment')->canPostComment($aBlog['user_id'], $aBlog['privacy_comment']);\n }"
] |
[
"0.7399237",
"0.64013314",
"0.63717824",
"0.6316757",
"0.6310131",
"0.6293161",
"0.62569195",
"0.6086926",
"0.606523",
"0.5998777",
"0.5905802",
"0.5851391",
"0.5714955",
"0.5714031",
"0.56981283",
"0.5693629",
"0.5690476",
"0.56831145",
"0.56827843",
"0.56771046",
"0.5632302",
"0.56124455",
"0.56025714",
"0.5548726",
"0.5548187",
"0.55396956",
"0.55342966",
"0.5516895",
"0.55028856",
"0.54944986"
] |
0.6856547
|
1
|
Modify my blog_id Old format: tag:iam.solostyle.net,20080813:/2008/08/whataday New format: 20080813:whataday This is the natural key
|
function update_blog_id() {
$table = 'blog_tags';
$query = "SELECT `blog_id` FROM `" . $table . "` WHERE `blog_id` not in ('2006-03-02:next-door')";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$loc = strrchr($row[0],"/");
$loc = substr($loc,1);
$date = strrchr($row[0],",");
$date = substr($date,1,10);
$id = $date . ":" . $loc;
$query = "update `" . $table . "` set `blog_id` = '" . $id . "' where `blog_id` = '" . $row[0] . "'";
print $query . '<br />';
mysql_query($query);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function update_blog_id_again() {\n\t$table = 'blog_category'; // need to do all that start with \"blog\"\n\t$query = \"SELECT `blog_id` FROM `\" . $table . \"`\";\n\t$result = mysql_query($query);\n\twhile ($row = mysql_fetch_array($result)) {\n\t\t$id = str_replace(':', '/', $row[0]);\n\t\t$query = \"update `\" . $table . \"` set `blog_id` = '\" . $id . \"' where `blog_id` = '\" . $row[0] . \"'\";\n\t\tprint $query . '<br />';\n\t\tmysql_query($query);\n\t}\n}",
"function get_id_from_blogname($slug)\n {\n }",
"function get_blog_id_from_url($domain, $path = '/')\n {\n }",
"public function getBlogKey();",
"public function column_id($blog)\n {\n }",
"function get_current_blog_id()\n {\n }",
"public function getblogId(): Uuid {\n\t\treturn ($this->blogId);\n\t}",
"public function for_blog($blog_id = '')\n {\n }",
"function clean_id($id)\n{\n\t$id = str_replace('-', '_', $id);\n\treturn $id;\n}",
"function url_to_postid($url)\n {\n }",
"function hashtags_insert_post( $id, $data ) {\n if (preg_match_all(\"/\".HASHTAGS_REGEXP.\"/i\", $data->post_content, $match)) {\n $tags = implode(\", \", $match[2]);\n\n wp_add_post_tags( $data->post_parent, $tags );\n }\n \n return $id;\n}",
"public function get_id_from_blogname() {\n global $json_api;\n\n $this->_verify_admin();\n\n extract( $_REQUEST );\n\n if(!isset($blogname))\n $json_api->error(__(\"You must send the 'blogname' parameter.\"));\n\n $blog_id = get_id_from_blogname( $blogname );\n\n return array( \"blog_id\" => $blog_id );\n }",
"function get_id_from_blogname( $slug ) {\n\t$current_network = get_network();\n\t$slug = trim( $slug, '/' );\n\n\tif ( is_subdomain_install() ) {\n\t\t$domain = $slug . '.' . preg_replace( '|^www\\.|', '', $current_network->domain );\n\t\t$path = $current_network->path;\n\t} else {\n\t\t$domain = $current_network->domain;\n\t\t$path = $current_network->path . $slug . '/';\n\t}\n\n\t$site_ids = get_sites( array(\n\t\t'number' => 1,\n\t\t'fields' => 'ids',\n\t\t'domain' => $domain,\n\t\t'path' => $path,\n\t) );\n\n\tif ( empty( $site_ids ) ) {\n\t\treturn null;\n\t}\n\n\treturn array_shift( $site_ids );\n}",
"function get_english_post_id( string $slug )\n{\n\n return [\n\n\t\t'agile-framework' => 54907,\n\t\t'blog' => 16636,\n\t\t'cta-building-bricks' => 60772,\n\t\t'customer-success-metrics-continental' => 60849,\n\t\t'customer-success-metrics-dubai' => 60859,\n\t\t'customer-success-metrics-nc-state' => 60860,\n\t\t'customer-success-metrics-solomon-group' => 60847,\n\t\t'events' => 29360,\n\t\t'hero-newsroom' => 61349,\n\t\t'hero-cloud' => 61349,\n\t\t'homepage-block-ctas' => 54984,\n\t\t'homepage' => 12357, \n\t\t'insurance' => 60943,\n\t\t'logo-ticker-mx-world-2020' => 57127,\n\t\t'low-code-guide' => 59648,\n\t\t'low-code-news' => 59151,\n\t\t'makeshift' => 56033,\n\t\t'media-coverage' => 30061,\n\t\t'mendix-values' => 56025,\n\t\t'mxw-agenda' => 56708,\n\t\t'mxw-home' => 56707,\n\t\t'press-releases' => 30062,\n\t\t'you-build-with-mendix' => 60894,\n\n\t][$slug];\n}",
"function to_id($s) {\n $s = singularize(trim($s));\n if (!$s) return $s;\n\n return underscore($s) . '_id';\n }",
"function add_hashTags( $ID, $post ) {\n\t\t\t$post = get_post( $ID );\n\t\t\t$url1 = $post->$post_name; // get the slug\n\t\t\t$url= bloginfo('url') .'/'. $url1;// your post title\n\t\t\t$APPLICATION_ID = '4ecd9e16';\n\t\t$APPLICATION_KEY='be54f0e53443501357865cbc055538aa';\n\t\t $ch = curl_init('https://api.aylien.com/api/v1/hashtags');\n\t\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t'Accept: application/json',\n\t\t\t'X-AYLIEN-TextAPI-Application-Key: ' . APPLICATION_KEY,\n\t\t\t'X-AYLIEN-TextAPI-Application-ID: '. APPLICATION_ID\n\t\t ));\n\t\t curl_setopt($ch, CURLOPT_POST, true);\n\t\t curl_setopt($ch, CURLOPT_POSTFIELDS, $url);\n\t\t $response = curl_exec($ch);\n\t\t $keywords= json_decode($response);\n\t\t wp_set_post_tags( $ID, $keywords, true );\n\t\t}",
"function name_id( string $key ): void {\n\t\t\\wpinc\\meta\\name_id( $key );\n\t}",
"function update_blog_sql($arr,$id)\n {\n $id = (int)$id;\n mysql_query(\"UPDATE \".$this->prefix.\"blogs SET\n title = '\".$this->safe_import($arr['title']).\"',\n comments = '\".$this->safe_import($arr['comments']).\"',\n postdate = '\".$arr['timestamp'].\"',\n allow = '\".(isset($arr['allow']) ? 1 : 0).\"',\n notify = '\".(isset($arr['notify']) ? 1 : 0).\"'\n WHERE id = '$id'\n LIMIT 1\n \") or die(mysql_error());\n }",
"function parse_id($id) {\n\n }",
"function fiorello_mikado_get_multisite_blog_id() {\n\t\tif ( is_multisite() ) {\n\t\t\treturn get_blog_details()->blog_id;\n\t\t}\n\t}",
"function clean_id($text) {\n $text = strtolower($text);\n $text = str_replace('/', '-', $text);\n $text = preg_replace('/[^0-9a-zA-Z-_]/', '', $text);\n return $text;\n}",
"function ap_core_chat_row_id( $chat_author ) {\r\n global $ap_core_post_format_chat_ids;\r\n\r\n /* Let's sanitize the chat author to avoid craziness and differences like \"John\" and \"john\". */\r\n $chat_author = strtolower( strip_tags( $chat_author ) );\r\n\r\n /* Add the chat author to the array. */\r\n $ap_core_post_format_chat_ids[] = $chat_author;\r\n\r\n /* Make sure the array only holds unique values. */\r\n $ap_core_post_format_chat_ids = array_unique( $ap_core_post_format_chat_ids );\r\n\r\n /* Return the array key for the chat author and add \"1\" to avoid an ID of \"0\". */\r\n return absint( array_search( $chat_author, $ap_core_post_format_chat_ids ) ) + 1;\r\n}",
"public static function cleanId($id) {\n\t\tstatic $seen;\n\t\t$id = str_replace(array('][', '_', ' '), '-', $id);\n\t\tif(isset($seen[$id]))\n\t\t\t$id .= '-'.$seen[$id]++;\n\t\telse\n\t\t\t$seen[$id] = 0;\n\t\treturn $id;\n\t}",
"function atwork_id_safe($string) {\n // Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.\n $string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));\n // If the first character is not a-z, add 'n' in front.\n if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.\n $string = 'id'. $string;\n }\n return $string;\n}",
"function attachment_url_to_postid($url)\n {\n }",
"function acf_idify($str = '')\n{\n}",
"function switch_blog( $blog_id ) {\n\t\t$this->reset();\n\t\t$this->_blog_id = $blog_id;\n\t}",
"public function parse ($del,$post,$post_id){\n\t\t\t$parse_occurances = substr_count($post,$del);\n\t\t\t$parse_end = 0;\t \n\t\t\t$post_new = $post;\n\t\t\tfor($i=1; $i<=$parse_occurances;$i++) {\n\t\t\t\t\tif($parse_end<strlen($_POST['post'])){\n\t\t\t\t\t #Start of the hashtag\n\t\t\t\t\t $parse_start = strpos($post,$del,$parse_end);\n\t\t\t\t\t\t#end of the hashtag\n\t\t\t\t\t\t$parse_end = strpos($post,\" \",$parse_start);\t\t\t\t\t\n\t\t\t\t\t\t#length of the hashtag value to grab:\n\t\t\t\t\t $parse_length = $parse_end - $parse_start;\n\t\t\t\t\t \n\t\t\t\t\t\t#account for odd situations that might force length to invalid values:\n\t\t\t\t\t\tif($parse_length > strlen($_POST['post']) OR ($parse_length <0) ){\n\t\t\t\t\t\t\t$parse_length = strlen($_POST['post']);\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#grab the actual tag from the post using the substring\t\t\t\t\t\n\t\t\t\t\t\t$parse_tag = substr($post,$parse_start,$parse_length);\n\t\t\t\t\t\t$parse_tag = substr($parse_tag,1,($parse_length-1));\n\t\t\t\t\t\tif($del==\"#\"){\n\t\t\t\t\t\t\t#update the post taggint the tag with a link:\n\t\t\t\t\t \t\t $post_temp = \"<a href='/posts/hash?input=\".$parse_tag.\"'>\".$parse_tag.\"</a>\";\n\t\t\t\t\t\t\t $post_new = str_replace($parse_tag,$post_temp,$post_new);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t \t\t #store parsed tag with reference to this post into the db\n\t\t\t\t\t \t\t $data = Array(\n\t\t\t\t\t\t\t\t\t\"post_id\" => $post_id,\n\t\t\t\t\t\t\t\t\t\"hashtag\" => $parse_tag,\t \n\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t # Do the insert\n\t\t\t\t\t\t\t DB::instance(DB_NAME)->insert('hashtags', $data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($del==\"@\"){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t$mention_user_id = 0;\t\n\t\t\t\t\t\t\t$q = \"select user_id from users where user_name = '\".$parse_tag.\"'\";\t\n\t\t\t\t\t\t\t$mention_user_id = DB::instance(DB_NAME)->select_field($q);\n \t\t\t\t\t\t\t#if this is the first iteration of the loop and you have found a 'mention' assume this is a reply to value\n\t\t\t\t\t\t\tif($i==1){\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t$_POST['reply_to'] = $mention_user_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!$mention_user_id==0){\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t#update the post taggint the tag with a link:\n\t\t\t\t\t \t\t $post_temp = \"<a href='/posts/mentions?input=\".$parse_tag.\"'>\".$parse_tag.\"</a>\";\n\t\t\t\t\t\t\t $post_new = str_replace($parse_tag,$post_temp,$post_new);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t \t\t\t#store hashtag with reference to this post into the db\n\t\t\t\t\t \t\t\t$data = Array(\n\t\t\t\t\t\t\t\t\t\"post_id\" => $post_id,\n\t\t\t\t\t\t\t\t\t\"user_id\" => $mention_user_id,\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# Do the insert\n\t\t\t\t\t\t\t\tDB::instance(DB_NAME)->insert('mentions', $data);\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#return the updated post with tagged tags:\n\t\t\treturn $post_new;\t\t \n\t\t\t\n\t\t}",
"private function computeIdentifierAttribute(): void\n {\n $data = $this->content->jsonSerialize();\n $this->attributes['data-bb-identifier'] = str_replace('\\\\', '/', $data['type']) . '(' . $data['uid'] . ')';\n }",
"function writeHashtags($str, object $link, int $last_id)\n{\n if (!empty($_POST['post-tags'])) {\n $tags_array = array_diff(explode(' ', $str), array(''));\n foreach ($tags_array as $val) {\n $exist_sql = \"SELECT * FROM hashtag WHERE title = '$val'\";\n $res = mysqli_fetch_all(mysqli_query($link, $exist_sql), MYSQLI_ASSOC);\n if ($res[0]['id']) {\n $hashtag_id = $res[0]['id'];\n $sql = \"INSERT INTO post_hashtag (post_id, hashtag_id) VALUES ('$last_id', '$hashtag_id')\";\n mysqli_query($link, $sql);\n } else {\n $sql = \"INSERT INTO hashtag (title) VALUES ('$val')\";\n mysqli_query($link, $sql);\n $new_hashtag_id = mysqli_insert_id($link);\n $sql = \"INSERT INTO post_hashtag (post_id, hashtag_id) VALUES ('$last_id', '$new_hashtag_id')\";\n mysqli_query($link, $sql);\n }\n }\n }\n}"
] |
[
"0.6653416",
"0.6233495",
"0.59801984",
"0.5892923",
"0.5649367",
"0.5602658",
"0.55021363",
"0.5441881",
"0.5435031",
"0.54318017",
"0.5427033",
"0.53992844",
"0.5381435",
"0.5336111",
"0.53160214",
"0.5314547",
"0.5314158",
"0.5309192",
"0.5289796",
"0.5274326",
"0.5271794",
"0.52675647",
"0.52471876",
"0.5246322",
"0.52050525",
"0.52017593",
"0.5196938",
"0.5194834",
"0.5182436",
"0.5177647"
] |
0.7183961
|
0
|
Update the database time for all entries! 7 mar 09: created
|
function update_entry_time() {
$query = "SELECT `id` FROM `blog` WHERE `time` = '0000-00-00 00:00:00'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$datepos = strpos($row[0],",");
$date = substr($row[0],$datepos+1,10);
$hr = rand(0,24);
if ($hr<10)
$hr = "0" . $hr;
$mn = rand(0,59);
$sc = rand(0,59);
if ($mn<10)
$mn = "0" . $mn;
if ($sc<10)
$sc = "0" . $sc;
$date .= " " . $hr . ":" . $mn . ":" . $sc;
$query = "UPDATE `blog` SET `time` = '" . $date . "' WHERE `id` = '" . $row[0] . "'";
//print $query . '<br />';
mysql_query($query);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updateQueryTime()\n\t{\n\t\t$this->setLastQueryTime(time());\n\t\t$this->save();\n\t}",
"protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }",
"function updateTime($abrv){\n\t$time = time();\n\t$sql = \"UPDATE updated set $abrv='$time' where ID='0'\";\n db_query($sql, \"update the time record\");\n}",
"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}",
"function dbToUItime() {\r\n\r\n\t\t$hour = substr($this->event_date_time, -8, 2);\r\n\t\t$min = substr($this->event_date_time, -5, 2);\r\n\r\n\t\t$am_pm = \"AM\";\r\n\r\n\t\t//change hour based on certain conditions\r\n\t\t$hour = changeTo12hour($hour, $am_pm);\r\n\r\n\t\t$this->time = $hour . \":\" . $min . \" \" . $am_pm;\r\n\t}",
"protected function _update()\n {\r\n $this->date_updated = new Zend_Db_Expr(\"NOW()\");\n parent::_update();\n }",
"function set_date_to_now()\n {\n $this->timestamp=time();\n }",
"protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }",
"public function updatePinTime()\n {\n /*Redis::command(\"sadd\", [PinHelper::REDIS_PINS_TO_UPDATE_TIME, 2,5,6, \"j\", \"aaa\"]);\n $x = Redis::command('spop', [PinHelper::REDIS_PINS_TO_UPDATE_TIME, 100]);*/\n $pin_id = [];\n $result = PinTimeUpdate::limit(100)->get();\n foreach ($result as $value) {\n $pin_id[] = CacheHelper::getCache(\"user_pin_id\", [\"user_id\" => $value->user_id]);\n $value->delete();\n }\n\n Pin::whereIn(\"id\", $pin_id)->update(['updated_at' => DB::raw('DATE_ADD(updated_at,INTERVAL 10 MINUTE)')]);\n }",
"public function refreshTimestamp();",
"protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}",
"private function setLastModifiedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-last-modified` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setLastModifiedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-last-modified` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->lastModifiedDate = $row['datetime-last-modified'];\n\t\t}\n\t}",
"public function populateTimestamp()\n {\n $this->exists = true;\n $this->timestamp = 1;\n }",
"function update_vehicle_time($cid)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\t\n\t\t$data['time'] = time();\n\n\t\t$this->update_single_field(GARAGE_TABLE, 'date_updated', $data['time'], 'id', $cid);\n\t\n\t\treturn;\n\t}",
"public function onPreUpdate()\n {\n $this->fechaUltimaModificacion = new \\DateTime(\"now\");\n }",
"public function update_login_time() {\n\t\t$this->last_login = date('Y-m-d H:i:s');\n\t\t$this->db->update('admin_login', $this, array('id' => 1));\n\t}",
"private function updateUpdatedAtField() {\n foreach (static::getFields() as $field_name => $field) {\n if ($field instanceof UpdatedAtField) {\n $this->$field_name = time();\n }\n }\n }",
"function Sql_DB_Info_Set_Time($table)\n {\n //We need it here!\n if (empty($table)) { $table=$this->SqlTableName($table); }\n $query=$this->Sql_DB_Info_Set_Time_Query($table);\n \n $result=$this->DB_Query($query);\n \n return $this->MyMod_Data_Files_MTime();\n }",
"function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}",
"public function notify_Time($id,$table){\n $this->date = date(\"h:i A\");\n $sql = \"UPDATE {$table} SET SENT_Time = '$this->date' WHERE ID = '$id'\";\n $query = mysqli_query($this->con,$sql);\n }",
"public function updatedTimestamps()\n {\n if($this->getCreatedAt() == null)\n {\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\n }\n }",
"function touch_time($edit = 1, $for_post = 1, $tab_index = 0, $multi = 0)\n {\n }",
"public function getUpdate_time()\r\n {\r\n return $this->update_time;\r\n }",
"private function setPublishedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-published` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setPublishedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-published` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->datePublished = $row['datetime-published'];\n\t\t}\n\n\t\t// Also set the last modified datetime\n\t\t$this->setLastModifiedDateTime();\n\t}",
"public function updateTimestamps()\n {\n $time = $this->freshTimestamp();\n\n $updatedAtColumn = $this->getUpdatedAtColumn();\n\n if (! is_null($updatedAtColumn) && ! $this->isDirty($updatedAtColumn)) {\n $this->setUpdatedAt($time);\n }\n\n $createdAtColumn = $this->getCreatedAtColumn();\n\n if (! $this->exists && ! is_null($createdAtColumn) && ! $this->isDirty($createdAtColumn)) {\n $this->setCreatedAt($time);\n }\n }",
"public function notification_message_time_update()\n {\n echo $this->Home_model->notification_message_time_update_model();\n }",
"public function updateTimestamps() {\r\n $this->setModifiedAt(new \\DateTime(date('Y-m-d H:i:s')));\r\n\r\n if ($this->getCreatedAt() == null) {\r\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\r\n }\r\n }",
"function complete_update() {\n // Extract the relevant day of the week for which to update link times\n // N.B. php function: 6=Saturday, 7=Sunday, 1=Monday\n // \t postgres function: 6=Saturday, 0=Sunday, 1=Monday\n $dow = date('N',strtotime('yesterday', $this->backup_time)) % 7;\n\n echo \"Deleting stale information\".\"\\n\";\n $this->delete_stale_information($dow);\n echo \"Stale information deleted. Starting to process new average times\".\"\\n\";\n\n for($hod = 0; $hod < 24; $hod++) { // for each hour of the day\n $journey_times = $this->extract_journey_times($dow, $hod);\n $this->insert_into_database($journey_times, $dow, $hod);\n echo \"Update complete for hour \".$hod.\"\\n\";\n }\n }",
"function updateTimestamp($year, $month, $day, $time = NULL)\n\t\t{\n\t\t\tif(empty($this->id))\n\t\t\t\treturn false;\t\t//need a saved order\n\n\t\t\tif(empty($time))\n\t\t\t\t$time = \"00:00:00\";\n\n\t\t\t$date = $year . \"-\" . $month . \"-\" . $day . \" \" . $time;\n\n\t\t\tglobal $wpdb;\n\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders SET timestamp = '\" . $date . \"' WHERE id = '\" . $this->id . \"' LIMIT 1\";\n\n\t\t\tif($wpdb->query($this->sqlQuery) !== \"false\")\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}",
"public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}"
] |
[
"0.7076871",
"0.6751708",
"0.6588383",
"0.63749963",
"0.6333144",
"0.6325113",
"0.6319088",
"0.6262284",
"0.6222596",
"0.6213909",
"0.61929005",
"0.61885357",
"0.61854726",
"0.61625654",
"0.61109227",
"0.60999805",
"0.6087697",
"0.6059711",
"0.60559213",
"0.60448503",
"0.6026448",
"0.60216117",
"0.6020966",
"0.60023683",
"0.59995997",
"0.59740764",
"0.5958903",
"0.5949971",
"0.5947391",
"0.5932804"
] |
0.70210266
|
1
|
Shortcut for checking authorization as series editor.
|
static function isSeriesEditor($pressId = -1) {
return Validation::isAuthorized(ROLE_ID_SUB_EDITOR, $pressId);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function feed_category_term_admin_access() {\r\n $arguments = func_get_args();\r\n $feed_category_term = array_shift($arguments);\r\n foreach ($arguments as $access) {\r\n if (!user_access($access)) {\r\n return FALSE;\r\n }\r\n }\r\n return feed_category_term_access($feed_category_term);\r\n}",
"public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }",
"public function authorize(): bool\n {\n return Gate::allows('seo.translation.edit');\n }",
"public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }",
"public function authorize()\n {\n return session('role') == 'administrador';\n }",
"public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }",
"public function authorize()\n {\n return isSuperAdmin();\n }",
"function feed_widget_admin_access() {\r\n $arguments = func_get_args();\r\n $feed = array_shift($arguments);\r\n foreach ($arguments as $access) {\r\n if (!user_access($access)) {\r\n return FALSE;\r\n }\r\n }\r\n return feed_widget_access($feed);\r\n}",
"public function authorize()\n {\n return Gate::allows('store', $this->getMarkType());\n }",
"public function authorize()\n {\n return Auth::user()->type == 'admin';\n }",
"public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }",
"function is_editor($shared)\n{\n\n return $shared->permission === 'editor';\n}",
"public function authorize() {\n\t\tif (Auth::user()->user_type == \"S\" || Auth::user()->user_type == \"O\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tabort(404);\n\t\t}\n\t}",
"public function authorize()\n {\n return Auth::check() && Auth::user()->hasAnyRol([\n 'contractor-superadmin',\n 'contractor-manager',\n 'contractor-worker',\n 'contractor-admin',\n ]);\n }",
"public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }",
"public function authorize()\n {\n return auth()->user()->is_author($this->route('board'));\n }",
"function user_can_richedit()\n {\n }",
"public function authorize()\n {\n return is_client_or_staff();\n }",
"protected function authorization()\n {\n $this->gate();\n\n FlowDash::auth(function ($request) {\n return app()->environment('local') ||\n Gate::check('viewFlowDash', [$request->user()]);\n });\n }",
"public function hasAuthorization(): bool;",
"public function authorize()\n {\n $user = Sentinel::getUser();\n $admin = Sentinel::findRoleByName('Admin');\n if ( $user->inRole( $admin ) ) { //lets make sure its an admin\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return access()->hasPermission('manage-articles');\n }",
"function CheckEditorAccess () {\n global $zOLDAPPLE, $zLOCALUSER; \n\n // Check if user has ownership access to this page.\n if ($this->userAuth_uID != $zLOCALUSER->uID) {\n // Error out if user does not have access privileges.\n if ($zLOCALUSER->userAccess->e == FALSE) {\n return (FALSE);\n } // if\n } // if\n\n return (TRUE);\n }",
"static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }",
"function feed_category_admin_access() {\r\n $arguments = func_get_args();\r\n $allow_public = array_shift($arguments);\r\n $feed_category = array_shift($arguments);\r\n foreach ($arguments as $access) {\r\n if (!user_access($access)) {\r\n return FALSE;\r\n }\r\n }\r\n return feed_category_access($allow_public, $feed_category);\r\n}",
"public function authorize(): bool\n {\n return Auth::check() &&\n $this->user()->tokenCan('view:store');\n }",
"public function authorize()\n {\n return auth()->user()->role === \"admin\";\n }",
"public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}",
"public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }",
"public function authorize()\n {\n return Auth::guard()->user()->role == 'admin';\n }"
] |
[
"0.6155042",
"0.57706153",
"0.5770268",
"0.5755401",
"0.57332504",
"0.5720532",
"0.5709799",
"0.570876",
"0.5708656",
"0.56945205",
"0.56748956",
"0.5674881",
"0.5664089",
"0.56630147",
"0.565354",
"0.5649755",
"0.5601848",
"0.5601604",
"0.5591642",
"0.559006",
"0.5586633",
"0.5581893",
"0.5580987",
"0.55804825",
"0.5579113",
"0.55765414",
"0.55761546",
"0.556857",
"0.5561717",
"0.55567986"
] |
0.61810416
|
0
|
Get the field name/id for the nonce field.
|
public function get_nonce_field(): string {
return $this->nonce_field;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getIdentifier()\n {\n return static::FIELD_ID;\n }",
"public function getIdentifierField();",
"public function get_field_id() {\n\t\treturn $this->get_field_attr( 'id' );\n\t}",
"public function get_field_name();",
"public function get_field_key() {\n\t\treturn $this->get_field_attr( 'field_key' );\n\t}",
"public function getNonce();",
"public function getNonce(): int;",
"public function getIDField(): string {\n\t\treturn $this->idField;\n\t}",
"public function getIdFieldName()\n {\n return $this->_idFieldName;\n }",
"function get_field_id( $str ){\n\t\treturn 'field-'.$this->id_base.'-'.$this->number.'-'.$str;\n\t}",
"protected function getWpNonceFieldFunction()\n {\n return new TwigFunction('wp_nonce_field', 'wp_nonce_field', [\n 'is_safe' => ['html'],\n ]);\n }",
"public function getClientNonce(): string;",
"function getFieldName($n){\n\t\t$field = $this->fields[$n]['Field'];\n\t\treturn $field;\n\t}",
"function get_nonce(): ?string\n{\n return is_request() ? input_request('nonce') : input_get('nonce');\n}",
"public function getFieldId()\n {\n if (array_key_exists(\"fieldId\", $this->_propDict)) {\n return $this->_propDict[\"fieldId\"];\n } else {\n return null;\n }\n }",
"public function getSingleIdentifierFieldName(): string;",
"public function getNonce()\n {\n return $this->nonce;\n }",
"public function getKeyField()\n {\n $class = get_class($this);\n $parts = explode('\\\\', $class);\n $name = $parts[count($parts)-1];\n return strtolower($name) . '_id';\n }",
"public function get_nonce() {\n\t\treturn $this->mt_nonce;\n\t}",
"public function getNonce(): int\n {\n $time = explode(' ', microtime());\n\n return $time[1] . substr($time[0], 2, 6);\n }",
"public function getUuidFieldName() {\n \n return $this->getUuidColumnName();\n }",
"public function fieldName()\n\t{\n\t\tif(strpos($this->key, '_id'))\n\t\t{\n\t\t\treturn str_replace('_id', '', $this->key);\n\t\t}\n\n\t\treturn $this->key;\n\t}",
"function get_nonce() {\n if (!empty($this->nonce)) {\n $nonce = $this->nonce;\n unset($this->nonce);\n return $nonce;\n }\n $mt = microtime();\n $rand = mt_rand();\n\n return md5($mt . $rand);\n }",
"public function getRecordIdFieldName()\n {\n $metadata = $this->exportMetaData();\n $recordIdFieldName = $metadata[0]['field_name'];\n return $recordIdFieldName;\n }",
"protected function getNonce()\n\t{\n\t\treturn self::NONCE;\n\t}",
"public function getIdField()\n {\n return $this->idField;\n }",
"public function getIdFieldName()\n {\n return $this->prototype->getIdFieldName();\n }",
"function getNonce() {\n\t\t\t$time = ceil(time() / $this->nonceLife) * $this->nonceLife;\n\t\t\treturn md5(date('Y-m-d H:i', $time).':'.$_SERVER['REMOTE_ADDR'].':'.$this->privateKey);\n\t\t}",
"public function get_field_id($field_name)\n {\n }",
"private function get_nonce () {\n return @$_COOKIE['sso_nonce'];\n }"
] |
[
"0.67392796",
"0.6639026",
"0.6472387",
"0.6371506",
"0.6357886",
"0.6286608",
"0.62062925",
"0.6182856",
"0.6051115",
"0.60381925",
"0.6036821",
"0.6025078",
"0.5974363",
"0.5971786",
"0.5970253",
"0.5967253",
"0.59589905",
"0.59459317",
"0.5940267",
"0.5935247",
"0.5927553",
"0.5910599",
"0.5903148",
"0.5877888",
"0.5857433",
"0.5841786",
"0.58376026",
"0.5830493",
"0.5824719",
"0.5822523"
] |
0.7637368
|
0
|
Checks if the action is defined.
|
public function has_valid_action(): bool {
return is_string( $this->get_action() )
&& \mb_strlen( $this->get_action() ) > 0;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function hasAction()\n {\n return !is_null($this->_action);\n }",
"public function hasAction(string $name): bool;",
"public function hasActions();",
"public function isAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return true;\n }\n }\n\n return false;\n }",
"function has_action($hook_name, $callback = \\false)\n {\n }",
"public function hasAction($action)\n {\n if (method_exists($this, $action . 'Action')) {\n return $action . 'Action';\n }\n return false;\n }",
"private function _actionExists($request) { \n $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher(); \n \n // Check controller \n if (!$dispatcher->isDispatchable($request)) { \n return false; \n } \n \n // Check action \n $controllerClassName = $dispatcher->formatControllerName( $request->getControllerName() ); \n $controllerClassFile = str_replace('_', '/', $controllerClassName) . '.php'; \n if ($request->getModuleName() != $dispatcher->getDefaultModule()) { \n $controllerClassName = ucfirst($request->getModuleName()) . '_' . $controllerClassName; \n } \n try { \n require_once 'Zend/Loader.php'; \n Zend_Loader::loadFile($controllerClassFile, $dispatcher->getControllerDirectory($request->getModuleName()), true); \n $actionMethodName = $dispatcher->formatActionName($request->getActionName()); \n if (@in_array($actionMethodName, get_class_methods($controllerClassName))) { \n return true; \n } \n return false; \n } catch(Exception $e) { \n return false; \n } \n }",
"function isAllowedAction($action) {\n\t\t\treturn true;\n\t\t}",
"public function isAction($action)\n\t{\n\t\treturn strpos($this->getAction(TRUE), $action) !== FALSE;\n\t}",
"public function hasPermission($action = \"\");",
"private static function action_allowed( $action ) {\n\t\tif ( in_array( $action, self::allowed_actions() ) ) {\n\t\t\t$class = route::action_class( $action );\n\t\t\tif ( self::check_interface( $class ) && self::check_parent_class( $class ) ) {\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"public function requireAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return;\n }\n }\n\n $this->sendJsonResponse(false, 'Invalid Action!');\n die;\n }",
"public function getDefaultHasAction()\n {\n return 1;\n }",
"public function getDefaultHasAction()\n {\n return 1;\n }",
"public function getDefaultHasAction()\n {\n return 1;\n }",
"public function isDefined($module, $action)\n {\n foreach ($this->widgets as $widget) {\n if ($widget->getModule() === $module && $widget->getAction() === $action) {\n return true;\n }\n }\n\n return false;\n }",
"protected function hasAction($hook, $callback = false)\n\t{\n\t\treturn has_action($hook,$callback);\n\t}",
"protected function isAllowedAction($action)\n {\n return true;\n }",
"public function isActionRequest()\n\t{\n\t\t$this->_checkRequestType();\n\t\treturn $this->_isActionRequest;\n\t}",
"public function isActionAllowed($action){\r\n if(in_array($action,$this->_allowedActions)){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function hasAction($actionName) {\n if (method_exists($this, Lvc_Config::getActionFunctionName($actionName))) {\n return true;\n } else {\n return false;\n }\n }",
"private function isControllerAction()\n {\n return is_string($this->attributes[self::ACTION]);\n }",
"public function isActionAllowed($section, $reference, $action = NULL) ;",
"public function has($name)\n {\n return isset($this->actions[$name]);\n }",
"public function isAction($action)\n {\n if (!$this->MultiStepForm->isWhitelist($action)) {\n return false;\n }\n\n return parent::isAction($action);\n }",
"public function checkActions() {\n if (isset($this->request_json->action)) {\n\n if (is_array($this->request_json->action)) {\n $this->request_json->action = array_pop($this->request_json->action);\n }\n $vars = array('data' => (array) $this->request_json);\n $this->hook('action_' . $this->request_json->action, $vars);\n exit;\n }\n }",
"public function actionExist ($actionName) {\n\t\treturn method_exists($this, 'process'.$actionName);\n\t}",
"function valid_action() {\n # of pages that are about that page (i.e. not admin\n # or recent changes)\n global $ACT;\n if($ACT == 'show') { return true; }\n if($ACT == 'edit') { return true; }\n if($ACT == 'revisions') { return true; }\n return false;\n }",
"protected function checkForMissingController($action)\n {\n $exists = is_object($action)\n || $this->dispatcher->hasObject($action);\n if ($exists) {\n return;\n }\n\n $this->logger->debug(__METHOD__ . \" missing action '$action'\");\n $this->request->params['action'] = 'aura.web_kernel.missing_action';\n $this->request->params['missing_action'] = $action;\n }",
"function test_init_action_added() {\n\t\t$this->assertSame( 10, has_action( 'init', 'rest_api_init' ) );\n\t}"
] |
[
"0.825277",
"0.7432535",
"0.7400957",
"0.73274547",
"0.71783584",
"0.71131593",
"0.70850176",
"0.7057132",
"0.6879339",
"0.6814579",
"0.6767158",
"0.6731491",
"0.6719131",
"0.6719131",
"0.6719131",
"0.667448",
"0.66369224",
"0.6604468",
"0.65983236",
"0.6587849",
"0.65806156",
"0.65617734",
"0.65350705",
"0.65320694",
"0.6527417",
"0.6519428",
"0.6475035",
"0.6456793",
"0.64562386",
"0.64474595"
] |
0.76880044
|
1
|
Builds a new post.
|
public function buildPost($content);
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function createPostFromInput() {\n\n $record = [\n 'id_config' => post_config()->getCurrent()->get('id'),\n 'id_user' => user()->getCurrent()->get('id'),\n 'id_parent' => in('id_parent', 0),\n 'subject' => in('subject', ''),\n 'content' => in('content', ''),\n 'content_stripped' => strip_tags(in('content')),\n 'content_type' => in('content_type'),\n 'id_browser' => getBrowserID(),\n 'ip' => getIP(),\n 'domain' => getDomain(),\n 'user_agent' => getUserAgent(),\n 'country' => in('country'),\n 'province' => in('province'),\n 'city' => in('city'),\n 'link' => in('link'),\n ];\n $post = $this->createPost($record);\n\n $this->updateData($post);\n return $post;\n }",
"private function buildPost($post) {\n\t\treturn $this->getInLayout(SNUG_VIEWS . '_post.haml', $post);\n\t}",
"public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $this->issetPostSperglobal('publish'))\n {\n $empty_field = 0;\n foreach ($_POST as $key => $post) {\n if ($key !== 'publish' && empty(trim($post))) {\n $empty_field++;\n }\n }\n if ($empty_field === 0) {\n $User = $this->session->read('User');\n $this->posts_manager->create($_POST, $User->getIdUser());\n $this->session->writeFlash('success', \"L'article a été créé avec succès.\");\n $this->redirect('dashboard');\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($_POST);\n $categories = $this->categories_manager->listAll();\n $this->render('admin_post', ['head'=>['title'=>'Création d\\'un article', 'meta_description'=>''], 'categories'=>$categories, '_post'=>isset($_post) ? $_post : ''], 'admin');\n }",
"public static function create()\n {\n if(isset($_POST['create_post']) && Html::form()->validate())\n {\n $postId = Blog::post()->insert(array(\n 'user_id' => User::current()->id,\n 'title' => $_POST['title'],\n 'slug' => String::slugify($_POST['title']),\n 'body' => $_POST['body']\n ));\n\n if($postId)\n {\n foreach($_POST['category_id'] as $catId)\n {\n Db::table('categories_posts')->insert(array(\n 'category_id' => $catId,\n 'post_id' => $postId\n ));\n }\n\n Message::ok('Post created successfully.');\n $_POST = array(); // Clear form\n }\n else\n Message::error('Error creating post. Please try again.');\n }\n\n $formData[] = array(\n 'fields' => array(\n 'title' => array(\n 'title' => 'Title',\n 'type' => 'text',\n 'validate' => array('required')\n ),\n 'body' => array(\n 'title' => 'Body',\n 'type' => 'textarea',\n 'attributes' => array('class' => 'tinymce')\n ),\n 'category_id[]' => array(\n 'title' => 'Category',\n 'type' => 'select',\n 'options' => self::_getSelectCategories(),\n 'attributes' => array(\n 'multiple' => 'multiple'\n ),\n 'validate' => array('required')\n ),\n 'create_post' => array(\n 'type' => 'submit',\n 'value' => 'Create Post'\n )\n )\n );\n\n return array(\n 'title' => 'Create Post',\n 'content' => Html::form()->build($formData)\n );\n }",
"public function buildPostAction()\n {\n $isCount = $this->getRequest()->getParam('pretend');\n $index = Zend_Search_Lucene::create(Zend_Registry::getInstance()->config->search->post);\n\n \n\n require_once 'Ifphp/models/Posts.php';\n require_once 'Ifphp/models/Feeds.php';\n require_once 'Ifphp/models/Categories.php';\n\n $posts = new Posts();\n $allPosts = $posts->getRecent(1,0);\n\n if ($isCount)\n {\n echo $allPosts->count().' posts would have been added to the post index';\n exit;\n }\n\n\n foreach($allPosts as $post)\n {\n $feed = $post->findParentFeeds();\n \n $doc = new Zend_Search_Lucene_Document();\n $doc->addField(Zend_Search_Lucene_Field::Text('pid', $post->id));\n $doc->addField(Zend_Search_Lucene_Field::Text('title', $post->title));\n $doc->addField(Zend_Search_Lucene_Field::Text('siteUrl', $post->siteUrl));\n $doc->addField(Zend_Search_Lucene_Field::Text('link', $post->link));\n $doc->addField(Zend_Search_Lucene_Field::Text('feedTitle', $feed->title));\n $doc->addField(Zend_Search_Lucene_Field::Text('feedSlug', $feed->slug));\n $doc->addField(Zend_Search_Lucene_Field::keyword('category', $feed->findParentCategories()->title));\n $doc->addField(Zend_Search_Lucene_Field::Text('description', $post->description));\n $doc->addField(Zend_Search_Lucene_Field::unIndexed('publishDate', $post->publishDate));\n $doc->addField(Zend_Search_Lucene_Field::Keyword('type','post'));\n $index->addDocument($doc);\n\n }\n// chown(Zend_Registry::getInstance()->search->post,'www-data');\n }",
"public function createPost()\n {\n $this->validate(['body' => 'required|min:15']);\n $post = auth()->user()->posts()->create(['body' => $this->body]);\n\n $this->emit('postAdded', $post->id); //emit de l'event\n\n $this->body = \"\"; //vidage du body\n\n }",
"public function build() {}",
"public function build() {}",
"public function build() {}",
"public function post()\n\t{\n\t\t$crud = $this->generate_crud('blog_posts');\n\t\t$crud->columns('author_id', 'category_id', 'title', 'image_url', 'tags', 'publish_time', 'status');\n\t\t$crud->set_field_upload('image_url', UPLOAD_BLOG_POST);\n\t\t$crud->set_relation('category_id', 'blog_categories', 'title');\n\t\t$crud->set_relation_n_n('tags', 'blog_posts_tags', 'blog_tags', 'post_id', 'tag_id', 'title');\n\t\t\n\t\t$state = $crud->getState();\n\t\tif ($state==='add')\n\t\t{\n\t\t\t$crud->field_type('author_id', 'hidden', $this->mUser->id);\n\t\t\t$this->unset_crud_fields('status');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$crud->set_relation('author_id', 'admin_users', '{first_name} {last_name}');\n\t\t}\n\n\t\t$this->mPageTitle = 'Blog Posts';\n\t\t$this->render_crud();\n\t}",
"function newPost($post){\n $rval = false;\n $now = strtotime(gmdate(\"M d Y H:i:s\"));\n $sections = ':';\n if(isset($post['frm_sections']) && count($post['frm_sections'])>0) {\n $sections = ':'.implode(\":\", $post['frm_sections']).':';\n }\n $title = $post['frm_post_title'];\n $body = $post['frm_post_body'];\n $posttime = (isset($post['posttime'])) ? $post['posttime'] : $now;\n $modifytime = $posttime;\n $status = $post['frm_post_status'];\n $modifier = $post['frm_modifier'];\n $ownerid = (isset($post['ownerid'])) ? intval($post['ownerid']) : $_SESSION['user_id'];\n $hidefromhome = (isset($post['frm_post_hidefromhome']) && $post['frm_post_hidefromhome'] == 1) ? 1: 0;\n $allowcomments = (isset($post['frm_post_allowcomments']) && $post['frm_post_allowcomments'] == ('allow' or 'disallow' or 'timed')) ? $post['frm_post_allowcomments'] : 'disallow';\n # TODO this needs refactored as everytime the post is edited, the disable date will auto-change (unintended). Make it use a definite date\n $autodisabledate = 'null';\n if(isset($post['disallowcommentsdays']) && in_array($post['disallowcommentsdays'], array(7, 14, 30, 90))){\n \t$inc = $post['disallowcommentsdays'];\n \t$rs['autodisabledate'] = strtotime(\"+$inc days\");\n }\n $sql = 'INSERT INTO `'.T_POSTS.'` VALUES(null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0)';\n $stmt = $this->_db->Prepare($sql);\n $this->_db->debug = true;\n if($this->_db->Execute($stmt, array($title, $body, $posttime, $modifytime, $status, $modifier, $sections, $ownerid, $hidefromhome, $allowcomments, $autodisabledate )) !== false){\n\t\t\t$rval = intval($this->_db->insert_id());\n if(isset($post['send_trackback']) && $post['send_trackback'] == true){\n \tinclude_once(LOQ_APP_ROOT.'includes/trackbackhandler.class.php');\n \t$tb = new trackbackhandler($this->_db);\n \t$tb->send_trackback('', $post['title'], $post['excerpt'], $post['tburl']);\n }\n }\n else{\n $this->_last_error = $this->_db->ErrorMsg();\n }\n return $rval;\n //return $this->modifyPost($post, 'INSERT');\n }",
"function new_post($post){\n $this->newPost($post);\n }",
"public function createPost(PostsFormRequest $request, $image){\n\n $post = $this->dispatcher->dispatch(\n new CreatePostCommand(\n $request->title,\n $request->preamble,\n $request->body,\n $request->tags_list,\n $request->published_at,\n $request->localed = Lang::locale()\n ));\n\n $this->bindImage($image, $post);\n\n return $post;\n }",
"private function buildOne($post, $mod = false) {\n\t\t\tglobal $config;\n\n\t\t\topenBoard($post['board']);\n\t\t\t$thread = new Thread($post, $mod ? '?/' : $config['root'], $mod);\n\t\t\t$replies = $this->fetchReplies($post['board'], $post['id']);\n\t\t\t// Number of replies to a thread that are displayed beneath it\n\t\t\t$preview_count = $post['sticky'] ? $config['threads_preview_sticky'] :\n\t\t\t\t$config['threads_preview'];\n\n\t\t\t// Chomp the last few replies\n\t\t\t$disp_replies = array_splice($replies, 0, $preview_count);\n\t\t\t$disp_img_count = 0;\n\t\t\tforeach ($disp_replies as $reply) {\n\t\t\t\tif ($reply['files'] !== '')\n\t\t\t\t\t++$disp_img_count;\n\n\t\t\t\t// Append the reply to the thread as it's being built\n\t\t\t\t$thread->add(new Post($reply, $mod ? '?/' : $config['root'], $mod));\n\t\t\t}\n\n\t\t\t// Count the number of omitted image replies\n\t\t\t$omitted_img_count = count(array_filter($replies, fn($p) => $p['files'] !== ''));\n\n\t\t\t// Set the corresponding omitted numbers on the thread\n\t\t\tif (!empty($replies)) {\n\t\t\t\t$thread->omitted = count($replies);\n\t\t\t\t$thread->omitted_images = $omitted_img_count;\n\t\t\t}\n\n\t\t\t// Board name and link\n\t\t\t$html = '<h2><a href=\"' . $config['root'] . $post['board'] . '/\">/' .\n\t\t\t\t$post['board'] . '/</a></h2>';\n\t\t\t// The thread itself\n\t\t\t$html .= $thread->build(true);\n\n\t\t\treturn $html;\n\t\t}",
"protected function createPost($index, $published = TRUE) {\n $post = new Post();\n $post->title = 'Some title ' . $index;\n $post->slug = 'some_slug_' . $index;\n $post->content = 'Post content ' . $index;\n if ($published) {\n $post->published = TRUE;\n // make it 10 seconds ago because isPublished() scope use '<' for comparison\n $post->published_at = Carbon::createFromTimestamp(time() - 10);\n }\n $post->save();\n return $post;\n }",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"protected function build_post() {\n\t\t\n\t\treturn false;\n\t}",
"public function create(PostRequest $request)\n {\n\n $post = $this->repository->newInstance([]);\n return $this->response->setMetaTitle(trans('app.new') . ' ' . trans('channels::post.name')) \n ->view('channels::post.create', true) \n ->data(compact('post'))\n ->output();\n }",
"public static function createFromRequest($data)\n {\n $post = new self($data);\n $post->published_at = Carbon::parse($data['published_at']);\n $post->user_id = Auth::id();\n if (!$post->short_body) {\n $post->short_body = $post->short();\n }\n $post->save();\n return $post;\n }",
"public function create(array $values = array()) {\n // Add values that are specific to our Post\n $values += array( \n 'post_id' => '',\n 'is_new' => TRUE,\n 'title' => '',\n 'created' => '',\n 'changed' => '',\n 'data' => '',\n );\n \n $post = parent::create($values);\n return $post;\n }",
"public function createPost()\n {\n // create a new post\n $data['title'] = __('posts.add');\n $data['post'] = $this->schema;\n $data['post']['categories'] = CategoryModel::all();\n $data['post']['form'] = config('app.admin_prefix').'/post/store';\n\n return admin_view('Posts::CreateEdit', $data);\n }",
"abstract public function build();",
"abstract public function build();",
"public function run()\n\t{\n\t\tPost::create([\n\t\t\t'title'=>'Fourth post',\n\t\t\t'slug'=>'Fourth -post',\n\t\t\t'excerpt'=>'<strong>Fourth post body</strong>',\n\t\t\t'content'=>'<strong>Content Fourth post body</strong>',\n\t\t\t'published'=>false ,\n\t\t\t'published_at'=>DB::raw('CURRENT_TIMESTAMP')]);\n}"
] |
[
"0.69335407",
"0.6909561",
"0.6692913",
"0.6350082",
"0.6234773",
"0.61780405",
"0.61398906",
"0.61397696",
"0.61397696",
"0.61280835",
"0.6098997",
"0.6078261",
"0.6077518",
"0.60540384",
"0.6041102",
"0.60239565",
"0.60239565",
"0.60239565",
"0.60239565",
"0.60239565",
"0.60239565",
"0.60239565",
"0.59729815",
"0.5948548",
"0.59448266",
"0.5942143",
"0.59382963",
"0.59069425",
"0.59069425",
"0.5905459"
] |
0.7356493
|
0
|
/ // raw SQL Replace with table used by document transaction i.e: t_letter_of_intent, t_purchase_order, etc SELECT m_approval.module_kode, m_approval.role_id, m_approval.urutan, m_approval.opsi, m_approval.deskripsi, m_approval.aktif , t_approval.id, t_approval.data_id, t_approval.deskripsi, t_approval.urutan, t_approval.status , t_approval_prev.id, t_approval_prev.data_id, t_approval_prev.deskripsi, t_approval_prev.urutan, t_approval_prev.status FROM m_approval JOIN t_approval on m_approval_id = m_approval.id JOIN ON .id = t_approval.data_id LEFT JOIN t_approval t_approval_prev ON t_approval_prev.data_id = t_approval.data_id AND t_approval.urutan 1 = t_approval_prev.urutan LEFT JOIN m_approval m_approval_prev ON m_approval_prev.module_kode = m_approval.module_kode AND m_approval_prev.id = t_approval_prev.id WHERE m_approval.module_kode = '::module_kode' AND m_approval.role_id in (18,23,26) AND ( t_approval.status = 0 or t_approval.status = 2 ) AND ( t_approval_prev.status is null or t_approval_prev.status = 1 ) ORDER BY m_approval.module_kode, t_approval.data_id, t_approval.urutan
|
public function toApprove($options = array())
{
$m_approval = 'm_approval';
$t_approval = 't_approval';
$m_approval_prev = "{$m_approval}_prev";
$t_approval_prev = "{$t_approval}_prev";
if (isset($options['limit'])) {
$this->db->limit($options['limit']);
}
if (isset($options['offset'])) {
$this->db->offset($options['offset']);
}
if (isset($options['orderBy'])) {
$this->db->order_by($options['orderBy']);
}
$roles_id = array_values(array_filter(explode(',', $this->session->userdata('ROLES'))));
/* $res = $this->db->from($this->table) */
/* ->join('t_approval', "t_approval.data_id = {$this->table}.id") */
/* ->join('m_approval', "m_approval.id = t_approval.m_approval_id") */
/* ->where('m_approval.module_kode', $this::module_kode) */
/* ->or_group_start() */
/* ->where('t_approval.status', 0) */
/* ->where('t_approval.status', 2) */
/* ->group_end() */
/* //->where('t2.prior_status', 1) */
/* ->where_in('m_approval.role_id', $roles_id) */
/* ->get(); */
$res = $this->db->select(array(
"m_approval.module_kode",
"m_approval.role_id",
"m_approval.urutan",
"m_approval.opsi",
"m_approval.deskripsi",
"m_approval.aktif",
"t_approval.id",
"t_approval.data_id",
"t_approval.deskripsi",
"t_approval.urutan",
"t_approval.status",
"t_approval_prev.id as id_prev",
"t_approval_prev.data_id as data_id_prev",
"t_approval_prev.deskripsi as deskripsi_prev",
"t_approval_prev.urutan as urutan_prev",
"t_approval_prev.status as status_prev",
"{$this->table}.*"
))
->from($m_approval)
->join($t_approval, "$t_approval.m_approval_id = $m_approval.id")
->join($this->table, "{$this->table}.id = $t_approval.data_id")
->join($t_approval." as ".$t_approval_prev, "$t_approval_prev.data_id = $t_approval.data_id"
." AND ($t_approval.urutan - 1) = $t_approval_prev.urutan", 'left', NULL)
->join($m_approval." as ".$m_approval_prev, "$m_approval_prev.module_kode = $m_approval.module_kode"
." AND $m_approval_prev.id = $t_approval_prev.id", 'left')
->where("$m_approval.module_kode", $this::module_kode)
->where_in("$m_approval.role_id", $roles_id)
->group_start()
->where("$t_approval.status", 0)
->or_where("$t_approval.status", 2)
->group_end()
->group_start()
->where("$t_approval_prev.status", NULL, false)
->or_where("$t_approval_prev.status", 1)
->group_end()
->get();
if (isset($options['resource']) && $options['resource'] == true) {
return $res;
}
return $res->result();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function execute($arguments = array(), $options = array())\n {\n $databaseManager = new sfDatabaseManager($this->configuration);\n $connection = $databaseManager->getDatabase($options['connection'])->getConnection();\n\r\n $q = Doctrine_Query::create()\r\n ->select('*')\r\n ->from('Citation c')\r\n ->where('is_active = ?', 1)\r\n ->offset(rand(0, rand(0, 10000)))\r\n ->limit(10)\r\n ->orderBy('created_at desc');\n\n $citation = $q->fetchOne();\n //sfTask::log($citation->quote);die();\n\n\n \t$baseline = array(\n \t\t'« L’education est l’arme la plus puissante pour changer le monde » — Nelson Mandela',\n \t\t'L’éducation de nos enfants est notre priorité : nous nous sommes donnés comme objectif de construire une école',\n \t\t'« Si tu veux aller vite, marche seul ; mais si tu veux aller loin, marchons ensemble » — proverbe africain',\n \t\t'« Un Enfant sans éducation est comme un oiseau sans ailes » — proverbe Tibétain',\n \t\t'Vous pouvez lire et écrire ceci… Pas les enfants de Niellé.',\n \t);\n\r\n $annonce = '<p>Découvrez <a href=\"http://revenudebase.info/?utm_source=citation-ou-proverbe.fr&utm_medium=email&utm_campaign=citation-ou-proverbe.fr\" style=\"color:#000;\">Le Revenu de base</a>, et vous, que feriez-vous si votre revenu était garanti ?</p>';\r\n $annonce = '<p>Accrochez des citations à vos murs avec <a href=\"http://www.wallshop.fr/fr/?pk_campaign=email-citation-ou-proverbe&pk_kwd=email-footer-citation-ou-proverbe\" style=\"color:#000;\">WallShop.fr</a></p>';\r\n\r\n $annonce = '<p>'.$baseline[rand(0, count($baseline)-1)].' <a href=\"http://www.badessatellites.com/?utm_medium=email&utm_campaign=citation-ou-proverbe.fr\">Une École à Niellé</a></p>';\r\n\r\n $message_text = '<a href=\"https://www.citation-ou-proverbe.fr/'.$citation->Author->slug.'/'.$citation->slug.'?pk_campaign=abonnement&pk_kwd=abonnement-citation\" class=\"card-container\" style=\"width: 460px;display: block;text-decoration: none;\">\r\n <blockquote style=\"color: '.$citation->getTextRGBColorHex().';background-color: '.$citation->getRGBColorHex() .';width: 460px;display: table-cell;font-size: 1.8em;height: 8em;line-height: 1.2em;padding: 1em;vertical-align: middle;\">\r\n \t\t\t'. $citation->quote .'</blockquote></a>\r\n <p>Retrouver d\\'autres citations de <a style=\"color:#000;\" href=\"https://www.citation-ou-proverbe.fr/'.$citation->Author->slug.'?pk_campaign=abonnement&pk_kwd=abonnement-auteur\">'. $citation->Author->name.'</a></p>\n '.$annonce.'\n <p>\n\t\t-- <br />\n\t\tL\\'équipe de <a href=\"https://www.citation-ou-proverbe.fr?pk_campaign=abonnement&pk_kwd=abonnement-footer\" style=\"color:#000;\">Citation ou Proverbe</a><br />\n\t\t<a href=\"https://www.citation-ou-proverbe.fr/desabonnement/[encoded_mail]?pk_campaign=abonnement&pk_kwd=abonnement-auteur\">se désabonner</a><br />\n\t\t<a href=\"https://www.citation-ou-proverbe.fr/proposer-citation?pk_campaign=abonnement&pk_kwd=abonnement-auteur\">proposer une citation</a>\n\t\t</p>';\r\n\n\r\n $q = Doctrine::getTable('Newsletter')\r\n ->createQuery('a')\r\n ->where('is_confirmed = ?', 1)\r\n ->andWhere('hour(TIMEDIFF(now(), last_send_at)) > ?', 36)\r\n ->limit(35)\r\n ->orderBy('last_send_at ASC');\r\n// die($q->getSqlQuery());\r\n $newsletters = $q->execute();\n\n\n foreach ($newsletters as $newsletter) {\n\n $personalized_message = str_replace('[encoded_mail]', base64_encode($newsletter->getEmail()), $message_text);\n\n\t \t$message = $this->getMailer()->compose(\n\t sfConfig::get('app_newsletter_mail_from'),\n\t $newsletter->getEmail(),\n\t 'citation du jour',\n\t \t $personalized_message\n\t );\n $message->setContentType(\"text/html\");\n $message->setContentType(\"text/html\");\n if ($this->getMailer()->send($message)) {\n \t\tsfTask::log(' -> ok');\n\t \t$newsletter->last_send_at = new Doctrine_Expression('NOW()');\n\t \t$newsletter->save();\n } else {\n \t\tsfTask::log(' -> #failed');\n }\n\n }\n sfTask::log('send '.$citation->id.' at '.date('r').' to '.count($newsletters).' mails');\n }",
"public function change()\n {\n $query = <<<'EOD'\n \ndrop FUNCTION paging_dbnamespace_column_prop_ext(text);\ndrop FUNCTION paging_dbnamespace_column_prop_ext(text,boolean);\ndrop FUNCTION paging_dbnamespace_column_prop_save(jsonb,text);\ndrop FUNCTION paging_table_cond(jsonb);\n\ncreate or replace function paging_objectdb(a_js jsonb) returns SETOF jsonb\nLANGUAGE plpgsql\nAS $$\nDECLARE\n val_timestart TIMESTAMP = clock_timestamp();\n\n val_draw INTEGER = coalesce(($1 ->> 'draw') :: INTEGER, 0 :: INTEGER);\n val_table TEXT;\n\n val_order TEXT = (SELECT 'order by ' || string_agg((r ->> 'column') || ' ' || (r ->> 'dir'), ',')\n FROM (\n SELECT jsonb_array_elements(a_js -> 'order') AS r\n ) AS r);\n val_offlim TEXT = ' limit ' || COALESCE($1 ->> 'length', '0') || ' offset ' ||\n COALESCE($1 ->> 'start', '0');\n val_condition TEXT ;\n\n val_query TEXT;\n val_result JSONB = '{}';\n val_query_result_jsonb JSONB = '{}';\n val_query_result_integer INTEGER;\n val_debug JSONB = '[]';\n val_mat_mode BOOLEAN;\n val_m_count_total INTEGER;\n val_m_columns TEXT;\n val_condition_arg JSONB = a_js -> 'columns';\n val_paging boolean;\nBEGIN\n\n SELECT\n p.m_column,\n ptm.m_count,\n is_materialize,\n p.name,\n is_paging_full\n FROM paging_table AS p\n left JOIN paging_table_materialize_info AS ptm ON ptm.id = p.last_paging_table_materialize_info_id\n WHERE p.name = $1 ->> 'objdb'\n INTO val_m_columns, val_m_count_total, val_mat_mode, val_table,val_paging;\n\n IF (val_condition_arg IS NOT NULL)\n THEN\n WITH getcolumns AS\n (\n SELECT jsonb_array_elements(val_condition_arg) AS r\n ), normalize AS\n (\n SELECT\n r ->> 'col' AS f_data,\n r ->> 'fc' AS f_cd,\n r ->> 'fv' AS f_value,\n r ->> 'ft' AS f_type\n FROM getcolumns AS t\n )\n SELECT ' where ' || string_agg(CASE WHEN (f_type ~ 'timestamp|date')\n THEN concat_ws(' ',\n f_data,\n f_cd,\n quote_literal(split_part(f_value, ' - ', 1)),\n 'and',\n quote_literal(split_part(f_value, ' - ', 2)))\n WHEN (f_cd = 'in' AND f_type ~ 'int')\n THEN concat_ws(' ',\n f_data,\n f_cd,\n '(' || f_value) || ')'\n WHEN (f_cd = 'in')\n THEN concat_ws(' ',\n f_data,\n f_cd,\n '(' || (SELECT string_agg(quote_literal(r), ',')\n FROM regexp_split_to_table(f_value, ',') AS r)) || ')'\n ELSE concat_ws(' ',\n f_data,\n f_cd,\n quote_literal(f_value)) END, ' and ')\n FROM normalize AS n\n INTO val_condition;\n END IF;\n\n -- if materialize\n val_table = CASE WHEN val_mat_mode\n THEN replace(val_table, 'vw', 'mv')\n ELSE val_table END;\n\n SELECT concat_ws(' ', 'WITH objdb as (',\n 'select', val_m_columns,\n 'FROM', val_table,\n val_condition, val_order, val_offlim\n , ')', 'SELECT ', 'json_agg(row_to_json(objdb)) from objdb')\n INTO val_query;\n\n EXECUTE val_query\n INTO val_query_result_jsonb;\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('data',val_query, 'time', round(\n (EXTRACT(SECOND FROM clock_timestamp()) - EXTRACT(SECOND FROM val_timestart)) :: NUMERIC, 4)));\n val_result = val_result || jsonb_build_object('data', coalesce(val_query_result_jsonb,'[]'));\n\n val_timestart = clock_timestamp();\n\n\n IF (val_mat_mode IS TRUE\n AND val_condition IS NULL\n AND val_m_count_total IS NOT NULL)\n THEN\n val_query = concat_ws(' ', 'select count(*)', 'from', val_table);\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsFiltered', null, 'time',null));\n val_result = val_result || jsonb_build_object('recordsFiltered', val_m_count_total);\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsTotal', null, 'time',null));\n val_result = val_result || jsonb_build_object('recordsTotal', val_m_count_total);\n\n ELSEIF (val_condition IS NOT NULL\n AND val_m_count_total IS NOT NULL)\n THEN\n val_query = concat_ws(' ', 'select count(*)', 'from', val_table, val_condition);\n\n EXECUTE val_query\n INTO val_query_result_integer;\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsFiltered', val_query, 'time', round(\n (EXTRACT(SECOND FROM clock_timestamp()) - EXTRACT(SECOND FROM val_timestart)) :: NUMERIC, 4)));\n val_result = val_result || jsonb_build_object('recordsFiltered', val_query_result_integer);\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsTotal', null, 'time',null));\n val_result = val_result || jsonb_build_object('recordsTotal', val_m_count_total);\n ELSEIF (val_condition is not null AND\n val_m_count_total IS NOT NULL)\n THEN\n RAISE EXCEPTION 'asd';\n val_query = concat_ws(' ', 'select count(*)', 'from', val_table, val_condition);\n\n EXECUTE val_query\n INTO val_query_result_integer;\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsFiltered', val_query, 'time', round(\n (EXTRACT(SECOND FROM clock_timestamp()) - EXTRACT(SECOND FROM val_timestart)) :: NUMERIC, 4)));\n val_result = val_result || jsonb_build_object('recordsFiltered', val_query_result_integer);\n\n\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsTotal',val_query_result_integer, 'time',null));\n val_result = val_result || jsonb_build_object('recordsTotal', val_m_count_total);\n\n ELSEif (val_condition is null)\n then\n\n val_query = concat_ws(' ', 'select count(*)', 'from', val_table);\n\n val_timestart = clock_timestamp();\n\n EXECUTE val_query\n INTO val_query_result_integer;\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsFiltered', null, 'time',null));\n val_result = val_result || jsonb_build_object('recordsFiltered', val_query_result_integer);\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsTotal', val_query, 'time', round(\n (EXTRACT(SECOND FROM clock_timestamp()) - EXTRACT(SECOND FROM val_timestart)) :: NUMERIC, 4)));\n val_result = val_result || jsonb_build_object('recordsTotal', val_query_result_integer);\n else\n val_query = concat_ws(' ', 'select count(*)', 'from', val_table, val_condition);\n\n EXECUTE val_query\n INTO val_query_result_integer;\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsFiltered', val_query, 'time', round(\n (EXTRACT(SECOND FROM clock_timestamp()) - EXTRACT(SECOND FROM val_timestart)) :: NUMERIC, 4)));\n val_result = val_result || jsonb_build_object('recordsFiltered', val_query_result_integer);\n\n val_query = concat_ws(' ', 'select count(*)', 'from', val_table);\n\n val_timestart = clock_timestamp();\n\n EXECUTE val_query\n INTO val_query_result_integer;\n\n val_debug = val_debug || jsonb_build_array(jsonb_build_object('recordsTotal', val_query, 'time', round(\n (EXTRACT(SECOND FROM clock_timestamp()) - EXTRACT(SECOND FROM val_timestart)) :: NUMERIC, 4)));\n val_result = val_result || jsonb_build_object('recordsTotal', val_query_result_integer);\n END IF;\n\n RETURN QUERY\n SELECT val_result || jsonb_build_object('debug', val_debug);\n\nEND;\n$$;\n\nupdate paging_table\nset last_paging_table_materialize_info_id = null\nwhere id in\n (select p.id\nfrom paging_table as p\nLEFT JOIN paging_table_materialize_info as pp on p.last_paging_table_materialize_info_id = pp.id\nwhere is_materialize is false);\n\nEOD;\n $this->execute($query);\n }",
"function get_sql_for_view_transactions($filtertype, $from, $to, &$trans_ref)\n{\n\t$db_info = get_systype_db_info($filtertype);\n\n\tif ($db_info == null)\n\t\treturn \"\";\n\n\t$table_name = $db_info[0];\n\t$type_name = $db_info[1];\n\t$trans_no_name = $db_info[2];\n\t$trans_ref = $db_info[3];\n\t$trans_date = $db_info[4];\n\n\t$sql = \"SELECT t.$trans_no_name as trans_no\";\n\n\tif ($trans_ref)\n\t\t$sql .= \" ,t.$trans_ref as ref \";\n\telse\n\t\t$sql .= \", r.reference as ref\";\n \t$sql .= \",t.$trans_date as trans_date\";\n \tif ($type_name)\n\t\t$sql .= \", t.$type_name as type\";\n\t$sql .= \" FROM $table_name t LEFT JOIN \".TB_PREF.\"voided v ON\"\n\t\t.\" t.$trans_no_name=v.id AND v.type=$filtertype\";\n\tif (!$trans_ref)\n\t\t$sql .= \" LEFT JOIN \".TB_PREF.\"refs r ON t.$trans_no_name=r.id AND r.type=$filtertype\";\n\n\t$sql .= \" WHERE ISNULL(v.`memo_`)\";\n\tif ($from != null && $to != null)\n\t{\n\t\t$sql .= \" AND t.$trans_no_name >= \".db_escape($from). \"\n\t\t\tAND t.$trans_no_name <= \".db_escape($to);\n\t\tif ($type_name != null)\n\t\t\t$sql .= \" AND t.`$type_name` = \".db_escape($filtertype);\n\t}\n\telseif ($type_name != null)\n\t\t$sql .= \" AND t.`$type_name` = \".db_escape($filtertype);\n\n\t// the ugly hack below is necessary to exclude old gl_trans records lasting after edition,\n\t// otherwise old data transaction can be retrieved instead of current one.\n\tif ($table_name==TB_PREF.'gl_trans')\n\t\t$sql .= \" AND t.`amount` <> 0\";\n\n\t$sql .= \" GROUP BY \".($type_name ? \"t.$type_name,\" : '').\" t.$trans_no_name\";\n\t$sql .= \" ORDER BY t.$trans_no_name DESC\";\n\treturn $sql;\n}",
"public function f_get_confirmation_tableData()\n {\n\n $sql = $this->db->query(\" SELECT a.trans_id, a.trans_dt, a.order_no, a.sdo_memo, a.bdo_memo, a.pb_no, a.bill_no as sb_no, a.bill_dt as sb_dt,\n b.order_dt, c.bill_dt as pb_dt FROM td_dm_sale a, td_dm_work_order b, td_dm_delivery c\n WHERE a.order_no = b.order_no\n AND a.dist_cd = b.dist_cd\n AND a.order_no = c.order_no\n AND a.sdo_memo = c.sdo_memo\n AND a.dist_cd = c.dist_cd\n AND a.point_no = c.point_no\n AND a.challan_from = c.challan_from\n AND a.challan_to = c.challan_to\n AND a.pb_no = c.bill_no\n AND a.cnf_status = 0 \");\n return $sql->result();\n\n }",
"function head() {\n global $_lib;\n\n $query = \"select max(RemittanceDaySequence) from invoicein where RemittanceSendtDateTime='\" . $_lib['sess']->get_session('Date') . \"' and Active=1\";\n #print \"Finn h¿yeste dag sekvens: $query\";\n $daysequence = $_lib['storage']->get_row(array('query' => $query));\n\n $query = \"select max(RemittanceSequence) from invoicein where Active=1\";\n #print \"Finn h¿yeste sekvens: $query\";\n $sequence = $_lib['storage']->get_row(array('query' => $query));\n \n #print \"<h2>Her kommer remitteringsfila på TelePay 2.0.1 formatet</h2>\";\n $transaction = new stdClass();\n $this->transaction->RemittanceSequence = $daysequence->RemittanceSequence + 1; #M kalkuleres og settes\n $this->transaction->RemittanceDaySequence = $daysequence->RemittanceDaySequence; #M kalkuleres og settes\n\n #$this->transaction->BatchID = 99; #M kalkuleres og settes\n $this->transaction->Date = $_lib['sess']->get_session('Date');\n $this->transaction->Datetime = $_lib['sess']->get_session('Datetime');\n $this->transaction->VersionSoftware = '00001.00 LODO';\n \n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $this->transaction->CustomerOrgNumber = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber'))); \n $this->transaction->CustomerName = $_lib['sess']->get_companydef('CompanyName');\n $this->transaction->Database = $_SETUP['DB_NAME']['0'];\n \n $this->transaction->NumTransactions = 0;\n $this->transaction->TotalAmount = 0;\n $this->transaction->NumRecords = 0; \n\n if(!$InvoiceO->CustomerBankAccount) { #Sjekke lengde og modulus p kontonummer ogs\n $_lib['message']->Add(\"Betalerkonto mangler\");\n return;\n }\n if(!$this->transaction->CustomerOrgNumber) {\n $_lib['message']->Add(\"Orgnummer/personnummer mangler på betaler\");\n return;\n }\n }",
"function XSAInvoicing_ANT32($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db,$nivelfacturacion=2,$descripcionOT='',$OT=''){\n\t// **************************** //\n\t// No dejar echo en la funcion //\n\t// Afecta al punto de venta //\n\t// **************************** //\n\n $debug_sql = false;\n\t$charelectronic='01';\n\t$charelectronicEmbarque='';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n $pedimento=\"\";\n\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n $folioelect=\"\";//$folio;//$InvoiceNoTAG;\n if ($TypeInvoice == 66) {\n \t$folioelect = $folio;\n }\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t$charelectronictaxsfederal='';\n\t$charelectronictaxslocal='';\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$rfccliente = \"\";\n\t$TipoAgrupacionXTag = \"\";\n $branch= \"\";\n \n\tif ($TypeInvoice==11){\n\t\t$tabla='notesorders';\n\t}else{\n\t\t$tabla='salesorders';\n\t}\n\t\n\t$decimalplaces=6;\n\t\n\tif ($_SESSION['DecimalPlacesInvoice']==''){\n\t\t$_SESSION['DecimalPlacesInvoice']=6;\n\t}\n\t$decimalplaces=$_SESSION['DecimalPlacesInvoice'];\n\t\n\t$SQLInvoice = \"SELECT replace(debtortrans.trandate,'-','/') as trandate,debtortrans.ovamount,debtortrans.ovdiscount,\n\t\t\tdebtortrans.ovfreight,debtortrans.ovgst,debtortrans.rate as cambio,\n\t\t\tdebtortrans.order_,debtortrans.invtext,\tdebtortrans.consignment,\n\t\t\tdebtortrans.id AS iddocto, debtortrans.type,\n\t\t\tdebtorsmaster.name,debtorsmaster.address1,debtorsmaster.address2,\n\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\tcustbranch.taxid as rfc,paymentterms.terms,salesorders.deliverto,\n\t\t\tsalesorders.deladd1,salesorders.deladd2,salesorders.deladd3,\n\t\t\tsalesorders.deladd4,salesorders.deladd5,salesorders.deladd6,\n\t\t\tsalesorders.customerref,salesorders.orderno,salesorders.orddate,\n\t\t\tlocations.locationname,\tshippers.shippername,custbranch.brname,\n\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\tsalesman.salesmanname,debtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\treplace(origtrandate,'-','/') as origtrandate,debtortrans.currcode,custbranch.branchcode,\n\t\t\tsalesorders.salesman,salesorders.UserRegister,custbranch.phoneno as telofi,\n\t\t\tsalesorders.placa, salesorders.serie,salesorders.kilometraje,salesorders.comments,debtortrans.ref1,\n\t\t\tsalesorders.ordertype,debtortrans.paymentname,debtortrans.nocuenta,\n\t\t\tcustbranch.brnumext, custbranch.brnumint,custbranch.specialinstructions,\n\t\t\ttags.typegroup,debtortrans.id, custbranch.custpais, IFNULL(paymentmethods.codesat,'') as codesat,\n\t\t\tdebtortrans.codesat as cadenacodesat, debtortrans.order_\n\t\tFROM debtortrans\n\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\tleft join shippers on debtortrans.shipvia=shippers.shipper_id \n\t\t\tjoin tags on tags.tagref=debtortrans.tagref,\n\t\t\tdebtorsmaster,custbranch,\".$tabla.\" as salesorders \n\t\t\tleft join locations on salesorders.fromstkloc=locations.loccode ,\n\t\t\tsalesman,paymentterms \n\n\t\tWHERE debtortrans.order_ = salesorders.orderno\n\t\t\tAND debtortrans.type='\".$TypeInvoice.\"'\n\t\t\tAND debtortrans.transno='\" . $InvoiceNo . \"'\n\t\t\tAND debtortrans.tagref='\" . $tag . \"'\n\t\t\tAND debtortrans.debtorno=debtorsmaster.debtorno\n\t\t\tAND salesorders.paytermsindicator=paymentterms.termsindicator\n\t\t\tAND debtortrans.debtorno=custbranch.debtorno\n\t\t\tAND debtortrans.branchcode=custbranch.branchcode\n\t\t\tAND salesorders.salesman=salesman.salesmancode\";\n\t\n if($_SESSION['UserID'] == \"admin\"){\n //echo '<pre>get > 1 :<br>'.$SQLInvoice.'<br>';\n\t}\n\t//echo '<pre>get > 1 :<br>'.$SQLInvoice.'<br>';\n\t//echo '<pre>get > 1 :<br>'.$SQLInvoice.'<br>';\n\t//echo '<pre>SQL Principal: <br>'.$SQLInvoice;\n\n //debug_sql($SQLInvoice, __LINE__,true,__FILE__);\n\t$Result=DB_query($SQLInvoice,$db);\n\t\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t//impuestos federales\n\t\t$totretencionfederal=0;\n\t\t//$charelectronictaxslocal='|'.chr(13).chr(10);\n\t\tif(isset($_SESSION['ordenaimpuestos']) AND $_SESSION['ordenaimpuestos']==1 ){\n $qry = \"Select debtortranstaxesclient.*,sec_taxes.nametax, sec_taxes.flagimpuestolocal \n \t\tfrom debtortranstaxesclient, sec_taxes\n\t\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\t\t\tAND sec_taxes.typetax=1 and orden!=0\n\t\t\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id']. \" ORDER BY orden ASC\";\n\t\t}else{\n $qry = \"Select debtortranstaxesclient.*,sec_taxes.nametax, sec_taxes.flagimpuestolocal \n \t\tfrom debtortranstaxesclient, sec_taxes\n\t\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\t\t\tAND sec_taxes.typetax=1\n\t\t\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\t}\n \n debug_sql($qry, __LINE__,$debug_sql,__FILE__);\n\t\t$rs = DB_query($qry,$db);//\n\t\t$totalImpuestosLocales=0;\n\t\tif (DB_num_rows($rs) > 0){\n\t\t\t//$charelectronictaxsfederalini='|'.chr(13).chr(10).'06';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n if($regs['flagimpuestolocal']==0){\n $charelectronictaxsfederal.='|'.chr(13).chr(10).'06'.\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'].\"|\".$regs['flagimpuestolocal'];\n\t\t\t\t$totretencionfederal=$totretencionfederal+$regs['amount'];\n }\n if($regs['flagimpuestolocal']==1){\n $charelectronictaxsfederal.='|'.chr(13).chr(10).'08'.\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'].\"|\".$regs['flagimpuestolocal'];\n\t\t\t\t$totretencionfederal=$totretencionfederal+$regs['amount'];\n }\n\t\t\t}\n\t\t}\n\n\t\t//impuestos locales\n\t\t$totalretencionlocal=0;\n\t\t//$charelectronictaxslocal='|'.chr(13).chr(10);\n\t\t$qry = \"Select debtortranstaxesclient.*,sec_taxes.nametax from debtortranstaxesclient, sec_taxes\n\t\t\t\twhere debtortranstaxesclient.idtax = sec_taxes.idtax\n\t\t\t\tAND sec_taxes.typetax=2\n\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\tdebug_sql($qry, __LINE__,$debug_sql,__FILE__);\n\t\t$rs = DB_query($qry,$db);\n\t\t$totalImpuestosLocales=0;\n\t\tif (DB_num_rows($rs) > 0){\n\t\t\t$charelectronictaxslocal='08';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n\t\t\t\t$charelectronictaxslocal.=\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'];\n\t\t\t\t$totalretencionlocal=$totalretencionlocal+$regs['amount'];\n\t\t\t}\n\t\t\t$charelectronictaxslocal.=chr(13).chr(10);\n\t\t}\n\n\t\t$totalretencion=$totretencionfederal+$totalretencionlocal;\n\t\t//Tipo agrupacion\n\t\t$TipoAgrupacionXTag=$myrow['typegroup'];\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\n\t\t/********\n\t\t$metodoPago = $myrow['paymentname'];\n\t\tif ($metodoPago==\"\")\n\t\t\t$metodoPago = \"No Identificado\";\n\t\t*/\n\t\t\n\t\t$metodoPago = \"\";\n\n\t\tif (trim($myrow['cadenacodesat'] != \"\")) {\n\t\t\t$metodoPago = $myrow['cadenacodesat'];\n\t\t}else{\n\t\t\t$metodoPago = $myrow['codesat'];\n\t\t\n\t\t\tif($metodoPago == \"\") {\n\t\t\t\t$metodoPago = \"99\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\")\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= number_format($myrow['ovamount'], $decimalplaces, '.', '');\n\t\t\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], $decimalplaces, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], $decimalplaces, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$decimalplacesuno=6;\n\t\tif($TypeInvoice==66 or $TypeInvoice==10 or $TypeInvoice==110){\n\t\t\t$decimalplacesuno=4;\n\t\t}\n\t\t$total= number_format($myrow['ovamount']+$myrow['ovgst']+$totalretencion,$decimalplaces,'.','');\n $total= number_format(round($myrow['ovamount'],2) + round($myrow['ovgst'],2) + round($totalretencion, 2), $decimalplaces, '.', '');\n\t\t\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=number_format($myrow['ovgst'],$decimalplaces,'.','');\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\" OR $_SESSION['DesgloseIVA']==1){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n debug_sql($sqldiscount, __LINE__,$debug_sql,__FILE__);\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],$decimalplaces,'.','');\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n debug_sql($sqldiscount, __LINE__,$debug_sql,__FILE__);\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\t\n\t\t}\n\n\t\t$descuento=number_format($descuento,$decimalplaces,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=($myrow['ovamount']+$myrow['ovgst'])+$totalretencion;\n\t\t/*$decimalplacesuno=4;\n\t\tif($totaletras<0 and ($TypeInvoice==66 or $TypeInvoice==10 or $TypeInvoice==110)){\n\t\t\t$decimalplacesuno=2;\n\t\t}\n\t\t//$totalx=str_replace(',','',number_format($totaletras,$decimalplacesuno,'.',''));\n\t\t//$totalx = str_replace(',','',$total);\n\t\t$separa2=explode(\".\",$totalx,4);\n\t\t//$separa=explode(\".\",$totalx);//////\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\",number_format($totalx2,$decimalplacesuno));\n\t\t\n\t\tif($totaletras<0 and ($TypeInvoice==66 or $TypeInvoice==10 or $TypeInvoice==110)){\n\t\t\t$montoctvs2=\"0.00\";\n\t\t}else{\n\t\t\t$montoctvs2 = $separa2[1];\n\t\t}\n\t\t\n\t\t//$montoletra = Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=$montoctvs2;\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;*/\n\t\t$totalx=str_replace(',','',$total);\n\t\t\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t//\n\t\t//$separa2=explode(\".\",$totalx);//\n if(isset($_SESSION['DecimalPlacesLetra']) and $_SESSION['DecimalPlacesLetra'] <> \"\"){\n $montoctvs2 = substr($separa[1], 0,$_SESSION['DecimalPlacesLetra']);\n }else{\n $montoctvs2 = substr($separa[1], 0,6);\n }\n\t\t\n\t\t//$montoctvs2 = $separa[1];//\n \n\t\t$montoletra = Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t}elseif ($moneda=='EUR'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Euros \". $montoctvs2 .\" /100 EUR\";\n\t\t}else{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=number_format((1/$myrow['cambio']),$decimalplaces,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription,t.legalid\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n // $legal = DB_fetch_array($Result);\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t// observaciones 3\n\t\t$comments=$comments.' Cuenta de Referencia: '.$myrow['ref1'];\n\t\t$observaciones3='Id Factura:'.$InvoiceNo. '. La tenencia de esta factura no acredita su pago si no se justifica con el comprobante respectivo. '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\t\t// informacionExtra\n\t\t$infoextra=\"\";\n\t\t$numpago=0;\n\t\t$cadenapagares=\"\";\n\t\tif ($TypeInvoice==11){\n\t\t\t$tipodoc=0;\n\t\t}else{\n\t\t\t$tipodoc=70;\n\t\t}\n\t\t\n\t\t$SQL=\" SELECT trandate,case when ovamount<0 then (ovamount+ovgst)*-1 else ovamount+ovgst end as monto\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=\".$tipodoc.\"\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)>0) {\n\t\t\twhile ($myrowpagos=DB_fetch_array($Result)){\n\t\t\t\t$numpago=$numpago+1;\n\t\t\t\t$fechapago=ConvertSQLDate($myrowpagos['trandate']);\n\t\t\t\t$montopago=$myrowpagos['monto'];\n\t\t\t\t$montopago=number_format($montopago,$decimalplaces,'.','');\n\t\t\t\t$cadenapagares=$cadenapagares.\" No:\".$numpago.\" Fecha: \".$fechapago.\" Monto: \".$montopago .' '.$moneda;\n\t\t\t}\n\t\t}\n\t\t$placa= $_SESSION['LabelText1'].' : '.$myrow['placa'];\n\t\t$serie=$_SESSION['LabelText3'].' : '.$myrow['serie'];\n\t\t$kilometraje=$_SESSION['LabelText2'].' : '.$myrow['kilometraje'];\n\t\t$comments1=' Extra: '.$myrow['comments'];\n\t\t$infoextra=$placa.' '.$serie.' '.$kilometraje.' '.$comments1.' Pagares: '. $cadenapagares;\n\n\n\t\t$charelectronic=$charelectronic.'|'.$infoextra;\n\n\t\t//cometarios nivel factura\n\t\t$charelectronic=$charelectronic.'|'.$myrow['invtext'];\n\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT count(*) as pagares\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$myrowpag = DB_fetch_array($Result);\n\t\t\t$numpagares=intval($myrowpag['pagares']);\n\t\t\tif ($numpagares<=1){\n\t\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t\t}else{\n\t\t\t\t$Tipopago=\"Parcialidades\";\n\t\t\t}\n\t\t}\n\t\tif ($TypeInvoice==11){\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}\n\t\t\n\t\t$Tipopago=$Tipopago;//.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|'.$terminospago;\n\t\t// metodo de pago\n\t\t$metodopago=$metodoPago;\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4 (no de cuenta)\n\t\t$observaciones4=$nocuenta;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\t// if (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t// $pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))); //\"Mexico\";//$myrow['name'];\n\t\t//\t\t}else{\n\t\t// $pais=\"Mexico\";\n\t\t//\t\t}\n \n $pais= $myrow[\"custpais\"];\n if (empty($myrow[\"custpais\"])){\n $pais= \"Mexico\";\n } \n \n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$referenciacalle=$myrow['telofi'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t//\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t//\t\t}else{\n\t\t//\t\t\t$pais=\"Mexico\";\n\t\t//\t\t}\n \n $pais= $myrow[\"custpais\"];\n if (empty($myrow[\"custpais\"])){\n $pais= \"Mexico\";\n } \n \n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\n\t\t//$colonia=$myrow['braddress6'];\n $colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t\n\t\t\n\t\t$charelectronicEmbarque='|'.chr(13).chr(10).'09';\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['specialinstructions'];\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr1'];//calle\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//noext\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//no int\n\t\t\n\t\t/*charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr2'];//colonia\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//municipio\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//cp\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr5'];//estado\n\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//pais*/\n \n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//colonia\n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr2'];//municipio\n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//cp\n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//estado\n //$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['custpais'];//pais\n \n if (!empty($myrow['brpostaddr7'])){\n $charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n } else {\n $charelectronicEmbarque=$charelectronicEmbarque.'|0';\n }\n\t}\n\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n debug_sql($descripcionOT, __LINE__,false,__FILE__,'blue');\n debug_sql($nivelfacturacion, __LINE__,false,__FILE__,'blue');\n debug_sql($OT, __LINE__,false,__FILE__,'blue');\n\n\n // validar si existen las tablas de activos\n $consulta_col= \"SHOW TABLES LIKE '%leasingCharges%'\";\n $resultado_col= DB_query($consulta_col, $db);\n $cols_activo= \"\";\n $joins_activo= \"\";\n $usaactivos= false;\n \n if (DB_fetch_array($resultado_col)){\n $usaactivos= true;\n $cols_activo= \", leasingCharges.barcode,\n \t\t\t\tleasingCharges.serialno,\n fixedassets.description AS desc_activo,\n CASE WHEN leasingCharges.hours IS NULL OR leasingCharges.hours= 0 THEN leasingCharges.days ELSE leasingCharges.hours END cantidad_activo,\n CASE WHEN leasingCharges.hours IS NULL OR leasingCharges.hours= 0 THEN 'Dias' ELSE 'Horas' END unidad_activo\";\n \n $joins_activo= \" LEFT JOIN leasingCharges ON stockmoves.ref2 = leasingCharges.idleasincharges \n LEFT JOIN fixedassets ON leasingCharges.serialno = fixedassets.serialno AND leasingCharges.barcode= fixedassets.barcode \";\n }\n \n\tif ($rfccliente!=\"XAXX010101000\" OR $_SESSION['DesgloseIVA']==1){\n\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\t-- stockmoves.stockid,\n\t\t\t\t\t ProdLine.prodLineId as stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\t-- stockmaster.description,\n\t\t\t\t\t\tProdLine.Description as description,\n\t\t\t\t\t\t/*stockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,*/\n\t\t\t\t\t\t0 as serialised,\n\t\t\t\t\t\t0 as controlled,\n\t\t\t\t\t\tsum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV,\n\t\t\t\t\tsum(stockmoves.totaldescuento) as totaldescuento,\n\t\t\t\t\tstockmoves.ref4 as movorderline,\n\t\t\t\t\tstockmaster.flagadvance,\n\t\t\t\t\tstockmoves.ref2 ' . $cols_activo . '\n\t\t\t\tFROM stockmoves ' . $joins_activo . ',stockmaster,stockcategory \n\t\t\t\t\t \tINNER JOIN ProdLine ON ProdLine.prodLineId=stockcategory.prodLineId\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\tGROUP BY ProdLine.Description,ProdLine.prodLineId';\n\t\t}else{//\n\t\t\t// echo '<br>START<br>';\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.longdescription,\n\t\t\t\t\t\tstockmaster.mbflag,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV,\n\t\t\t\t\t\tstockmoves.totaldescuento,\n\t\t\t\t\t\tstockmaster.flagadvance,\n\t\t\t\t\t\tstockmoves.ref4 as movorderline, stockmoves.ref2 ' . $cols_activo . '\n\t\t\t\tFROM stockmoves' . $joins_activo . ',stockmaster,stockcategory\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND (stockmoves.show_on_inv_crds=1 or stockmoves.stockid =\"facturaremision\")\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t}\n\t\t\n\t\tdebug_sql($sqldetails, __LINE__,$debug_sql,__FILE__);\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";////\n\t\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid = \"\";\n\t\t\t$stockcantidad = 0;\n\t\t\t$stockcantidadCompleta = 0;\n\t\t\t$stocknegativo = 0; //obtener si es negativo para precio\n $movorderlineno = $myrow2['movorderline'];\n if ($usaactivos && !empty($myrow2['ref2'])){\n \t$stockid = $myrow2['barcode']; \n \t$stockcantidad=number_format($myrow2['cantidad_activo'],$decimalplaces,'.','');\n }else{\n \t$stockid = $myrow2['stockid']; \n \t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n \t$stockcantidadCompleta = $myrow2['quantity'];\n }\n if ($stockcantidad < 0) {\n \t//Cantidad en negativo\n \t$stocknegativo = 1;\n }\n\t\t\tif($_SESSION['DescrLargaFact'] == $myrow2['mbflag']){\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'].' '.$myrow2['longdescription'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow2['longdescription'].' ';\n\t\t\t}else{\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' ';\n\t\t\t}\n\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t$stockdescrip=$myrow2['desc_activo'];\n\t\t\t}\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t//$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t\n\t\t\t/*if ($_SESSION['UserID'] == 'desarrollo' or $_SESSION['UserID'] == 'iortiz') {\n\t\t\t\t$stockcantidad = abs($stockcantidad);\n\t\t\t}*/\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.abs($stockcantidad); //Cantidad como este en DB + o -\n\t\t\t\n\t\t\tif($TypeInvoice == 111){\n\t\t\t\t\n\t\t\t\t$SQL=\"SELECT chartmaster.accountcode,\n\t\t\t\t\t\t\tchartmaster.accountname\n\t\t\t\t\tFROM gltrans\n\t\t\t\t\t\tINNER JOIN chartmaster \tON gltrans.account = chartmaster.accountcode\n\t\t\t\t\tWHERE gltrans.type = '\".$TypeInvoice.\"'\n\t\t\t\t\t\tAND gltrans.typeno = '\".$InvoiceNo.\"'\n\t\t\t\t\t\tAND gltrans.stockid = '\".$stockid.\"'\n\t\t\t\t\t\tAND gltrans.amount > 0\";\n\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t$Result= DB_query($SQL,$db);\n\t\t\t\tif (DB_num_rows($Result)==1) {\n\t\t\t\t\t$myrowcuentas = DB_fetch_array($Result);\n\t\t\t\t\t$cuenta = \" Cuenta \".$myrowcuentas['accountcode'].\" \".$myrowcuentas['accountname'];\n\t\t\t\t}\n\t\t\t\t$stockdescrip = $stockdescrip.$cuenta;\n\t\t\t}\n\t\t\t\n\t\t\t// valores de los vendedorfees por linea//\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n p.complemento,\n sp.label\n FROM salesstockproperties p,\n stockcatproperties sp,\n stockmaster sm\n WHERE p.stkcatpropid=sp.stkcatpropid\n AND sp.categoryid=sm.categoryid\n AND sp.reqatprint=1\n AND p.orderno=\" . $orderno . \"\n AND p.typedocument IN(10,110, '\" . $TypeInvoice . \"')\n AND sm.stockid='\" . $stockid . \"'\n AND p.orderlineno = '\".$movorderlineno.\"'\";\n \n //echo $sqlpropertyes;\n\t\t\t\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n \n $xt=0; \n \n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t// \t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t// \t\t\t\t$trab=$traba[0];\n\t\t\t\t// \t\t\t\t$trab=$myrowprop['val'];****\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$myrowprop['val'];\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$myrowprop['val'];\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\n\n\t\t\t//Se ha eliminado el trabajador de la descripcion del XML\n\t\t\t//printecho(\"entroant\", \"echo\");\n\n\t\t\t$numberserie=\"\";\n\t\t\t$xserie= 0;\n\n if (strpos(\"@\".$_SESSION ['DatabaseName'], \"gruposervillantas\")) {\n $sqlserials=\"SELECT DISTINCT stockserialitems.serialno AS serie\n\t\t\t\t\t\t\tFROM workorders \n\t\t\t\t\t\t\tINNER JOIN stockserialitems ON workorders.wo= stockserialitems.wo\n\t\t\t\t\t\t\tWHERE orderno= '\".$orderno.\"'\n\t\t\t\t\t\t\tAND stockserialitems.customs= '\".$stockid.\"' \n\t\t\t\t\t\t\tAND qualitytext NOT LIKE '%rechaz%' AND stockserialitems.serialno NOT LIKE 'R-%'\n\t\t\t\t\t\t\tAND stockserialitems.stockid= 'cascli'\";\n\n\t\t\t\t//echo \"series 2: \".$sqlserials;\t\t\n\n\t\t\t\t$resultado= DB_query($sqlserials,$db);\n\t\t\t\t\n\t\t\t\twhile ($myrownseries=DB_fetch_array($resultado)) {\n\t\t\t\t\tif ($stockid!='cascli'){\n\t\t\t\t\t\t$consulta= \"SELECT DISTINCT stockserialitems.serialno AS serie\n\t\t\t\t\t\t\t\t\tFROM workorders \n\t\t\t\t\t\t\t\t\tINNER JOIN stockserialitems ON workorders.wo= stockserialitems.wo\n\t\t\t\t\t\t\t\t\tWHERE orderno= '\".$orderno.\"'\n\t\t\t\t\t\t\t\t\tAND stockserialitems.customs= '\".$stockid.\"'\n\t\t\t\t\t\t\t\t\tAND qualitytext LIKE '%rechaz%' \n\t\t\t\t\t\t\t\t\tAND stockserialitems.serialno LIKE '%\".$myrownseries['serie'].\"%';\";\n\n\t\t\t\t\t\t$resultado2= DB_query($consulta, $db);\n\n\t\t\t\t\t\tif ($registro=DB_fetch_array($resultado2)){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ($xserie==0){\n\t\t\t\t\t\t$numberserie=' Series: '.$myrownseries['serie'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numberserie=$numberserie.', '.$myrownseries['serie'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$xserie++;\n\t\t\t\t}\n } \n\n\t\t\t$descrnarrative=\"\";\n //\n if($_SESSION ['FormatoDeComentarioEnPV']==1){\n \t$descrnarrative=str_replace('\\r','',str_replace('\\n', chr(60).'br'.chr(62),$myrow2['narrative']));\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative); \n\t\t\t\t$descrnarrative=str_replace(chr(10), chr(60).'br'.chr(62), $descrnarrative);\n }else{\n $descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t$descrnarrative=str_replace(chr(10), chr(60).'br'.chr(62), $descrnarrative);\n }\t\t\n\t\t\t/*\n\t\t\tif ($TypeInvoice==11){\n\t\t\t\t$tablades=0;\n\t\t\t}else{\n\t\t\t\t$tipodoc=70;\n\t\t\t}\n\t\t\t*/\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\t\t\t\tFROM salesorderdetails \n\t\t\t\t\t\t\tWHERE salesorderdetails.orderno=\" . $orderno . \"\n\t\t\t\t \t\t\t\tAND salesorderdetails.stkcode='\" . $stockid . \"'\n\t\t\t\t \t\t\t\tAND salesorderdetails.orderlineno = '\" . $movorderlineno . \"'\";\n\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\tif ($myrownarrative['narrative'] != $myrow2['narrative']) {\n\t\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative = \"\";\n\t\t\t}\n\n\t\t\t//$descrnarrative=\"\";\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\t\t\t\n\t\t\t$xserie=0;\n\t\t\t/*$sqlserials=\"SELECT stockserialitems.serialno as serie\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t//echo '<pre><br>'.$sqlserials;\n\t\t\t$Result= DB_query($sqlserials,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$numberserie=\"\";\n\t\t\t}else{\n\t\t\t\twhile ($myrownseries=DB_fetch_array($Result)){\n\t\t\t\t\tif ($xserie==0){\n\t\t\t\t\t\t$numberserie=' Series: '.$myrownseries['serie'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numberserie=$numberserie.', '.$myrownseries['serie'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (strlen($numberserie)==0){\n\t\t\t\t$numberserie=\"\";\n\t\t\t}*/\n\n\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative.$numberserie;\n\t\t\t\t}\n\t\t\t}//while\n\n\t\t\t/******INICIO AGREGA LA DESCRIPCION DE LOS ACTIVOS FIJO FACTURADOS\n\t\t\tif($_SESSION ['DatabaseName'] == \"erpgosea\" or $_SESSION ['DatabaseName'] == \"erpgosea_CAPA\" or $_SESSION ['DatabaseName'] == \"erpgosea_DES\"){\n\t\t\t\t$descfixedassets = \"\";\n\t\t\t\t$sqldescfassets = \"SELECT CONCAT('Cod.:',l.barcode, ' Serie: ', l.serialno, ' ', f.longdescription) as descfixedassets\n\t\t\t\t\tFROM leasingCharges l\n\t\t\t\t\t\tLEFT JOIN fixedassets f ON l.serialno = f.serialno and l.barcode = f.barcode\n\t\t\t\t\tWHERE l.salesordernumber = \" . $orderno;\n\t\t\t\techo \"<br>DESC:\" . $sqldescfassets;\n\t\t\t\t$resultdescfassets = DB_query($sqldescfassets,$db);\n\t\t\t\twhile ($myrowfassets = DB_fetch_array($resultdescfassets)){\n\t\t\t\t\tif ($descfixedassets == \"\"){\n\t\t\t\t\t\t$descfixedassets = $myrowfassets['descfixedassets'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$descfixedassets = $descfixedassets . \"<br>\" . $myrowfassets['descfixedassets'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tif ($descfixedassets != \"\"){\n\t\t\t\t\t$stockdescripuno = $descfixedassets;\n\t\t\t\t}\n\t\t\t}*/\n\n\t\t\t/******INICIO AGREGA LA DESCRIPCION DE LOS ACTIVOS FIJO FACTURADOS*/\n\n\n\t\t\t/* Gosea pidio que se agregara una leyenda en la descripcion al inicio 'Renta de' o 'Servicio de' se agrego tambien el numero de serie */\n\t\t\tif($_SESSION ['DatabaseName'] == \"erpgosea\" or $_SESSION ['DatabaseName'] == \"erpgosea_CAPA\" or $_SESSION ['DatabaseName'] == \"erpgosea_DES\"){\n\t\t\t\tif (isset($tag) and $tag!=''){\n\t\t\t\t\t$SQL=\"SELECT tagref,legalid,legend FROM tagslegend where tagref = \" . $tag;\n\t\t\t\t\t$resulttaglegend=DB_query($SQL,$db);\n\t\t\t\t\t$rowtaglegend = DB_fetch_array($resulttaglegend);\n\t\t\t\t\tif($rowtaglegend['legend'] !=''){\n\t\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$rowtaglegend['legend'] .\" \".$stockdescripuno . \", No. Serie \". $myrow2['serialno'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno. \", No. Serie \". $myrow2['serialno'];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno. \", No. Serie \". $myrow2['serialno'];\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t}\n\t\t\t\n\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t$stockprecio=number_format(($myrow2['fxprice']/$myrow2['cantidad_activo']),$decimalplaces,'.','');\n\t\t\t}else{\n\t\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t}\n\n\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t$stockneto=number_format(($myrow2['fxnet']/$myrow2['cantidad_activo']),$decimalplaces,'.','');\n\t\t\t}else{\n\t\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\t}\n\n\t\t\tif ($_SESSION['UserID'] == 'desarrollo') {\n\t\t\t\t//echo \"<br>stockcantidad: \".$stockcantidad.\" - stockcantidadCompleta \".$stockcantidadCompleta.\" - stockprecio: \".$stockprecio.\" - stockneto: \".$stockneto.\"<br>\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($myrow2['flagadvance'] == 1) {\n\t\t\t\t//Obtener total de la partida, si existe diferencia obtener precio unitario\n\t\t\t\t$totalPar = number_format($stockcantidad * $stockprecio,$decimalplaces,'.','');\n\t\t\t\t//echo \"<br>totalPar1: \".$totalPar.\"<br>\";\n\t\t\t\tif (abs($totalPar) != abs($stockneto)) {\n\t\t\t\t\t$stockprecio = number_format($stockneto/$stockcantidad,$decimalplaces,'.','');\n\t\t\t\t}\n\n\t\t\t\tif ($stockcantidad < 0 and $stockprecio > 0) {\n\t\t\t\t\t$stockprecio = $stockprecio * (-1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($stocknegativo == 1 and $stockprecio > 0) {\n\t\t\t\t//Si cantidad es negativo, poner precio en negativo para operacion\n\t\t\t\t$stockprecio = $stockprecio * (-1);\n\t\t\t}\n\n\t\t\tif ($_SESSION['UserID'] == 'desarrollo') {\n\t\t\t\t//echo \"<br>stockprecio change: \".$stockprecio.\"<br>\";\n\t\t\t}\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t$stockunits=$myrow2['unidad_activo'];\n\t\t\t}else{\n\t\t\t\t$stockunits=$myrow2['units'];\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=number_format($myrow2['totaldescuento'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\n\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n \n\t\t\tdebug_sql($sqladuana, __LINE__,false,__FILE__);\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$nameaduana=$myrowaduana['aduana'];\n\t\t\t\t$numberaduana=$myrowaduana['noaduana'];\n\t\t\t\t$fechaaduana=$myrowaduana['fechaaduana'];\n\t\t\t\t//$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t//$nameaduana = $separaaduana[0];\n\t\t\t\t//$numberaduana= $separaaduana[1];\n\t\t\t\t//$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t\t$nameaduana = $myrowaduana['aduana'];\n\t\t\t\t$numberaduana = $myrowaduana['noaduana'];\n\t\t\t\t$fechaaduana = $myrowaduana['fechaaduana'];\n\t\t\t\t$pedimento = $myrowaduana['pedimento'];\n\t\t\t}\n \n\t\t\tif($myrow['type'] == 66) { // Si es factura remision\n\n\t\t\t\t$ordernotmp = $myrow['orderno'];\n\n\t\t\t\t$SQL = \"\n\t\t\t\t\tSELECT GROUP_CONCAT(debtortrans.order_) AS order_\n\t\t\t\t\tFROM invoicetoremision\n\t\t\t\t\tINNER JOIN debtortrans\n\t\t\t\t\tON debtortrans.id = invoicetoremision.idremision\n\t\t\t\t\tWHERE invoicetoremision.idinvoice = '\".$myrow['iddocto'].\"'\n\t\t\t\t\";\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\n\t\t\t\t$rstmp = DB_query($SQL, $db);\n\t\t\t\t$rowtmp = DB_fetch_array($rstmp);\n\t\t\t\t$ordernotmp = $rowtmp['order_'];\n\n\t\t\t\tif(empty($ordernotmp) == FALSE) {\n\n\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\";\n\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t$numberaduana = $rowtmp['pedimento'];\n\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$almacen;\n\t\t\t\n\t\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t\t\n\t\t\t\t$sqlstockmovestaxes=\"SELECT stockmovestaxes.stkmoveno,\n\t\t\t\t\t\t\t\t\t\t\ttaxauthid,taxrate,\n\t\t\t\t\t\t\t\t\t\t\ttaxcalculationorder,\n\t\t\t\t\t\t\t\t\t\t\ttaxontax,\n\t\t\t\t\t\t\t\t\t\t\ttaxauthorities.description,\n \t\t\t\t\t\t\t\t\t\t\tsum(stockmovestaxes.taxrate*(((stockmoves.price*(stockmoves.qty*-1))-(CASE WHEN stockmoves.type=11 then stockmoves.totaldescuento*-1 else stockmoves.totaldescuento end)))) as iva\n\t \t\t\t\t\t\t\t\tFROM stockmovestaxes inner join stockmoves on stockmoves.stkmoveno=stockmovestaxes.stkmoveno\n\t\t\t\t\t\t\t\t\t\tLEFT join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid \n\t\t\t\t\t\t\t\t\t\tLEFT JOIN taxauthorities ON taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t WHERE type=\".$TypeInvoice. \" AND transno=\".$InvoiceNo.\" And stockcategory.prodLineId='\".$myrow2['stockid'].\"'\";\n\t\t\t}else{\n\t\t\t\n\t\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,\n\t\t\t\t\t\ttaxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes\n LEFT JOIN taxauthorities ON taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t WHERE stkmoveno=\".$stkmoveno;\n\t\t\t}\n \n debug_sql($sqlstockmovestaxes, __LINE__,$debug_sql,__FILE__);\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n if(empty($myrow3['description']) == false){\n $impuesto=$myrow3['description'];\n }else{\n $impuesto=\"IVA\";\n }\n\t\t\t\t\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,$decimalplaces,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\tif($TipoAgrupacionXTag==1){\n\t\t\t\t\t//$taxratetotal=number_format(abs($myrow3['iva']),$decimalplaces,'.','');\n\t\t\t\t\t$taxratetotal = abs($myrow3['iva']);\n\t\t\t\t\t$taxratetotal = number_format($taxratetotal,$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\t//$taxratetotal=number_format($myrow3['taxrate']*($subtot),$decimalplaces,'.','');\n\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * $myrow2['subtotal'];\n\t\t\t\t\t$taxratetotal = number_format($taxratetotal,$decimalplaces,'.','');\n\t\t\t\t}\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n ///***************************************///\n $TotGeneralCantEmision = 0;\n if ($TypeInvoice == 119) {\n //*****se agrega cantidad emision solo en remisiones *///\n $wo = 'select wo from workorders where orderno=\"' . ($myrow['orderno']-1) . '\"';\n if ($_SESSION['UserID'] == \"desarrollo\" and $debug) {\n \t//echo '<pre>Busca OT'.$wo;\n }\n debug_sql($wo, __LINE__,$debug_sql,__FILE__);\n $rwo = DB_query($wo, $db);\n if(DB_num_rows($rwo) > 0){\n $fwo = DB_fetch_array($rwo);\n $woo=$fwo['wo'];\n $SQL=\" SELECT legalid\n FROM tags \n WHERE tagref='\".$tag.\"'\";\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n $legal = DB_query($SQL, $db);\n list($legalid) = DB_fetch_array($legal);\n\n $sqlRequRes = \"SELECT t.wostdcost, \n t.worequirements_id, t.stockid, t.description,t.units, t.decimalplaces,\n (t.requiredqty) as requiredqty,\n (t.expectedcost) as expectedcost,\n (t.stdcost) AS costperqty,\n t.mbflag,\n t.categoryid,\n t.categorydescription,\n t.taxrate\n FROM (\tSELECT\n worequirements.worequirements_id,\n worequirements.stdcost AS wostdcost,\n worequirements.stockid,\n stockmaster.longdescription as description ,\n stockmaster.decimalplaces,\n stockmaster.mbflag,\n stockmaster.units,\n (stockcostsxlegal.avgcost) as stdcost,\n stockmaster.categoryid,\n stockcategory.categorydescription,\n SUM(if(worequirements.ispercent=1,0,worequirements.qtypu)) AS requiredqty,\n SUM(worequirements.stdcost*worequirements.qtypu) AS expectedcost,\n AVG(worequirements.qtypu) as qtypu,\n stockmaster.taxcatid,\n taxauthrates.taxrate\n FROM worequirements\n INNER JOIN stockmaster ON worequirements.stockid=stockmaster.stockid\n INNER JOIN taxauthrates ON taxauthrates.taxcatid = stockmaster.taxcatid\n INNER JOIN stockcategory ON stockmaster.categoryid = stockcategory.categoryid\n INNER JOIN stockcostsxlegal ON stockmaster.stockid = stockcostsxlegal.stockid AND stockcostsxlegal.legalid = \" .$legalid. \"\n INNER JOIN woitems ON woitems.stockid=worequirements.masterparentid\n WHERE worequirements.wo='\" . $woo . \"' and woitems.wo=worequirements.wo\n AND stockmaster.mbflag <> 'M'\n /*AND stockmaster.stockid='DOR1-13'*/\n GROUP BY worequirements.stockid) AS t\n GROUP BY t.stockid\n ORDER BY t.categorydescription\";\n\n if ($_SESSION['UserID'] == \"desarrollo\" and $debug) {\n \t//echo '<pre>GET ReqRes:'.$sqlRequRes;\n }\n \n debug_sql($sqlRequRes, __LINE__,$debug_sql,__FILE__);\n $RequirementsResult = DB_query($sqlRequRes, $db);\n $TotGeneralCantEmision = 0;\n while ($RequirementsRow = DB_fetch_array($RequirementsResult)) {\n $SQL2 = \"SELECT trandate,\n (qty + Case When movs.cantidad Is Null Then 0 Else movs.cantidad End) as qty,\n standardcost\n FROM stockmoves\n Left Join (Select ref4, stockid, reference, sum(qty) as cantidad\n From stockmoves\n Where type= 815 Group by ref4, stockid, reference) as movs On stockmoves.stockid= movs.stockid \n and stockmoves.reference= movs.reference \n and stockmoves.stkmoveno= movs.ref4\n WHERE stockmoves.type=28\n AND stockmoves.reference = '\" . $woo['wo'] . \"'\n AND stockmoves.stockid = '\" . $RequirementsRow['stockid'] . \"'\";\n\t\t\t\t\t\t\tdebug_sql($SQL2, __LINE__,$debug_sql,__FILE__);\n $IssuesResult = DB_query($SQL2, $db, _('Could not retrieve the issues of the item because:'));\n if ($_SESSION['UserID'] == \"desarrollo\" and $debug) {\n\t\t\t\t\t\t\t\t//echo '<pre>ok'.$SQL2;\n\t\t\t\t\t\t\t\t//die('END');\n }\n if (DB_num_rows($IssuesResult) > 0) {\n while ($IssuesRow = DB_fetch_array($IssuesResult)) {\n $IssueQty -= $IssuesRow['qty']; // because qty for the stock movement will be negative\n $IssueCost -= ($IssuesRow['qty'] * $IssuesRow['standardcost']);\n }\n }\n if($IssueQty>0){\n \t$TotGeneralCantEmision = $IssueQty;\n }else{\n \t$TotGeneralCantEmision = 0;\n }\n }\n\t\t\t\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$TotGeneralCantEmision;\n \t}else{\n\t\t\t\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$TotGeneralCantEmision;\n \t}\n \n $SQLemision=\"SELECT sum(plcdata.value) AS total,folio\n FROM worequirements\n INNER JOIN workorders ON workorders.wo = worequirements.wo\n INNER JOIN plcdata ON plcdata.stockid = worequirements.stockid AND plcdata.wo = worequirements.wo\n INNER JOIN stockmaster ON stockmaster.stockid = worequirements.stockid\n INNER JOIN stockmaster AS encabezado ON encabezado.stockid = worequirements.parentstockid\n INNER JOIN debtortrans ON workorders.orderno = debtortrans.order_ AND debtortrans.type = 119 AND debtortrans.transno='\".$InvoiceNo.\"' AND plcdata.transno = debtortrans.transno\n WHERE folio IN (SELECT folio FROM debtortrans WHERE order_='\".$myrow['orderno'].\"') GROUP BY folio;\";\n //echo '<br>EmisionAnt'.$TotGeneralCantEmision;\n \n debug_sql($SQLemision, __LINE__,$debug_sql,__FILE__);\n $resultEmision= DB_query($SQLemision, $db);\n //echo '<pre>SQLEmision: '.$SQLemision;\n $myrowEmision= DB_fetch_array($resultEmision);\n $TotGeneralCantEmision = 0;\n $TotGeneralCantEmision=$myrowEmision['total'];\n //echo '<br>Emision: '.$TotGeneralCantEmision;\n //$charelectronicdetail=$charelectronicdetail.'|'.$TotGeneralCantEmision;\n //echo '<br>Cadena: '.$charelectronicdetail; \n\t\t\t\t\t//echo '<br>END</br>';\n }\n $charelectronicdetail=$charelectronicdetail.'|'.$TotGeneralCantEmision;\n $charelectronicdetail=$charelectronicdetail.'|'.$movorderlineno;\n $charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n $charelectronicdetail=$charelectronicdetail.'|'.$pedimento;\n $charelectronicdetail=$charelectronicdetail.'';\n\t\t\t\t$nolinea=$nolinea+1;\n\t /**FIN DE CALCULO DE EMISIONES***/\n }\n\t}else{//\n\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\t-- stockmoves.stockid,\n\t\t\t\t\t ProdLine.prodLineId as stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\t-- stockmaster.description,\n\t\t\t\t\t\tProdLine.Description as description,\n\t\t\t\t\t\t/*stockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,*/\n\t\t\t\t\t\t0 as serialised,\n\t\t\t\t\t\t0 as controlled,\n\t\t\t\t\t\tsum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxnet,\n\t\t\t\t\t\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))-totaldescuento)/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as subtotal,\n\t\t\t\t\t\t-- sum((stockmoves.price*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)/case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tsum((stockmoves.price*IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end))/sum(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t\tstockcategory.MensajePV,\n stockmoves.ref4 as movorderline,\n stockmaster.flagadvance\n\t\t\t\tFROM stockmoves left JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno, stockmaster,\n\t\t\t\t\tstockcategory\n\t\t\t\t\t \tINNER JOIN ProdLine ON ProdLine.prodLineId=stockcategory.prodLineId\n\t\t\t\t\t\t\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\tGROUP BY ProdLine.Description,ProdLine.prodLineId';\n\t\t}else{\n\t\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV,\n\t\t\t\t\t\tstockmaster.longdescription,\n\t\t\t\t\t\tstockmaster.mbflag,\n stockmoves.ref4 as movorderline,\n stockmaster.flagadvance\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno \n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t}\n\t\t//echo \"<pre>\".$sqldetails;\n debug_sql($sqldetails, __LINE__,$debug_sql,__FILE__);\n //DB_query(\"SET NAMES 'utf8';\",$db);\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stocknegativo = 0; //obtener si es negativo para precio\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t$stockcantidadCompleta = $myrow2['quantity'];\n\n\t\t\tif ($stockcantidad < 0) {\n \t//Cantidad en negativo\n \t$stocknegativo = 1;\n }\n\n\t\t\t/*if ($_SESSION['UserID'] == 'desarrollo' or $_SESSION['UserID'] == 'iortiz') {\n\t\t\t\t$stockcantidad = abs($stockcantidad);\n\t\t\t}*/\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.abs($stockcantidad); //Cantidad como este en DB + o -\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t$totalCantEmision = 0;\n $movorderlineno = $myrow2['movorderline'];\n\t\t\tif($_SESSION['DescrLargaFact'] == $myrow2['mbflag']){\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'].' '.$myrow2['longdescription'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow2['longdescription'].' ';\n\t\t\t}else{\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' ';\n\t\t\t}\n\t\t\t\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument IN(110, '\" . $TypeInvoice . \"')\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n \n //echo $sqlpropertyes;\n \n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\n\t\t\t/*if ($_SESSION[\"desarrollo\"]){\n\t\t\t\techo \"series 1: \".\"SELECT DISTINCT stockserialitems.serialno as serie\n\t\t\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\t\t\tAND stockserialitems.loccode='\".$myrow2['almacen'].\"' \n\t\t\t\t\t\t\tAND qualitytext NOT LIKE '%rechaz%' \n\t\t\t\t\t\t\tAND stockmoves.stockid='CASCLI'\";\t\t\n\t\t\t}*/\n\n\t\t\t$numberserie= \"\";\n\t\t\t$xserie=0;\n\n\t\t\tif (strpos(\"@\".$_SESSION ['DatabaseName'], \"gruposervillantas\")) {\n $sqlserials=\"SELECT DISTINCT stockserialitems.serialno AS serie\n\t\t\t\t\t\t\tFROM workorders \n\t\t\t\t\t\t\tINNER JOIN stockserialitems ON workorders.wo= stockserialitems.wo\n\t\t\t\t\t\t\tWHERE orderno= '\".$orderno.\"'\n\t\t\t\t\t\t\tAND stockserialitems.customs= '\".$stockid.\"' \n\t\t\t\t\t\t\tAND qualitytext NOT LIKE '%rechaz%' AND stockserialitems.serialno NOT LIKE 'R-%'\n\t\t\t\t\t\t\tAND stockserialitems.stockid= 'cascli'\";\n\n\t\t\t\t//echo \"series 2: \".$sqlserials;\t\t\n\n\t\t\t\t$resultado= DB_query($sqlserials,$db);\n\t\t\t\t\n\t\t\t\twhile ($myrownseries=DB_fetch_array($resultado)) {\n\t\t\t\t\tif ($stockid!='cascli'){\n\t\t\t\t\t\t$consulta= \"SELECT DISTINCT stockserialitems.serialno AS serie\n\t\t\t\t\t\t\t\t\tFROM workorders \n\t\t\t\t\t\t\t\t\tINNER JOIN stockserialitems ON workorders.wo= stockserialitems.wo\n\t\t\t\t\t\t\t\t\tWHERE orderno= '\".$orderno.\"'\n\t\t\t\t\t\t\t\t\tAND stockserialitems.customs= '\".$stockid.\"'\n\t\t\t\t\t\t\t\t\tAND qualitytext LIKE '%rechaz%' \n\t\t\t\t\t\t\t\t\tAND stockserialitems.serialno LIKE '%\".$myrownseries['serie'].\"%'\";\n\n\t\t\t\t\t\t$resultado2= DB_query($consulta, $db);\n\n\t\t\t\t\t\tif ($registro=DB_fetch_array($resultado2)){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ($xserie==0){\n\t\t\t\t\t\t$numberserie=' Series: '.$myrownseries['serie'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$numberserie=$numberserie.', '.$myrownseries['serie'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$xserie++;\n\t\t\t\t}\n }\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM salesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n \n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n if (strlen($descrnarrative)==0){\n $stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n }else{\n $stockdescripuno=$descrnarrative.$numberserie;\n }\n\t\t\t}\n\n\t\t\tif($_SESSION ['DatabaseName'] == \"erpgosea\" or $_SESSION ['DatabaseName'] == \"erpgosea_CAPA\" or $_SESSION ['DatabaseName'] == \"erpgosea_DES\"){\n\t\t\t\tif ($myrow2['stockid'] =='10001'){\n\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.\"RENTA DE \".$stockdescripuno;\n\t\t\t\t}else{\n\t\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t}\n \n\t\t\t// Se QUITO POR EL DE ARRIBA $charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\n\t\t\tif ($_SESSION['UserID'] == 'desarrollo') {\n\t\t\t\t//echo \"<br>stockcantidad: \".$stockcantidad.\" - stockcantidadCompleta \".$stockcantidadCompleta.\" - stockprecio: \".$stockprecio.\" - stockneto: \".$stockneto.\"<br>\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($myrow2['flagadvance'] == 1) {\n\t\t\t\t//Obtener total de la partida, si existe diferencia obtener precio unitario\n\t\t\t\t$totalPar = number_format($stockcantidad * $stockprecio,$decimalplaces,'.','');\n\t\t\t\t//echo \"<br>totalPar1: \".$totalPar.\"<br>\";\n\t\t\t\tif (abs($totalPar) != abs($stockneto)) {\n\t\t\t\t\t$stockprecio = number_format($stockneto/$stockcantidad,$decimalplaces,'.','');\n\t\t\t\t}\n\n\t\t\t\tif ($stockcantidad < 0 and $stockprecio > 0) {\n\t\t\t\t\t$stockprecio = $stockprecio * (-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($stocknegativo == 1 and $stockprecio > 0) {\n\t\t\t\t//Si cantidad es negativo, poner precio en negativo para operacion\n\t\t\t\t$stockprecio = $stockprecio * (-1);\n\t\t\t}\n\n\t\t\tif ($_SESSION['UserID'] == 'desarrollo') {\n\t\t\t\t//echo \"<br>stockprecio change: \".$stockprecio.\"<br>\";\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.($stockprecio);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.($stockneto);\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t\n debug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n debug_sql($sqlstockmovestaxes, __LINE__,$debug_sql,__FILE__);\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,$decimalplaces,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t//$subtot = number_format($myrow2['subtotal'], 2); //Siempre se manejo en 2\n\t\t\t\t//$taxratetotal=number_format($myrow3['taxrate']*($subtot),$decimalplaces,'.','');\n\t\t\t\t\n\t\t\t\t$taxratetotal = $myrow3['taxrate'] * $myrow2['subtotal'];\n\t\t\t\t$taxratetotal = number_format($taxratetotal, $decimalplaces,'.','');\n\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t\t//$subtotal=number_format($myrow2['subtotal']+$taxtotalratex,$decimalplaces,'.','');\n\t\t\t$subtotal = $myrow2['subtotal'] + $taxtotalratex;\n\t\t\t$subtotal = number_format($subtotal,$decimalplaces,'.','');\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t//$subtotal=number_format($myrow2['subtotal']+$taxtotalratex,$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\n\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t debug_sql($sqladuana, __LINE__,$debug_sql,__FILE__);\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana = $myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t\t$nameaduana = $myrowaduana['aduana'];\n\t\t\t\t$numberaduana = $myrowaduana['noaduana'];\n\t\t\t\t$fechaaduana = $myrowaduana['fechaaduana'];\n\t\t\t\t$pedimento = $myrowaduana['pedimento'];\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif($myrow['type'] == 66) { // Si es factura remision\n\n\t\t\t\t$ordernotmp = $myrow['orderno'];\n\n\t\t\t\t$SQL = \"\n\t\t\t\t\tSELECT GROUP_CONCAT(debtortrans.order_) AS order_\n\t\t\t\t\tFROM invoicetoremision\n\t\t\t\t\tINNER JOIN debtortrans\n\t\t\t\t\tON debtortrans.id = invoicetoremision.idremision\n\t\t\t\t\tWHERE invoicetoremision.idinvoice = '{$myrow['iddocto']}'\n\t\t\t\t\";\n\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t$rstmp = DB_query($SQL, $db);\n\t\t\t\t$rowtmp = DB_fetch_array($rstmp);\n\t\t\t\t$ordernotmp = $rowtmp['order_'];\n\n\t\t\t\tif(empty($ordernotmp) == FALSE) {\n\n\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\";\n\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t$numberaduana = $rowtmp['pedimento'];\n\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n \n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana.'aqui';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$almacen;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$totalCantEmision;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$movorderlineno;\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$pedimento;\n\n\t\t\t/*$stockprecio=number_format($myrow2['fxnet']+$taxtotalratex,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet']+$taxtotalratex,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal*/\n\n\t\t}\n /*if($_SESSION['UserID'] == \"desarrollo\"){\n echo '<br><pre>$charelectronicdetail: '.$charelectronicdetail;\n }*/\n \n\t}\n\t// complemento INE\n $charelectronicdetailINEComplements=\"\";\n $permiso_complementos = 'SELECT typecomplement FROM custbranch WHERE debtorno=\"'.$branch.'\"';\n\t$resul_permiso = DB_query($permiso_complementos,$db);\n\tlist($permiso_complemento) = DB_fetch_array($resul_permiso);\n\tif($permiso_complemento==1){\n\t\t$Select_INE = \"SELECT typeprocess,\n\t\t\t\t\t\t\ttypecommittee,\n\t\t\t\t\t\t\tentity, \n\t\t\t\t\t\t\tidaccounting, \n\t\t\t\t\t\t\torderno,\n\t\t\t\t\t\t\tIFNULL(scope,'') as scope \n\t\t\t\t\t\tFROM complementsine \n\t\t\t\t\t\tWHERE orderno = '\" . $orderno .\"'\";\n\t\t$Result_INE = DB_query($Select_INE, $db);\n\t\t$charelectronicdetailINEComplements = '|'.chr(13).chr(10).'010';\n while($ine = DB_fetch_array($Result_INE)){\n \t$tipoproceso = utf8_decode($ine['typeprocess']);\n\n \t$tipoproceso = str_replace(chr(63),chr(241), $tipoproceso);\n\t\t\t$detallesINE .= $tipoproceso . '|'.$ine['typecommittee'].'|'.$ine['entity'].'|'.$ine['idaccounting'].'|'.$ine['orderno'].'|'.$ine['scope'];\n\t\t}\n\t\t$charelectronicdetailINEComplements=$charelectronicdetailINEComplements.'|'.$detallesINE;\n\t\tif ($_SESSION ['UserID'] == 'saplicaciones' ) {\n\t\t\techo \"<br>\" . $charelectronicdetailINEComplements;\n\t\t}\n }\n\t// ivas retenidos\n\n\tif($_SESSION['UserID'] == \"desarrollo\"){\n\t\t//\techo __line__.'<br><pre>$charelectronic: '.$charelectronic;\n\t\t//\techo __line__.'<br><pre>$charelectronicdetail: '.$charelectronicdetail;\n\t\t//\t\techo __line__.'<br><pre>$charelectronictaxsret: '.$charelectronictaxsret;\n\t\t//\t\techo __line__.'<br><pre>$charelectronictaxsfederal: '.$charelectronictaxsfederal;\n\t\t//\t\techo __line__.'<br><pre>$charelectronictaxslocal: '.$charelectronictaxslocal;\n\t\t//\t\techo __line__.'<br><pre>$charelectronicEmbarque: '.$charelectronicEmbarque;\n\t\t//\t\techo __line__.'<br><pre>$totalCantEmision: '.$totalCantEmision;\n\t\t// echo __line__.'<br><pre>$charelectronicdetailINEComplements: '.$charelectronicdetailINEComplements;\n\t}\n if(empty($totalCantEmision) == true){\n $totalCantEmision = 0;\n }\n if($nivelfacturacion==1){\n debug_sql('TIPO OT', __LINE__,$debug_sql,__FILE__);\n $stockid=$OT; \n $stockcantidad = 1;\n $stockdescrip = $descripcionOT;\n }elseif($nivelfacturacion==2){\n debug_sql('TIPO CONCEPTOS', __LINE__,$debug_sql,__FILE__);\n \n }\n elseif($nivelfacturacion==3){\n debug_sql('Productos manufacturacios', __LINE__,$debug_sql,__FILE__);\n }\n\t// \t die(\"END XSA\");\n\n\tif ($rfccliente==\"XAXX010101000\" && $_SESSION['DesgloseIVA']!=1){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronictaxsfederal.$charelectronictaxslocal.$charelectronicEmbarque.$totalCantEmision.$charelectronicdetailINEComplements;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsfederal.$charelectronictaxs.$charelectronictaxslocal.$charelectronicEmbarque.$totalCantEmision.$charelectronicdetailINEComplements;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\t}\n \n //debug_sql('cadena original <br>'.$cadenaenviada, __LINE__,true,__FILE__,'blue');\n //echo \"<br> XSAInvoicing: \".$cadenaenviada.\"<br>\";\n return $cadenaenviada;\n}",
"public function run()\n {\n \n\n \\DB::table('trx_purchase_order')->delete();\n \n \\DB::table('trx_purchase_order')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'number' => 'PO-1900001',\n 'purchase_requisition_id' => 4,\n 'vendor_id' => 17,\n 'delivery_date' => '2019-02-18',\n 'currency' => 'Rupiah',\n 'value' => 1,\n 'project_id' => 1,\n 'description' => 'PO DUMMY 1',\n 'status' => 1,\n 'total_price' => 151500000,\n 'branch_id' => 2,\n 'user_id' => 1,\n 'created_at' => '2019-01-17 04:35:15',\n 'updated_at' => '2019-01-17 04:35:15',\n ),\n 1 => \n array (\n 'id' => 2,\n 'number' => 'PO-1900002',\n 'purchase_requisition_id' => 5,\n 'vendor_id' => 35,\n 'delivery_date' => '2019-02-18',\n 'currency' => 'Rupiah',\n 'value' => 1,\n 'project_id' => 1,\n 'description' => 'PO DUMMY 2 (RESOURCE)',\n 'status' => 1,\n 'total_price' => 3000000,\n 'branch_id' => 2,\n 'user_id' => 1,\n 'created_at' => '2019-01-17 04:35:44',\n 'updated_at' => '2019-01-17 06:49:44',\n ),\n 2 => \n array (\n 'id' => 3,\n 'number' => 'PO-1900003',\n 'purchase_requisition_id' => 8,\n 'vendor_id' => 38,\n 'delivery_date' => '2019-02-18',\n 'currency' => 'Rupiah',\n 'value' => 1,\n 'project_id' => 2,\n 'description' => 'PO DUMMY 1 PAMI',\n 'status' => 1,\n 'total_price' => 306000000,\n 'branch_id' => 1,\n 'user_id' => 1,\n 'created_at' => '2019-01-17 04:43:52',\n 'updated_at' => '2019-01-17 04:44:06',\n ),\n 3 => \n array (\n 'id' => 4,\n 'number' => 'PO-1900004',\n 'purchase_requisition_id' => 9,\n 'vendor_id' => 10,\n 'delivery_date' => '2019-02-18',\n 'currency' => 'Rupiah',\n 'value' => 1,\n 'project_id' => 2,\n 'description' => 'PO DUMMY 2 PAMI',\n 'status' => 1,\n 'total_price' => 10500000,\n 'branch_id' => 1,\n 'user_id' => 1,\n 'created_at' => '2019-01-17 04:44:29',\n 'updated_at' => '2019-01-17 04:44:29',\n ),\n 4 => \n array (\n 'id' => 5,\n 'number' => 'PO-1900005',\n 'purchase_requisition_id' => 12,\n 'vendor_id' => 9,\n 'delivery_date' => '2019-02-18',\n 'currency' => 'Rupiah',\n 'value' => 1,\n 'project_id' => 1,\n 'description' => 'PO DUMMY PMP',\n 'status' => 2,\n 'total_price' => 952140000,\n 'branch_id' => 2,\n 'user_id' => 1,\n 'created_at' => '2019-01-17 06:55:05',\n 'updated_at' => '2019-01-17 06:55:54',\n ),\n 5 => \n array (\n 'id' => 6,\n 'number' => 'PO-1900006',\n 'purchase_requisition_id' => 13,\n 'vendor_id' => 17,\n 'delivery_date' => '2019-02-18',\n 'currency' => 'Rupiah',\n 'value' => 1,\n 'project_id' => 1,\n 'description' => 'PO DUMMY RESOURCE',\n 'status' => 2,\n 'total_price' => 24500000,\n 'branch_id' => 2,\n 'user_id' => 1,\n 'created_at' => '2019-01-17 06:55:37',\n 'updated_at' => '2019-01-17 06:56:06',\n ),\n 6 => \n array (\n 'id' => 7,\n 'number' => 'PO-1900007',\n 'purchase_requisition_id' => 16,\n 'vendor_id' => 17,\n 'delivery_date' => '2019-02-18',\n 'currency' => 'Rupiah',\n 'value' => 1,\n 'project_id' => 2,\n 'description' => 'PO DUMMY PAMI 3',\n 'status' => 2,\n 'total_price' => 110864500,\n 'branch_id' => 1,\n 'user_id' => 1,\n 'created_at' => '2019-01-17 07:01:56',\n 'updated_at' => '2019-01-17 07:02:37',\n ),\n 7 => \n array (\n 'id' => 8,\n 'number' => 'PO-1900008',\n 'purchase_requisition_id' => 17,\n 'vendor_id' => 11,\n 'delivery_date' => '2019-02-18',\n 'currency' => 'Rupiah',\n 'value' => 1,\n 'project_id' => 2,\n 'description' => 'PO DUMMY PAMI 4 (RESOURCE)',\n 'status' => 2,\n 'total_price' => 35500000,\n 'branch_id' => 1,\n 'user_id' => 1,\n 'created_at' => '2019-01-17 07:02:17',\n 'updated_at' => '2019-01-17 07:02:41',\n ),\n ));\n \n \n }",
"public function gettransactionsbyjournal($startdate,$enddate,$id=false){\n\n$condition = \"\";\n//Are we looking transactions for only one account ?\n if ($id!=false) {\n $condition = \" AND journal_id=$id \";\n\n }\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_1'));\n\n//Create temporary table that will store the mirrored table\n $this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_1').\"\n (SELECT * FROM \".$this->db->dbprefix('postings').\" \n WHERE (created_at BETWEEN '$startdate' AND '$enddate') $condition )\");\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_2'));\n\n$this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_2').\"(\nSELECT a.transaction_id,\n a.account_id AS from_account,\n b.account_id AS to_account,\n a.journal_id,\n a.amount,\n a.comment,\n a.created_at,\n a.created_by\nFROM \".$this->db->dbprefix('temp_postings_1').\" AS a , \".$this->db->dbprefix('postings').\" AS b \nWHERE a.journal_id=b.journal_id AND a.amount=b.amount*-1 \n AND a.comment=b.comment AND a.created_at=b.created_at\n AND a.created_by=b.created_by AND a.amount>0\n AND a.transaction_id=b.transaction_id)\");\n\n\n\n $dataset=$this->db->query(\"SELECT a.transaction_id,\n CONCAT(b.name,' [#',b.code,'] ') AS from_account,\n CONCAT(c.name,' [#',c.code,'] ') AS to_account,\n d.type AS journal_type,\n a.amount,\n a.comment,\n a.created_at,\n CONCAT(e.first_name,' ',e.last_name) AS created_by\n\nFROM \".$this->db->dbprefix('temp_postings_2').\" AS a\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS b ON a.from_account=b.id\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS c ON a.to_account =c.id\nLEFT JOIN \".$this->db->dbprefix('journals').\" AS d ON a.journal_id =d.id\nLEFT JOIN \".$this->db->dbprefix('users').\" AS e ON a.created_by=e.id \nORDER BY created_at DESC\");\n\n return $dataset->result();\n}",
"public function approved_tr_data() {\n $result = array();\n \n //<editor-fold desc=\"Settings\" defaultstate=\"collapsed\">\n $conditions = array(\n 'Ticket.region' => $this->loginUser['Region']['region_name'],\n 'Ticket.approval_status' => APPROVE,\n 'Ticket.invoice_id' => 0,\n );\n \n $order = array( 'Ticket.id' => 'DESC' );\n \n $columns = array(\n 0 => array( 'model' => 'Ticket.id', 'field' => 'id', 'search' => 'like' ),\n 1 => array( 'model' => 'Ticket.supplier', 'field' => 'supplier_name', 'search' => 'like' ),\n 2 => array( 'model' => 'Ticket.supplier_category', 'field' => 'supplier_category', 'search' => 'like' ),\n 3 => array( 'model' => 'Ticket.site', 'field' => 'site_name', 'search' => 'like' ),\n 4 => array( 'model' => 'Ticket.asset_group', 'field' => 'asset_group', 'search' => 'like' ),\n 5 => array( 'model' => 'Ticket.asset_number', 'field' => 'asset_number', 'search' => 'like' ),\n 6 => array( 'model' => 'Ticket.tr_class', 'field' => 'tr_class', 'search' => 'like' ),\n 7 => array( 'model' => 'Ticket.project', 'field' => 'project_name', 'search' => 'like' ),\n );\n \n if( isset( $this->request->data['order'][0]['column'] ) ) {\n $column = $columns[ $this->request->data['order'][0]['column'] ]['model'];\n $direction = $this->request->data['order'][0]['dir'];\n $order = array( $column => $direction );\n }\n \n foreach( $columns as $col ) {\n if( isset( $this->request->data[ $col['field'] ] ) && $this->request->data[ $col['field'] ] != '' ) {\n if( $col['search'] == 'like' ) {\n $conditions[\"{$col['model']} LIKE\"] = '%' . $this->request->data[ $col['field'] ] . '%';\n }\n else {\n $conditions[\"{$col['model']}\"] = $this->request->data[ $col['field'] ];\n }\n }\n }\n //</editor-fold>\n \n $total = $this->Ticket->find( 'count', array( 'conditions' => $conditions, 'contain' => FALSE ) );\n $data = $this->Ticket->find( 'all', array(\n 'conditions' => $conditions,\n 'contain' => FALSE,\n 'limit' => intval( $this->request->data['length'] ) > 0 ? intval( $this->request->data['length'] ) : $total,\n 'offset' => intval( $this->request->data['start'] ),\n 'order' => $order,\n ) );\n \n $this->set( array(\n 'request' => $this->request->data,\n 'result' => $result,\n 'data' => $data,\n 'total' => $total,\n ) );\n }",
"function fullTableName($model, $quote = true) {\n\t\treturn \"\n(\n\tSELECT\n\t\tRepTransaction.id AS id, RepTransaction.created AS created, null AS confirmed,\n\t\tBPRepTransactionItem.id AS item_id, BPRepTransactionItem.price AS item_price, BPRepTransactionItem.product_name AS item_product_name, 'nakup' AS type,\n\t\tProductVariant.id AS product_variant_id, ProductVariant.lot AS product_variant_lot, ProductVariant.exp AS product_variant_exp,\n\t\tProduct.id AS product_id, Product.vzp_code AS product_vzp_code, Product.group_code AS product_group_code, Product.referential_number AS product_referential_number,\n\t\tBusinessPartner.id AS business_partner_id, BusinessPartner.name AS business_partner_name,\n\t\tUnit.id AS unit_id, Unit.shortcut AS unit_shortcut,\n\t\tRep.id AS rep_id, Rep.user_type_id AS user_type_id, Rep.first_name as rep_first_name, Rep.last_name AS rep_last_name, RepAttribute.ico AS rep_ico, RepAttribute.dic AS rep_dic, RepAttribute.street AS rep_street, RepAttribute.city AS rep_city, RepAttribute.zip AS rep_zip,\n\t\tRepAttribute.id AS rep_attribute_id, RepAttribute.ico AS rep_attribute_ico, RepAttribute.dic AS rep_attribute_dic, RepAttribute.street AS rep_attribute_street, RepAttribute.street_number AS rep_attribute_street_number, RepAttribute.city AS rep_attribute_city, RepAttribute.zip AS rep_attribute_zip,\n\t\t(BPRepTransactionItem.quantity) AS RepTransaction__quantity, (ABS(BPRepTransactionItem.quantity)) AS RepTransaction__abs_quantity, (BPRepTransactionItem.price * BPRepTransactionItem.quantity) AS RepTransaction__total_price, (ABS(BPRepTransactionItem.price * BPRepTransactionItem.quantity)) AS RepTransaction__abs_total_price, (CONCAT(Rep.first_name, \\\" \\\", Rep.last_name)) AS RepTransaction__rep_name\n\tFROM b_p_rep_purchases AS RepTransaction\n\t\tLEFT JOIN b_p_rep_transaction_items AS BPRepTransactionItem ON (RepTransaction.id = BPRepTransactionItem.b_p_rep_purchase_id)\n\t\tLEFT JOIN product_variants AS ProductVariant ON (BPRepTransactionItem.product_variant_id = `ProductVariant`.`id`)\n\t\tLEFT JOIN products AS Product ON (Product.id = ProductVariant.product_id)\n\t\tLEFT JOIN business_partners AS BusinessPartner ON (BusinessPartner.id = RepTransaction.business_partner_id)\n\t\tLEFT JOIN units AS Unit ON (Product.unit_id = Unit.id)\n\t\tLEFT JOIN users AS Rep ON (RepTransaction.rep_id = Rep.id)\n\t\tLEFT JOIN rep_attributes AS RepAttribute ON (Rep.id = RepAttribute.rep_id)\nUNION\n\tSELECT\n\t\tRepTransaction.id AS id, RepTransaction.created AS created, null AS confirmed,\n\t\tBPRepTransactionItem.id AS item_id, BPRepTransactionItem.price AS item_price, BPRepTransactionItem.product_name AS item_product_name, 'prodej' AS type,\n\t\tProductVariant.id AS product_variant_id, ProductVariant.lot AS product_variant_lot, ProductVariant.exp AS product_variant_exp,\n\t\tProduct.id AS product_id, Product.vzp_code AS product_vzp_code, Product.group_code AS product_group_code, Product.referential_number AS product_referential_number,\n\t\tBusinessPartner.id AS business_partner_id, BusinessPartner.name AS business_partner_name,\n\t\tUnit.id AS unit_id, Unit.shortcut AS unit_shortcut,\n\t\tRep.id AS rep_id, Rep.user_type_id AS user_type_id, Rep.first_name as rep_first_name, Rep.last_name AS rep_last_name, RepAttribute.ico AS rep_ico, RepAttribute.dic AS rep_dic, RepAttribute.street AS rep_street, RepAttribute.city AS rep_city, RepAttribute.zip AS rep_zip,\n\t\tRepAttribute.id AS rep_attribute_id, RepAttribute.ico AS rep_attribute_ico, RepAttribute.dic AS rep_attribute_dic, RepAttribute.street AS rep_attribute_street, RepAttribute.street_number AS rep_attribute_street_number, RepAttribute.city AS rep_attribute_city, RepAttribute.zip AS rep_attribute_zip,\n\t\t(BPRepTransactionItem.quantity) AS RepTransaction__quantity, (ABS(BPRepTransactionItem.quantity)) AS RepTransaction__abs_quantity, (BPRepTransactionItem.price * BPRepTransactionItem.quantity) AS RepTransaction__total_price, (ABS(BPRepTransactionItem.price * BPRepTransactionItem.quantity)) AS RepTransaction__abs_total_price, (CONCAT(Rep.first_name, \\\" \\\", Rep.last_name)) AS RepTransaction__rep_name\n\tFROM b_p_rep_sales AS RepTransaction\n\t\tLEFT JOIN b_p_rep_transaction_items AS BPRepTransactionItem ON (RepTransaction.id = BPRepTransactionItem.b_p_rep_sale_id)\n\t\tLEFT JOIN product_variants AS ProductVariant ON (BPRepTransactionItem.product_variant_id = `ProductVariant`.`id`)\n\t\tLEFT JOIN products AS Product ON (Product.id = ProductVariant.product_id)\n\t\tLEFT JOIN business_partners AS BusinessPartner ON (BusinessPartner.id = RepTransaction.business_partner_id)\n\t\tLEFT JOIN units AS Unit ON (Product.unit_id = Unit.id)\n\t\tLEFT JOIN users AS Rep ON (RepTransaction.rep_id = Rep.id)\n\t\tLEFT JOIN rep_attributes AS RepAttribute ON (Rep.id = RepAttribute.rep_id)\nUNION\n\tSELECT\n\t\tRepTransaction.id AS id, RepTransaction.created AS created, null AS confirmed,\n\t\tMCRepTransactionItem.id AS item_id, MCRepTransactionItem.price AS item_price, MCRepTransactionItem.product_name AS item_product_name, 'převod z MC' AS type,\n\t\tProductVariant.id AS product_variant_id, ProductVariant.lot AS product_variant_lot, ProductVariant.exp AS product_variant_exp,\n\t\tProduct.id AS product_id, Product.vzp_code AS product_vzp_code, Product.group_code AS product_group_code, Product.referential_number AS product_referential_number,\n\t\tnull AS business_partner_id, 'Medical Corp' AS business_partner_name,\n\t\tUnit.id AS unit_id, Unit.shortcut AS unit_shortcut,\n\t\tRep.id AS rep_id, Rep.user_type_id AS user_type_id, Rep.first_name as rep_first_name, Rep.last_name AS rep_last_name, RepAttribute.ico AS rep_ico, RepAttribute.dic AS rep_dic, RepAttribute.street AS rep_street, RepAttribute.city AS rep_city, RepAttribute.zip AS rep_zip,\n\t\tRepAttribute.id AS rep_attribute_id, RepAttribute.ico AS rep_attribute_ico, RepAttribute.dic AS rep_attribute_dic, RepAttribute.street AS rep_attribute_street, RepAttribute.street_number AS rep_attribute_street_number, RepAttribute.city AS rep_attribute_city, RepAttribute.zip AS rep_attribute_zip,\n\t\t(MCRepTransactionItem.quantity) AS RepTransaction__quantity, (ABS(MCRepTransactionItem.quantity)) AS RepTransaction__abs_quantity, (MCRepTransactionItem.price * MCRepTransactionItem.quantity) AS RepTransaction__total_price, (ABS(MCRepTransactionItem.price * MCRepTransactionItem.quantity)) AS RepTransaction__abs_total_price, (CONCAT(Rep.first_name, \\\" \\\", Rep.last_name)) AS RepTransaction__rep_name\n\tFROM m_c_rep_sales AS RepTransaction\n\t\tLEFT JOIN m_c_rep_transaction_items AS MCRepTransactionItem ON (RepTransaction.id = MCRepTransactionItem.m_c_rep_sale_id)\n\t\tLEFT JOIN product_variants AS ProductVariant ON (MCRepTransactionItem.product_variant_id = `ProductVariant`.`id`)\n\t\tLEFT JOIN products AS Product ON (Product.id = ProductVariant.product_id)\n\t\tLEFT JOIN units AS Unit ON (Product.unit_id = Unit.id)\n\t\tLEFT JOIN users AS Rep ON (RepTransaction.rep_id = Rep.id)\n\t\tLEFT JOIN rep_attributes AS RepAttribute ON (Rep.id = RepAttribute.rep_id)\nUNION\n\tSELECT\n\t\tRepTransaction.id AS id, RepTransaction.created AS created, RepTransaction.confirmed AS confirmed,\n\t\tMCRepTransactionItem.id AS item_id, MCRepTransactionItem.price AS item_price, MCRepTransactionItem.product_name AS item_product_name, 'převod do MC' AS type,\n\t\tProductVariant.id AS product_variant_id, ProductVariant.lot AS product_variant_lot, ProductVariant.exp AS product_variant_exp,\n\t\tProduct.id AS product_id, Product.vzp_code AS product_vzp_code, Product.group_code AS product_group_code, Product.referential_number AS product_referential_number,\n\t\tnull AS business_partner_id, 'Medical Corp' AS business_partner_name,\n\t\tUnit.id AS unit_id, Unit.shortcut AS unit_shortcut,\n\t\tRep.id AS rep_id, Rep.user_type_id AS user_type_id, Rep.first_name as rep_first_name, Rep.last_name AS rep_last_name, RepAttribute.ico AS rep_ico, RepAttribute.dic AS rep_dic, RepAttribute.street AS rep_street, RepAttribute.city AS rep_city, RepAttribute.zip AS rep_zip,\n\t\tRepAttribute.id AS rep_attribute_id, RepAttribute.ico AS rep_attribute_ico, RepAttribute.dic AS rep_attribute_dic, RepAttribute.street AS rep_attribute_street, RepAttribute.street_number AS rep_attribute_street_number, RepAttribute.city AS rep_attribute_city, RepAttribute.zip AS rep_attribute_zip,\n\t\t(MCRepTransactionItem.quantity) AS RepTransaction__quantity, (ABS(MCRepTransactionItem.quantity)) AS RepTransaction__abs_quantity, (MCRepTransactionItem.price * MCRepTransactionItem.quantity) AS RepTransaction__total_price, (ABS(MCRepTransactionItem.price * MCRepTransactionItem.quantity)) AS RepTransaction__abs_total_price, (CONCAT(Rep.first_name, \\\" \\\", Rep.last_name)) AS RepTransaction__rep_name\n\tFROM m_c_rep_purchases AS RepTransaction\n\t\tLEFT JOIN m_c_rep_transaction_items AS MCRepTransactionItem ON (RepTransaction.id = MCRepTransactionItem.m_c_rep_purchase_id)\n\t\tLEFT JOIN product_variants AS ProductVariant ON (MCRepTransactionItem.product_variant_id = `ProductVariant`.`id`)\n\t\tLEFT JOIN products AS Product ON (Product.id = ProductVariant.product_id)\n\t\tLEFT JOIN units AS Unit ON (Product.unit_id = Unit.id)\n\t\tLEFT JOIN users AS Rep ON (RepTransaction.rep_id = Rep.id)\n\t\tLEFT JOIN rep_attributes AS RepAttribute ON (Rep.id = RepAttribute.rep_id)\n)\";\n\t}",
"function _getItemSearchFromStmt() {\n $sql = 'FROM plugin_docman_item AS i'.\n ' LEFT JOIN plugin_docman_version AS v'.\n ' ON (i.item_id = v.item_id)'.\n ' LEFT JOIN plugin_docman_version AS v2'.\n ' ON (v2.item_id = v.item_id AND v.number < v2.number) ';\n return $sql;\n }",
"public function all($limit=20,$offset=0){\n\n//Because transaction are double recorded now we are going to double the limit too\n$limit*=2;\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_1'));\n\n//Create temporary table that will store the mirrored table\n $this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_1').\"(SELECT * FROM \".$this->db->dbprefix('postings').\" ORDER BY created_at desc LIMIT $offset,$limit)\");\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_2'));\n\n$this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_2').\"(\nSELECT a.transaction_id,\n a.account_id AS from_account,\n b.account_id AS to_account,\n a.journal_id,\n a.amount,\n a.comment,\n a.created_at,\n a.created_by\nFROM \".$this->db->dbprefix('temp_postings_1').\" AS a , \".$this->db->dbprefix('postings').\" AS b \nWHERE a.journal_id=b.journal_id AND a.amount=b.amount*-1 \n AND a.comment=b.comment AND a.created_at=b.created_at\n AND a.created_by=b.created_by AND a.amount>0\n AND a.transaction_id=b.transaction_id)\");\n\n\n\n $dataset=$this->db->query(\"SELECT a.transaction_id,\n CONCAT(b.name,' [#',b.code,'] ') AS from_account,\n CONCAT(c.name,' [#',c.code,'] ') AS to_account,\n d.type AS journal_type,\n a.amount,\n a.comment,\n a.created_at,\n CONCAT(e.first_name,' ',e.last_name) AS created_by\n\nFROM \".$this->db->dbprefix('temp_postings_2').\" AS a\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS b ON a.from_account=b.id\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS c ON a.to_account =c.id\nLEFT JOIN \".$this->db->dbprefix('journals').\" AS d ON a.journal_id =d.id\nLEFT JOIN \".$this->db->dbprefix('users').\" AS e ON a.created_by=e.id \nORDER BY created_at DESC\");\n\n return $dataset->result();\n}",
"protected function joinProgressTable() {\n $until = CRM_Utils_Array::value('effective_date_value', $this->_params);\n $untilClause = '';\n if ($until) {\n $untilClause = ' AND c.receive_date <=\"' . CRM_Utils_Type::validate(CRM_Utils_Date::processDate($until, 235959), 'Integer') . '\"';\n }\n $this->_from .= \" LEFT JOIN\n\n (\n SELECT CONCAT('p', p.id) as id, contact_id, campaign_id, financial_type_id,\n COALESCE(amount, 0) - COALESCE(cancelled_amount, 0) as total_amount,\n currency,\n COALESCE(paid_amount, 0) as paid_amount,\n COALESCE(amount - paid_amount, 0) - COALESCE(cancelled_amount, 0) as balance_amount,\n 1 as is_pledge\n\nFROM civicrm_pledge p\nLEFT JOIN\n (SELECT pledge_id,\n sum(if(status_id = 1 $untilClause , actual_amount, 0)) as paid_amount,\n sum(if(status_id = 3 $untilClause , scheduled_amount, 0)) as cancelled_amount\n\n FROM civicrm_pledge_payment\n LEFT JOIN civicrm_contribution c ON c.id = contribution_id\n GROUP BY pledge_id\n ) as pp\n ON pp.pledge_id = p.id\n WHERE p.is_test = 0\n \";\n if ($until) {\n $this->_from .= ' AND p.create_date <=\"' . CRM_Utils_Type::validate(CRM_Utils_Date::processDate($until, 235959), 'Integer') . '\"';\n }\n\n $this->_from .= \" UNION\n\n SELECT CONCAT('c', c.id) as id, contact_id, campaign_id, financial_type_id,\n COALESCE(total_amount, 0) as total_amount, c.currency,\n COALESCE(total_amount, 0) as paid_amount,\n 0 as balance_amount,\n 0 as is_pledge\n FROM civicrm_contribution c\n LEFT JOIN civicrm_pledge_payment pp ON pp.contribution_id = c.id\n WHERE c.contribution_status_id = 1\n AND pp.id IS NULL \";\n if ($until) {\n $this->_from .= ' AND c.receive_date <= \"' . CRM_Utils_Type::validate(CRM_Utils_Date::processDate($until, 235959), 'Integer') . '\"';\n }\n\n $this->_from .= \") as progress ON progress.campaign_id = {$this->_aliases['civicrm_campaign']}.id\n \";\n }",
"private function gen_provSQL() {\n\t\t\t$this -> Retun_val = true;\n\t\t}",
"public function change()\n {\n$query =<<<'EOD'\n\nCREATE OR REPLACE FUNCTION materialize_paging_column(integer) RETURNS VOID\nVOLATILE\nLANGUAGE SQL STRICT\nAS $$\n update paging_table\n set m_prop_column_full = full_data,\n m_prop_column_small = small_data,\n m_column = cols\n from (SELECT jsonb_build_object('columns',\n jsonb_agg(jsonb_build_object(\n 'data',p.name,\n 'visible', coalesce(p.is_visible,false),\n 'primary', coalesce(is_primary,false),\n 'title', coalesce(p.title,p.name),\n 'orderable',Coalesce(p.is_orderable,true),\n 'is_filter',p.is_filter,\n 'type', pt.name,\n 'cd',coalesce(p.condition,pt.cond_default),\n 'cdi', p.item_condition) ORDER by p.priority)) as full_data,\n jsonb_build_object('columns',\n jsonb_agg(jsonb_build_object(\n 'data',p.name ,\n 'visible',coalesce(p.is_visible,false),\n 'primary',coalesce(is_primary,false),\n 'orderable',Coalesce(p.is_orderable,true),\n 'title', coalesce(p.title,p.name),\n 'type', pt.name) ORDER by priority)) as small_data,\n string_agg(p.name,',' ORDER BY priority) as cols,\n p.paging_table_id\n from paging_column as p\n left join paging_column_type as pt on p.paging_column_type_id = pt.id\n where p.paging_table_id = $1\n and p.is_visible is true or p.is_primary is true\n GROUP BY p.paging_table_id ) as rs\n where rs.paging_table_id = paging_table.id;\n$$;\n\ncreate or replace function rebuild_paging_prop(a_vw_view text, a_descr text, a_type_name text, a_is_mat boolean) returns text\nLANGUAGE plpgsql\nAS $$\nDECLARE\n val_object_table_id INTEGER = (SELECT id\n FROM paging_table\n WHERE name =a_vw_view);\nBEGIN\n drop table if EXISTS temp_paging_col_prop;\n\n create temp table temp_paging_col_prop as\n (\n SELECT pv.viewname as tablename, isc.column_name as col, t.typname AS col_type,pgi.id as col_type_id,p.attnum as pr\n FROM pg_views AS pv\n JOIN information_schema.columns AS isc ON pv.viewname = isc.table_name\n JOIN pg_attribute AS p ON p.attrelid = isc.table_name :: REGCLASS AND isc.column_name = p.attname\n JOIN pg_type AS t ON p.atttypid = t.oid\n left join paging_column_type as pgi on pgi.name = t.typname\n WHERE schemaname = 'public' and pv.viewname = a_vw_view\n union all\n SELECT pv.tablename as tablename, isc.column_name as col, t.typname AS col_type,pgi.id as col_type_id,p.attnum as pr\n FROM pg_tables AS pv\n JOIN information_schema.columns AS isc ON pv.tablename = isc.table_name\n JOIN pg_attribute AS p ON p.attrelid = isc.table_name :: REGCLASS AND isc.column_name = p.attname\n JOIN pg_type AS t ON p.atttypid = t.oid\n left join paging_column_type as pgi on pgi.name = t.typname\n where pv.schemaname = 'public' and pv.tablename = a_vw_view\n );\n\n --- delete if table not exists\n delete from paging_table\n where id = val_object_table_id\n and not exists (select 1\n from temp_paging_col_prop limit 1)\n RETURNING id\n into val_object_table_id;\n\n --- create object if not exists (return paging_table_id)\n select get_set_paging_table_object as id\n from get_set_paging_table_object((select tablename from temp_paging_col_prop limit 1),a_descr,a_type_name,a_is_mat)\n into val_object_table_id;\n\n --- update paging_columns_prop\n update paging_column\n set paging_column_type_id = r.col_type_id,priority = coalesce(priority,r.pr)\n from (select pcp.id,t.col_type_id,t.pr\n from temp_paging_col_prop as t\n join paging_column as pcp on pcp.name = t.col\n where pcp.paging_table_id = val_object_table_id\n ) as r\n where r.id = paging_column.id;\n\n insert into paging_column(paging_table_id,paging_column_type_id,name,priority)\n select val_object_table_id,col_type_id,col,pr\n from temp_paging_col_prop\n ON CONFLICT (paging_table_id,name) DO NOTHING;\n\n\n delete from paging_column\n where paging_column_type_id = val_object_table_id\n and name not in (select col from temp_paging_col_prop);\n\n perform materialize_paging_column((select id from paging_table where name =a_vw_view));\n\n RETURN '';\nEND;\n$$;\n\ncreate or replace function paging_columns_prop_before_update_paging_table_mat_trg() returns trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN \n perform materialize_paging_column(new.paging_table_id);\nRETURN NEW;\nEND;\n$$;\n\nupdate paging_table\n set last_paging_table_materialize_info_id = null\nwhere name in ('paging_table','paging_column_type','paging_column');\n\ndelete from paging_table_materialize_info\n where paging_table_id in\n (select id from paging_table\nwhere name in ('paging_table','paging_column_type','paging_column'));\n\ndelete from paging_table\nwhere name in ('paging_table','paging_column_type','paging_column');\n\ncreate or replace function get_set_paging_table_object(a_name text, a_descr text, a_type text, a_is_mat boolean) returns integer\nLANGUAGE plpgsql\nAS $$\ndeclare\n val_id integer = (select id from paging_table where name = $1);\n val_type_id integer = (select id from paging_table_type where name = $3);\nBEGIN\n if (val_id is null)\n then\n insert into paging_table(name, descr,paging_table_type_id,is_materialize)\n select $1,$2,Coalesce(val_type_id,1),coalesce(a_is_mat,false)\n RETURNING id\n into val_id;\n END IF;\n RETURN val_id;\nEND;\n$$;\n\nselect rebuild_paging_prop('paging_table',null,'table',false);\nselect rebuild_paging_prop('paging_column_type',null,'table',false);\nselect rebuild_paging_prop('paging_column',null,'table',false);\n\nupdate paging_column\nset is_visible = false\nwhere paging_table_id in (select id from paging_table where name in ('paging_table','paging_column','paging_column_type'));\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_table')\nand name in ('id','name','descr');\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_column')\nand name in ('id','paging_table_id','paging_column_type_id','name','title','is_visible','is_orderable','is_primary','priority');\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_column_type')\nand name in ('id','name');\n\nselect materialize_worker('recreate','vw_gen_materialize',null);\n\nEOD;\n$this->execute($query);\n}",
"public function get_estimations_views($id,$name,$identity_name)\n {\n Log::info(\"TransactionController->get_estimations_views :- Inside \");\n //dd($identity_name);\n $organization_id = Session::get('organization_id');\n $name = $name;\n $id = $id;\n $identity_name = $identity_name;\n \n /*$job_request_id = AccountVoucher::select('id')->where('name','job_request')->where('organization_id',$organization_id)->first(); \n\n $job_invoice_id = AccountVoucher::select('id')->where('name','job_invoice')\n ->where('organization_id',$organization_id)->first(); \n\n $job_invoice_cash_id = AccountVoucher::select('id')->where('name','job_invoice_cash')\n ->where('organization_id',$organization_id)->first();\n\n $delivery_id = AccountVoucher::select('id')->where('name','delivery_note')\n ->where('organization_id',$organization_id)->first();\n\n $grn_id = AccountVoucher::select('id')->where('name','goods_receipt_note')\n ->where('organization_id',$organization_id)->first();*/\n //dd($job_invoice_id->id);\n \n $status = '';\n \n $transaction_type = AccountVoucher::where('name', $name)->where('organization_id', $organization_id)->first();\n\n //dd($transaction_type); \n $payment = PaymentMode::where('status', 1)->pluck('display_name','id');\n $payment->prepend('Cash','1');\n\n $journal_voucher = AccountVoucher::where('name', 'journal')->where('organization_id', $organization_id)->first()->id;\n\n if($name == \"payment\") {\n $transaction_id = AccountVoucher::where('name', 'purchases')->where('organization_id', $organization_id)->first()->id;\n $cash_voucher = AccountVoucher::where('name', 'payment')->where('organization_id', $organization_id)->first()->id;\n $return_voucher = AccountVoucher::where('name', 'debit_note')->where('organization_id', $organization_id)->first()->id;\n $user = \"Vendor\";\n } else if($name == \"receipt\") {\n $transaction_id = AccountVoucher::where('name', 'sales')->where('organization_id', $organization_id)->first()->id;\n $cash_voucher = AccountVoucher::where('name', 'receipt')->where('organization_id', $organization_id)->first()->id;\n $return_voucher = AccountVoucher::where('name', 'credit_note')->where('organization_id', $organization_id)->first()->id;\n $user = \"Customer\";\n }\n else if($name == \"wms_receipt\") {\n $transaction_id = AccountVoucher::where('name', 'job_invoice')->where('organization_id', $organization_id)->first()->id;\n $cash_voucher = AccountVoucher::where('name', 'wms_receipt')->where('organization_id', $organization_id)->first()->id;\n //dd($cash_voucher);\n\n $return_voucher = AccountVoucher::where('name', 'credit_note')->where('organization_id', $organization_id)->first()->id;\n $user = \"Customer\";\n }\n\n $view_estimations = Transaction::select('transactions.id', 'transactions.order_no',\n DB::raw('COALESCE(DATE_FORMAT(transactions.created_at, \"%d-%m-%Y\"), \"\") as created_on'), \n DB::raw('COALESCE(DATE_FORMAT(transactions.date, \"%d-%m-%Y\"), \"\") as date'), \n DB::raw('COALESCE(DATEDIFF(NOW(), transactions.due_date), \"\") as overdue'), \n DB::raw('COALESCE(DATE_FORMAT(transactions.due_date, \"%d-%m-%Y\"), \"\") as due_date'), \n DB::raw('IF(transactions.transaction_type_id = '.$transaction_type->id.', \"1\", 0) AS cash_transaction'),\n 'transactions.total', \n DB::raw('IF(people.id IS NULL, business.display_name, people.display_name ) AS customer'),\n 'transactions.due_date as original_due_date',\n DB::raw(\"IF( (SELECT SUM(account_transactions.amount) FROM account_entries LEFT JOIN account_transactions ON account_transactions.entry_id = account_entries.id WHERE account_entries.reference_transaction_id = transactions.id AND account_entries.voucher_id IN ($journal_voucher, $cash_voucher, $return_voucher)) IS NULL, \n\n transactions.total, \n\n transactions.total - (SELECT SUM(account_transactions.amount) FROM account_entries LEFT JOIN account_transactions ON account_transactions.entry_id = account_entries.id WHERE account_entries.reference_transaction_id = transactions.id AND account_entries.voucher_id IN ($journal_voucher, $cash_voucher, $return_voucher)) ) AS balance\"), \n\n DB::raw(\"CASE WHEN (transactions.total - SUM((SELECT SUM(account_transactions.amount) FROM account_entries LEFT JOIN account_transactions ON account_transactions.entry_id = account_entries.id WHERE account_entries.reference_transaction_id = transactions.id AND account_entries.voucher_id IN ($journal_voucher, $cash_voucher, $return_voucher)))) = 0 THEN 1 \n WHEN transactions.due_date < CURDATE() THEN 3 \n WHEN (transactions.total - SUM((SELECT SUM(account_transactions.amount) FROM account_entries LEFT JOIN account_transactions ON account_transactions.entry_id = account_entries.id WHERE account_entries.reference_transaction_id = transactions.id AND account_entries.voucher_id IN ($journal_voucher, $cash_voucher, $return_voucher)))) > 0 THEN 2\n ELSE 0 \n END AS status\"), \n\n\n 'transactions.approval_status', 'transactions.user_type', 'transactions.people_id');\n\n $view_estimations->leftJoin('people', function($query) {\n $query->on('transactions.people_id','=','people.person_id');\n $query->where('transactions.user_type','=','0');\n });\n\n $view_estimations->leftJoin('people AS business', function($query) {\n $query->on('transactions.people_id','=','business.business_id');\n $query->where('transactions.user_type','=','1');\n });\n\n $view_estimations->where('transactions.organization_id', $organization_id);\n if($identity_name == \"job_invoice_payment\")\n {\n $view_estimations->where('reference_id',$id);\n }\n if($identity_name == \"payment\")\n {\n $view_estimations->where('transactions.id',$id);\n }\n $view_estimations->where('transaction_type_id',$transaction_id);\n\n /*if($name == \"job_request\")\n {\n $view_estimations->where('transaction_type_id',$job_request_id->id);\n }\n if($name == \"job_invoice\")\n {\n $view_estimations->where(function($query) use($job_invoice_id,$job_invoice_cash_id)\n {\n $query->where('transaction_type_id',$job_invoice_id->id)\n ->orWhere('transaction_type_id',$job_invoice_cash_id->id);\n });\n \n \n }\n if($name == \"delivery_note\")\n {\n $view_estimations->where('transaction_type_id',$delivery_id->id);\n }\n if($name == \"goods_receipt_note\")\n {\n $view_estimations->where('transaction_type_id',$grn_id->id);\n }\n*/\n $view_estimations->groupby('transactions.id');\n\n $view_estimations->havingRaw('status != 1');\n\n $view_estimations->havingRaw('balance > 0');\n\n $view_estimation = $view_estimations->get();\n //dd($view_estimation);\n $ledgers = AccountLedger::select('account_ledgers.id', 'account_ledgers.display_name AS name','account_groups.name AS group')\n ->leftJoin('account_groups', 'account_groups.id', '=', 'account_ledgers.group_id')\n ->whereIn('account_groups.name', ['cash','bank_account'])\n ->where('account_ledgers.organization_id', $organization_id)\n ->where('account_ledgers.approval_status', '1')\n ->where('account_ledgers.status', '1')\n ->orderby('account_ledgers.id','asc')\n ->pluck('name', 'id');\n Log::info(\"TransactionController->get_estimations_views :- return \");\n\n if(count($view_estimation) == 0 )\n {\n \n $status = 0;\n\n return view('inventory.pay_bill',compact('view_estimation','id','status','name','payment','ledgers'));\n \n\n }\n else\n {\n $status = 1;\n //dd($status);\n\n return view('inventory.pay_bill',compact('view_estimation','id','status','name','payment','ledgers'));\n \n }\n }",
"protected function _prepareCollection() {\n $collection = Config::get()->collectionTransaction();\n $asTrnx = 'main_table';\n $collection->addFieldToSelect(Transaction::ATTR_ID, self::AS_TRAN_ID);\n $collection->addFieldToSelect(Transaction::ATTR_DATE_APPLIED, self::AS_DATE_APPLIED);\n $collection->addFieldToSelect(Transaction::ATTR_VALUE, self::AS_VALUE);\n /* LEFT JOIN prxgt_bonus_operation oper ON trnx.operation_id = oper.id */\n $asOper = 'oper';\n $tbl = array( $asOper => Config::ENTITY_OPERATION );\n $cond = $asTrnx . '.' . Transaction::ATTR_OPERATION_ID . '=' . $asOper . '.' . Operation::ATTR_ID;\n $cols = array(\n self::AS_OPER_ID => Operation::ATTR_ID,\n self::AS_DATE_PERFORMED => Operation::ATTR_DATE_PERFORMED\n );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account credit ON trnx.credit_acc_id = credit.id */\n $asCredit = 'credit';\n $tbl = array( $asCredit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_CREDIT_ACC_ID . '=' . $asCredit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_account debit ON trnx.debit_acc_id = debit.id */\n $asDebit = 'debit';\n $tbl = array( $asDebit => Config::ENTITY_ACCOUNT );\n $cond = $asTrnx . '.' . Transaction::ATTR_DEBIT_ACC_ID . '=' . $asDebit . '.' . Account::ATTR_ID;\n $cols = array();\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custCred ON credit.customer_id = custCred.entity_id */\n $asCreditCust = 'creditCust';\n $tbl = array( $asCreditCust => 'customer/entity' );\n $cond = $asCredit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asCreditCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_CREDIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN customer_entity custDeb ON debit.customer_id = custDeb.entity_id */\n $asDebitCust = 'debitCust';\n $tbl = array( $asDebitCust => 'customer/entity' );\n $cond = $asDebit . '.' . Account::ATTR_CUSTOMER_ID . '=' . $asDebitCust . '.' . Eav::DEFAULT_ENTITY_ID_FIELD;\n $cols = array( self::AS_DEBIT_CUST => ConfigCore::ATTR_CUST_MLM_ID );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_asset asset ON credit.asset_id = asset.id */\n $asAsset = 'asset';\n $tbl = array( $asAsset => Config::ENTITY_TYPE_ASSET );\n $cond = $asCredit . '.' . Account::ATTR_ASSET_ID . '=' . $asAsset . '.' . TypeAsset::ATTR_ID;\n $cols = array( self::AS_ASSET_CODE => TypeAsset::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* LEFT JOIN prxgt_bonus_type_oper operType ON oper.type_id = operType.id */\n $asOperType = 'operType';\n $tbl = array( $asOperType => Config::ENTITY_TYPE_OPER );\n $cond = $asOper . '.' . Operation::ATTR_TYPE_ID . '=' . $asOperType . '.' . TypeOper::ATTR_ID;\n $cols = array( self::AS_OPER_CODE => TypeOper::ATTR_CODE );\n $collection->join($tbl, $cond, $cols);\n /* prepare collection */\n $sql = $collection->getSelectSql(true);\n $this->setCollection($collection);\n parent::_prepareCollection();\n return $this;\n }",
"function EditData($conn)\r\n{\r\n\r\n\tphpmkr_query('START TRANSACTION;', $conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: BEGIN TRAN');\r\n\t\r\n//SOLICITUD\r\n\r\n\t// Field credito_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_credito_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_credito_tipo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`credito_tipo_id`\"] = $theValue;\r\n\r\n\t// Field solicitud_status_id\r\n\t$theValue = ($GLOBALS[\"x_solicitud_status_id\"] != \"\") ? intval($GLOBALS[\"x_solicitud_status_id\"]) : \"NULL\";\r\n\t$fieldList[\"`solicitud_status_id`\"] = $theValue;\r\n\r\n\t// Field folio\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_folio\"]) : $GLOBALS[\"x_folio\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`folio`\"] = $theValue;\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_fecha_registro\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_registro\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_registro`\"] = $theValue;\r\n\r\n\t// Field promotor_id\r\n\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t$fieldList[\"`promotor_id`\"] = $theValue;\r\n\r\n\t// Field importe_solicitado\r\n\t$theValue = ($GLOBALS[\"x_importe_solicitado\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_importe_solicitado\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`importe_solicitado`\"] = $theValue;\r\n\r\n\t// Field plazo\r\n\t$theValue = ($GLOBALS[\"x_plazo_id\"] != \"\") ? intval($GLOBALS[\"x_plazo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`plazo_id`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_forma_pago_id\"] != \"\") ? intval($GLOBALS[\"x_forma_pago_id\"]) : \"NULL\";\r\n\t$fieldList[\"`forma_pago_id`\"] = $theValue;\r\n\r\n\t// Field contrato\r\n\t$theValue = $GLOBALS[\"x_contrato\"][0];\r\n\t$theValue = ($theValue != \"\") ? intval($theValue) : \"NULL\";\r\n\t$fieldList[\"`contrato`\"] = $theValue;\r\n\r\n\t// Field pagare\r\n\t$theValue = $GLOBALS[\"x_pagare\"][0];\r\n\t$theValue = ($theValue != \"\") ? intval($theValue) : \"NULL\";\r\n\t$fieldList[\"`pagare`\"] = $theValue;\r\n\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_comentario_promotor\"]) : $GLOBALS[\"x_comentario_promotor\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`comentario_promotor`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_comentario_comite\"]) : $GLOBALS[\"x_comentario_comite\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`comentario_comite`\"] = $theValue;\r\n\r\n\r\n\r\n\t// solicitud_anterior\r\n\t$x_solicitud_id_ant = $GLOBALS[\"x_solicitud_id\"];\r\n\t$fieldList[\"`solicitud_id_ant`\"] = $GLOBALS[\"x_solicitud_id\"];\r\n\r\n\r\n$theValue = ($GLOBALS[\"x_actividad_id\"] != \"\") ? intval($GLOBALS[\"x_actividad_id\"]) : \"0\";\r\n\t$fieldList[\"`actividad_id`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_actividad_desc\"]) : $GLOBALS[\"x_actividad_desc\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`actividad_desc`\"] = $theValue;\r\n\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `solicitud` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\t$x_solicitud_id = mysql_insert_id();\r\n\r\n\r\n\t$sSql = \"update solicitud set solicitud_status_id = 8 where solicitud_id = $x_solicitud_id_ant\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n//FOLIO\t\r\n\t$currentdate_fol = getdate(time());\r\n\t$x_solicitud_fol = str_pad($x_solicitud_id, 5, \"0\", STR_PAD_LEFT);\r\n\t$x_dia_fol = str_pad($currentdate_fol[\"mday\"], 2, \"0\", STR_PAD_LEFT);\r\n\t$x_mes_fol = str_pad($currentdate_fol[\"mon\"], 2, \"0\", STR_PAD_LEFT);\r\n\t$x_year_fol = str_pad($currentdate_fol[\"year\"], 2, \"0\", STR_PAD_LEFT);\t\t\t\r\n\t\r\n\t$x_folio = \"CP$x_solicitud_fol\".$x_dia_fol.$x_mes_fol.$x_year_fol;\t\r\n\t$sSql = \"update solicitud set folio = '$x_folio' where solicitud_id = $x_solicitud_id\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n\r\n\r\n//CLIENTE\r\n\r\n\t$fieldList = NULL;\r\n\t// Field solicitud_id\r\n//\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\r\n\t// Field usuario_id\r\n//\t$theValue = ($GLOBALS[\"x_usuario_id\"] != \"\") ? intval($GLOBALS[\"x_usuario_id\"]) : \"NULL\";\r\n\t$fieldList[\"`usuario_id`\"] = 0;\r\n\r\n\t// Field nombre_completo\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_nombre_completo\"]) : $GLOBALS[\"x_nombre_completo\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`nombre_completo`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_apellido_paterno\"]) : $GLOBALS[\"x_apellido_paterno\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`apellido_paterno`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_apellido_materno\"]) : $GLOBALS[\"x_apellido_materno\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`apellido_materno`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_tit_rfc\"]) : $GLOBALS[\"x_tit_rfc\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`rfc`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_tit_curp\"]) : $GLOBALS[\"x_tit_curp\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`curp`\"] = $theValue;\r\n\r\n\r\n\t// Field tipo_negocio\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_tipo_negocio\"]) : $GLOBALS[\"x_tipo_negocio\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`tipo_negocio`\"] = $theValue;\r\n\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_tit_fecha_nac\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_tit_fecha_nac\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_nac`\"] = $theValue;\r\n\r\n\r\n\t// Field edad\r\n\t$theValue = ($GLOBALS[\"x_edad\"] != \"\") ? intval($GLOBALS[\"x_edad\"]) : \"NULL\";\r\n\t$fieldList[\"`edad`\"] = $theValue;\r\n\r\n\t// Field sexo\r\n\t$theValue = ($GLOBALS[\"x_sexo\"] != \"\") ? intval($GLOBALS[\"x_sexo\"]) : \"NULL\";\r\n\t$fieldList[\"`sexo`\"] = $theValue;\r\n\r\n\t// Field estado_civil_id\r\n\t$theValue = ($GLOBALS[\"x_estado_civil_id\"] != \"\") ? intval($GLOBALS[\"x_estado_civil_id\"]) : \"0\";\r\n\t$fieldList[\"`estado_civil_id`\"] = $theValue;\r\n\r\n\t// Field numero_hijos\r\n\t$theValue = ($GLOBALS[\"x_numero_hijos\"] != \"\") ? intval($GLOBALS[\"x_numero_hijos\"]) : \"0\";\r\n\t$fieldList[\"`numero_hijos`\"] = $theValue;\r\n\r\n\r\n\t// Field numero_hijos_dep\r\n\t$theValue = ($GLOBALS[\"x_numero_hijos_dep\"] != \"\") ? intval($GLOBALS[\"x_numero_hijos_dep\"]) : \"0\";\r\n\t$fieldList[\"`numero_hijos_dep`\"] = $theValue;\r\n\r\n\t// Field nombre_conyuge\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_nombre_conyuge\"]) : $GLOBALS[\"x_nombre_conyuge\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`nombre_conyuge`\"] = $theValue;\r\n\r\n\t// Field nombre_conyuge\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_email\"]) : $GLOBALS[\"x_email\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`email`\"] = $theValue;\r\n\r\n\r\n\t$theValue = ($GLOBALS[\"x_nacionalidad_id\"] != \"\") ? intval($GLOBALS[\"x_nacionalidad_id\"]) : \"0\";\r\n\t$fieldList[\"`nacionalidad_id`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_empresa\"]) : $GLOBALS[\"x_empresa\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`empresa`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_piesto\"]) : $GLOBALS[\"x_puesto\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`puesto`\"] = $theValue;\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_fecha_contratacion\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_contratacion\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_contratacion`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_salario_mensual\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_salario_mensual\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`salario_mensual`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `cliente` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\t$x_cliente_id = mysql_insert_id();\r\n\r\n\r\n\r\n//SOLICITUD CLIENTE\r\n\r\n\t$fieldList = NULL;\r\n\t// Field solicitud_id\r\n\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\r\n\t$fieldList[\"`cliente_id`\"] = $x_cliente_id;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `solicitud_cliente` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n//DIRECCION PART\r\n\r\n\t$fieldList = NULL;\r\n\t// Field cliente_id\r\n//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t$fieldList[\"`cliente_id`\"] = $x_cliente_id;\r\n\r\n\t// Field aval_id\r\n//\t$theValue = ($GLOBALS[\"x_aval_id\"] != \"\") ? intval($GLOBALS[\"x_aval_id\"]) : \"NULL\";\r\n\t$fieldList[\"`aval_id`\"] = 0;\r\n\r\n\t// Field promotor_id\r\n//\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t$fieldList[\"`promotor_id`\"] = 0;\r\n\r\n\t// Field direccion_tipo_id\r\n//\t$theValue = ($GLOBALS[\"x_direccion_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_direccion_tipo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`direccion_tipo_id`\"] = 1;\r\n\r\n\t// Field calle\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_calle\"]) : $GLOBALS[\"x_calle\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`calle`\"] = $theValue;\r\n\r\n\t// Field colonia\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_colonia\"]) : $GLOBALS[\"x_colonia\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`colonia`\"] = $theValue;\r\n\r\n\t// Field delegacion_id\r\n\t$theValue = ($GLOBALS[\"x_delegacion_id\"] != \"\") ? intval($GLOBALS[\"x_delegacion_id\"]) : \"0\";\r\n\t$fieldList[\"`delegacion_id`\"] = $theValue;\r\n\r\n\t// Field propietario\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_propietario\"]) : $GLOBALS[\"x_propietario\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`propietario`\"] = $theValue;\r\n\r\n/*\r\n\t// Field entidad\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_entidad\"]) : $GLOBALS[\"x_entidad\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`entidad`\"] = $theValue;\r\n*/\r\n\t// Field codigo_postal\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_codigo_postal\"]) : $GLOBALS[\"x_codigo_postal\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`codigo_postal`\"] = $theValue;\r\n\r\n\t// Field ubicacion\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ubicacion\"]) : $GLOBALS[\"x_ubicacion\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ubicacion`\"] = $theValue;\r\n\r\n\t// Field antiguedad\r\n\t$theValue = ($GLOBALS[\"x_antiguedad\"] != \"\") ? intval($GLOBALS[\"x_antiguedad\"]) : \"0\";\r\n\t$fieldList[\"`antiguedad`\"] = $theValue;\r\n\r\n\t// Field vivienda_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_vivienda_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_vivienda_tipo_id\"]) : \"0\";\r\n\t$fieldList[\"`vivienda_tipo_id`\"] = $theValue;\r\n\r\n\t// Field otro_tipo_vivienda\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_otro_tipo_vivienda\"]) : $GLOBALS[\"x_otro_tipo_vivienda\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`otro_tipo_vivienda`\"] = $theValue;\r\n\r\n\t// Field telefono\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono\"]) : $GLOBALS[\"x_telefono\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_sec\"]) : $GLOBALS[\"x_telefono_sec\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono_movil`\"] = $theValue;\r\n\r\n\t// Field telefono_secundario\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_secundario\"]) : $GLOBALS[\"x_telefono_secundario\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono_secundario`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `direccion` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL AQUI: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n//DIRECCION NEG\r\n\r\n\t$fieldList = NULL;\r\n\t// Field cliente_id\r\n//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t$fieldList[\"`cliente_id`\"] = $x_cliente_id;\r\n\r\n\t// Field aval_id\r\n//\t$theValue = ($GLOBALS[\"x_aval_id\"] != \"\") ? intval($GLOBALS[\"x_aval_id\"]) : \"NULL\";\r\n\t$fieldList[\"`aval_id`\"] = 0;\r\n\r\n\t// Field promotor_id\r\n//\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t$fieldList[\"`promotor_id`\"] = 0;\r\n\r\n\t// Field direccion_tipo_id\r\n//\t$theValue = ($GLOBALS[\"x_direccion_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_direccion_tipo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`direccion_tipo_id`\"] = 2;\r\n\r\n\t// Field calle\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_calle2\"]) : $GLOBALS[\"x_calle2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`calle`\"] = $theValue;\r\n\r\n\t// Field colonia\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_colonia2\"]) : $GLOBALS[\"x_colonia2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`colonia`\"] = $theValue;\r\n\r\n\t// Field delegacion_id\r\n\t$theValue = ($GLOBALS[\"x_delegacion_id2\"] != \"\") ? intval($GLOBALS[\"x_delegacion_id2\"]) : \"0\";\r\n\t$fieldList[\"`delegacion_id`\"] = $theValue;\r\n/*\r\n\t// Field otra_delegacion\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_otra_delegacion\"]) : $GLOBALS[\"x_otra_delegacion\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`otra_delegacion`\"] = $theValue;\r\n*/\r\n/*\r\n\t// Field entidad\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_entidad2\"]) : $GLOBALS[\"x_entidad2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`entidad`\"] = $theValue;\r\n*/\r\n\t// Field codigo_postal\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_codigo_postal2\"]) : $GLOBALS[\"x_codigo_postal2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`codigo_postal`\"] = $theValue;\r\n\r\n\t// Field ubicacion\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ubicacion2\"]) : $GLOBALS[\"x_ubicacion2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ubicacion`\"] = $theValue;\r\n\r\n\t// Field antiguedad\r\n\t$theValue = ($GLOBALS[\"x_antiguedad\"] != \"\") ? intval($GLOBALS[\"x_antiguedad2\"]) : \"0\";\r\n\t$fieldList[\"`antiguedad`\"] = $theValue;\r\n\r\n\t// Field vivienda_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_vivienda_tipo_id2\"] != \"\") ? intval($GLOBALS[\"x_vivienda_tipo_id2\"]) : \"0\";\r\n\t$fieldList[\"`vivienda_tipo_id`\"] = $theValue;\r\n\r\n\t// Field otro_tipo_vivienda\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_otro_tipo_vivienda2\"]) : $GLOBALS[\"x_otro_tipo_vivienda2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`otro_tipo_vivienda`\"] = $theValue;\r\n\r\n\t// Field telefono\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono2\"]) : $GLOBALS[\"x_telefono2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono`\"] = $theValue;\r\n\r\n\t// Field telefono_secundario\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_secundario2\"]) : $GLOBALS[\"x_telefono_secundario2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono_secundario`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `direccion` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n//AVAL\r\n\r\n\tif($GLOBALS[\"x_nombre_completo_aval\"] != \"\"){\r\n\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n\t//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\t\r\n\t\t// Field nombre_completo\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_nombre_completo_aval\"]) : $GLOBALS[\"x_nombre_completo_aval\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`nombre_completo`\"] = $theValue;\r\n\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_apellido_paterno_aval\"]) : $GLOBALS[\"x_apellido_paterno_aval\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`apellido_paterno`\"] = $theValue;\r\n\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_apellido_materno_aval\"]) : $GLOBALS[\"x_apellido_materno_aval\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`apellido_materno`\"] = $theValue;\r\n\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_aval_rfc\"]) : $GLOBALS[\"x_aval_rfc\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`rfc`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_aval_curp\"]) : $GLOBALS[\"x_aval_curp\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`curp`\"] = $theValue;\r\n\r\n\t\r\n\t\t// Field parentesco_tipo_id\r\n\t\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_aval\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_aval\"]) : \"0\";\r\n\t\t$fieldList[\"`parentesco_tipo_id`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono3\"]) : $GLOBALS[\"x_telefono3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono`\"] = $theValue;\r\n\t\r\n\t\t// Field ingresos_mensuales\r\n\t\t$theValue = ($GLOBALS[\"x_ingresos_mensuales\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_mensuales\"]) . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`ingresos_mensuales`\"] = $theValue;\r\n\t\r\n\t\t// Field ocupacion\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ocupacion\"]) : $GLOBALS[\"x_ocupacion\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`ocupacion`\"] = $theValue;\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `aval` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\r\n\t\t$x_aval_id = mysql_insert_id();\r\n\t\t\r\n\t//DOM PART AVAL\r\n\t\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n\t//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`cliente_id`\"] = 0;\r\n\t\r\n\t\t// Field aval_id\r\n\t//\t$theValue = ($GLOBALS[\"x_aval_id\"] != \"\") ? intval($GLOBALS[\"x_aval_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`aval_id`\"] = $x_aval_id;\r\n\t\r\n\t\t// Field promotor_id\r\n\t//\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`promotor_id`\"] = 0;\r\n\t\r\n\t\t// Field direccion_tipo_id\r\n\t//\t$theValue = ($GLOBALS[\"x_direccion_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_direccion_tipo_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`direccion_tipo_id`\"] = 3;\r\n\t\r\n\t\t// Field calle\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_calle3\"]) : $GLOBALS[\"x_calle3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`calle`\"] = $theValue;\r\n\t\r\n\t\t// Field colonia\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_colonia3\"]) : $GLOBALS[\"x_colonia3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`colonia`\"] = $theValue;\r\n\t\r\n\t\t// Field delegacion_id\r\n\t\t$theValue = ($GLOBALS[\"x_delegacion_id3\"] != \"\") ? intval($GLOBALS[\"x_delegacion_id3\"]) : \"0\";\r\n\t\t$fieldList[\"`delegacion_id`\"] = $theValue;\r\n\t\r\n\t\t// Field propietario\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_propietario2\"]) : $GLOBALS[\"x_propietario2\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`propietario`\"] = $theValue;\r\n\t\r\n/*\r\n\t\t// Field entidad\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_entidad3\"]) : $GLOBALS[\"x_entidad3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`entidad`\"] = $theValue;\r\n*/\t\r\n\t\t// Field codigo_postal\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_codigo_postal3\"]) : $GLOBALS[\"x_codigo_postal3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`codigo_postal`\"] = $theValue;\r\n\t\r\n\t\t// Field ubicacion\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ubicacion3\"]) : $GLOBALS[\"x_ubicacion3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`ubicacion`\"] = $theValue;\r\n\t\r\n\t\t// Field antiguedad\r\n\t\t$theValue = ($GLOBALS[\"x_antiguedad3\"] != \"\") ? intval($GLOBALS[\"x_antiguedad3\"]) : \"0\";\r\n\t\t$fieldList[\"`antiguedad`\"] = $theValue;\r\n\t\r\n\t\t// Field vivienda_tipo_id\r\n\t\t$theValue = ($GLOBALS[\"x_vivienda_tipo_id2\"] != \"\") ? intval($GLOBALS[\"x_vivienda_tipo_id2\"]) : \"0\";\r\n\t\t$fieldList[\"`vivienda_tipo_id`\"] = $theValue;\r\n\t\r\n\t\t// Field otro_tipo_vivienda\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_otro_tipo_vivienda3\"]) : $GLOBALS[\"x_otro_tipo_vivienda3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`otro_tipo_vivienda`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono3\"]) : $GLOBALS[\"x_telefono3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono`\"] = $theValue;\r\n\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono3_sec\"]) : $GLOBALS[\"x_telefono3_sec\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono_movil`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono_secundario\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_secundario3\"]) : $GLOBALS[\"x_telefono_secundario3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono_secundario`\"] = $theValue;\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `direccion` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\r\n\r\n\t//DOM NEG AVAL\r\n\t\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n\t//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`cliente_id`\"] = 0;\r\n\t\r\n\t\t// Field aval_id\r\n\t//\t$theValue = ($GLOBALS[\"x_aval_id\"] != \"\") ? intval($GLOBALS[\"x_aval_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`aval_id`\"] = $x_aval_id;\r\n\t\r\n\t\t// Field promotor_id\r\n\t//\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`promotor_id`\"] = 0;\r\n\t\r\n\t\t// Field direccion_tipo_id\r\n\t//\t$theValue = ($GLOBALS[\"x_direccion_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_direccion_tipo_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`direccion_tipo_id`\"] = 4;\r\n\t\r\n\t\t// Field calle\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_calle3_neg\"]) : $GLOBALS[\"x_calle3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`calle`\"] = $theValue;\r\n\t\r\n\t\t// Field colonia\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_colonia3_neg\"]) : $GLOBALS[\"x_colonia3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`colonia`\"] = $theValue;\r\n\t\r\n\t\t// Field delegacion_id\r\n\t\t$theValue = ($GLOBALS[\"x_delegacion_id3_neg\"] != \"\") ? intval($GLOBALS[\"x_delegacion_id3_neg\"]) : \"0\";\r\n\t\t$fieldList[\"`delegacion_id`\"] = $theValue;\r\n\t\r\n\t\t// Field propietario\r\n/*\t\t\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_propietario2\"]) : $GLOBALS[\"x_propietario2\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`propietario`\"] = $theValue;\r\n*/\t\r\n/*\r\n\t\t// Field entidad\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_entidad3\"]) : $GLOBALS[\"x_entidad3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`entidad`\"] = $theValue;\r\n*/\t\r\n\t\t// Field codigo_postal\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_codigo_postal3_neg\"]) : $GLOBALS[\"x_codigo_postal3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`codigo_postal`\"] = $theValue;\r\n\t\r\n\t\t// Field ubicacion\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ubicacion3_neg\"]) : $GLOBALS[\"x_ubicacion3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`ubicacion`\"] = $theValue;\r\n\t\r\n\t\t// Field antiguedad\r\n\t\t$theValue = ($GLOBALS[\"x_antiguedad3_neg\"] != \"\") ? intval($GLOBALS[\"x_antiguedad3_neg\"]) : \"0\";\r\n\t\t$fieldList[\"`antiguedad`\"] = $theValue;\r\n\t\r\n\t\t// Field vivienda_tipo_id\r\n\t\t$theValue = ($GLOBALS[\"x_vivienda_tipo_id2_neg\"] != \"\") ? intval($GLOBALS[\"x_vivienda_tipo_id2_neg\"]) : \"0\";\r\n\t\t$fieldList[\"`vivienda_tipo_id`\"] = $theValue;\r\n\t\r\n\t\t// Field otro_tipo_vivienda\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_propietario3_neg\"]) : $GLOBALS[\"x_propietario3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`propietario`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono3_neg\"]) : $GLOBALS[\"x_telefono3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono_secundario\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_secundario3_neg\"]) : $GLOBALS[\"x_telefono_secundario3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono_secundario`\"] = $theValue;\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `direccion` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\r\n\r\n\r\n\t//Ingresos AVAL\r\n\t$fieldList = NULL;\r\n\t// Field cliente_id\r\n//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t$fieldList[\"`aval_id`\"] = $x_aval_id;\r\n\r\n\t// Field ingresos_negocio\r\n\t$theValue = ($GLOBALS[\"x_ingresos_mensuales\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_mensuales\"]) . \"'\" : \"0\";\r\n\t$fieldList[\"`ingresos_negocio`\"] = $theValue;\r\n\r\n\t// Field ingresos_familiar_1\r\n\t$theValue = ($GLOBALS[\"x_ingresos_familiar_1_aval\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_familiar_1_aval\"]) . \"'\" : \"0\";\r\n\t$fieldList[\"`ingresos_familiar_1`\"] = $theValue;\r\n\r\n\t// Field parentesco_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ing_1_aval\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ing_1_aval\"]) : \"0\";\r\n\t$fieldList[\"`parentesco_tipo_id`\"] = $theValue;\r\n\r\n\t// Field ingresos_familiar_2\r\n//\t$theValue = ($GLOBALS[\"x_ingresos_familiar_2\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_familiar_2\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ingresos_familiar_2`\"] = 0;\r\n\r\n\t// Field parentesco_tipo_id2\r\n//\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ing_2\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ing_2\"]) : \"0\";\r\n\t$fieldList[\"`parentesco_tipo_id2`\"] = 0;\r\n\r\n\t// Field otros_ingresos\r\n\t$theValue = ($GLOBALS[\"x_otros_ingresos_aval\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_otros_ingresos_aval\"]) . \"'\" : \"0\";\r\n\t$fieldList[\"`otros_ingresos`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos_aval\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos_aval\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos_aval2\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos_aval2\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos_fam_1`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `ingreso_aval` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\t\r\n\r\n\r\n\t\t\r\n\t}\r\n\r\n//GARANTIAS\r\n\r\n\tif($GLOBALS[\"x_garantia_desc\"] != \"\"){\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n\t//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\t\r\n\t\t// Field descripcion\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_garantia_desc\"]) : $GLOBALS[\"x_garantia_desc\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`descripcion`\"] = $theValue;\r\n\t\r\n\t\t// Field valor\r\n\t\t$theValue = ($GLOBALS[\"x_garantia_valor\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_garantia_valor\"]) . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`valor`\"] = $theValue;\r\n\t\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `garantia` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\r\n//INGRESOS\r\n\r\n\t$fieldList = NULL;\r\n\t// Field cliente_id\r\n//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\r\n\t// Field ingresos_negocio\r\n\t$theValue = ($GLOBALS[\"x_ingresos_negocio\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_negocio\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ingresos_negocio`\"] = $theValue;\r\n\r\n\t// Field ingresos_familiar_1\r\n\t$theValue = ($GLOBALS[\"x_ingresos_familiar_1\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_familiar_1\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ingresos_familiar_1`\"] = $theValue;\r\n\r\n\t// Field parentesco_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ing_1\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ing_1\"]) : \"0\";\r\n\t$fieldList[\"`parentesco_tipo_id`\"] = $theValue;\r\n\r\n\t// Field ingresos_familiar_2\r\n\t$theValue = ($GLOBALS[\"x_ingresos_familiar_2\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_familiar_2\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ingresos_familiar_2`\"] = $theValue;\r\n\r\n\t// Field parentesco_tipo_id2\r\n\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ing_2\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ing_2\"]) : \"0\";\r\n\t$fieldList[\"`parentesco_tipo_id2`\"] = $theValue;\r\n\r\n\t// Field otros_ingresos\r\n\t$theValue = ($GLOBALS[\"x_otros_ingresos\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_otros_ingresos\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`otros_ingresos`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos`\"] = $theValue;\r\n\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos2\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos2\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos_fam_1`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos3\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos3\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos_fam_2`\"] = $theValue;\r\n\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `ingreso` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n\r\n//REFERENCIAS CICLO\r\n\r\n\r\n\t$x_counter = 1;\r\n\twhile($x_counter < 6){\r\n\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n//\t\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\r\n\r\n\t\tif($GLOBALS[\"x_nombre_completo_ref_$x_counter\"] != \"\"){\r\n\t\t\r\n\t\t\t// Field nombre_completo\r\n\t\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_nombre_completo_ref_$x_counter\"]) : $GLOBALS[\"x_nombre_completo_ref_$x_counter\"]; \r\n\t\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t\t$fieldList[\"`nombre_completo`\"] = $theValue;\r\n\t\t\r\n\t\t\t// Field telefono\r\n\t\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_ref_$x_counter\"]) : $GLOBALS[\"x_telefono_ref_$x_counter\"]; \r\n\t\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t\t$fieldList[\"`telefono`\"] = $theValue;\r\n\t\t\r\n\t\t\t// Field parentesco_tipo_id\r\n\t\t\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ref_$x_counter\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ref_$x_counter\"]) : \"NULL\";\r\n\t\t\t$fieldList[\"`parentesco_tipo_id`\"] = $theValue;\r\n\t\t\r\n\t\t\t// insert into database\r\n\t\t\t$sSql = \"INSERT INTO `referencia` (\";\r\n\t\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t\t$sSql .= \") VALUES (\";\r\n\t\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t\t$sSql .= \")\";\r\n\t\t\r\n\t\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\t\tif(!$x_result){\r\n\t\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\t\texit();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\r\n\t\t$x_counter++;\r\n\t}\r\n\r\n\tphpmkr_query('commit;', $conn);\t \r\n\t\r\n\treturn true;\r\n}",
"private function beginQuery() {\n $this->sql = 'SELECT sum(inv_total_cost) as total_cost,id,businessname,email,businesstelephone,'\n . 'IFNULL((SELECT SUM(pfp_importo) as pfp_importo FROM plused_fincon_payments where find_in_set(plused_fincon_payments.pfp_bk_id,GROUP_CONCAT(derived_booking_invoice.inv_booking_id)) AND plused_fincon_payments.pfp_dare_avere =\"avere\" ),0) as pfp_import,'\n . 'ROUND((sum(inv_total_cost) - IFNULL((SELECT SUM(pfp_importo) as pfp_importo FROM plused_fincon_payments where find_in_set(plused_fincon_payments.pfp_bk_id,GROUP_CONCAT(derived_booking_invoice.inv_booking_id)) AND plused_fincon_payments.pfp_dare_avere =\"avere\" ),0)), 2) as overdue '\n . 'FROM (SELECT t.* FROM agnt_booking_invoice t INNER JOIN (SELECT inv_total_cost,MAX(inv_invoice_id) AS latest,inv_booking_id FROM agnt_booking_invoice GROUP BY inv_booking_id) t1 ON t1.inv_booking_id=t.inv_booking_id AND t1.latest=t.inv_invoice_id) AS derived_booking_invoice '\n . 'LEFT JOIN agenti ON agenti.id=derived_booking_invoice.inv_agent_id WHERE agenti.status=\"active\" ';\n }",
"function general_fetch($post_json, $my, $append_sql, &$updtoken, $gkey, $parent = \"\", $id = \"\", $override_sql = \"\") {\n \n // Check params\n if (!isCorrectID($updtoken) || !isCorrectID($gkey) || !isCorrectID($parent) || !isCorrectID($id)) throw new Exception(INTERNAL);\n \n // Judge key pattern\n $keycnt = 0;\n $kv1 = $kv2 = \"\";\n if ($parent == \"\" && $id == \"\") {\n $sql_key = \"AND gkey = ? \";\n } elseif ($parent == \"\") {\n $sql_key = \"AND gkey = ? AND rkey = ? \";\n $kv1 = $id;\n $keycnt = 1;\n } elseif ($id == \"\") {\n $sql_key = \"AND gkey = ? AND pkey = ? \";\n $kv1 = $parent;\n $keycnt = 1;\n } else {\n $sql_key = \"AND gkey = ? AND pkey = ? AND rkey = ? \";\n $kv1 = $parent;\n $kv2 = $id;\n $keycnt = 2;\n }\n \n // make transaction data for callback\n $transaction_data = [];\n \n // Callback - onBeforeSelect\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"transaction_data\" => $transaction_data);\n callbackTo(\"onBeforeSelect\", $cbarr, $post_json[\"gkey\"]);\n $transaction_data = $cbarr[\"transaction_data\"];\n \n // Make SQL\n $sql_col = \"SELECT dataid, rkey, pkey, dkey, dvalue\";\n $sql_frm = \"FROM CHAP_DATAS\";\n $sql_whr = \"WHERE delf = 0 AND rdate IS NULL \" . $sql_key . $append_sql;\n $sql_odr = \"ORDER BY rkey desc, dkey\";\n $sql_etc = \"\";\n if ($override_sql != \"\") {\n $sql_whr = \"\";\n $sql_odr = \"\";\n $sql_etc = $override_sql;\n }\n\n \n // Callback - onConstractSelectSQL\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"columns\" => $sql_col, \"from\" => $sql_frm, \"where\" => $sql_whr, \"order\" => $sql_odr, \"etc\" => $sql_etc);\n callbackTo(\"onConstractSelectSQL\", $cbarr, $post_json[\"gkey\"]);\n $sql = $cbarr[\"columns\"] . \" \" . $cbarr[\"from\"] . \" \" . $cbarr[\"where\"] . \" \" . $cbarr[\"order\"] . \" \" . $cbarr[\"etc\"];\n \n // Do SELECT\n if ($stmt = $my->prepare($sql)) {\n \n // Bind query\n if ($keycnt == 0) {\n $stmt->bind_param(\"s\", $gkey);\n } elseif ($keycnt == 1) {\n $stmt->bind_param(\"ss\", $gkey, $kv1);\n } else {\n $stmt->bind_param(\"sss\", $gkey, $kv1, $kv2);\n }\n \n // Execute SQL\n $stmt->execute();\n $stmt->store_result();\n \n // Make onBreak function\n $fx_onBreak = null;\n if ($fx_onBreak == null) {\n $fx_onBreak = function(&$rows, &$tmp) {\n if ($rows == null) $rows = array();\n array_push($rows, $tmp);\n $tmp = [];\n };\n }\n \n // Init fetch buffer\n $dataid = $rkey = $pkey = $dkey = $dvalue = \"\";\n $rows_all = array();\n $current_key = \"\";\n $tmp = array();\n \n // Bind result\n $stmt->bind_result($dataid, $rkey, $pkey, $dkey, $dvalue);\n \n // Fetch\n while ($stmt->fetch()) {\n if ($current_key != \"\" && $current_key != $rkey) {\n \n // Callback - onRowFetched\n $skip = false;\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"transaction_data\" => $transaction_data, \"row\" => $tmp, \"skip\" => &$skip);\n callbackTo(\"onRowFetched\", $cbarr, $post_json[\"gkey\"]);\n $tmp = $cbarr[\"row\"];\n \n if ($skip) $tmp = []; else $fx_onBreak($rows_all, $tmp);\n }\n $tmp[\"id\"] = $rkey;\n $tmp[\"parent\"] = $pkey;\n $tmp[$dkey] = $dvalue;\n $current_key = $rkey;\n }\n if ($current_key != \"\") {\n \n // Callback - onRowFetched\n $skip = false;\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"transaction_data\" => $transaction_data, \"row\" => $tmp, \"skip\" => &$skip);\n callbackTo(\"onRowFetched\", $cbarr, $post_json[\"gkey\"]);\n $tmp = $cbarr[\"row\"];\n \n if ($skip) $tmp = []; else $fx_onBreak($rows_all, $tmp);\n }\n \n // Close\n $stmt->close();\n \n } else {\n error_log(\"[api.php] > Cannot prepare SQL.\");\n throw new Exception(DB_PREPARE_ERR);\n }\n \n // Get current tuple token to update itself\n $sql = \"SELECT token FROM CHAP_UPDTOKENS WHERE 1 = 1 \" . $sql_key;\n if ($stmt = $my->prepare($sql)) {\n \n // Bind query\n if ($keycnt == 0) {\n $stmt->bind_param(\"s\", $gkey);\n } elseif ($keycnt == 1) {\n $stmt->bind_param(\"ss\", $gkey, $kv1);\n } else {\n $stmt->bind_param(\"sss\", $gkey, $kv1, $kv2);\n }\n \n // Execute SQL\n $stmt->execute();\n $stmt->store_result();\n \n // Bind result\n $stmt->bind_result($updtoken);\n if (!$stmt->fetch()) {\n $updtoken = \"INITIALTOKEN\";\n }\n \n // Close\n $stmt->close();\n \n } else {\n error_log(\"[api.php] > Cannot prepare SQL (CHAP_UPDTOKENS).\");\n throw new Exception(DB_PREPARE_ERR);\n }\n \n // Callback - onAllDataFetched\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"data\" => $rows_all);\n callbackTo(\"onAllDataFetched\", $cbarr, $post_json[\"gkey\"]);\n $rows_all = $cbarr[\"data\"];\n \n // Finalize\n return $rows_all;\n \n }",
"public function tnaOrderEdit($id)\n {\n #-----------------------------------------------------------#\n $library=TnaLibrary::get();\n\n\n\n\n $tna = DB::table('mr_order_tna AS t')\n ->select(\n DB::raw('@serial_no := @serial_no + 1 AS serial_no'),\n \"t.*\",\n \"e.order_code\" ,\n \"tm.tna_temp_name\",\n \"tm.id as tm_id\"\n )\n ->leftJoin('mr_order_entry AS e', 'e.order_id', '=', 't.order_id')\n ->leftJoin('mr_tna_template AS tm', 'tm.id', '=', 't.mr_tna_template_id')\n ->where('t.id', $id)\n ->first();\n\n $order_en=OrderEntry::pluck('order_code','order_id');\n\n $order_en2=OrderEntry::where('order_id',$tna->order_id)\n ->first(['mr_buyer_b_id']);\n $tnatype=TnaTemplate::where('mr_buyer_b_id', $order_en2->mr_buyer_b_id)->pluck('tna_temp_name','id');\n\n\n\n\n //$tnaction = OrderTNAction::where('mr_order_entry_order_id', $id)->get();\n //dd($tna->tm_id);\n $tnaction = DB::table('mr_order_tna_action AS t')\n ->select(\n \"t.*\",\n \"t.id as tid\",\n \"ot.*\",\n \"e.order_code\" ,\n \"tm.id AS tmid\",\n \"tm.tna_temp_name\",\n \"tl.id as tlid\",\n \"tl.tna_lib_action\",\n \"tl.tna_lib_offset\",\n \"ttl.tna_temp_logic\",\n \"ttl.id AS lib_id\",\n \"ttl.offset_day\"\n )\n ->leftJoin('mr_order_tna AS ot', 'ot.id', '=', 't.mr_order_entry_order_id')\n ->leftJoin('mr_order_entry AS e', 'e.order_id', '=', 'ot.order_id')\n ->leftJoin('mr_tna_template AS tm', 'tm.id', '=', 'ot.mr_tna_template_id')\n ->leftJoin('mr_tna_library AS tl', 'tl.id', '=', 't.mr_tna_library_id')\n ->leftJoin('mr_tna_template_to_library AS ttl', 'ttl.mr_tna_library_id', '=', 'tl.id')\n ->where('mr_order_entry_order_id', $id)\n ->where('ttl.mr_tna_template_id', $tna->tm_id)\n ->get();\n\n\n\n //dd($tnaction );\n\n return view('merch.time_action.tna_order_edit',compact('library','tnatype','order_en','tna','tnaction'));\n\n }",
"private function get_datatable_query()\n {\n\n $this->column_order = ['transactions.id','c.name', 'c.shop_name','c.mobile','c.district_id','c.upazila_id','c.route_id','c.area_id',null,null,'transactions.created_at',null,null,null];\n \n \n $query = self::select('transactions.*','coa.id as coa_id','coa.code','c.id as customer_id','c.name as customer_name',\n 'c.shop_name','c.mobile','d.name as district_name','u.name as upazila_name','r.name as route_name','a.name as area_name')\n ->join('chart_of_accounts as coa','transactions.chart_of_account_id','=','coa.id')\n ->join('customers as c','coa.customer_id','c.id')\n ->join('locations as d', 'c.district_id', '=', 'd.id')\n ->join('locations as u', 'c.upazila_id', '=', 'u.id')\n ->join('locations as r', 'c.route_id', '=', 'r.id')\n ->join('locations as a', 'c.area_id', '=', 'a.id')\n ->where([\n 'transactions.voucher_type'=>self::TYPE,\n 'transactions.approve'=>1,\n ]);\n\n //search query\n if (!empty($this->customer_id)) {\n $query->where('c.id', $this->customer_id);\n }\n if (!empty($this->_district_id)) {\n $query->where('c.district_id', $this->_district_id);\n }\n if (!empty($this->_upazila_id)) {\n $query->where('c.upazila_id', $this->_upazila_id);\n }\n if (!empty($this->_route_id)) {\n $query->where('c.route_id', $this->_route_id);\n }\n if (!empty($this->_area_id)) {\n $query->where('c.area_id', $this->_area_id);\n }\n if (!empty($this->type) && $this->type == 'debit') {\n $query->where('transactions.debit', '!=',0);\n }\n if (!empty($this->type) && $this->type == 'credit') {\n $query->where('transactions.credit', '!=',0);\n }\n if (!empty($this->start_date)) {\n $query->where('transactions.voucher_date', '>=',$this->start_date);\n }\n if (!empty($this->end_date)) {\n $query->where('transactions.voucher_date', '<=',$this->end_date);\n }\n\n //order by data fetching code\n if (isset($this->orderValue) && isset($this->dirValue)) { //orderValue is the index number of table header and dirValue is asc or desc\n $query->orderBy($this->column_order[$this->orderValue], $this->dirValue); //fetch data order by matching column\n } else if (isset($this->order)) {\n $query->orderBy(key($this->order), $this->order[key($this->order)]);\n }\n return $query;\n }",
"public function gettransactions($startdate,$enddate,$id=false){\n\n$condition = \"\";\n//Are we looking transactions for only one account ?\n if ($id!=false) {\n $condition = \" AND account_id=$id \";\n }\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_1'));\n\n//Create temporary table that will store the mirrored table\n $this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_1').\"\n (SELECT * FROM \".$this->db->dbprefix('postings').\" \n WHERE (created_at BETWEEN '$startdate' AND '$enddate') $condition )\");\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_2'));\n\n$this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_2').\"(\nSELECT a.transaction_id,\n a.account_id AS from_account,\n b.account_id AS to_account,\n a.journal_id,\n a.amount,\n a.comment,\n a.created_at,\n a.created_by\nFROM \".$this->db->dbprefix('temp_postings_1').\" AS a , \".$this->db->dbprefix('postings').\" AS b \nWHERE a.journal_id=b.journal_id AND a.amount=b.amount*-1 \n AND a.comment=b.comment AND a.created_at=b.created_at\n AND a.created_by=b.created_by AND a.amount>0\n AND a.transaction_id=b.transaction_id)\");\n\n\n\n $dataset=$this->db->query(\"SELECT a.transaction_id,\n CONCAT(b.name,' [#',b.code,'] ') AS from_account,\n CONCAT(c.name,' [#',c.code,'] ') AS to_account,\n d.type AS journal_type,\n a.amount,\n a.comment,\n a.created_at,\n CONCAT(e.first_name,' ',e.last_name) AS created_by\n\nFROM \".$this->db->dbprefix('temp_postings_2').\" AS a\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS b ON a.from_account=b.id\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS c ON a.to_account =c.id\nLEFT JOIN \".$this->db->dbprefix('journals').\" AS d ON a.journal_id =d.id\nLEFT JOIN \".$this->db->dbprefix('users').\" AS e ON a.created_by=e.id \nORDER BY created_at DESC\");\n\n return $dataset->result();\n}",
"function bwc_transactions_selections(){\r\n\t$fermenters = bwc_exec_query(\"SELECT f.fermenterName as tankId, f.fermenterName as tankName, e.fermId as _id, e.dateTime as dt, e.type as type FROM `fermenter_master` as f LEFT JOIN (SELECT * FROM `fermenter_master` as a LEFT JOIN fermentation as b ON a.fermenterName = b.fermenter where b.clearingStatus IS NULL ) as e ON f.fermenterName = e.fermenter ORDER BY e.fermId DESC\", array());\r\n\t//$prods = bwc_exec_query(\"SELECT p.prodId as _id, p.dateTime as dt, p.type as type FROM production as p ORDER BY prodId DESC\", array());\r\n\t$prostos = bwc_exec_query(\"SELECT pt.tankId as tankId, pt.tankName as tankName, p.prostoId as _id, p.type as type, p.dateTime as dt FROM production_tanks_master as pt LEFT JOIN (SELECT * FROM production_tanks_master as q LEFT JOIN prosto as r ON q.tankId = r.tank where r.clearingStatus IS NULL) as p ON p.tank = pt.tankId ORDER BY p.prostoId DESC\", array());\r\n\t$storages = bwc_exec_query(\"SELECT b.barrelName as tankName, b.barrelId as tankId, e.storageId as _id, e.type as type FROM barrel_master as b LEFT JOIN (SELECT * FROM barrel_master as c LEFT JOIN storage as d on c.barrelId = d.barrel WHERE d.clearingStatus IS NULL) as e ON b.barrelId = e.barrelId ORDER BY e.storageId DESC\", array());\r\n\t//$products = bwc_exec_query(\"SELECT product as type FROM spirit_classes\", array());\r\n\t$return_array = [\r\n\t\t\"fermenter_master\"=>$fermenters,\r\n\t\t\"production_tanks_master\"=>$prostos,\r\n\t\t\"barrel_master\"=>$storages\r\n\t\t];\r\n\treturn array($return_array);\r\n}",
"private function insertTranslations()\n {\n $sql = \"INSERT INTO s_core_snippets (namespace, shopID, localeID, name, value) VALUES \"\n .\"('frontend/\". $this->getPaymentController() .\"/form/cp', 1,1, 'FRONTEND_BT_CANCEL', 'Abbrechen'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,2, 'FRONTEND_BT_CANCEL', 'Cancel'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,1, 'FRONTEND_TT_TESTMODE', 'TESTMODUS \"\n .\": ES FINDET KEINE REALE ZAHLUNG STATT'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,2, 'FRONTEND_TT_TESTMODE', 'THIS IS A \"\n .\"TEST. NO REAL MONEY WILL BE TRANSFERED') ,\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,1, 'FRONTEND_MC_PAYANDSAFE', 'Zahlung \"\n .\"abschließen und Daten hinterlegen'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,2, 'FRONTEND_MC_PAYANDSAFE', 'Pay and \"\n .\"Save Payment Information'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,1, 'FRONTEND_RECURRING_WIDGET_HEADER1', \"\n .\"'Hinterlegte Zahlungsdaten verwenden'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,2, 'FRONTEND_RECURRING_WIDGET_HEADER1', \"\n .\"'Use stored payment data'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,1, 'FRONTEND_RECURRING_WIDGET_HEADER2', \"\n .\"'Alternative Zahlungsdaten verwenden'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,2, 'FRONTEND_RECURRING_WIDGET_HEADER2', \"\n .\"'Use alternative payment data'),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,1, 'FRONTEND_MERCHANT_LOCATION_DESC', \"\n .\"'Zahlungsempfänger: '),\n ('frontend/\". $this->getPaymentController() .\"/form/cp', 1,2, 'FRONTEND_MERCHANT_LOCATION_DESC', \"\n .\"'Payee: '),\n\n\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,1, 'FRONTEND_BT_CANCEL', 'Abbrechen'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,2, 'FRONTEND_BT_CANCEL', 'Cancel'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,1, 'FRONTEND_TT_TESTMODE', 'TESTMODUS \"\n .\": ES FINDET KEINE REALE ZAHLUNG STATT'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,2, 'FRONTEND_TT_TESTMODE', 'THIS IS A \"\n .\"TEST. NO REAL MONEY WILL BE TRANSFERED') ,\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,1, 'FRONTEND_MC_PAYANDSAFE', 'Zahlung \"\n .\"abschließen und Daten hinterlegen'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,2, 'FRONTEND_MC_PAYANDSAFE', 'Pay and \"\n .\"Save Payment Information') ,\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,1, 'FRONTEND_BT_PAYNOW', 'Jetzt bezahlen'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,2, 'FRONTEND_BT_PAYNOW', 'Pay now'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,1, 'FRONTEND_RECURRING_WIDGET_HEADER1', \"\n .\"'Hinterlegte Zahlungsdaten verwenden'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,2, 'FRONTEND_RECURRING_WIDGET_HEADER1', \"\n .\"'Use stored payment data'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,1, 'FRONTEND_RECURRING_WIDGET_HEADER2', \"\n .\"'Alternative Zahlungsdaten verwenden'),\n ('frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 1,2, 'FRONTEND_RECURRING_WIDGET_HEADER2', \"\n .\"'Use alternative payment data'),\n\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,1, 'SHOPWARE_BILLING_ADDRESS', 'Rechnungsadresse'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,2, 'SHOPWARE_BILLING_ADDRESS', 'Billing address'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,1, 'SHOPWARE_SHIPPING_ADDRESS', 'Lieferadresse'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,2, 'SHOPWARE_SHIPPING_ADDRESS', 'Shipping address'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,1, 'FRONTEND_EASYCREDIT_LINK', 'Vorvertragliche \"\n .\"Informationen zum Ratenkauf hier abrufen'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,2, 'FRONTEND_EASYCREDIT_LINK', 'Read pre-contractual \"\n .\"information on Installments'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,1, 'SHOPWARE_PAYMENT_BUTTON', 'Zahlungspflichtig bestellen'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,2, 'SHOPWARE_PAYMENT_BUTTON', 'Complete payment'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,1, 'SHOPWARE_PAYMENT_DISPATCH', 'Zahlung und Versand'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,2, 'SHOPWARE_PAYMENT_DISPATCH', 'Payment and dispatch'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,1, 'FRONTEND_EASYCREDIT_INTEREST', 'Zinsbetrag'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,2, 'FRONTEND_EASYCREDIT_INTEREST', 'Sum of Interest'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,1, 'FRONTEND_EASYCREDIT_INTEREST_OF_INSTALLMENT', 'Zinsen für Ratenzahlung'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,2, 'FRONTEND_EASYCREDIT_INTEREST_OF_INSTALLMENT', 'Interest on installment'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,1, 'FRONTEND_EASYCREDIT_TOTAL', 'Endbetrag'),\n ('frontend/\". $this->getPaymentController() .\"/confirmation', 1,2, 'FRONTEND_EASYCREDIT_TOTAL', 'Order Total'),\n\n ('frontend/account/payment', 1,1, 'MODULE_PAYMENT_VRPAYECOMMERCE_EASYCREDIT_TEXT_ERROR_CREDENTIALS', \"\n .\"'VR pay eCommerce General Setting Müssen ausgefüllt werden'),\n ('frontend/account/payment', 1,2, 'MODULE_PAYMENT_VRPAYECOMMERCE_EASYCREDIT_TEXT_ERROR_CREDENTIALS', \"\n .\"'VR pay eCommerce General Setting must be filled'),\n ('frontend/account/payment', 1,1, 'ERROR_MESSAGE_EASYCREDIT_AMOUNT_NOTALLOWED', 'Der Finanzierungsbetrag \"\n .\"liegt außerhalb der zulässigen Beträge (200 - 5.000 EUR).'),\n ('frontend/account/payment', 1,2, 'ERROR_MESSAGE_EASYCREDIT_AMOUNT_NOTALLOWED', 'The financing amount is \"\n .\"outside the permitted amounts (200 - 5,000 EUR).'),\n ('frontend/account/payment', 1,1, 'ERROR_EASYCREDIT_BILLING_NOTEQUAL_SHIPPING', 'Um mit easyCredit \"\n .\"bezahlen zu können, muss die Lieferadresse mit der Rechnungsadresse übereinstimmen.'),\n ('frontend/account/payment', 1,2, 'ERROR_EASYCREDIT_BILLING_NOTEQUAL_SHIPPING', 'In order to be able \"\n .\"to pay with easyCredit, the delivery address must match the invoice address.'),\n ('frontend/account/payment', 1,1, 'ERROR_MESSAGE_EASYCREDIT_PARAMETER_GENDER', 'Bitte geben Sie Ihr \"\n .\"Geschlecht an um die Zahlung mit easyCredit durchzuführen.'),\n ('frontend/account/payment', 1,2, 'ERROR_MESSAGE_EASYCREDIT_PARAMETER_GENDER', 'Please enter your gender to\"\n .\" make payment with easyCredit.'),\"\n .\"('frontend/account/payment', 1,1, 'FRONTEND_EASYCREDIT_TERMS', 'Ja, ich möchte per Ratenkauf\"\n .\" zahlen und willge ein, dass %x Ratenkauf der TeamBank AG (Partner der genossenschaftlichen FiinanzGrupper \"\n .\"Volksbanken Raiffeisenbanken), %y zur Identitäts- und Bonitätsprüfung sowie Betrugsprävention Anrede und \"\n .\"Name, Geburtsdatum und -ort, Kontaktdaten (Adresse, Telefon, E-mail) sowie Angaben zur aktuallen und zu \"\n .\"früheren Bestellungen übermittlet und das Prüfungsergebnis zu diesem Zweck erhält.'),\"\n .\"('frontend/account/payment', 1,2, 'FRONTEND_EASYCREDIT_TERMS', 'Yes, I would like to pay by installment \"\n .\"and I agree that %x installment purchase of TeamBank AG (Partner of the Cooperative FiinanzGrupper Volksbanken \"\n .\"Raiffeisenbanken), %y gets for identity and credit checks and fraud prevention title and \"\n .\"surname, date and place of birth, contact details ( Address, telephone, e-mail) as well as details\"\n .\" of current and past orders and receives the test result for this purpose.'),\n ('frontend/\". $this->getPaymentController() .\"/form/response_redirect', 1,1, 'ERROR_MESSAGE_EASYCREDIT_BEFORE_PAYMENT', \"\n .\"'Please make sure your payment method is correct!'),\n ('frontend/\". $this->getPaymentController() .\"/form/response_redirect', 1,2, 'ERROR_MESSAGE_EASYCREDIT_BEFORE_PAYMENT', \"\n .\"'Please make sure your payment method is correct!'),\n\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'SHOPWARE_FAILPAYMENTTITLE', 'Die Zahlung kann \"\n .\"nicht abgeschlossen werden'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'SHOPWARE_FAILPAYMENTTITLE', 'Payment cannot \"\n .\"be completed'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'SHOPWARE_CLICKTITLE', 'Klicken'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'SHOPWARE_CLICKTITLE', 'Click'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'SHOPWARE_HERETITLE', 'hierher'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'SHOPWARE_HERETITLE', 'here'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'SHOPWARE_TOCONTINUETITLE', 'Weiter'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'SHOPWARE_TOCONTINUETITLE', 'Continue'),\n\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_CC', 'Kreditkarte'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_CC', 'Credit Cards'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_CCSAVED', 'Kreditkarte'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_CCSAVED', 'Credit Card'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_DC', 'Debit Card'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_DC', 'Debit Card'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_DD', 'Lastschrift'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_DD', 'Direct Debit'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_DDSAVED', 'Lastschrift'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_DDSAVED', 'Direct Debit'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_EPS', 'eps'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_EPS', 'eps'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_GIROPAY', 'Giropay'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_GIROPAY', 'Giropay'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_IDEAL', 'iDeal'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_IDEAL', 'iDeal'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_KLARNAPAYLATER', 'Rechnung.'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_KLARNAPAYLATER', 'Pay later.'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_KLARNASLICEIT', 'Ratenkauf.'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_KLARNASLICEIT', 'Slice it.'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_MASTERPASS', 'Masterpass'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_MASTERPASS', 'Masterpass'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_PAYPAL', 'PayPal'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_PAYPAL', 'PayPal'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_PAYPALSAVED', 'PayPal'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_PAYPALSAVED', 'PayPal'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_PAYDIREKT', 'paydirekt'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_PAYDIREKT', 'paydirekt'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_KLARNAOBT', 'Sofort.'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_KLARNAOBT', 'Online Bank Transfer.'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_SWISSPOSTFINANCE', 'Swiss Postfinance'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_SWISSPOSTFINANCE', 'Swiss Postfinance'),\n ('frontend/checkout/shipping_payment', 1,1, 'FRONTEND_PM_EASYCREDIT', 'ratenkauf by easyCredit'),\n ('frontend/checkout/shipping_payment', 1,2, 'FRONTEND_PM_EASYCREDIT', 'ratenkauf by easyCredit'),\n\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_ACCOUNT', 'The account holder entered \"\n .\"does not match your name. Please use an account that is registered on your name.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_INVALIDDATA', 'Unfortunately, the \"\n .\"card/account data you entered was not correct. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_BLACKLIST', 'Unfortunately, the credit \"\n .\"card you entered can not be accepted. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_DECLINED_CARD', 'Unfortunately, the credit \"\n .\"card you entered can not be accepted. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_EXPIRED', 'Unfortunately, the credit card \"\n .\"you entered is expired. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_INVALIDCVV', 'Unfortunately, the CVV/CVC you \"\n .\"entered is not correct. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_EXPIRY', 'Unfortunately, the expiration date \"\n .\"you entered is not correct. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_LIMIT_EXCEED', 'Unfortunately, the limit of \"\n .\"your credit card is exceeded. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_3DAUTH', 'Unfortunately, the password you \"\n .\"entered was not correct. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_3DERROR', 'Unfortunately, there has been an \"\n .\"error while processing your request. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_NOBRAND', 'Unfortunately, there has been an \"\n .\"error while processing your request. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_LIMIT_AMOUNT', 'Unfortunately, your \"\n .\"credit limit is exceeded. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_LIMIT_TRANSACTIONS', 'Unfortunately, \"\n .\"your limit of transaction is exceeded. Please try again later. '),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_DECLINED_AUTH', 'Unfortunately, your \"\n .\"transaction has failed. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_DECLINED_RISK', 'Unfortunately, \"\n .\"your transaction has failed. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_ADDRESS', 'We are sorry. We could no \"\n .\"accept your card as its origin does not match your address.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_CANCEL', 'You cancelled the payment \"\n .\"prior to its execution. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_RECURRING', 'Recurring transactions have \"\n .\"been deactivated for this credit card. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CC_REPEATED', 'Unfortunately, your transaction \"\n .\"has been declined due to invalid data. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_ADDRESS', 'Unfortunately, your transaction \"\n .\"has failed. Please check the personal data you entered.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_BLACKLIST', 'The chosen payment method \"\n .\"is not available at the moment. Please choose a different card or payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_GENERAL', 'Unfortunately, your transaction \"\n .\"has failed. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_TIMEOUT', 'Unfortunately, your transaction \"\n .\"has failed. Please try again. '),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GIRO_NOSUPPORT', 'Giropay is not supported for \"\n .\"this transaction. Please choose a different payment method.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_ADDRESS_PHONE', 'Unfortunately, your transaction has \"\n .\"failed. Please enter a valid telephone number.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_REDIRECT', 'Error before redirect.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_CAPTURE_BACKEND', 'Transaction can not be captured.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_MERCHANT_SSL_CERTIFICATE',\n 'SSL certificate problem, please contact the merchant.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_UNKNOWN', 'Unfortunately, your transaction has \"\n .\"failed. Please try again.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_GENERAL_NORESPONSE', 'Unfortunately, the confirmation \"\n .\"of your payment failed. Please contact your merchant for clarification.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_MESSAGE_SESSION_TIMEOUT', 'your payment is refunded \"\n .\"due to the session timeout, please login to finish the payment.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_MESSAGE_SESSION_TIMEOUT_WHITOUT_REFUND', 'Your payment \"\n .\"is failed due to the session timeout'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_EASYCREDIT_IBAN', 'The IBAN \"\n .\"does not correspond to the IBAN country format.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_EASYCREDIT_DOB', 'The date entered must be in the past'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,2, 'ERROR_EASYCREDIT_ADDRESS', 'The address could not be found. \"\n .\"Please select a different delivery and billing address or choose another payment method.'),\n\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_ACCOUNT', 'Sie sind nicht der Inhaber des \"\n .\"eingegebenen Kontos. Bitte wählen Sie ein Konto das auf Ihren Namen läuft.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_INVALIDDATA', 'Ihre Karten-/Kontodaten sind leider \"\n .\"nicht korrekt. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_BLACKLIST', 'Leider kann die eingegebene Kreditkarte \"\n .\"nicht akzeptiert werden. Bitte wählen Sie eine andere Karte oder Bezahlungsmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_DECLINED_CARD', 'Leider kann die eingegebene \"\n .\"Kreditkarte nicht akzeptiert werden. Bitte wählen Sie eine andere Karte oder Bezahlungsmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_EXPIRED', 'Leider ist die eingegebene Kreditkarte \"\n .\"abgelaufen. Bitte wählen Sie eine andere Karte oder Bezahlungsmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_INVALIDCVV', 'Leider ist die eingegebene \"\n .\"Kartenprüfnummer nicht korrekt. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_EXPIRY', 'Leider ist das eingegebene Ablaufdatum \"\n .\"nicht korrekt. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_LIMIT_EXCEED', 'Leider übersteigt der zu \"\n .\"zahlende Betrag das Limit Ihrer Kreditkarte. Bitte wählen Sie eine andere Karte oder \"\n .\"Bezahlsmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_3DAUTH', 'Ihr Passwort wurde leider nicht korrekt \"\n .\"eingegeben. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_3DERROR', 'Leider gab es einen Fehler bei der \"\n .\"Durchführung Ihrer Zahlung. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_NOBRAND', 'Leider gab es einen Fehler bei der \"\n .\"Durchführung Ihrer Zahlung. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_LIMIT_AMOUNT', 'Leider übersteigt der \"\n .\"zu zahlende Betrag Ihr Limit. Bitte wählen Sie eine andere Bezahlsmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_LIMIT_TRANSACTIONS', 'Leider übersteigt \"\n .\"der zu zahlende Betrag Ihr Transaktionslimit. Bitte wählen Sie eine andere Bezahlsmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_DECLINED_AUTH', 'Leider ist Ihre Zahlung \"\n .\"fehlgeschlagen. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_DECLINED_RISK', 'Leider ist Ihre Zahlung \"\n .\"fehlgeschlagen. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_ADDRESS', 'Leider konnten wir Ihre Kartendaten \"\n .\"nicht akzeptieren. Ihre Adresse stimmt nicht mit der Herkunft Ihrer Karte überein.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_CANCEL', 'Der Vorgang wurde auf Ihren Wunsch \"\n .\"abgebrochen. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_RECURRING', 'Für die gewählte Karte wurden \"\n .\"wiederkehrende Zahlungen deaktiviert. Bitte wälen Sie eine andere Bezahlmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CC_REPEATED', 'Leider ist Ihre Zahlung fehlgeschlagen, \"\n .\"da Sie mehrfach fehlerhafte Angaben gemacht haben. Bitte wälen Sie eine andere Bezahlmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_ADDRESS', 'Leider ist Ihre Zahlung \"\n .\"fehlgeschlagen. Bitte kontrollieren Sie Ihre persönlichen Angaben.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_BLACKLIST', 'Die gewählte Bezahlmethode \"\n .\"steht leider nicht zur Verfügung. Bitte wälen Sie eine andere Bezahlmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_GENERAL', 'Leider konnten wir Ihre Transaktion \"\n .\"nicht durchführen. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_TIMEOUT', 'Leider konnten wir Ihre Transaktion \"\n .\"nicht durchführen. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GIRO_NOSUPPORT', 'Giropay wird leider für diese \"\n .\"Transaktion nicht unterstützt. Bitte wälen Sie eine andere Bezahlmethode.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_ADDRESS_PHONE', 'Leider ist Ihre Zahlung \"\n .\"fehlgeschlagen. Bitte geben Sie eine korrekte Telefonnummer an.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_REDIRECT', 'Fehler vor Weiterleitung.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_CAPTURE_BACKEND', 'Die Transaktion kann nicht gecaptured werden.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_MERCHANT_SSL_CERTIFICATE',\n 'SSL-Zertifikat Problem, wenden Sie sich bitte an den Händler.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_UNKNOWN', 'Leider konnten wir Ihre Transaktion \"\n .\"nicht durchführen. Bitte versuchen Sie es erneut.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_GENERAL_NORESPONSE', 'Leider konnte ihre Zahlung \"\n .\"nicht bestätigt werden. Bitte setzen Sie sich mit dem Händler in Verbindung.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_MESSAGE_SESSION_TIMEOUT', 'Ihre Zahlung wird \"\n .\"zurückerstattet wegen der Session Timeout, bitte anmelden, um die Zahlung zu beenden.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_MESSAGE_SESSION_TIMEOUT_WHITOUT_REFUND', 'Ihre Zahlung \"\n .\"ist aufgrund des Session-Timeouts fehlgeschlagen'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_EASYCREDIT_IBAN', 'Die IBAN \"\n .\"entspricht nicht dem IBAN-Länder-Format.'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_EASYCREDIT_DOB', 'Das eingegebene Datum muss in \"\n .\"der Vergangenheit liegen'),\n ('frontend/\". $this->getPaymentController() .\"/result', 1,1, 'ERROR_EASYCREDIT_ADDRESS', 'Die Adresse konnte nicht gefunden \"\n .\"werden. Bitte wählen Sie eine andere Liefer- und Rechnungsadresse oder wählen Sie eine andere Zahlungsart.'),\n\n ('sidebar', 1,2, 'FRONTEND_MC_INFO', 'My Payment Information'),\n ('sidebar', 1,1, 'FRONTEND_MC_INFO', 'Meine Zahlungsarten'),\n\n ('frontend/account/sidebar', 1,2, 'FRONTEND_MC_INFO', 'My Payment Information'),\n ('frontend/account/sidebar', 1,1, 'FRONTEND_MC_INFO', 'Meine Zahlungsarten'),\n\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_INFO', 'My Payment Information'),\n ('frontend/payment_information/information', 1,2, 'SUCCESS_MC_ADD', 'Congratulations, your \"\n .\"payment information were successfully saved.'),\n ('frontend/payment_information/information', 1,2, 'SUCCESS_MC_UPDATE', 'Congratulations, your \"\n .\"payment information were successfully updated.'),\n ('frontend/payment_information/information', 1,2, 'SUCCESS_MC_DELETE', 'Congratulations, your \"\n .\"payment information were successfully deleted.'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_CC', 'Credit Cards'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_ENDING', 'ending in:'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_VALIDITY', 'expires on:'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_BT_DEFAULT', 'Default'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_BT_SETDEFAULT', 'Set as Default'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_BT_CHANGE', 'Change'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_BT_DELETE', 'Delete'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_BT_ADD', 'Add'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_DD', 'Direct Debit'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_ACCOUNT', 'Account: ****'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_HOLDER', 'Holder:'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_PAYPAL', 'PayPal'),\n ('frontend/payment_information/information', 1,2, 'FRONTEND_MC_EMAIL', 'Email:'),\n ('frontend/payment_information/information', 1,2, 'ERROR_MC_ADD', 'We are sorry. Your attempt \"\n .\"to save your payment information was not successful, please try again.'),\n ('frontend/payment_information/information', 1,2, 'ERROR_MC_UPDATE', 'We are sorry. Your \"\n .\"attempt to update your payment information was not successful, please try again.'),\n ('frontend/payment_information/information', 1,2, 'ERROR_MC_DELETE', 'We are sorry. Your \"\n .\"attempt to delete your payment information was not successful, please try again.'),\n\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_INFO', 'Meine Zahlungsarten'),\n ('frontend/payment_information/information', 1,1, 'SUCCESS_MC_ADD', 'Ihre Zahlungsart wurde \"\n .\"erfolgreich angelegt'),\n ('frontend/payment_information/information', 1,1, 'SUCCESS_MC_UPDATE', 'Ihre Zahlungsdaten \"\n .\"wurden erfolgreich geändert'),\n ('frontend/payment_information/information', 1,1, 'SUCCESS_MC_DELETE', 'Ihre Zahlungsart \"\n .\"wurde erfolgreich gelöscht'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_CC', 'Kreditkarten'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_ENDING', 'endet auf:'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_VALIDITY', 'gültig bis:'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_BT_DEFAULT', 'Standard'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_BT_SETDEFAULT', 'Als Standard \"\n .\"setzen'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_BT_CHANGE', 'Ändern'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_BT_DELETE', 'Entfernen'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_BT_ADD', 'Hinzufügen'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_DD', 'Lastschrift'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_ACCOUNT', 'Konto: ****'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_HOLDER', 'Inhaber:'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_PAYPAL', 'PayPal'),\n ('frontend/payment_information/information', 1,1, 'FRONTEND_MC_EMAIL', 'Email:'),\n ('frontend/payment_information/information', 1,1, 'ERROR_MC_ADD', 'Leider ist das Anlegen Ihrer \"\n .\"Zahlungsart fehlgeschlagen. Bitte versuchen Sie es erneut'),\n ('frontend/payment_information/information', 1,1, 'ERROR_MC_UPDATE', 'Leider ist die Änderung \"\n .\"Ihrer Zahlungsdaten fehlgeschlagen. Bitte versuchen Sie es erneut'),\n ('frontend/payment_information/information', 1,1, 'ERROR_MC_DELETE', 'Leider ist das löschen \"\n .\"Ihrer Zahlungsart fehlgeschlagen. Bitte versuchen Sie es erneut'),\n\n ('frontend/payment_information/form/register_cp', 1,2, 'FRONTEND_MC_SAVE', 'Save Payment Information'),\n ('frontend/payment_information/form/register_cp', 1,2, 'ERROR_MC_ADD', 'We are sorry. Your attempt \"\n .\"to save your payment information was not successful, please try again.'),\n ('frontend/payment_information/form/register_cp', 1,2, 'FRONTEND_BT_CANCEL', 'Cancel'),\n ('frontend/payment_information/form/register_cp', 1,2, 'FRONTEND_BT_REGISTER', 'Register'),\n ('frontend/payment_information/form/register_cp', 1,2, 'FRONTEND_TT_TESTMODE', 'THIS IS A TEST. \"\n .\"NO REAL MONEY WILL BE TRANSFERED'),\n ('frontend/payment_information/form/register_cp', 1,2, 'FRONTEND_TT_REGISTRATION', 'A small amount \"\n .\"(<1 €) will be charged and instantly refunded to verify your account/card details. '),\n\n ('frontend/payment_information/form/register_cp', 1,1, 'FRONTEND_MC_SAVE', 'Zahlungsarten anlegen'),\n ('frontend/payment_information/form/register_cp', 1,1, 'ERROR_MC_ADD', 'Leider ist das Anlegen \"\n .\"Ihrer Zahlungsart fehlgeschlagen. Bitte versuchen Sie es erneut'),\n ('frontend/payment_information/form/register_cp', 1,1, 'FRONTEND_BT_CANCEL', 'Abbrechen'),\n ('frontend/payment_information/form/register_cp', 1,1, 'FRONTEND_BT_REGISTER', 'Registrieren'),\n ('frontend/payment_information/form/register_cp', 1,1, 'FRONTEND_TT_TESTMODE', 'TESTMODUS : ES \"\n .\"FINDET KEINE REALE ZAHLUNG STATT'),\n ('frontend/payment_information/form/register_cp', 1,1, 'FRONTEND_TT_REGISTRATION', 'Hinweis: Bei \"\n .\"der Registrierung wird zur Verifizierung Ihrer Konten/Kartendaten ein kleiner Betrag <1 € \"\n .\"belastet und sofort wieder gut geschrieben. '),\n\n ('frontend/payment_information/form/change_cp', 1,2, 'FRONTEND_MC_CHANGE', 'Change Payment \"\n .\"Information'),\n ('frontend/payment_information/form/change_cp', 1,2, 'ERROR_MC_UPDATE', 'We are sorry. Your \"\n .\"attempt to update your payment information was not successful, please try again.'),\n ('frontend/payment_information/form/change_cp', 1,2, 'FRONTEND_BT_CANCEL', 'Cancel'),\n ('frontend/payment_information/form/change_cp', 1,2, 'FRONTEND_MC_BT_CHANGE', 'Change'),\n ('frontend/payment_information/form/change_cp', 1,2, 'FRONTEND_TT_TESTMODE', 'THIS IS A TEST. \"\n .\"NO REAL MONEY WILL BE TRANSFERED'),\n ('frontend/payment_information/form/change_cp', 1,2, 'FRONTEND_TT_REGISTRATION', 'A small \"\n .\"amount (<1 €) will be charged and instantly refunded to verify your account/card details. '),\n\n ('frontend/payment_information/form/change_cp', 1,1, 'FRONTEND_MC_CHANGE', 'Zahlungsarten \"\n .\"Ändern'),\n ('frontend/payment_information/form/change_cp', 1,1, 'ERROR_MC_UPDATE', 'Leider ist die Änderung \"\n .\"Ihrer Zahlungsdaten fehlgeschlagen. Bitte versuchen Sie es erneut'),\n ('frontend/payment_information/form/change_cp', 1,1, 'FRONTEND_BT_CANCEL', 'Abbrechen'),\n ('frontend/payment_information/form/change_cp', 1,1, 'FRONTEND_MC_BT_CHANGE', 'Ändern'),\n ('frontend/payment_information/form/change_cp', 1,1, 'FRONTEND_TT_TESTMODE', 'TESTMODUS : ES FINDET \"\n .\"KEINE REALE ZAHLUNG STATT'),\n ('frontend/payment_information/form/change_cp', 1,1, 'FRONTEND_TT_REGISTRATION', 'Hinweis: Bei der \"\n .\"Registrierung wird zur Verifizierung Ihrer Konten/Kartendaten ein kleiner Betrag <1 € belastet \"\n .\"und sofort wieder gut geschrieben. '),\n\n ('frontend/payment_information/delete', 1,2, 'FRONTEND_MC_DELETE', 'Delete Payment Information'),\n ('frontend/payment_information/delete', 1,2, 'ERROR_MC_DELETE', 'We are sorry. Your attempt to delete \"\n .\"your payment information was not successful, please try again.'),\n ('frontend/payment_information/delete', 1,2, 'FRONTEND_MC_DELETESURE', 'Are you sure to delete this \"\n .\"payment information?'),\n ('frontend/payment_information/delete', 1,2, 'FRONTEND_BT_CANCEL', 'Cancel'),\n ('frontend/payment_information/delete', 1,2, 'FRONTEND_BT_CONFIRM', 'Confirm'),\n\n ('frontend/payment_information/delete', 1,1, 'FRONTEND_MC_DELETE', 'Zahlungsarten löschen'),\n ('frontend/payment_information/delete', 1,1, 'ERROR_MC_DELETE', 'Leider ist das löschen Ihrer \"\n .\"Zahlungsart fehlgeschlagen. Bitte versuchen Sie es erneut'),\n ('frontend/payment_information/delete', 1,1, 'FRONTEND_MC_DELETESURE', 'Sind Sie sicher, dass Sie \"\n .\"diese Zahlungsart löschen möchten?'),\n ('frontend/payment_information/delete', 1,1, 'FRONTEND_BT_CANCEL', 'Abbrechen'),\n ('frontend/payment_information/delete', 1,1, 'FRONTEND_BT_CONFIRM', 'Bestätigen'),\n\n ('backend/order/main', 1,2, 'SUCCESS_IN_REVIEW', 'Transaction succeeded but has been suspended for \"\n .\"manual review. Please update transaction status in 24 hours.'),\n ('backend/order/main', 1,1, 'SUCCESS_IN_REVIEW', 'Die Transaktion war erfolgreich, sollte aber \"\n .\"manuell überprüft werden. Bitte aktualisieren Sie den Status der Transaktion manuell nach 24 Stunden'),\n\n ('backend/error/index', 1,1, 'ERROR_CAPTURE_BACKEND', 'Transaction can not be captured.'),\n ('backend/error/index', 1,2, 'ERROR_CAPTURE_BACKEND', 'Die Transaktion kann nicht gecaptured werden.'),\n ('backend/error/index', 1,2, 'ERROR_REFUND_BACKEND', 'Transaction can not be refunded or reversed.'),\n ('backend/error/index', 1,1, 'ERROR_REFUND_BACKEND', 'Die Transaktion kann nichrt refunded oder \"\n .\"reversed werden.'),\n ('backend/error/index', 1,1, 'ERROR_REORDER_BACKEND', 'Card holder has advised his bank to stop \"\n .\"this recurring payment.'),\n ('backend/error/index', 1,2, 'ERROR_REORDER_BACKEND', 'Der Kunde hat seine Bank angewiesen, keine \"\n .\"wiederkehrenden Zahlungen mehr zuzulassen. .'),\n ('backend/error/index', 1,1, 'ERROR_RECEIPT_BACKEND', 'Receipt can not be performed.'),\n ('backend/error/index', 1,2, 'ERROR_RECEIPT_BACKEND', 'Das Receipt kann nicht prozessiert werden.'),\"\n .\"('confirm', 1,2, 'FRONTEND_EASYCREDIT_CONFIRM_BUTTON', 'Continue to Ratenkauf by easyCredit'),\n ('confirm', 1,1, 'FRONTEND_EASYCREDIT_CONFIRM_BUTTON', 'Weiter zu Ratenkauf by easyCredit')\n \"\n ;\n\n Shopware()->Db()->query($sql);\n }",
"private function deleteTranslations()\n {\n $sql = \"DELETE FROM s_core_snippets WHERE namespace in ('frontend/\". $this->getPaymentController() .\"/form/cp',\"\n . \"'frontend/\". $this->getPaymentController() .\"/form/paypalsaved', 'frontend/\". $this->getPaymentController() .\"/result', \"\n . \"'frontend/\". $this->getPaymentController() .\"/confirmation', \"\n . \"'frontend/payment_information/information', 'frontend/payment_information/form/register_cp',\"\n . \"'frontend/payment_information/form/change_cp', 'frontend/payment_information/delete',\n 'frontend/\". $this->getPaymentController() .\"/form/response_redirect')\";\n Shopware()->Db()->query($sql);\n $sql = \"DELETE FROM s_core_snippets WHERE namespace in ('frontend/checkout/shipping_payment',\"\n . \"'sidebar', 'frontend/account/sidebar', 'backend/error/index', \"\n . \"'frontend/account/payment', 'backend/order/main') \"\n . \"AND name IN ('FRONTEND_PM_CC','FRONTEND_PM_CCSAVED','FRONTEND_PM_DC','FRONTEND_PM_DD',\"\n . \"'FRONTEND_PM_DDSAVED','FRONTEND_PM_EPS','FRONTEND_PM_GIROPAY','FRONTEND_PM_IDEAL',\"\n . \"'FRONTEND_PM_KLARNAPAYLATER','FRONTEND_PM_EASYCREDIT',\"\n . \"'FRONTEND_PM_KLARNASLICEIT','FRONTEND_PM_MASTERPASS',\"\n . \"'FRONTEND_PM_PAYPAL','FRONTEND_PM_PAYPALSAVED','FRONTEND_PM_PAYDIREKT','FRONTEND_PM_KLARNAOBT',\"\n . \"'FRONTEND_PM_SWISSPOSTFINANCE','FRONTEND_MC_INFO',\"\n . \"'MODULE_PAYMENT_VRPAYECOMMERCE_EASYCREDIT_TEXT_ERROR_CREDENTIALS', 'ERROR_EASYCREDIT_FUTURE_DOB',\"\n . \"'ERROR_EASYCREDIT_PARAMETER_DOB','ERROR_MESSAGE_EASYCREDIT_PARAMETER_GENDER','ERROR_CAPTURE_BACKEND',\"\n . \"'ERROR_MESSAGE_EASYCREDIT_AMOUNT_NOTALLOWED','ERROR_EASYCREDIT_BILLING_NOTEQUAL_SHIPPING',\"\n . \"'ERROR_REFUND_BACKEND','ERROR_REORDER_BACKEND', 'ERROR_RECEIPT_BACKEND', 'SUCCESS_IN_REVIEW',\"\n .\"'FRONTEND_EASYCREDIT_TERMS')\";\n Shopware()->Db()->query($sql);\n $sql = \"DELETE FROM s_core_snippets WHERE namespace in ('confirm') \"\n . \"AND name IN ('FRONTEND_EASYCREDIT_CONFIRM_BUTTON')\";\n Shopware()->Db()->query($sql);\n }",
"function get_payment_requests($financial_year_id=0,$programarea_id=0, $status=0, $owner_id=0){ // i changed 'finacial' to 'financial'\n $filter=\"1\";\n if($status!=0){\n $filter=\"request_status=$status\"; //replace this with the right column\n }\n \n\n if($financial_year_id!=0){ \n $filter.=\" and financial_year_financial_year_id=$financial_year_id\"; //chech the column from payment request \n } // i changed 'finacial' to 'financial' on the line above\n \n\n if($programarea_id!=0){ \n $filter.=\" and p.`programarea_id`=$programarea_id\"; //chech the column from payment request \n }\n \n if($owner_id!=0){\n $filter.=\" and owner_id=$owner_id \"; \n }\n \n $str_query=\"select p.`payment_request_id`,p.`code`,p.`year`,p.`request_date`,p.`programarea_id`,\n p.`request_status`,p.`financial_year_financial_year_id`,p.`amount`,\n p.`group_id`,p.`verification_document`,p.`liquidationdoc`,p.`owner_id`,\n pa.`programarea_name`,f.`year_name` \n from payment_request p\n join financial_year f on p.`financial_year_financial_year_id`=f.`financial_year_id`\n left join programarea pa on p.`programarea_id`=pa.`programarea_id` \n where $filter\"; \n //echo $str_query;\n if (!$this->sql_query($str_query)){\n return false;\n }\n else{\n return true;\n }\n }",
"private function get_datatable_query()\n {\n\n $this->column_order = ['transactions.voucher_date','transactions.description', 'transactions.voucher_no','transactions.debit','transactions.credit',null];\n \n $query = self::select('transactions.*','coa.id as coa_id','coa.code','coa.name','coa.parent_name',\n 'c.id as customer_id','c.shop_name','c.name','c.mobile')\n ->join('chart_of_accounts as coa','transactions.chart_of_account_id','=','coa.id')\n ->join('customers as c','coa.customer_id','c.id')\n ->where('transactions.approve',1);\n\n //search query\n if (!empty($this->_customer_id)) {\n $query->where('c.id', $this->_customer_id);\n }\n if (!empty($this->_district_id)) {\n $query->where('c.district_id', $this->_district_id);\n }\n if (!empty($this->_upazila_id)) {\n $query->where('c.upazila_id', $this->_upazila_id);\n }\n if (!empty($this->_route_id)) {\n $query->where('c.route_id', $this->_route_id);\n }\n if (!empty($this->_area_id)) {\n $query->where('c.area_id', $this->_area_id);\n }\n if (!empty($this->start_date)) {\n $query->where('transactions.voucher_date', '>=',$this->start_date);\n }\n if (!empty($this->end_date)) {\n $query->where('transactions.voucher_date', '<=',$this->end_date);\n }\n\n //order by data fetching code\n if (isset($this->orderValue) && isset($this->dirValue)) { //orderValue is the index number of table header and dirValue is asc or desc\n $query->orderBy($this->column_order[$this->orderValue], $this->dirValue); //fetch data order by matching column\n } else if (isset($this->order)) {\n $query->orderBy(key($this->order), $this->order[key($this->order)]);\n }\n return $query;\n }",
"public function Select_enquiry_approve($filter)\r\n\t\t {\r\n // return $query13->result();\r\n\r\n $query13 = $this->db->query(\"SELECT a.ID,a.EnqID,a.Producttype,a.ICompanyID,a.ClientID,a.ExecutiveID,a.Status,DATE_FORMAT(a.EnqDateTime, '%d/%m/%Y %h:%m:%s') as EnqDateTime,a.ProductName,a.ProductCode,a.AnnualQty,concat(a.Quantity, if (Quantity2<>'',',',''),a.Quantity2, if (Quantity3<>'',',',''),a.Quantity3, if (Quantity4<>'',',',''),a.Quantity4, if (Quantity5<>'',',',''),a.Quantity5) as Quantity,a.PaperType,a.Gsm,\r\n\t\t\t\ta.ItemType,a.Length,a.Breadth,a.Height,a.PrintColor,a.PrePressDetail,a.PressDetail,a.PostPressDetail,a.CorrugationDetail,a.PackingDetail,\r\n\t\t\t\ta.DespatchDetail,a.OtherRemark,a.RecordID,a.ContactPerson,a.PersonPost,a.ContactNo_Email,a.ClientLocation,a.CostingDeptComment,\r\n\t\t\t\ta.Approved,a.Remark_approve,b.printing,b.printing_remarks,c.Description as coating,b.coating_remarks,d.filmtype as lamination,b.metpat_lamination,\r\n\t\t\t\tb.lamination_remarks,b.foiling,b.punching,b.punching_remarks,b.window_patching,b.pasting,b.pasting_remarks,b.corrugation,b.corrugation_remarks \r\n\t\t\t\tfrom ((est_enquiry as a inner join est_enquiry_process as b on b.enqid=a.EnqID\r\n\t\t\t\tleft join coating_master as c on b.coating=c.CoatingID)\r\n\t\t\t\tleft join lammaster as d on b.lamination=d.LamID)\r\n\t\t\t\twhere a.IsActive=1\" .\" $filter\");\r\n return $query13->result();\r\n\t\t }",
"function getLibelOperationTransaction($type_op) { //Renvoie le libellé dun operation\n global $dbHandler,$global_id_agence;\n $db = $dbHandler->openConnection();\n\n $sql=\"SELECT traduction from ad_cpt_ope a, ad_traductions b where a.libel_ope = b.id_str and type_operation = $type_op ;\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n }\n $dbHandler->closeConnection(true);\n $retour = $result->fetchrow();\n return $retour[0];\n}"
] |
[
"0.52750397",
"0.52506834",
"0.522675",
"0.52208924",
"0.522027",
"0.5194641",
"0.5162461",
"0.51501507",
"0.51500124",
"0.5148129",
"0.5135955",
"0.5125079",
"0.5119003",
"0.5116046",
"0.5109736",
"0.5109523",
"0.5100834",
"0.50876594",
"0.5087596",
"0.5063795",
"0.50583345",
"0.50521666",
"0.5042687",
"0.5034188",
"0.5008651",
"0.5000266",
"0.49833444",
"0.49780703",
"0.49715525",
"0.49637756"
] |
0.57830125
|
0
|
Returns the description of this migration.
|
public function getDescription()
{
$description = 'A migration which creates the `role` and `permission` tables.';
return $description;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getDescription()\n {\n $description = 'This is the migration which provides user impersonation.';\n\n return $description;\n }",
"public function getDescription()\n {\n $description = 'This migration adds the post_user_id_fk foreign key to the post table.';\n return $description;\n }",
"public function description(): string\n {\n return $this->description;\n }",
"public function getDescription()\n {\n return t('Change the task title when the task is moved to another column (Plugin)');\n }",
"public function get_description() {\r\n\t\t$text = 'Change to ' . Cast::string($this->get_params());\r\n\t\t$transmods = array('app', 'status');\r\n\t\t$inst = $this->get_instance();\r\n \t\tif ($inst instanceof IDataObject) {\r\n \t\t\tarray_unshift($transmods, $inst->get_table_name());\r\n \t\t}\r\n\t\treturn tr(\r\n\t\t\t$text, \r\n\t\t\t$transmods\r\n\t\t);\t\r\n\t}",
"public function getVersionDescription()\n {\n return $this->version_description;\n }",
"public function description()\n\t{\n\t\treturn $this->description;\n\t}",
"function getDescription()\n {\n return $this->command_description;\n }",
"public function getDescription()\n {\n return 'Developer at Afrihost. Design Patterns acolyte. Dangerous sysadmin using \\'DevOps\\' as an excuse. I like '.\n 'long walks on the beach and craft beer.';\n }",
"public function description()\n {\n\n return static::$description;\n\n }",
"public function getDescription(): string\n {\n return $this->description;\n }",
"public function getDescription(): string\n {\n return $this->description;\n }",
"public function getDescription(): string\n {\n return $this->description;\n }",
"public function getDescription(): string\n {\n return $this->description;\n }",
"public function getDescription(): string\n {\n return $this->description;\n }",
"public function getDescription(): string\n {\n return $this->description;\n }",
"public function getDescription(): string\n {\n return $this->description;\n }",
"public function getDescription(): string\n {\n return $this->description;\n }",
"public function get_description() {\r\n\t\treturn $this->get_name();\r\n\t}",
"public static function description()\n {\n return static::$_description;\n }",
"public function getDescription()\r\n\t{\r\n\t\treturn $this->getTransaction()->getDescription();\r\n\t}",
"public function getDescription(): string\r\n {\r\n return $this->description;\r\n }",
"public function getDescription() : string {\n return $this->taskDesc;\n }",
"public function getDescription() {\n\t\treturn \"No description yet\";\n\t}",
"public function getDescription()\n {\n return $this->Description;\n }",
"public function getDescription()\n {\n return $this->Description;\n }",
"public function getDescription()\n {\n return $this->Description;\n }",
"public function getDescription() : string\n {\n return $this->description;\n }",
"public function getDescription() : string\n {\n return $this->description;\n }",
"public function getDescription() : string\n {\n return $this->description;\n }"
] |
[
"0.8169561",
"0.7710895",
"0.6984241",
"0.6942694",
"0.6939115",
"0.68596554",
"0.68461084",
"0.6836231",
"0.6780154",
"0.6777296",
"0.674363",
"0.674363",
"0.674363",
"0.674363",
"0.674363",
"0.674363",
"0.674363",
"0.674363",
"0.67272395",
"0.67104405",
"0.6706191",
"0.6703236",
"0.6699294",
"0.66863775",
"0.6658849",
"0.6658849",
"0.6658849",
"0.6651521",
"0.6651521",
"0.6651521"
] |
0.8113845
|
1
|
Get the first attachment filename for this inventory. If does not exist, returnd default image.
|
public function getFirstAttachmentFilename() {
if($this->attachment && count($this->attachment)) {
return '/' . $this->attachment[0]->filename;
}
return Inventory::getDefaultImage();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getAttachmentFilename()\n {\n return $this->attachment_filename;\n }",
"static public function GetGETAttachmentName() {\n if (isset(self::$attachmentName))\n return self::$attachmentName;\n else\n return false;\n }",
"public function getFirstImageName()\n {\n $url = '';\n if ($image = $this->getFirstImage()) {\n $url = $image->getName();\n }\n return $url;\n }",
"public function getFileName()\n {\n if (array_key_exists(\"fileName\", $this->_propDict)) {\n return $this->_propDict[\"fileName\"];\n } else {\n return null;\n }\n }",
"public function getThumbFilename() {\n if ($this->has_thumb) {\n $path_info = pathinfo($this->thumb_file_name);\n\n return $path_info['filename'];\n }\n\n return 'default';\n }",
"public function getFileName()\n {\n $value = $this->get(self::FILENAME);\n return $value === null ? (string)$value : $value;\n }",
"public function getFileName() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filename\", FALSE);\n\t}",
"public function getAttachmentFile() {\n return $this->attributes['attachment_file'];\n }",
"public function getApplicantResumeCoverLetterAttachmentFileName()\n {\n return $this->getProperty('applicant_resume_cover_letter_attachment_file_name');\n }",
"function getAttachedFileName($fileID){\r\n\t\t$query = \"SELECT `Alias` FROM `attachments` WHERE ID='$fileID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\t$result = mysql_fetch_array($result);\t\r\n\t\t$result = $result['Alias'];\r\n\t\treturn($result);\r\n\t}",
"public function getFilename() {\n return $this->getData('file');\n }",
"public function getFilename()\n {\n if (!$this->fileName) {\n $matcher = $this->getFileMatcher();\n $this->fileName = $this->searchFile($matcher);\n }\n\n return $this->fileName;\n }",
"public function getFilename()\n {\n return null;\n }",
"public function getFilename()\r\n\t{\r\n\t\tif($this->getFile() instanceof GridFSDownload){\r\n\t\t\treturn $this->getFile()->getFilename();\r\n\t\t}\r\n\t\tif($this->getFile() instanceof CUploadedFile){\r\n\t\t\treturn $this->getFile()->getTempName();\r\n\t\t}\r\n\t\tif(is_string($this->getFile()) && is_file($this->getFile())){\r\n\t\t\treturn $this->getFile();\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }",
"public function getFirstDocumentSignatureFilename()\n {\n if ($this->getDocumentSignaturesCount() > 0) {\n /** @var DocumentSignature $signature */\n $signature = $this->documentSignatures->first();\n\n return $signature->getDocument()->getFilename();\n }\n\n return;\n }",
"public function getAttachFileName() {\n return $this->attachFileName;\n }",
"protected function getFileName() {\n // Full file path.\n $path = $this->urls[$this->activeUrl];\n\n // Explode with the '/' to get the last element.\n $files = explode('/', $path);\n\n // File name without extension.\n $file_name = explode('.', end($files))[0];\n return $file_name;\n }",
"public function extractFileName(): string\n {\n $name = $this->extractMeta('name') ?: $this->extractMeta('filename');\n\n if ( ! $this->isValidFilename($name)) {\n return '';\n }\n\n return $name;\n }",
"private function fileName()\n\t{\n\t\treturn $this->files[count($this->files) - 1];\n\t}",
"public function getFilename()\n {\n return static::filename($this->path);\n }",
"public function getFilename() {}",
"public function getFilename()\n\t{\n\t\t$contentDisposition = $this->get('Content-Disposition');\n\t\tif ($contentDisposition !== null)\n\t\t{\n\t\t\t$filename = null;\n\t\t\t$encoding = null;\n\n\t\t\t$contentElements = explode(';', $contentDisposition);\n\t\t\tforeach ($contentElements as $contentElement)\n\t\t\t{\n\t\t\t\t$contentElement = trim($contentElement);\n\t\t\t\tif (preg_match('/^filename\\*=(.+)\\'(.+)?\\'(.+)$/', $contentElement, $matches))\n\t\t\t\t{\n\t\t\t\t\t$filename = $matches[3];\n\t\t\t\t\t$encoding = $matches[1];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telseif (preg_match('/^filename=\"(.+)\"$/', $contentElement, $matches))\n\t\t\t\t{\n\t\t\t\t\t$filename = $matches[1];\n\t\t\t\t}\n\t\t\t\telseif (preg_match('/^filename=(.+)$/', $contentElement, $matches))\n\t\t\t\t{\n\t\t\t\t\t$filename = $matches[1];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($filename <> '')\n\t\t\t{\n\t\t\t\t$filename = urldecode($filename);\n\n\t\t\t\tif ($encoding <> '')\n\t\t\t\t{\n\t\t\t\t\t$charset = Context::getCurrent()->getCulture()->getCharset();\n\t\t\t\t\t$filename = Encoding::convertEncoding($filename, $encoding, $charset);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $filename;\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getAttachment($index)\n {\n return isset($this->attachments[$index]) ? $this->attachments[$index] : null;\n }",
"public function getAvatarFilename(){\n return $this->getAvatar()->getFilename();\n }",
"function getAttachmentFilename($filename, $attachment_id, $dir = null, $new = false, $file_hash = '')\n{\n\tglobal $modSettings;\n\n\t// Just make up a nice hash...\n\tif ($new)\n\t{\n\t\t$tokenizer = new TokenHash();\n\n\t\treturn $tokenizer->generate_hash(32);\n\t}\n\n\t// In case of files from the old system, do a legacy call.\n\tif (empty($file_hash))\n\t{\n\t\treturn getLegacyAttachmentFilename($filename, $attachment_id, $dir, $new);\n\t}\n\n\t// If we were passed the directory id, use it\n\t$modSettings['currentAttachmentUploadDir'] = $dir;\n\t$attachmentsDir = new AttachmentsDirectory($modSettings, database());\n\t$path = $attachmentsDir->getCurrent();\n\n\treturn $path . '/' . $attachment_id . '_' . $file_hash . '.elk';\n}",
"private function getFilename()\r\n {\r\n if ($this->path === null) {\r\n throw new \\DomainException('Path can\\'t be null when call '.__METHOD__);\r\n }\r\n\r\n if ($this->uuid === null) {\r\n throw new \\DomainException('Uuid can\\'t be null when call '.__METHOD__);\r\n }\r\n\r\n return str_replace($this->path, '', $this->uuid);\r\n }",
"public function getFilename() {\n return $this->path;\n }",
"public function getClientFilename()\n {\n return $this->fileInfo['name'];\n }",
"public function getFilename()\n {\n return '';\n }"
] |
[
"0.70553327",
"0.6478755",
"0.64387125",
"0.6429814",
"0.63696307",
"0.6313674",
"0.6255138",
"0.6228718",
"0.62069607",
"0.6150368",
"0.6145175",
"0.6142789",
"0.6135602",
"0.61222076",
"0.6048752",
"0.60086066",
"0.59968156",
"0.5987389",
"0.5977679",
"0.59770834",
"0.59571964",
"0.5947052",
"0.5945072",
"0.59285665",
"0.5893151",
"0.5863941",
"0.58426523",
"0.5839318",
"0.58269906",
"0.582621"
] |
0.88690954
|
0
|
Look for a deep value in a data array. Given $data = ['one' => ['two' => ['three' => 55]], 'four' => []]; ```php getArrayValueByKeys(['one','two','three'], $data) will return 55 getArrayValueByKeys(['four','five'], $data) will throw OutOfBoundsException ```
|
public static function getArrayValueByKeys(array $keys, &$data)
{
$key = array_shift($keys);
if (!is_array($data) || empty($key)) {
return $data;
}
if (array_key_exists($key, $data) === false) {
throw new OutOfBoundsException("Key [{$key}." . join('.', $keys) . "] not set in " . print_r($data, true));
}
if (empty($keys)) {
return $data[$key];
} else {
return self::getArrayValueByKeys($keys, $data[$key]);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function search_nested_array($key = 'id', $value, $arr = [])\n{\n foreach ($arr as $k => $a) {\n $s_value = $a[$key];\n if ($s_value == $value) {\n return $k;\n }\n if (is_array($s_value)) {\n if (in_array($value, $s_value)) return $k;\n }\n }\n return -1;\n}",
"function array_get_key_val($value, $heystack) {\r\n if (is_array($heystack)) {\r\n foreach ($heystack as $k => $v) {\r\n if ($v == $value) {\r\n return $k;\r\n } elseif (is_array($v)) {\r\n return array_get_key_val($value, $v);\r\n }\r\n }\r\n return -1;\r\n }\r\n return -1;\r\n}",
"function getValueByPath($arr,$path) {\n\t\t$r=$arr;\n\t\tif (!is_array($path)) return false;\n\t\tforeach ($path as $key) {\n\t\t\tif (isset($r[$key]))\n\t\t\t\t$r=$r[$key];\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn $r;\n\t}",
"public static function findByKey(array $data, $searchKey, $searchValue)\n {\n\t\t$result = (isset($data[$searchKey]) && $data[$searchKey] == $searchValue) ? $data : false;\n\t\tif (false === $result) {\n\t\t\tforeach ($data as $keypath => $value) {\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t$result = self::findByKey($value, $searchKey, $searchValue);\n\t\t\t\t\tif (false !== $result) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\n }",
"function array_value_recursive($key, array $arr)\n{\n $val = array();\n array_walk_recursive($arr, function ($v, $k) use ($key, &$val) {\n if ($k == $key) array_push($val, $v);\n });\n return count($val) > 1 ? $val : array_pop($val);\n}",
"protected function recursiveGet($data, $keys, $defaultValue)\n {\n $key = array_shift($keys);\n if (is_array($data) && $key !== null && count($keys) == 0) { //Last Key\n return array_key_exists($key, $data) ? $data[$key] : $defaultValue;\n } elseif (is_array($data) && array_key_exists($key, $data)) {\n return $this->recursiveGet($data[$key], $keys, $defaultValue);\n }\n return $defaultValue;\n }",
"public static function findKeys(array $data, array $keys)\n {\n if (count($keys) == 1) {\n $value = reset($keys);\n $key = key($keys);\n foreach ($data as $index => $row) {\n if (isset($row[$key]) && ($row[$key] == $value)) {\n return $index;\n }\n }\n } else {\n foreach ($data as $index => $row) {\n $found = true;\n foreach ($keys as $key => $value) {\n if ((!isset($row[$key])) || ($row[$key] !== $value)) {\n $found = false;\n break;\n }\n }\n if ($found) {\n return $index;\n }\n }\n }\n\n return null;\n }",
"public static function getNestedArrayValue($data, $keys, $default = null)\n {\n if ( ! is_array($data)) {\n throw new InvalidArgumentException(\n 'The first parameter must be an array.',\n 1461178154\n );\n }\n \n if ( ! is_array($keys)) {\n throw new InvalidArgumentException(\n 'The list of keys must be an array.',\n 1461178192\n );\n }\n \n /* Keep narrowing down to the desired part of the given array until we\n * find the desired entry (or discover that it doesn't exist). */\n while (count($keys) > 0) {\n $key = array_shift($keys);\n \n if (array_key_exists($key, $data)) {\n $data = $data[$key];\n } else {\n return $default;\n }\n }\n \n return $data;\n }",
"function array_value_recursive($key, array $arr){\n\t$val = array();\n\tarray_walk_recursive($arr, function($v, $k) use($key, &$val){\n\t\tif($k == $key) array_push($val, $v);\n\t});\n\treturn count($val) > 1 ? $val : array_pop($val);\n}",
"function findSubArray($DataArray, $keyName, $Value)\n {\n if (is_array($DataArray)) {\n $Data = array();\n foreach ($DataArray as $Row) {\n if ($Row[$keyName] == $Value)\n $Data[] = $Row;\n }\n return $Data;\n }\n return FALSE;\n }",
"function kc_array_multi_get_value( $array, $keys ) {\n\tforeach ( $keys as $idx => $key ) {\n\t\tunset( $keys[$idx] );\n\t\tif ( !isset($array[$key]) )\n\t\t\treturn false;\n\n\t\tif ( count($keys) )\n\t\t\t$array = $array[$key];\n\t}\n\n\tif ( !isset($array[$key]) )\n\t\treturn false;\n\n\treturn $array[$key];\n}",
"function getKeyByValue($arr,$value) {\n\t $n=-1;\n\t foreach ($arr as $aKey=>$aItem) {\n\t\t $n++;\n\t\t //if (!isset($akey)) $aKey=$n;\n\t\t if (!is_array($aItem)) {\n\t\t\t if ($Item==$value) return $aKey;\n\t\t } else {\n\t\t\t if ($aItem[$value['key']]==$value['value']) {\n\t\t\t\t return $aKey;\n\t\t\t }\n\t\t }\n\t }\n }",
"public static function tryGetKeysChainValue($array)\n {\n $arguments = func_get_args();\n $numArguments = func_num_args();\n\n $currentArray = $array;\n for ($i = 1; $i < $numArguments; ++$i) {\n if (is_array($currentArray)) {\n if (array_key_exists($arguments[$i], $currentArray)) {\n $currentArray = $currentArray[$arguments[$i]];\n } else {\n return null;\n }\n } else {\n return null;\n }\n }\n\n return $currentArray;\n }",
"function array_get_in($array, array $path, $default = null)\n{\n if (empty($path)) {\n return $array;\n }\n\n $head = array_shift($path);\n\n if (!is_array($array) || !array_key_exists($head, $array)) {\n return $default;\n }\n\n return array_get_in($array[$head], $path, $default);\n}",
"static function get($data /*key subkey ...*/){\n $ar = func_get_args();\n array_shift($ar);\n if(is_array($ar[0])) {\n $def = def($ar,1);\n $ar = $ar[0];\n } else $def = NULL;\n while($ck = array_shift($ar)){\n if(isset($data[$ck])) $data = $data[$ck]; \n else return($def);\n } \n return($data);\n }",
"public static function getValue($array, $key)\n\t{\n\t\t$keys = explode(\"->\", $key);\n\t\tforeach ($keys as $k) {\n\t\t\tif (is_array($array) && isset($array[$k])) {\n\t\t\t\t$array = $array[$k];\n\t\t\t} else if (is_object($array) && property_exists($array, $k)) {\n\t\t\t\t$array = $array->$k;\n\t\t\t} else {\n\t\t\t\t$array = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}",
"private function getArrayItemByPath($array)\n\t{\n\t\t$p = $array;\n\t\t$argc = func_num_args();\n\t\tfor ($i = 1; $i < $argc; $i++) {\n\t\t\t$k = func_get_arg($i);\n\t\t\tif ($k === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (is_array($k)) {\n\t\t\t\tforeach ($k as $kk) {\n\t\t\t\t\tif (isset($p[$kk])) {\n\t\t\t\t\t\t$p = $p[$kk];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (isset($p[$k])) {\n\t\t\t\t\t$p = $p[$k];\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $p;\n\t}",
"public static function getValue($array, $key, $default = null)\n {\n if (is_string($key)) {\n // Iterate path\n $keys = explode('.', $key);\n foreach ($keys as $key) {\n if (!isset($array[$key])) {\n return $default;\n }\n $array = &$array[$key];\n }\n // Get value\n return $array;\n } elseif (is_null($key)) {\n // Get all data\n return $array;\n }\n return null;\n }",
"function recursive_array_search($needle,$haystack) {\n foreach($haystack as $key=>$value) {\n $current_key=$key;\n if($needle===$value OR (is_array($value) && recursive_array_search($needle,$value) !== false)) {\n return $current_key;\n }\n }\n return false;\n}",
"function recursive_array_search($needle,$haystack) {\n foreach($haystack as $key=>$value) {\n $current_key=$key;\n if($needle===$value OR (is_array($value) && recursive_array_search($needle,$value) !== false)) {\n return $current_key;\n }\n }\n return false;\n}",
"function searchInArray($array, $key=null, $value=null)\n{\n $results = array();\n\n if (is_array($array))\n {\n if (isset($array[$key]) && $array[$key] == $value)\n $results[] = $array;\n\n foreach ($array as $subarray)\n $results = array_merge($results, searchInArray($subarray, $key, $value));\n }\n\n return $results;\n}",
"function searchByKey($keyVal, $array) {\n\t foreach ($array as $key => $val) {\n\t\t\t if ($keyVal == $key) {\n\t\t\t\t return $val;\n\t\t\t }\n\t }\n\t return null;\n }",
"public static function lookup_path($path, array $data, &$found) {\n\n if (!is_array($path)) {\n $path = explode(static::config()->get('path_seperator'), $path);\n }\n $pathLength = count($path);\n $parsed = 0;\n $lastPart = array();\n\n while ($part = array_shift($path)) {\n\n if (is_numeric($part)) {\n if (isset($lastPart[$part])) {\n $data = $lastPart[$part];\n }\n $parsed++;\n } elseif (isset($data[$part])) {\n // save this incase next 'part' is a numeric array index\n $lastPart = $data[$part];\n\n $data = $data[$part];\n $parsed++;\n } else {\n // failed to walk the full path, break out\n break;\n }\n }\n $found = $parsed === $pathLength;\n\n return $data;\n }",
"protected function getDataValue(array $record, array $path)\n {\n $lastKey = array_pop($path);\n $current = $record;\n foreach ($path as $key) {\n if (!isset($current[$key]) || !is_array($current[$key])) {\n return null;\n }\n $current = $current[$key];\n }\n if (!isset($current[$lastKey])) {\n return null;\n }\n\n return $current[$lastKey];\n }",
"function array_search_recursive_improved ($needle, $heystack, $consider_keys = false)\n{\n\tif (array_key_exists($needle,$heystack) && $consider_keys) // item is in keys\n\t\treturn array($needle);\n\telse // search values\n\t{\n\t\tforeach ($heystack as $key => $value)\n\t\t{\n\t\t\tif (is_array($value)) // we have an array value, search it\n {\n $effect = array_search_recursive_improved($needle,$value);\n if ($effect == false)\n continue;\n else\n return array_merge( array($key), $effect);\n }\n\t\t\telse\t// non-array value\n\t\t\t{\n\t\t\t\tif ($value == $needle)\n\t\t\t\t\treturn array($key);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn false;\n\t}\n}",
"public function getDataByMultiKey() {\n $val = json_decode($this, true);\n for ($i = 0; $i < func_num_args(); $i++) {\n $valid = false; //assume response is not valid unless the ith argument is found\n if (isset($val[func_get_arg($i)])) {\n $val = $val[func_get_arg($i)];\n $valid = true;\n }\n }\n if ($valid) {\n return $val;\n }\n else {\n return null;\n }\n return null;\n }",
"public function find($array, $value, $key = 'id'){\n \n foreach($array as $obj){\n \n if(is_array($obj) && $obj[$key] == $value) return $obj;\n else if(is_object($obj) && $obj->{$key} == $value) return $obj;\n \n }\n \n return null;\n \n }",
"public function getValue(array $array, string $path)\n {\n // If the $path value is empty, return the entire array graph\n if ($this->isRoot($path)) {\n return $array;\n }\n\n // If $path doesn't exist returns null. It is not possible to distinghuish between a path that exists and has a\n // null value and a path that doesn't exist at all.\n return $this->pa->getValue($array, $path);\n }",
"private function _get_array_value($array, $key)\r\n {\r\n if(array_key_exists($key, $array))\r\n {\r\n return $array[$key];\r\n }\r\n return NULL;\r\n }",
"static protected function findData ($path, $array)\n {\n if (!$path) {\n return $array;\n }\n\n $ids = explode ('/', $path);\n $root = array_shift($ids);\n\n return self::findData(implode ('/', $ids), $array[$root]);\n }"
] |
[
"0.64613444",
"0.64040226",
"0.61875737",
"0.61350083",
"0.61182964",
"0.60889256",
"0.60834223",
"0.60151553",
"0.5977985",
"0.59162235",
"0.5856554",
"0.58542746",
"0.57831055",
"0.5773905",
"0.5760174",
"0.5726868",
"0.57180756",
"0.5708613",
"0.570122",
"0.570122",
"0.56718206",
"0.5671115",
"0.5669961",
"0.56168264",
"0.5565842",
"0.55575174",
"0.5491068",
"0.5487918",
"0.54602253",
"0.5456506"
] |
0.6520812
|
0
|
Get Daily Email and SMS
|
public function dailyEmailsSMS($limit = 7)
{
$dailyEmailsSMSCount = array();
$periods = CarbonPeriod::create(Carbon::now()->subdays($limit), Carbon::now());
if (isset($periods)) {
foreach ($periods as $period) {
$count['email'] = Campaign::email()->whereDate('updated_at', $period)->get()->sum(function ($campaign) {
return count($campaign->contacts);
});
$count['sms'] = Campaign::sms()->whereDate('updated_at', $period)->get()->sum(function ($campaign) {
return count($campaign->contacts);
});
$dailyEmailsSMSCount[$period->day] = $count;
}
}
return $dailyEmailsSMSCount;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getEmailSent();",
"public function TextMessagesSentInLastDay()\n\t{\n\t\t$count = 0;\n\t\t$q = DB::Run(\"SELECT Recipients, SegmentCount, FailedRecipients\n\t\t\t\t\tFROM SMSJobs\n\t\t\t\t\tWHERE (Finished > NOW() - INTERVAL 1 DAY OR Started > NOW() - INTERVAL 1 DAY)\n\t\t\t\t\t\tAND WardID='{$this->WardID}'\n\t\t\t\t\t\tAND SenderID='{$this->ID}'\");\n\n\t\twhile ($row = mysql_fetch_array($q))\n\t\t{\n\t\t\t$recip = json_decode($row['Recipients']);\n\t\t\t$parts = $row['SegmentCount'];\n\t\t\t$failed = json_decode($row['FailedRecipients']);\n\t\t\t$count += count($recip) * $parts - count($failed);\n\t\t}\n\t\treturn $count;\n\t}",
"public function dailyClientEmailsSMS(Client $client, $limit = 7)\n {\n $dailyEmailsSMSCount = array();\n $periods = CarbonPeriod::create(Carbon::now()->subdays($limit), Carbon::now());\n if (isset($periods)) {\n foreach ($periods as $period) {\n $count['email'] = Campaign::where('client_id', $client->id)->email()->whereDate('updated_at', $period)->get()->sum(function ($campaign) {\n return count($campaign->contacts);\n });\n $count['sms'] = Campaign::where('client_id', $client->id)->sms()->whereDate('updated_at', $period)->get()->sum(function ($campaign) {\n return count($campaign->contacts);\n });\n\n $dailyEmailsSMSCount[$period->day] = $count;\n }\n }\n return $dailyEmailsSMSCount;\n }",
"private function sendDailyPubEmail()\n {\n foreach(Publisher::all() as $publisher) {\n $message = (new PublisherDaily($publisher->id))->onQueue('platform-processing');\n Mail::to($publisher->email,$publisher->name)->send($message);\n Log::info(\"Sent Daily Email To: \" . $publisher->email);\n }\n }",
"public function filter_messages_by_date()\n {\n if(session('reports_filter_domain') != [])\n {\n $data = $this->get_filtered_data(true, false)['data']->groupBy('date');\n $labels = [];\n $results = [];\n foreach ($data as $day) {\n $stats = [\n 'label' => $day->first()->date,\n 'messages' => count($day),\n 'virus' => $day->sum('virusinfected') + $day->sum('otherinfected'),\n 'msg_virus_ratio' => 0,\n 'spam' => $day->sum('isspam') + $day->sum('ishighspam'),\n 'msg_spam_ratio' => 0,\n 'volumne' => $day->sum('size')\n ];\n $stats['msg_virus_ratio'] = ($stats['virus'] > 0) ? ($stats['virus'] / $stats['messages']) * 100 : 0;\n $stats['msg_spam_ratio'] = ($stats['spam'] > 0) ? ($stats['spam'] / $stats['messages']) * 100 : 0;\n $results[] = $stats;\n $labels[] = $day->first()->date;\n }\n return ['results' => $results, 'labels' => $labels];\n }\n else\n {\n //abort(400, 'You have not applied any filters, therefore this report will not work');\n return response()->json([ 'error' => 400, 'message' => 'You have not applied any filters, therefore this report will not work' ], 400);\n }\n }",
"public function getSendMailings() {\n\t\t$sql = 'SELECT pageId, UNIX_TIMESTAMP(dateadded) as `dateadded` FROM mailqueue WHERE issend=2';\n\t\t$ids = $this -> _conn -> getFields($sql);\n\t\t$rows = $this -> _conn -> getRows($sql);\n\t\t$page = new Page();\n\t\t$result = $page -> getPagesByIds($ids, true);\n\t\tif($result) {\n\t\t\tforeach($result as $page) {\n\t\t\t\tforeach($rows as $row) {\n\t\t\t\t\tif($row -> pageId == $page -> pageId) {\n\t\t\t\t\t\t$page -> publicationdate = $row -> dateadded;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}",
"public function getMailingStatistics()\n {\n $query = $this->em->createQuery('SELECT m.id AS messageId, COUNT(u.viewed) AS views, COUNT(u.status) AS total,\n m.subject, m.sent, m.bounceCount AS bounceCount, (COUNT(u.viewed) / COUNT(u.status) * 100) AS rate\n FROM IdeupPhplistBundle:PhplistUserMessage u JOIN u.message m\n GROUP BY m.id\n ORDER BY m.entered');\n return $query->getResult();\n }",
"public function getSmsReadySchdule () \n {\n\n date_default_timezone_set('Asia/Manila');\n \t$objTime = Carbon::now();\n \t$from = $objTime->format('Y-m-d H:i:s');\n \t$to = $objTime->addMinutes(3)->format('Y-m-d H:i:s');\n\t\t\n\t\t$sms = ScheduledSms::where('sent', 0)->whereBetween('standard_datetime', [$from,$to]);\n\t\t$sms = $sms->get();\n\n\t\tif(!empty($sms)){\n\t\t\tforeach($sms as $v){\n\n\t\t\t\tif(!empty($v->phone)){\n\t\t\t\t\t$message = 'The \"Making Money with Automated Bots\" training is live in 15 minutes! Check your email for your link and let\\'s rock!';\n\n\t\t\t\t\t$sms = Twilio::message($v->phone, $message);\n\t\t\t\t}\n\n\t\t\t\t$v->sent = 1;\n\t\t\t\t$v->save();\n\t\t\t}\n\n\t\t\treturn 'success';\n\t\t}\n\n\t\treturn 'no scheduled sms';\n\n }",
"public function sendemails(){\n $sql = \"SELECT DATEDIFF( `date_for_renew` , NOW( ) ) AS `DAYS` , `email` , `first_name` , `last_name` \n FROM `subscriptions` \n JOIN `artists` ON `artists`.`id` = `subscriptions`.`artist_id` \n HAVING DAYS = '30' || DAYS ='15' || DAYS = '1';\";\n $query = $this->db->query($sql);\n $this->load->library('general_library');\n $gl = new general_library();\n foreach($query->result() as $email):\n $email_array = array();\n $email_array['subject'] = \"Your subscription has \" . $email->DAYS . \" left.\";\n $email_array['message'] = \"Your subscription has \" . $email->DAYS . \" left.\";\n $email_array['email'] = $email->email;\n $gl->sendEmail($email_array);\n endforeach;\n \n return true;\n }",
"function mail_summary_count($countType, $time=\"\"){\r\n\tglobal $wpdb;\r\n\t\t$table_mail_creation = $wpdb->prefix . \"mail_creation\";\r\n\t\t$table_mail_tagging = $wpdb->prefix . \"mail_tagging\";\r\n\t\t$count_type=$countType;\r\n\t\t$roleCondition='';\r\n\t\t//AND created_by='1'\r\n\t\t\r\n\t\t$userCurr = wp_get_current_user();\r\n\t\tif ( in_array( 'client', (array) $userCurr->roles ) ) {\r\n\t\t//The user has the \"client\" role\r\n\t\t$roleCondition='AND created_by='.$userCurr->ID;\r\n\t\t//\r\n\t\t}\r\n\r\n\r\n\r\n\r\n\t\t/** That query is Find count registered mail according to time from mail_creation table **/\r\n\t\t\r\n\t\t\r\n\t\t//$sql= \"SELECT COUNT(*) as registerd_mail_count FROM \".$table_name.\" WHERE mail_type='\".$count_type.\"'\".$roleCondition;\r\n\t\t$sql= \"SELECT COUNT(b.mail_type) as mailCount FROM \".$table_mail_tagging.\" a INNER JOIN \".$table_mail_creation.\" b ON a.tracking_id = b.tracking_number WHERE a.tag IN('good','bad') AND a.type ='Individual' AND b.mail_type='\".$count_type.\"' \".$roleCondition;\r\n\t\t\r\n\t\r\n\t\tif($time!=\"\"){\r\n\t\t\t\r\n\t\t\tif($time=='week'){\r\n\t\t\t\t$sql .= ' and created_on >= (CURDATE() + INTERVAL -7 DAY)';\r\n\t\t\t}\r\n\t\t\tif($time=='month'){\r\n\t\t\t\t$sql .= ' and created_on >= (CURDATE() + INTERVAL -30 DAY)';\r\n\t\t\t}\r\n\t\t\tif($time=='today'){\r\n\t\t\t\t$sql .= ' and created_on >= (CURDATE() + INTERVAL - 0 DAY)';\r\n\t\t\t}\r\n\t\t}\r\n\t\t//echo $sql;\r\n\t\t$result = $wpdb->get_results( $sql );\r\n\t\t\r\n\t\t//$resultCount=$result[0]->registerd_mail_count;\r\n\t\t$result[0]->mailCount;\r\n\t\t\r\n\t\t//return $resultCount;\r\n\t\t\r\n\r\n /** Batch Query **/\r\n\t\t$table_batch_creation = $wpdb->prefix . \"batch_creation\";\r\n\t\t//$sqlBatch= \"SELECT COUNT(*) as registerd_mail_count FROM \".$table_name2.\" WHERE mail_type='\".$count_type.\"'\".$roleCondition;\r\n\t\t$sqlBatch= \"SELECT COUNT(b.mail_type) as mailCount FROM \".$table_mail_tagging.\" a INNER JOIN \".$table_batch_creation.\" b ON a.tracking_id = b.tracking_number WHERE a.tag IN('good','bad') AND a.type ='Batch' AND b.mail_type='\".$count_type.\"' \".$roleCondition;\r\n\t\t//echo $sqlBatch;\r\n\t\tif($time!=\"\"){\r\n\t\t\t\r\n\t\t\tif($time=='week'){\r\n\t\t\t\t$sqlBatch .= ' and created_on >= (CURDATE() + INTERVAL -7 DAY)';\r\n\t\t\t}\r\n\t\t\tif($time=='month'){\r\n\t\t\t\t$sqlBatch .= ' and created_on >= (CURDATE() + INTERVAL -30 DAY)';\r\n\t\t\t}\r\n\t\t\tif($time=='today'){\r\n\t\t\t\t$sqlBatch .= ' and created_on >= (CURDATE() + INTERVAL - 0 DAY)';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//echo $sqlBatch.\"<br>\".$sql;\r\n\t\t$resultBatch = $wpdb->get_results( $sqlBatch );\r\n\t\t//$result[0]->mailCount;\r\n\t\t\r\n\t\t\r\n\t\t$resultCount= $result[0]->mailCount+$resultBatch[0]->mailCount;\r\n\t\t\r\n\t\t//echo '<pre>';\r\n\t\t//print_r($resultCount);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn $resultCount;\r\n\r\n\r\n\r\n\t\t\r\n\t}",
"private function upcoming_bills_reminder()\n\t{\n\t\t$recipients = array();\n\t\t$recipient = array();\n\t\t$this->load->model('Membership_model');\n\t\t$this->load->model('Accounts_model');\n\t\t$this->load->model('Settings_model');\n\t\t\n\t\t$result = $this->Membership_model->get_members();\n\t\tforeach ($result as $member)\n\t\t{\n\t\t\t$days = $this->Settings_model->email_reminder_days_get($member->id);\n\t\t\tif ($days > 0) // only do this if they want email reminders \n\t\t\t{\n\t\t\t\t$recipient['email_address'] = $member->email_address;\n\t\t\t\t$billcount = 0;\n\t\t\t\t$accounts_due = $this->Accounts_model->get_accounts_due($member->id);\n\t\t\t\t$recipient['message'] = \"G'day\";\n\t\t\t\tif ($member->first_name != '') $recipient['message'] .= \" \".$member->first_name;\n\t\t\t\t$recipient['message'] .= \",<br><br>Derek from remember-my-bills here. As promised, here's a list of bills due in the next \".$days.\" days<hr>\";\n\t\t\t\tforeach ($accounts_due as $account) {\n\t\t\t\t\t$billcount += 1;\n\t\t\t\t\t$recipient['message'] .= \n\t\t\t\t\t\t$account->account.\" bill for \".\n\t\t\t\t\t\t$account->amount.\" is due by \".\n\t\t\t\t\t\tdate($this->Settings_model->date_format_get_php($member->id), strtotime($account->next_due)).\"<br>\";\n\t\t\t\t}\n\t\t\t\t$recipient['message'] .= \"<Br><br>Go to <a href='http://rememberthebills.com'>http://rememberthebills.com</a> to pay them.\";\n\t\t\t\t$recipient['message'] .= \"<Br><br>Enjoy your day!<br><br>The remember-the-bills team.\";\n\t\t\t\t\n\t\t\t\t$recipient['subject'] = \"You have \".$billcount.\" bill\".($billcount > 1 ? \"s\" : \"\").\" due within the next \".$days.\" day\".($days > 1 ? \"s\" : \"\");\n\t\t\t\t//$data['ignoreMenu'] = 'true';\n\t\t\t\t//$data['main_content'] = 'email_view';\n\t\t\t\t//$recipient['message'] = $this->load->view('includes/template.php', $data, true);\n\t\t\t\t\n\t\t\t\tarray_push($recipients, $recipient);\n\t\t\t}\n\t\t}\n\t\treturn $recipients;\n\t}",
"public function sendOrdersInNextWeek()\n {\n $subject = '[QS-IMS MAILER] DANH SÁCH THIẾT BỊ SẼ ĐƯỢC ĐIỀU ĐỘNG TRONG TUẦN KẾ TIẾP';\n $mail = '';\n $start = date('Y-m-d', strtotime('next monday'));\n $end = date('Y-m-d', strtotime('next sunday'));\n\n $sql = sprintf('\n SELECT\n ddtb.*,\n qsusers.*,\n dsddtb.MaThietBi,\n dsddtb.TenThietBi\n FROM OLichThietBi AS ddtb\n INNER JOIN ODanhSachDieuDongThietBi AS dsddtb ON ddtb.IFID_M706 = dsddtb.IFID_M706\n INNER JOIN ODanhSachThietBi AS dstb ON dsddtb.Ref_MaThietBi = dstb.IOID\n INNER JOIN OKhuVuc AS khuvuc ON dstb.Ref_MaKhuVuc = khuvuc.IOID\n INNER JOIN OKhuVuc AS khuvuccon ON khuvuc.lft <= khuvuccon.lft AND khuvuc.rgt >= khuvuccon.rgt\n INNER JOIN OThietBi AS DonViKhuVuc ON khuvuccon.IOID = DonViKhuVuc.Ref_Ma\n INNER JOIN ODonViSanXuat AS DonVi ON DonVi.IFID_M125 = DonViKhuVuc.IFID_M125\n INNER JOIN ODonViSanXuat AS DonViCon ON DonVi.lft <= DonViCon.lft AND DonVi.rgt >= DonViCon.rgt\n INNER JOIN ONhanVien AS DonViNhanVien ON DonViCon.IFID_M125 = DonViNhanVien.IFID_M125\n INNER JOIN ODanhSachNhanVien AS NhanVien ON DonViNhanVien.Ref_MaNV = NhanVien.IOID\n INNER JOIN qsusers ON qsusers.UID = NhanVien.Ref_TenTruyCap\n WHERE qsusers.isActive = 1 /*AND (ddtb.NgayBatDau BETWEEN %1$s AND %2$s)*/\n ORDER BY ddtb.NgayBatDau, ddtb.SoPhieu\n ', $this->_db->quote($start), $this->_db->quote($end));\n\n $dataSql = $this->_db->fetchAll($sql);\n\n $this->setToList($dataSql);\n\n if(count($dataSql) && count($this->to))\n {\n $mail .= '<h1> DANH SÁCH THIẾT BỊ SẼ ĐƯỢC ĐIỀU ĐỘNG TRONG TUẦN KẾ TIẾP </h1>';\n $mail .= '<br/>';\n $mail .= '<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\">';\n $mail .= '<tr>';\n $mail .= '<th> TÊN THIẾT BỊ </th>';\n $mail .= '<th> MÃ THIẾT BỊ </th>';\n $mail .= '<th> SỐ PHIẾU </th>';\n $mail .= '<th> NGÀY BẮT ĐẦU </th>';\n $mail .= '<th> NGÀY KẾT THÚC </th>';\n $mail .= '</tr>';\n\n foreach($dataSql as $item)\n {\n $mail .= '<tr>';\n $mail .= '<td>' . $item->TenThietBi . '</td>';\n $mail .= '<td>' . $item->MaThietBi . '</td>';\n $mail .= '<td><a target=\"_blank\" href=\"http://'.$this->domain.'/user/form/edit?ifid='.$item->IFID_M706.'&deptid='.$item->DeptID.'\">'.$item->SoPhieu.'</a></td>';\n $mail .= '<td>' . Qss_Lib_Date::mysqltodisplay($item->NgayBatDau) . '</td>';\n $mail .= '<td>' . Qss_Lib_Date::mysqltodisplay($item->NgayKetThuc) . '</td>';\n $mail .= '</tr>';\n }\n\n $mail .= '</table>';\n $mail .= '<br/>';\n $mail .= '<p style=\"text-align:right\" > <b>QS-IMS Mailer</b> </p>';\n $this->_sendMail($subject, $this->to, $mail, $this->cc);\n }\n }",
"public function getMTLog($f_date, $t_date){\r\n\t\t$select = $this->Select(\"select time, sum(total) as total, sum(sucess) as num_sucess from (\r\n\t\tselect trunc(sent_time) time, 0 total, count(*) sucess from sms_log \r\n\t\twhere SUBMIT_STATUS = 0 and sent_time >= to_date('\".$f_date.\"','dd/mm/yyyy') and sent_time < to_date('\".$t_date.\"','dd/mm/yyyy') +1 group by trunc(sent_time)\r\n\t\tunion all\r\n\t\tselect trunc(sent_time) time , count(*) total, 0 sucess from sms_log where sent_time >= to_date('\".$f_date.\"','dd/mm/yyyy') and sent_time < to_date('\".$t_date.\"','dd/mm/yyyy') +1 group by trunc(sent_time)\r\n\t\t)\r\n\t\tgroup by time\r\n\t\torder by time\");\r\n\t\t\r\n\t\t//$select = $this->Select(\"select count(*) as count, TRUNC(sent_time) as time_sent from sms_log where sent_time >= '\" . $f_date . \"' and sent_time <= '\" . $t_date . \"' group by TRUNC(sent_time) order by TRUNC(sent_time) desc\");\r\n\t\t\r\n\t\t$result = $this->FetchAll($select);\r\n\t\t//$this->DumpQueriesStack(); \r\n\t\tif($this->NumRows($select) > 0){\r\n return $result;\r\n }\r\n }",
"function get_all_mailings(){\n \n #api return count 25 as default.\n #set max count in rowCount as 500\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'rowCount' => 500 \n );\n \n /*$sql = \"Select count(*) as count From civicrm_mailing\";\n $mailingCount = CRM_Core_DAO::singleValueQuery($sql);\n if($mailingCount > 25){\n $params['rowCount'] = $mailingCount;\n }*/\n $aMailings = civicrm_api('Mailing', 'get', $params);\n if( $aMailings['is_error'] == 1 ){\n watchdog( WATCHDOG_DEBUG\n , \"Calling get_all_mailings():\\n\" .\n '$aMailings:' . print_r( $aMailings, true ) . \"\\n\"\n );\n return;\n }\n foreach ( $aMailings['values'] as $key => $mailing ){\n $pMailingJob = array(\n 'version' => 3,\n 'sequential' => 1,\n 'mailing_id' => $mailing['id']\n );\n $aMailingJob = civicrm_api('MailingJob', 'get', $pMailingJob);\n if( $aMailingJob['is_error'] != 1 && $aMailingJob['count']!= 0 ){\n $status = $aMailingJob['values'][0]['status'];\n $stDate = array_search('start_date', $aMailingJob['values'][0]);\n $endDate = array_search('end_date', $aMailingJob['values'][0]);\n $not_scheduled = false;\n if($stDate){\n $start_date = CRM_Utils_Date::customFormat($stDate);\n }else{\n $start_date = 'NULL';\n }\n if($endDate){\n $end_date = CRM_Utils_Date::customFormat($endDate);\n }else{\n $end_date = 'NULL';\n }\n }else{\n $status = \"Draft\";\n $start_date = $end_date = 'NULL';\n $not_scheduled = true;\n }\n \n //get change the action link based on the status\n if($not_scheduled){\n $actionUrl = CRM_Utils_System::url( 'civicrm/quickbulkemail', 'mid='.$mailing['id'].'&continue=true&reset=1');\n $actionName = 'Edit';\n }else{\n $actionUrl = CRM_Utils_System::url( 'civicrm/quickbulkemail', 'mid='.$mailing['id'].'&reset=1');\n $actionName = 'Re-Use';\n }\n \n //get scheduled_id and contact name\n if(!empty( $mailing['scheduled_id'] )){\n $scheduled_id = $mailing['scheduled_id'];\n $scheduled_name = self::get_contact_name( $mailing['scheduled_id'] );\n }else{\n $scheduled_id = 'NULL';\n $scheduled_name = 'NULL';\n }\n \n if(empty($mailing['scheduled_date'])) {\n $mailing['scheduled_date'] = NULL;\n }\n \n $action = \"<span><a href='\".$actionUrl.\"'>\".$actionName.\"</a></span>\" ;\n $rows[] = array( 'id' => $mailing['id']\n ,'name' => $mailing['name']\n ,'status' => $status\n ,'created_date' => CRM_Utils_Date::customFormat($mailing['created_date'])\n ,'scheduled' => CRM_Utils_Date::customFormat($mailing['scheduled_date'])\n ,'start' => $start_date\n ,'end' => $end_date\n ,'created_by' => self::get_contact_name( $mailing['created_id'] )\n ,'scheduled_by' => $scheduled_name\n ,'created_id' => $mailing['created_id']\n ,'scheduled_id' => $scheduled_id\n ,'action' => $action\n ); \n }\n return $rows;\n }",
"function daily_update_property_email(){\n\t\t$meta_post = $this->InteractModal->get_update_post_meta();\n\t\tif(!empty($meta_post)){\n\t\t\t$data = array();\n\t\t\tforeach($meta_post as $meta_details){\n\t\t\t\t$user_id = $this->InteractModal->get_post_meta($meta_details['post_id'],'initiator_id');\n\t\t\t\t$data[$user_id][]= $meta_details['meta_key'];\n\t\t\t}\n\t\t}\t\t\n\t\t$get_data=$this->InteractModal->get_today_data();\n\t\t$id=2;\n\t\tif(!empty($get_data)){\n\t\t\t$result = array();\n\t\t\tforeach ($get_data as $element) {\n\t\t\t\t$result[$element['user_id']][]= $element['task_type'];\n\t\t\t}\n\t\t\tif(!empty($data) && (!empty($result))){\n\t\t\t\t$results = array_merge($data,$result);\n\t\t\t}\n\t\t\t$user_id= '';\n\t\t\tif(!empty($results)){\n\t\t\t\tforeach($result as $user_id=>$value):\n\t\t\t\t\t$update_details='';\n\t\t\t\t\t$value = array_unique($value);\n\t\t\t\t\tforeach($value as $values):\t\t\t\t\t\t\n\t\t\t\t\t\t$update_details=$update_details.'Today '.ucwords($values).' Successfully.<br>';\n\t\t\t\t\tendforeach;\n\t\t\t\t\tif(!empty($user_id)){\n\t\t\t\t\t\t$where = array( 'id' =>$user_id);\n\t\t\t\t\t\t$user_data=$this->InteractModal->single_field_value('users',$where);\n\t\t\t\t\t\techo $email= $user_data[0]['user_email'];\n\t\t\t\t\t\techo \"<br>\";\n\t\t\t\t\t\t$company_id = $this->InteractModal->get_user_meta( $user_id, 'company_id');\n\t\t\t\t\t\t///get auto email content data \n\t\t\t\t\t\t$status_template = $this->InteractModal->get_user_meta( $company_id, 'status_template_id_'.$id );\n\t\t\t\t\t\tif(($status_template ==1)){\n\t\t\t\t\t\t\t$subject = $this->InteractModal->get_user_meta( $company_id, 'subject_template_id_'.$id );\n\t\t\t\t\t\t\t$content = $this->InteractModal->get_user_meta( $company_id, 'content_template_id_'.$id );\n\t\t\t\t\t\t\t$user_name = $this->InteractModal->get_user_meta( $user_id, 'concerned_person');\n\t\t\t\t\t\t\t$phone_number = $this->InteractModal->get_user_meta( $user_id, 'phone_number');\n\t\t\t\t\t\t\t$logo_content = '<img src=\"'.base_url().'/assets/img/profiles/logo_(2).png\" height=\"auto\" width=\"100\" alt=\"Logo\">'; \t\t\t\t\t\t\n\t\t\t\t\t\t\t$content=nl2br($content);\n\t\t\t\t\t\t\t$content = str_replace(\"_NAME_\",$user_name,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_PHONE_\",$phone_number,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_EMAIL_\",$email,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_LOGO_\",$logo_content,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_DATE_\",date('d-F-Y'),$content);\n\t\t\t\t\t\t\t$content = $content.'<br>'.$update_details;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$template_list = $this->InteractModal->get_email_template($id);\n\t\t\t\t\t\t\tforeach( $template_list as $template_lists ):\n\t\t\t\t\t\t\t\t$subject = $template_lists['subject']; \n\t\t\t\t\t\t\t\t$content = $update_details; \n\t\t\t\t\t\t\tendforeach;\t\t\t\t\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t///get auto email content data \t\t\t\t\n\t\t\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t'content' => $content,\n\t\t\t\t\t\t\t'subject' => $subject\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->send_email($email_data);\n\t\t\t\t\t} \n\t\t\t\tendforeach;\n\t\t\t}\n\t\t}\n\t}",
"public function messages_by_date()\n {\n return view('reports.messages_by_date');\n }",
"function getAllEmails() {\n return getALL('SELECT * FROM mail');\n}",
"function send_first_reminder()\n\t{\n\t\tlog_message('debug', '_message_cron/send_first_reminder');\n\t\t# get non-responsive invites that are more than FIRST_INVITE_PERIOD days old\n\t\t$list = $this->_query_reader->get_list('get_non_responsive_invitations', array('days_old'=>FIRST_INVITE_PERIOD, 'limit_text'=>' LIMIT '.MAXIMUM_INVITE_BATCH_LIMIT, 'old_message_code'=>'invitation_to_join_clout'));\n\t\tlog_message('debug', '_message_cron/send_first_reminder:: [1] list='.json_encode($list));\n\t\t# resend old invite as a reminder\n\t\t$results = array();\n\t\tforeach($list AS $i=>$row){\n\t\t\t$results[$i] = $this->_query_reader->run('resend_old_invite', array('invite_id'=>$row['invite_id'], 'new_code'=>'first_reminder_to_join_clout', 'new_status'=>'pending'));\n\t\t}\n\t\tlog_message('debug', '_message_cron/send_first_reminder:: [2] results='.json_encode($results));\n\t\t$reason = empty($results)? 'no-users': '';\n\t\treturn array('result'=>(get_decision($results)? 'SUCCESS': 'FAIL'), 'count'=>count($results), 'reason'=>$reason);\n\t}",
"public function requestDailyReport()\n {\n $client = $this->guzzleClient ?: new GuzzleClient($this->apiEndpoint);\n\n $request = $client->get(\n '/anapi/daily_summary_feed',\n ['Accept' => 'application/json'],\n ['query' => ['key' => $this->apiKey, 'format' => $this->format]]\n );\n\n $response = $request->send();\n\n return $this->handleResponse($response);\n }",
"function statReceiveAuth()\n{\n $post = getPostInfo();\n $startDate= isset($post['reportstartdate'])?$post['reportstartdate']:'2016-11-01';\n $endDate = isset($post['reportenddate'])?$post['reportenddate']:'2017-01-20';\n\n XLog::formatLog(\"statReceiveAuth\", json_encode($post), XLog::$errorFile);\n\n $dateArr = parseDate($startDate,$endDate);\n\n $curTime = date('Y-m-d H:i:s');\n\n $pageInfo = DB::fetchAll(DB_NUMBER, \"\n SELECT SUM(`Received`) AS total,SUM(`Authorised`) AS auths,date_format(`CreateDate`, '%Y-%m-%d') as `day`\n FROM `dashboard`\n WHERE `CreateDate` <= '{$curTime}' AND `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}'\n GROUP BY `day`\n \");\n\n return $pageInfo;\n}",
"public function getNew()\n\t{\n\t\t$msgs = $this->getAllByQuery(\"date_sent >= ?\", [$this->last_query_time]);\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}",
"function fetchSMS(){\n\n\t$sql=\"select requestID,MSISDN,messageContent,processed from incomingRequests where processed = 5\";\n\t$result=mysql_query($sql);\n\tif(!$result){\n\t\t$dbErr=\"SQL Error: \".mysql_error().\"SQL CODE: \".$sql;\n\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t}else{\n\t\t$subLogs = \"Fetched 1 sms bucket of approx \".mysql_num_rows($result).\" items.\";\n\t\tlogSubs($subLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t\n\t}\n\treturn $result;\n}",
"function update_activity_send_sms_email_to_visitors($activity_id) {\n // , auto-generate meeting_ID\n $date = date('Ymd');\n\n $visitors = $this->Activity_model->get_activity_visitors_by_activity_id($activity_id);\n $activity_details = $this->Activity_model->get_daily_activity_by_activity_id($activity_id);\n\n $host_info = $this->Activity_Model->get_emp_info_by_empcode($activity_details->HOST_EMP);\n $host_name = $host_info->EMP_FNAME .' '. $host_info->EMP_LNAME;\n\n if($visitors) {\n foreach ($visitors as $visitor) {\n $meeting_ID = $date . str_pad($visitor->VISITOR_ID, 4, '0', STR_PAD_LEFT);\n $this->Activity_Model->update_visit_log_meeting_id($meeting_ID, $visitor->VISITOR_ID);\n\n $visitors_name = $visitor->VISIT_FNAME .' '. $visitor->VISIT_LNAME;\n $sms_message = \"Good day, \".$visitors_name.\"! Please be advised that your meeting with \".$host_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\" has already been confirmed. Your meeting ID is \".$meeting_ID.\". Please check your e-mail for further details. Thank you!\";\n\n $email_message = \"Dear \".$visitors_name.\": <br><br> Good Day! <br><br>\n Please be advised that your meeting with \".$host_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\" has already been confirmed. <br><br>\n Your meeting ID is \".$meeting_ID.\". <br><br>\n If you encountered any technical problems, please contact \".$host_name.\" at \".$host_info->EMAIL_ADDRESS.\" or \".$host_info->MOBILE_NO.\".\n\n <br><br><br>\n Thank you.<br><br>\n <b>Human Resources </b>\";\n $this->sms->send( array('mobile' => $visitor->MOBILE_NO, 'message' => $sms_message) );\n $this->send_email($visitor->EMAIL_ADDRESS, 'ETS – '.$visitor->MEETING_ID.' - MEETING UPDATE', $email_message);\n\n // SMS EMAIL TO HOST_EMPLOYEE FOR MEETING ID\n $sms_message = \"Good day, \".$host_name.\"! Please be informed that you have a meeting with \".$visitors_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\". Please check your e-mail for the meeting confirmation. Please disregard this message if you already complied. Thank you!\";\n\n $email_message = \"Dear \".$host_name.\": <br><br> Good Day! <br><br>\n Please be informed that you have a meeting with \".$visitors_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\". <br><br>\n To confirm the meeting, please copy the link below and paste it into your browser’s address bar. <br><br>\".base_url('login').\" <br><br>Please disregard this message if you already complied.\n\n <br><br><br>\n Thank you.<br><br>\n <b>Human Resources </b>\";\n if($host_info->MOBILE_NO <> 0) {\n $this->sms->send( array('mobile' => $host_info->MOBILE_NO, 'message' => $sms_message) );\n }\n\n if($host_info->EMAIL_ADDRESS) {\n $this->send_email($host_info->EMAIL_ADDRESS, 'ETS – VISITOR’S MEETING CONFIRMATION', $email_message);\n }\n\n }\n }\n\n\n\n \n }",
"function getDailyReport($date = null)\n{\n//SELECT COUNT(0)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `invoice_count`,\n//`b`.`tran_date` AS `tran_date`,(\n//SELECT COUNT(`0_debtor_trans_details`.`id`)\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND\n//(`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_count`,(\n//SELECT SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_invoice_amount`,(\n//SELECT SUM(`0_debtor_trans`.`alloc`)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_amount_recieved`,(\n//SELECT (SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`)) - SUM(`0_debtor_trans`.`alloc`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `pending_amount`,(\n//SELECT (SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`unit_price`)) -\n//SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`discount_amount`)))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_charge`,(\n//SELECT SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`user_commission`))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_commission`,(\n//SELECT SUM(ABS(`0_gl_trans`.`amount`))\n//FROM `0_gl_trans`\n//WHERE ((`0_gl_trans`.`type` = 12) AND (`0_gl_trans`.`account` = 1200) AND\n//(`b`.`tran_date` = '$date'))) AS `total_collection`\n//FROM ((`0_debtor_trans` `a`\n//JOIN `0_gl_trans` `b` ON((`a`.`trans_no` = `b`.`type_no`)))\n//JOIN `0_debtor_trans_details` `c` ON((`a`.`trans_no` = `c`.`debtor_trans_no`)))\n//WHERE ((`c`.`debtor_trans_type` = 10) AND (`a`.`type` = 10)) and `b`.`tran_date` = '$date'\n//GROUP BY `b`.`tran_date`\n//ORDER BY `b`.`tran_date`\";\n//\n//// if ($date) {\n//// $sql .= \" and tran_date='$date' \";\n//// }\n////\n//// $sql .= \" order by tran_date desc LIMIT 10\";\n//\n//\n//// print_r($sql); die;\n//\n// $result = db_query($sql, \"Transactions could not be calculated\");\n//\n// $table_html = \"\";\n//\n// $i = 0;\n//\n// while ($myrow = db_fetch($result)) {\n//\n// $class = 'class=\"oddrow\"';\n// if ($i % 2 == 0)\n// $class = 'class=\"evenrow\"';\n//\n// $table_html .= \"<tr $class>\";\n// $table_html .= \"<td>\" . $myrow['tran_date'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['invoice_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['total_service_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_service_charge'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_invoice_amount'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_collection'], user_price_dec()) . \"</td>\";\n// $table_html .= \"</tr>\";\n// $i++;\n// }\n// return $table_html;\n\n}",
"function getHistory($email){\n $db = databaseConnection();\n $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $email = $db -> quote($email);\n $query = \"SELECT *, COUNT(*) as quant FROM Transazione, Prodotto WHERE Transazione.id_prodotto=Prodotto.ID AND email=$email GROUP BY email, Prodotto.ID;\";\n $rows = $db -> query($query);\n return $rows -> fetchAll(PDO::FETCH_ASSOC);\n}",
"public function getAllSMS()\n\t{\n return $this->_getAndParse($this->_serverPath['getSMS'], null);\n\t}",
"function getSentboxMessage() {\n $sql = \"SELECT * FROM `mail` WHERE sender_id = ?\";\n return getAll($sql, [getLogin()['mid']]);\n}",
"public function recurringSMS()\n {\n return view('client.recurring-sms');\n }",
"function emailStats($DBH) {\r\n\t\t$query = $DBH->prepare('SELECT callinfo.completed, callinfo.emailDateTime, TIMESTAMPDIFF(SECOND, callinfo.completed, callinfo.emailDateTime) AS diff, staff.username, staff.staffID FROM callinfo \r\n\t\t\t\t\t\t\t\tINNER JOIN staff AS staff ON callinfo.staffID = staff.staffID\r\n\t\t\t\t\t\t\t\tWHERE callinfo.callID > 22629\r\n\t\t\t\t\t\t\t\tAND staff.branchID = 27\r\n\t\t\t\t\t\t\t\tAND TIMESTAMPDIFF(SECOND, callinfo.completed, callinfo.emailDateTime) >= 0\r\n\t\t\t\t\t\t\t\tAND callinfo.emailDateTime IS NOT NULL\r\n\t\t\t\t\t\t\t\tORDER BY diff ASC');\r\n\t\t$query->execute();\r\n\t\t$result = $query->fetchAll(PDO::FETCH_ASSOC);\r\n\t\treturn $result;\r\n\t}"
] |
[
"0.63097405",
"0.59899753",
"0.59314936",
"0.57851243",
"0.5763868",
"0.57254434",
"0.56963",
"0.5662368",
"0.56467247",
"0.56153",
"0.55647075",
"0.5547426",
"0.55171514",
"0.5493514",
"0.54887116",
"0.5443526",
"0.54422504",
"0.5433986",
"0.54291266",
"0.54160565",
"0.54109186",
"0.5339442",
"0.5338076",
"0.53379244",
"0.53277314",
"0.5320652",
"0.53166914",
"0.53149426",
"0.5306646",
"0.5303129"
] |
0.68588024
|
0
|
Total Status Lead Discussions
|
public function totalStatusLeadDiscussions($status)
{
return Lead::where('status', $status)->count();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getTotalLactationByStatus()\n {\n return $this->total_lactation_by_status;\n }",
"function getTotalSubmissions() {\n if(\n is_object(\n $oStmt = DB::$PDO->prepare(\n 'SELECT\n COUNT(1)\n FROM\n challenges c\n INNER JOIN\n attempts a\n ON\n (a.challenge_id=c.id)\n WHERE\n (\n c.active\n OR\n :RightViewAllChallenges\n )'\n )\n )\n &&\n $oStmt->execute(\n Array(\n //':RightViewAllChallenges' => access('show_unactive_challenges')? 1 : 0\n ':RightViewAllChallenges' => 1\n )\n )\n &&\n is_array($aTotalSubs = $oStmt->fetch(PDO::FETCH_NUM))\n ){\n return $aTotalSubs[0];\n } return 0;\n}",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalOnlineRefunded();",
"public function getTotalListSize($moderation_states = null)\n {\n try {\n $db = DB::get();\n $query = '\tSELECT assurance_id\n\t\t\t \t\t\tFROM t_assurance\n \t\t\t\t\t\tWHERE assurance_supprime = \\'0\\' ';\n\n if (!is_null($moderation_states))\n $query .= $moderation_states;\n\n $query .= ' ORDER BY assurance_id DESC';\n \n // echo $query;\n \n\n $result = $db->query($query);\n return $db->num_rows($result);\n }\n catch (exception $e) {\n //echo $e->getMessage();\n }\n }",
"public function totalCount();",
"public function totalCount();",
"public static function deadlinesWithCount() {\n return self::select('deadline', DB::raw('COUNT(deadline) as vps_count'))\n ->groupBy('deadline');\n }",
"public function count_lists(){\n $cart_result = @mysqli_query($this->dbc, \"SELECT SUM(state='draft') as draft, SUM(article_type='news' and state='published') as news, SUM(article_type='guidance' and state='published') as guidance from `news_advice`\") or die(\"Couldn't ViewSql page USERS lists()\");\n $this->num_rows = mysqli_num_rows($cart_result);\n while ($row = mysqli_fetch_assoc($cart_result)) {\n $this->draft = $row[\"draft\"];\n $this->news = $row[\"news\"];\n $this->guidance = $row[\"guidance\"];\n }// end while\n mysqli_close($this->dbc);\n }",
"private function totalIssues()\n {\n $url = $this->base_uri.'search?jql=project='.$this->project.'&startAt=0&maxResults=0';\n $issues = $this->request($url);\n if (!$this->infos['errorBoolean']) {\n return json_decode($issues)->total;\n }\n }",
"public function ultralinkCount(){ return $this->APICall( 'ultralinkCount', \"Could not retrieve the Ultralink count\" ); }",
"public function getTotalIssuesBeingImported()\n {\n return $this->total;\n }",
"public function getTotalIssuesBeingImported()\n {\n return $this->total;\n }",
"function getRCCACountUnderReview()\n{\n\tglobal $dbObjMirrors;\n\n\t$RCCAQuery = \"SELECT State,count(*) as cnt\n\t\t\t\t\tFROM [mirrors].[dbo].[View_LSIP2_RCCA]\n\t\t\t\t\tWHERE [mirrors].[dbo].[View_LSIP2_RCCA].[Ready_For_Arch_Review]='Yes' and State='Submitted'\n\t\t\t\t\tGROUP BY State\";\n\n\t$RCCAResult = $dbObjMirrors->executeQuery($RCCAQuery);\n\n\treturn $RCCAResult;\n}",
"function getTotalLaboursByStatus($statusType, $statusID, $returnType){\n\t\t\t$sqlQuery = \"SELECT wkr_id, wkr_passno, wkr_name, emp_status_desc, wkr_country, wkr_race, wkr_permitexp, cty_desc, race_desc FROM workers \";\n\t\t\t$sqlQuery .= \" LEFT JOIN mst_emp_status ON workers.wkr_status = mst_emp_status.emp_statusid\n\t\t\t\t\t\t \tLEFT JOIN mst_countries ON mst_countries.cty_id = workers.wkr_country\n\t\t\t\t\t\t \tLEFT JOIN mst_race ON mst_race.race_id = workers.wkr_race\";\n\t\t\t\n\t\t\tif(strlen($statusType) > 0){\n\t\t\t\t$sqlQuery .= \" WHERE $statusType = '$statusID' \";\n\t\t\t}\n\t\t\t$labourRecord = $this->db->query($sqlQuery);\n\t\t\t\n\t\t\tif($returnType == 'total'){\n\t\t\t\treturn $labourRecord->num_rows();\n\t\t\t}\n\t\t\telse return $labourRecord;\n\t\t}",
"function board_health($prj,$status=1){\n $query = \"select box.rname,count(box_cont.cid) from box join box_cont on box.id = box_cont.fkid and box.fbid = '\".$prj.\"' and box_cont.status = '\".$status.\"' group by box.id;\";\n $result = mysql_query($query);\n $the_count = null;\n while($row = mysql_fetch_array($result)){\n $the_count = $the_count + $row[1];\n }\n if($the_count==0){$the_count = 0;}\n return $the_count;\n}",
"public function member_dsc_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Member DSC Summary', $this->session->userdata['type']);\n\n\t\t$total_emp_prohire = $this->M_dscMembersGraph->get_total_pro_hire();\n\t\t$total_emp_probation = $this->M_dscMembersGraph->get_total_probation();\n\t\t$total_emp_outsource = $this->M_dscMembersGraph->get_total_outsource();\n\t\t$total_emp_mob = $this->M_dscMembersGraph->get_total_member_emp_mob();\n\t\t$total_digital_talent = $this->M_dscMembersGraph->get_total_member_digital_talent();\n\t\t$total_member_organik = $this->M_dscMembersGraph->get_total_member_organik();\n\t\t$total_member = $this->M_dscMembersGraph->get_total_member();\n\n\t\t$data = [\n\t\t'total_member_organik' => $total_member_organik,\n\t\t'total_emp_prohire'=> $total_emp_prohire,\n\t\t'total_emp_probation' => $total_emp_probation,\n\t\t'total_emp_outsource' => $total_emp_outsource,\n\t\t'total_emp_mob' => $total_emp_mob,\n\t\t'total_digital_talent' => $total_digital_talent,\n\t\t'total_member' => $total_member,\n\t\t'member_status' => $this->M_dscMembersGraph->get_member_graph(),\n\t\t'contract_expired' => $this->M_dscMembersGraph->get_contract_expired(),\n\t\t'graphAlumni' => $this->M_dscMembersGraph->getGraphMemberAlumni(),\n\t\t'graphBand' => $this->M_dscMembersGraph->getGraphBand(),\n\t\t'graphPosition' => $this->M_dscMembersGraph->getGraphPosition(),\n\t\t'judul' => 'DSC Member Summary - INSIGHT',\n\t\t'konten' => 'adm_views/home/monitoringMemberDsc',\n\t\t'admModal' => [],\n\t\t'footerGraph' => ['dscMemberSummary/memberDscGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}",
"function dialogue_cm_unread_total(\\mod_dialogue\\dialogue $dialogue) {\n global $USER, $DB;\n\n $sql = '';\n $params = array();\n\n $dialogueid = $dialogue->activityrecord->id;\n $userid = $USER->id;\n\n $params['todialogueid'] = $dialogueid;\n $params['touserid'] = $userid;\n\n list($insql, $inparams) = $DB->get_in_or_equal(\\mod_dialogue\\dialogue::get_unread_states(), SQL_PARAMS_NAMED, 'un');\n\n $params = array_merge($params, $inparams);\n\n $params['undialogueid'] = $dialogueid;\n $params['unuserid'] = $userid;\n $params['unflag'] = \\mod_dialogue\\dialogue::FLAG_READ;\n\n // Most restrictive: view own.\n $sql = \"SELECT\n (SELECT COUNT(1)\n FROM {dialogue_messages} dm\n JOIN {dialogue_participants} dp ON dp.conversationid = dm.conversationid\n WHERE dm.dialogueid = :todialogueid\n AND dp.userid = :touserid\n AND dm.state $insql) -\n (SELECT COUNT(1)\n FROM {dialogue_flags} df\n JOIN {dialogue_participants} dp ON dp.conversationid = df.conversationid\n AND dp.userid = df.userid\n WHERE df.dialogueid = :undialogueid\n AND df.userid = :unuserid\n AND df.flag = :unflag) AS unread\";\n\n // Least restrictive: view any.\n if (has_capability('mod/dialogue:viewany', $dialogue->context)) {\n $sql = \"SELECT\n (SELECT COUNT(1)\n FROM {dialogue_messages} dm\n WHERE dm.dialogueid = :todialogueid\n AND dm.state $insql) -\n (SELECT COUNT(1)\n FROM {dialogue_flags} df\n WHERE df.dialogueid = :undialogueid\n AND df.userid = :unuserid\n AND df.flag = :unflag) AS unread\";\n }\n\n // Get user's total unread count for a dialogue.\n $record = (array) $DB->get_record_sql($sql, $params);\n if (isset($record['unread']) and $record['unread'] > 0) {\n return (int) $record['unread'];\n }\n return 0;\n}",
"function showtotals(){\nglobal $XUSER, $SERVER, $ROOMS;\ncleanOnline();\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]online\");\n$RV[0] = 0; $RV[1] = 0; $RV[2] = 0;\nwhile($row = Do_Fetch_Row($q)){\n$q2 = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]users WHERE username='$row[1]'\");\n$row2 = Do_Fetch_Row($q2);\nif($row2[4] == 4 || $row2[4] == 5){\n$RV[0]++;\n}else{\n$RV[1]++;\n}\n}\ncleanRooms();\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]rooms\");\nwhile($row = Do_Fetch_Row($q)){\n$RV[2]++;\n}\nreturn $RV;\n}",
"public function get_total() { \n\n\t// Get total\n\t$this->total = DB::queryFirstField(\"SELECT count(*) FROM notifications\");\n\tif ($this->total == '') { $this->total = 0; }\n\n\t// Return\n\treturn $this->total;\n\n}",
"public function get_total() \n {\n return $this->db->count_all(\"blog\");\n }",
"function Totaldowncount($table) \n\t{\n\t\t$condition = \"Status = '1'\";\n\t\t$mtrix_table = $this->common_model->GetResults($condition, $table);\n\t\tif($mtrix_table) {\n\t\t\tforeach ($mtrix_table as $row) {\n\t\t\t\t$left_data = $this->common_model->GetRow(\"MemberId = '\".$row->MemberId.\"' \",$table);\n\t\t\t\tif($left_data->LeftId != '0')\n\t\t\t\t{\n\t\t\t\t\t$leftids=array('0' => $left_data->LeftId);\n\t\t\t\t\t$dowid_left = $this->GetSpillovercount($leftids,$table);\n\t\t\t\t\t$this->db->set('leftdowncount', $dowid_left, FALSE);\n\t\t\t\t\t$this->db->where('MemberId', $row->MemberId);\n\t\t\t\t\t$update_left_members = $this->db->update($table);\n\t\t\t\t}\n\t\t\t\tif($left_data->RightId != '0')\n\t\t\t\t{\n\t\t\t\t\t$rightids=array('0' => $left_data->RightId);\n\t\t\t\t \t$dowid_right = $this->GetSpillovercount($rightids,$table);\n\t\t\t\t\t$this->db->set('rightdowncount', $dowid_right, FALSE);\n\t\t\t\t\t$this->db->where('MemberId', $row->MemberId);\n\t\t\t\t\t$update_right_members = $this->db->update($table);\n\t\t\t }\n\t\t\t $matrisetting=$this->common_model->GetRow(\"MatrixStatus='1'\",\"arm_matrixsetting\");\n\t\t\t if($matrisetting->RankStatus==1)\n\t\t\t {\n\t\t\t\t //this is rank for goes to member to achieve for downlines count\n\n\t\t\t\t $checkrankstatus=$this->common_model->GetRow(\"MatrixStatus='1'\",\"arm_matrixsetting\");\n\t\t\t\t\t$rank=$checkrankstatus->RankStatus;\n\t\t\t\t\tif($rank==1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$checkrankmember=$this->common_model->GetRow(\"Status='1'\",\"arm_ranksetting\");\n\t\t\t\t\t\t$downlines=$checkrankmember->Membercount;\n\t\t\t\t\t\tif($downlines!=\"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$checkmemberspil=$this->common_model->GetRow(\"MemberId='\".$row->MemberId.\"'\",$table);\n\t\t\t\t\t\t\t$leftcounts=$checkmemberspil->leftdowncount;\n\t\t\t\t\t\t\t$rightcounts=$checkmemberspil->rightdowncount;\n\t\t\t\t\t\t\t$totalmembercount=$leftcounts+$rightcounts;\n\t\t\t\t\t\t\tif($downlines==$totalmembercount)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$rank=$checkrankmember->Rank;\n\t\t\t\t\t\t\t\t$trnid = 'RAN'.rand(1111111,9999999);\n\t\t\t\t\t\t\t\t\t$date = date('y-m-d h:i:s');\n\t\t\t\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t\t\t'MemberId'=>$row->MemberId,\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t'Description'=>\"Promoted to achieve for target downline members\".' '.$rank,\n\t\t\t\t\t\t\t\t\t\t'TransactionId'=>$trnid,\n\t\t\t\t\t\t\t\t\t\t'TypeId'=>'22',\n\t\t\t\t\t\t\t\t\t\t'DateAdded'=>$date\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t// $conss=\"MemberId='\".$spilloverid.\"' and TypeId='22'\";\n\t\t\t\t\t\t\t\t\t// $checkcount=$this->common_model->GetRowCount($conss,\"arm_history\");\n\t\t\t\t\t\t\t\t\t// if($checkcount==0)\n\t\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t\t\t$rankdetails = $this->common_model->SaveRecords($data,'arm_history');\t\n\t\t\t\t\t\t\t\t\t\t// echo \"<br>\".$this->db->last_query();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\n\t\t\t}\n\t\t}\n\t}",
"public function get_total()\n {\n return $this->db->count_all(\"blog\");\n }",
"public function getTotalOfflineRefunded();",
"public static function getStats()\n\t{\n\t\t$messages = UserController::getUser(Auth::user())->messages();\n\t\t$inbox = $messages->where('from', '!=', Auth::id())->where('archived', false)->count();\n\t\t$sent = $messages->where('from', Auth::id())->where('archived', false)->count();\n\t\t$archived = $messages->where('archived', true)->count();\n\t\t\n\t\treturn array(\n\t\t\t'inbox' => $inbox,\n\t\t\t'unread' => count(MessageController::unReadMessages(\"all\")),\n\t\t\t'sent' => $sent,\n\t\t\t'archived' => $archived,\n\t\t\t'approve' => PendingEnrollment::where('teacher_id', Auth::id())->count(),\n\t\t\t'join' => PendingGroup::where('teamleader_id', Auth::id())->count(),\n\t\t);\t\n\t}",
"public function doctorChannelingsSummary()\n {\n $schedules = Auth::user()->doctor->schedules;\n $appointmentsCount = Appointment::whereIn('schedule_id', $schedules->pluck('id'))\n ->where('date', now()->toDateString())\n ->whereIn('status', [Appointments::PENDING, Appointments::COMPLETED])\n ->get()->count();\n $paymentsPending = \"Rs.\" . number_format($schedules->sum('balance'), 2);\n return ResponseHelper::findSuccess('Items Summary Data', [\n 'total_shedules_count' => $schedules->count(),\n 'today_appointments_count' => $appointmentsCount,\n 'payments_pending' => $paymentsPending,\n ]);\n }",
"function get_entradas_contabilidad_sin_list_count($estatus)\n\t{\n\t\t$u = new Entrada();\n\t\t$sql=\"select count(distinct(e.pr_facturas_id)) as total from entradas as e left join cproveedores as pr on pr.id=e.cproveedores_id left join pr_facturas as prf on prf.id=e.pr_facturas_id left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id left join estatus_general as eg on eg.id=e.estatus_general_id where e.estatus_general_id=1 and ctipo_entrada=1\";\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows == 1){\n\t\t\treturn $u->total;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function getMessagesTotal() {\n\t\t$db = GetGlobal('db');\t\n\t\t\n\t\t$sSQL = \"SELECT count(id) from stats where tid='action' and DATE(date) BETWEEN DATE( DATE_SUB( NOW() , INTERVAL 1 DAY ) ) AND DATE ( NOW() )order by date desc\";\n\t\t$result = $db->Execute($sSQL);\t\t\n\t\t$ret = $result->fields[0];\n\t\t\n\t\treturn ($ret>10) ? '10' : strval($ret);\t\t\n\t}"
] |
[
"0.6435931",
"0.6059527",
"0.5981261",
"0.5981261",
"0.5981261",
"0.59504586",
"0.5881921",
"0.58279365",
"0.58279365",
"0.58210135",
"0.578081",
"0.57802534",
"0.5718376",
"0.5682864",
"0.5682864",
"0.5645733",
"0.5635716",
"0.5628105",
"0.56248134",
"0.5614034",
"0.5610888",
"0.55861205",
"0.55860424",
"0.55837655",
"0.55758154",
"0.5573204",
"0.55692685",
"0.55571836",
"0.55162036",
"0.5492741"
] |
0.7557167
|
0
|
Find timereport to a user by month and year
|
public function findCRT($user,$month,$year)
{
$qb = $this->createQueryBuilder('crt');
$qb->where('crt.user = :user')
->andWhere('YEAR(crt.date ) = :year')
->andWhere('MONTH(crt.date ) = :month')
->setParameter('year', $year)
->setParameter('month', $month)
->setParameter('user', $user);
return $qb->getQuery()->getOneOrNullResult();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function get_month_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('m')] = month_converter($fecha->format('m'));\n }\n return $result;\n}",
"function get_years_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('Y')] = $fecha->format('Y');\n }\n return $result;\n}",
"function get_users_entries($users, $year, $bundle = 'entry_month_record')\n{\n if (!$users) {\n return NULL;\n }\n if (!isset($year)) {\n $year = date('Y');\n }\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'entry_month_record')\n ->entityCondition('bundle', $bundle)\n ->fieldCondition('field_entry_date', 'value', $start_date, '>=')\n ->fieldCondition('field_entry_date', 'value', $end_date, '<=')\n ->propertyCondition('uid', $users, 'IN')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n if (isset($records[$bundle])) {\n return entity_load(\"entry_month_record\", array_keys($records[$bundle]));\n }\n return array();\n}",
"function getResultForMonthlyRegistered(){\n global $mysqli;\n\n $sql = \"SELECT DATE_FORMAT(u.register_date, '%M') as \\\"month\\\",\n EXTRACT(YEAR from u.register_date) as \\\"year\\\" ,\n count(*) as \\\"registered users\\\" \n FROM users u \n group by month, year \n HAVING year = 2020\n order by FIELD(month,'January','February','March','April','May','June','July','August','September','October','November','December')\";\n\n $result = $mysqli->query($sql);\n return $result->fetch_all(MYSQLI_ASSOC);\n}",
"public function monthlyReport($year, $month){\n\t\t$result = collect();\n\t\tforeach(Employee::getActiveEmployee(true, $year, $month) as $employee){\n\t\t\t$result->put($employee->nip, $employee->getAttendanceSummaryByMonth($year, $month));\n\t\t}\n\t\t\n\t\t$return = collect();\n\t\t$returnCount = $result->count();\n\t\tforeach($this->resutlKeys as $key){\n\t\t\t$val = collect($result->map(function($summary) use($key, $returnCount) {\n\t\t\t\t\t\treturn isset($summary[$key])? $summary[$key] : 0;\n\t\t\t\t\t}))->sum();\n\t\t\t$return->put($key, $val);\n\t\t}\n\t\t\n\t\treturn $return;\n\t}",
"public function get_month_data($month = \"January\", $year = 2015){\n\t\t/* if($year==2015)\n\t\t$year = date('y'); */\n\t\t// echo date( 'F Y');\n\t\t$this->loadModel(\"Invoice.Invoice\");\n\t\t$this->loadModel(\"Transaction.Transaction\");\n\t\t$month_first_day = strtotime( 'first day of ' . $month.' '.$year);\n\t\t$month_last_day = strtotime( 'last day of ' . $month.' '.$year);\n\t\t// echo date('Y-m-d',$month_last_day);\n\t\t// $dt = new DateTime('first Monday of this month');\n\t\t$dt = new DateTime('first Monday of '.$month.' '.$year);\n\t\t// echo $dt->format('Y-m-d');\n\t\t$first_week_start = $dt->getTimestamp(); \n\t\t$week_last = $first_week_start;\n\t\t$this->Invoice->belongsTo = array('Client' => array('className'=>\"Usermgmt.Client\",'foreignKey'=>'client_id'));\n\t\t$this->Transaction->belongsTo = array('Invoice' => array('className'=>\"Invoice.Invoice\",'foreignKey'=>'invoice_id'));\n\t\t$this->Transaction->recursive = 2;\n\t\t$this->Transaction->Behaviors->load('Containable');\n\t\t\n\t\t$all_transactoins = array();\n\t\tfor($current =$month_first_day; ($week_last<$month_last_day && $week_last<time()); $week_last += (7*86400)){\n\t\t\t\n\t\t\t\t$transactions = $this->Transaction->find(\"all\",array(\"conditions\"=>array(\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) >\"=>$current,\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) <\"=>$week_last,'Transaction.status'=>1),'contain'=>array(\"Invoice\"=>array(\"fields\"=>array(\"title\",\"client_id\",\"payment\",\"tax\",\"total\")),\"Invoice.Client\"=>array(\"fields\"=>array(\"first_name\",\"last_name\"))),\"fields\"=>array(\"invoice_id\",\"payment_date\",\"method\")));\n\t\t\t\t\n\t\t\t\t$all_transactoins[date('m/d/Y',$current).'-'.date('m/d/Y',$week_last)] = $transactions;\n\t\t\t\t\n\t\t\t\t// pr($transactions); die;\n\t\t\t\n\t\t\t$current =$week_last;\n\t\t}\n\t\treturn $all_transactoins;\n\t\t\n\t}",
"public function getMonthlyCalendarEntries($model = null, $userId = null, $year = null, $month = null) {\n\t\t// Use today's date if no date given.\n\t\tif(is_null($month)) $month = gmdate(\"F\");\n\t\tif(is_null($year)) $year = gmdate(\"Y\");\n\t\n\t\t// Calculate the month number and week-beginning date for the first of the month\n\t\t$monthnum = gmdate('n', strtotime(\"2:00 1 \".$month. \" \".$year));\n\t\t$monthStartDate = gmmktime(2,0,0,$monthnum,1,$year);\n\t\t$monthWeekBeginning = $this->_getWeekBeginningDate(gmdate(\"Ymd\",$monthStartDate));\n\t\n\t\t// Retrieve all the weekly entries between the start week and the last day of the month\n\t\t$allEntries = $model->find('all',array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'user_id' => $userId,\n\t\t\t\t\t\t'week_beginning >=' => gmdate(\"Y-m-d\",$monthWeekBeginning),\n\t\t\t\t\t\t'week_beginning <=' => gmdate(\"Y-m-t\",$monthStartDate)\n\t\t\t\t),\n\t\t\t\t'order' => array('week_beginning' => 'asc')\n\t\t));\n\t\n\t\t$records = array();\n\t\t$weekdayList = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday');\n\t\n\t\t// Iterate through the entries and reformat them as, e.g., array( 1 => '10', 2 => '5', 14 => '2'... 31 => '12')\n\t\tforeach($allEntries as $key => $weeklyEntry) {\n\t\t\tforeach($weekdayList as $weekDayNo => $weekday) {\n\t\t\t\t$weekDayDate = strtotime(\"2:00 \" . $weeklyEntry[get_class($model)]['week_beginning']\n\t\t\t\t\t\t. \" +\" . $weekDayNo . \" day\");\n\t\t\t\tif(date('n Y', $weekDayDate) == $monthnum . \" \" . $year) {\n\t\t\t\t\t$comment = \"Daily entry: \".$weeklyEntry[get_class($model)][$weekday];\n\t\t\t\t\tif(!empty($weeklyEntry[get_class($model)]['what_worked'])) {\n\t\t\t\t\t\t$comment .= \"<br />What worked for me this week: \".$weeklyEntry[get_class($model)]['what_worked'];\n\t\t\t\t\t}\n\t\t\t\t\t$records[date('j', $weekDayDate)] = array(\n\t\t\t\t\t\t\t'entry' => $weeklyEntry[get_class($model)][$weekday],\n\t\t\t\t\t\t\t'comment' => $comment\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\treturn $records;\n\t}",
"function get_user_active($from=null, $to=null)\r\n {\r\n if($to ==null) $to =date('Y-m-d');\r\n if($from==null) $from=date('Y-m-d', strtotime(\"-1 week\", strtotime($to)));\r\n\r\n $printYear = ((int)(substr($from, 0, 4))<(int)(date('Y')))?true:false;\r\n\r\n $period = new DatePeriod(\r\n new DateTime($from),\r\n new DateInterval('P1D'),\r\n new DateTime($to)\r\n );\r\n\r\n $output = array(array('날짜' , '회원'));\r\n $data = array();\r\n\r\n $sql = \"SELECT \r\n date_format(date, '%Y-%m-%d') as date,\r\n logged_in_month\r\n from\r\n log_user_actives\r\n WHERE date between ? and ?\r\n group by date\"; \r\n $query = $this->db->query($sql, array($from, $to));\r\n foreach ($query->result() as $row)\r\n {\r\n $data[$row->date] = round($row->logged_in_month);\r\n $i++;\r\n }\r\n\r\n $i = 1;\r\n foreach ($period as $date) {\r\n $output[$i] = array($date->format((($printYear)?'Y년 ':'').' m월 d일'), isset($data[$date->format('Y-m-d')])?$data[$date->format('Y-m-d')]:0);\r\n $i++;\r\n }\r\n\r\n return $output;\r\n /*\r\n //---- dummy data\r\n $dateNum = floor((strtotime($to)-strtotime($from))/86400)+1;\r\n $output = array(array('날짜' , '회원'));\r\n if($dateNum>0){\r\n for($i=1;$i<=$dateNum;$i++){\r\n $date = date(\"m월 d일\",strtotime(($i-$dateNum).\" day\", strtotime($to)));\r\n $num = rand(800, 1500);\r\n $output[$i] = array($date, $num);\r\n }\r\n }\r\n return $output;*/\r\n }",
"public function statisticUserBy($field) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, COUNT(DATE_FORMAT(created_at,'%Y-%m')) as number \n FROM user GROUP BY DATE_FORMAT(created_at,'%Y-%m')\";\n \n $stmt = $this->conn->prepare($q);\n //$stmt->bind_param(\"i\",$customer_id);\n $stmt->execute();\n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"number\"] = $stat[\"number\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }",
"public function getCalendarData($uid,$year, $month){\n $query = $this->db->select('date, data')->from('calendar')->where('uid',$uid)->like('date', \"$year-$month\", 'after')->get();\n $calendarData = array();\n foreach ($query->result() as $row){\n // important: convert date string to integer can solve the problem that\n // \"no events showing for the first 9 days of the month\"\n $calendarData[intval(substr($row->date,8,2))] = $row->data;\n }\n return $calendarData;\n }",
"function getreportYearfn($year)\n\t{\n\t\t$customerid=\"SELECT count(customer_id) as cou,month from customer_general_detail where year = '$year' GROUP BY month\";\n\t\t$customeriddata = $this->get_results($customerid);\n\t\treturn $customeriddata;\n\t}",
"public function getCalendarItems($month = FALSE, $year = FALSE, $user_id = FALSE)\n\t{\n\t\t$sql = $this->db->select();\n\t\t$sql = $sql->from(array('i'=>'times'))->columns(array(new \\Zend\\Db\\Sql\\Expression('SUM(hours) AS total'), 'date', 'creator', 'user_id'));\n\n\t\tif($month)\n\t\t{\n\t\t\t$sql = $sql->where(array('month' => $month));\n\t\t}\n\t\t\n\t\tif($year)\n\t\t{\n\t\t\t$sql = $sql->where(array('year' => $year));\n\t\t}\n\t\t\n\t\tif($user_id)\n\t\t{\n\t\t\t$sql = $sql->where('creator = ? ', $user_id);\n\t\t}\t\t\t\t\n\t\t\n\t\t$sql = $sql->join(array('u' => 'users'), 'u.id = i.creator', array('creator_first_name' => 'first_name', 'creator_last_name' => 'last_name'), 'left');\t\t\t\t \n\t\t$sql = $sql->group('date')\n\t\t\t\t ->group('creator');\n\t\t\n\t\t$route_options = array('month' => $month, 'year' => $year);\n\t\t$route_options['user_id'] = $user_id;\n\t\t\n\t\treturn $this->_translateCalendarItems($this->getRows($sql), 'date', array('route_name' => 'times/view-day', 'options' => $route_options));\n\t}",
"public function getEventsMonth($month, $year){\n $firstDay = $year . \"-\" . $month . \"-01\"; \n $lastDay = $year . \"-\" . $month . \"-31\";\n /*\n\t\t$firstDay = mktime(0,0,0,$month,1,$year);\n\t\t$l_day=date(\"t\",$firstDay);\n\t\t// dernier jour du moi\n\t\t$lastDay=mktime(0, 0, 0, $month,$l_day , $year);\n \n */\n\t\t\n\t\t$sql = \"SELECT \n\t\t\t\t\tevents.id as id,\n\t\t\t\t\tevents.date_begin as date_begin,\n\t\t\t\t\tevents.date_end as date_end,\n events.time_begin as time_begin,\n\t\t\t\t\tevents.time_end as time_end,\n\t\t\t\t\tevents.name as title,\n\t\t\t\t\tevent_types.color as type_color\n\t\t\t\tFROM ag_events as events \n\t\t\t\tINNER JOIN ag_eventtypes as event_types ON event_types.id = events.id_type \t\n\t\t\t\tWHERE date_begin >= ? and date_begin <= ? \n\t\t\t\torder by date_begin ASC;\";\n\t\t$req = $this->runRequest($sql, array($firstDay, $lastDay));\n\t\treturn $req->fetchAll();\n\t}",
"function Monthly_Requests($year) {\r\n $query2 = $this->db->query(\"SELECT MONTHNAME(designation_date) as month, YEAR(designation_date) as year, DATE_FORMAT(designation_date, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM request\r\n WHERE DATE_FORMAT(designation_date, '%Y') = '$year'\r\n GROUP BY MONTHNAME(designation_date)\r\n ORDER BY MONTH(designation_date) ASC\");\r\n\r\n return $result = $query2->result();\r\n }",
"function get_month_media($date, $labels) {\n global $DB;\n\n $fechainicio = new DateTime(\"1-\".$date->month.\"-\".$date->year);\n $maxday = cal_days_in_month(CAL_GREGORIAN, $date->month, $date->year);\n $fechafin = new DateTime($maxday.\"-\".$date->month.\"-\".$date->year);\n $fechafin->setTime(23, 59, 59);\n $result = array();\n foreach ($labels as $label) {\n $result[] = 0;\n }\n\n $sql = \"SELECT id, connectedusers, date FROM {report_user_statistics} WHERE date >= ? AND date <= ? ORDER BY date;\";\n $todaslasconexiones = $DB->get_records_sql($sql, [$fechainicio->getTimestamp(), $fechafin->getTimestamp()]);\n $day = 0;\n $temp = array();\n $i = 1;\n foreach ($todaslasconexiones as $conexiones) {\n $fecha = new DateTime(\"@$conexiones->date\");\n if (($fecha->format('m') == $date->month) && ($fecha->format('Y') == $date->year)) {\n if ($day == 0) {\n $day = $fecha->format('d');\n $temp[] = $conexiones->connectedusers;\n } else if ($day == $fecha->format('d')) {\n $temp[] = $conexiones->connectedusers;\n } else if ($day < $fecha->format('d')) {\n $key = array_search($day, $labels);\n $result[$key] = array_sum($temp) / count($temp);\n $temp = array();\n $day = $fecha->format('d');\n $temp[] = $conexiones->connectedusers;\n }\n if (count($todaslasconexiones) == $i) {\n $key = array_search($day, $labels);\n $result[$key] = array_sum($temp) / count($temp);\n } else if (count($temp) > 1) {\n $key = array_search($day, $labels);\n $result[$key] = array_sum($temp) / count($temp);\n }\n $i++;\n }\n }\n return $result;\n}",
"public function getEntryByMonthOrYear($date, $userID) {\n $conn = $this->getConnection();\n return $conn->query(\"SELECT * FROM Entry WHERE UserID = $userID AND Date LIKE '$date-%'\", PDO::FETCH_ASSOC);\n }",
"public function getOvertimePoint($user_id, $month, $year) {\n $arrDayOfMonth = [];\n $sumPoint = 0;\n $dayOfMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);\n for ($i = 1; $i <= $dayOfMonth; $i++) {\n $d = new Time($year . '-' . $month . '-' . $i);\n $point = \"\";\n\n $query = $this->find()->where([\n 'user_id' => $user_id,\n 'day_of_overtime' => $d->format('Y-m-d'),\n 'delete_status' => 0,\n 'approve_status' => 1,\n ])->toArray();\n\n if ($query) {\n\n foreach ($query as $result) {\n $num = ($this->convertMinute($result[\"end_at\"]) - $this->convertMinute($result[\"start_at\"]) - $result[\"breaktime\"]) / 60;\n $point += $this->fractionRound($num, 0.25);\n }\n $sumPoint += $point;\n }\n $arrDayOfMonth[$i] = $point;\n }\n //Sum point / user\n $arrDayOfMonth[$dayOfMonth + 1] = $sumPoint;\n return $arrDayOfMonth;\n }",
"public function getUserCollectedData($username, $year, $month) {\n $col = self::USERS_REPORT_PREFIX.$year.sprintf(\"%02d\", $month);\n $query = \"select * from \".$col.\" where user=\\\"\".$username.\"\\\"\";\n if ($result = $this->db_conn->query($query)) {\n if ($result->num_rows > 0) {\n $row = $result->fetch_array();\n return $row;\n }\n else {\n return null;\n }\n }\n else {\n die (\"Error sending the query '\".$query.\"' to MySQL\");\n }\n }",
"public function takePostBaseOnMonth();",
"public function getMomentsByMonth() {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$date = Carbon::now($timezone);\n\n\t\t\t$year_start = $date->copy()->startOfMonth()->subMonths(12);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n\t\t\tif(\\Auth::User()->station->id == 8 && $year_start->lt(Carbon::parse('2016-03-11'))) {\n\t\t\t\t$year_start = Carbon::parse('2016-03-11');\n\t\t\t}\n\t\t\t$year_end = $date;\n\n\t\t\t$moments = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw('MONTH(FROM_UNIXTIME(record_timestamp)) AS month, \n\t\t\t\tYEAR(FROM_UNIXTIME(record_timestamp)) AS year,\n\t\t\t\tWEEK(FROM_UNIXTIME(record_timestamp)) as week, \n\t\t\t\tCOUNT(*) as count'))\n\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n//\t\t\t\t->where('event_data_status', '=', 1)\n\t\t\t\t->where('record_timestamp', '>=', $year_start->timestamp)\n\t\t\t\t->where('record_timestamp', '<=', $year_end->timestamp)\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets seconds since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\") // We then compare the hours from midnight to check if it is between the hours we want\n\t\t\t\t->groupBy('week')\n\t\t\t\t->orderBy('year')\n\t\t\t\t->orderBy('month')\n\t\t\t\t->orderBy('week')\n\t\t\t\t->get();\n\n\t\t\t$total_moments = 0;\n\t\t\t$moments_this_month = 0;\n\n\t\t\tforeach($moments as $moment) {\n\t\t\t\t$total_moments += $moment->count;\n\t\t\t\tif($moment->month == $date->month && $moment->year == $date->year) {\n\t\t\t\t\t$moments_this_month += $moment->count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'moments' => $moments,\n\t\t\t\t'moments_this_month' => $moments_this_month,\n\t\t\t\t'total_moments' => $total_moments\n\t\t\t\t));\n\t\t\t\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}",
"public function userStatics()\n { \n if (func_num_args() > 0) {\n $year = func_get_arg(0);\n $select = \"SELECT COUNT(u.user_id) AS total, m.month\n FROM (\n SELECT 'JAN' AS MONTH\n UNION SELECT 'FEB' AS MONTH\n UNION SELECT 'MAR' AS MONTH\n UNION SELECT 'APR' AS MONTH\n UNION SELECT 'MAY' AS MONTH\n UNION SELECT 'JUN' AS MONTH\n UNION SELECT 'JUL' AS MONTH\n UNION SELECT 'AUG' AS MONTH\n UNION SELECT 'SEP' AS MONTH\n UNION SELECT 'OCT' AS MONTH\n UNION SELECT 'NOV' AS MONTH\n UNION SELECT 'DEC' AS MONTH\n ) AS m\n LEFT JOIN users u ON MONTH(STR_TO_DATE(CONCAT(m.month, ' $year'),'%M %Y')) = MONTH(u.reg_date) AND YEAR(u.reg_date) = '$year'\n GROUP BY m.month\n ORDER BY 1+1\";\n\n $result = $this->getAdapter()->fetchAll($select); \n return $result;\n }\n }",
"function semanasMes($year,$month){\n \n # Obtenemos el ultimo dia del mes\n $ultimoDiaMes=date(\"t\",mktime(0,0,0,$month,1,$year)); \n # Obtenemos la semana del primer dia del mes\n $primeraSemana=date(\"W\",mktime(0,0,0,$month,1,$year)); \n # Obtenemos la semana del ultimo dia del mes\n $ultimaSemana=date(\"W\",mktime(0,0,0,$month,$ultimoDiaMes,$year)); \n # Devolvemos en un array los dos valores\n return array($primeraSemana,$ultimaSemana);\n \n}",
"public function scopeMonth($query,$filters){\n if($month = $filters['month']){\n $query->whereMonth('created_at', Carbon::parse($month)->month);\n }\n\n if($year = $filters['year']){\n $query->whereYear('created_at',$year);\n }\n\n }",
"function Monthly_Requests_Assignment($year) {\r\n $query2 = $this->db->query(\"SELECT DISTINCT(labref), MONTHNAME(date_issued) as month, YEAR(date_issued) as year,DATE_FORMAT(date_issued, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM sample_details\r\n WHERE DATE_FORMAT(date_issued, '%Y') = '$year' \r\n AND activity='Analysis'\r\n GROUP BY MONTHNAME(date_issued)\r\n ORDER BY MONTH(date_issued) ASC\");\r\n\r\n return $result = $query2->result();\r\n }",
"public function getMonthlyInstalment();",
"function Monthly_Requests_Urgent($year) {\r\n $query2 = $this->db->query(\"SELECT MONTHNAME(designation_date) as month, YEAR(designation_date) as year,DATE_FORMAT(designation_date, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM request\r\n WHERE DATE_FORMAT(designation_date, '%Y') = '$year' AND urgency = '1'\r\n GROUP BY MONTHNAME(designation_date)\r\n ORDER BY MONTH(designation_date) ASC\");\r\n\r\n return $result = $query2->result();\r\n }",
"public function get_data_index($any, $mes)\n {\n $ret = array();\n $els = cefire::whereMonth('data', '=', date($mes))->whereYear('data', '=', date($any))->get();\n foreach ($els as $el) {\n $item=array(\"id\"=>$el->id, \"name\"=>$el->user['name'], \"data\"=>$el->data, \"inici\"=>$el->inici->format('H:i:s'), \"fi\"=>$el->fi->format('H:i:s'));\n array_push($ret, $item);\n }\n return $ret;\n }",
"function getBookingByMonth()\n {\n $query = $this->db->select('BK_Year,BK_Month,BK_Day')\n ->get('booking');\n return $query->result();\n }",
"public function findCRTForAYear($user,$year)\n {\n $yearp1=$year+1;\n $qb = $this->createQueryBuilder('crt');\n $qb->where('crt.user = :user')\n ->andWhere($qb->expr()->orX(\n $qb->expr()->andX(\n $qb->expr()->eq('YEAR(crt.date )', $year),\n $qb->expr()->gt('MONTH(crt.date )', '5')\n ),\n $qb->expr()->andX(\n $qb->expr()->eq('YEAR(crt.date )', $yearp1),\n $qb->expr()->lte('MONTH(crt.date )', '5')\n )\n )\n \n )\n ->setParameter('user', $user)\n ;\n \n return $qb->getQuery()->getResult();\n }",
"private function grab_data(){\n\t\t$y=0;\n\t\tfor($i=$this->startingmonth;$i>=0;$i--){\n\t\t\t$this->searchmonth = date(\"n\")-$i;\n\t\t\t$this->searchyear = date(\"Y\");\n\t\t\tif(0 >= $this->searchmonth){\n\t\t\t\twhile(0 >= $this->searchmonth){\n\t\t\t\t\t$this->searchmonth += 12;\n\t\t\t\t\t$this->searchyear--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->count_chrono_records();\n\t\t\t$this->monthlyrecordvolume[$i] = intval($this->volume_of_records_in_timerange);\n\t\t\tif(0==$this->max_month_value or $this->monthlyrecordvolume[$i] > $this->max_month_value){\n\t\t\t\t$this->max_month_value = $this->monthlyrecordvolume[$i];\n\t\t\t}\n\t\t\t$this->monthaggregator += $this->monthlyrecordvolume[$i];\n\t\t\t\n\t\t\t$this->count_months_recorded_this_year++;\n\t\t\tif(12 == $this->searchmonth or 0 == $i ){\n\t\t\t\t$this->ave_this_year[$y]['volume'] = intval($this->monthaggregator / $this->count_months_recorded_this_year);\n\t\t\t\t$this->ave_this_year[$y]['month'] = $i;\n\t\t\t\t$this->ave_this_year[$y]['year'] = $this->searchyear;\n\t\t\t\t$this->monthaggregator = 0;\n\t\t\t\t$this->count_months_recorded_this_year = 0;\n\t\t\t\t$y++;\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}"
] |
[
"0.64024323",
"0.6043832",
"0.5953872",
"0.5883139",
"0.57665104",
"0.56530374",
"0.56499726",
"0.56477004",
"0.56195414",
"0.5616328",
"0.56058675",
"0.56012905",
"0.55933183",
"0.55485874",
"0.5547454",
"0.5546255",
"0.5534824",
"0.55326957",
"0.5518491",
"0.5514824",
"0.5511958",
"0.5507058",
"0.546612",
"0.5456052",
"0.54009455",
"0.5395458",
"0.53832287",
"0.53695804",
"0.5365797",
"0.53479815"
] |
0.60731876
|
1
|
/ Problem: Digit Fifth Powers Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits: 1634 = 1^4 + 6^4 + 3^4 + 4^4 8208 = 8^4 + 2^4 + 0^4 + 8^4 9474 = 9^4 + 4^4 + 7^4 + 4^4 As 1 = 14 is not a sum it is not included. The sum of these numbers is 1634 + 8208 + 9474 = 19316. Find the sum of all the numbers that can be written as the sum of fifth powers of their digits. by Abdullah Alfaraj sum the digits of the number $num after you rise them to the power $nPower
|
function sumOfNth($nPower,$num)
{
$digitsArr = str_split((string)$num);
$nthPower = function($n) use ($nPower){return pow($n,$nPower);};
return array_sum(array_map($nthPower,$digitsArr));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function checkRecursive($x, $n, $curr_num = 1,$curr_sum = 0)\n{\n // Initialize number of ways to express\n // x as n-th powers of different natural\n // numbers\n $results = 0;\n \n // Calling power of 'i' raised to 'n'\n $p = power($curr_num, $n);\n $p + $curr_sum;\n while ($p + $curr_sum < $x)\n {\n // Recursively check all greater values of i\n $results += checkRecursive($x, $n, $curr_num+1,$p+$curr_sum);\n $curr_num++;\n $p = power($curr_num, $n);\n }\n \n // If sum of powers is equal to x\n // then increase the value of result.\n echo $p + $curr_sum;\n echo \"\\n\";\n if ($p + $curr_sum == $x)\n $results++;\n \n // Return the final result\n return $results;\n}",
"function verteilung2($n) {\n return (powInt($n, 7/4));\n}",
"function verteilung4($n) {\n return (powInt($n, 1.5));\n}",
"function elevaralcubo($num1){\n \n $res=pow($num1,3);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"static function powerOfTwo($n)\n { \n if ($n >= 0 && $n < 31) {\n $pow = 2**$n;\n $all = 0; $count = 1;\n while($all != $pow)\n {\n $all = 2** $count;\n echo $all.\"\\n\";\n $count++;\n }\n } else {\n echo \"enter value between 0 to 31\".\"\\n\";\n Utility::powerOfTwo();\n }\n \n }",
"function sum_of_3_and_5() {\n\n /*\n * Algorithmic solution\n * count of multiples of 3 = 1000 / 3 = 333;\n * count of multiples of 5 = 1000 / 5 = 199;\n *\n * sum of multiplies of 3\n * 1 * 3 + 2 * 3 + ... + 333 * 3 = 3 * (1 + ... + 333) = 3 * 333 * (333 + 1) / 2\n * sum of multiplies of 5\n * 1 * 5 + 2 * 5 + ... + 199 * 5 = 5 * (1 + ... + 199) = 5 * 199 * (199 + 1) / 2\n *\n * sum = 166833 + 99500 = 266333\n *\n */\n\n $sum = 0;\n for($i = 3; $i < 1000; $i += 3) {\n $sum += $i;\n }\n\n for($i = 5; $i < 1000; $i += 5) {\n $sum += $i;\n }\n\n return $sum; // 266333\n}",
"function sum($n) {\n $sumOfAll = 0;\n for ($i = 1; $i <= $n; $i++) {\n $list = str_split($i); \n foreach ($list as $digit) {\n $sumOfAll += $digit;\n }\n }\n return $sumOfAll.PHP_EOL;\n}",
"function next_pow($number)\n{\n if($number < 2) return 1;\n for($i = 0 ; $number > 1 ; $i++)\n {\n $number = $number >> 1;\n }\n return 1<<($i+1);\n}",
"function sumDigits($number)\n {\n if ($number == 0) {\n return 0;\n }\n //echo \"return ($number % 10) + sumDigits($number / 10)<br>\"; //debug info\n return ($number % 10) + sumDigits($number / 10);\n }",
"function solution($N) {\n $binStr = decbin($N);\n $binStr = preg_replace(['/^0+/', '/0+$/'], '',$binStr);\n $zeros = explode('1', $binStr);\n $zeros = array_map(function ($zero) {\n return strlen($zero);\n }, $zeros);\n return max($zeros);\n}",
"function TestNumber($N) {\t\r\n\t\tglobal $DecentNumber, $Max5s, $Max3s, $SolutionFound;\r\n\t\tswitch ($N) {\r\n\t\t// Too small to start\r\n\t\t\tCase ($N <= 2):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 3 - early success exit\r\n\r\n\t\t\tCase ($N == 3):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = 1;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"555\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 4 - Fail\r\n\t\r\n\t\t\tCase ($N == 4):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for Special Success MOD 3 = 0, If this is true, then we found a special case of all 5's.\r\n\t\t\r\n\t\t\tCase (($N % 3) == 0):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = $N / 3;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = AssembleString($Max5s, $Max3s);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\tGeneralCase ($N);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}",
"function number_format_huge($n)\n {\n if ($n>pow(10, 100)) {\n return round(($n/pow(10, 100)), 1).' googol';\n }\n // I'll add more later\n if ($n>pow(1000, 32)) {\n return round(($n/pow(1000, 32)), 1).' untrigintillion';\n }\n if ($n>pow(1000, 31)) {\n return round(($n/pow(1000, 31)), 1).' trigintillion';\n }\n if ($n>pow(1000, 30)) {\n return round(($n/pow(1000, 30)), 1).' novemvigintillion';\n }\n if ($n>pow(1000, 29)) {\n return round(($n/pow(1000, 29)), 1).' octovigintillion';\n }\n if ($n>pow(1000, 28)) {\n return round(($n/pow(1000, 28)), 1).' septenvigintillion';\n }\n if ($n>pow(1000, 27)) {\n return round(($n/pow(1000, 27)), 1).' sexvigintillion';\n }\n if ($n>pow(1000, 26)) {\n return round(($n/pow(1000, 26)), 1).' quinvigintillion';\n }\n if ($n>pow(1000, 25)) {\n return round(($n/pow(1000, 25)), 1).' quattuorvigintillion';\n }\n if ($n>pow(1000, 24)) {\n return round(($n/pow(1000, 24)), 1).' trevigintillion';\n }\n if ($n>pow(1000, 23)) {\n return round(($n/pow(1000, 23)), 1).' duovigintillion';\n }\n if ($n>pow(1000, 22)) {\n return round(($n/pow(1000, 22)), 1).' unvigintillion';\n }\n if ($n>pow(1000, 21)) {\n return round(($n/pow(1000, 21)), 1).' vigintillion';\n }\n if ($n>pow(1000, 20)) {\n return round(($n/pow(1000, 20)), 1).' novemdecillion';\n }\n if ($n>pow(1000, 19)) {\n return round(($n/pow(1000, 19)), 1).' octodecillion';\n }\n if ($n>pow(1000, 18)) {\n return round(($n/pow(1000, 18)), 1).' septendecillion';\n }\n if ($n>pow(1000, 17)) {\n return round(($n/pow(1000, 17)), 1).' sexdecillion';\n }\n if ($n>pow(1000, 16)) {\n return round(($n/pow(1000, 16)), 1).' quindecillion';\n }\n if ($n>pow(1000, 15)) {\n return round(($n/pow(1000, 15)), 1).' quattuordecillion';\n }\n if ($n>pow(1000, 14)) {\n return round(($n/pow(1000, 14)), 1).' tredecillion';\n }\n if ($n>pow(1000, 13)) {\n return round(($n/pow(1000, 13)), 1).' duodecillion';\n }\n if ($n>pow(1000, 12)) {\n return round(($n/pow(1000, 12)), 1).' undecillion';\n }\n if ($n>pow(1000, 11)) {\n return round(($n/pow(1000, 11)), 1).' decillion';\n }\n if ($n>pow(1000, 10)) {\n return round(($n/pow(1000, 10)), 1).' nonillion';\n }\n if ($n>pow(1000, 9)) {\n return round(($n/pow(1000, 9)), 1).' octillion';\n }\n if ($n>pow(1000, 8)) {\n return round(($n/pow(1000, 8)), 1).' septillion';\n }\n if ($n>pow(1000, 7)) {\n return round(($n/pow(1000, 7)), 1).' sextillion';\n }\n if ($n>pow(1000, 6)) {\n return round(($n/pow(1000, 6)), 1).' quintillion';\n }\n if ($n>pow(1000, 5)) {\n return round(($n/pow(1000, 5)), 1).' quadrillion';\n }\n if ($n>pow(1000, 4)) {\n return round(($n/pow(1000, 4)), 1).' trillion';\n }\n if ($n>pow(1000, 3)) {\n return round(($n/pow(1000, 3)), 1).' billion';\n }\n if ($n>1000000) {\n return round(($n/1000000), 1).' million';\n }\n if ($n>1000) {\n return number_format($n);\n }\n }",
"function sumDegit($number){\n //23 -> 3, sum = 2 +3 = 5, n = (23 - 3)/10 = 2\n //2 -> 2, sum = 5 +2 = 7, n = 0\n\n $sum = 0;\n while($number > 0){\n $degit = $number % 10;\n $sum += $degit;\n $number = ($number - $degit)/10;\n }\n return $sum;\n }",
"function power($base,$n){\r\n $x=pow($base,$n);\r\n return $x;\r\n}",
"function calculate_pow($min, $max) {\n for($count = $min; $count <= $max; $count++) {\n echo \"Val : $count , $count<sup>2</sup> : \" . pow($count, 2) . \"<br>\";\n }\n}",
"function elevaralcuadrado($num1){\n \n $res=pow($num1,2);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }",
"function num1BitsThirdSolution($number)\n{\n if ($number <= 0) {\n return 0;\n }\n\n for ($c = 0; $number; $c++) {\n $number &= $number - 1;\n }\n\n return $c;\n}",
"function UglyNumber($number)\n{\n while ($number%2 == 0){\n $number = $number/2;\n }\n while ($number%3 == 0){\n $number = $number/3;\n }\n while ($number%5 == 0){\n $number = $number/5;\n }\n if($number == 1){\n return 1;\n }else{\n return 0;\n }\n}",
"function verteilung3($n) {\n return (powInt($n, 3)) / 3;\n}",
"private function sumThreeAndFiveMultiples($limit)\n {\n $outputSum = 0;\n for ($i=1; $i < $limit; $i++){\n if ($i % 3 === 0 || $i % 5 === 0) {\n $outputSum += $i;\n }\n }\n return $outputSum;\n }",
"private function sumMul($limit, $number)\n {\n $greatestMultiple = $limit-1;\n while ($greatestMultiple%$number != 0) {\n $greatestMultiple--;\n }\n $last = $greatestMultiple / $number;\n return (integer) $number * $last * ($last + 1) / 2;\n }",
"public function save6($pv,$int,$n,&$fv){\r\n\t\t$fv=$pv*exp($n*log(1+$int));\r\n\t}",
"function recursiveSum(string $numbers) : string\n {\n if (strlen($numbers) <= 2)\n {\n return $numbers;\n }\n $output = '';\n for ($i = 0, $j = strlen($numbers) - 1; $i < $j; $i++, $j--)\n {\n $output .= (int) $numbers[$i] + (int) $numbers[$j];\n }\n if (strlen($numbers) % 2 == 1)\n {\n $middle = (int) (strlen($numbers) / 2);\n $output .= $numbers[$middle];\n }\n if (isset($_POST['debug']) && strtolower($_POST['debug']) == 'true')\n {\n echo $output;\n echo '<br />';\n }\n recursiveSum($output);\n }",
"function minimumNumber($n, $password) {\n $res = 0;\n $check = 0;\n\t$free = 0;\n\n if ($n < 6) {\n $free = 6 - $n;\n }\n\t\n\t$uppercase = preg_match('@[A-Z]@', $password);\n\tif (!$uppercase) {\n\t\t$check++;\n\t}\n\t$lowercase = preg_match('@[a-z]@', $password);\n\tif (!$lowercase) {\n\t\t$check++;\n\t}\n\t$number = preg_match('@[0-9]@', $password);\n\tif (!$number) {\n\t\t$check++;\n\t}\n\t$speciaux = preg_match('#^(?=.*\\W)#', $password);\n\tif (!$speciaux) {\n\t\t$check++;\n\t}\n\t\n\t$res = $free + $check;\n\tif ($n < 6) {\n\t\t$res = ($free <= $check) ? $check : $free;\n\t}\n \n return $res;\n}",
"function armstrong_number(int $num){\n $temp = $num; // store the number in a temporary variable\n $result = 0; // variable to store the result\n\n // loop till the the temporary variable is not equal to zero\n while($temp != 0){\n $remainder = $temp%10; // get the remainder of temp variable divided by 10\n $result = $result + $remainder*$remainder*$remainder; // add the result with cube of the remainder\n\n $temp = $temp/10; // change the temp variable by dividing it by 10\n }\n\n return $result; // return result\n }",
"function checkNum($red, $stupac, $mjesto) {\n\tif($red%2 == 0){\n\t\t$broj=0;\n\t\tif($stupac == 1){\n\t\t\t$broj= $mjesto-9;\n\t\t\techo $broj;\n\t\t} else {\n\t\t\t$broj = $mjesto / 10;\n\t\t\t$broj = floor($broj);\n\t\t\t$broj *= 10;\n\t\t\t$broj += $stupac;\n\t\t\techo $broj . \" i \" . $red ;\n\t\t}\n\n\t} else {\n\t\techo $mjesto;\n\t}\n\n}",
"public function sumNumbersA()\n {\n $suma = 0;\n for($i = 1; $i<=1000; $i++)\n {\n if($i%3 == 0 and $i%5 == 0 and $i%7 ==0)\n {\n $suma = $suma + $i;\n }\n }\n return $suma;\n }",
"function checkWeightedSum($isbn){\n $odd = 0;\n $even = 0;\n for($i = 0; $i<strlen($isbn)-1; $i++){\n if($i%2 == 0){\n $odd += $isbn[$i];\n }else{\n $even += $isbn[$i]*3;\n }\n }\n $sum = $odd + $even;\n $mod = $sum%10;\n $check = ($mod == 0) ? 0 : 10-$mod;\n if($check == substr($isbn, 12,12)){\n return 1;\n }else{\n return 0;\n }\n }",
"function check_armstrong($number){\r\n$n=$number;\r\n$total_sum=0;\r\nwhile($n!=0){\r\n\t$rem=$n%10;\r\n\t$n=$n/10;\r\n\t$sum=1;\r\n\tfor($i=0; $i<3; $i++){\r\n\t\t$sum*=$rem;\r\n\t}\r\n\t$total_sum+=$sum;\r\n\t$sum=1;\r\n}\r\nif($total_sum==$number){\r\n\techo \"It is an armstrong number\".$total_sum;\r\n}\r\nelse{\r\n\techo \"It is not armstrong number\";\r\n\r\n}\r\n}",
"function Tn_eco_iro($level,$MBn) // -> CT sai neu test level >=7\n{\n\treturn round(6000*pow(2-($level-1)/10,$level-1)*$MBn);\n}"
] |
[
"0.60419554",
"0.5968498",
"0.5883453",
"0.5756385",
"0.5739952",
"0.5737688",
"0.55899024",
"0.55890155",
"0.5525939",
"0.550741",
"0.5440084",
"0.5416347",
"0.5412163",
"0.5397404",
"0.53523654",
"0.5329117",
"0.5284867",
"0.5266647",
"0.52295923",
"0.52123207",
"0.5168725",
"0.5161071",
"0.5153859",
"0.5135447",
"0.5123615",
"0.5119807",
"0.51194733",
"0.51165235",
"0.51149136",
"0.5109607"
] |
0.72332525
|
0
|
get CashBack by id
|
public function getCashBackById($id)
{
try {
return $this->cash->find($id);
} catch (\Exception $e) {
self::logErr($e->getMessage());
return false;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCable( $id ) {\n\n $json = $this->c->get( FEED_SINGLE_CABLE . $id . '.' . FEED_FORMAT )->body;\n\n return new Cable( $json );\n\t\n\t}",
"public function getCocktail($id){\r\n $cocktails = array();\r\n $con = $this->db->getConnection();\r\n foreach(mysqli_query($con, 'SELECT * FROM cocktail_details WHERE idcoccktail_details='.$id)as $key){\r\n $titel = $key['c_name'];\r\n $description = $key['c_description'];\r\n $id = $key['idcoccktail_details'];\r\n $image = $key['c_image'];\r\n $cat = $key['category'];\r\n $ingredients = array();\r\n foreach (mysqli_query($con, 'Select i.ingredient, a.amount from cocktails join ingredients i on fk_ingredient_id=idingredients join amounts a on fk_amounts_id=idamounts where fk_detail_id='.$id.';') as $co) {\r\n $ingredients[] = array($co['ingredient'],$co['amount']);\r\n }\r\n $rating = 0;\r\n $count = 0;\r\n foreach (mysqli_query($con, 'SELECT * FROM rating where fk_cocktail='.$id.';') as $co) {\r\n $rating = $rating + $co['rating'];\r\n $count++;\r\n }\r\n if ($count != 0) {\r\n $rating = round($rating/$count);\r\n }else{\r\n $rating = 0;\r\n }\r\n $getcat = mysqli_fetch_assoc(mysqli_query($con, 'SELECT category_name FROM categories where idcategories='.$cat.';'));\r\n $category = $getcat['category_name'];\r\n $cocktail = new Cocktail($id, $titel, $description, $image, $ingredients, $category, $rating);\r\n }\r\n return $cocktail;\r\n $this->con->closeConnection();\r\n }",
"public function getById($id){\n\t\t$Channel = \\Channel::find($id); \n\t\treturn $Channel;\n\t}",
"public function get( $id ){}",
"public function get($id)\n {\n return Customer::find($id);\n }",
"public function getByID($id)\n {\n return $this->dao->select('*')->from(TABLE_BALANCE)->where('id')->eq($id)->limit(1)->fetch();\n }",
"public function show($id)\n {\n return Currency::find($id);\n }",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function show($id)\n {\n $courrier = Courrier::find($id);\n return $courrier;\n }",
"public function get( $id );",
"public function show($id) {\n return ClientTransaction::find($id);\n }"
] |
[
"0.6599536",
"0.6345395",
"0.62054235",
"0.6154126",
"0.61470354",
"0.61275095",
"0.61120963",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.61111623",
"0.60949856",
"0.6071207",
"0.6057387"
] |
0.67717946
|
0
|
/ get all cash back by id
|
public function getCashBacks()
{
try {
return $this
->cash
->where('account_id', auth()->user()->account_id)
->orderBy('created_at', 'desc')// get last requests first
->orderBy('is_approved', 'asc')// then order them by approved asc 0 -> 1 as not paid first
->get();
} catch (\Exception $e) {
self::logErr($e->getMessage());
return new Collection();
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getDemandeActesPayes($id){\n\t\t$adapter = $this->tableGateway->getAdapter();\n\t\t$sql = new Sql($adapter);\n\t\t$select = $sql->select();\n\t\t$select->columns(array('*'));\n\t\t$select->from(array('d'=>'demande_acte'));\n\t\t$select->join( array( 'a' => 'actes' ), 'd.idActe = a.id' , array ( '*' ) );\n\t\t$select->where(array('d.idCons' => $id, 'd.reglement' => 1));\n\t\t$select->order('d.dateDemande ASC');\n\t\t$stat = $sql->prepareStatementForSqlObject($select);\n\t\t$result = $stat->execute();\n\t\n\t\treturn $result;\n\t}",
"public function getCashBackById($id)\n {\n try {\n return $this->cash->find($id);\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return false;\n }\n }",
"public function get_all_balance($id)\n {\n if($id==0){\n $q=$this->db->where(['admin_id'=>1])->get('admin');\n $bal=$q->result_array()[0]['admin_chips'];\n }else if($id>999){\n $q=$this->db->where(['client_id'=>$id])->get('clients');\n $bal=$q->result_array()[0]['client_balance'];\n }else{\n $q=$this->db->where(['dist_id'=>$id])->get('distributor');\n $bal=$q->result_array()[0]['dist_balance'];\n }\n return $bal;\n }",
"public function index($id = null) {\n if ($id == null) {\n return ClientTransaction::orderBy('ID', 'asc')->get();\n } else {\n return $this->show($id);\n }\n }",
"public function cash($id) {\n// $cash = array_shift($cash);\n $this->checked = 0;\n $this->dispatchBrowserEvent('cash-detail', $id);\n }",
"function getContractList() {\n $sql = \"SELECT * FROM contract ORDER BY id DESC\";\n return getAll($sql);\n}",
"public function selectAllContracteData(){\n $sql = \"SELECT * FROM contract ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }",
"public function getRecords(int $id)\n {\n if ($id === false)\n {\n throw new \\Exceptions(\"Could not get information of budgets. Improper identification number. \"); \n }else\n {\n return $this -> asArray()\n -> where(['Id' => $id])\n -> first();\n }\n }",
"public function show($id) {\n return ClientTransaction::find($id);\n }",
"public function getDoctorCashBacks()\n {\n try {\n return $this\n ->cash\n ->join('doctor_income', 'doctor_income.request_id', 'cash_back.id')\n ->where('doctor_income.account_id', auth()->user()->account_id)\n ->select(\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%b')) as month_name\"),\n DB::raw('SUM(doctor_income.income) as doctor_income'),\n DB::raw('SUM(cash_back.seena_cash) as seena_income'),\n DB::raw('SUM(cash_back.patient_cash) as patient_income'),\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%m')) as month\"),\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%Y')) as year\")\n )\n ->groupBy('month', 'year')\n ->orderBy('year', 'desc')\n ->orderBy('month', 'desc')\n ->get();\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return new Collection();\n }\n }",
"public function getCoins(int $id)\n {\n return DB::select('call CoinTypeGetAllByCoinID(?)',array($id));\n }",
"public function showStock($id)\n\t{\n\t\treturn $this->stock->where('id',$id)->first();\n\t}",
"public function cashbacks()\n {\n return $this->hasMany(Cashback::class);\n }",
"public function show($id)\n {\n return Account::select('*')->where('account_number',$id)->get();\n }",
"public function getById($id){\n\n\t\t$row = $this->_model\n\t\t->getTable()\n\t\t->createQuery()\n\t\t->Where('estado_id in (0,1)')\n\t\t->andWhere('despachante_aduana_id = ?',$this->_model->despachante_aduana_id)\n\t\t->execute()\n\t\t->toArray();\n\t\treturn $row;\n\t}",
"public function get_by_item_id_all($id = FALSE)\n {\n if (!$id)\n {\n $query = $this->db->get('stock');\n return $query->result_array();\n }\n\n //$this->db->where('stock > 0');\n $this->db->where('itemID', $id);\n $this->db->where('stock >0');\n $query = $this->db->get('stock');\n\n return $query->result_array();\n }",
"public function get_all_data_bonifications_company($id)\n {\n $datos = $this->db->query('select * from money_usuario left join money_back on usuariosMoneyBackId = moneyBackId where usuarioMoneyId = ' . $id);\n return $datos->row();\n }",
"function flo_2_cash_details($id){\n\t\t$this->db->where('user_id',$id);\n\t\t$query=$this->db->get($this->config->item('ems_flo2cash_payment_method','dbtables'))->result_array();\n\t\tif(!empty($query)){\n\t\t\treturn $query;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getTransactions();",
"public function data_chain($id){\n\t\t$this->db->where('kd_cabang', $id);\n\t\t$query = $this->db->get('tbl_cabang');\n\t\treturn $query->result();\n\t}",
"public function coinGetByID(int $id)\n {\n return $this->coinModel->getByID($id);\n //return DB::select('call CoinsGetByID(?)',array($id));\n }",
"public function getRecenzeClanku($id){\n $sth = $this->db->prepare(\"SELECT * FROM RECENZE\n WHERE PRISPEVKY_id_prispevku = :id\");\n $sth->bindParam(':id', $id);\n $sth->execute();\n $data = $sth->fetchAll();\n return $data;\n }",
"public function show($id) {\n $redis = Redis::connection();\n\n $buy_orders = $redis->zRevRange('orders:' . $id . ':1', 0, -1);\n $sell_orders = $redis->zRange('orders:' . $id . ':0', 0, -1);\n\n $buy_side = [];\n foreach($buy_orders as $order) {\n $keys = $redis->hKeys('order:' . $order);\n $values = $redis->hVals('order:' . $order);\n $buy_side[] = array_combine($keys, $values);\n }\n\n $sell_side = [];\n foreach($sell_orders as $order) {\n $keys = $redis->hKeys('order:' . $order);\n $values = $redis->hVals('order:' . $order);\n $sell_side[] = array_combine($keys, $values);\n }\n\n $orders = array(\n 'buyOrders' => $buy_side,\n 'sellOrders' => $sell_side\n );\n\n return response($orders)\n ->header('Content-Type', 'application/json');\n }",
"public function getDistritos($id){\n return Distrito::where('codProvincia','=',$id)->get();\n \n }",
"public function get_bankcash() {\n\t return $this->db->get(\"tat_finance_bankcash\");\n\t}",
"public function getSoalByBanksoalAll($id)\n {\n $this->checkPermissions('soal');\n\n $soal = Soal::with('jawabans')->where('banksoal_id',$id)->get();\n\n return [ 'data' => $soal ];\n }",
"public function show($id)\n {\n $returnData = Invoice::find($id);\n foreach ($returnData->invoiceItems as $key => $value) {\n $value->return_qty = 0;\n }\n \n return $returnData;\n }",
"function recuperer_produit_bsm($id){\n global $db;\n $i = array(\n 'id' => $id\n );\n $sql = \"SELECT * FROM bsm WHERE id=:id\";\n $req = $db->prepare($sql);\n $req-> execute($i);\n $results = array();\n while($rows = $req->fetchObject()){\n $results[] = $rows;\n }\n return $results;\n}",
"public static function readAllClienteAbierto ($id) {\n\t\ttry {\n\t\t\t$objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso(); \n\t\t\t$consulta = $objetoAccesoDato->RetornarConsulta(\n\t\t\t\t\"SELECT p.idPedidoItem, p.idCliente, p.idPedido, p.idArticulo, p.cantidad, a.descripcion_corta, a.stock, p.precio_lista\n\t\t\t\tFROM articulos a, pedidos_item p\n\t\t\t\tWHERE a.id_articulo = p.idArticulo \n\t\t\t\tAND p.idCliente = $id \n\t\t\t\tAND p.idPedido = -1\"\n\t\t\t);\n\t\t\t$consulta->execute();\n\t\t\t\t\t\n\t\t\t$ret = $consulta->fetchAll(PDO::FETCH_CLASS, \"pedido_item\");\n\t\t} catch (Exception $e) {\n\t\t\t$mensaje = $e->getMessage();\n\t\t\t$respuesta = array(\"Estado\" => \"ERROR\", \"Mensaje\" => \"$mensaje\");\n\t\t} finally {\n\t\t\treturn $ret;\n\t\t}\t\t\n\t}",
"public function index()\n {\n $uid = auth()->user()->id;\n return Transaction::where('user_id', $uid)->get();\n }"
] |
[
"0.65986323",
"0.6581153",
"0.6476632",
"0.64527124",
"0.6443918",
"0.6436608",
"0.6383422",
"0.63623345",
"0.6361051",
"0.63170564",
"0.6286769",
"0.6267806",
"0.62300104",
"0.6184549",
"0.61831546",
"0.6170331",
"0.61654097",
"0.6162387",
"0.6130607",
"0.61294705",
"0.6128372",
"0.6109331",
"0.610366",
"0.60888004",
"0.6088357",
"0.6067472",
"0.6056982",
"0.60509825",
"0.6013862",
"0.5990949"
] |
0.6599533
|
0
|
Returns whether the resource is fresh as of the given timestamp
|
public function isFresh($timestamp = null);
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function isFresh()\n {\n return (bool)$this->fresh;\n }",
"public function isFresh(string $name, int $time): bool\n {\n if (null === $path = $this->findTemplate($name)) {\n return false;\n }\n\n return filemtime($path) < $time;\n }",
"public function isFresh(): bool\n {\n $lock = $this->lockFile->read();\n\n if (!empty($lock['content-hash'])) {\n // There is a content hash key, use that instead of the file hash\n return $this->contentHash === $lock['content-hash'];\n }\n\n // BC support for old lock files without content-hash\n if (!empty($lock['hash'])) {\n return $this->hash === $lock['hash'];\n }\n\n // should not be reached unless the lock file is corrupted, so assume it's out of date\n return false;\n }",
"public function isFresh()\n {\n return false;\n }",
"public function isFresh($name, $time)\n {\n $fresh = parent::isFresh($name, $time);\n if (!$fresh) return $fresh;\n\n $ctime = @filemtime(DOKU_CONF . 'local.php');\n\n return ($time > $ctime);\n }",
"public function uptodate()\n\t{\n\t\t$interval = new DateInterval('P1W'); // 1 Week\n\t\t$now = new DateTime();\n\n\t\treturn (new DateTime($this->updated_at))->add($interval) > $now && ( ! $this->recent());\n\t}",
"public function needUpdate()\n\t{\n\t\treturn ($this->getLastUpdate() == null || time() - $this->getLastUpdate()->format('U') > 1 * 60);\n\t}",
"public function isTemplateFresh($name, $time)\n {\n foreach ($this->extensions as $extension) {\n $r = new ReflectionObject($extension);\n if (filemtime($r->getFileName()) > $time) {\n return false;\n }\n }\n return $this->getLoader()->isFresh($name, $time);\n }",
"public function hasTimestamp(): bool\n {\n return isset($this->timestamp);\n }",
"public function isTemplateFresh($name, $time)\n {\n return $this->getLoader()->isFresh($name, $time);\n }",
"public function isFresh()\n {\n return ($this->level == -2);\n }",
"public function hasLastTime(){\n return $this->_has(18);\n }",
"public function recentlySeen()\n {\n return $this->checked_in_at->diffInDays(now()) < 1;\n }",
"public function freshness() {\n // Return 'fresh', 'stale', 'expired', or 'missing' depending on age thresholds.\n //\n // NOTE: if this function is called on a Crew that has Helicopters, the freshness verb will\n // refer to the length of time that has passed since ANY of this Crew's helicopters were updated.\n\n $max_fresh_age = config('app.hours_until_updates_go_stale');\n $expiration_age= config('app.days_until_updates_expire') * 24; // Converted to hours\n\n $now = Carbon::now();\n $last_status = $this->status();\n if(is_null($last_status->id)) $freshness = \"missing\"; // No Status has ever been created for this Crew\n else {\n $last_update = $last_status->created_at;\n $age_hours = $now->diffInHours($last_update); // The number of hours between NOW and the last update\n \n if($age_hours <= $max_fresh_age) $freshness = \"fresh\";\n elseif(($age_hours > $max_fresh_age) && ($age_hours < $expiration_age)) $freshness = \"stale\";\n else $freshness = \"expired\";\n }\n\n return $freshness;\n }",
"protected function isOutdated(): bool {\n $outdated = true;\n if(!$this->dry()){\n $timezone = $this->getF3()->get('getTimeZone')();\n $currentTime = new \\DateTime('now', $timezone);\n $updateTime = \\DateTime::createFromFormat(\n 'Y-m-d H:i:s',\n $this->updated,\n $timezone\n );\n $interval = $updateTime->diff($currentTime);\n if($interval->days < Universe\\BasicUniverseModel::CACHE_MAX_DAYS){\n $outdated = false;\n }\n }\n return $outdated;\n }",
"private function isCacheFresh()\n {\n $documentDirs = $this->documentLocator->getAllDocumentDirs();\n\n foreach ($documentDirs as $dir) {\n $isFresh = $this->cache->fetch('[C]'.self::CACHE_KEY) >= filemtime($dir);\n if (!$isFresh) {\n return false;\n }\n }\n\n return true;\n }",
"public function needsRefreshing()\n {\n return $this->isExpired() || ! $this->isLoaded();\n }",
"function expired() {\r\n if(!file_exists($this->cachefile)) return true;\r\n # compare new m5d to existing cached md5\r\n elseif($this->hash !== $this->get_current_hash()) return true;\r\n else return false;\r\n }",
"public function has_expired()\n\t{\n\t\treturn $this->until < time();\n\t}",
"public function is_expired() {\n\t\treturn $this->data['created_at'] + HOUR_IN_SECONDS < ITSEC_Core::get_current_time_gmt();\n\t}",
"function is_updated($updated_at)\n{\n $now = time() - 60;\n $updated_at = strtotime($updated_at);\n if ($updated_at > $now) {\n return true;\n }\n\n return false;\n}",
"public function checkTimestamps()\n {\n return false;\n }",
"public function hasRtime32Created()\n {\n return $this->rtime32_created !== null;\n }",
"public function hasRelivetime(){\n return $this->_has(3);\n }",
"public function is_new_data() {\n $rv = FALSE;\n if ($this->is_remote($this->url)) {\n $ts_standard = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_COUNTIES);\n }\n else {\n $ts_standard = filemtime($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = filemtime($this->url . FileFetcher::FILE_COUNTIES);\n }\n $ts = 0;\n if ($this->last_fetch == '' || $ts_standard > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_standard;\n }\n if ($this->last_fetch == '' || $ts_counties > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_counties;\n }\n if ($rv) {\n update_option(\"hecc_standard_last_update_datetime\", $ts);\n }\n return $rv;\n }",
"private function isFreshCacheEntry(Response $entry)\n {\n return $this->getReverseProxyTtl($entry) > 0;\n }",
"public function isUpdateRequired()\n {\n $CacheCreated = filemtime($this->cachedPath);\n $CacheRenewal = $CacheCreated + $this->CacheLife;\n if(time() >= $CacheRenewal)\n return true;\n else\n return false;\n }",
"public function hasLastUpdate() {\n return $this->_has(2);\n }",
"public function hasExpired($timestamp): bool\n {\n return CompanionTokenManager::hasExpired($timestamp);\n }",
"public function checkModified($timestamp)\n {\n\n $sourceFilePath = $this->getData($this->code . '_file_path');\n\n if (!$this->metadata) {\n $this->metadata = $this->getMetadata($sourceFilePath);\n }\n\n $modified = strtotime($this->metadata['client_modified']);\n\n return ($timestamp != $modified) ? $modified : false;\n }"
] |
[
"0.7110876",
"0.6894656",
"0.6728656",
"0.6684991",
"0.6684377",
"0.6616016",
"0.6468048",
"0.63848454",
"0.63766736",
"0.63219535",
"0.63169175",
"0.6291651",
"0.62711877",
"0.6257202",
"0.6256739",
"0.624635",
"0.62240493",
"0.62204695",
"0.6197095",
"0.6190939",
"0.6180579",
"0.6157981",
"0.6152856",
"0.61323327",
"0.6116845",
"0.6107742",
"0.6104764",
"0.60798",
"0.6064407",
"0.6050612"
] |
0.85411114
|
0
|
Custom variables for the checkout module. Custom variables are stored in the following format: array(variable_id, variable_name, variable_type, help_text, default_value, required, [variable_options], [multi_select], [multi_select_height]) variable_type types are: text,number,password,radio,dropdown variable_options is used when the variable type is radio or dropdown and is a name/value array.
|
public function SetCustomVars()
{
$this->_variables['displayname'] = array("name" => GetLang('DisplayName'),
"type" => "textbox",
"help" => GetLang('DisplayNameHelp'),
"default" => $this->GetName(),
"required" => true
);
$this->_variables['vendorname'] = array("name" => GetLang($this->_languagePrefix.'VendorName'),
"type" => "textbox",
"help" => GetLang($this->_languagePrefix.'VendorNameHelp'),
"default" => "",
"required" => true
);
$this->_variables['cardcode'] = array("name" => GetLang($this->_languagePrefix.'CardCode'),
"type" => "dropdown",
"help" => GetLang($this->_languagePrefix.'CardCodeHelp'),
"default" => "no",
"required" => true,
"options" => array(GetLang($this->_languagePrefix.'CardCodeNo') => "NO",
GetLang($this->_languagePrefix.'CardCodeYes') => "YES"
),
"multiselect" => false
);
$this->_variables['testmode'] = array("name" => GetLang($this->_languagePrefix.'TestMode'),
"type" => "dropdown",
"help" => GetLang($this->_languagePrefix.'TestModeHelp'),
"default" => "no",
"required" => true,
"options" => array(GetLang($this->_languagePrefix.'TestModeTest') => "TEST",
GetLang($this->_languagePrefix.'TestModeSimulator') => "SIMULATOR",
GetLang($this->_languagePrefix.'TestModeLive') => "LIVE"
),
"multiselect" => false
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function SetCustomVars()\n\t{\n\t\t$this->_variables['displayname'] = array(\"name\" => GetLang('NabDisplayName'),\n\t\t \"type\" => \"textbox\",\n\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t \"default\" => $this->GetName(),\n\t\t \"required\" => true\n\t\t);\n\n\t\t$this->_variables['vendor_name'] = array(\"name\" => GetLang('NabVendorName'),\n\t\t \"type\" => \"textbox\",\n\t\t \"help\" => GetLang('NabVendorNameHelp'),\n\t\t \"default\" => \"\",\n\t\t \"required\" => true\n\t\t);\n\n\t\t$this->_variables['email'] = array(\"name\" => GetLang('NabPaymentEmail'),\n\t\t \"type\" => \"textbox\",\n\t\t \"help\" => GetLang('NabPaymentAlertHelp'),\n\t\t \"default\" => \"\",\n\t\t \"required\" => true\n\t\t);\n\n\t\t$this->_variables['testmode'] = array(\"name\" => GetLang('NabTestMode'),\n\t\t \"type\" => \"dropdown\",\n\t\t \"help\" => GetLang(\"NabTestModeHelp\"),\n\t\t \"default\" => \"no\",\n\t\t \"required\" => true,\n\t\t \"options\" => array(GetLang(\"NabTestModeNo\") => \"NO\",\n\t\t\t\t\t\t GetLang(\"NabTestModeYes\") => \"YES\"\n\t\t\t),\n\t\t\t\"multiselect\" => false\n\t\t);\n\t}",
"public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang($this->_languagePrefix.'DisplayName'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['productid'] = array(\"name\" => GetLang($this->_languagePrefix.'ProductId'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'ProductIdHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['sharedsecret'] = array(\"name\" => GetLang($this->_languagePrefix.'SharedSecret'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'SharedSecretHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t}",
"public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang($this->_languagePrefix.\"DisplayName\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['MerchantId'] = array(\"name\" => GetLang($this->_languagePrefix.\"MerchantId\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'MerchantIdHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['MerchantEmail'] = array(\"name\" => GetLang($this->_languagePrefix.\"MerchantEmail\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'MerchantEmailHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['CallbackId'] = array(\"name\" => GetLang($this->_languagePrefix.\"CallbackId\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'CallbackIdHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t$this->_variables['SecretWord'] = array(\"name\" => GetLang($this->_languagePrefix.\"SecretWord\"),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'SecretWordHelp'),\n\t\t\t \"default\" => '',\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t}",
"function SetCustomVars()\n\t\t{\n\n\n\n\t\t\t$this->_variables['availablecountries'] = array(\"name\" => \"Continentes\",\n\t\t\t \"type\" => \"dropdown\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilContinentes'),\n\t\t\t \"default\" => \"all\",\n\t\t\t \"required\" => true,\n\t\t\t \"options\" => GetCountryListAsNameValuePairs(),\n\t\t\t\t\"multiselect\" => true\n\t\t\t);\n\n\n\t\t\t$this->_variables['boletobancodobrasilcedente'] = array(\"name\" => \"Cedente\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCedente'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['boletobancodobrasilagencia'] = array(\"name\" => \"Agencia\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilAgencia'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t\t);\n\n\n\t\t\t$this->_variables['boletobancodobrasilconta'] = array(\"name\" => \"Conta\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilConta'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\n\n\n\t\t\t$this->_variables['boletobancodobrasilcarteira'] = array(\"name\" => \"Carteira\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCarteira'),\n\t\t\t \"default\" => \"18\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilconvenio'] = array(\"name\" => \"Convenio\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilConvenio'),\n\t\t\t \"default\" => \"0000000\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t$this->_variables['boletobancodobrasilcontrato'] = array(\"name\" => \"Contrato\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilContrato'),\n\t\t\t \"default\" => \"0000000\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t\t$this->_variables['boletobancodobrasilvariacaocarteira'] = array(\"name\" => \"Variação da Carteira\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilVariacaoCarteira'),\n\t\t\t \"default\" => \"-019\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t\t\t$this->_variables['boletobancodobrasilformatacaoconvenio'] = array(\"name\" => \"Formatação do Convênio\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilFormatacaoConvenio'),\n\t\t\t \"default\" => \"7\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\t\t\t\t$this->_variables['boletobancodobrasilformatacaonossonumero'] = array(\"name\" => \"Formatação do Nosso Número\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilFormatacaoNossoNumero'),\n\t\t\t \"default\" => \"7\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\n\n\n\t//_-----------------------------------------------------------------------------------------demonstrativos\n\t\n\t\t\t$this->_variables['demoum'] = array(\"name\" => \"Demonstração 1\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoU'),\n\t\t\t \"default\" => \"REFERENTE A COMPRAS ONLINE\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t$this->_variables['demodois'] = array(\"name\" => \"Demonstração 2\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoD'),\n\t\t\t \"default\" => \"Duvidas e sugestões entre em contato conosco:\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t\t\t$this->_variables['demotres'] = array(\"name\" => \"Demonstração 3\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilDemoT'),\n\t\t\t \"default\" => \"[email protected] | +55 xx 0000.0000\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t//_------------------------------------------------------------------------------------------fim-demonstrativos\n\t\n\n\n\n\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaoum'] = array(\"name\" => \"Instrução 1\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoUm'),\n\t\t\t \"default\" => \"Multa de R$ 3,00 por atraso.\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaodois'] = array(\"name\" => \"Instrução 2\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoDois'),\n\t\t\t \"default\" => \"Apos o vencimento, pagavel apenas no Banco Real\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\t\t\t$this->_variables['boletobancodobrasilinstrucaotres'] = array(\"name\" => \"Instrução 3\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoTres'),\n\t\t\t \"default\" => \"Fatura sujeita a protesto no SPC/SERASA\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilinstrucaoquatro'] = array(\"name\" => \"Instrução 4\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInstrucaoQuatro'),\n\t\t\t \"default\" => \"Juros de mora de 0,1% ao dia.\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\n\t\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilaceite'] = array(\"name\" => \"Aceite\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilAceite'),\n\t\t\t \"default\" => \"N\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t$this->_variables['boletobancodobrasilespeciedoc'] = array(\"name\" => \"Espécie do documento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilEspecieDoc'),\n\t\t\t \"default\" => \"DS\",\n\t\t\t \"required\" => false\n\t\t\t);\n\n\t\t\t$this->_variables['boletobancodobrasilespecie'] = array(\"name\" => \"Espécie de cobrança\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilEspecie'),\n\t\t\t \"default\" => \"R$\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\t\n\n\t\t\t$this->_variables['boletobancodobrasilcpfcnpj'] = array(\"name\" => \"CPF ou CNPJ do Boleto\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilCNPF'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => false\n\t\t\t);\n\t\t\n\t\t\n\t\t$this->_variables['boletobancodobrasildiasparavencimento'] = array(\"name\" => \"Dias para vencimento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilVence'),\n\t\t\t \"default\" => \"10\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t\t\t\t$this->_variables['postagem'] = array(\"name\" => \"LINK de Repagamento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => \"URL para Repagamento\",\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletobancodobrasil/boleto_bancodobrasil.php?boleto=\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\t\n\t\t\t$this->_variables['imagems'] = array(\"name\" => \"IMAGEM de Repagamento\",\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => \"URL para Repagamento\",\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletobancodobrasil/images/logo.gif\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t\n\n\n\t$this->_variables['helptext'] = array(\"name\" => \"Mais configurações\",\n\t\t\t \"type\" => \"textarea\",\n\t\t\t \"help\" => GetLang('boletobancodobrasilInst'),\n\t\t\t \"default\" => \"Você escolheu pagar com Boleto Bancário do Banco do Brasil.\\nPara reimprimir seu boleto clique no botão abaixo.<br>\",\n\t\t\t \"required\" => true,\n\t\t\t \"rows\" => 7\n\t\t\t);\n\t\t\t\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}",
"function SetCustomVars()\r\n\t\t{\r\n\r\n\r\n\r\n\t\t\t$this->_variables['availablecountries'] = array(\"name\" => \"Continentes\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauContinentes'),\r\n\t\t\t \"default\" => \"all\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"options\" => GetCountryListAsNameValuePairs(),\r\n\t\t\t\t\"multiselect\" => true\r\n\t\t\t);\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['desconto'] = array(\"name\" => \"Desconto em %\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => '',\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\r\n\r\n\t\t\t$this->_variables['boletoitaucedente'] = array(\"name\" => \"Cedente\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCedente'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauagencia'] = array(\"name\" => \"Agencia\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAgencia'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauconta'] = array(\"name\" => \"Conta\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauConta'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitaucarteira'] = array(\"name\" => \"Carteira\",\r\n\t\t\t \"type\" => \"dropdown\",\r\n\t\t\t \"help\" => GetLang('boletoitauCarteira'),\r\n\t\t\t \"default\" => \"20\",\r\n\t\t\t \"options\" => array('175' => '175', '109' => '109'),\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"multiselection\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\r\n\r\n\t//_-----------------------------------------------------------------------------------------demonstrativos\r\n\t\r\n\t\t\t$this->_variables['demoum'] = array(\"name\" => \"Demonstração 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoU'),\r\n\t\t\t \"default\" => \"REFERENTE A COMPRAS ONLINE\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['demodois'] = array(\"name\" => \"Demonstração 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoD'),\r\n\t\t\t \"default\" => \"Duvidas e sugestões entre em contato conosco:\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['demotres'] = array(\"name\" => \"Demonstração 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDemoT'),\r\n\t\t\t \"default\" => \"[email protected] | +55 xx 0000.0000\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t//_------------------------------------------------------------------------------------------fim-demonstrativos\r\n\t\r\n\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoum'] = array(\"name\" => \"Instrução 1\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoUm'),\r\n\t\t\t \"default\" => \"Multa de R$ 3,00 por atraso.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaodois'] = array(\"name\" => \"Instrução 2\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoDois'),\r\n\t\t\t \"default\" => \"Apos o vencimento, pagavel apenas no Banco Real\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\t\t\t$this->_variables['boletoitauinstrucaotres'] = array(\"name\" => \"Instrução 3\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoTres'),\r\n\t\t\t \"default\" => \"Fatura sujeita a protesto no SPC/SERASA\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauinstrucaoquatro'] = array(\"name\" => \"Instrução 4\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauInstrucaoQuatro'),\r\n\t\t\t \"default\" => \"Juros de mora de 0,1% ao dia.\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauaceite'] = array(\"name\" => \"Aceite\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauAceite'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->_variables['boletoitauespeciedoc'] = array(\"name\" => \"Espécie do documento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecieDoc'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['boletoitauespecie'] = array(\"name\" => \"Espécie de cobrança\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauEspecie'),\r\n\t\t\t \"default\" => \"R$\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\t\r\n\r\n\t\t\t$this->_variables['boletoitaucpfcnpj'] = array(\"name\" => \"CPF ou CNPJ do Boleto\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauCNPF'),\r\n\t\t\t \"default\" => \"\",\r\n\t\t\t \"required\" => false\r\n\t\t\t);\r\n\t\t\r\n\t\t\r\n\t\t$this->_variables['boletoitaudiasparavencimento'] = array(\"name\" => \"Dias para vencimento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauVence'),\r\n\t\t\t \"default\" => \"10\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\r\n\r\n\r\n\t\t$this->_variables['boletoitaudv'] = array(\"name\" => \"Dígito Verificador\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => GetLang('boletoitauDV'),\r\n\t\t\t \"default\" => \"0\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\r\n\t\t\t$this->_variables['postagem'] = array(\"name\" => \"LINK de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/boleto_itau.php?boleto=\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$this->_variables['imagems'] = array(\"name\" => \"IMAGEM de Repagamento\",\r\n\t\t\t \"type\" => \"textbox\",\r\n\t\t\t \"help\" => \"URL para Repagamento\",\r\n\t\t\t \"default\" => \"%%GLOBAL_ShopPath%%/modules/checkout/boletoitau/images/logo.gif\",\r\n\t\t\t \"required\" => true\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t\r\n\t$this->_variables['helptext'] = array(\"name\" => \"Mais configurações\",\r\n\t\t\t \"type\" => \"textarea\",\r\n\t\t\t \"help\" => GetLang('boletoitauInst'),\r\n\t\t\t \"default\" => \"Você escolheu pagar com Boleto Bancário do Banco Itaú.\\nPara reimprimir seu boleto clique no botão abaixo.<br>\",\r\n\t\t\t \"required\" => true,\r\n\t\t\t \"rows\" => 7\r\n\t\t\t);\r\n\t\t\t\r\n\t\t}",
"public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }",
"public function field_custom_variables() {\n\n\t\t$custom_vars = $this->_get_options( 'custom_vars' );\n\n\t\t$scope_options = array(\n\t\t\t\t0 => __( 'Default', 'wp-google-analytics' ),\n\t\t\t\t1 => __( 'Visitor', 'wp-google-analytics' ),\n\t\t\t\t2 => __( 'Session', 'wp-google-analytics' ),\n\t\t\t\t3 => __( 'Page', 'wp-google-analytics' ),\n\t\t\t);\n\t\tfor ( $i = 1; $i <= 5; $i++ ) {\n\t\t\t$name = ( isset( $custom_vars[$i]['name'] ) ) ? $custom_vars[$i]['name'] : '';\n\t\t\t$value = ( isset( $custom_vars[$i]['value'] ) ) ? $custom_vars[$i]['value'] : '';\n\t\t\t$scope = ( isset( $custom_vars[$i]['scope'] ) ) ? $custom_vars[$i]['scope'] : 0;\n\t\t\techo '<label for=\"wga_custom_var_' . $i . '_name\"><strong>' . $i . ')</strong> ' . __( 'Name', 'wp-google-analytics' ) . ' ';\n\t\t\techo '<input id=\"wga_custom_var_' . $i . '\" type=\"text\" name=\"wga[custom_vars][' . $i . '][name]\" value=\"' . esc_attr( $name ) . '\" />';\n\t\t\techo '</label> ';\n\t\t\techo '<label for=\"wga_custom_var_' . $i . '_value\">' . __( 'Value', 'wp-google-analytics' ) . ' ';\n\t\t\techo '<input id=\"wga_custom_var_' . $i . '\" type=\"text\" name=\"wga[custom_vars][' . $i . '][value]\" value=\"' . esc_attr( $value ) . '\" />';\n\t\t\techo '</label> ';\n\t\t\techo '<label for=\"wga_custom_var_' . $i . '_scope\">' . __( 'Scope', 'wp-google-analytics' ) . ' ';\n\t\t\techo '<select id=\"wga_custom_var_' . $i . '_scope\" name=\"wga[custom_vars][' . $i . '][scope]\">';\n\t\t\tforeach( $scope_options as $key => $label ) {\n\t\t\t\techo '<option value=\"' . $key . '\" ' . selected( $scope, $key, false ) . '>';\n\t\t\t\techo $label . '</option>';\n\t\t\t}\n\t\t\techo '</select>';\n\t\t\techo '</label><br />';\n\t\t}\n\n\t}",
"protected function _addB2CVariables()\n {\n if(isset($this->_additionalFields['bankaccount']))\n {\n // Strip whitespace from bankaccount string\n $bankAccountNumber = preg_replace( '/\\s+/' , '' , $this->_additionalFields['bankaccount'] );\n $array = array(\n 'bankAccountNumber' => $bankAccountNumber,\n );\n }\n else\n {\n $array = array(\n 'bankAccountNumber' => '',\n );\n }\n \n if (is_array($this->_vars)) {\n $this->_vars = array_merge($this->_vars, $array);\n } else {\n $this->_vars = $array;\n }\n \n $this->_debugEmail .= \"Shipping address variables added! \\n\";\n }",
"public static function variables(): array\n {\n return [ \n Variable::make('method', __('Login form method')), \n Variable::make('action', __('Login form action')), \n Variable::make('token_field', __('Name of the csrf_token field')), \n Variable::make('token_value', __('The csrf_token field value')), \n Variable::make('widget_field', __('Name of the widget field')), \n Variable::make('widget_value', __('The widget field value')), \n\n Variable::make('username_field', __('Name of the username/email field')), \n Variable::make('username_error', __('The username/email field error')), \n Variable::make('username_value', __('The username/email field old value')), \n\n Variable::make('password_field', __('Name of the password field')), \n Variable::make('password_error', __('The password field error')), \n\n Variable::make('remember_field', __('Name of the remember field')), \n Variable::make('remember_checked', __('The remember field checked status')), \n Variable::make('registration_page', __('The registration page url')), \n ];\n }",
"public function output_custom_fields_variables() {\n\t\t$external_fields = $this->get_all_external_fields();\n\t\t$suffix = '_' . get_the_ID();\n\n\t\techo $this->get_custom_fields_variables( $external_fields, $suffix );\n\t}",
"public function prepareVars()\n {\n $this->vars['defaultCurrency'] = $this->defaultCurrency;\n $this->vars['defaultValue'] = $this->getPriceValue($this->defaultCurrency->id);\n $this->vars['currencies'] = Currency::orderBy('sort_order', 'ASC')->get();\n $this->vars['field'] = $this->formField;\n }",
"protected function addBootstrapVariables()\n {\n $objFile = new \\File($this->getBootstrapSrc('variables.less'));\n\n $strVariables = '';\n\n if ($objFile->size > 0)\n {\n $strVariables = $objFile->getContent();\n }\n\n if (!is_array($this->variablesOrderSRC))\n {\n return;\n }\n\n $objTarget = new \\File($this->getBootstrapCustomSrc($this->variablesSrc));\n\n // overwrite bootstrap variables with custom variables\n $objFilesModels = \\FilesModel::findMultipleByUuids($this->variablesOrderSRC);\n\n if ($objFilesModels !== null)\n {\n while ($objFilesModels->next())\n {\n $objFile = new \\File($objFilesModels->path);\n $strContent = $objFile->getContent();\n\n if ($this->isFileUpdated($objFile, $objTarget))\n {\n $this->rewrite = true;\n $this->rewriteBootstrap = true;\n if ($strContent)\n {\n $strVariables .= \"\\n\" . $strContent;\n }\n }\n else\n {\n $strVariables .= \"\\n\" . $strContent;\n }\n }\n }\n\n if ($this->rewriteBootstrap)\n {\n $objTarget->write($strVariables);\n $objTarget->close();\n }\n\n $this->objLess->parse($strVariables);\n }",
"public static function variables(): array\n {\n return [\n Variable::make('sorts', __('Array of available sorting')),\n\n Variable::make('directions', __('Array of sort directions')),\n\n Variable::make('items', __('HTML generated of blog items')),\n\n Variable::make('pagination', __('HTML generated of pagination links')),\n ];\n }",
"function config()\n\t{\n\t\t$rows=$GLOBALS['SITE_DB']->query_select('pstore_customs',array('*'),NULL,'ORDER BY id');\n\t\t$out=array();\n\t\tforeach ($rows as $i=>$row)\n\t\t{\n\t\t\t$fields=new ocp_tempcode();\n\t\t\t$hidden=new ocp_tempcode();\n\t\t\t$fields->attach($this->get_fields('_'.strval($i),get_translated_text($row['c_title']),get_translated_text($row['c_description']),$row['c_enabled'],$row['c_cost'],$row['c_one_per_member']));\n\t\t\t$fields->attach(do_template('FORM_SCREEN_FIELD_SPACER',array('TITLE'=>do_lang_tempcode('ACTIONS'))));\n\t\t\t$fields->attach(form_input_tick(do_lang_tempcode('DELETE'),do_lang_tempcode('DESCRIPTION_DELETE'),'delete_custom_'.strval($i),false));\n\t\t\t$hidden->attach(form_input_hidden('custom_'.strval($i),strval($row['id'])));\n\t\t\t$out[]=array($fields,$hidden,do_lang_tempcode('EDIT_CUSTOM_PRODUCT'));\n\t\t}\n\n\t\treturn array($out,do_lang_tempcode('ADD_NEW_CUSTOM_PRODUCT'),$this->get_fields());\n\t}",
"function TS_VCSC_Extensions_Create_Variables() {\r\n // Create Data Holder Object (window.krautcomposium)\r\n $TS_VCSC_VariablesOutput = array();\r\n $TS_VCSC_VariablesOutput['Releases'] = array();\r\n $TS_VCSC_VariablesOutput['Lightbox'] = array();\r\n $TS_VCSC_VariablesOutput['Other'] = array();\r\n\t\t\techo '<script type=\"text/javascript\">'; \r\n\t\t\t\t// Current Plugin Version\r\n\t\t\t\techo 'var $TS_VCSC_CurrentPluginRelease = \"' . COMPOSIUM_VERSION . '\";';\r\n $TS_VCSC_VariablesOutput['Releases']['Composium'] = COMPOSIUM_VERSION;\r\n\t\t\t\t// Current WP Bakery Page Builder Extensions Addon Version\r\n\t\t\t\techo 'var $TS_VCSC_CurrentComposerRelease = \"' . $this->TS_VCSC_VisualComposer_Version . '\";';\r\n $TS_VCSC_VariablesOutput['Releases']['WPBakeryBuilder'] = $this->TS_VCSC_VisualComposer_Version;\r\n\t\t\t\t// Current Page/Post Title\r\n\t\t\t\tif ((TS_VCSC_IsEditPagePost()) && ($this->TS_VCSC_EditorLivePreview == \"true\") && ($this->TS_VCSC_Visual_Composer_Elements['TS Title Advanced']['active'] == 'true')) {\r\n\t\t\t\t\tglobal $post;\r\n\t\t\t\t\tif ($post) {\r\n\t\t\t\t\t\techo 'var $TS_VCSC_CurrentPageTitle = \"' . get_the_title($post->ID) . '\";';\r\n $TS_VCSC_VariablesOutput['CurrentPageTitle'] = get_the_title($post->ID);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\techo 'var $TS_VCSC_CurrentPageTitle = ' . __( \"Title could not (yet) be retrieved!\", \"ts_visual_composer_extend\" ) . ';';\r\n $TS_VCSC_VariablesOutput['CurrentPageTitle'] = __( \"Title could not (yet) be retrieved!\", \"ts_visual_composer_extend\" );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Lightbox Settings\r\n\t\t\t\tif ($this->TS_VCSC_UseInternalLightbox == \"true\") { \r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Activated = true;';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Activated'] = true;\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Thumbs = \"' . \t\t\t\t\t((array_key_exists('thumbs', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['thumbs'] : $this->TS_VCSC_Lightbox_Setting_Defaults['thumbs']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Thumbnails'] = ((array_key_exists('thumbs', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['thumbs'] : $this->TS_VCSC_Lightbox_Setting_Defaults['thumbs']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Thumbsize = ' . \t\t\t\t((array_key_exists('thumbsize', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['thumbsize'] : $this->TS_VCSC_Lightbox_Setting_Defaults['thumbsize']) . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Thumbsize'] = (int)((array_key_exists('thumbsize', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['thumbsize'] : $this->TS_VCSC_Lightbox_Setting_Defaults['thumbsize']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Animation = \"' . \t\t\t\t((array_key_exists('animation', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['animation'] : $this->TS_VCSC_Lightbox_Setting_Defaults['animation']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Animation'] = ((array_key_exists('animation', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['animation'] : $this->TS_VCSC_Lightbox_Setting_Defaults['animation']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Captions = \"' . \t\t\t\t((array_key_exists('captions', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['captions'] : $this->TS_VCSC_Lightbox_Setting_Defaults['captions']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Captions'] = ((array_key_exists('captions', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['captions'] : $this->TS_VCSC_Lightbox_Setting_Defaults['captions']);\r\n echo 'var $TS_VCSC_Lightbox_Closer = ' . \t\t\t\t\t(((array_key_exists('closer', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['closer'] : $this->TS_VCSC_Lightbox_Setting_Defaults['closer']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Closer'] = (((array_key_exists('closer', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['closer'] : $this->TS_VCSC_Lightbox_Setting_Defaults['closer']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Durations = ' . \t\t\t\t((array_key_exists('duration', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['duration'] : $this->TS_VCSC_Lightbox_Setting_Defaults['duration']) . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Duration'] = (int)((array_key_exists('duration', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['duration'] : $this->TS_VCSC_Lightbox_Setting_Defaults['duration']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Share = ' . \t\t\t\t\t(((array_key_exists('share', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['share'] : $this->TS_VCSC_Lightbox_Setting_Defaults['share']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Share'] = (((array_key_exists('share', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['share'] : $this->TS_VCSC_Lightbox_Setting_Defaults['share']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Save = ' . \t\t\t\t\t\t(((array_key_exists('save', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['save'] : $this->TS_VCSC_Lightbox_Setting_Defaults['save']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Save'] = (((array_key_exists('save', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['save'] : $this->TS_VCSC_Lightbox_Setting_Defaults['save']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_LoadAPIs = ' . \t\t\t\t\t(((array_key_exists('loadapis', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['loadapis'] : $this->TS_VCSC_Lightbox_Setting_Defaults['loadapis']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['LoadAPIs'] = (((array_key_exists('loadapis', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['loadapis'] : $this->TS_VCSC_Lightbox_Setting_Defaults['loadapis']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Social = \"' . \t\t\t\t\t((array_key_exists('social', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['social'] : $this->TS_VCSC_Lightbox_Setting_Defaults['social']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Social'] = ((array_key_exists('social', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['social'] : $this->TS_VCSC_Lightbox_Setting_Defaults['social']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_NoTouch = ' . \t\t\t\t\t(((array_key_exists('notouch', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['notouch'] : $this->TS_VCSC_Lightbox_Setting_Defaults['notouch']) == 1 ? 'false' : 'true') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['NoTouch'] = (((array_key_exists('notouch', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['notouch'] : $this->TS_VCSC_Lightbox_Setting_Defaults['notouch']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_BGClose = ' . \t\t\t\t\t(((array_key_exists('bgclose', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['bgclose'] : $this->TS_VCSC_Lightbox_Setting_Defaults['bgclose']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['BGClose'] = (((array_key_exists('bgclose', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['bgclose'] : $this->TS_VCSC_Lightbox_Setting_Defaults['bgclose']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_NoHashes = ' . \t\t\t\t\t(((array_key_exists('nohashes', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['nohashes'] : $this->TS_VCSC_Lightbox_Setting_Defaults['nohashes']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['NoHashes'] = (((array_key_exists('nohashes', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['nohashes'] : $this->TS_VCSC_Lightbox_Setting_Defaults['nohashes']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Keyboard = ' . \t\t\t\t\t(((array_key_exists('keyboard', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['keyboard'] : $this->TS_VCSC_Lightbox_Setting_Defaults['keyboard']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Keyboard'] = (((array_key_exists('keyboard', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['keyboard'] : $this->TS_VCSC_Lightbox_Setting_Defaults['keyboard']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_FullScreen = ' . \t\t\t\t(((array_key_exists('fullscreen', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['fullscreen'] : $this->TS_VCSC_Lightbox_Setting_Defaults['fullscreen']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['FullScreen'] = (((array_key_exists('fullscreen', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['fullscreen'] : $this->TS_VCSC_Lightbox_Setting_Defaults['fullscreen']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Zoom = ' . \t\t\t\t\t\t(((array_key_exists('zoom', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['zoom'] : $this->TS_VCSC_Lightbox_Setting_Defaults['zoom']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Zoom'] = (((array_key_exists('zoom', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['zoom'] : $this->TS_VCSC_Lightbox_Setting_Defaults['zoom']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_FXSpeed = ' . \t\t\t\t\t((array_key_exists('fxspeed', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['fxspeed'] : $this->TS_VCSC_Lightbox_Setting_Defaults['fxspeed']) . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['FXSpeed'] = (int)((array_key_exists('fxspeed', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['fxspeed'] : $this->TS_VCSC_Lightbox_Setting_Defaults['fxspeed']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Scheme = \"' . \t\t\t\t\t((array_key_exists('scheme', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['scheme'] : $this->TS_VCSC_Lightbox_Setting_Defaults['scheme']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Scheme'] = ((array_key_exists('scheme', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['scheme'] : $this->TS_VCSC_Lightbox_Setting_Defaults['scheme']); \r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Controls = \"' . ((array_key_exists('controls', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['controls'] : $this->TS_VCSC_Lightbox_Setting_Defaults['controls']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Buttons'] = ((array_key_exists('controls', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['controls'] : $this->TS_VCSC_Lightbox_Setting_Defaults['controls']);\r\n echo 'var $TS_VCSC_Lightbox_URLColor = ' . \t\t\t\t\t(((array_key_exists('urlcolorscan', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['urlcolorscan'] : $this->TS_VCSC_Lightbox_Setting_Defaults['urlcolorscan']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['URLColor'] = (((array_key_exists('urlcolorscan', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['urlcolorscan'] : $this->TS_VCSC_Lightbox_Setting_Defaults['urlcolorscan']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Backlight = \"' . \t\t\t\t((array_key_exists('backlight', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['backlight'] : $this->TS_VCSC_Lightbox_Setting_Defaults['backlight']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Backlight'] = ((array_key_exists('backlight', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['backlight'] : $this->TS_VCSC_Lightbox_Setting_Defaults['backlight']);\r\n echo 'var $TS_VCSC_Lightbox_UseColor = ' . \t\t\t\t\t(((array_key_exists('usecolor', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['usecolor'] : $this->TS_VCSC_Lightbox_Setting_Defaults['usecolor']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['UseColor'] = (((array_key_exists('usecolor', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['usecolor'] : $this->TS_VCSC_Lightbox_Setting_Defaults['usecolor']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Overlay = \"' . \t\t\t\t\t((array_key_exists('overlay', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['overlay'] : $this->TS_VCSC_Lightbox_Setting_Defaults['overlay']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Overlay'] = ((array_key_exists('overlay', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['overlay'] : $this->TS_VCSC_Lightbox_Setting_Defaults['overlay']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Background = \"' . \t\t\t\t((array_key_exists('background', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['background'] : $this->TS_VCSC_Lightbox_Setting_Defaults['background']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Background'] = ((array_key_exists('background', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['background'] : $this->TS_VCSC_Lightbox_Setting_Defaults['background']);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Repeat = \"' . \t\t\t\t\t((array_key_exists('repeat', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['repeat'] : $this->TS_VCSC_Lightbox_Setting_Defaults['repeat']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Repeat'] = ((array_key_exists('repeat', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['repeat'] : $this->TS_VCSC_Lightbox_Setting_Defaults['repeat']); \r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Noise = \"' . \t\t\t\t\t((array_key_exists('noise', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['noise'] : $this->TS_VCSC_Lightbox_Setting_Defaults['noise']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Noise'] = ((array_key_exists('noise', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['noise'] : $this->TS_VCSC_Lightbox_Setting_Defaults['noise']); \r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_CORS = ' . \t\t\t\t\t\t(((array_key_exists('cors', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['cors'] : $this->TS_VCSC_Lightbox_Setting_Defaults['cors']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['CORS'] = (((array_key_exists('cors', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['cors'] : $this->TS_VCSC_Lightbox_Setting_Defaults['cors']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Tapping = ' . \t\t\t\t\t(((array_key_exists('tapping', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['tapping'] : $this->TS_VCSC_Lightbox_Setting_Defaults['tapping']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Tapping'] = (((array_key_exists('tapping', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['tapping'] : $this->TS_VCSC_Lightbox_Setting_Defaults['tapping']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_ScrollBlock = \"' . \t\t\t\t((array_key_exists('scrollblock', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['scrollblock'] : $this->TS_VCSC_Lightbox_Setting_Defaults['scrollblock']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['ScrollBlock'] = ((array_key_exists('scrollblock', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['scrollblock'] : $this->TS_VCSC_Lightbox_Setting_Defaults['scrollblock']);\r\n echo 'var $TS_VCSC_Lightbox_Protection = \"' . \t\t\t\t((array_key_exists('protection', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['protection'] : $this->TS_VCSC_Lightbox_Setting_Defaults['protection']) . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Protection'] = ((array_key_exists('protection', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['protection'] : $this->TS_VCSC_Lightbox_Setting_Defaults['protection']);\r\n echo 'var $TS_VCSC_Lightbox_HistoryClose = ' .\t\t\t\t(((array_key_exists('historyclose', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['historyclose'] : $this->TS_VCSC_Lightbox_Setting_Defaults['historyclose']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['HistoryClose'] = (((array_key_exists('historyclose', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['historyclose'] : $this->TS_VCSC_Lightbox_Setting_Defaults['historyclose']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_CustomScroll = ' .\t\t\t\t(((array_key_exists('customscroll', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['customscroll'] : $this->TS_VCSC_Lightbox_Setting_Defaults['customscroll']) == 1 ? 'true' : 'false') . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['CustomScroll'] = (((array_key_exists('customscroll', $this->TS_VCSC_LightboxGlobalSettings)) ? $this->TS_VCSC_LightboxGlobalSettings['customscroll'] : $this->TS_VCSC_Lightbox_Setting_Defaults['customscroll']) == 1 ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_HomeURL = \"' . \t\t\t\t\tget_home_url() . '\";';\r\n $TS_VCSC_VariablesOutput['Lightbox']['HomeURL'] = get_home_url();\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_LastScroll = 0;';\r\n $TS_VCSC_VariablesOutput['Lightbox']['LastScroll'] = 0;\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Showing = false;';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Showing'] = false;\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_PrettyPhoto = ' . \t\t\t\t$this->TS_VCSC_UseLightboxPrettyPhoto . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['PrettyPhoto'] = ((($this->TS_VCSC_UseLightboxPrettyPhoto == \"true\") || ($this->TS_VCSC_UseLightboxPrettyPhoto == true)) ? true : false);\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_AttachAllOther = ' .\t\t\t$this->TS_VCSC_UseLightboxAttachAllOther . ';';\r\n $TS_VCSC_VariablesOutput['Lightbox']['AttachAllOther'] = ((($this->TS_VCSC_UseLightboxAttachAllOther == \"true\") || ($this->TS_VCSC_UseLightboxAttachAllOther == true)) ? true : false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo 'var $TS_VCSC_Lightbox_Activated = false;';\r\n $TS_VCSC_VariablesOutput['Lightbox']['Activated'] = false;\r\n\t\t\t\t} \r\n\t\t\t\t// Hammer Version Setting\r\n\t\t\t\techo 'var $TS_VCSC_Hammer_ReleaseNew = ' . $this->TS_VCSC_LoadFrontEndHammerNew . ';';\r\n $TS_VCSC_VariablesOutput['Other']['HammerReleaseNew'] = ((($this->TS_VCSC_LoadFrontEndHammerNew == \"true\") || ($this->TS_VCSC_LoadFrontEndHammerNew == true)) ? true : false);\r\n\t\t\t\t// Extended Row Effects (Breakpoint)\r\n\t\t\t\tif (get_option('ts_vcsc_extend_settings_additionsRows', 0) == 1) {\r\n\t\t\t\t\techo 'var $TS_VCSC_RowEffects_Breakpoint = ' . \t\t\t\tget_option('ts_vcsc_extend_settings_additionsRowEffectsBreak', '600') . ';';\r\n $TS_VCSC_VariablesOutput['Other']['RowsBreakPoint'] = (int)get_option('ts_vcsc_extend_settings_additionsRowEffectsBreak', '600');\r\n\t\t\t\t}\r\n // AJAX Callback URL\r\n $TS_VCSC_VariablesOutput['Other']['AjaxURL'] = admin_url('admin-ajax.php'); \r\n // Output Data Holder Object (window.krautcomposium) \r\n //echo 'window.krautcomposium = ' . json_encode($TS_VCSC_VariablesOutput) . ';';\r\n\t\t\techo '</script>';\r\n\t\t}",
"function simply_add_custom_general_fields()\n{\n // You can create text, textarea, select, checkbox and custom fields\n global $woocommerce, $post;\n // Custom fields will be created here...\n ?>\n <div class=\"options_group\">\n <p class=\"form-field custom_field_type\">\n <label for=\"custom_field_family_code\"><?php echo __('Family Code', 'p18a'); ?></label>\n <span class=\"wrap\">\n\t\t<?php\n $family_code = get_post_meta($post->ID, 'family_code', true);\n\n echo $family_code;\n\n ?>\n\n </p>\n <p class=\"form-field custom_field_type\">\n <label for=\"custom_field_mpartname\"><?php echo __('Mpartname', 'p18a'); ?></label>\n <span class=\"wrap\">\n\t\t<?php\n\t\t$mpartname = get_post_meta($post->ID, 'mpartname', true);\n\n\t\techo $mpartname;\n\n\t\t?>\n\n </p>\n </div>\n <?php\n}",
"function woo_add_custom_general_fields() {\r\n\t// You can create text, textarea, select, checkbox and custom fields\r\n\r\n\tglobal $woocommerce, $post;\r\n\r\n\techo '<div class=\"options_group\">';\r\n\r\n\t// Custom fields will be created here...\r\n\t?>\r\n\t<p class=\"form-field custom_field_type\">\r\n\t\t<label for=\"custom_field_type\"><?php echo __( 'Packs', 'p18a' ); ?></label>\r\n\t\t<span class=\"wrap\">\r\n\t\t<?php\r\n\t\t$packs = get_post_meta( $post->ID, 'pri_packs', true );\r\n\t\tif(!empty($packs)){\r\n\t\t\tforeach($packs as $pack){\r\n\t\t\t\techo $pack['PACKNAME'].' '.$pack['PACKQUANT'].'<br>';\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t_e('There are no packs for this product','p18a');\r\n\t\t}\r\n\r\n\r\n\t\t?>\r\n\t</span>\r\n\r\n\t</p>\r\n\t<?php\r\n\r\n\techo '</div>';\r\n\r\n}",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }",
"public function config()\n {\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*'), null, 'ORDER BY id');\n $out = array();\n foreach ($rows as $i => $row) {\n $fields = new Tempcode();\n $hidden = new Tempcode();\n $fields->attach($this->get_fields('_' . strval($i), get_translated_text($row['c_title']), get_translated_text($row['c_description']), $row['c_enabled'], $row['c_cost'], $row['c_one_per_member'], get_translated_text($row['c_mail_subject']), get_translated_text($row['c_mail_body'])));\n $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('_GUID' => '01362c21b40d7905b76ee6134198a128', 'TITLE' => do_lang_tempcode('ACTIONS'))));\n $fields->attach(form_input_tick(do_lang_tempcode('DELETE'), do_lang_tempcode('DESCRIPTION_DELETE'), 'delete_custom_' . strval($i), false));\n $hidden->attach(form_input_hidden('custom_' . strval($i), strval($row['id'])));\n $out[] = array($fields, $hidden, do_lang_tempcode('_EDIT_CUSTOM_PRODUCT', escape_html(get_translated_text($row['c_title']))));\n }\n\n return array($out, do_lang_tempcode('ADD_NEW_CUSTOM_PRODUCT'), $this->get_fields(), do_lang_tempcode('CUSTOM_PRODUCT_DESCRIPTION'));\n }",
"public static function variables(): array\n {\n return [\n Variable::make('id', __('Article Id')),\n\n Variable::make('name', __('Article Name')),\n\n Variable::make('summary', __('Article Summary')),\n\n Variable::make('url', __('Article URL')),\n\n Variable::make('hits', __('Article Hits')),\n\n Variable::make('creation_date', __('Article Creation Date')),\n\n Variable::make('last_update', __('Article Update Date')),\n\n Variable::make('author', __('Article Author')),\n\n Variable::make('image.templateName', __(\n 'Image with the required template (example: image.common-main)'\n )),\n ];\n }",
"public function provideVariables()\n {\n return [\n 'first test' => [\n 'variables' => [\n 'var1' => 'val1',\n 'var2' => 'val2',\n 'var3' => 'val3',\n ],\n ]\n ];\n }",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName() . '[]';\n\n $this->vars['model'] = $this->model;\n $this->vars['subscribers'] = Subscriber::all()->lists('count', 'id');\n if (!empty($this->getLoadValue())) {\n $this->vars['value'] = $this->getLoadValue();\n } else {\n $this->vars['value'] = [];\n }\n\n }",
"public function type_vars( ){\n\t\t\n\t\tglobal $disabled_settings;\n\t\t$alt = false;\n\t\tif ( is_array( $disabled_settings ) )\n\t\t\tif( !empty( $disabled_settings['typography'] ) )\n\t\t\t\t$alt = true;\n\t\t\n\t\t$vars = array(\n\t\t\t'plBaseFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_primary', 'stack'), \n\t\t\t'plBaseWeight'\t\t=> pl_type_el('type_primary', 'weight'), \n\t\t\t'plAltFont'\t\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_secondary', 'stack'), \n\t\t\t'plAltWeight'\t\t=> pl_type_el('type_secondary', 'weight'), \n\t\t\t'plHeaderFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_headers', 'stack'), \n\t\t\t'plHeaderWeight'\t=> pl_type_el('type_headers', 'weight'),\n\t\t);\n\t\treturn $vars;\n\t}",
"public function addComponentsVariable( $args)\n {\n $session = new Session();\n $publicKey = $this->config::publicKey();\n $token = $args->getPage()->getCart()->getToken();\n\n $salesChannelContext = $args->getSalesChannelContext()->getContext();\n $context = $args->getSalesChannelContext();\n \n // Get cko context\n $ckoContext = $this->getCkoContext($token);\n\n $apmData = $this->getApmData($ckoContext);\n\n if($this->merchantService->isGPayEnabled()) {\n array_push($apmData->apmName, 'gpay');\n\n $googlePayData = $this->getGooglePayData('checkout', $context, $args);\n }\n\n // check if save card is available in context\n // and save in session, this will be used when payment failed\n $isSaveCard = in_array('id', $apmData->apmName);\n $session->set('id', $isSaveCard);\n\n $sepaCreditorId = isset($apmData->sepaCreditor['id']) ? $apmData->sepaCreditor['id'] : null;\n $session->set('cko_sepa_creditor_id', $sepaCreditorId);\n\n $customerInfo = $context->getCustomer()->getActiveBillingAddress();\n $name = $customerInfo->getFirstName().\" \".$customerInfo->getLastName();\n $billingAddress = $this->setCutomerInfo($customerInfo);\n $isLoggedIn = $context->getCustomer()->getGuest() == true ? false : true;\n $customField = $context->getCustomer()->getCustomFields();\n \n $args->getPage()->assign(\n [\n 'ckoPublicKey' => $publicKey,\n 'ckoContextId' => $ckoContext['id'],\n 'name' => $name,\n 'billingAddress' => json_encode($billingAddress),\n 'isLoggedIn' => $isLoggedIn,\n 'ckoPaymentMethodId' => $this->getPaymentMethodId($salesChannelContext),\n 'framesUrl' => Url::CKO_IFRAME_URL,\n 'activeToken' => $this->getPaymentInstrument($context),\n 'isSaveCard' => $isSaveCard,\n 'customerBillingAddress' => $billingAddress,\n 'apms' => $apmData->apmName,\n 'clientToken' => $apmData->clientToken ?? null,\n 'sessionData' => $apmData->sessionData ?? null,\n 'sepaCreditor' => $apmData->sepaCreditor ?? null,\n 'paymentMethodCategory' => $this->getPaymentMethodCategory($apmData->paymentMethodAvailable ?? null) ?? null,\n 'googlePayData' => $googlePayData ?? null,\n 'googlePayEnv' => Url::isLive($publicKey) ? 'PRODUCTION' : 'TEST',\n 'shopwareVersion' => strtok(Versions::getVersion('shopware/core'), '@')\n ]\n );\n }",
"function AdditionalVars ( $cAdditionalVars=null )\n{\n if ( isset($cAdditionalVars) ) {\n // 由於 serialize 物件時 private 變數會在前面加上 \"\\0類別名稱\\0\", 而 protected 變數\n // 則前面加上 \"\\0*\\0\", 因此不可直接用 trim() 會將最前面的 NULL 字元去掉.\n // 而 perl regular expression 的 \"\\s\" 空白字元僅包含 \" \\t\\n\\r\\f\", 不影響 NULL\n $this->_AdditionalVars = is_array($cAdditionalVars)\n ? $cAdditionalVars\n : preg_split('/\\s*,\\s*/',trim($cAdditionalVars,\" \\t\\r\\n\\f\"));\n return true;\n } else {\n return $this->_AdditionalVars;\n }\n}",
"public function item_get_after_vars($module, $node, $single_model, $id, $variables){\n $variables['no_invoice_reduction'] = 16;\n return $variables;\n }",
"public static function get_template_global_variables()\n {\n return [\n 'FoxyStripe' => 'current_foxystripe_setting',\n ];\n }",
"public function init_form_fields() {\n\n $this->form_fields = array(\n 'enabled' => array(\n 'title' => __( 'Enable/Disable', $this->domain ),\n 'type' => 'checkbox',\n 'label' => __( 'Enable Custom Payment', $this->domain ),\n 'default' => 'yes'\n ),\n 'title' => array(\n 'title' => __( 'Title', $this->domain ),\n 'type' => 'text',\n 'description' => __( 'This controls the title which the user sees during checkout.', $this->domain ),\n 'default' => __( 'Cartão de Crédito', $this->domain ),\n 'desc_tip' => true,\n ),\n 'order_status' => array(\n 'title' => __( 'Order Status', $this->domain ),\n 'type' => 'select',\n 'class' => 'wc-enhanced-select',\n 'description' => __( 'Choose whether status you wish after checkout.', $this->domain ),\n 'default' => 'wc-completed',\n 'desc_tip' => true,\n 'options' => wc_get_order_statuses()\n ),\n 'description' => array(\n 'title' => __( 'Description', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Payment method description that the customer will see on your checkout.', $this->domain ),\n 'default' => __('Informação do método de pagamento', $this->domain),\n 'desc_tip' => true,\n ),\n 'instructions' => array(\n 'title' => __( 'Instructions', $this->domain ),\n 'type' => 'textarea',\n 'description' => __( 'Instructions that will be added to the thank you page and emails.', $this->domain ),\n 'default' => '',\n 'desc_tip' => true,\n ),\n );\n }",
"function custom_override_checkout_fields($fields) {\n //billing fields\n $args_billing = array(\n 'first_name' => __('First name','qode'),\n 'last_name' => __('Last name','qode'),\n 'company' => __('Company name','qode'),\n 'address_1' => __('Address','qode'),\n 'email' => __('Email','qode'),\n 'phone' => __('Phone','qode'),\n 'postcode' => __('Postcode / ZIP','qode'),\n 'city' \t => __('Town / City','qode'),\n 'state' \t => __('State','qode')\n );\n \n //shipping fields\n $args_shipping = array(\n 'first_name' => __('First name','qode'),\n 'last_name' => __('Last name','qode'),\n 'company' => __('Company name','qode'),\n 'address_1' => __('Address','qode'),\n 'postcode' => __('Postcode / ZIP','qode'),\n\t\t'city' \t => __('Town / City','qode'),\n 'state' \t => __('State','qode')\n );\n \n //override billing placeholder values\n foreach ($args_billing as $key => $value) {\n $fields[\"billing\"][\"billing_{$key}\"][\"placeholder\"] = $value;\n }\n \n //override shipping placeholder values\n foreach ($args_shipping as $key => $value) {\n $fields[\"shipping\"][\"shipping_{$key}\"][\"placeholder\"] = $value;\n }\n\n return $fields;\n}"
] |
[
"0.7372163",
"0.71588606",
"0.7011692",
"0.67815447",
"0.657785",
"0.6544428",
"0.61889243",
"0.6177271",
"0.57543576",
"0.56145495",
"0.5562694",
"0.555358",
"0.5531509",
"0.5526962",
"0.54036975",
"0.53986245",
"0.5393699",
"0.5387998",
"0.5369916",
"0.5307703",
"0.530044",
"0.5275112",
"0.52350456",
"0.51985055",
"0.51678145",
"0.5153563",
"0.5142314",
"0.51306576",
"0.5100115",
"0.50703514"
] |
0.72038835
|
1
|
OneToMany (owning side) Get fkComprasPublicacaoCompraDiretas
|
public function getFkComprasPublicacaoCompraDiretas()
{
return $this->fkComprasPublicacaoCompraDiretas;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function getFkComprasSolicitacao()\n {\n return $this->fkComprasSolicitacao;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }",
"public function getFkPessoalDependenteCids()\n {\n return $this->fkPessoalDependenteCids;\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function getFkOrganogramaNiveis()\n {\n return $this->fkOrganogramaNiveis;\n }",
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkComprasMapaItemDotacoes()\n {\n return $this->fkComprasMapaItemDotacoes;\n }",
"public function getFkComprasMapaSolicitacao()\n {\n return $this->fkComprasMapaSolicitacao;\n }",
"public function getFkPessoalContratoServidorOcorrencias()\n {\n return $this->fkPessoalContratoServidorOcorrencias;\n }",
"public function getFkOrcamentoDespesas()\n {\n return $this->fkOrcamentoDespesas;\n }",
"public function getFkCalendarioCalendarioDiaCompensados()\n {\n return $this->fkCalendarioCalendarioDiaCompensados;\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function direcciones()\n {\n return $this->hasMany('App\\BolsaEmpleo\\DireccionPostulante', 'postulante_id', 'id');\n }",
"public function getFkPessoalDependente()\n {\n return $this->fkPessoalDependente;\n }",
"public function getFkPessoalCtps()\n {\n return $this->fkPessoalCtps;\n }",
"public function getFkComprasModalidade()\n {\n return $this->fkComprasModalidade;\n }",
"public function getFkTcealPublicacaoRgfs()\n {\n return $this->fkTcealPublicacaoRgfs;\n }",
"public function getFkAlmoxarifadoCatalogoNiveis()\n {\n return $this->fkAlmoxarifadoCatalogoNiveis;\n }",
"public function getFkPatrimonioBemMarcas()\n {\n return $this->fkPatrimonioBemMarcas;\n }",
"public function getFkDividaParcela()\n {\n return $this->fkDividaParcela;\n }",
"public function getFkDividaParcela()\n {\n return $this->fkDividaParcela;\n }",
"public function Compras_Ot()\n {\n return $this->hasMany('App\\Compras_Ot','tipos_compras_id','id');\n }",
"public function getFkImaConfiguracaoBanrisulOrgoes()\n {\n return $this->fkImaConfiguracaoBanrisulOrgoes;\n }",
"public function getFkEconomicoDiasCadastroEconomicos()\n {\n return $this->fkEconomicoDiasCadastroEconomicos;\n }",
"public function getForeignKeys(){\n \n }"
] |
[
"0.6873307",
"0.66151017",
"0.6571709",
"0.6571709",
"0.65573525",
"0.6530886",
"0.6508532",
"0.64831406",
"0.64492583",
"0.64103436",
"0.6403145",
"0.6386631",
"0.6374543",
"0.6325447",
"0.6312396",
"0.62496936",
"0.62475383",
"0.62153554",
"0.6190051",
"0.6187534",
"0.61579674",
"0.614494",
"0.61305255",
"0.6125667",
"0.61197764",
"0.61197764",
"0.6079709",
"0.60782933",
"0.6077352",
"0.6046709"
] |
0.75029445
|
0
|
OneToMany (owning side) Get fkLdoHomologacoes
|
public function getFkLdoHomologacoes()
{
return $this->fkLdoHomologacoes;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getTblLophocphans()\n {\n return $this->hasMany(TblLophocphan::className(), ['mahocphan' => 'mahocphan']);\n }",
"public function getFkLdoLdos()\n {\n return $this->fkLdoLdos;\n }",
"public function getLophp()\n {\n return $this->hasOne(TblLophocphan::className(), ['lophp_id' => 'lophp_id']);\n }",
"public function getFkFolhapagamentoConfiguracaoEmpenhoLlaLotacoes()\n {\n return $this->fkFolhapagamentoConfiguracaoEmpenhoLlaLotacoes;\n }",
"public function lapices(){\n\n return $this->hasMany('App\\lapiz','id_owner', 'id');\n \n }",
"public function getFkPessoalDependente()\n {\n return $this->fkPessoalDependente;\n }",
"public function loaiNho() {\n return $this ->hasMany('App\\Models\\loainho', 'loai_id', 'id'); \n }",
"public function getForeignKeys(){\n \n }",
"public function hijo(){\r\n return $this->hasMany('hijo','escuela_id');\r\n }",
"public function getFkEmpenhoEmpenho()\n {\n return $this->fkEmpenhoEmpenho;\n }",
"public function getFkPessoalDependenteCids()\n {\n return $this->fkPessoalDependenteCids;\n }",
"public function relations()\n {\n return array( \n 'usuarios'=>array(self::BELONGS_TO, 'Usuarios', 'usuarios_id_usuario'),\n 'habilidades'=>array(self::BELONGS_TO, 'Habilidades' , 'habilidades_id_habilidad'),\n );\n }",
"public function vehiculos()\n {\n return $this->HasMany('Apis\\Vehiculo');\n }",
"public function getFkOrganogramaNiveis()\n {\n return $this->fkOrganogramaNiveis;\n }",
"public function letras(){\n return $this->hasMany('trogue\\Entities\\Letra','prestamo_id','id');\n }",
"public function getIDSociete_FK()\n {\n return $this->soc_id_fk;\n }",
"public function get_ville_fk(){ return $this->_ville_fk;}",
"public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getDependentEntities();",
"public function getFk()\n {\n return $this->_fk;\n }",
"protected function other_key()\n {\n return Relationship::foreign($this->model, $this->other);\n }",
"static public function getParentRelationalField(){\n return \"uid_empresa_inferior\";\n }",
"public function getFkFolhapagamentoConfiguracaoEmpenhoLlaLocais()\n {\n return $this->fkFolhapagamentoConfiguracaoEmpenhoLlaLocais;\n }",
"public function idiomas()\n {\n return $this->hasMany('cursos\\Language', 'teacher_id','id');\n }",
"public function getForeignKey();",
"public function getGlJfoDets()\n {\n return $this->hasMany(GlJfoDet::className(), ['account_id' => 'account_id']);\n }",
"public function getFkAlmoxarifadoCatalogoNiveis()\n {\n return $this->fkAlmoxarifadoCatalogoNiveis;\n }",
"public function lista_vehiculos()\n {\n return $this->hasOne('App\\Lista_vehiculo');\n }",
"public function buildRelations()\n\t{\n $this->addRelation('SftOrganismo', 'SftOrganismo', RelationMap::ONE_TO_MANY, array('id' => 'id_pais', ), 'SET NULL', 'CASCADE');\n $this->addRelation('SftPersona', 'SftPersona', RelationMap::ONE_TO_MANY, array('id' => 'id_paisdocidentificacion', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('GenPaisI18n', 'GenPaisI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', 'CASCADE');\n\t}"
] |
[
"0.6444692",
"0.6045428",
"0.60195196",
"0.5999213",
"0.5993136",
"0.5975653",
"0.59726065",
"0.59561056",
"0.5913195",
"0.5892287",
"0.5848755",
"0.5806871",
"0.579552",
"0.5734927",
"0.5723317",
"0.5677549",
"0.5668117",
"0.56341296",
"0.56128335",
"0.56040365",
"0.5603126",
"0.55903363",
"0.55770344",
"0.55164874",
"0.5515616",
"0.55143106",
"0.55140907",
"0.5513642",
"0.5510565",
"0.5484997"
] |
0.7742684
|
0
|
OneToMany (owning side) Add LicitacaoPublicacaoContratoAditivos
|
public function addFkLicitacaoPublicacaoContratoAditivos(\Urbem\CoreBundle\Entity\Licitacao\PublicacaoContratoAditivos $fkLicitacaoPublicacaoContratoAditivos)
{
if (false === $this->fkLicitacaoPublicacaoContratoAditivos->contains($fkLicitacaoPublicacaoContratoAditivos)) {
$fkLicitacaoPublicacaoContratoAditivos->setFkLicitacaoVeiculosPublicidade($this);
$this->fkLicitacaoPublicacaoContratoAditivos->add($fkLicitacaoPublicacaoContratoAditivos);
}
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function peliculas(){\n //retornar tipo de relacion\n return $this->belongsToMany('App\\Pelicula','pelicula_director');\n }",
"public function asignaturas()\n {\n \treturn $this->belongsToMany('App\\Asignatura');\n }",
"public function add()\n {\n $this->loadModel('SiVeriEntregas');\n $this->loadModel('Persons');\n $this->loadModel('SiLideres');\n $this->loadModel('SiPastores');\n $this->loadModel('MaPropiedades');\n //Objeto a llenar\n $verificacion = $this->SiVeriEntregas->newEntity();\n\n //POST que guarda la información agregada al formulario\n if ($this->request->is('post')) {\n $verificacion = $this->SiVeriEntregas->patchEntity($verificacion, $this->request->data);\n\n $verificaciondb = $this->SiVeriEntregas->find('all')->select(['Persona.documento'])\n ->where(['SiVeriEntregas.id_datos_basicos' => $this->request->data['id_datos_basicos'], 'SiVeriEntregas.status_id' => 1])\n ->contain(['Persona'])\n ->toArray();\n\n if (count($verificaciondb) > 0) {\n $this->Flash->error(__('La persona con documento ' . $verificaciondb[0]['Persona']['documento'] . ', ya tiene una verificación'));\n } else {\n $verificacion->id_estado_llamada = 251;\n $verificacion->status_id = 1;\n $verificacion->creator_id = $this->Auth->user()['id'];\n\n if ($this->SiVeriEntregas->save($verificacion)) {\n $this->addEncuesta($verificacion);\n $this->Flash->success(__('La verificación ha sido agregada.'), 'success');\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('No se pudo agregar la verificación.'));\n }\n }\n\n //Listas que se presentan en el formulario\n $lista1[] = array();\n unset($lista1[0]);\n $lista3[] = array();\n unset($lista3[0]);\n $lista4[] = array();\n unset($lista4[0]);\n $lista5[] = array();\n unset($lista5[0]);\n $lista9[] = array();\n\n $personsdb = $this->Persons->find()->select(['id', 'documento', 'nombres', 'apellidos'])\n ->where(['status_id' => 1])\n ->order(['nombres' => 'ASC']);\n foreach ($personsdb as $person) {\n $lista1[$person['id']] = $person['documento'] . ' | ' . $person['nombres'] . ' ' . $person['apellidos'];\n } //Lista de personas a verificar\n \n $lideresgt = $this->SiLideres->find()->select(['SiLideres.id', 'Persons.documento', 'Persons.nombres', 'Persons.apellidos'])\n ->where(['SiLideres.id_nivel' => 207, 'SiLideres.status_id' => 1])\n ->contain(['Persons'])\n ->order(['Persons.nombres' => 'ASC']);\n\n foreach ($lideresgt as $lidergt) {\n $lista2[$lidergt['id']] = $lidergt['person']['documento'] . ' | ' . $lidergt['person']['nombres'] . ' ' . $lidergt['person']['apellidos'];\n } //Lista para Lideres de GT\n\n $lideresdb = $this->SiLideres->find()->select(['SiLideres.id', 'Persons.documento', 'Persons.nombres', 'Persons.apellidos'])\n ->where(['SiLideres.id_nivel' => 209, 'SiLideres.status_id' => 1])\n ->contain(['Persons'])\n ->order(['Persons.nombres' => 'ASC']);\n\n foreach ($lideresdb as $lider) {\n $lista3[$lider['id']] = $lider['person']['documento'] . ' | ' . $lider['person']['nombres'] . ' ' . $lider['person']['apellidos'];\n } //Lista para Lideres de acompañamiento\n\n $pastoresdb = $this->SiPastores->find()->select(['SiPastores.id', 'Persons.documento', 'Persons.nombres', 'Persons.apellidos'])\n ->where(['SiPastores.status_id' => 1])\n ->contain(['Persons'])\n ->order(['Persons.nombres' => 'ASC']);\n\n foreach ($pastoresdb as $pastor) {\n $lista4[$pastor['id']] = $pastor['person']['documento'] . ' | ' . $pastor['person']['nombres'] . ' ' . $pastor['person']['apellidos'];\n } //Lista para pastores\n\n $liderconsolida = $this->SiLideres->find()->select(['SiLideres.id', 'Persons.documento', 'Persons.nombres', 'Persons.apellidos'])\n ->where(['SiLideres.id_nivel' => 1179, 'SiLideres.status_id' => 1])\n ->contain(['Persons'])\n ->order(['Persons.nombres' => 'ASC']);\n\n foreach ($liderconsolida as $liderco) {\n $lista5[$liderco['id']] = $liderco['person']['documento'] . ' | ' . $liderco['person']['nombres'] . ' ' . $liderco['person']['apellidos'];\n } //Lista para lideres de consolidación\n\n $lista6 = $lista1; //Lista para quien lo invito\n $lista7 = $this->properties(219); //Lista para tipo de entrega\n $lista8 = $this->properties(223); //Lista para fase de la entrega \n \n //Parametros que se envian a la vista\n $this->set(compact('verificacion', 'lista1', 'lista2', 'lista3', 'lista4', 'lista5', 'lista6', 'lista7', 'lista8'));\n }",
"public function publicaciones(){\n\t\treturn $this->hasMany('App\\Publicacion', 'Pub_ID_Asp');\n\t}",
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function perfiles(){\n return $this->belongsToMany('App\\Perfil', 'cliente_perfil', 'cliente_id', 'perfil_id' );\n }",
"function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function patrocinadores()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Patrocinador', 'proyecto_patrocinador','proyecto_id');\n\t}",
"public function provincias()\n {\n return $this->belongsToMany(Provincia::class,'projecto__provincias__distritos');\n }",
"public function educacion_distancia(){\n\t\treturn $this->hasOne('App\\EducacionDistancia', 'EDi_ID_Asp');\n\t}",
"public function comentarios(){\n return $this->hasMany('App\\Comentario');\n }",
"public function concessionaires(){\n return $this->hasMany('App\\Concessionaire');\n }",
"public function acudientes(){\n return $this->belongsToMany('App\\Acudiente');\n }",
"public function addFkLicitacaoPublicacaoRescisaoContratos(\\Urbem\\CoreBundle\\Entity\\Licitacao\\PublicacaoRescisaoContrato $fkLicitacaoPublicacaoRescisaoContrato)\n {\n if (false === $this->fkLicitacaoPublicacaoRescisaoContratos->contains($fkLicitacaoPublicacaoRescisaoContrato)) {\n $fkLicitacaoPublicacaoRescisaoContrato->setFkLicitacaoVeiculosPublicidade($this);\n $this->fkLicitacaoPublicacaoRescisaoContratos->add($fkLicitacaoPublicacaoRescisaoContrato);\n }\n \n return $this;\n }",
"public function buildRelations()\n {\n $this->addRelation('Contrarecibo', 'Contrarecibo', RelationMap::MANY_TO_ONE, array('idcontrarecibo' => 'idcontrarecibo', ), 'CASCADE', 'CASCADE');\n }",
"function addRelacion($numero_de_socio = FALLBACK_CLAVE_DE_PERSONA, $tipo_de_relacion = DEFAULT_TIPO_RELACION, $consanguinidad = DEFAULT_TIPO_CONSANGUINIDAD,\n\t\t\t$depende = 0, $observaciones = \"\", $monto_relacionado = 0, $porcentaje_relacionado = 1, $fecha_de_alta = false, $documento = false){\n\t\t$xSocRel\t\t= new cSocio($numero_de_socio);\n\t\t$xSocRel->init();\n\t\t$DSocR\t\t\t\t= $xSocRel->getDatosInArray();\n\t\t$documento \t\t\t= ($documento == false) ? DEFAULT_CREDITO : $documento;\n\t\t$nombres \t\t\t= $xSocRel->getNombre();\n\t\t$apellido_paterno\t= $xSocRel->getApellidoPaterno();\n\t\t$apellido_materno \t= $xSocRel->getApellidoMaterno();\n\t\t$domicilio \t\t\t= $xSocRel->getDomicilio();\n\t\t$DTel\t\t\t\t= $xSocRel->getTelefonos();\n\t\t$telefono_fijo \t\t= (isset($DTel[1])) ? $DTel[1] : 0;\n\t\t$telefono_movil \t= (isset($DTel[2])) ? $DTel[2] : 0;\n\t\t$fecha_de_nacimiento = $xSocRel->getFechaDeNacimiento();\n\t\t$curp \t\t\t\t= $xSocRel->getCURP();\n\t\t$DOcup\t\t\t\t= $xSocRel->getOActividadEconomica();\n\t\t$monto_relacionado\t= setNoMenorQueCero($monto_relacionado);// ( !isset($monto_relacionado) OR $monto_relacionado === false ) ? 0 : $monto_relacionado;\n\t\t$ocupacion \t\t\t= ($DOcup == null) ? \"DESCONOCIDO\" : $DOcup->getPuesto();\n\t\n\t\t$socio_relacionado\t= $this->mPersona;\n\t\t$sucursal\t\t\t= getSucursal();\n\t\t$eacp\t\t\t\t= EACP_CLAVE;\n\t\t$fecha_de_alta\t\t= ( $fecha_de_alta == false ) ? fechasys() : $fecha_de_alta;\n\t\t$iduser\t\t\t\t= getUsuarioActual();\n\t\t$estatus\t\t\t= 10;\n\t\t$depende\t\t\t= setNoMenorQueCero($depende);\n\t\t$this->mClaveDePersona\t= $numero_de_socio;\n\t\t//Sentencia Sql\n\t\t$sql = \"INSERT INTO socios_relaciones(socio_relacionado, credito_relacionado, tipo_relacion,\n\t\tnumero_socio, nombres, apellido_paterno, apellido_materno, domicilio_completo,\n\t\ttelefono_residencia, telefono_movil, fecha_nacimiento, monto_relacionado,\n\t\tporcentaje_relacionado, fecha_alta, curp, observaciones, idusuario,\n\t\tconsanguinidad, estatus, dependiente, codigo, ocupacion, sucursal, eacp)\n\t\tVALUES ($socio_relacionado, $documento, $tipo_de_relacion, $numero_de_socio, '$nombres', '$apellido_paterno', '$apellido_materno',\n\t\t'$domicilio', '$telefono_fijo', '$telefono_movil', '$fecha_de_nacimiento', '$monto_relacionado', $porcentaje_relacionado,\n\t\t'$fecha_de_alta', '$curp', '$observaciones', $iduser, $consanguinidad,\n\t\t$estatus, $depende, $socio_relacionado, '$ocupacion', '$sucursal', '$eacp')\n\t\t\";\n\t\t//agregar relacion inversa\n\t\t// Envio Sql\n\t\t$res\t\t= my_query($sql);\n\t\t$sucess\t\t= $res[SYS_ESTADO];\n\t\tif($sucess == true){\n\t\t\t//agregar modificaciones de Grupo\n\t\t\tswitch ($tipo_de_relacion){\n\t\t\t\tcase GRUPO_CLAVE_INTEGRANTE:\n\t\t\t\t\t$xPer\t= new cSocio($numero_de_socio);\n\t\t\t\t\t$xPer->setUpdate( array(\"grupo_solidario\" => \"$socio_relacionado\") );\n\t\t\t\t\tbreak;\n\t\t\t\tcase GRUPO_CLAVE_PRESIDENTA:\n\t\t\t\t\t$xGr\t= new cGrupo($socio_relacionado);\n\t\t\t\t\t$xGr->setUpdate( array(\"representante_numerosocio\" => \"$numero_de_socio\",\n\t\t\t\t\t\t\t\"representante_nombrecompleto\" => \"$apellido_paterno $apellido_materno $nombres\") );\n\t\t\t\t\t$xPer\t= new cSocio($numero_de_socio);\n\t\t\t\t\t$xPer->setUpdate( array(\"grupo_solidario\" => \"$socio_relacionado\") );\n\t\t\t\t\tbreak;\n\t\t\t\tcase GRUPO_CLAVE_VOCAL:\n\t\t\t\t\t$xGr\t= new cGrupo($socio_relacionado);\n\t\t\t\t\t$xGr->setUpdate( array(\"vocalvigilancia_numerosocio\" => \"$numero_de_socio\",\n\t\t\t\t\t\t\t\"vocalvigilancia_nombrecompleto\" => \"$apellido_paterno $apellido_materno $nombres\") );\n\t\t\t\t\t$xPer\t= new cSocio($numero_de_socio);\n\t\t\t\t\t$xPer->setUpdate( array(\"grupo_solidario\" => \"$socio_relacionado\") );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//Agregar relación Inversa\n\t\t} else {\n\t\t\t$this->mMessages\t.= \"ERROR\\tError al guardar la relacion\\r\\n\";\n\t\t}\n\t\treturn $sucess;\n\t}",
"public function peliculas(){\n // Retornar tipo de relacion\n return $this->hasMany('App\\Pelicula');\n }",
"public function compras(){\n return $this->hasMany('App\\CompraInsumo');\n }",
"public function addPerfilAction() {\n $perfil= new Perfiles();\n $perfil->setIdperfilUsuario(\"Sec\");\n $perfil->setNombrePerfil(\"Secretaria\");\n $perfil->setDescripcionPerfil(\"Perfil Agregado desde UsuariosController\");\n \n $em=$this->getDoctrine()->getEntityManager();\n $em->persist($perfil);\n $flush=$em->flush();\n \n if($flush!=null){echo \"El perfil no se ha creado correctamente\";}\n else{echo \"Perfil Creado\";}\n \n die();\n }",
"public function produtos() \n \t{\n \t\treturn $this->belongsToMany(Produto::class);\n \t}",
"public function ediciones()\n {\n return $this->hasMany('App\\Edicion');\n }",
"public function canalesAdquisicion()\n {\n return $this->belongsToMany('App\\CanalAdquisicion', 'clientes_canales_adquisicion', 'id_cliente', 'id_canal_adquisicion');\n }",
"public function licencias()\n \t\t{\n \t\t\treturn $this->hasMany(Licencia::class);\n \t\t}",
"function insertarObligacionCompleta()\n {\n $this->objFunc = $this->create('MODObligacionPago');\n if ($this->objParam->insertar('id_obligacion_pago')) {\n $this->res = $this->objFunc->insertarObligacionCompleta($this->objParam);\n } else {\n //TODO .. trabajar en la edicion\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }",
"function alta_inventario(){\n\t\t\n\t\t$u= new Pr_factura();\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresaid'];\n\t\t$u->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$u->fecha_captura=date(\"Y-m-d H:i:s\");\n\t\t$u->fecha=date(\"Y-m-d H:i:s\");\n\t\t$u->cproveedores_id=1;\n $u->fecha_pago=date(\"Y-m-d H:i:s\");\n $u->ctipo_factura_id=2;\n\t\t$fecha=explode(\" \", $_POST['fecha']);\n\t\t$u->fecha=$fecha[2].\"/\".$fecha[1].\"/\".$fecha[0];\n\t\tunset($_POST['fecha']);\n\t\tunset($_POST['tipo_entrada']);\n\t\t$related = $u->from_array($_POST);\n\t\t// save with the related objects\n\t\t\n\t\tif($u->save($related)){\n //Dar de alta el lote si el proveedor no es el inicial\n if($u->cproveedores_id>0){\n $l=new Lote();\n $l->fecha_recepcion=$u->fecha;\n $l->espacio_fisico_inicial_id=$u->espacios_fisicos_id;\n $l->pr_factura_id=$u->id;\n $l->save(); \n $u->lote_id=$l->id;\n $u->save();\n }\n }\n\t\t\techo \"<input type='hidden' name='id' id='id' value='$u->id'>\";\n \n\t}",
"public function addFkLicitacaoPublicacaoContratos(\\Urbem\\CoreBundle\\Entity\\Licitacao\\PublicacaoContrato $fkLicitacaoPublicacaoContrato)\n {\n if (false === $this->fkLicitacaoPublicacaoContratos->contains($fkLicitacaoPublicacaoContrato)) {\n $fkLicitacaoPublicacaoContrato->setFkLicitacaoVeiculosPublicidade($this);\n $this->fkLicitacaoPublicacaoContratos->add($fkLicitacaoPublicacaoContrato);\n }\n \n return $this;\n }",
"public function valide()\n {\n return $this->hasMany('App\\Models\\Publication','departement_pub','user_id');\n }",
"public function vehiculos()\n {\n return $this->HasMany('Apis\\Vehiculo');\n }",
"public function ajouter() {\n $this->loadView('ajouter', 'content');\n $arr = $this->em->selectAll('client');\n $optionsClient = '';\n foreach ($arr as $entity) {\n $optionsClient .= '<option value=\"' . $entity->getId() . '\">' . $entity->getNomFamille() . '</option>';\n }\n $this->loadHtml($optionsClient, 'clients');\n $arr = $this->em->selectAll('compteur');\n $optionsCompteur = '';\n foreach ($arr as $entity) {\n $optionsCompteur .= '<option value=\"' . $entity->getId() . '\">' . $entity->getNumero() . '</option>';\n }\n $this->loadHtml($optionsCompteur, 'compteurs');\n if(isset($this->post->numero)){\n $abonnement = new Abonnement($this->post);\n $this->em->save($abonnement);\n $this->handleStatus('Abonnement ajouté avec succès.');\n }\n }"
] |
[
"0.6401228",
"0.61063313",
"0.6063442",
"0.5926853",
"0.5885718",
"0.5819691",
"0.58110464",
"0.57663995",
"0.57663614",
"0.5763162",
"0.5748688",
"0.57470995",
"0.5743613",
"0.57428455",
"0.57367295",
"0.5732899",
"0.5724927",
"0.57095134",
"0.56961644",
"0.5689992",
"0.56805605",
"0.56751055",
"0.5661553",
"0.5660866",
"0.5643567",
"0.5640201",
"0.5638852",
"0.5637791",
"0.5621701",
"0.5619193"
] |
0.61535555
|
1
|
OneToMany (owning side) Get fkLicitacaoPublicacaoContratoAditivos
|
public function getFkLicitacaoPublicacaoContratoAditivos()
{
return $this->fkLicitacaoPublicacaoContratoAditivos;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }",
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }",
"public function licencias()\n \t\t{\n \t\t\treturn $this->hasMany(Licencia::class);\n \t\t}",
"public function getFkLicitacaoLicitacao()\n {\n return $this->fkLicitacaoLicitacao;\n }",
"public function getFkLicitacaoLicitacoes()\n {\n return $this->fkLicitacaoLicitacoes;\n }",
"public function getFkLicitacaoPublicacaoAtas()\n {\n return $this->fkLicitacaoPublicacaoAtas;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkTcemgContratoAditivos()\n {\n return $this->fkTcemgContratoAditivos;\n }",
"public function getFkLicitacaoConvenio()\n {\n return $this->fkLicitacaoConvenio;\n }",
"public function getFkEconomicoLicencaDiversa()\n {\n return $this->fkEconomicoLicencaDiversa;\n }",
"public function perfiles(){\n return $this->belongsToMany('App\\Perfil', 'cliente_perfil', 'cliente_id', 'perfil_id' );\n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkLicitacaoRescisaoContrato()\n {\n return $this->fkLicitacaoRescisaoContrato;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getFkLicitacaoTipoVeiculosPublicidade()\n {\n return $this->fkLicitacaoTipoVeiculosPublicidade;\n }",
"public function getFkPessoalContratoServidorOcorrencias()\n {\n return $this->fkPessoalContratoServidorOcorrencias;\n }",
"public function libros()\n {\n return $this->hasMany('App\\Modelos\\Libro',\n 'id_publicador', 'id_usuario');\n }",
"public function acceso_procesamiento_datos(){\n\t\treturn $this->hasMany('App\\AccesoProcesamientoDatos', 'PDa_ID_Asp');\n\t}",
"public function addFkLicitacaoPublicacaoContratoAditivos(\\Urbem\\CoreBundle\\Entity\\Licitacao\\PublicacaoContratoAditivos $fkLicitacaoPublicacaoContratoAditivos)\n {\n if (false === $this->fkLicitacaoPublicacaoContratoAditivos->contains($fkLicitacaoPublicacaoContratoAditivos)) {\n $fkLicitacaoPublicacaoContratoAditivos->setFkLicitacaoVeiculosPublicidade($this);\n $this->fkLicitacaoPublicacaoContratoAditivos->add($fkLicitacaoPublicacaoContratoAditivos);\n }\n \n return $this;\n }",
"public function publicaciones(){\n\t\treturn $this->hasMany('App\\Publicacion', 'Pub_ID_Asp');\n\t}",
"public function getVotosComentarios()\n {\n return $this->hasMany(VotoComentario::className(), ['usuario_id' => 'id'])->inverseOf('usuario');\n }",
"public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function provincias()\n {\n return $this->belongsToMany(Provincia::class,'projecto__provincias__distritos');\n }",
"public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }"
] |
[
"0.7433855",
"0.7022171",
"0.6997039",
"0.68176377",
"0.6771484",
"0.67386645",
"0.67299914",
"0.6729561",
"0.6597312",
"0.6502317",
"0.64982605",
"0.64982605",
"0.6493722",
"0.6437753",
"0.64362353",
"0.6403966",
"0.63430136",
"0.62967414",
"0.62826645",
"0.62731147",
"0.62047774",
"0.61746633",
"0.61695087",
"0.61639214",
"0.61219025",
"0.61206335",
"0.6111638",
"0.61034584",
"0.6103015",
"0.6091823"
] |
0.77627426
|
0
|
OneToMany (owning side) Get fkLicitacaoPublicacaoRescisaoContratos
|
public function getFkLicitacaoPublicacaoRescisaoContratos()
{
return $this->fkLicitacaoPublicacaoRescisaoContratos;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function getFkLicitacaoRescisaoContrato()\n {\n return $this->fkLicitacaoRescisaoContrato;\n }",
"public function getFkLicitacaoLicitacoes()\n {\n return $this->fkLicitacaoLicitacoes;\n }",
"public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }",
"public function licencias()\n \t\t{\n \t\t\treturn $this->hasMany(Licencia::class);\n \t\t}",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function getFkLicitacaoLicitacao()\n {\n return $this->fkLicitacaoLicitacao;\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function getFkLicitacaoConvenio()\n {\n return $this->fkLicitacaoConvenio;\n }",
"public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkPessoalContratoServidorOcorrencias()\n {\n return $this->fkPessoalContratoServidorOcorrencias;\n }",
"public function getFkEconomicoLicencaDiversa()\n {\n return $this->fkEconomicoLicencaDiversa;\n }",
"public function getFkComprasSolicitacao()\n {\n return $this->fkComprasSolicitacao;\n }",
"public function getFkEconomicoResponsavel()\n {\n return $this->fkEconomicoResponsavel;\n }",
"public function recomendaciones(){\n\t\treturn $this->hasMany('App\\Recomendacion', 'Rec_ID_Asp');\n\t}",
"public function getFkLicitacaoTipoVeiculosPublicidade()\n {\n return $this->fkLicitacaoTipoVeiculosPublicidade;\n }",
"public function getFkPessoalCausaRescisao()\n {\n return $this->fkPessoalCausaRescisao;\n }",
"public function getFkEconomicoResponsavelTecnicos()\n {\n return $this->fkEconomicoResponsavelTecnicos;\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }",
"public function getFkConcursoCandidato()\n {\n return $this->fkConcursoCandidato;\n }",
"public function concessionaires()\n {\n return $this->hasMany('App\\Models\\Concessionaire');\n }",
"public function getFkEconomicoLicencaDiasSemanas()\n {\n return $this->fkEconomicoLicencaDiasSemanas;\n }"
] |
[
"0.7624612",
"0.7299571",
"0.7190168",
"0.7183094",
"0.71443367",
"0.7138111",
"0.7122052",
"0.711426",
"0.7057137",
"0.69024575",
"0.6782046",
"0.6693293",
"0.66490483",
"0.66490483",
"0.66465735",
"0.65075743",
"0.64704466",
"0.64166963",
"0.62956536",
"0.6283881",
"0.62796146",
"0.62778324",
"0.6249894",
"0.6239581",
"0.6239581",
"0.62257856",
"0.62147355",
"0.6201181",
"0.6191609",
"0.61493003"
] |
0.79079366
|
0
|
OneToMany (owning side) Get fkLicitacaoPublicacaoConvenios
|
public function getFkLicitacaoPublicacaoConvenios()
{
return $this->fkLicitacaoPublicacaoConvenios;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"public function getFkLicitacaoConvenio()\n {\n return $this->fkLicitacaoConvenio;\n }",
"function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function licencias()\n \t\t{\n \t\t\treturn $this->hasMany(Licencia::class);\n \t\t}",
"public function getFkLicitacaoLicitacao()\n {\n return $this->fkLicitacaoLicitacao;\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function getFkLicitacaoLicitacoes()\n {\n return $this->fkLicitacaoLicitacoes;\n }",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"public function getFkEconomicoLicencaDiversa()\n {\n return $this->fkEconomicoLicencaDiversa;\n }",
"public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoTipoVeiculosPublicidade()\n {\n return $this->fkLicitacaoTipoVeiculosPublicidade;\n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkLicitacaoRescisaoContrato()\n {\n return $this->fkLicitacaoRescisaoContrato;\n }",
"public function provincias()\n {\n return $this->belongsToMany(Provincia::class,'projecto__provincias__distritos');\n }",
"public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }",
"public function getFkEconomicoLicencaDiasSemanas()\n {\n return $this->fkEconomicoLicencaDiasSemanas;\n }",
"public function getFkEconomicoResponsavel()\n {\n return $this->fkEconomicoResponsavel;\n }",
"public function getFkComprasSolicitacao()\n {\n return $this->fkComprasSolicitacao;\n }",
"public function getFkLicitacaoPublicacaoAtas()\n {\n return $this->fkLicitacaoPublicacaoAtas;\n }",
"public function getFkConcursoCandidato()\n {\n return $this->fkConcursoCandidato;\n }",
"public function proyecto()\n {\n return $this->belongsTo('App\\Proyectos', 'proyecto_fk_rp', 'id_proyecto');\n }",
"public function proveedor(){\n return $this->belongsTo('App\\Proveedor', 'proveedor_legajo', 'tecnico_legajo');\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getFkTcealPublicacaoRgfs()\n {\n return $this->fkTcealPublicacaoRgfs;\n }",
"public function getFkImaConfiguracaoConvenioBanrisul()\n {\n return $this->fkImaConfiguracaoConvenioBanrisul;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getFkPessoalContratoServidorOcorrencias()\n {\n return $this->fkPessoalContratoServidorOcorrencias;\n }"
] |
[
"0.7445839",
"0.70992905",
"0.70976007",
"0.7041503",
"0.70331943",
"0.70116466",
"0.69830894",
"0.68864053",
"0.6795639",
"0.6792301",
"0.6764861",
"0.66570127",
"0.66570127",
"0.654606",
"0.63420695",
"0.63056684",
"0.6272771",
"0.6272011",
"0.6235458",
"0.62058604",
"0.61893886",
"0.61648726",
"0.61228245",
"0.61138964",
"0.61138636",
"0.6100674",
"0.6093421",
"0.6082392",
"0.60701126",
"0.6031317"
] |
0.77271265
|
0
|
OneToMany (owning side) Get fkLicitacaoPublicacaoEditais
|
public function getFkLicitacaoPublicacaoEditais()
{
return $this->fkLicitacaoPublicacaoEditais;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"public function getFkLicitacaoLicitacao()\n {\n return $this->fkLicitacaoLicitacao;\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function getFkLicitacaoLicitacoes()\n {\n return $this->fkLicitacaoLicitacoes;\n }",
"public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }",
"function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function licencias()\n \t\t{\n \t\t\treturn $this->hasMany(Licencia::class);\n \t\t}",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"public function getFkLicitacaoConvenio()\n {\n return $this->fkLicitacaoConvenio;\n }",
"public function getFkLicitacaoTipoVeiculosPublicidade()\n {\n return $this->fkLicitacaoTipoVeiculosPublicidade;\n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkConcursoEdital()\n {\n return $this->fkConcursoEdital;\n }",
"public function getFkLicitacaoPublicacaoAtas()\n {\n return $this->fkLicitacaoPublicacaoAtas;\n }",
"public function getFkEconomicoLicencaDiversa()\n {\n return $this->fkEconomicoLicencaDiversa;\n }",
"public function getFkLicitacaoRescisaoContrato()\n {\n return $this->fkLicitacaoRescisaoContrato;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasSolicitacao()\n {\n return $this->fkComprasSolicitacao;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getFkEconomicoLicencaDiasSemanas()\n {\n return $this->fkEconomicoLicencaDiasSemanas;\n }",
"public function getFkImobiliarioTipoLicencaDocumentos()\n {\n return $this->fkImobiliarioTipoLicencaDocumentos;\n }",
"public function getFkEconomicoResponsavel()\n {\n return $this->fkEconomicoResponsavel;\n }",
"public function getFkTcealPublicacaoRgfs()\n {\n return $this->fkTcealPublicacaoRgfs;\n }",
"public function getFkOrganogramaNiveis()\n {\n return $this->fkOrganogramaNiveis;\n }",
"public function getFkComprasSolicitacaoItens()\n {\n return $this->fkComprasSolicitacaoItens;\n }"
] |
[
"0.7219703",
"0.696813",
"0.6923095",
"0.6912954",
"0.68926567",
"0.687921",
"0.67362857",
"0.6601461",
"0.6601461",
"0.65992415",
"0.65719175",
"0.6509175",
"0.6472069",
"0.6461166",
"0.6440174",
"0.634259",
"0.62885904",
"0.62793714",
"0.62594944",
"0.62594944",
"0.6070989",
"0.60584724",
"0.60305494",
"0.6027266",
"0.6017686",
"0.5919186",
"0.5899125",
"0.58946365",
"0.58311033",
"0.5818635"
] |
0.7928973
|
0
|
OneToMany (owning side) Get fkPpaPpaPublicacoes
|
public function getFkPpaPpaPublicacoes()
{
return $this->fkPpaPpaPublicacoes;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkPessoalPensao()\n {\n return $this->fkPessoalPensao;\n }",
"public function getFkPpaPpaPrecisao()\n {\n return $this->fkPpaPpaPrecisao;\n }",
"public function getFkPpaPrecisao()\n {\n return $this->fkPpaPrecisao;\n }",
"public function pais(){\n return $this->belongsTo('App\\Models\\Pais');//relaciona provincia con pais\n }",
"public function getFkPpaPpa()\n {\n return $this->fkPpaPpa;\n }",
"public function publicaciones(){\n\t\treturn $this->hasMany('App\\Publicacion', 'Pub_ID_Asp');\n\t}",
"public function partidas()\n {\n \treturn $this->hasMany('App\\Presupuesto_Partida', 'tPresupuesto_idPresupuesto', 'idPresupuesto');\n }",
"public function getPlataforma()\n {\n return $this->hasOne(Plataformas::className(), ['id' => 'plataforma_id'])->inverseOf('copias');\n }",
"public function Parents(){\n return $this->hasOne('padre','membresia_id');\n }",
"public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }",
"public function peliculas(){\n // Retornar tipo de relacion\n return $this->hasMany('App\\Pelicula');\n }",
"public function getPropietario()\n {\n return $this->hasOne(Usuarios::className(), ['id' => 'propietario_id'])->inverseOf('copias');\n }",
"public function pais(){\r\n return $this->belongsTo('pais');\r\n }",
"public function getPublicacion()\n {\n return $this->hasOne(Publicacion::className(), ['id' => 'id_publicacion']);\n }",
"public function provincias()\n {\n return $this->belongsToMany(Provincia::class,'projecto__provincias__distritos');\n }",
"public function pautas()\n {\n return $this->hasMany('App\\Pauta');\n }",
"public function bPelajaran()\n {\n return $this->belongsToMany('App\\Pelajaran');\n }",
"public function getFkPessoalCtps()\n {\n return $this->fkPessoalCtps;\n }",
"public function getForeignKeys(){\n \n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }",
"public function patrocinadores()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Patrocinador', 'proyecto_patrocinador','proyecto_id');\n\t}",
"public function pesanan()\n {\n return $this->hasMany('App\\Pesanan', 'id_pengguna');\n }",
"public function propiedades()\n {\n return $this->hasOne(Propiedades::class, 'id', 'propiedad_id');\n }",
"public function sub_principles(){\n return $this->hasMany(SubPrinciple::class);\n }",
"public function getFkPpaProgramas()\n {\n return $this->fkPpaProgramas;\n }",
"public function pertanyaan(){\n \treturn $this->hasMany('App\\Pertanyaan', 'id_aspek');\n }",
"public function getFkOrganogramaNiveis()\n {\n return $this->fkOrganogramaNiveis;\n }"
] |
[
"0.6623769",
"0.6563858",
"0.65266085",
"0.6478532",
"0.64659935",
"0.6452693",
"0.6345024",
"0.63095677",
"0.6265583",
"0.6232621",
"0.6224327",
"0.6223547",
"0.6204207",
"0.62007666",
"0.61783504",
"0.617561",
"0.6147404",
"0.6139649",
"0.6125806",
"0.6120939",
"0.61208653",
"0.6117982",
"0.6087648",
"0.608306",
"0.60674715",
"0.6066848",
"0.6053854",
"0.6048426",
"0.6040194",
"0.6023495"
] |
0.74998736
|
1
|
OneToMany (owning side) Get fkTcealPublicacaoRreos
|
public function getFkTcealPublicacaoRreos()
{
return $this->fkTcealPublicacaoRreos;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }",
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function getFkPessoalDependente()\n {\n return $this->fkPessoalDependente;\n }",
"public function getFkOrcamentoReceita()\n {\n return $this->fkOrcamentoReceita;\n }",
"public function getFkOrganogramaNiveis()\n {\n return $this->fkOrganogramaNiveis;\n }",
"public function peliculas(){\n // Retornar tipo de relacion\n return $this->hasMany('App\\Pelicula');\n }",
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"public function getFkPessoalContratoServidorOcorrencias()\n {\n return $this->fkPessoalContratoServidorOcorrencias;\n }",
"public function getFkTcealPublicacaoRgfs()\n {\n return $this->fkTcealPublicacaoRgfs;\n }",
"public function postulanteR()\n {\n \treturn $this->belongsTo('App\\Postulante','postulante'); //Id local\n }",
"public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }",
"public function getFkEconomicoResponsavel()\n {\n return $this->fkEconomicoResponsavel;\n }",
"public function getFkPpaPrecisao()\n {\n return $this->fkPpaPrecisao;\n }",
"public function getFkEconomicoResponsavelTecnicos()\n {\n return $this->fkEconomicoResponsavelTecnicos;\n }",
"public function peliculas(){\n //retornar tipo de relacion\n return $this->belongsToMany('App\\Pelicula','pelicula_director');\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkOrcamentoDespesas()\n {\n return $this->fkOrcamentoDespesas;\n }",
"public function getFkPessoalPensao()\n {\n return $this->fkPessoalPensao;\n }",
"public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }",
"public function getFkImaEventoComposicaoRemuneracoes()\n {\n return $this->fkImaEventoComposicaoRemuneracoes;\n }",
"public function getForeignKeys(){\n \n }",
"public function proveedor(){\n return $this->belongsTo('App\\Proveedor', 'proveedor_legajo', 'tecnico_legajo');\n }",
"public function patrocinadores()\n\t{\n\t\treturn $this->belongsToMany('App\\Models\\Patrocinador', 'proyecto_patrocinador','proyecto_id');\n\t}",
"public function libros()\n {\n return $this->hasMany('App\\Modelos\\Libro',\n 'id_publicador', 'id_usuario');\n }",
"public function getFkOrcamentoRecursoDestinacoes()\n {\n return $this->fkOrcamentoRecursoDestinacoes;\n }",
"public function getIDSociete_FK()\n {\n return $this->soc_id_fk;\n }",
"public function remision(){\n\n return $this->hasMany('App\\Models\\Remision', 'id_usuario_paciente', 'id_usuario');\n }"
] |
[
"0.68995374",
"0.67664176",
"0.6553124",
"0.655011",
"0.65257084",
"0.65178055",
"0.6489827",
"0.64811754",
"0.6471935",
"0.64579993",
"0.6422506",
"0.6398829",
"0.63929725",
"0.63823",
"0.6352035",
"0.6341388",
"0.63120204",
"0.6304463",
"0.6304463",
"0.6303621",
"0.62970936",
"0.62940466",
"0.62714213",
"0.62620395",
"0.6242598",
"0.6236564",
"0.6222409",
"0.62105983",
"0.6207003",
"0.6197219"
] |
0.7451274
|
0
|
OneToMany (owning side) Get fkTcealPublicacaoRgfs
|
public function getFkTcealPublicacaoRgfs()
{
return $this->fkTcealPublicacaoRgfs;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getFkOrganogramaNiveis()\n {\n return $this->fkOrganogramaNiveis;\n }",
"public function getForeignKeys(){\n \n }",
"public function getFkPessoalDependente()\n {\n return $this->fkPessoalDependente;\n }",
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function get_groupe_fk(){ return $this->_groupe_fk;}",
"public function getIDSociete_FK()\n {\n return $this->soc_id_fk;\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }",
"public function getFkFrotaEfetivacoes()\n {\n return $this->fkFrotaEfetivacoes;\n }",
"public function getFkTcemgContratos()\n {\n return $this->fkTcemgContratos;\n }",
"public function getFkTcemgContratos()\n {\n return $this->fkTcemgContratos;\n }",
"public function getFkFrotaVeiculo()\n {\n return $this->fkFrotaVeiculo;\n }",
"public function getFkFrotaVeiculo()\n {\n return $this->fkFrotaVeiculo;\n }",
"public function getFkFrotaVeiculo()\n {\n return $this->fkFrotaVeiculo;\n }",
"public function getFkPessoalDependenteCids()\n {\n return $this->fkPessoalDependenteCids;\n }",
"public function getFkPessoalCtps()\n {\n return $this->fkPessoalCtps;\n }",
"public function getFkPessoalPensao()\n {\n return $this->fkPessoalPensao;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasPublicacaoCompraDiretas()\n {\n return $this->fkComprasPublicacaoCompraDiretas;\n }",
"public static function getResolveForeignIdFields();",
"public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }",
"public function getFkComprasSolicitacao()\n {\n return $this->fkComprasSolicitacao;\n }",
"public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }",
"public function getFkOrcamentoDespesas()\n {\n return $this->fkOrcamentoDespesas;\n }",
"public function getFk()\n {\n return $this->_fk;\n }",
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }"
] |
[
"0.68161833",
"0.6751685",
"0.65860075",
"0.65677786",
"0.65513784",
"0.6547837",
"0.64201206",
"0.63888556",
"0.63688266",
"0.6293477",
"0.62801003",
"0.6223434",
"0.6223434",
"0.62098837",
"0.62098837",
"0.62098837",
"0.6196842",
"0.61939186",
"0.61903626",
"0.6181365",
"0.6181365",
"0.61613536",
"0.61514366",
"0.6124636",
"0.61120933",
"0.6108064",
"0.6097996",
"0.60617846",
"0.6060899",
"0.60596097"
] |
0.72343385
|
0
|
OneToMany (owning side) Get fkTcemgContratos
|
public function getFkTcemgContratos()
{
return $this->fkTcemgContratos;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkTcemgContratoAditivos()\n {\n return $this->fkTcemgContratoAditivos;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getForeignKeys(){\n \n }",
"public function getFkConcursoCandidato()\n {\n return $this->fkConcursoCandidato;\n }",
"public function getTipoContrato(){\n\t\t$em= $this->getEntityManager(); \n $dql = 'SELECT tc.id, tc.tipo , tc.abr FROM RRHHBundle:TipoContrato tc ORDER By tc.id ASC ';\n $dql = $em->createQuery($dql); \n return $dql->getResult(); \n\t}",
"public function getConvocados()\n {\n return $this->hasMany(InterConvocados::className(), ['modo_id' => 'id']);\n }",
"public function concessionaires()\n {\n return $this->hasMany('App\\Models\\Concessionaire');\n }",
"public function concessionaires(){\n return $this->hasMany('App\\Concessionaire');\n }",
"public function getFkCseCidadoes()\n {\n return $this->fkCseCidadoes;\n }",
"public function conjuntos(){\n\n return $this->belongsToMany('Conjunto','administrador_conjunto','administrador_id','conjunto_id');\n\n }",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"public function conocimiento_idiomas(){\n\t\treturn $this->hasMany('App\\ConocimientoIdioma', 'Idm_ID_Asp');\n\t}",
"public function getFkConcursoEdital()\n {\n return $this->fkConcursoEdital;\n }",
"public function contrato(){\n return $this->belongsTo('App\\Contrato');\n }",
"public function getFkPessoalDependenteCids()\n {\n return $this->fkPessoalDependenteCids;\n }",
"public function getFkMonetarioConvenios()\n {\n return $this->fkMonetarioConvenios;\n }",
"public function getFkPessoalContratoServidor()\n {\n return $this->fkPessoalContratoServidor;\n }",
"public function getFkPessoalContratoServidor()\n {\n return $this->fkPessoalContratoServidor;\n }",
"public function getFkEconomicoResponsavelTecnicos()\n {\n return $this->fkEconomicoResponsavelTecnicos;\n }",
"public function getIDSociete_FK()\n {\n return $this->soc_id_fk;\n }",
"public function getFkCseCidadao()\n {\n return $this->fkCseCidadao;\n }",
"public function getFkFrotaInfracoes()\n {\n return $this->fkFrotaInfracoes;\n }",
"public function tipoSangre(){\n return $this->belongsTo('App\\Tipo','pk_codsangre');\n }",
"public function getFkConcursoConcursoCargo()\n {\n return $this->fkConcursoConcursoCargo;\n }",
"public function getFk()\n {\n return $this->_fk;\n }",
"public function getForeignKey()\n {\n return 'owner_id';\n }",
"public function getForeignKey();",
"public function getFkPessoalDependente()\n {\n return $this->fkPessoalDependente;\n }",
"public function comentarios(){\n return $this->hasMany('App\\Comentario');\n }",
"public function getFkComprasSolicitacao()\n {\n return $this->fkComprasSolicitacao;\n }"
] |
[
"0.6906631",
"0.67483455",
"0.6736112",
"0.655206",
"0.64882714",
"0.6356678",
"0.6339623",
"0.63311976",
"0.63243306",
"0.6317802",
"0.6300091",
"0.62872046",
"0.6182556",
"0.61797565",
"0.6170625",
"0.6163466",
"0.61557585",
"0.61557585",
"0.6143967",
"0.61040795",
"0.6097857",
"0.60760903",
"0.6068598",
"0.6066925",
"0.60660577",
"0.60643315",
"0.60568243",
"0.6045484",
"0.60263956",
"0.60087645"
] |
0.7632175
|
1
|
OneToMany (owning side) Get fkLicitacaoPublicacaoContratos
|
public function getFkLicitacaoPublicacaoContratos()
{
return $this->fkLicitacaoPublicacaoContratos;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"public function licencias()\n \t\t{\n \t\t\treturn $this->hasMany(Licencia::class);\n \t\t}",
"function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function getFkLicitacaoLicitacao()\n {\n return $this->fkLicitacaoLicitacao;\n }",
"public function getFkLicitacaoLicitacoes()\n {\n return $this->fkLicitacaoLicitacoes;\n }",
"public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }",
"public function getFkLicitacaoConvenio()\n {\n return $this->fkLicitacaoConvenio;\n }",
"public function getFkLicitacaoRescisaoContrato()\n {\n return $this->fkLicitacaoRescisaoContrato;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoTipoVeiculosPublicidade()\n {\n return $this->fkLicitacaoTipoVeiculosPublicidade;\n }",
"public function getFkEconomicoLicencaDiversa()\n {\n return $this->fkEconomicoLicencaDiversa;\n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkPessoalContratoServidorOcorrencias()\n {\n return $this->fkPessoalContratoServidorOcorrencias;\n }",
"public function getFkLicitacaoPublicacaoAtas()\n {\n return $this->fkLicitacaoPublicacaoAtas;\n }",
"public function getFkComprasSolicitacao()\n {\n return $this->fkComprasSolicitacao;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function proveedores()\n {\n return $this->belongsTo(Proveedor::class);\n }",
"public function getFkConcursoCandidato()\n {\n return $this->fkConcursoCandidato;\n }",
"public function getFkEconomicoLicencaDiasSemanas()\n {\n return $this->fkEconomicoLicencaDiasSemanas;\n }",
"public function getFkComprasPublicacaoCompraDiretas()\n {\n return $this->fkComprasPublicacaoCompraDiretas;\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function libros()\n {\n return $this->hasMany('App\\Modelos\\Libro',\n 'id_publicador', 'id_usuario');\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function provincias()\n {\n return $this->belongsToMany(Provincia::class,'projecto__provincias__distritos');\n }",
"public function getFkConcursoEdital()\n {\n return $this->fkConcursoEdital;\n }"
] |
[
"0.75575995",
"0.7459148",
"0.7416407",
"0.71518624",
"0.7083091",
"0.7074746",
"0.7013749",
"0.6993833",
"0.6878965",
"0.6866741",
"0.66600597",
"0.65980184",
"0.65980184",
"0.6582605",
"0.6531634",
"0.6471146",
"0.6417249",
"0.63639194",
"0.62874305",
"0.6255636",
"0.6212882",
"0.62006223",
"0.6150502",
"0.6143496",
"0.6140302",
"0.6112846",
"0.60902345",
"0.60902345",
"0.6087878",
"0.60584855"
] |
0.7926493
|
0
|
OneToMany (owning side) Get fkLicitacaoPublicacaoAtas
|
public function getFkLicitacaoPublicacaoAtas()
{
return $this->fkLicitacaoPublicacaoAtas;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }",
"public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }",
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function licencias()\n \t\t{\n \t\t\treturn $this->hasMany(Licencia::class);\n \t\t}",
"public function getFkLicitacaoLicitacoes()\n {\n return $this->fkLicitacaoLicitacoes;\n }",
"public function getFkLicitacaoLicitacao()\n {\n return $this->fkLicitacaoLicitacao;\n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkLicitacaoTipoVeiculosPublicidade()\n {\n return $this->fkLicitacaoTipoVeiculosPublicidade;\n }",
"public function publicaciones(){\n\t\treturn $this->hasMany('App\\Publicacion', 'Pub_ID_Asp');\n\t}",
"public function getIdpeliculas()\n {\n return $this->hasMany(Pelicula::className(), ['id' => 'idpelicula'])->viaTable('actores_por_pelicula', ['idactor' => 'id']);\n }",
"public function libros()\n {\n return $this->hasMany('App\\Modelos\\Libro',\n 'id_publicador', 'id_usuario');\n }",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"public function getFkEconomicoLicencaDiversa()\n {\n return $this->fkEconomicoLicencaDiversa;\n }",
"public function getFkComprasPublicacaoCompraDiretas()\n {\n return $this->fkComprasPublicacaoCompraDiretas;\n }",
"public function getFkTcealPublicacaoRgfs()\n {\n return $this->fkTcealPublicacaoRgfs;\n }",
"public function asignaturas()\n {\n \treturn $this->belongsToMany('App\\Asignatura');\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }",
"public function getFkOrganogramaNiveis()\n {\n return $this->fkOrganogramaNiveis;\n }",
"public function getFkLicitacaoConvenio()\n {\n return $this->fkLicitacaoConvenio;\n }",
"public function getFkTcmgoProjecaoAtuariais()\n {\n return $this->fkTcmgoProjecaoAtuariais;\n }",
"public function getFkEconomicoLicencaDiasSemanas()\n {\n return $this->fkEconomicoLicencaDiasSemanas;\n }",
"public function partidas()\n {\n \treturn $this->hasMany('App\\Presupuesto_Partida', 'tPresupuesto_idPresupuesto', 'idPresupuesto');\n }",
"public function provincias()\n {\n return $this->belongsToMany(Provincia::class,'projecto__provincias__distritos');\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }"
] |
[
"0.74709696",
"0.72185856",
"0.70855683",
"0.69770736",
"0.6963095",
"0.6949324",
"0.68897396",
"0.67675656",
"0.6602407",
"0.6574031",
"0.6531976",
"0.6285319",
"0.62335634",
"0.6228746",
"0.6211592",
"0.6204246",
"0.6140665",
"0.609113",
"0.60584027",
"0.6049347",
"0.6049347",
"0.6042812",
"0.6035544",
"0.60159516",
"0.6012051",
"0.6011256",
"0.5967036",
"0.59481686",
"0.5911374",
"0.5911374"
] |
0.7556929
|
0
|
OneToMany (owning side) Get fkTcemgContratoAditivos
|
public function getFkTcemgContratoAditivos()
{
return $this->fkTcemgContratoAditivos;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkTcemgContratos()\n {\n return $this->fkTcemgContratos;\n }",
"public function getFkTcemgContratos()\n {\n return $this->fkTcemgContratos;\n }",
"public function getFkTcepeDocumentos()\n {\n return $this->fkTcepeDocumentos;\n }",
"public function getConvocados()\n {\n return $this->hasMany(InterConvocados::className(), ['modo_id' => 'id']);\n }",
"public function conocimiento_idiomas(){\n\t\treturn $this->hasMany('App\\ConocimientoIdioma', 'Idm_ID_Asp');\n\t}",
"public function asignaturas()\n {\n \treturn $this->belongsToMany('App\\Asignatura');\n }",
"public function getDocumentoInternatos()\n {\n return $this->hasMany(DocumentoInternato::className(), ['internato_id' => 'id']);\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function candidatos(): HasMany\n {\n return $this->hasMany(VotosModel::class, 'votacao_id', 'id')\n ->select('votos.candidato_id', 'votos.id as voto_id', 'votos.votacao_id', 'users.id as user_id', 'users.name')\n ->join('users', function($j) {\n return $j->on('votos.candidato_id', '=', 'users.id');\n })->orderBy('users.name', 'ASC');\n }",
"public function getFkAlmoxarifadoCatalogoNiveis()\n {\n return $this->fkAlmoxarifadoCatalogoNiveis;\n }",
"public function getTipoContrato(){\n\t\t$em= $this->getEntityManager(); \n $dql = 'SELECT tc.id, tc.tipo , tc.abr FROM RRHHBundle:TipoContrato tc ORDER By tc.id ASC ';\n $dql = $em->createQuery($dql); \n return $dql->getResult(); \n\t}",
"public function fotos()\n {\n return $this->hasMany(foto::class,'fk_id_producto');\n }",
"public function contrato(){\n return $this->belongsTo('App\\Contrato');\n }",
"public function imagenes(){\n return $this->belongsToMany(Imagen::class);\n }",
"public function conjuntos(){\n\n return $this->belongsToMany('Conjunto','administrador_conjunto','administrador_id','conjunto_id');\n\n }",
"public function perfiles(){\n return $this->belongsToMany('App\\Perfil', 'cliente_perfil', 'cliente_id', 'perfil_id' );\n }",
"public function carpeta(){\n return $this->hasOne('App\\CarpetaAdjuntos','id_carpeta_adjuntos','id_carpeta_adjuntos');\n }",
"public function fichas(){\n return $this->hasMany('App\\Ficha', 'id_representante', 'representante_id');\n }",
"public function getVotos()\n {\n return $this->hasMany(VotoComentario::className(), ['comentario_id' => 'id'])->inverseOf('comentario');\n }",
"public function contato()\n {\n return $this->belongsTo(ClienteContato::class);\n }",
"public function direcciones()\n {\n return $this->hasMany('App\\BolsaEmpleo\\DireccionPostulante', 'postulante_id', 'id');\n }",
"public function getFkConcursoCandidato()\n {\n return $this->fkConcursoCandidato;\n }",
"public function getVotosComentarios()\n {\n return $this->hasMany(VotoComentario::className(), ['usuario_id' => 'id'])->inverseOf('usuario');\n }",
"public function concessionaires(){\n return $this->hasMany('App\\Concessionaire');\n }",
"public function getFkEconomicoResponsavelTecnicos()\n {\n return $this->fkEconomicoResponsavelTecnicos;\n }",
"public function acudientes(){\n return $this->belongsToMany('App\\Acudiente');\n }",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"public function profesor(){\r\n return $this->hasMany('profesor','escuela_id');\r\n }",
"public function tipoSangre(){\n return $this->belongsTo('App\\Tipo','pk_codsangre');\n }",
"public function aviones(){\n\t\t//la relacion es de 1 a muchos: 1 fabricante tiene muchos aviones\n\t\treturn $this->hasMany('App\\Avion');\n\t}"
] |
[
"0.69655466",
"0.69655466",
"0.65203154",
"0.6426103",
"0.63823485",
"0.6339268",
"0.6307423",
"0.6299812",
"0.628181",
"0.62793636",
"0.6266995",
"0.62528646",
"0.62220585",
"0.61941004",
"0.6193028",
"0.6190161",
"0.6175705",
"0.6175628",
"0.6171811",
"0.6166064",
"0.6165269",
"0.61552405",
"0.61423385",
"0.6123258",
"0.6107935",
"0.6104445",
"0.61029124",
"0.61023456",
"0.6093384",
"0.60926604"
] |
0.772905
|
0
|
ManyToOne (inverse side) Get fkLicitacaoTipoVeiculosPublicidade
|
public function getFkLicitacaoTipoVeiculosPublicidade()
{
return $this->fkLicitacaoTipoVeiculosPublicidade;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getFkEconomicoLicencaDiversa()\n {\n return $this->fkEconomicoLicencaDiversa;\n }",
"public function getFkLicitacaoPublicacaoConvenios()\n {\n return $this->fkLicitacaoPublicacaoConvenios;\n }",
"public function getFkLicitacaoLicitacao()\n {\n return $this->fkLicitacaoLicitacao;\n }",
"public function getFkLicitacaoPublicacaoContratos()\n {\n return $this->fkLicitacaoPublicacaoContratos;\n }",
"public function getFkLicitacaoPublicacaoEditais()\n {\n return $this->fkLicitacaoPublicacaoEditais;\n }",
"public function getFkLicitacaoConvenio()\n {\n return $this->fkLicitacaoConvenio;\n }",
"public function getFkLicitacaoContrato()\n {\n return $this->fkLicitacaoContrato;\n }",
"public function getFkLicitacaoPublicacaoContratoAditivos()\n {\n return $this->fkLicitacaoPublicacaoContratoAditivos;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoDocumento()\n {\n return $this->fkLicitacaoDocumento;\n }",
"public function getFkLicitacaoPublicacaoRescisaoContratos()\n {\n return $this->fkLicitacaoPublicacaoRescisaoContratos;\n }",
"public function getFkFrotaVeiculo()\n {\n return $this->fkFrotaVeiculo;\n }",
"public function getFkFrotaVeiculo()\n {\n return $this->fkFrotaVeiculo;\n }",
"public function getFkFrotaVeiculo()\n {\n return $this->fkFrotaVeiculo;\n }",
"public function getFkLicitacaoLicitacoes()\n {\n return $this->fkLicitacaoLicitacoes;\n }",
"public function getFkTcealPublicacaoRgfs()\n {\n return $this->fkTcealPublicacaoRgfs;\n }",
"public function getFkPessoalOcorrencia()\n {\n return $this->fkPessoalOcorrencia;\n }",
"public function getFkTcealPublicacaoRreos()\n {\n return $this->fkTcealPublicacaoRreos;\n }",
"public function getFkImobiliarioTipoLicencaDocumentos()\n {\n return $this->fkImobiliarioTipoLicencaDocumentos;\n }",
"public function getFkLicitacaoRescisaoContrato()\n {\n return $this->fkLicitacaoRescisaoContrato;\n }",
"public function getFkImobiliarioAtributoTipoLicencas()\n {\n return $this->fkImobiliarioAtributoTipoLicencas;\n }",
"function licencias()\n\t{\n\t\treturn $this->hasMany(\n\t\t\tLicencia::class,\n\t\t\t'Licencia_id',\n\t\t\t'id'\n\t\t);\n\t}",
"public function getFkEconomicoResponsavel()\n {\n return $this->fkEconomicoResponsavel;\n }",
"public function proveedor(){\n return $this->belongsTo('App\\Proveedor', 'proveedor_legajo', 'tecnico_legajo');\n }",
"public function getFkPessoalDependente()\n {\n return $this->fkPessoalDependente;\n }",
"public function GetSeccion()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"producto_ibfk_1\");\n\t}",
"public function getFkEconomicoResponsavelTecnicos()\n {\n return $this->fkEconomicoResponsavelTecnicos;\n }",
"public function getFkDividaParcela()\n {\n return $this->fkDividaParcela;\n }",
"public function getFkDividaParcela()\n {\n return $this->fkDividaParcela;\n }",
"public function getFkComprasOrdemItens()\n {\n return $this->fkComprasOrdemItens;\n }"
] |
[
"0.70547223",
"0.7032761",
"0.7029754",
"0.6967053",
"0.6853017",
"0.6816853",
"0.67114294",
"0.6671827",
"0.65691346",
"0.65691346",
"0.65642834",
"0.65181285",
"0.65181285",
"0.65181285",
"0.64383554",
"0.64344907",
"0.64057",
"0.638917",
"0.6294307",
"0.6214839",
"0.6164466",
"0.6121566",
"0.61161864",
"0.6099144",
"0.6093416",
"0.6074523",
"0.6050037",
"0.6038555",
"0.6038555",
"0.60362506"
] |
0.7739954
|
0
|
This function converts a user object to json and gets rid of stuff that the user should not be able to update and also excludes users password
|
public function toCleanJson()
{
$user = [
'firstName' => $this->firstName,
'lastName' => $this->lastName,
'email' => $this->email
];
return $user;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private static function sanitize($user) {\n $user['is_owner'] = ($_SESSION['user_id'] == $user['id']) ? 1 : 0;\n\n if (!$user['is_owner']) {\n unset($user['birthday'], $user['email']);\n }\n\n $user['age'] = 0;\n if ($user['birthday'] != '0000-00-00') {\n $today = new DateTime();\n $birthday = new DateTime($user['birthday']);\n $interval = $today->diff($birthday);\n $user['age'] = $interval->y;\n }\n\n unset($user['password'], $user['confirmed'], $user['date_added'], $user['date_updated']);\n return $user;\n }",
"private function prepare_user_data( $user ) {\n\n\t\t$user_data = $user->data;\n\n\t\t// Clean up response. We only need specific user data.\n\t\t$data_to_remove = [ 'user_pass', 'user_nicename', 'user_status', 'user_activation_key', 'spam', 'deleted' ];\n\t\tforeach ( $data_to_remove as $key ) {\n\t\t\tunset( $user->{$key} );\n\t\t}\n\n\t\t$user_data->roles = $user->roles;\n\t\t$user_data->caps = $user->allcaps;\n\n\t\treturn $user_data;\n\t}",
"public function normalizeUser($user)\n {\n $user[self::USER_METADATA] = $user[getenv('AUTH_METADATA')];\n unset($user[getenv('AUTH_METADATA')]);\n\n $user['id'] = $user['sub'];\n unset($user['sub']);\n\n return $user;\n }",
"public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\tunset($fields[\"profileHash\"]);\n\t\tunset($fields[\"profileSalt\"]);\n\t\treturn ($fields);\n\t}",
"#[\\ReturnTypeWillChange]\n public function jsonSerialize()\n {\n $userData = [\n \"email\" => $this->email,\n \"name\" => $this->name,\n \"username\" => $this->username\n ];\n\n if (!is_null($this->password)) {\n $userData[\"password\"] = $this->password;\n }\n\n if (!is_null($this->active)) {\n $userData[\"active\"] = $this->active;\n }\n\n if (!is_null($this->roles)) {\n $userData[\"roles\"] = $this->roles;\n }\n\n if (!is_null($this->joinDefaultChannels)) {\n $userData[\"joinDefaultChannels\"] = $this->joinDefaultChannels;\n }\n\n if (!is_null($this->requirePasswordChange)) {\n $userData[\"requirePasswordChange\"] = $this->requirePasswordChange;\n }\n\n if (!is_null($this->sendWelcomeEmail)) {\n $userData[\"sendWelcomeEmail\"] = $this->sendWelcomeEmail;\n }\n\n if (!is_null($this->verified)) {\n $userData[\"verified\"] = $this->verified;\n }\n\n if (!is_null($this->customFields)) {\n $userData[\"customFields\"] = $this->customFields;\n }\n\n return $userData;\n }",
"private function getDefaultUser(): \\stdClass\n {\n return json_decode('{\"name\":\"\", \"email\":\"\", \"password\":\"\" }');\n }",
"public function formatUser()\n {\n if (! $this->user) {\n return [];\n } else {\n return [\n 'uniqueid' => $this->user->user_id,\n 'name' => $this->user->username,\n 'email' => $this->user->email,\n 'photourl' => $this->user->avatar_img_url,\n 'roles' => $this->getMappedRoles(),\n ];\n }\n }",
"public function jsonSerialize() {\n\t\t$fields = get_object_vars($this);\n\t\tunset($fields[\"volEmailActivation\"]);\n\t\tunset($fields[\"volHash\"]);\n\t\tunset($fields[\"volSalt\"]);\n\t\treturn($fields);\n\t}",
"function jp_rcp_user_registration_data( $user ) {\n\trcp_errors()->remove( 'username_empty' );\n\t$user['login'] = $user['email'];\n\treturn $user;\n}",
"public function transformUsers() {\n $saUsers = $this->kalturaUser->getAll();\n foreach ($saUsers as $key => $saUser){\n /**\n * @var $saUser KalturaUser\n */\n $dwUser = new DwUser();\n $dwUser->setId(\n $this->anonymize->anonymizeUser($saUser->getKalturaUserId())\n );\n $dwUser->setType(\n $this->typeOfUser($saUser->getKalturaUserId())\n );\n $dwUser->setCreatedAt($saUser->created_at);\n $dwUser->setUpdatedAt($saUser->updated_at);\n try{\n $dwUser->save();\n } catch (Exception $e) {\n var_dump($e->getMessage());\n die;\n }\n };\n }",
"public function serialize(ProjectUser $object)\n {\n return Arr::only((array)$object, $this->fillable);\n }",
"function save_user_info ()\n{\n if (check_user_info()){\n $feedback = array ();\n // Retrieve datas from form\n $user_name = filter_var($_POST['user_name'],\n FILTER_SANITIZE_STRING);\n //$user_password = $_POST['user_password'];\n $user_email = filter_var($_POST['user_email'], \n FILTER_SANITIZE_EMAIL);\n $user_birthday = filter_var($_POST['user_birthday'], \n FILTER_SANITIZE_STRING);\n $user_nationality = utf8_encode(filter_var($_POST['user_nationality'], \n FILTER_SANITIZE_STRING));\n $user_lastname = utf8_encode(filter_var($_POST['user_lastname'], \n FILTER_SANITIZE_STRING));\n $user_firstname = utf8_encode(filter_var($_POST['user_firstname'], \n FILTER_SANITIZE_STRING));\n $user_gender = utf8_encode(filter_var($_POST['user_gender'], \n FILTER_SANITIZE_STRING));\n $user_password_hash = \n $_SESSION['user']->get_string_attribute('user_password_hash');\n \n /*if (isset($_POST['user_password_new'])) {\n $user_password_hash = password_hash($_POST['user_password_new'],\n PASSWORD_DEFAULT);\n }else {\n $user_password_hash = \n $_SESSION['user']->get_string_attribute('user_password_hash');\n }*/\n \t\n //Create an user object with it\n $parameters = array ('user_id' =>\n $_SESSION['user']->get_string_attribute('user_id'),\n\t\t\t'user_name' => $user_name,\n\t\t\t'user_email' => $user_email,\n\t\t\t'user_birthday' => $user_birthday,\n\t\t\t'user_nationality' => $user_nationality,\n\t\t\t'user_lastname' => $user_lastname,\n\t\t\t'user_firstname' => $user_firstname,\n 'user_password_hash' => $user_password_hash,\n \t'user_gender' => $user_gender);\n $user = new User ($parameters);\n \t\n // save new datas in database;\n if ($user->update_user_data()) {\n // Save them in the user session\n $_SESSION['user'] = $user;\n $feedback ['status'] = true;\n $_SESSION['feedback'] = $feedback;\n return true;\n } else {\n $feedback ['msg'] = 'The update of your profile information has failed';\n $feedback ['status'] = false;\n $_SESSION['feedback'] = $feedback;\n return false;\n }\n }else {\n return false;\n }\n}",
"public function convert() {\n $this->user->convert();\n }",
"public function testUpdateUserGetsHandled()\n {\n $handler = new UpdateUserHandler(\n new EncoderFactory([User::class => new PlaintextPasswordEncoder()]),\n $this->userRepositoryCollection\n );\n\n $user = $this->userRepository->findByUsername('wouter');\n $originalUser = clone $user;\n\n $baseUserTransferObject = UserDataTransferObject::fromUser($user);\n $baseUserTransferObject->displayName = 'test';\n $baseUserTransferObject->plainPassword = 'randomPassword';\n $baseUserTransferObject->email = '[email protected]';\n\n $handler->handle($baseUserTransferObject);\n\n $this->assertNotEquals(\n 'test',\n $this->userRepository->findByUsername('wouter')->getUsername()\n );\n $this->assertEquals(\n 'test',\n $this->userRepository->findByUsername('wouter')->getDisplayName()\n );\n $this->assertEquals(\n 'randomPassword{' . $this->userRepository->findByUsername('wouter')->getSalt() . '}',\n $this->userRepository->findByUsername('wouter')->getPassword()\n );\n $this->assertNotEquals(\n $originalUser->getDisplayName(),\n $this->userRepository->findByUsername('wouter')->getDisplayName()\n );\n $this->assertNotEquals(\n $originalUser->getPassword(),\n $this->userRepository->findByUsername('wouter')->getPassword()\n );\n }",
"function hook_openid_connect_user_properties_to_skip_alter(array &$properties_to_skip) {\n}",
"public function convert($user)\n {\n jimport('joomla.utilities.arrayhelper');\n\n $rt = 'object';\n if (is_array($user)) {\n $rt = 'array';\n foreach ($user as $name => $value) {\n if (empty($value)) {\n unset($user[$name]);\n }\n }\n $user = JArrayHelper::toObject($user);\n }\n\n $name = (isset($user->name)) ? $user->name : null;\n $firstname = (isset($user->firstname)) ? $user->firstname : null;\n $lastname = (isset($user->lastname)) ? $user->lastname : null;\n $username = (isset($user->username)) ? $user->username : null;\n\n // Generate an username\n if (empty($username)) {\n $username = $user->email;\n }\n\n // Generate a firstname and lastname\n if (!empty($name) && (empty($firstname) && empty($lastname))) {\n $array = explode(' ', $name);\n $firstname = array_shift($array);\n $lastname = implode( ' ', $array );\n }\n \n // Generate a name\n if (empty($name) && (!empty($firstname) && !empty($lastname))) {\n $name = $firstname.' '.$lastname;\n } else if (empty($name)) {\n $name = $username;\n }\n\n // Insert the values back into the object\n $user->name = trim($name);\n $user->username = trim($username);\n $user->firstname = trim($firstname);\n $user->lastname = trim($lastname);\n\n // Return either an array or an object\n if ($rt == 'array') {\n return JArrayHelper::fromObject($user);\n }\n return $user;\n }",
"function sanitize_user_object($user, $context = 'display')\n {\n }",
"public function ToJSON()\n {\n $userStd = new stdClass();\n $userStd->nombre = $this->nombre;\n $userStd->correo = $this->correo;\n $userStd->clave = $this->clave;\n\n $userJson = json_encode($userStd);\n return $userJson;\n }",
"function sanitize($dataArray)\n\t{\n\t\t$this->data[\"username\"] = filter_var($dataArray[\"username\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"password\"] = filter_var($dataArray[\"password\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"description\"] = filter_var($dataArray[\"description\"], FILTER_SANITIZE_STRING);\n\t\t$this->data[\"quote\"] = filter_var($dataArray[\"quote\"], FILTER_SANITIZE_STRING);\n\t\t\n\t\t/* if(isset($this->data[\"user_level\"]))\n\t\t{\n\t\t\t$this->data[\"user_level\"] = filter_var($dataArray[\"user_level\"], FILTER_SANITIZE_STRING);\n\t\t} */\n\t\treturn $dataArray;\n\t}",
"function admin_add_user()\n{\n global $app;\n\n $user_data = $app->request()->post();\n $app->getLog()->debug('admin_add_user: ' . var_export($user_data, true));\n try {\n $user = $app->bbs->addUser($user_data['username'], $user_data['password']);\n } catch (Exception $e) {\n $app->getLog()->error('admin_add_user: error for adding user ' . var_export($user_data, true));\n $app->getLog()->error('admin_add_user: exception ' . $e->getMessage());\n $user = null;\n }\n $resp = $app->response();\n if (isset($user) && !is_null($user)) {\n $resp->status(200);\n $msg = getMessageString('admin_modified');\n $answer = json_encode(['user' => $user->getProperties(), 'msg' => $msg]);\n $resp->header('Content-type', 'application/json');\n } else {\n $resp->status(500);\n $resp->header('Content-type', 'text/plain');\n $answer = getMessageString('admin_modify_error');\n }\n $resp->header('Content-Length', strlen($answer));\n $resp->body($answer);\n}",
"function buildUserObject($userInfo, $file, $pass, $add)\n {\n\n $user = new User();\n $validateF = new ValidateFunctions();\n $user->setName($validateF->sanitize($userInfo['user_name']));\n $address = $validateF->sanitize($userInfo['user_street1']) . ', ' . $validateF->sanitize($userInfo['user_city']) . ', ' . $validateF->sanitize($userInfo['user_county']) . ', '\n . $validateF->sanitize($userInfo['user_country']);\n $user->setAddress($address);\n $user->setEmail($validateF->sanitize($userInfo['user_email']));\n $user->setPhone($validateF->sanitize($userInfo['user_phone']));\n\n if($_GET['action'] == 'edituser')\n {\n if ($_SESSION['id'] == $_GET['id']) {\n $userPass = $validateF->sanitize($userInfo['user_password']);\n } else {\n $userPass = $user->getPassword();\n }\n } else{\n $userPass = $validateF->sanitize($userInfo['user_password']);\n }\n\n\n $hashedPass = password_hash($userPass, PASSWORD_BCRYPT);\n $user->setPassword($pass);\n if ($_GET['action'] == 'edituser' || isset($_GET['id']) && $_GET['id'] != $_SESSION['id']) {\n $user->setPassword($pass);\n } else {\n $user->setPassword($hashedPass);\n }\n $user->setAccountType($this->getAccountTypeName($userInfo));\n $user->setImage($file);\n $user->setAddedBy($add);\n return $user->userToJson();\n }",
"public function updateUser()\n {\n $data = $_POST;\n if (isNull($data['id'])) {\n return false;\n }\n $id = $data['id'];\n $user = array(\"email\"=>$data['email'],\n \"first_name\"=>$data['firstName'],\n \"last_name\"=>$data['lastName']);\n if ($data['password'] != '')\n {\n $user[\"password\"] = password_hash($data['password'],PASSWORD_BCRYPT);\n }\n $updatedUser = $this->usersController->updateUser($id,$user);\n echo json_encode($updatedUser);\n if ($updatedUser)\n {\n return true;\n } else\n {\n return false;\n }\n }",
"public function toUser($data){\n\t\t\t$this->email=$data['email'];\n\t\t\t$this->password=$data['password'];\n\t\t\t$this->nombre=$data['nombre'];\n\t\t\t$this->apellido=$data['apellido'];\n\t\t}",
"public static function filterObjectKeys($user)\n {\n global $wp_roles;\n\n // Keep only the some data\n $item = (object) [\n \"ID\" => $user->ID,\n \"roles\" => set($user->roles)->mapAssoc(function ($i, $role) use ($wp_roles) {\n return [$role => $wp_roles->roles[$role]];\n }),\n \"caps\" => $user->allcaps,\n \"first_name\" => $user->first_name,\n \"last_name\" => $user->last_name,\n ];\n\n // Remove \"user_\" prefix for some data\n foreach ($user->data as $key => $value) {\n $item->{str_replace(\"user_\", \"\", $key)} = $value;\n }\n\n // Unset the default URL\n unset($item->url);\n unset($item->status);\n\n return $item;\n }",
"public function detachUserAll(User $user)\n {\n if ($user->id == \\Auth::user()->id) {\n return response()->json('Not allowed',422);\n }\n $user->permissions()->detach();\n\n return 'User Stripped of all permissions';\n }",
"public function exportToJson()\n {\n $user = $this->load([\n 'bookings.resource',\n 'identifiers',\n ]);\n\n $user->bookings->transform(function ($item, $key) {\n return (object) [\n 'resource' => $item->resource->name,\n 'start' => $item->start_time->format('U'),\n 'end' => $item->end_time->format('U'),\n ];\n });\n\n $user->identifiers->transform(function ($item, $key) {\n return $item->value;\n });\n\n return json_encode($user->only(['email', 'name', 'bookings', 'identifiers']));\n }",
"static public function getUserAttributes($user = null)\n {\n if (is_null($user)) {\n $user = $GLOBALS['registry']->getAuth();\n } elseif (empty($user)) {\n return array('user' => '',\n 'name' => '',\n 'email' => '');\n }\n\n if (isset(self::$_users[$user])) {\n return self::$_users[$user];\n }\n\n if (strpos($user, ':') !== false) {\n list($type, $user) = explode(':', $user, 2);\n } else {\n $type = 'user';\n }\n\n // Default this; some of the cases below might change it.\n self::$_users[$user]['user'] = $user;\n self::$_users[$user]['type'] = $type;\n\n switch ($type) {\n case 'user':\n if (substr($user, 0, 2) == '**') {\n unset(self::$_users[$user]);\n $user = substr($user, 2);\n\n self::$_users[$user]['user'] = $user;\n self::$_users[$user]['name'] = '';\n self::$_users[$user]['email'] = '';\n\n try {\n $addr_arr = Horde_Mime_Address::parseAddressList($user);\n if (isset($addr_arr[0])) {\n self::$_users[$user]['name'] = isset($addr_arr[0]['personal'])\n ? $addr_arr[0]['personal'] : '';\n self::$_users[$user]['email'] = $addr_arr[0]['mailbox'] . '@'\n . $addr_arr[0]['host'];\n }\n } catch (Horde_Mime_Exception $e) {\n }\n } elseif ($user < 0) {\n global $whups_driver;\n\n self::$_users[$user]['user'] = '';\n self::$_users[$user]['name'] = '';\n self::$_users[$user]['email'] = $whups_driver->getGuestEmail($user);\n\n try {\n $addr_arr = Horde_Mime_Address::parseAddressList(self::$_users[$user]['email']);\n if (isset($addr_arr[0])) {\n self::$_users[$user]['name'] = isset($addr_arr[0]['personal'])\n ? $addr_arr[0]['personal'] : '';\n self::$_users[$user]['email'] = $addr_arr[0]['mailbox'] . '@'\n . $addr_arr[0]['host'];\n }\n } catch (Horde_Mime_Exception $e) {\n }\n } else {\n $identity = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Identity')->create($user);\n\n self::$_users[$user]['name'] = $identity->getValue('fullname');\n self::$_users[$user]['email'] = $identity->getValue('from_addr');\n }\n break;\n\n case 'group':\n try {\n $group = $GLOBALS['injector']\n ->getInstance('Horde_Group')\n ->getData($user);\n self::$_users[$user]['user'] = $group['name'];\n self::$_users[$user]['name'] = $group['name'];\n self::$_users[$user]['email'] = $group['email'];\n } catch (Horde_Exception $e) {\n self::$_users['user']['name'] = '';\n self::$_users['user']['email'] = '';\n }\n break;\n }\n\n return self::$_users[$user];\n }",
"public function __toString():string\n {\n// $this->getUserId(),\n// $this->getUserName(),\n// $this->getUserEamil()\n// );\n $return[UserContext::JsonUserNameField] = $this->getUserName();\n $return[UserContext::JsonUserEmailField] = $this->getUserEamil();\n $return[UserContext::JsonUserIDField] = $this->getUserId();\n return json_encode($return);\n }",
"public function updateUser(){\n \n $name = htmlspecialchars($_POST['name']);\n $surname = htmlspecialchars($_POST['surname']);\n $phone = htmlspecialchars($_POST['phone']);\n $address = htmlspecialchars($_POST['address']);\n $jmbg = htmlspecialchars($_POST['jmbg']);\n $email = htmlspecialchars($_POST['email']);\n $username = htmlspecialchars($_POST['username']);\n \n $response = array(\n 'code' => 1,\n 'msg' => \"\",\n 'user' => NULL\n );\n \n $user = array(\n 'name' => $name,\n 'surname' => $surname,\n 'phone' => $phone,\n 'address' => $address,\n 'jmbg' => $jmbg,\n 'email'=> $email,\n 'username' => $username\n );\n \n if (!validateUpdateUserEmpty($user)){\n $response['code'] = 0;\n $response['msg'] = \"Sva polja moraju biti popunjena!\";\n }\n \n else if (!validateUpdateUsername($user, $this->modelUser, $this->curUser) ){\n $response['code'] = 0;\n $response['msg'] = \"Zauzeto korisnicko ime!\";\n }\n else {\n $this->modelUser->updateUser($this->curUser->idUser, $name, $surname, $address,\n $phone, $jmbg, $email, $username);\n $this->curUser = $this->modelUser->getUserById($this->curUser->idUser);\n $response['user']= $this->curUser; \n }\n \n header(\"Content-Type: application/json\");\n echo json_encode($response);\n \n }",
"public static function prettyUser($User)\n { if(is_numeric($User))\n {\n try\n {\n $User = \\App\\User::findOrFail($User);\n }\n catch (ModelNotFoundException $e)\n {\n return FALSE;\n }\n }\n\n return $prettyUser =\n [\n 'id' => $User->id,\n 'first_name' => $User->Profile->first_name,\n 'last_name' => $User->Profile->last_name,\n 'picture' => $User->Profile->picture,\n 'username' => $User->username,\n ];\n }"
] |
[
"0.67217237",
"0.6376987",
"0.60265434",
"0.60223156",
"0.57917315",
"0.57817924",
"0.56594193",
"0.555032",
"0.5448094",
"0.54154295",
"0.53256196",
"0.53216517",
"0.53109604",
"0.5309181",
"0.530516",
"0.5303992",
"0.52984565",
"0.5264177",
"0.52550817",
"0.52321196",
"0.5227649",
"0.5209322",
"0.5197669",
"0.5197464",
"0.5181713",
"0.5174823",
"0.5171191",
"0.51571065",
"0.51562613",
"0.51519775"
] |
0.68378127
|
0
|
get_redirect_url() Gets the address that the provided URL redirects to, or FALSE if there's no redirect.
|
function get_redirect_url($url){
$redirect_url = null;
$url_parts = @parse_url($url);
if (!$url_parts) return false;
if (!isset($url_parts['host'])) return false; //can't process relative URLs
if (!isset($url_parts['path'])) $url_parts['path'] = '/';
$sock = fsockopen($url_parts['host'], (isset($url_parts['port']) ? (int)$url_parts['port'] : 80), $errno, $errstr, 30);
if (!$sock) return false;
$request = "HEAD " . $url_parts['path'] . (isset($url_parts['query']) ? '?'.$url_parts['query'] : '') . " HTTP/1.1\r\n";
$request .= 'Host: ' . $url_parts['host'] . "\r\n";
$request .= "Connection: Close\r\n\r\n";
fwrite($sock, $request);
$response = '';
while(!feof($sock)) $response .= fread($sock, 8192);
fclose($sock);
if (preg_match('/^Location: (.+?)$/m', $response, $matches)){
if ( substr($matches[1], 0, 1) == "/" )
return $url_parts['scheme'] . "://" . $url_parts['host'] . trim($matches[1]);
else
return trim($matches[1]);
} else {
return false;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getRedirectUrl(): ?string\n {\n return $this->_redirectUrl;\n }",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function checkLinkToRedirect()\n {\n $config = $this->_registry->get(\"config\");\n\n $redirectAfterLogin = filter_input(INPUT_GET, \"redirect_after_login\", FILTER_UNSAFE_RAW);\n\n if ($redirectAfterLogin && $redirectAfterLogin != null) {\n $testLink = $redirectAfterLogin;\n } else if (isset($_SERVER['HTTP_REFERER'])) {\n $router = Zend_Controller_Front::getInstance()->getRouter();\n\n if ($router->getCurrentRouteName() == \"login\") {\n $referer = $_SERVER['HTTP_REFERER'];\n $partialLink = explode(\"?redirect_after_login=\", $referer, 2);\n\n if (! isset($partialLink[1])) {\n return false;\n } else {\n $testLink = $partialLink[1];\n }\n }\n } else {\n return false;\n }\n\n // the redirection link must start with a '/' and\n // must not end up in the redirector again\n // or be in another host (avoids the use of @)\n\n $thisPage = explode(\"?\", $_SERVER['REQUEST_URI'], 2);\n $thisPage = $thisPage[0];\n\n if (mb_substr($testLink, 0, 1) == '/' && !mb_strpos($testLink, \"@\") && $thisPage != $testLink) {\n // @todo improve HTTPS support\n $redirTo = \"http://\" . $config['webhost'] . $testLink;\n\n Zend_Uri::setConfig(array('allow_unwise' => true));\n\n if (Zend_Uri::check($redirTo)) {\n $testUri = Zend_Uri::factory($redirTo);\n\n $path = $testUri->getPath();\n\n Zend_Uri::setConfig(array('allow_unwise' => false));\n\n return $path;\n }\n }\n\n return false;\n }",
"protected static function getRedirectLocation($url)\n\t{\n\t\t$fp = @fopen(\n\t\t\t$url,\n\t\t\t'rb',\n\t\t\tfalse,\n\t\t\tstream_context_create(array(\n\t\t\t\t'http' => array(\n\t\t\t\t\t// Bit.ly doesn't like HEAD =\\\n\t\t\t\t\t//'method' => 'HEAD',\n\t\t\t\t\t'header' => \"Connection: close\\r\\n\",\n\t\t\t\t\t'follow_location' => false\n\t\t\t\t)\n\t\t\t))\n\t\t);\n\n\t\tif (!$fp)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$meta = stream_get_meta_data($fp);\n\t\tfclose($fp);\n\n\t\tforeach ($meta['wrapper_data'] as $k => $line)\n\t\t{\n\t\t\tif (is_numeric($k)\n\t\t\t && preg_match('#^Location:(.*)#i', $line, $m))\n\t\t\t{\n\t\t\t\treturn trim($m[1]);\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getRedirectURL()\n {\n return $this->redirectURL;\n }",
"function get_redirect_url($url){\n global $cookie;\n\t$redirect_url = null; \n \n\t$url_parts = @parse_url($url);\n\tif (!$url_parts) return false;\n\tif (!isset($url_parts['host'])) return false; //can't process relative URLs\n\tif (!isset($url_parts['path'])) $url_parts['path'] = '/';\n \n\t$sock = fsockopen($url_parts['host'], (isset($url_parts['port']) ? (int)$url_parts['port'] : 80), $errno, $errstr, 30);\n\tif (!$sock) return false;\n \n\t$request = \"HEAD \" . $url_parts['path'] . (isset($url_parts['query']) ? '?'.$url_parts['query'] : '') . \" HTTP/1.1\\r\\n\"; \n\t$request .= 'Host: ' . $url_parts['host'] . \"\\r\\n\"; \n\t$request .= 'Cookie: ' . $cookie . \"\\r\\n\"; \n\t$request .= \"Connection: Close\\r\\n\\r\\n\"; \n\tfwrite($sock, $request);\n\t$response = '';\n\twhile(!feof($sock)) $response .= fread($sock, 8192);\n\tfclose($sock);\n\n\tif (preg_match('/^Location: (.+?)$/m', $response, $matches)){\n\t\tif ( substr($matches[1], 0, 1) == \"/\" )\n\t\t\treturn $url_parts['scheme'] . \"://\" . $url_parts['host'] . trim($matches[1]);\n\t\telse\n\t\t\treturn trim($matches[1]);\n \n\t} else {\n\t\treturn $url;\n\t}\n \n}",
"public function getRedirectUri();",
"public function getRedirectUri();",
"function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->redirect_url;\r\n\t}",
"public function getRedirectUrl(): string;",
"public function getRedirectUrl() {\n return (string) $this->getValue('redirect_url');\n }",
"public function getRedirectUrl()\n {\n return $this->_redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->_redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->_redirectUrl;\n }",
"public function getRedirectUrl(): string\n {\n return $this->redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }",
"public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }",
"abstract protected function getRedirectUrl(): Url;",
"public function getRedirectUrl()\n {\n return $this->redirectUrl;\n }",
"function thrive_get_redirect_page_url() {\n\n\t$selected_login_post_id = intval( get_option( 'thrive_login_page' ) );\n\n\tif ( $selected_login_post_id === 0 ) {\n\n\t\treturn;\n\n\t}\n\n\t$login_post = get_post( $selected_login_post_id );\n\n\tif ( ! empty( $login_post ) ) {\n\n\t\treturn get_permalink( $login_post->ID );\n\n\t}\n\n\treturn false;\n\n}",
"public static function get_url_path()\n {\n \t//----------------------------------------------------\n \t// If $_SERVER['REDIRECT_URL'] is set\n \t//----------------------------------------------------\n \tif (isset($_SERVER['REDIRECT_URL'])) {\n \t\treturn $_SERVER['REDIRECT_URL'];\n \t}\n \t//----------------------------------------------------\n \t// If $_SERVER['PATH_INFO'] is set\n \t//----------------------------------------------------\n \telse if (isset($_SERVER['PATH_INFO'])) {\n \t\treturn $_SERVER['PATH_INFO'];\n \t}\n \t//----------------------------------------------------\n \t// If $_SERVER['REQUEST_URI'] is set\n \t//----------------------------------------------------\n \telse if (isset($_SERVER['REQUEST_URI'])) {\n \t\t$qs_start = strpos($_SERVER['REQUEST_URI'], '?');\n \t\tif ($qs_start === false) {\n \t\t\treturn $_SERVER['REQUEST_URI'];\n \t\t}\n \t\telse {\n \t\t\treturn substr($_SERVER['REQUEST_URI'], 0, $qs_start);\n \t\t}\n \t}\n\n \treturn false;\n }",
"public function getRedirectUrl() {\n return $this->redirectUrl;\n }",
"public static function get_url_path()\n {\n //----------------------------------------------------\n // If $_SERVER['REDIRECT_URL'] is set\n //----------------------------------------------------\n if (isset($_SERVER['REDIRECT_URL'])) {\n return $_SERVER['REDIRECT_URL'];\n }\n //----------------------------------------------------\n // If $_SERVER['PATH_INFO'] is set\n //----------------------------------------------------\n else if (isset($_SERVER['PATH_INFO'])) {\n return $_SERVER['PATH_INFO'];\n }\n //----------------------------------------------------\n // If $_SERVER['REQUEST_URI'] is set\n //----------------------------------------------------\n else if (isset($_SERVER['REQUEST_URI'])) {\n $qs_start = strpos($_SERVER['REQUEST_URI'], '?');\n if ($qs_start === false) {\n return $_SERVER['REQUEST_URI'];\n }\n else {\n return substr($_SERVER['REQUEST_URI'], 0, $qs_start);\n }\n }\n\n return false;\n }",
"public function getRedirectUri(): string;",
"public function hasRedirect()\n {\n return !empty($this->redirectUrl);\n }",
"public function getRedirectUrl()\n {\n }"
] |
[
"0.69765407",
"0.6918374",
"0.6918374",
"0.6918374",
"0.6918374",
"0.6918374",
"0.68498534",
"0.6681673",
"0.66285294",
"0.6627446",
"0.6605137",
"0.6605137",
"0.6575628",
"0.657342",
"0.6561052",
"0.65265983",
"0.65265983",
"0.65265983",
"0.65008205",
"0.64503694",
"0.64503694",
"0.64497936",
"0.6426693",
"0.64099985",
"0.6374838",
"0.6361687",
"0.6353483",
"0.6351202",
"0.6333271",
"0.63312954"
] |
0.7297239
|
0
|
get_final_url() Gets the address that the URL ultimately leads to. Returns $url itself if it isn't a redirect.
|
function get_final_url($url){
$redirects = get_all_redirects($url);
if (count($redirects)>0){
return array_pop($redirects);
} else {
return $url;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"static function get_final_url($url)\n\t\t{\n\t\t\t$redirects = CUtils::get_all_redirects($url);\n\t\t\tif (count($redirects)>0)\n\t\t\t{\n\t\t\t\treturn array_pop($redirects);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\treturn $url;\n\t\t\t}\n\t\t}",
"function get_final_url($url){\n\t$redirects = get_all_redirects($url);\n\tif (count($redirects)>0){\n\t\treturn array_pop($redirects);\n\t} else {\n\t\treturn $url;\n\t}\n}",
"public static function url_final_redirect( $url ) {\n\t\t\t$ch = curl_init( $url );\n\t\t\tcurl_setopt( $ch, CURLOPT_NOBODY, 1 );\n\t\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 ); // Follow redirects.\n\t\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, 1 ); // Set referer on redirect.\n\t\t\tcurl_exec( $ch );\n\t\t\t$target = curl_getinfo( $ch, CURLINFO_EFFECTIVE_URL );\n\t\t\tcurl_close( $ch );\n\n\t\t\tif ( $target ) {\n\t\t\t\treturn $target;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}",
"public function getURL()\n {\n return $this->finalURL;\n }",
"function _url_final_redirect( $url ) {\n\t\treturn IMFORZA_Utils::url_final_redirect( $url );\n\t}",
"public function getLastPageUrl();",
"function get_redirect_url($url){\n\t\t$redirect_url = null; \n\t \n\t\t$url_parts = @parse_url($url);\n\t\tif (!$url_parts) return false;\n\t\tif (!isset($url_parts['host'])) return false; //can't process relative URLs\n\t\tif (!isset($url_parts['path'])) $url_parts['path'] = '/';\n\t \n\t\t$sock = fsockopen($url_parts['host'], (isset($url_parts['port']) ? (int)$url_parts['port'] : 80), $errno, $errstr, 30);\n\t\tif (!$sock) return false;\n\t \n\t\t$request = \"HEAD \" . $url_parts['path'] . (isset($url_parts['query']) ? '?'.$url_parts['query'] : '') . \" HTTP/1.1\\r\\n\"; \n\t\t$request .= 'Host: ' . $url_parts['host'] . \"\\r\\n\"; \n\t\t$request .= \"Connection: Close\\r\\n\\r\\n\"; \n\t\tfwrite($sock, $request);\n\t\t$response = '';\n\t\twhile(!feof($sock)) $response .= fread($sock, 8192);\n\t\tfclose($sock);\n\t \n\t\tif (preg_match('/^Location: (.+?)$/m', $response, $matches)){\n\t\t\tif ( substr($matches[1], 0, 1) == \"/\" )\n\t\t\t\treturn $url_parts['scheme'] . \"://\" . $url_parts['host'] . trim($matches[1]);\n\t\t\telse\n\t\t\t\treturn trim($matches[1]);\n\t \n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t \n\t}",
"public function finalURL($value = null)\n \t{\n \t\tif($value != null) $this->_finalURL = $value;\n \t\telse return $this->_finalURL;\n \t}",
"protected function getRedirectUrl(): string\n\t{\n\t\tif($this->input === null)\n\t\t{\n\t\t\treturn $this->urlBuilder->current();\n\t\t}\n\n\t\treturn $this->input->getRedirectUrl();\n\t}",
"function get_effective_url()\n\t{\n\t\t//最后一个有效的url地址\n\t\treturn curl_getinfo($this->ch, CURLINFO_EFFECTIVE_URL);\n\t}",
"public function getUrl()\n {\n return $this->lastUrl;\n }",
"private function full($url = NULL)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$headers = get_headers($url,1);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Some kind of error\n\t\t\t// Abandon and return original url\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e));\n\t\t\treturn $url;\n\t\t}\n\n\t\tif (empty($headers))\n\t\t{\n\t\t\treturn $url;\n\t\t}\n\n\t\tif ( ! isset($headers['Location']))\n\t\t{\n\t\t\treturn $url;\n\t\t}\n\t\t$url = $headers['Location'];\n\t\t\n\t\t// If an Array is returned for redirects\n\t\t// Return the last item in the array\n\t\treturn is_array($url)? end($url) : $url;\n\t}",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->payment->links[1]->getHref();\r\n\t}",
"private function getRedirectUrl()\n {\n return $this->getConfigData('url');\n }",
"protected function GetReturnToLastStepURL()\n {\n $sLink = false;\n $oBackItem = $this->GetPreviousStep();\n if (!is_null($oBackItem)) {\n $sLink = $oBackItem->GetStepURL();\n }\n\n return $sLink;\n }",
"public function getRedirectUrl() {\n return (string) $this->getValue('redirect_url');\n }",
"public function getURLLogin() {\r\n $this->initGoogleClient();\r\n $url = $this->client->createAuthUrl();\r\n Log::message(Language::getMessage('log', 'debug_google_get_url', array('url' => $url)), 2);\r\n return $url;\r\n }",
"public function getLastRequestURL()\n {\n return $this->requestUrl;\n \n }",
"public function get_url(): string\n {\n return $this->get_url_internal();\n }",
"public function getRedirectURL()\n {\n return $this->redirectURL;\n }",
"function getRedirectUrl()\r\n\t{\r\n\t\treturn $this->redirect_url;\r\n\t}",
"protected function getRedirectUrl()\n\t{\n if ($customURL = $this->input->getBase64('returnurl', ''))\n {\n $customURL = base64_decode($customURL);\n }\n\n $url = !empty($customURL) ? $customURL : 'index.php?option='\n . $this->container->componentName\n . '&view='\n . $this->container->inflector->pluralize($this->view)\n . $this->getItemidURLSuffix(); // e.g. '&Itemid=123' or an empty string if no Itemid\n\n return $url;\n }",
"abstract protected function getRedirectUrl(): Url;",
"public function getRedirectUri();",
"public function getRedirectUri();"
] |
[
"0.8182524",
"0.81635004",
"0.73048997",
"0.7131725",
"0.68727154",
"0.6670572",
"0.65954643",
"0.650293",
"0.64909655",
"0.64904004",
"0.6467125",
"0.6452957",
"0.6427875",
"0.6427875",
"0.6427875",
"0.6427875",
"0.6427875",
"0.6367524",
"0.62690073",
"0.6217572",
"0.62168103",
"0.61777675",
"0.61563414",
"0.61394215",
"0.6123773",
"0.6118384",
"0.6114955",
"0.607787",
"0.6076952",
"0.6076952"
] |
0.8172781
|
1
|
Obtain the human readable message from redsys error code.
|
public function getMessageInfo($error_code)
{
return 'Error ' . $error_code . ': ' . RedsysErrorInfo::getErrorInfo($error_code);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function getErrorMessage(int $code): string\n {\n return sprintf(\n '%s - Error Code = [%d]'\n , self::$errors[$code]\n , $code\n );\n }",
"final public function error_get() : string{\r\n return (string) ($this->code != 0) ? \"[<b>{$this->code}</b>]: \".$this->message : $this->message;\r\n }",
"protected function message(int $code): string\n {\n switch ($code) {\n case 0:\n return 'No error';\n case 1:\n return 'Multi-disk zip archives not supported';\n case 2:\n return 'Renaming temporary file failed';\n case 3:\n return 'Closing zip archive failed';\n case 4:\n return 'Seek error';\n case 5:\n return 'Read error';\n case 6:\n return 'Write error';\n case 7:\n return 'CRC error';\n case 8:\n return 'Containing zip archive was closed';\n case 9:\n return 'No such file';\n case 10:\n return 'File already exists';\n case 11:\n return 'Can\\'t open file';\n case 12:\n return 'Failure to create temporary file';\n case 13:\n return 'Zlib error';\n case 14:\n return 'Malloc failure';\n case 15:\n return 'Entry has been changed';\n case 16:\n return 'Compression method not supported';\n case 17:\n return 'Premature EOF';\n case 18:\n return 'Invalid argument';\n case 19:\n return 'Not a zip archive';\n case 20:\n return 'Internal error';\n case 21:\n return 'Zip archive inconsistent';\n case 22:\n return 'Can\\'t remove file';\n case 23:\n return 'Entry has been deleted';\n default:\n return 'An unknown error has occurred(' . intval($code) . ')';\n }\n }",
"function error($code) {\n\tswitch ($code) {\n\t\tcase 'EntityExists':\n\t\t\t$str = 'Cannot complete that action because the entity already exists';\n\t\t\tbreak;\n\t\tcase 'EntityDoesNotExist':\n\t\t\t$str = 'Cannot complete that action because that entity does not exist';\n\t\t\tbreak;\n\t\tcase 'InvalidPassword':\n\t\t\t$str = 'The password supplied is not valid';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$str = $code;\n\t}\n\treturn $str;\n}",
"public function getMessage(): string\n\t{\n\t\treturn $this->err->getMessage();\n\t}",
"function getErrorString() {\n\t\tswitch ($this->getErrorType()) {\n\t\t\tcase INSTALLER_ERROR_DB:\n\t\t\t\treturn 'DB: ' . $this->getErrorMsg();\n\t\t\tdefault:\n\t\t\t\treturn __($this->getErrorMsg());\n\t\t}\n\t}",
"public function errorString($code) {\n \n if(!is_numeric($code)) {\n return false;\n }\n\n $code = (int)$code;\n \n switch($code) {\n case 0: \n return \"Operation was successful\";\n case 247: \n return \"The userid provided is absent, or incorrect\";\n case 250: \n return \"The provided userid and/or Oauth credentials do not match\";\n case 286: \n return \"No such subscription was found\";\n case 293: \n return \"The callback URL is either absent or incorrect\";\n case 294: \n return \"No such subscription could be deleted\";\n case 304: \n return \"The comment is either absent or incorrect\";\n case 305: \n return \"Too many notifications are already set\";\n case 342: \n return \"The signature (using Oauth) is invalid\";\n case 343: \n return \"Wrong Notification Callback Url don't exist\";\n case 601: \n return \"Too Many Request\";\n case 2554: \n return \"Wrong action or wrong webservice\";\n case 2555: \n return \"An unknown error occurred\";\n case 2556: \n return \"Service is not defined\";\n }\n \n return false;\n }",
"public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }",
"function getErrorText($code){\n $errorText = array(\"good\",\"account not existed\",\"insufficient fund\",\"invalid account format\",\"duplicate account record\",\"invalid tranzaction format\",\"unknown error\");\n return $errorText[$code];\n }",
"public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }",
"public function getErrorMessageByCode($code): string\n {\n switch ($code) {\n case 400:\n {\n return 'Requisição Mal Formada';\n }\n case 401:\n {\n return 'Usuário não autorizado';\n }\n case 403:\n {\n return 'Acesso não autorizado';\n }\n case 404:\n {\n return 'Recurso não Encontrado';\n }\n case 405:\n {\n return 'Operação não suportada';\n }\n case 408:\n {\n return 'Tempo esgotado para a requisição';\n }\n case 409:\n {\n return 'Recurso em conflito';\n }\n case 413:\n {\n return 'Requisição excede o tamanho máximo permitido';\n }\n case 415:\n {\n return 'Content-type inválido';\n }\n case 422:\n {\n return 'Não foi possível processar as instruções contidas na requisição';\n }\n case 429:\n {\n return 'Requisição excede a quantidade máxima de chamadas permitidas à API.';\n }\n case 500:\n {\n return 'Erro na API';\n }\n }\n }",
"public function getMessage($code) {\n return $this->_codes[$code];\n }",
"function getMessage()\n {\n return ($this->error_message_prefix . $this->message);\n }",
"public function message()\n {\n switch ($this->errorType) {\n case self::ERROR_TYPE_NUMERIC:\n $msg = 'Điện thoại phải là chữ số';\n break;\n case self::ERROR_TYPE_LENGTH:\n $msg = 'Điện thoại phải có độ dài từ 10 hoặc 11 số';\n break;\n default:\n $msg = 'Số điện thoại không đúng định dạng';\n break;\n }\n return $msg;\n }",
"static public function getMessageForCode($code){\n $codes = self::getCodes();\n\n if( isset($codes[$code]) ){\n return $codes[$code];\n }\n\n return '';\n }",
"public function getMessage()\n {\n return $this->_error;\n }",
"public static function message( $error, $code = null ) {\n\t\t// -- Check if a status code was defined, if not use a 404 status code\n\t\tif( $code == null ) {\n\t\t\t$code = Error::$not_found;\n\t\t}\n\n\t\t// -- Set the HTTP status code\n\t\t$code = Error::http_code( $code );\n\n\t\t// -- Make sure a log path is defined in the configuration\n\t\tif( LOGS_PATH ) {\n\n\t\t\t// -- Check if logging is enabled\n\t\t\tif( LOGGING ) {\n\n\t\t\t\t// -- Log the error before it is thrown\n\t\t\t\tLogging::error_log( $error, $code );\n\t\t\t}\n\n\t\t}\n\n\t\t// -- Check if the application is in development mode and return the proper error\n\t\tif( Environment::is_development( Environment::type() ) ) {\n\t\t\treturn Error::trace( $error, $code );\n\t\t} else {\n\t\t\treturn Error::type( $code );\n\t\t}\n\n\t}",
"public function get_error() {\n \t$error = oci_error($this->resource);\n \treturn $error[ 'code' ] . ': ' . $error[ 'message' ];\n }",
"public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }",
"public function getMessage()\n {\n return self::getMessageForError($this->value);\n }",
"public function get_error_message() {\n\t\treturn $this->error_message;\n\t}",
"public static function getStatusMessage()\n {\n switch(self::status())\n {\n case 'PLEXCEL_NO_CREDS':\n return \"no creds\";\n break;\n case 'PLEXCEL_PRINCIPAL_UNKNOW':\n return \"principal unknow\";\n break;\n case 'PLEXCEL_LOGON_FAILED':\n return \"logon failed\";\n break;\n default:\n return \"error :\".self::status();\n }\n }",
"public static function getErrorString( $message, $code = 0, $file = 'Unknown', $line = 'Unknown' ) { \n if( self::$_debug ) {\n\t\t\treturn $message .= ' ( DEBUG: Error code[' . $code . '], traced to file '.$file.' on line '.$line.' )';\n\t\t}\n\t\treturn $message;\n }",
"private function returnCodeMessage(int $code): string {\n $codes = [\n 211 => 'System status, or system help reply',\n 214 => 'Help message (A response to the HELP command)',\n 220 => '<domain> Service ready',\n 221 => '<domain> Service closing transmission channel',\n 235 => 'Authentication succeeded',\n 250 => 'Requested mail action okay, completed',\n 251 => 'User not local; will forward',\n 252 => 'Cannot verify the user, but it will try to deliver the message anyway',\n 334 => '(Server challenge - the text part contains the Base64-encoded challenge)',\n 354 => 'Start mail input',\n 421 => 'Service not available, closing transmission channel (This may be a reply to any command if the service knows it must shut down)',\n 432 => 'A password transition is needed',\n 450 => 'Requested mail action not taken: mailbox unavailable (e.g., mailbox busy or temporarily blocked for policy reasons)',\n 451 => 'Requested action aborted: local error in processing / IMAP server unavailable',\n 452 => 'Requested action not taken: insufficient system storage',\n 454 => 'Temporary authentication failure',\n 455 => 'Server unable to accommodate parameters',\n 500 => 'Syntax error, command unrecognized (This may include errors such as command line too long) / Authentication Exchange line is too long',\n 501 => 'Syntax error in parameters or arguments / Cannot Base64-decode Client responses / Client initiated Authentication Exchange (only when the SASL mechanism specified that client does not begin the authentication exchange)',\n 502 => 'Command not implemented',\n 503 => 'Bad sequence of commands',\n 504 => 'Command parameter is not implemented / Unrecognized authentication type',\n 521 => 'Server does not accept mail',\n 523 => 'Encryption Needed',\n 530 => 'Authentication required',\n 534 => 'Authentication mechanism is too weak',\n 535 => 'Authentication credentials invalid',\n 538 => 'Encryption required for requested authentication mechanism',\n 550 => 'Requested action not taken: mailbox unavailable (e.g., mailbox not found, no access, or command rejected for policy reasons)',\n 551 => 'User not local; please try <forward-path>',\n 552 => 'Requested mail action aborted: exceeded storage allocation',\n 553 => 'Requested action not taken: mailbox name not allowed',\n 554 => 'Transaction has failed (Or, in the case of a connection-opening response, \"No SMTP service here\") / Message too big for system',\n 556 => 'Domain does not accept mail',\n ];\n return $codes[$code] ?? '';\n }",
"public function getMessage()\n {\n if ($this->isSuccessful()) {\n return null;\n }\n\n if (isset($this->data['response']['gatewayCode'])) {\n return self::GATEWAY_CODES[$this->data['response']['gatewayCode']];\n }\n\n if (isset($this->data['error'])) {\n return sprintf('[%s] %s', $this->data['error']['cause'], $this->data['error']['explanation']);\n }\n\n return 'Unknown Error';\n }",
"public function getMessage() {\n\n\t\t\tswitch($this->getCode()) {\n\t\t\t\tcase 100: return 'Continue';\n\t\t\t\tcase 101: return 'Switching Protocols';\n\t\t\t\tcase 102: return 'Processing';\n\t\t\t\tcase 200: return 'OK';\n\t\t\t\tcase 201: return 'Created';\n\t\t\t\tcase 202: return 'Accepted';\n\t\t\t\tcase 203: return 'Non-Authoritative Information';\n\t\t\t\tcase 204: return 'No Content';\n\t\t\t\tcase 205: return 'Reset Content';\n\t\t\t\tcase 206: return 'Partial Content';\n\t\t\t\tcase 207: return 'Multi-Status';\n\t\t\t\tcase 208: return 'Already Reported';\n\t\t\t\tcase 226: return 'IM Used';\n\t\t\t\tcase 300: return 'Multiple Choices';\n\t\t\t\tcase 301: return 'Moved Permanently';\n\t\t\t\tcase 302: return 'Found';\n\t\t\t\tcase 303: return 'See Other';\n\t\t\t\tcase 304: return 'Not Modified';\n\t\t\t\tcase 305: return 'Use Proxy';\n\t\t\t\tcase 306: return 'Switch Proxy';\n\t\t\t\tcase 307: return 'Temporary Redirect';\n\t\t\t\tcase 308: return 'Permanent Redirect';\n\t\t\t\tcase 400: return 'Bad Request';\n\t\t\t\tcase 401: return 'Unauthorized';\n\t\t\t\tcase 402: return 'Payment Required';\n\t\t\t\tcase 403: return 'Forbidden';\n\t\t\t\tcase 404: return 'Not Found';\n\t\t\t\tcase 405: return 'Method Not Allowed';\n\t\t\t\tcase 406: return 'Not Acceptable';\n\t\t\t\tcase 407: return 'Proxy Authentication Required';\n\t\t\t\tcase 408: return 'Request Timeout';\n\t\t\t\tcase 409: return 'Conflict';\n\t\t\t\tcase 410: return 'Gone';\n\t\t\t\tcase 411: return 'Length Required';\n\t\t\t\tcase 412: return 'Precondition Failed';\n\t\t\t\tcase 413: return 'Request Entity Too Large';\n\t\t\t\tcase 414: return 'Request-URI Too Long';\n\t\t\t\tcase 415: return 'Unsupported Media Type';\n\t\t\t\tcase 416: return 'Requested Range Not Satisfiable';\n\t\t\t\tcase 417: return 'Expectation Failed';\n\t\t\t\tcase 418: return 'I\\'m a teapot';\n\t\t\t\tcase 419: return 'Authentication Timeout';\n\t\t\t\tcase 420: return 'Enhance Your Calm';\n\t\t\t\tcase 420: return 'Method Failure';\n\t\t\t\tcase 422: return 'Unprocessable Entity';\n\t\t\t\tcase 423: return 'Locked';\n\t\t\t\tcase 424: return 'Failed Dependency';\n\t\t\t\tcase 424: return 'Method Failure';\n\t\t\t\tcase 425: return 'Unordered Collection';\n\t\t\t\tcase 426: return 'Upgrade Required';\n\t\t\t\tcase 428: return 'Precondition Required';\n\t\t\t\tcase 429: return 'Too Many Requests';\n\t\t\t\tcase 431: return 'Request Header Fields Too Large';\n\t\t\t\tcase 444: return 'No Response';\n\t\t\t\tcase 449: return 'Retry With';\n\t\t\t\tcase 450: return 'Blocked by Windows Parental Controls';\n\t\t\t\tcase 451: return 'Redirect';\n\t\t\t\tcase 451: return 'Unavailable For Legal Reasons';\n\t\t\t\tcase 494: return 'Request Header Too Large';\n\t\t\t\tcase 495: return 'Cert Error';\n\t\t\t\tcase 496: return 'No Cert';\n\t\t\t\tcase 497: return 'HTTP to HTTPS';\n\t\t\t\tcase 499: return 'Client Closed Request';\n\t\t\t\tcase 500: return 'Internal Server Error';\n\t\t\t\tcase 501: return 'Not Implemented';\n\t\t\t\tcase 502: return 'Bad Gateway';\n\t\t\t\tcase 503: return 'Service Unavailable';\n\t\t\t\tcase 504: return 'Gateway Timeout';\n\t\t\t\tcase 506: return 'Variant Also Negotiates';\n\t\t\t\tcase 507: return 'Insufficient Storage';\n\t\t\t\tcase 508: return 'Loop Detected';\n\t\t\t\tcase 509: return 'Bandwidth Limit Exceeded';\n\t\t\t\tcase 510: return 'Not Extended';\n\t\t\t\tcase 511: return 'Network Authentication Required';\n\t\t\t\tcase 598: return 'Network read timeout error';\n\t\t\t\tcase 599: return 'Network connect timeout error';\n\t\t\t\tdefault: return 'Unknown Response';\n\t\t\t}\n\n\t\t}",
"public function getError(){\n if (empty($this->getErrorCode())) {\n return null;\n }\n return $this->getErrorCode().': '.$this->getErrorMessage();\n }",
"public function getErrorMessage()\n\t\t{\n\t\t\t$error = $this->statement->errorInfo();\n\t\t\t$errorText \t= '<h6>Something happened ... :(</h6>';\n\t\t\t$errorText .= 'Error code : '.$error[0].'<br>';\n\t\t\t$errorText .= 'Driver error code : '.$error[1].'<br>';\n\t\t\t$errorText .= 'Error Message : '.$error[2].'<br>';\n\t\t\treturn $errorText;\n\t\t}",
"private function getCodeMsg($code)\n\t{\n\t\t$codeMsg = [\n\t\t\t/* 100+ */\n\t\t\t100 => 'Continue', 101 => 'Switching Protocols',\n\n\t\t\t/* 200+ */\n\t\t\t200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content',\n\n\t\t\t/* 300+ */\n\t\t\t300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other',\n\t\t\t304 => 'Not Modified', 305 => 'Use Proxy', 306 => '(Unused)', 307 => 'Temporary Redirect',\n\n\t\t\t/* 400+ */\n\t\t\t400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden',\n\t\t\t404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone',\n\t\t\t411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\n\t\t\t/* 500+ */\n\t\t\t500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported'\n\t\t];\n\n\t\treturn $codeMsg[$code];\n\t}",
"public function getMessage($response_code = null)\n {\n if (is_null($response_code)) {\n $response_code = $this->getCode();\n }\n\n return HTTP::$statusTexts[$response_code];\n }"
] |
[
"0.7506608",
"0.74893034",
"0.7479687",
"0.72988445",
"0.72967196",
"0.7252391",
"0.71906835",
"0.7169486",
"0.7134165",
"0.71326643",
"0.7128417",
"0.71013594",
"0.702751",
"0.7020475",
"0.7017535",
"0.70157695",
"0.7012731",
"0.69851846",
"0.69492877",
"0.69384867",
"0.69180214",
"0.69155717",
"0.6910003",
"0.6903834",
"0.68902683",
"0.6884272",
"0.688021",
"0.68558896",
"0.6853188",
"0.6836554"
] |
0.771796
|
0
|
/query_by_recipe_id.php contains the following functions: 1. printFormattedRecipeInfo 1 parameter: recipe id function: it takes recipe id in as a parameter to display the formatted information including recipe name, plant name, type name, overview goal names, weather names, level names, ingredients, and instructions. 2. printName 1 parameter: recipe id function: it takes recipe id in as a parameter to display the name of the recipe 3. printBrief 1 parameter: recipe id function: it takes recipe id in as a parameter to display the name, plant name, type name and the overview of the recipe 4. printDetailedRecipeInfo 1 parameter: recipe id function: it takes recipe id in as a parameter to display everything. Used for testing.
|
function printFormattedRecipeInfo($this_recipe_id) {
//----------Connecting-------------//
$con = mysqli_connect("localhost","alicornt_sharep","xgGXHBuQWu","alicornt_sharep");
//----------Check connection-------------//
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
//----------Check connection-------------//
//----------Connecting-------------//
//-----------query the row of this recipe_id from recipes table-----------//
$query_recipe = "SELECT * FROM `recipes` WHERE recipe_id='$this_recipe_id'";
$result_query_recipe = $con->query($query_recipe);
$row_recipe = $result_query_recipe->fetch_array();
//-----------query the row of this recipe_id from recipes table-----------//
//---------------define variables storing the recipe's data---------------//
$this_name=$row_recipe['recipe_name']; //string
$this_plant_id=$row_recipe['plant_id']; //int
$this_type_id=$row_recipe['type_id']; //int
$this_goals=$row_recipe['goals']; //serialized array -> string
$this_goals_arr=unserialize($this_goals); //unserialized string -> array
$this_weather=$row_recipe['weather']; //serialized array -> string
$this_weather_arr=unserialize($this_weather); //unserialized string -> array
$this_period=$row_recipe['period'];
$this_time_unit_id=$row_recipe['time_unit_id'];
$this_soil_id=$row_recipe['soil_id'];
$this_level_id=$row_recipe['level_id'];
$this_overview=$row_recipe['overview'];
//---------------define variables storing the recipe's data---------------//
//---------------------------printing defined variables----------------------//
//---------------------------printing defined variables-----------------//
//GETTING NAME
echo "<strong>"."RECIPE NAME"."</strong>"."<br>";
echo $this_name."<br>";
//GETTING PLANT NAME OF THIS PLANT ID
echo "<br>"."<strong>"."PLANT NAME"."</strong>"."<br>";
$query_plant_name = "SELECT * FROM plants WHERE plant_id='$this_plant_id'";
$result_query_plant_name = $con->query($query_plant_name);
$row_this_plant_name = $result_query_plant_name->fetch_array();
$this_plant_name=$row_this_plant_name['plant_name'];
echo $this_plant_name."<br>";
//GETTING TYPE NAME OF THIS PLANT ID
echo "<br>"."<strong>"."FERTILIZER TYPE"."</strong>"."<br>";
$query_type_name = "SELECT * FROM types WHERE type_id='$this_type_id'";
$result_query_type_name = $con->query($query_type_name);
$row_this_type_name = $result_query_type_name->fetch_array();
$this_type_name=$row_this_type_name['types'];
echo $this_type_name."<br>";
//GETTING OVERVIEW
echo "<br>"."<strong>"."OVERVIEW"."</strong>"."<br>";
echo $this_overview."<br>";
//GETTING GOAL NAMES OF THIS GOAL IDs
echo "<br>"."<strong>"."WHAT DOES THIS RECIPE DO?"."</strong>"."<br>";
$query_goals = "SELECT * FROM goals";
$result_query_goals = $con->query($query_goals);
while($row_goal = $result_query_goals->fetch_array())
{
if (in_array($row_goal['goals_id'],$this_goals_arr)) {
//echo "Weather id: ".$row_weather['weather_id']." ";
echo $row_goal['goal_text'] . "<br>";
}
}
//GETTING WEATHER NAMES OF THIS WEATHER IDs
echo "<br>"."<strong>"."SUITABLE IN THE FOLLOWING WEATHER"."</strong>"."<br>";
$query_weather = "SELECT * FROM weather";
$result_query_weather = $con->query($query_weather);
while($row_weather = $result_query_weather->fetch_array())
{
if (in_array($row_weather['weather_id'],$this_weather_arr)) {
//echo "Weather id: ".$row_weather['weather_id']." ";
echo $row_weather['weather'] . "<br>";
}
}
//GETTING TIME PERIOD
echo "<br>"."<strong>"."HOW LONG DOES IT TAKE?"."</strong>"."<br>";
echo $this_period." ";
//GETTING NAME OF TIME UNIT ID
$query_time_unit_name = "SELECT * FROM time_units WHERE time_unit_id='$this_time_unit_id'";
$result_query_time_unit_name = $con->query($query_time_unit_name);
$row_this_time_unit_name = $result_query_time_unit_name->fetch_array();
$this_time_unit_name=$row_this_time_unit_name['time_unit'];
echo $this_time_unit_name."<br>";
//GETTING NAME OF THIS SOIL ID
echo "<br>"."<strong>"."SOIL TYPE"."</strong>"."<br>";
$query_soil_name = "SELECT * FROM soil_types WHERE soil_types_id='$this_soil_id'";
$result_query_soil_name = $con->query($query_soil_name);
$row_this_soil_name = $result_query_soil_name->fetch_array();
$this_soil_name=$row_this_soil_name['soil_types'];
echo $this_soil_name."<br>";
//GETTING NAME OF THIS LEVEL ID
echo "<br>"."<strong>"."DIFFICULTY"."</strong>"."<br>";
$query_level_name = "SELECT * FROM levels WHERE level_id='$this_level_id'";
$result_query_level_name = $con->query($query_level_name);
$row_this_level_name = $result_query_level_name->fetch_array();
$this_level_name=$row_this_level_name['level'];
echo $this_level_name."<br>";
//GETTING INGREDIENTS
//getting all if recipe_id == this_recipe_id
echo "<br>"."<strong>"."INGREDIENTS"."</strong>"."<br>";
$query_ingredients = "SELECT * FROM recipes_ingredients WHERE recipe_id='$this_recipe_id'";
$result_ingredients = $con->query($query_ingredients);
$count=1;
while($row_result_ingredients = $result_ingredients->fetch_array())
{
echo $count.". ";
echo $row_result_ingredients['ingredient']." ";
echo $row_result_ingredients['quantity']." ";
//echo "Unit id: ".$row_result_ingredients['unit_id']."<br>";
$this_unit_id=$row_result_ingredients['unit_id'];
//getting unit name from unit id
$query_unit_name = "SELECT * FROM units WHERE unit_id='$this_unit_id'";
$result_query_unit_name = $con->query($query_unit_name);
$row_this_unit_name = $result_query_unit_name->fetch_array();
$this_unit_name=$row_this_unit_name['unit'];
echo $this_unit_name."<br>";
$count++;
}
//GETTING INSTRUCTIONS
//getting all if recipe_id == this_recipe_id
$one=1;
echo "<br>"."<strong>"."INSTRUCTIONS"."</strong>"."<br>";
$query_instructions = "SELECT * FROM instructions WHERE recipe_id='$this_recipe_id'";
$result_instructions = $con->query($query_instructions);
while($row_result_instructions = $result_instructions->fetch_array())
{
$order=$row_result_instructions['myorder']+$one;
echo $order.". ";
echo $row_result_instructions['instruction']."<br>";
}
echo "<br>";
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function view_recipe($id){\n\t\t$query = $this->db->query(\"\n\t\t\tSELECT re.id re_id, re.name re_nm, re.price re_prc, re.instructions re_ins, re.cooking_time re_ct, re.servings re_se, re.image re_im, re.status re_st, re.created_date re_cd, re.updated_date re_ud, rg.name rg_nm, rg.id rid, co.name co_nm, co.id cid, ing.name in_nm, ring.ingredient_amount in_am\n\t\t\tFROM recipe_ingredients ring\n\t\t\tINNER JOIN ingredients ing ON ring.ingredient_id = ing.id\n\t\t\tRIGHT JOIN recipe re ON ring.recipe_id = re.id\n\t\t\tINNER JOIN country co ON re.country_id = co.id\n\t\t\tINNER JOIN region rg ON co.region_id = rg.id\n\t\t\tWHERE md5(re.id) = '$id'\n\t\t\");\n\t\tif ($query->num_rows() > 0){\n\t\t\treturn $query->result();\n\t\t}else{\n\t\t\treturn NULL;\n\t\t}\n\t}",
"public function getRecipeById($r_id){\r\n require 'database.php';\r\n $sql = \"SELECT * from recipe WHERE recipe_id = $r_id\";\r\n $output = $DB_con->query($sql);\r\n foreach ($output as $outputs) {\r\n echo \"<div class='container'>\";\r\n echo \"<div class='row cardView'>\";\r\n \r\n echo \"<div class='image_enlarged'>\";\r\n echo \"<img src=\" . $outputs['img_src'] . \">\";\r\n echo \"</div>\";\r\n\r\n echo \"<div class='description'>\";\r\n echo \"<h3>\" . $outputs['title'] . \"</h3>\";\r\n echo \"<h5>\" . $outputs['subtitle'] . \"</h5>\";\r\n echo \"<h5> Serving size \" . $outputs['serving_size'] . \"</h5>\";\r\n //function getIngredientsById has purpose to display ingredients \r\n $this->getIngredientsById($r_id);\r\n echo \"<h3 class='price'> \" . $outputs['price'] . \"</h3>\";\r\n echo \"<a href='./recipeapp/confirm.php?id=\" . $r_id . \"'><button class='order'>\" . \"Order Ingredients\" . \"</button></a>\";\r\n \r\n\r\n \r\n echo \"</div>\";\r\n echo \"</div>\";\r\n echo \"</div>\";\r\n \r\n }\r\n }",
"function getRecipe($id)\r\n {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE recipe_id = :id\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameter\r\n $statement->bindParam(':id', $id, PDO::PARAM_STR);\r\n\r\n //execute\r\n $statement->execute();\r\n\r\n //get result\r\n $result = $statement->fetch(PDO::FETCH_ASSOC);\r\n return $result;\r\n }",
"public function recipes($id)\n\t{\n\t\tif (!isset($_SESSION['user']))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/session/new\");\n\t\t\texit;\n\t\t}\n\t\t// this page is only accessable by self and admin (type 2)\n\t\tif (($_SESSION['user']['type'] != 2) && ($_SESSION['user']['id'] != $id))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/{$_SESSION['user']['id']}\");\n\t\t\texit;\n\t\t}\n\t\n\t\tif(!$user = User::findUser(array('user_id' => $id)))\n\t\t{\n\t\t\t// something has gone wrong with db request\n\t\t\theader(\"Location: /myrecipe/users/\".$id);\n\t\t\texit;\n\t\t}\n\t\t$this->template->user = $user[0];\n\t\t\n\t\t// get all the recipes uploaded by the user\n\t\t$myrecipes = Recipe::findRecipe(array('recipes.user_id'=>$id, 'recipe_images.is_cover'=>'yes'));\n\t\t$this->template->myrecipes = $myrecipes;\n/*\t\techo \"<pre>\";\n\t\tprint_r($myrecipes);\n\t\techo \"</pre>\";\n*/\t\n\t\t$this->template->display('recipes.html.php');\n\t}",
"function printTableMealInfo($meal_id, $chef_id, $name, $desc) {\n\t\n\t$meal_contains_query = \"SELECT ing_id FROM MEAL_CONTAINS WHERE meal_id = '$meal_id'\";\n\t$meal_contains_query_res = pg_query($GLOBALS['dbconn'],$meal_contains_query);\n\tif (!$meal_contains_query_res) {\n\t\techo \"An error occurred.\\n\";\n\t\texit;\n\t} else {\n\t\techo \"<br>\";\n\t\techo \"<table style='width:100%'>\";\n\t\techo \"<tr style='font-weight:bold'><td>Meal ID</td>\" . \"<td>Name</td>\" . \"<td>Description</td>\" . \"<td>Ingredient Name</td>\" . \"<td>Count</td>\" . \"<td>Category</td>\" . \"</tr>\";\n\t\twhile ($row = pg_fetch_row($meal_contains_query_res)) { // now we have all the ingredients IDs belonging to this meal\n\t\t\t\n\t\t\t$ing_query = \"SELECT * FROM INGREDIENTS WHERE ing_id = '$row[0]'\";\n\t\t\t$ing_query_res = pg_query($GLOBALS['dbconn'],$ing_query);\n\t\t\t\n\t\t\tif (!$ing_query_res) {\n\t\t\t\techo \"An error occured.\\n\";\n\t\t\t\texit;\n\t\t\t} else {\n\t\t\t\t\twhile ($ing_row = pg_fetch_row($ing_query_res)) {\n\t\t\t\t\techo \"<tr><td>\" . \"$meal_id\" . \"</td><td>\" . \"$name\" . \"</td><td>\" . \"$desc\" . \"</td><td>\" . \"$ing_row[1]\" . \"</td><td>\" . \"$ing_row[4]\" . \"</td><td>\" . \"$ing_row[5]\" . \"</td>\";\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"</table>\";\n\t\techo \"</form>\";\n\t}\n}",
"public function show($id) {\n\n $ingredient = DB::table('ingredients')\n ->join('recipes', 'ingredients.RID', '=', 'recipes.id')\n ->select('ingredients.*', 'recipes.Name as recipeName','recipes.id as recipeID')\n ->where('ingredients.id','=',$id)\n ->get();\n return $ingredient;\n }",
"public function get($id) {\n //SQL\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"\";\n $dbname = \"a2Database\";\n\n // Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n\n $sql = \"SELECT * FROM recipes WHERE code <=> \" . $id . \";\";\n $record = $conn->query($sql);\n $conn->close();\n //SQL//\n return $record;\n }",
"public function show($id){\r\n\t\t$this->template->id = $id;\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::retrieve(array(\"RecipeID\"=>$id));\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\tif(count($recipes) == 1){\r\n\t\t\t$this->template->recipe = $recipes;\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->display('show.html.php');\r\n\t}",
"public function getIngredientsById($r_id)\r\n {\r\n require 'database.php';\r\n $sql = \"SELECT i.ingredient, i.amount, m.measurements FROM `ingredients` AS i LEFT JOIN measurement AS m ON m.id = i.measurement WHERE i.recipe_id = $r_id\";\r\n $output = $DB_con->query($sql);\r\n foreach ($output as $outputs) {\r\n echo \"<p>\" . $outputs['ingredient'] . \" \" . $outputs['amount'] . \" \". $outputs['measurements'] . \"</p>\";\r\n \r\n \r\n }\r\n }",
"public function index($id = null) {\n if ($id == null) {\n \t$ingredient = DB::table('ingredients')\n ->join('recipes', 'ingredients.RID', '=', 'recipes.id')\n ->select('ingredients.*', 'recipes.Name as recipeName')\n ->get();\n return $ingredient;\n } else {\n return $this->show($id);\n }\n }",
"public function getRecipeById($id)\n {\n $stmt = (new Statement())->where(\n function (array $record) use ($id)\n {\n return $record['id'] == $id;\n }\n );\n return $stmt->process($this->reader)->fetchOne(0);\n }",
"function echo_contest_summary_for_id($id) {\n echo_summary_view_for_contest($id);\n}",
"function show_record($dbc, $id){\n\t$query = 'SELECT * FROM stuff WHERE id = ' . $id . '';\n\t\n\t# Execute the query\n\t$results = mysqli_query( $dbc, $query ) ;\n\tcheck_results($results) ;\n\t$row = mysqli_fetch_array( $results, MYSQLI_ASSOC) ;\n\t\n\t\n\t# Show results\n\tif ( $results ) {\n\t\t# Initilizes the table before executing query.\n echo '<DIV>' ;\n\t\techo '<TABLE border = \"1\" align= \"center\" cellpadding=\"5px\" cellspacing=5px border = \"1\" >';\n echo '<TR class=\"id\">';\n echo '<TD>ID:</TD>';\n\t\techo '<TD>'.$row['id'].'</TD>';\n\t\techo '<TR></TR>';\n\t\techo '<TR>';\n echo '<TD>Item Name:</TD>';\n\t\techo '<TD>'.$row['item_name'].'</TD>';\n\t\techo '</TR>';\n\t\techo '<TR>';\n echo '<TD>Location:</TD>' ;\n\t\techo '<TD>'.$row['location_id'].'</TD>';\n\t\techo '</TR>';\n\t\techo '<TR>';\n echo '<TD>Description</TD>';\n\t\techo '<TD>'.$row['description'].'</TD>';\n\t\techo '</TR>';\n\t\techo '<TR>';\n\t\techo '<TD>Created</TD>';\n\t\techo '<TD>'.$row['create_date'].'</TD>';\n\t\techo '</TR>' ;\n\t\techo '<TR>' ;\n\t\techo '<TD>Owner</TD>';\n\t\techo '<TD>'.$row['owner'].'</TD>';\n\t\techo '</TR>' ;\n\t\techo '<TR>' ;\n echo '<TD>Finder</TD>';\n\t\techo '<TD>'.$row['finder'].'</TD>';\n\t\techo '</TR>' ;\n\t\techo '<TR>' ;\n echo '<TD>Status</TD>';\n\t\techo '<TD>'.$row['status'].'</TD>';\n\t\techo '</TR>' ;\n\t\techo '</TABLE>';\n\t\techo '</DIV>';\n\t\t\n\t\t\n # For each row result, generate a table row\n while ( $row = mysqli_fetch_array( $results , MYSQLI_ASSOC ) ) {\n\t\t\techo '<TR class=\"id\">' ;\n echo '<TD>' . $row['id'] . '</TD>' ;\n\t echo '<TD>' . $row['item_name'] . '</TD>' ;\n echo '</TR>' ;\n }\n # End the table\n echo '</TABLE>';\n\n # Free up the results in memory\n mysqli_free_result( $results ) ;\n }\n}",
"function viewRecipe(){\n include(\"../model/recipe.php\");\n $obj=new recipe();\n\n if($obj->viewRecipe()) {\n $row=$obj->fetch();\n echo '{\"result\":1,\"recipes\":[';\n while($row){\n echo json_encode($row);\n $row=$obj->fetch();\n if($row){\n echo \",\";\n }\n }\n echo \"]}\";\n }\n else {\n echo '{\"result\":0}';\n }\n }",
"function show_record ($dbc, $id) {\n\t# Create a query to get the name and price sorted by price\n\t$query = 'SELECT id, lname, fname FROM presidents WHERE id = ' . $id ;\n\n\t# Execute the query\n\t$results = mysqli_query( $dbc , $query) ;\n\tcheck_results($results) ;\n\n\t# Show results\n\tif( $results )\n\t{\n \t\t# But...wait until we know the query succeed before\n \t\t# rendering the table start.\n \t\techo '<H1>Presidents</H1>' ;\n \t\techo '<TABLE>';\n \t\techo '<TR>';\n \t\techo '<TH>ID</TH>';\n \t\techo '<TH>First Name</TH>';\n echo '<TH>Last Name</TH>';\n \t\techo '</TR>';\n\n \t\t# For each row result, generate a table row\n \t\twhile ( $row = mysqli_fetch_array( $results , MYSQLI_ASSOC ) )\n \t\t{\n \t\techo '<TR>' ;\n \t\techo '<TD>' . $row['id'] . '</TD>' ;\n \t\techo '<TD>' . $row['fname'] . '</TD>' ;\n \t\techo '<TD>' . $row['lname'] . '</TD>' ;\n \t\techo '</TR>' ;\n \t\t}\n\n \t\t# End the table\n \t\techo '</TABLE>';\n\n \t\t# Free up the results in memory\n \t\tmysqli_free_result( $results ) ;\n\t}\n}",
"public function get_recipe( $id, $post_data ) {\n\t\tglobal $wpdb;\n\t\t$table = $wpdb->prefix . 'mv_creations';\n\n\t\t$mv_recipe = false;\n\t\tif ( $table === $wpdb->get_var( \"SHOW TABLES LIKE '$table'\" ) ) {\n\t\t\t$rows = $wpdb->get_results( 'SELECT * FROM ' . $table . ' WHERE id=' . intval( $id ) );\n\n\t\t\tif ( is_array( $rows ) && 1 === count( $rows ) ) {\n\t\t\t\t$mv_recipe = (array) $rows[0];\n\t\t\t}\n\t\t}\n\n\t\t// Make sure we found the corresponding recipe, die otherwise.\n\t\tif ( false === $mv_recipe ) {\n\t\t\twp_die( 'Could not find the MV table or recipe.' );\n\t\t}\n\n\t\t$post_id = isset( $mv_recipe['object_id'] ) ? intval( $mv_recipe['object_id'] ) : 0;\n\n\t\t$recipe = array(\n\t\t\t'import_id' => $post_id,\n\t\t\t'import_backup' => array(\n\t\t\t\t'mv_creation_id' => $id,\n\t\t\t),\n\t\t);\n\n\t\t// Recipe type.\n\t\t$recipe['type'] = 'diy' === $mv_recipe['type'] ? 'howto' : 'food';\n\n\t\t// Featured Image.\n\t\t$recipe['image_id'] = $mv_recipe['thumbnail_id'];\n\n\t\t// Simple Matching.\n\t\t$recipe['name'] = $mv_recipe['title'];\n\t\t$recipe['summary'] = $mv_recipe['description'];\n\t\t$recipe['cost'] = $mv_recipe['estimated_cost'];\n\t\t$recipe['author_name'] = $mv_recipe['author'];\n\n\t\tif ( $recipe['author_name'] ) {\n\t\t\t$recipe['author_display'] = 'custom';\n\t\t}\n\n\t\t// Servings.\n\t\t$mv_yield = $mv_recipe['yield'];\n\t\t$match = preg_match( '/^\\s*\\d+/', $mv_yield, $servings_array );\n\t\tif ( 1 === $match ) {\n\t\t\t\t$servings = str_replace( ' ','', $servings_array[0] );\n\t\t} else {\n\t\t\t\t$servings = '';\n\t\t}\n\n\t\t$servings_unit = preg_replace( '/^\\s*\\d+\\s*/', '', $mv_yield );\n\n\t\t$recipe['servings'] = $servings;\n\t\t$recipe['servings_unit'] = $servings_unit;\n\n\t\t// Recipe times. From seconds to minutes.\n\t\t$recipe['prep_time'] = intval( $mv_recipe['prep_time'] ) / 60;\n\t\t$recipe['cook_time'] = intval( $mv_recipe['active_time'] ) / 60;\n\t\t$recipe['custom_time'] = intval( $mv_recipe['additional_time'] ) / 60;\n\t\t$recipe['custom_time_label'] = $mv_recipe['additional_time_label'];\n\t\t$recipe['total_time'] = intval( $mv_recipe['total_time'] ) / 60;\n\n\t\t// Recipe tags.\n\t\t$recipe['tags'] = array();\n\t\t$recipe['tags']['keyword'] = $mv_recipe['keywords'] ? array_map( 'trim', explode( ',', $mv_recipe['keywords'] ) ) : array();\n\n\t\t$taxonomies = array(\n\t\t\t'category' => 'course',\n\t\t\t'mv_cuisine' => 'cuisine',\n\t\t);\n\n\t\tforeach ( $taxonomies as $mv_tag => $wprm_tag ) {\n\t\t\t$terms = get_the_terms( $post_id, $mv_tag );\n\t\t\tif ( $terms && ! is_wp_error( $terms ) ) {\n\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t$recipe['tags'][ $wprm_tag ][] = $term->name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Recipe video.\n\t\tif ( $mv_recipe['external_video'] ) {\n\t\t\t$mv_video = (array) json_decode( $mv_recipe['external_video'] );\n\n\n\t\t\tif ( isset( $mv_video['contentUrl'] ) ) {\n\t\t\t\t$recipe['video_embed'] = $mv_video['contentUrl'];\n\t\t\t}\n\t\t} else if ( $mv_recipe['video'] ) {\n\t\t\t$mv_video = (array) json_decode( $mv_recipe['video'] );\n\n\t\t\tif ( $mv_video['key'] ) {\n\t\t\t\t$key = esc_attr( $mv_video['key'] );\n\t\t\t\t$recipe['video_embed'] = '<div id=\"' . $key . '\"></div><script type=\"text/javascript\" src=\"//video.mediavine.com/videos/' . $key . '.js\" async data-noptimize></script>';\n\t\t\t}\n\t\t}\n\n\t\t// Pinterest Image.\n\t\tif ( $mv_recipe['pinterest_img_id'] ) {\n\t\t\t$recipe['pin_image_id'] = intval( $mv_recipe['pinterest_img_id'] );\n\t\t}\n\n\t\t// Ingredients.\n\t\t$mv_published = (array) json_decode( $mv_recipe['published'] );\n\t\t$mv_ingredients = 'food' === $recipe['type'] ? (array) $mv_published['ingredients'] : (array) $mv_published['materials'];\n\t\t$ingredients = array();\n\t\t$has_ingredient_links = false;\n\n\t\tforeach ( $mv_ingredients as $mv_group_name => $mv_group_ingredients ) {\n\t\t\t$group = array(\n\t\t\t\t'name' => 'mv-has-no-group' === $mv_group_name ? '' : $mv_group_name,\n\t\t\t\t'ingredients' => array(),\n\t\t\t);\n\n\t\t\tforeach ( $mv_group_ingredients as $mv_ingredient ) {\n\t\t\t\t$mv_ingredient = (array) $mv_ingredient;\n\t\t\t\t$text = trim( $mv_ingredient['original_text'] );\n\n\t\t\t\tif ( ! empty( $text ) ) {\n\t\t\t\t\t$ingredient = array(\n\t\t\t\t\t\t'raw' => $text,\n\t\t\t\t\t);\n\n\t\t\t\t\t// Check for ingredient link.\n\t\t\t\t\tif ( $mv_ingredient['link'] ) {\n\t\t\t\t\t\t$ingredient['link'] = array(\n\t\t\t\t\t\t\t'url' => $mv_ingredient['link'],\n\t\t\t\t\t\t\t'nofollow' => '0' === $mv_ingredient['nofollow'] ? 'follow' : 'nofollow',\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$has_ingredient_links = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t$group['ingredients'][] = $ingredient;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$ingredients[] = $group;\n\t\t}\n\t\t$recipe['ingredients'] = $ingredients;\n\n\t\tif ( $has_ingredient_links ) {\n\t\t\t$recipe['ingredient_links_type'] = 'custom';\n\t\t}\n\n\t\t// Equipment.\n\t\t$mv_equipment = (array) $mv_published['tools'];\n\t\t$equipment = array();\n\n\t\tforeach ( $mv_equipment as $mv_group_name => $mv_group_equipment ) {\n\t\t\tforeach ( $mv_group_equipment as $mv_item ) {\n\t\t\t\t$mv_item = (array) $mv_item;\n\t\t\t\t$text = trim( $mv_item['original_text'] );\n\n\t\t\t\tif ( ! empty( $text ) ) {\n\t\t\t\t\t$equipment[] = array(\n\t\t\t\t\t\t'name' => $text,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$recipe['equipment'] = $equipment;\n\n\t\t// Instructions.\n\t\t$mv_instructions = $this->parse_blob( $mv_recipe['instructions'] );\n\t\t$instructions = array();\n\n\t\tforeach ( $mv_instructions as $mv_group ) {\n\t\t\t$group = array(\n\t\t\t\t'name' => trim( strip_tags( $mv_group['name'], '<a><strong><b><em><i><u><sub><sup>' ) ),\n\t\t\t\t'instructions' => array(),\n\t\t\t);\n\n\t\t\tforeach ( $mv_group['items'] as $mv_item ) {\n\t\t\t\t$text = trim( strip_tags( $mv_item, '<a><strong><b><em><i><u><sub><sup><br>' ) );\n\n\t\t\t\t// Find any images.\n\t\t\t\tpreg_match_all( '/\\[mv_img[^\\]]*\\]/i', $mv_item, $img_shortcodes );\n\n\t\t\t\tforeach ( $img_shortcodes[0] as $img_shortcode ) {\n\t\t\t\t\t$img_shortcode = html_entity_decode( $img_shortcode );\n\t\t\t\t\tpreg_match( '/id=\"?\\'?(\\d+)/i', $img_shortcode, $img );\n\n\t\t\t\t\tif ( $img[1] ) {\n\t\t\t\t\t\t$image_id = intval( $img[1] );\n\n\t\t\t\t\t\tif ( $image_id ) {\n\t\t\t\t\t\t\t$group['instructions'][] = array(\n\t\t\t\t\t\t\t\t'text' => $text,\n\t\t\t\t\t\t\t\t'image' => $image_id,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$text = ''; // Only add same text once.\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( $text ) ) {\n\t\t\t\t\t$group['instructions'][] = array(\n\t\t\t\t\t\t'text' => $text,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$instructions[] = $group;\n\t\t}\n\t\t$recipe['instructions'] = $instructions;\n\n\t\t// Nutrition Facts.\n\t\t$recipe['nutrition'] = array();\n\n\t\t$mv_nutrition = (array) $mv_published['nutrition'];\n\n\t\t// Serving size.\n\t\t$mv_serving_size = isset( $mv_nutrition['serving_size'] ) ? trim( $mv_nutrition['serving_size'] ) : '';\n\t\t$match = preg_match( '/^\\s*\\d+/', $mv_serving_size, $servings_array );\n\t\tif ( 1 === $match ) {\n\t\t\t$servings = str_replace( ' ','', $servings_array[0] );\n\t\t} else {\n\t\t\t$servings = '';\n\t\t}\n\n\t\t$servings_unit = preg_replace( '/^\\s*\\d+\\s*/', '', $mv_serving_size );\n\n\t\t$recipe['nutrition']['serving_size'] = $servings;\n\t\t$recipe['nutrition']['serving_unit'] = $servings_unit;\n\n\t\t// Other nutrients.\n\t\t$nutrition_mapping = array(\n\t\t\t'calories' => 'calories',\n\t\t\t'carbohydrates' => 'carbohydrates',\n\t\t\t'protein' => 'protein',\n\t\t\t'total_fat' => 'fat',\n\t\t\t'saturated_fat' => 'saturated_fat',\n\t\t\t'unsaturated_fat' \t=> 'polyunsaturated_fat',\n\t\t\t'trans_fat' => 'trans_fat',\n\t\t\t'cholesterol' => 'cholesterol',\n\t\t\t'sodium' => 'sodium',\n\t\t\t'fiber' => 'fiber',\n\t\t\t'sugar' => 'sugar',\n\t\t\t'sugar_alcohols' => 'sugar_alcohols',\n\t\t);\n\n\t\tforeach ( $nutrition_mapping as $mv_field => $wprm_field ) {\n\t\t\tif ( isset( $mv_nutrition[ $mv_field ] ) && $mv_nutrition[ $mv_field ] ) {\n\t\t\t\t$recipe['nutrition'][ $wprm_field ] = $mv_nutrition[ $mv_field ];\n\t\t\t}\n\t\t}\n\n\t\t// Recipe Notes.\n\t\t$notes = $mv_recipe['notes'];\n\n\t\t// Find any images.\n\t\tpreg_match_all( '/\\[mv_img[^\\]]*\\]/i', $notes, $img_shortcodes );\n\n\t\tforeach ( $img_shortcodes[0] as $img_shortcode_encoded ) {\n\t\t\t$img_shortcode = html_entity_decode( $img_shortcode_encoded );\n\t\t\tpreg_match( '/id=\"?\\'?(\\d+)/i', $img_shortcode, $img );\n\n\t\t\tif ( $img[1] ) {\n\t\t\t\t$image_id = intval( $img[1] );\n\n\t\t\t\tif ( $image_id ) {\n\t\t\t\t\t$image_html = wp_get_attachment_image( $image_id, 'medium' );\n\n\t\t\t\t\tif ( $image_html ) {\n\t\t\t\t\t\t$notes = str_replace( $img_shortcode_encoded, $image_html, $notes );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$recipe['notes'] = $notes;\n\n\t\treturn $recipe;\n\t}",
"public function find($id){\n\n $query = $this->db->prepare('SELECT * FROM recipes WHERE id = ?');\n $query->bind_param(\"s\", $id);\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 }",
"function getInfo($id){\r\n\t\t$this->getQuestion($id);\r\n\t}",
"public function showIngredient($identifier);",
"public function show($id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n return new FoodRecipeResource($foodRecipe);\n }",
"public function show($id)\n {\n return Recipe::findOrFail($id);\n }",
"public function fetchRating( int $recipe_id)\n\t{\n return $this->db->fetchAll(\"SELECT * from rating WHERE recipe_id =?\",[$recipe_id]);\n\t}",
"public function displayRecipe()\n {\n return $this->title . \"by\" . $this->source;\n }",
"function getRecipe($recipe){\n\t $recipeid = $this->getRecipeID($recipe);\n\t\t $list = mysql_fetch_assoc(@mysql_query(\"SELECT * FROM Recipes WHERE RecipeID = '$recipeid'\"));\n\t\t\t \n\t\t\t $name =$list['RecipeName'];\n\t\t\t $url= $list['URL'] ;\n\t\t $img = $list['Image'];\n\t\t $time = $list['TotalCookingTime'] ;\n\t\t\t//$ingredients = \"\";\n\t\t $ingredients = $this->getRecipeIngredients($recipe);\n\t\t $instructions = $list['Instructions'];\n\t\t\t $array = array($name,$url,$img,$time,$ingredients,$instructions);\n\t\t\t return json_encode($array);\n\t \n\t}",
"function displayRecipes(){\r\n global $allRecipes;\r\n global $totRecipes;\r\n global $first;\r\n global $last;\r\n global $usertype;\r\n \r\n if(($totRecipes <= 0)|| (is_null($allRecipes))){\r\n echo \"<tr>\";\r\n echo \"<td align=\\\"center\\\" colspan=\\\"5\\\" class=\\\"searchresultbg\\\" width=\\\"468\\\"><i>no recipes found</i></td>\";\r\n echo \"</tr>\";\r\n } else{\r\n\r\n\r\n// foreach ($allRecipes as $recipe){\r\n \t\tfor($counter = ($first-1); $counter<$last; $counter += 1){\r\n\t\r\n $name_id = $allRecipes[$counter][0];\r\n $name = $allRecipes[$counter][1];\r\n $source = $allRecipes[$counter][2];\r\n $allergens = $allRecipes[$counter][4];\r\n\t\t\t\r\n\t\tif ($counter % 2 == 0){\r\n\t\t\techo \"<tr>\";\r\n\t\t\techo \"<input type=hidden id=\\\"srid\\\" name=\\\"sr\\\" value=>\";\r\n\t\t\techo \"<td align=\\\"center\\\" class=\\\"searchresultbgeven\\\" width=\\\"30\\\">\";\r\n\t\t\tif ($usertype == 'admin'){\r\n\t\t\techo \"<input type=checkbox name=list[] value=\\\"\";\r\n\t\t\techo \"\". $name_id . \"\\\" class=\\\"defaultfont\\\">\";\r\n\t\t\t}\r\n\t\t\techo \"</td>\";\r\n\t\t\techo \"<td align=\\\"left\\\" class=\\\"searchresultbgeven\\\" width=\\\"238\\\"> <a class=\\\"resultlinkeven\\\" href=\\\"http://kidswithfoodallergies.org/recipes/showrecipe.php?id=\".$name_id.\"\\\">\".$name.\"</a></td>\";\r\n\t\t\techo \"<td align=\\\"left\\\" class=\\\"resultlinkeven\\\" width=\\\"100\\\"> \". $source .\"</td>\";\r\n\t\t\techo \"<td align=\\\"left\\\" class=\\\"resultlinkeven\\\" width=\\\"100\\\"> \" . $allergens . \"</td>\";\r\n\t\t\techo \"</tr>\";\r\n\t\t} else {\r\n\t\t\techo \"<tr>\";\r\n\t\t\techo \"<input type=hidden id=\\\"srid\\\" name=\\\"sr\\\" value=>\";\r\n\t\t\techo \"<td align=\\\"center\\\" class=\\\"searchresultbgodd\\\" width=\\\"30\\\">\";\r\n\t\t\tif ($usertype == 'admin'){\r\n\t\t\techo \"<input type=checkbox name=list[] value=\\\"\";\r\n\t\t\techo \"\". $name_id . \"\\\" class=\\\"defaultfont\\\">\";\r\n\t\t\t}\r\n\t\t\techo \"</td>\";\r\n\t\t\techo \"<td align=\\\"left\\\" class=\\\"searchresultbgodd\\\" width=\\\"238\\\"> <a class=\\\"resultlinkodd\\\" href=\\\"showrecipe.php?id=\" . $name_id . \"\\\">\" . $name . \"</a></td>\";\r\n\t\t\techo \"<td align=\\\"left\\\" class=\\\"resultlinkodd\\\" width=\\\"100\\\"> \". $source .\"</td>\";\r\n\t\t\techo \"<td align=\\\"left\\\" class=\\\"resultlinkodd\\\" width=\\\"100\\\"> \" . $allergens . \"</td>\";\r\n\t\t\techo \"</tr>\";\t\t\t\r\n\t\t}\r\n }\r\n }\r\n}",
"function Recipe($id=0, $name='', $ethnic='NULL', $base='NULL', $course='NULL', $time='NULL', $difficulty='NULL', $directions='', $comments='',\n\t\t$serving=0, $source=0, $source_desc='', $user=NULL, $private='FALSE', $picture='', $picture_type='', $picture_oid=NULL) {\n\t\tglobal $DB_LINK, $SMObj;\n\t\t// Initial a new Recipe Object\n\t\t$this->id = $id;\n\t\t$this->name = $name;\n\t\t$this->ethnic = $ethnic;\n\t\t$this->base = $base;\n\t\t$this->course = $course;\n\t\t$this->prep_time = $time;\n\t\t$this->difficulty = $difficulty;\n\t\t$this->directions = $directions;\n\t\t$this->comments = $comments;\n\t\t$this->serving_size = $serving;\n\t\t$this->source = $source;\n\t\t$this->source_desc = $source_desc;\n\t\t$this->picture = $picture;\n\t\t$this->picture_type = $picture_type;\n\t\t$this->picture_oid = $picture_oid;\n\t\tif ($user == \"\" || $user == NULL) {\n\t\t\t$this->user = $SMObj->getUserID();\n\t\t} else {\n\t\t\t$this->user = $user;\n\t\t}\n\n\t\tif ($this->source=='')\n\t\t\t$this->source = 'NULL';\n\n\t\t$this->modified = $DB_LINK->DBDate(time()); // set the current date\n\t\t$this->unitSystem = Units::getLocalSystem();\n\n\t\tif ($private == \"TRUE\") $this->private = $DB_LINK->true;\n\t\telse $this->private = $DB_LINK->false;\n\t}",
"public function getCraftRecipe(RecipeManager $service, $id)\n {\n $recipe = Recipe::find($id);\n $selected = [];\n\n if(!$recipe || !Auth::user()) abort(404);\n\n // foreach ingredient, search for a qualifying item in the users inv, and select items up to the quantity, if insufficient continue onto the next entry\n // until there are no more eligible items, then proceed to the next item\n $selected = $service->pluckIngredients(Auth::user(), $recipe);\n\n $inventory = UserItem::with('item')->whereNull('deleted_at')->where('count', '>', '0')->where('user_id', Auth::user()->id)->get();\n\n return view('home.crafting._modal_craft', [\n 'recipe' => $recipe,\n 'categories' => ItemCategory::orderBy('sort', 'DESC')->get(),\n 'item_filter' => Item::orderBy('name')->get()->keyBy('id'),\n 'inventory' => $inventory,\n 'page' => 'craft',\n 'selected' => $selected\n ]);\n }",
"function getResourceDesc($id){\n return sqlSelectOne(\"SELECT * FROM resources WHERE resource_id={$id}\", 'resource_identifier');\n}",
"public function profile($id)\n\t{\n\t\tif (!isset($_SESSION['user']))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/session/new\");\n\t\t\texit;\n\t\t}\n\t\t// this page is only accessable by self and admin (type 2)\n\t\tif (($_SESSION['user']['type'] != 2) && ($_SESSION['user']['id'] != $id))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/{$_SESSION['user']['id']}\");\n\t\t\texit;\n\t\t}\n\t\n\t\t//get the user with id\n\t\t$user = User::findUser(array('user_id' => $id));\n\t\t$this->template->user = $user[0];\n\t\t\n\t\t$recipesArray = array();\n\t\t$commentsArray = array();\n\t\t$favouritesArray = array();\n\t\t\n\t\t$myrecipes = Recipe::findRecipe(array('recipes.user_id'=>$id, 'recipe_images.is_cover'=>'yes'));\n\t\tif (count($myrecipes)!=0)\n\t\t{\n\t\t\t$max_recipe = min(3, count($myrecipes)) - 1;\n\t\t\tfor ($i=0; $i<min(3, count($myrecipes)); $i++)\n\t\t\t{\n\t\t\t\t$recipesArray[$i] = $myrecipes[$max_recipe-$i];\n\t\t\t}\n\t\t}\n\t\t$this->template->myrecipes = $recipesArray;\n\t\t\n\t\t$mycomments = Comments::findComments(array('user_id'=>$id));\n\t\tif (count($mycomments)!=0)\n\t\t{\n\t\t\t$max_comment = min(3, count($mycomments)) - 1;\n\t\t\tfor ($i=0; $i<min(3, count($mycomments)); $i++)\n\t\t\t{\n\t\t\t\t$commentsArray[$i] = $mycomments[$max_comment-$i];\n\t\t\t}\n\t\t}\n\t\t$this->template->mycomments = $commentsArray;\n\t\t\n\t\t$myfavourites = Favourites::findFavourites(array('favourites.user_id'=>$id, 'recipe_images.is_cover'=>'yes'));\n\t\tif (count($myfavourites)!=0)\n\t\t{\n\t\t\t$max_favourite = min(3, count($myfavourites)) - 1;\n\t\t\tfor ($i=0; $i<min(3, count($myfavourites)); $i++)\n\t\t\t{\n\t\t\t\t$favouritesArray[$i] = $myfavourites[$max_favourite-$i];\n\t\t\t}\n\t\t}\n\t\t$this->template->myfavourites = $favouritesArray;\n\t\t\n\t\t$recipes = Recipe::findRecipe(array('recipe_images.is_cover'=>'yes'));\n\t\t$this->template->recipes = $recipes;\n\t\t\n\t\t$this->template->display('profile.html.php');\n\t}",
"function getRecipe($filter=false){\n\t\t$strQuery=\"select Name, energy,fat,saturatedfat,transfat,cholestrol,carbohydrates,sugars,fiber,proteins,salt,sodium,vitamina,vitaminc,calcium,iron\n\t\t\t\t\tfrom recipes\";\n\t\tif($filter!=false){\n\t\t\t$strQuery=$strQuery . \" where $filter limit 12\";\n\t\t}\n\t\treturn $this->query($strQuery);\n\t}"
] |
[
"0.71254385",
"0.6939311",
"0.67230093",
"0.6485231",
"0.6243276",
"0.62108517",
"0.6173122",
"0.61598927",
"0.6009948",
"0.5921597",
"0.5895817",
"0.5874103",
"0.58424115",
"0.5784402",
"0.57610095",
"0.5751357",
"0.57439125",
"0.5737293",
"0.5716694",
"0.5709051",
"0.57090276",
"0.5694104",
"0.56520885",
"0.56510466",
"0.5641082",
"0.5640369",
"0.5634477",
"0.56283325",
"0.56092685",
"0.560837"
] |
0.69756323
|
1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.