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 |
---|---|---|---|---|---|---|
Checks if this title has trophy groups. These groups are typically DLC trophies.
|
public function hasTrophyGroups(): bool
{
return $this->pluck('hasTrophyGroups');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function hasGroups(){\n return $this->_has(1);\n }",
"public function hasGroups(){\n return $this->_has(3);\n }",
"public function hasGroups(){\n return $this->_has(4);\n }",
"public function hasGroups(){\n return $this->_has(4);\n }",
"public function is_group(){\n return is_array($this->controls) && count($this->controls) > 1;\n }",
"public function isGroup(){\n\t\t\n\t\t$this->validateInited();\n\t\t\n\t\t$arrChildren = UniteFunctionsWPUC::getPostChildren($this->post);\n\t\t\t\t\n\t\tif(!empty($arrChildren))\n\t\t\treturn(true);\n\t\t\n\t\treturn(false);\n\t}",
"public function hasGroup()\n {\n return $this->_has('_group');\n }",
"public function isGroup() : bool\n {\n $distinguishingDigit = substr($this->rawGroundWithoutSnow, 0, 1);\n\n return strcasecmp($distinguishingDigit, self::DIGIT) == 0;\n }",
"private function groups_check(){\n\t\t\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$needed_groups = $production_formats->get_product_groups( $this->slug );\n\t\t$needed_groups_ = array_flip( $needed_groups );\n\t\t$todo_groups = $this->get_todo_groups();\n\t\tforeach ($todo_groups as $key => $value) {\t\t\n\t\t\tif ( array_key_exists( $key, $needed_groups_)) {\n\t\t\t\t$index = $needed_groups_[ $key ];\n\t\t\t\tunset($needed_groups[ $index ]);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( count( $needed_groups) > 0) {\n\t\t\t\t\t\n\t\t}\n\t}",
"public function hasSubGroups()\n\t{\n\t\treturn count($this->_subGroups) > 0;\n\t}",
"public function hasGroupBy()\n\t\t{\n\t\t\treturn (count($this->groupby) > 0);\n\t\t}",
"public function isGroup()\n {\n return true;\n }",
"public function hasGroup()\n {\n return isset($this->arrConfig['group']);\n }",
"public function hasTrophies(): bool\n {\n $value = $this->pluck('definedTrophies');\n\n return isset($value) && !empty($value);\n }",
"public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"public function hasDataGroups() {\n\t\treturn !empty($this->dataGroups);\n\t}",
"function hasInstanceGroups() {\n\t\treturn $this->_grouping->hasInstanceGroups();\n\t}",
"public function hasAllGroups(...$groups): bool;",
"function is_group_ell( $group_id ) {\n\t$class_id = get_post_meta( $group_id, 'class', true );\n\n\treturn is_class_ell( $school_id );\n}",
"public function hasAnyGroup(...$groups): bool;",
"public function allowed_group_any()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$result = FALSE;\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ($k === TRUE OR $k == 'y')\n\t\t\t{\n\t\t\t\t$result = TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function hasGroups( $group_names )\n {\n foreach ( $group_names as $group_name )\n {\n if ( ! $this->hasGroup( $group_name ) )\n {\n return false;\n }\n }\n\n return true;\n }",
"public function hasGroupStack()\n {\n return ! empty($this->groupStack);\n }",
"function medigroup_mikado_post_has_title() {\n return get_the_title() !== '';\n }",
"function check ($groups=NULL)\n\t{\n\t\t//header ('Location: index_alpha.php');\n\t\t//echo //\"hello\";\n\t\tglobal $xnyo_parent;\n\n\t\t// no groups? bleh, guess they can go in\n\t\tif (is_null($groups) || empty($groups))\n\t\t\treturn true;\n\n\t\t// a string? split it into the array\n\t\tif (!is_array($groups))\n\t\t\t$groups = explode(\",\", preg_replace('/\\s/', '', $groups));\n\n\t\t// If not allowed to be logged in\n\t\tif (in_array('none', $groups))\n\t\t\tif (!empty($xnyo_parent->user->username))\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t\n\t\t// guess we have to be logged in then hey\n\t\t//if (empty($xnyo_parent->user->user)) {\t//\tfuck\t\t\t\t\n\t\tif (empty($xnyo_parent->user['user'])) {\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//print_r($groups);\n\t\t//echo \"HELLO<br>\";\n\t\t// required to be logged in, and they are\n\t\tif (in_array('required', $groups) || in_array('all', $groups))\n\t\t\treturn true;\n\n\t\t// ok, cycle the list\n\t\tforeach ($groups as $group) {\n\n\t\t\t// if its their username, fire away\n\t\t\tif (strtoupper($group) == strtoupper($_SESSION['auth']['user']))\n\t\t\t\treturn true;\n\n\t\t\tif (is_array($_SESSION['auth']['groups']))\n\t\t\t{\n\t\t\t\t// make the group into a regexp\n\t\t\t\t$group = preg_replace(\"/\\*/\", \".*?\", $group);\n\t\t\t\t$group = preg_replace(\"/([\\@\\(\\)\\|\\[\\]])/\", \"\\\\\\\\\\\\1\", $group);\n\n\t\t\t\t// see if our regexp matches a current group\n\t\t\t\tforeach ($_SESSION['auth']['groups'] as $var)\n\t\t\t\t\tif (preg_match(\"/$group/i\", $var))\n\t\t\t\t\t\treturn true;\n\n\t\t\t}\n\t\t}\n\n\t\t// guess they arent allowed in hey\n\t\treturn false;\n\n\t}",
"function charity_is_hope_team_is_taxonomy($tax, $query=null) {\n\t\tif (!empty($tax))\n\t\t\treturn $tax;\n\t\telse \n\t\t\treturn $query && $query->get('team_group')!='' || is_tax('team_group') ? 'team_group' : '';\n\t}",
"function tp_is_group_page() {\n\n\tif ($group = page_owner_entity()) {\n\t\tif ($group instanceof ElggGroup)\n\t\t\treturn true;\n\t}\n\n\treturn false;\n}",
"function validate_todos_groups(){\n\t\t$todo_groups = $this->get_todo_groups();\n\n\t\tforeach ( $todo_groups as $group_name => $group) {\n\t\t\t$ok = false;\n\t\t\tforeach ($group as $process_name => $process) {\n\t\t\t\t$pattern = '/pa_format|pa_'.$group_name.'_format/';\n\t\t\t\tif ( preg_match( $pattern, $process_name ) ) {\n\t\t\t\t\t$ok = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !$ok) {\n\t\t\t\t$todo_groups[ $group_name ][ 'pa_format' ] = array(\n\t\t\t\t\t'class_name' => 'pa_format'\n\t\t\t\t);\t\n\t\t\t}\n\n\t\t}\n\n\t\t$this->todo_groups = $todo_groups;\t\t\n\t\t$this->groups_check();\n\t\t$this->conflict_check();\n\t}",
"public function getGroupGen()\r\n\t{\r\n\t\treturn (trim($this->groupGen) === '1');\r\n\t}",
"public function hasGroup(): bool\n {\n return $this->has(GroupAttributeValue::OID);\n }"
] |
[
"0.61729485",
"0.61393493",
"0.61215264",
"0.61215264",
"0.60817313",
"0.59335977",
"0.58705825",
"0.578532",
"0.57577527",
"0.57046217",
"0.55779344",
"0.5540533",
"0.5407568",
"0.54036504",
"0.5375641",
"0.5366624",
"0.5348328",
"0.5328382",
"0.5313273",
"0.52999413",
"0.52544457",
"0.5237165",
"0.5216475",
"0.5205874",
"0.51816106",
"0.517159",
"0.51687765",
"0.5143576",
"0.513557",
"0.51285654"
] |
0.7091644
|
0
|
Gets the icon URL for the title.
|
public function iconUrl(): string
{
return $this->pluck('trophyTitleIconUrl');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function kind_icon_url ()\n {\n switch ($this->kind)\n {\n case History_item_published:\n return '{icons}indicators/released';\n case History_item_abandoned:\n return '{icons}buttons/abandon';\n case History_item_queued:\n return '{icons}buttons/queue';\n case History_item_unpublished:\n return '{icons}buttons/unpublish';\n default:\n return parent::kind_icon_url ();\n }\n }",
"public function getIconUrl(): string\n {\n return $this->iconUrl;\n }",
"public function kind_icon_url ()\n {\n switch ($this->kind)\n {\n case History_item_deleted:\n return '{icons}indicators/deleted';\n case History_item_restored:\n return '{icons}indicators/restored';\n case History_item_hidden:\n return '{icons}indicators/hidden';\n case History_item_hidden_update:\n return '{icons}indicators/hidden_update';\n case History_item_locked:\n return '{icons}indicators/locked';\n default:\n return parent::kind_icon_url ();\n }\n }",
"public function get_icon() {\n\t\treturn 'eicon-image';\n\t}",
"public function get_icon()\n {\n return 'fa fa-image';\n }",
"protected function _getSiteTitleImage(): string\n {\n $action = $this->_action();\n\n $image = $action->getConfig('scaffold.site_title_image');\n if (empty($image)) {\n $image = '';\n }\n\n return $image;\n }",
"public function get_icon() {\n\t\treturn 'fa fa-images';\n\t}",
"public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}",
"function get_icon() {\n\t\treturn $this->settings['icon'];\n\t}",
"public function get_icon() {\n\t\tglobal $wc_authorize_sim;\n\n\t\t$icon = '';\n\n\t\t$icon = '<img src=\"' . esc_url( $wc_authorize_sim->force_ssl( $wc_authorize_sim->plugins_url('assets/images/authorize-net-co.png') ) ) . '\" alt=\"' . esc_attr( $this->title ) . '\" />';\n\n\t\treturn apply_filters( 'woocommerce_authorize_sim_icon', $icon, $this->id );\n\t}",
"public function getIcon() {\n\t\t//regex is used to check if there's a filename within the iconFile string\n\t\treturn preg_replace('/^.*\\/([^\\/]+\\.(gif|png))?$/i', '\\1', $this->iconFile) ? $this->iconFile : '';\n\t}",
"public function icon()\n {\n return $this->icon;\n }",
"public function getIcon()\n {\n return ModuleResourceLoader::resourceURL(\n 'silverstripe/framework:client/images/app_icons/folder_icon_large.png'\n );\n }",
"public function iconUrl(): string\n {\n return $this->groupIconUrl;\n }",
"public function icon(): string;",
"private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}",
"private function get_icon()\n\t{\n\t\treturn $this->m_icon;\n\t}",
"public function getIcon(): string\n {\n return $this->icon ?: static::DEFAULT_ICON;\n }",
"public function get_source_icon_name() {\n return 'bp-logo-head';\n }",
"public function outputIconTitle($model, $title = null) {\n\t\tif ($model instanceof Model) {\n\t\t\t$model = $model->admin;\n\t\t}\n\n\t\tif (!$title && isset($model['title'])) {\n\t\t\t$title = $model['title'];\n\t\t}\n\n\t\tif ($model['iconClass']) {\n\t\t\t$title = $this->Html->tag('span', ' ', array(\n\t\t\t\t'class' => 'model-icon ' . $model['iconClass']\n\t\t\t)) . ' ' . $title;\n\t\t}\n\n\t\treturn $title;\n\t}",
"public function getIconName() {}",
"public function getIconName() {}",
"public function getIconName() {}",
"public function getIconName() {}",
"public function get_icon() {\n\t\treturn 'eicon-product-images';\n\t}",
"public static function iconPath()\n {\n return Craft::getAlias('@seibertio/elasticsearch/icon.svg');\n }",
"public function getIcon()\n {\n return $this->get(self::_ICON);\n }",
"function atom_site_icon()\n {\n }",
"public function get_image_title()\n {\n }",
"public function get_icon() {\n return 'eicon-youtube';\n }"
] |
[
"0.7112706",
"0.7104242",
"0.702835",
"0.6930468",
"0.6807157",
"0.6645729",
"0.6640553",
"0.6575832",
"0.65580004",
"0.65063804",
"0.6490686",
"0.64880365",
"0.64684904",
"0.6467012",
"0.6465994",
"0.64631146",
"0.64631146",
"0.64240724",
"0.640945",
"0.63886124",
"0.63468146",
"0.63468146",
"0.6346679",
"0.6346679",
"0.6333946",
"0.63260275",
"0.6293197",
"0.627765",
"0.62716734",
"0.6253555"
] |
0.796552
|
0
|
Gets the platform(s) this title is for.
|
public function platform(): array
{
$platforms = [];
foreach (explode(",", $this->pluck('trophyTitlePlatform')) as $platform) {
$platforms[] = ConsoleType::tryFrom($platform);
}
return $platforms;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getPlatforms()\n {\n return $this->platforms;\n }",
"public function getPlatforms()\n {\n if (array_key_exists(\"platforms\", $this->_propDict)) {\n return $this->_propDict[\"platforms\"];\n } else {\n return null;\n }\n }",
"public function platform()\n\t{\n\t\t$this->platforms = array(\n\t\t\t'/windows nt 10/i' \t=> 'Windows 10',\n '/windows nt 6.3/i' => 'Windows 8.1',\n '/windows nt 6.2/i' => 'Windows 8',\n '/windows nt 6.1/i' => 'Windows 7',\n '/windows nt 6.0/i' => 'Windows Vista',\n '/windows nt 5.2/i' => 'Windows Server 2003/XP x64',\n '/windows nt 5.1/i' => 'Windows XP',\n '/windows xp/i' => 'Windows XP',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n\t\t\t'/ubuntu/i' => 'Ubuntu',\n '/linux/i' => 'Linux',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile',\n '/android/i'\t\t\t=> \t'Android'\n\t\t);\n\t\t\n\t\tforeach($this->platforms as $key => $value)\n\t\t{\n\t\t\tif(preg_match($key,$this->ua))\n\t\t\t\treturn $this->platform = $value;\n\t\t}\n\n\t\treturn $this->platform = \"Unknown Platform\";\n\t}",
"public function getPlatforms(): ?array\n {\n return $this->platforms;\n }",
"public function getOS() { \n \n $server_data = $_SERVER['HTTP_USER_AGENT'];\n\n $os_platform = \"Unknown OS Platform\";\n\n $os_array = array(\n '/windows nt 10/i' => 'Windows',\n '/windows nt 6.3/i' => 'Windows',\n '/windows nt 6.2/i' => 'Windows',\n '/windows nt 6.1/i' => 'Windows',\n '/windows nt 6.0/i' => 'Windows',\n '/windows nt 5.2/i' => 'Windows',\n '/windows nt 5.1/i' => 'Windows',\n '/windows xp/i' => 'Windows',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n\n foreach ($os_array as $regex => $value) { \n\n if (preg_match($regex, $server_data)) {\n $os_platform = $value;\n }\n } \n\n return $os_platform;\n }",
"public function getPlatform()\n {\n return $this->platform;\n }",
"public function getPlatform()\n\t{\n\t\treturn $this->platform;\n\t}",
"public static function getCurrentPlatform() {\n\t\t$version = new JVersion();\n\t\t$filter = &JFilterInput::getInstance();\n\t\t$name = strtolower($filter->clean($version->PRODUCT, 'cmd'));\n\t\treturn Array('name'=>$name, 'version'=>$version->getShortVersion());\n\t}",
"public function getPlatformTypes(): array\n {\n return $this->platformTypes;\n }",
"public function getPlatform()\n {\n return $this->parser->getPlatform();\n }",
"public function getPlatform()\n\t{\n\n\t\treturn $this->getModelRow('platform');\n\t}",
"function platform(){\n\n\t\treturn (new user_agent)->platform();\n\n\t}",
"public function platform()\n {\n // TODO\n }",
"abstract protected function getPlatforms(): array;",
"public function getPrimaryPlatform() {}",
"public function getOS() {\n\n return array(\n 'AIX' => 'AIX',\n 'AND' => 'Android',\n 'AMG' => 'AmigaOS',\n 'ATV' => 'Apple TV',\n 'ARL' => 'Arch Linux',\n 'BTR' => 'BackTrack',\n 'SBA' => 'Bada',\n 'BEO' => 'BeOS',\n 'BLB' => 'BlackBerry OS',\n 'QNX' => 'BlackBerry Tablet OS',\n 'BMP' => 'Brew',\n 'CES' => 'CentOS',\n 'COS' => 'Chrome OS',\n 'CYN' => 'CyanogenMod',\n 'DEB' => 'Debian',\n 'DFB' => 'DragonFly',\n 'FED' => 'Fedora',\n 'FOS' => 'Firefox OS',\n 'FIR' => 'Fire OS',\n 'BSD' => 'FreeBSD',\n 'GNT' => 'Gentoo',\n 'GTV' => 'Google TV',\n 'HPX' => 'HP-UX',\n 'HAI' => 'Haiku OS',\n 'IRI' => 'IRIX',\n 'INF' => 'Inferno',\n 'KNO' => 'Knoppix',\n 'KBT' => 'Kubuntu',\n 'LIN' => 'GNU/Linux',\n 'LBT' => 'Lubuntu',\n 'VLN' => 'VectorLinux',\n 'MAC' => 'Mac',\n 'MAE' => 'Maemo',\n 'MDR' => 'Mandriva',\n 'SMG' => 'MeeGo',\n 'MCD' => 'MocorDroid',\n 'MIN' => 'Mint',\n 'MLD' => 'MildWild',\n 'MOR' => 'MorphOS',\n 'NBS' => 'NetBSD',\n 'MTK' => 'MTK / Nucleus',\n 'WII' => 'Nintendo',\n 'NDS' => 'Nintendo Mobile',\n 'OS2' => 'OS/2',\n 'T64' => 'OSF1',\n 'OBS' => 'OpenBSD',\n 'PSP' => 'PlayStation Portable',\n 'PS3' => 'PlayStation',\n 'RHT' => 'Red Hat',\n 'ROS' => 'RISC OS',\n 'REM' => 'Remix OS',\n 'RZD' => 'RazoDroiD',\n 'SAB' => 'Sabayon',\n 'SSE' => 'SUSE',\n 'SAF' => 'Sailfish OS',\n 'SLW' => 'Slackware',\n 'SOS' => 'Solaris',\n 'SYL' => 'Syllable',\n 'SYM' => 'Symbian',\n 'SYS' => 'Symbian OS',\n 'S40' => 'Symbian OS Series 40',\n 'S60' => 'Symbian OS Series 60',\n 'SY3' => 'Symbian^3',\n 'TDX' => 'ThreadX',\n 'TIZ' => 'Tizen',\n 'UBT' => 'Ubuntu',\n 'WTV' => 'WebTV',\n 'WIN' => 'Windows',\n 'WCE' => 'Windows CE',\n 'WIO' => 'Windows IoT',\n 'WMO' => 'Windows Mobile',\n 'WPH' => 'Windows Phone',\n 'WRT' => 'Windows RT',\n 'XBX' => 'Xbox',\n 'XBT' => 'Xubuntu',\n 'YNS' => 'YunOs',\n 'IOS' => 'iOS',\n 'POS' => 'palmOS',\n 'WOS' => 'webOS'\n );\n }",
"public function getPlatform()\n {\n return Shopware_Plugins_Frontend_NostoTagging_Bootstrap::PLATFORM_NAME;\n }",
"private function extract_platform($products) {\n if ( empty($products) ) return;\n $product = $products[0];\n $os_list = array();\n // Strings that indicate a particular OS...\n $oses = array(\n 'Linux' => 'unix',\n 'Macintosh' => 'mac',\n 'Mac OS X' => 'mac',\n 'PowerPC' => 'mac',\n 'FreeBSD' => 'unix',\n 'NetBSD' => 'unix',\n 'OpenBSD' => 'unix',\n 'SunOS' => 'unix',\n 'Amiga' => 'amiga',\n 'BeOS' => 'beos',\n 'IRIX' => 'unix',\n 'OS/2' => 'os2',\n 'Warp' => 'os2'\n );\n // Strings that definitely indicate an OS...\n $def_oses = array(\n 'iPhone' => 'iphone',\n 'Android' => 'android',\n 'iPad' => 'ipad',\n 'iPod' => 'ipod'\n );\n // Look at each element in comment separated by semicolon\n // Test each one for certain strings, if it exists add to the 'possible' list\n foreach( explode(';', $product[2]) as $element ) {\n $element = trim($element);\n // Is it Windows ME?\n if ( $element == 'Win 9x 4.90' ) {\n $this->platform = 'Windows ME';\n return;\n }\n if ( strtolower(substr($element, 0, 3)) == 'win' ) {\n $os_list[] = $element;\n continue;\n }\n // Did we find anything certain?\n foreach( $def_oses as $test => $os ) {\n if ( strpos($element, $test) !== false ) {\n $this->platform = $element;\n return;\n }\n }\n // Did we find anything possible?\n foreach( $oses as $test => $os ) {\n if ( strpos($element, $test) !== false ) {\n $os_list[] = $element;\n continue;\n }\n }\n }\n if ( count($os_list) > 0 ) {\n // guess it's the first one.\n $this->platform = $os_list[0];\n return;\n }\n }",
"public function platform(): string;",
"private function getPlatformDetails()\n {\n $version = $this->agent->version($this->agent->platform());\n $pieces = explode('.', str_replace('_', '.', $version));\n\n return [\n 'major' => $pieces[0] ?? 0,\n 'minor' => $pieces[1] ?? 0,\n 'float' => (float)sprintf('%s.%s', $pieces[0] ?? 0, $pieces[1] ?? 0),\n ];\n }",
"public function getUserAgentPlatform()\n {\n return UTIL_Browser::getPlatform($_SERVER['HTTP_USER_AGENT']);\n }",
"function getOS() { \n\n $user_agent = $_SERVER['HTTP_USER_AGENT'];\n\n $os_platform = \"UnknownOS\";\n\n $os_array = array(\n '/Windows Phone/i' => 'Windows Phone',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n\n foreach ($os_array as $regex => $value) { \n\n if (preg_match($regex, $user_agent)) {\n $os_platform = $value;\n }\n\n } \n\n return $os_platform;\n\n}",
"public function getPlatform()\n {\n $value = $this->get(self::platform);\n return $value === null ? (integer)$value : $value;\n }",
"private function getPlatform()\n\t{\n\t\t$this->platform = mt_rand(1, 3);\n\n\t\treturn $this->platform;\n\t}",
"protected function getPlatformKeywordList()\n {\n return $this->factory->getPlatformKeywordList();\n }",
"public function getPlatformKeywordList();",
"public static function getOperatingSystems()\n\t\t{\n\t\t\treturn self::$operatingSystems;\n\t\t}",
"public function getPlatform()\n {\n return $this->database ? $this->database->getPlatform() : null;\n }",
"public function getPlatform(string $platform): Platform;",
"function getOS($request) {\n $user_agent = $request->server('HTTP_USER_AGENT');\n $os_platform = $user_agent . \" - Unknown OS Platform\";\n $os_array = array(\n '/windows nt 10/i' => 'Windows 10',\n '/windows nt 6.3/i' => 'Windows 8.1',\n '/windows nt 6.2/i' => 'Windows 8',\n '/windows nt 6.1/i' => 'Windows 7',\n '/windows nt 6.0/i' => 'Windows Vista',\n '/windows nt 5.2/i' => 'Windows Server 2003/XP x64',\n '/windows nt 5.1/i' => 'Windows XP',\n '/windows xp/i' => 'Windows XP',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n foreach ($os_array as $regex => $value)\n if (preg_match($regex, $user_agent))\n $os_platform = $value;\n return $os_platform;\n }"
] |
[
"0.73311675",
"0.72463566",
"0.71515214",
"0.6664787",
"0.66603947",
"0.6650349",
"0.65730226",
"0.65640414",
"0.648705",
"0.6474174",
"0.6407768",
"0.6379583",
"0.63727796",
"0.63721454",
"0.6335757",
"0.6292647",
"0.6199287",
"0.61622036",
"0.6115401",
"0.6078722",
"0.6047993",
"0.6036973",
"0.6023146",
"0.5996775",
"0.59674615",
"0.5950122",
"0.59453005",
"0.5926875",
"0.59266615",
"0.5916634"
] |
0.768104
|
0
|
Checks if this title has trophies.
|
public function hasTrophies(): bool
{
$value = $this->pluck('definedTrophies');
return isset($value) && !empty($value);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function checkTrophyTitle($title)\r\n {\r\n $model = new Ynidea_Model_DbTable_Trophies;\r\n $select = $model -> select()->where('title = ?',$title); \r\n $row = $model->fetchRow($select); \r\n if($row)\r\n return true;\r\n else\r\n return false; \r\n }",
"public function hasTiers()\n {\n return (\\count($this->arrTiers) > 1);\n }",
"public function hasTiers()\n {\n return (count($this->arrTiers) > 1);\n }",
"public function getNumberTrophies()\r\n {\r\n return count($this->trophies);\r\n }",
"public function hasTips(){\n return $this->_has(19);\n }",
"public function hasTitle(){\n return $this->_has(37);\n }",
"public function hasTitle()\n {\n return $this->title !== null;\n }",
"public function hasTitles() {\n return $this->_has(2);\n }",
"public function has_title() {\n\t\treturn ! empty( $this->title );\n\t}",
"public function hasToTitle()\n {\n return $this->ToTitle !== null;\n }",
"public function hasTilting()\n {\n return $this->tilting !== null;\n }",
"public static function hasTitles(): bool\n {\n return true;\n }",
"public function hasTitle(){\n return $this->_has(2);\n }",
"public function hasTitles()\n\t{\n\t\treturn true;\n\t}",
"public function hasTerms()\n {\n $terms = $this->getElementData('t');\n return (null !== $terms && '' !== $terms);\n }",
"public function hasTowerinfo(){\n return $this->_has(1);\n }",
"function voyage_mikado_post_has_title() {\n return get_the_title() !== '';\n }",
"public function hasPlatinum(): bool\n {\n return $this->pluck('definedTrophies.platinum') == 1;\n }",
"public function hasScenery(){\n return $this->_has(25);\n }",
"public function hasDetails() { // opposed to isCompetition()\n\t\treturn $this->getScores()->exists();\n\t}",
"public function isTeilnahme()\n {\n return $this->teilnahme;\n }",
"public function hasTrip(): bool\n {\n return $this->trips()->first() !== null;\n }",
"public function hasTaskTitle(){\n return $this->_has(3);\n }",
"public function has_subtitle() {\n\t\treturn ! empty( $this->subtitle );\n\t}",
"public function isThereAWinner()\n {\n return $this->getWinningShip() !== null;\n }",
"public function hasTaxes()\n {\n return !empty($this->taxes);\n }",
"public function hasItemRarity()\n {\n return $this->item_rarity !== null;\n }",
"public function hasTutorreward(){\n return $this->_has(23);\n }",
"public function hasTitle() {\n return $this->_has(1);\n }",
"public function hasScore() {\n\t\treturn $this->thru > 0;\n\t}"
] |
[
"0.6574532",
"0.65394235",
"0.65203327",
"0.60338944",
"0.5982859",
"0.59706086",
"0.5962511",
"0.59620523",
"0.5934544",
"0.58606046",
"0.5850512",
"0.5842713",
"0.5812476",
"0.5811279",
"0.5771113",
"0.57586646",
"0.5753423",
"0.5745384",
"0.572252",
"0.57008564",
"0.5692276",
"0.5691232",
"0.56796503",
"0.56656957",
"0.5662867",
"0.5657439",
"0.56560314",
"0.56468344",
"0.5623959",
"0.5591518"
] |
0.7789468
|
0
|
Checks if this title has a platinum trophy.
|
public function hasPlatinum(): bool
{
return $this->pluck('definedTrophies.platinum') ?? false;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function hasPlatinum(): bool\n {\n return $this->pluck('definedTrophies.platinum') == 1;\n }",
"public function checkTrophyTitle($title)\r\n {\r\n $model = new Ynidea_Model_DbTable_Trophies;\r\n $select = $model -> select()->where('title = ?',$title); \r\n $row = $model->fetchRow($select); \r\n if($row)\r\n return true;\r\n else\r\n return false; \r\n }",
"public function hasTrophies(): bool\n {\n $value = $this->pluck('definedTrophies');\n\n return isset($value) && !empty($value);\n }",
"public function hasTitle(){\n return $this->_has(37);\n }",
"function voyage_mikado_post_has_title() {\n return get_the_title() !== '';\n }",
"function medigroup_mikado_post_has_title() {\n return get_the_title() !== '';\n }",
"public function isTeilnahme()\n {\n return $this->teilnahme;\n }",
"public function isPageHomonymie(): bool\n {\n return false !== stristr($this->getText() ?? '', '{{homonymie');\n }",
"public function has_title() {\n\t\treturn ! empty( $this->title );\n\t}",
"public function hasTitle()\n {\n return $this->title !== null;\n }",
"public function hasTitle(){\n return $this->_has(2);\n }",
"public function isPegawai()\n {\n return $this->role === Role::PEGAWAI;\n }",
"public function hasTitle() {\n return $this->_has(1);\n }",
"public function hasTerms()\n {\n $terms = $this->getElementData('t');\n return (null !== $terms && '' !== $terms);\n }",
"public function has_subtitle() {\n\t\treturn ! empty( $this->subtitle );\n\t}",
"public static function hasTitles(): bool\n {\n return true;\n }",
"public function hasToTitle()\n {\n return $this->ToTitle !== null;\n }",
"public function hasTaskTitle(){\n return $this->_has(3);\n }",
"public function hasTerritory() {\n return $this->_has(5);\n }",
"public function hasTerm() {\n return $this->_has(1);\n }",
"public function hasTitles()\n\t{\n\t\treturn true;\n\t}",
"public function hasTiers()\n {\n return (\\count($this->arrTiers) > 1);\n }",
"public function isPengunjung()\n {\n return $this->role === Role::PENGUNJUNG;\n }",
"public function isKetua()\n {\n return ($this->hasRole(HakAkses::KETUA_TIM));\n }",
"public function hasTitles() {\n return $this->_has(2);\n }",
"public function hasTiers()\n {\n return (count($this->arrTiers) > 1);\n }",
"public function hasTipid(){\n return $this->_has(3);\n }",
"public function isPemilik()\n {\n return $this->role === Role::PEMILIK;\n }",
"function isEthnicity($heading)\n{\n\t$isEthnicity = false;\n\t\n\t$root = $_SERVER[\"DOCUMENT_ROOT\"] . \"/RecipeFish/\";\n\n\t$handle = fopen($root . \"catalogs/ethnicityPriorities.txt\", \"r\");\n\n\twhile (($ethnicity = fgets($handle)) !== false)\n\t{\n\t\t//remove new line char from string\n\t\t$ethnicity = substr($ethnicity, 0, strlen($ethnicity)-2);\n\t\t\n\t\t//split ethnicity string into name and priority value\n\t\t$tokens = explode(\"%\", $ethnicity);\n\t\t\n\t\t$ethnicity = $tokens[0];\n\n\t\tif (strcmp($heading, $ethnicity . \" Ethnicity\") == 0)\n\t\t{\n\t\t\t$isEthnicity = true;\n\t\t\t\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tfclose($handle);\n\t\n\treturn $isEthnicity;\n}",
"public function hasText() {\n return !empty($this->text[\\App::getLocale()]);\n }"
] |
[
"0.75074804",
"0.6197555",
"0.6178559",
"0.6040171",
"0.60017276",
"0.59060484",
"0.5901795",
"0.572043",
"0.5696898",
"0.5605122",
"0.5577972",
"0.5541635",
"0.55347574",
"0.5485853",
"0.5467843",
"0.5436457",
"0.54346424",
"0.54270375",
"0.5413761",
"0.5400906",
"0.53757393",
"0.53672487",
"0.53598404",
"0.53574604",
"0.5336638",
"0.5329513",
"0.52888256",
"0.5271462",
"0.5253162",
"0.5245474"
] |
0.7363484
|
1
|
Gets the total trophy count for this title.
|
public function trophyCount(): int
{
$count = ($this->bronzeTrophyCount() + $this->silverTrophyCount() + $this->goldTrophyCount());
if ($this->hasPlatinum()) {
$count++;
}
return $count;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }",
"public function goldTrophyCount(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function total(): int\n {\n return Arr::get($this->meta, 'total', $this->count());\n }",
"public function bronzeTrophyCount(): int\n {\n return $this->pluck('definedTrophies.bronze');\n }",
"public function getNumberTrophies()\r\n {\r\n return count($this->trophies);\r\n }",
"public function earnedTrophiesPlatinumCount(): int\n {\n return $this->pluck('earnedTrophies.platinum');\n }",
"public function trophyCount(TrophyType $trophyType): int\n {\n switch ($trophyType) {\n case TrophyType::Bronze:\n return $this->bronze();\n case TrophyType::Silver:\n return $this->silver();\n case TrophyType::Gold:\n return $this->gold();\n case TrophyType::Platinum:\n return (int)$this->hasPlatinum();\n default:\n throw new \\InvalidArgumentException(\"Trophy type [$trophyType] does not contain a count method.\");\n }\n }",
"public static function totalNumber()\n {\n return (int)self::find()->count();\n }",
"public function getTotalCount()\n {\n return $this->totalCount;\n }",
"public function silverTrophyCount(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function getTotalHT(){\n\t\t$HT=0;\n\t\tforeach ($this->_leslignes->getAll() as $uneligne){\n\t\t\t$HT+=$uneligne->getTotal();\n\t\t}\n\t\treturn $HT;\n\t}",
"public function getHeroCount()\n {\n return $this->count(self::_HERO);\n }",
"public function getHeroCount()\n {\n return $this->count(self::_HERO);\n }",
"public function getHeroCount()\n {\n return $this->count(self::HERO);\n }",
"public function getTotal() : int\n {\n return $this->total;\n }",
"public function total(): int\n {\n return count($this->all());\n }",
"public function totalAmountOfShops()\n {\n return Shop::getTotalAmountOfShops();\n\n }",
"public function get_total_number_of_units(){\n return $this->unit_count;\n }",
"public function getTotalCount()\n\t{\n\t\treturn $this->totalCount;\n\t}",
"public function getTotalHits()\n {\n if (isset($this->results)) {\n return $this->results->getTotalHits();\n }\n }",
"public function totalCottages()\n {\n return $this->cottage->count();\n }",
"public function getTotal(): int\n {\n return\n $this->getAttack() +\n $this->getDefense() +\n $this->getStamina();\n }",
"public function getTotal(): int\n {\n if (isset($this->contents)) {\n return count($this->contents);\n }\n\n return 0;\n }",
"public function getAmountOfTicketsLabel()\n {\n return Ticket::find()->creator($this->id)->count();\n }",
"public function totalCount();",
"public function totalCount();",
"public function count(): int\n {\n return $this->keyTotal;\n }",
"public function getTotalCount()\n {\n $this->loadItems();\n return $this->calculator->getCount($this->items);\n }",
"public function getTotal() {\n\t\treturn $this->find('count', array(\n\t\t\t'contain' => false,\n\t\t\t'recursive' => false,\n\t\t\t'cache' => $this->alias . '::' . __FUNCTION__,\n\t\t\t'cacheExpires' => '+24 hours'\n\t\t));\n\t}",
"protected function get_total_count() {\n\t\treturn affiliate_wp()->utils->data->get( \"{$this->batch_id}_total_count\", 0 );\n\t}"
] |
[
"0.80158323",
"0.697131",
"0.69296044",
"0.68659145",
"0.67355156",
"0.6700751",
"0.669272",
"0.66508394",
"0.66328394",
"0.65897274",
"0.6569313",
"0.65368253",
"0.65368253",
"0.6488574",
"0.64780253",
"0.64771575",
"0.64762056",
"0.6473574",
"0.64592904",
"0.645691",
"0.6387516",
"0.63784635",
"0.6374941",
"0.6331023",
"0.6267793",
"0.6267793",
"0.6232821",
"0.6226302",
"0.6217155",
"0.6209809"
] |
0.78547716
|
1
|
Gets the amount of bronze trophies.
|
public function bronzeTrophyCount(): int
{
return $this->pluck('definedTrophies.bronze');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function bronze(): int\n {\n return $this->pluck('definedTrophies.bronze');\n }",
"public function earnedTrophiesBronzeCount(): int\n {\n return $this->pluck('earnedTrophies.bronze');\n }",
"public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }",
"public function trophyCount(): int\n {\n $count = ($this->bronzeTrophyCount() + $this->silverTrophyCount() + $this->goldTrophyCount());\n\n if ($this->hasPlatinum()) {\n $count++;\n }\n\n return $count;\n }",
"public function getNumberTrophies()\r\n {\r\n return count($this->trophies);\r\n }",
"public function silverTrophyCount(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function goldTrophyCount(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function tonnage() {\r\n\t\tif ($this->isStarship()) {\r\n\t\t\treturn $this->techData['tonnage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function getBathroomCount()\n {\n return $this->bathroomCount;\n }",
"protected function cost()\n {\n return $this->rounds;\n }",
"public function getBatHeroesCount()\n {\n return $this->count(self::_BAT_HEROES);\n }",
"public function getTotalBattles() : int\n\t{\n\t\treturn $this->totalBattles;\n\t}",
"public function size()\n {\n return 100 - $this->eaten;\n }",
"public function getToiletCount()\n {\n return $this->toiletCount;\n }",
"public function getBattlesCount()\n {\n return $this->count(self::_BATTLES);\n }",
"public function totalComputerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = false AND r.tie = false')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }",
"public function getStoneAmount()\n {\n return $this->get(self::_STONE_AMOUNT);\n }",
"public function getPothlandcost()\n {\n return $this->pothlandcost;\n }",
"public function getNbWheels(): int { return $this->nbWheels; }",
"public function getBrutto(){\n $brutto = 0;\n foreach($this->getOrders() as $order){\n $brutto += $order->getCourierCost() + $order->getCourierDiscount();\n }\n return $brutto;\n }",
"public function getTotalRingDamage(): int {\n return $this->getRingDamage();\n }",
"function total_itineraries()\n\t{\n\t\treturn $this->_tour_cart_contents['total_itineraries'];\n\t}",
"private function getWeight()\n\t{\n\t\treturn $this->cart->getWeight();\n\t}",
"public function getRounds() : int\n {\n return $this->rounds;\n }",
"private function getTotalCharge() {\n $result = 0;\n\n foreach ($this->rentals as $rental) {\n $result += $rental->getCharge();\n }\n return $result;\n\n }",
"public function getPotency(): int\n {\n return $this->potency;\n }",
"public function getBedroomCount()\n {\n return $this->bedroomCount;\n }",
"public function earnedTrophiesGoldCount(): int\n {\n return $this->pluck('earnedTrophies.gold');\n }",
"public function totalPlayerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = true')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }",
"private function getDozingLength(): int\n {\n if ($this->fenceHeight < 1750) {\n return $this->sleepThreshold * $this->fenceHeight;\n }\n return -1;\n }"
] |
[
"0.7978242",
"0.77563864",
"0.6971082",
"0.69356626",
"0.6922722",
"0.66939414",
"0.6609167",
"0.6478986",
"0.6414117",
"0.63766545",
"0.6284179",
"0.62556255",
"0.6221483",
"0.6214513",
"0.61438465",
"0.6138375",
"0.61012805",
"0.6092125",
"0.6072539",
"0.6065196",
"0.60623455",
"0.6042338",
"0.5987079",
"0.5944773",
"0.59191567",
"0.59112245",
"0.5895987",
"0.58859634",
"0.5881927",
"0.58817345"
] |
0.81291276
|
0
|
Gets the amount of silver trophies.
|
public function silverTrophyCount(): int
{
return $this->pluck('definedTrophies.silver');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function silver(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function earnedTrophiesSilverCount(): int\n {\n return $this->pluck('earnedTrophies.silver');\n }",
"public function gold(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function earnedTrophiesGoldCount(): int\n {\n return $this->pluck('earnedTrophies.gold');\n }",
"public function goldTrophyCount(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function getGold()\n {\n return $this->get(self::_GOLD);\n }",
"public function getGold()\n {\n return $this->get(self::_GOLD);\n }",
"public function tonnage() {\r\n\t\tif ($this->isStarship()) {\r\n\t\t\treturn $this->techData['tonnage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function getStoneAmount()\n {\n return $this->get(self::_STONE_AMOUNT);\n }",
"public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }",
"public function getGold()\n {\n $value = $this->get(self::GOLD);\n return $value === null ? (integer)$value : $value;\n }",
"public function getGold() {\n\t\treturn $this->gold;\n\t}",
"public function drainPerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDrain = $this->amount() * $this->drain();\r\n\t\t\treturn ($fullDrain / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function getTotalGross()\n {\n return $this->totalGross;\n }",
"public function earnedTrophiesBronzeCount(): int\n {\n return $this->pluck('earnedTrophies.bronze');\n }",
"public function getWeight() {\n return $this->item->getWeight();\n }",
"public function getSold()\n {\n return $this->sold;\n }",
"function getTotalWeight()\n { $total = 0 ;\n if (count($this->items) > 0) \n { \n for ($p=0; $p<count($this->items); $p++) \n {\n $total = $total + $this->items[$p];\n }\n }\n return $total;\n }",
"private function getWeight()\n\t{\n\t\treturn $this->cart->getWeight();\n\t}",
"function getOverallPrice(){\n\t\t$t=0;\n\t\t$a = Item::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('status', 'delivered')->count();\n\t\t$r=intVal(intVal($dur)-intVal($sl))*intVal($n->price);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}",
"public function damagePerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDamage = $this->amount() * $this->damage() * $this->burst();\r\n\t\t\treturn ($fullDamage / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function getNiceTotalPrice()\n {\n return round($this->totalPrice / 100, 2);\n }",
"public function weight()\n {\n return $this->getCartItemCollection()->sum(function ($item) {\n return $item->getTotalWeight();\n });\n }",
"public function getQuantitySold()\n {\n return $this->quantitySold;\n }",
"public function bronze(): int\n {\n return $this->pluck('definedTrophies.bronze');\n }",
"public function getWeightTotal(): float;",
"public function bronzeTrophyCount(): int\n {\n return $this->pluck('definedTrophies.bronze');\n }",
"public function getTotalRingDamage(): int {\n return $this->getRingDamage();\n }",
"public function getPotency(): int\n {\n return $this->potency;\n }",
"protected function cost()\n {\n return $this->rounds;\n }"
] |
[
"0.82267976",
"0.77601624",
"0.70781845",
"0.69287086",
"0.6874111",
"0.63416106",
"0.63416106",
"0.6309212",
"0.6302712",
"0.6293892",
"0.6214397",
"0.6165419",
"0.61127955",
"0.605494",
"0.60480255",
"0.6008686",
"0.59945154",
"0.59933674",
"0.5984484",
"0.5982333",
"0.5974944",
"0.59289443",
"0.59254164",
"0.59240174",
"0.589628",
"0.58942837",
"0.5890353",
"0.5876167",
"0.5870971",
"0.58676755"
] |
0.79281306
|
1
|
Gets the amount of gold trophies.
|
public function goldTrophyCount(): int
{
return $this->pluck('definedTrophies.gold');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function gold(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function earnedTrophiesGoldCount(): int\n {\n return $this->pluck('earnedTrophies.gold');\n }",
"public function getGold() {\n\t\treturn $this->gold;\n\t}",
"public function getGold()\n {\n return $this->get(self::_GOLD);\n }",
"public function getGold()\n {\n return $this->get(self::_GOLD);\n }",
"public function getGold()\n {\n $value = $this->get(self::GOLD);\n return $value === null ? (integer)$value : $value;\n }",
"public function silverTrophyCount(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function silver(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }",
"public function getTotalGross()\n {\n return $this->totalGross;\n }",
"public function trophyCount(): int\n {\n $count = ($this->bronzeTrophyCount() + $this->silverTrophyCount() + $this->goldTrophyCount());\n\n if ($this->hasPlatinum()) {\n $count++;\n }\n\n return $count;\n }",
"public function get_total_badges() {\n\t\t\treturn $this->total_badges;\n\t\t}",
"public function earnedTrophiesSilverCount(): int\n {\n return $this->pluck('earnedTrophies.silver');\n }",
"public function getGrossTotal(): float;",
"public function damagePerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDamage = $this->amount() * $this->damage() * $this->burst();\r\n\t\t\treturn ($fullDamage / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function tonnage() {\r\n\t\tif ($this->isStarship()) {\r\n\t\t\treturn $this->techData['tonnage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"protected function cost()\n {\n return $this->rounds;\n }",
"public function getAmountGte(): ?int\n {\n return $this->amountGte;\n }",
"public function getGrossPrice()\n {\n return $this->getPrice(false);\n }",
"public function getGwPrice() {\n return $this->item->getGwPrice();\n }",
"public function getTotalHT(){\n\t\t$HT=0;\n\t\tforeach ($this->_leslignes->getAll() as $uneligne){\n\t\t\t$HT+=$uneligne->getTotal();\n\t\t}\n\t\treturn $HT;\n\t}",
"public function getGrossPrice()\n {\n return (float) $this->getTotal();\n }",
"public function getDeliveryGrossAmount()\r\n {\r\n return $this->_deliveryNetAmount + $this->_deliveryTaxAmount;\r\n }",
"public function getTotalRingDamage(): int {\n return $this->getRingDamage();\n }",
"public function getTotalSpellDamage(): int {\n return $this->getSpellDamage();\n }",
"public function getTotal(): int\n {\n return\n $this->getAttack() +\n $this->getDefense() +\n $this->getStamina();\n }",
"function getTotalHT() {\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", $this->totalHT));\n else return 0;\n }",
"public function hasGold()\n {\n return $this->get(self::GOLD) !== null;\n }",
"public function getGrossPrice()\n {\n return $this->calculateGrossPrice($this->getPrice());\n }",
"private function getGrossEarnings()\n {\n $markup = $this->worked_in_delaware ? 1.032 : 1;\n return $this->payroll->getEarnings() * $this->payroll->pay_periods * $markup;\n }"
] |
[
"0.8345473",
"0.79333484",
"0.7632484",
"0.76234716",
"0.76234716",
"0.7546886",
"0.6965532",
"0.68459314",
"0.68085396",
"0.6605607",
"0.6545694",
"0.6540271",
"0.6471654",
"0.6427731",
"0.6301556",
"0.63003105",
"0.62922955",
"0.6212029",
"0.6175912",
"0.61741984",
"0.6145279",
"0.60590094",
"0.6049757",
"0.6030075",
"0.6012392",
"0.5991676",
"0.59887373",
"0.5970113",
"0.59621906",
"0.5961721"
] |
0.81173235
|
1
|
Gets the trophy list version number for this trophy title.
|
public function trophySetVersion(): string
{
return $this->pluck('trophySetVersion');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getVersionNo()\n {\n return $this->versionNo;\n }",
"public function getLabelVersionNo()\n\t{\n\t\treturn $this->labelVersionNo;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n return $this->version;\n }",
"public function get_version()\n {\n return $this->version;\n }",
"public function get_version()\n {\n return $this->version;\n }",
"public function getVersion()\n {\n return $this->get(self::VERSION);\n }",
"public function getVersion()\n {\n return $this->get(self::_VERSION);\n }",
"public function get_version()\n\t{\n\t\treturn $this->version;\n\t}",
"public function getVersion()\n {\n return $this->values[\"version\"];\n }",
"public function getVersion(): int\n {\n return $this->version;\n }",
"public function getVersion() {\r\n $version = $this->QuerySysStatus(1);\r\n return $version['ver-key'];\r\n }",
"public function get_version() { \n\n\t\treturn $this->version; \n\n\t}",
"public function getVersion(): string\n {\n return $this->data->version;\n }",
"function get_version() {\n\n\t\treturn $this->version;\n\n\t}",
"public function getVersion()\r\n {\r\n return $this->version;\r\n }",
"public function getVersion() {\r\n return $this->version;\r\n }",
"public function get_version(){\n return $this->_version;\n }",
"public function getVersionID()\n {\n return $this->versionID;\n }",
"public function getVersion()\n {\n return $this->version;\n }",
"public function getVersion()\n {\n return $this->version;\n }"
] |
[
"0.68849707",
"0.6506227",
"0.647724",
"0.647724",
"0.647724",
"0.647724",
"0.647724",
"0.647724",
"0.647724",
"0.647724",
"0.647724",
"0.647724",
"0.6458992",
"0.64468724",
"0.64468724",
"0.641822",
"0.64114183",
"0.6397479",
"0.63767767",
"0.637446",
"0.63687044",
"0.6365864",
"0.63638294",
"0.63533497",
"0.6343601",
"0.6321902",
"0.63198835",
"0.6317206",
"0.6316038",
"0.6316038"
] |
0.70043635
|
0
|
Gets the amount of earned bronze trophies for this user.
|
public function earnedTrophiesBronzeCount(): int
{
return $this->pluck('earnedTrophies.bronze');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function bronzeTrophyCount(): int\n {\n return $this->pluck('definedTrophies.bronze');\n }",
"public function bronze(): int\n {\n return $this->pluck('definedTrophies.bronze');\n }",
"public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }",
"public function earnedTrophiesGoldCount(): int\n {\n return $this->pluck('earnedTrophies.gold');\n }",
"public function trophyCount(): int\n {\n $count = ($this->bronzeTrophyCount() + $this->silverTrophyCount() + $this->goldTrophyCount());\n\n if ($this->hasPlatinum()) {\n $count++;\n }\n\n return $count;\n }",
"public function getNumberTrophies()\r\n {\r\n return count($this->trophies);\r\n }",
"public function goldTrophyCount(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function silverTrophyCount(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function getBatHeroesCount()\n {\n return $this->count(self::_BAT_HEROES);\n }",
"protected function cost()\n {\n return $this->rounds;\n }",
"public function getTotalBattles() : int\n\t{\n\t\treturn $this->totalBattles;\n\t}",
"public function getCandyEarnedCount()\n {\n return $this->candy_earned_count;\n }",
"public function earnedTrophiesSilverCount(): int\n {\n return $this->pluck('earnedTrophies.silver');\n }",
"public function tonnage() {\r\n\t\tif ($this->isStarship()) {\r\n\t\t\treturn $this->techData['tonnage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"function total_itineraries()\n\t{\n\t\treturn $this->_tour_voucher_contents['total_itineraries'];\n\t}",
"public function getStoneAmount()\n {\n return $this->get(self::_STONE_AMOUNT);\n }",
"function total_itineraries()\n\t{\n\t\treturn $this->_tour_cart_contents['total_itineraries'];\n\t}",
"public function getAwardedBountyAmount()\n {\n return $this->awardedBountyAmount;\n }",
"public function getBathroomCount()\n {\n return $this->bathroomCount;\n }",
"public function totalComputerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = false AND r.tie = false')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }",
"public function getIteneraryTotalTaxesAmount()\n {\n return $this->IteneraryTotalTaxesAmount;\n }",
"public function size()\n {\n return 100 - $this->eaten;\n }",
"public function getAverageTies()\n {\n return round($this->getTiesAttribute() / $this->teams->count());\n }",
"public function earnedTrophiesPlatinumCount(): int\n {\n return $this->pluck('earnedTrophies.platinum');\n }",
"public static function totalAmountOfOffers()\n {\n return Offer::getTotalAmountOfOffers();\n\n }",
"public function getAverageWins()\n {\n return round($this->getWinsAttribute() / $this->teams->count());\n }",
"public function getTotalHT(){\n\t\t$HT=0;\n\t\tforeach ($this->_leslignes->getAll() as $uneligne){\n\t\t\t$HT+=$uneligne->getTotal();\n\t\t}\n\t\treturn $HT;\n\t}",
"public function totalPlayerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = true')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }",
"public function getCostPerTraveledHour()\n {\n return $this->cost_per_traveled_hour;\n }",
"public function getTotalCalories() {\n return (float) $this->profile->userTotals->totalCalories;\n }"
] |
[
"0.7126671",
"0.6956779",
"0.66269547",
"0.64716566",
"0.6406024",
"0.63082033",
"0.6177894",
"0.608518",
"0.60088813",
"0.6007577",
"0.5998727",
"0.59893113",
"0.59771043",
"0.5930985",
"0.5864334",
"0.5860737",
"0.582702",
"0.58171093",
"0.58098197",
"0.5798422",
"0.57897115",
"0.5771665",
"0.57699424",
"0.57626176",
"0.57475734",
"0.57107157",
"0.57106215",
"0.5706782",
"0.57065254",
"0.56918293"
] |
0.7572422
|
0
|
Gets the amount of earned silver trophies for this user.
|
public function earnedTrophiesSilverCount(): int
{
return $this->pluck('earnedTrophies.silver');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function silver(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function earnedTrophiesGoldCount(): int\n {\n return $this->pluck('earnedTrophies.gold');\n }",
"public function silverTrophyCount(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function gold(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function goldTrophyCount(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function getAverageTies()\n {\n return round($this->getTiesAttribute() / $this->teams->count());\n }",
"public function getTotalAuctionSellingValue()\n {\n return $this->totalAuctionSellingValue;\n }",
"public function getTotalGross()\n {\n return $this->totalGross;\n }",
"private function getGrossEarnings()\n {\n $markup = $this->worked_in_delaware ? 1.032 : 1;\n return $this->payroll->getEarnings() * $this->payroll->pay_periods * $markup;\n }",
"public function getGold()\n {\n $value = $this->get(self::GOLD);\n return $value === null ? (integer)$value : $value;\n }",
"public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }",
"public function getGold()\n {\n return $this->get(self::_GOLD);\n }",
"public function getGold()\n {\n return $this->get(self::_GOLD);\n }",
"public function getGold() {\n\t\treturn $this->gold;\n\t}",
"public function getTotalCalories() {\n return (float) $this->profile->userTotals->totalCalories;\n }",
"public function earnedTrophiesBronzeCount(): int\n {\n return $this->pluck('earnedTrophies.bronze');\n }",
"function profit()\n\t{\n\t\t$total = 0;\n\t\t$ante = $this->properties->get('ante');\n\t\tforeach ($this->all() as $record)\n\t\t\tif (!empty($record->making))\n\t\t\t\t$total += $record->balance - $ante;\n\n\t\treturn $total;\n\t}",
"public function getOffenseEffectiveness()\n {\n return $this->attacker->getStats()->getStrength();\n }",
"public function getStoneAmount()\n {\n return $this->get(self::_STONE_AMOUNT);\n }",
"public function getLoyaltyPoints() : int\n {\n $id = $this->customerSession->getCustomerId();\n $user = $this->customerRepository->getById($id);\n\n if(empty($user->getCustomAttribute(LoyaltyPointsInterface::CODE))) {\n $user->setCustomAttribute(LoyaltyPointsInterface::CODE, 0);\n $this->customerRepository->save($user);\n }\n\n return round($user->getCustomAttribute(LoyaltyPointsInterface::CODE)->getValue());\n }",
"public function getNiceTotalPrice()\n {\n return round($this->totalPrice / 100, 2);\n }",
"public function tonnage() {\r\n\t\tif ($this->isStarship()) {\r\n\t\t\treturn $this->techData['tonnage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function getSold()\n {\n return $this->sold;\n }",
"public function getAverageWins()\n {\n return round($this->getWinsAttribute() / $this->teams->count());\n }",
"public function iN_TotalPremiumEarnings($userID) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\tif ($this->iN_CheckIsAdmin($userID) == 1) {\n\t\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS premEarn FROM i_user_payments WHERE payment_status = 'ok'\") or die(mysqli_error($this->db));\n\t\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\t\treturn isset($row['premEarn']) ? $row['premEarn'] : '0.00';\n\t\t}\n\t}",
"public function getAuctionSellingCount()\n {\n return $this->auctionSellingCount;\n }",
"public function getAmount()\r\n {\r\n $amount = $this->getDeliveryGrossAmount();\r\n foreach ($this->_items as $item)\r\n {\r\n $amount += $item->getTotalGrossAmount();\r\n }\r\n return $amount;\r\n }",
"public function getTotalSoldCount()\n {\n return $this->totalSoldCount;\n }",
"public function getGrossPrice()\n {\n return (float) $this->getTotal();\n }",
"public function damagePerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDamage = $this->amount() * $this->damage() * $this->burst();\r\n\t\t\treturn ($fullDamage / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}"
] |
[
"0.72792",
"0.71931636",
"0.7070169",
"0.6613299",
"0.63579386",
"0.6024753",
"0.60221684",
"0.59434694",
"0.59289914",
"0.5921802",
"0.59190804",
"0.59131396",
"0.59131396",
"0.5908181",
"0.5905664",
"0.5903013",
"0.5877489",
"0.5871551",
"0.5866876",
"0.5862005",
"0.576389",
"0.57477194",
"0.5745101",
"0.573313",
"0.5668965",
"0.5644805",
"0.5628926",
"0.56131774",
"0.5607963",
"0.5603553"
] |
0.7557068
|
0
|
Gets the amount of earned gold trophies for this user.
|
public function earnedTrophiesGoldCount(): int
{
return $this->pluck('earnedTrophies.gold');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function gold(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function goldTrophyCount(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function getGold() {\n\t\treturn $this->gold;\n\t}",
"public function getGold()\n {\n $value = $this->get(self::GOLD);\n return $value === null ? (integer)$value : $value;\n }",
"public function getGold()\n {\n return $this->get(self::_GOLD);\n }",
"public function getGold()\n {\n return $this->get(self::_GOLD);\n }",
"public function getTotalGross()\n {\n return $this->totalGross;\n }",
"public function getTotalCalories() {\n return (float) $this->profile->userTotals->totalCalories;\n }",
"public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }",
"private function getGrossEarnings()\n {\n $markup = $this->worked_in_delaware ? 1.032 : 1;\n return $this->payroll->getEarnings() * $this->payroll->pay_periods * $markup;\n }",
"public function get_total_badges() {\n\t\t\treturn $this->total_badges;\n\t\t}",
"public function earnedTrophiesSilverCount(): int\n {\n return $this->pluck('earnedTrophies.silver');\n }",
"public function getLoyaltyPoints() : int\n {\n $id = $this->customerSession->getCustomerId();\n $user = $this->customerRepository->getById($id);\n\n if(empty($user->getCustomAttribute(LoyaltyPointsInterface::CODE))) {\n $user->setCustomAttribute(LoyaltyPointsInterface::CODE, 0);\n $this->customerRepository->save($user);\n }\n\n return round($user->getCustomAttribute(LoyaltyPointsInterface::CODE)->getValue());\n }",
"public function getGrossTotal(): float;",
"public function silverTrophyCount(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function getGrossPrice()\n {\n return (float) $this->getTotal();\n }",
"public function getNewUserPrice()\n {\n $value = $this->get(self::new_user_price);\n return $value === null ? (integer)$value : $value;\n }",
"public function getTotalHT(){\n\t\t$HT=0;\n\t\tforeach ($this->_leslignes->getAll() as $uneligne){\n\t\t\t$HT+=$uneligne->getTotal();\n\t\t}\n\t\treturn $HT;\n\t}",
"public function silver(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"protected function cost()\n {\n return $this->rounds;\n }",
"public function damagePerRound() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\t$fullDamage = $this->amount() * $this->damage() * $this->burst();\r\n\t\t\treturn ($fullDamage / $this->reload());\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function getUserTotalPaid()\n {\n $user = getUser();\n $w = self::where('type', 'credit')->where('user_id', $user->id);\n return $w->sum('amount');\n }",
"public function trophyCount(): int\n {\n $count = ($this->bronzeTrophyCount() + $this->silverTrophyCount() + $this->goldTrophyCount());\n\n if ($this->hasPlatinum()) {\n $count++;\n }\n\n return $count;\n }",
"public function getGrossPrice()\n {\n return $this->getPrice(false);\n }",
"public function getGrandTotalAttribute() {\n $total = $this->cartItems->map(function ($item, $key) {\n return $item->subtotal;\n })->sum();\n\n if ($this->userPromotion) {\n $total *= ($this->userPromotion->promotion->discount / 100);\n }\n\n $total += $this->deliveryOption->cost;\n\n return $total;\n\n }",
"public function getUserAmount() {\n \t$_user = new class_User();\n \n \t$userAmount = $_user->getUserAmount();\n \n \treturn $userAmount;\n }",
"public function getAverageTies()\n {\n return round($this->getTiesAttribute() / $this->teams->count());\n }",
"function profit()\n\t{\n\t\t$total = 0;\n\t\t$ante = $this->properties->get('ante');\n\t\tforeach ($this->all() as $record)\n\t\t\tif (!empty($record->making))\n\t\t\t\t$total += $record->balance - $ante;\n\n\t\treturn $total;\n\t}",
"public function getTotal(): int\n {\n return\n $this->getAttack() +\n $this->getDefense() +\n $this->getStamina();\n }",
"public static function getAmountUser()\n {\n $sql = 'SELECT COUNT(*) FROM `user`';\n\n $db = new DB();\n $connectionDB = $db->getConnection();\n $result = $connectionDB->prepare($sql);\n $result->execute();\n\n $amountUser = intval($result->fetchColumn());\n return $amountUser;\n }"
] |
[
"0.7426699",
"0.71247923",
"0.6954024",
"0.6908033",
"0.68252903",
"0.68252903",
"0.63504285",
"0.62736905",
"0.62579834",
"0.6224385",
"0.6218199",
"0.6204519",
"0.61758447",
"0.6128557",
"0.59577703",
"0.58911943",
"0.5882279",
"0.58628124",
"0.5852499",
"0.5841446",
"0.5838811",
"0.5831194",
"0.5826451",
"0.5818721",
"0.5782773",
"0.57737064",
"0.57621247",
"0.57601154",
"0.5726122",
"0.5723222"
] |
0.78356695
|
0
|
Gets the amount of earned platinum trophies for this user.
|
public function earnedTrophiesPlatinumCount(): int
{
return $this->pluck('earnedTrophies.platinum');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function totalTrophyCount(): int\n {\n $count = $this->bronze() + $this->silver() + $this->gold();\n\n return $this->hasPlatinum() ? ++$count : $count;\n }",
"public function earnedTrophiesGoldCount(): int\n {\n return $this->pluck('earnedTrophies.gold');\n }",
"public function trophyCount(): int\n {\n $count = ($this->bronzeTrophyCount() + $this->silverTrophyCount() + $this->goldTrophyCount());\n\n if ($this->hasPlatinum()) {\n $count++;\n }\n\n return $count;\n }",
"public function earnedTrophiesBronzeCount(): int\n {\n return $this->pluck('earnedTrophies.bronze');\n }",
"public function earnedTrophiesSilverCount(): int\n {\n return $this->pluck('earnedTrophies.silver');\n }",
"public function goldTrophyCount(): int\n {\n return $this->pluck('definedTrophies.gold');\n }",
"public function getIteneraryTotalTaxesAmount()\n {\n return $this->IteneraryTotalTaxesAmount;\n }",
"public function getTotalCalories() {\n return (float) $this->profile->userTotals->totalCalories;\n }",
"public function getTotal(): int\n {\n return\n $this->getAttack() +\n $this->getDefense() +\n $this->getStamina();\n }",
"public function getTotalHT(){\n\t\t$HT=0;\n\t\tforeach ($this->_leslignes->getAll() as $uneligne){\n\t\t\t$HT+=$uneligne->getTotal();\n\t\t}\n\t\treturn $HT;\n\t}",
"public function getNumberTrophies()\r\n {\r\n return count($this->trophies);\r\n }",
"public function getPerPersonEquivFareAmount()\n {\n return $this->PerPersonEquivFareAmount;\n }",
"public function getCandyEarnedCount()\n {\n return $this->candy_earned_count;\n }",
"public function getPointsEarned()\n {\n return $this->pointsEarned;\n }",
"public function silverTrophyCount(): int\n {\n return $this->pluck('definedTrophies.silver');\n }",
"public function getHireHeroCount()\n {\n return $this->count(self::_HIRE_HERO);\n }",
"public function getHireUidsCount()\n {\n return $this->count(self::_HIRE_UIDS);\n }",
"public function tonnage() {\r\n\t\tif ($this->isStarship()) {\r\n\t\t\treturn $this->techData['tonnage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}",
"public function getAverageTies()\n {\n return round($this->getTiesAttribute() / $this->teams->count());\n }",
"function total_itineraries()\n\t{\n\t\treturn $this->_tour_voucher_contents['total_itineraries'];\n\t}",
"public function getPothfrtamt()\n {\n return $this->pothfrtamt;\n }",
"public static function totalAmountOfOffers()\n {\n return Offer::getTotalAmountOfOffers();\n\n }",
"public function getPothmiscamt()\n {\n return $this->pothmiscamt;\n }",
"public static function getAmountUser()\n {\n $sql = 'SELECT COUNT(*) FROM `user`';\n\n $db = new DB();\n $connectionDB = $db->getConnection();\n $result = $connectionDB->prepare($sql);\n $result->execute();\n\n $amountUser = intval($result->fetchColumn());\n return $amountUser;\n }",
"function total_itineraries()\n\t{\n\t\treturn $this->_tour_cart_contents['total_itineraries'];\n\t}",
"public function getTotalEstimulo() {\n return $this->totalEstimulo;\n }",
"public function totalPotentialUsers()\n {\n return $this->users()->count() + $this->invitations()->count();\n }",
"public function iN_TotalPremiumEarnings($userID) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\tif ($this->iN_CheckIsAdmin($userID) == 1) {\n\t\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS premEarn FROM i_user_payments WHERE payment_status = 'ok'\") or die(mysqli_error($this->db));\n\t\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\t\treturn isset($row['premEarn']) ? $row['premEarn'] : '0.00';\n\t\t}\n\t}",
"public function getPerPersonTotalFareAmount()\n {\n return $this->PerPersonTotalFareAmount;\n }",
"public function gold(): int\n {\n return $this->pluck('definedTrophies.gold');\n }"
] |
[
"0.6870749",
"0.68114036",
"0.6410952",
"0.6154621",
"0.61471236",
"0.6070527",
"0.60606754",
"0.6033722",
"0.5978158",
"0.59710264",
"0.5962624",
"0.5885135",
"0.5862298",
"0.5859952",
"0.58546376",
"0.5830061",
"0.58248305",
"0.5819418",
"0.5805013",
"0.5767616",
"0.5758278",
"0.57515097",
"0.57508224",
"0.5747866",
"0.5709452",
"0.5683379",
"0.56754386",
"0.5664692",
"0.56558293",
"0.56354237"
] |
0.74926335
|
0
|
Gets the trophy service name for this trophy.
|
public function serviceName(): string
{
return $this->serviceName ??= $this->pluck('npServiceName');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function getServiceName()\n {\n return $this->argument('service');\n }",
"public function getServiceName()\n {\n if (array_key_exists(\"serviceName\", $this->_propDict)) {\n return $this->_propDict[\"serviceName\"];\n } else {\n return null;\n }\n }",
"function getServiceName() { return $this->_servicename; }",
"public function getService()\n {\n return $this->getKey('Service');\n }",
"public function service() {\n return $this->service;\n }",
"public function getGrpcServiceName()\n {\n return isset($this->grpc_service_name) ? $this->grpc_service_name : '';\n }",
"public function getService(): ?string\n {\n return $this->service;\n }",
"public function getTransportName()\n {\n if (in_array($this->getTransport(), array_keys(dcTransport::$transports)))\n {\n return dcTransport::$transports[$this->getTransport()];\n }\n\n return;\n }",
"public function service()\r\n {\r\n return $this->service;\r\n }",
"public function getAuthServiceName(): string\n {\n return $this->authServiceName;\n }",
"public function getServiceKey() {\n return $this->_get( 'service_key' );\n }",
"public function service()\n {\n return $this->service;\n }",
"public function getServiceId()\n {\n return $this->service_id;\n }",
"protected function getServiceName()\n {\n return 'logger';\n }",
"public function getServiceId() {\n return $this->serviceId;\n }",
"public function getServiceId()\r\n {\r\n return $this->serviceId;\r\n }",
"abstract public function getServiceName();",
"abstract public function getServiceTypeName();",
"public function getStationName(): string\n {\n return $this->name;\n }",
"public function getserviceId()\n {\n return $this->service_id;\n }",
"public function getNomeServidor()\n {\n return $this->nome_servidor;\n }",
"public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }",
"public function getService() {\n return $this->service;\n }",
"public function getCarrierServiceName()\n {\n $carrierServiceInfo = $this->getCarrierServiceInfo();\n if($carrierServiceInfo){\n return trim($carrierServiceInfo->getCarrierName().' '.$carrierServiceInfo->getServiceName());\n }\n return null;\n }",
"public function getServiceId()\n {\n if (array_key_exists(\"serviceId\", $this->_propDict)) {\n return $this->_propDict[\"serviceId\"];\n } else {\n return null;\n }\n }",
"public function getTransportationService()\n {\n return $this->transportationService;\n }",
"protected function getShopName()\n {\n return $this->shopName;\n }",
"public function getInstanceName(): string\n {\n return $this->instanceName;\n }",
"function getTns() \n {\n\t\t\treturn $this->tnsName;\n\t\t}",
"static function Name()\n {\n return self::Variable('SERVER_NAME');\n }"
] |
[
"0.68208694",
"0.6699743",
"0.66227925",
"0.6603377",
"0.63247275",
"0.6276523",
"0.62157434",
"0.6209712",
"0.61617833",
"0.6142529",
"0.61383855",
"0.60994107",
"0.60481864",
"0.6028596",
"0.5987589",
"0.59794325",
"0.5977117",
"0.5972885",
"0.59307873",
"0.5916902",
"0.58858913",
"0.5841644",
"0.58392",
"0.5837161",
"0.58277476",
"0.5791489",
"0.5767914",
"0.5763085",
"0.5760911",
"0.5758282"
] |
0.7078204
|
0
|
Get instructions text from config
|
public function getInstructions()
{
return trim($this->getConfigData('instructions'));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function showInstructions()\n {\n\treturn $this->getConfigData('checkout/ship_instructions');\n }",
"public function getCustomizeText(){\n\n $text = Mage::getStoreConfig(self::XPATH_CONFIG_INSTALLMENT_TEXT);\n if(!empty($text)){\n return $text;\n }\n return __('Juros');\n }",
"public function buildConfigText() {\n\t\t$this->setPrimaryDomain();\n\t\n\t\tob_start();\n\t\t$installation_path = $this->installation_path;\n\t\t$name = $this->sitename;\n\t\t$domains = array(\n\t\t\t$this->primary_domain\n\t\t);\n\t\t$redirrectdomains = array();\n\t\tinclude(SHARED_PATH . 'provisioning/httpd.tpl');\n\t\t$config_text = ob_get_clean ();\n\t\treturn $config_text;\n\t\t\n\t}",
"public function getInstructions()\n {\n\t$instructions = Mage::getSingleton('checkout/session')->getData('shipping_instructions');\n\tif($instructions) {\n\t return htmlspecialchars($instructions);\n\t}\n\treturn '';\n }",
"public function getInstructions()\n {\n return $this->instructions;\n }",
"public function getSpecialInstructions(): string\n {\n return $this->_specialInstructions;\n }",
"public function instructions()\n {\n $payloads = [\n 'code' => $this->channelCode,\n ];\n\n return $this->request('get', 'payment/instruction', $payloads);\n }",
"private function getRobotsDefaultCustomInstructions()\n {\n return trim((string)$this->scopeConfig->getValue(\n self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS,\n ScopeConfigInterface::SCOPE_TYPE_DEFAULT\n ));\n }",
"protected function getInstructions()\n {\n if($this->paymentHelper->useCustomForm()) {\n return $this->paymentHelper->getCustomHtmlForm();\n }\n\n $logoAddress = $this->assetsRepository->getUrl('Picpay_Payment::images/picpay-logo.svg');\n\n return '<img width=\"150px\" src=\"' . $logoAddress . '\" alt=\"PicPay Logo\" '\n . 'style=\"background-color: rgb(33, 194, 94); border: 0; padding: 10px;\" />'\n . '<br/>'\n . '<p>Não conhece o PicPay? '\n . '<a href=\"https://www.picpay.com/site\" target=\"_blank\">Clique aqui</a>'\n . ' e baixe agora para efetuar seu pagamento.</p>';\n }",
"public function get_config_field_subtext()\n\t{\n\t\treturn array(\n\t\t\t'site_url'\t\t\t\t\t=> array('url_explanation'),\n\t\t\t'is_site_on'\t\t\t\t=> array('is_site_on_explanation'),\n\t\t\t'is_system_on'\t\t\t\t=> array('is_system_on_explanation'),\n\t\t\t'debug'\t\t\t\t\t\t=> array('debug_explanation'),\n\t\t\t'show_profiler'\t\t\t\t=> array('show_profiler_explanation'),\n\t\t\t'max_caches'\t\t\t\t=> array('max_caches_explanation'),\n\t\t\t'use_newrelic'\t\t\t\t=> array('use_newrelic_explanation'),\n\t\t\t'newrelic_app_name'\t\t\t=> array('newrelic_app_name_explanation'),\n\t\t\t'gzip_output'\t\t\t\t=> array('gzip_output_explanation'),\n\t\t\t'server_offset'\t\t\t\t=> array('server_offset_explain'),\n\t\t\t'default_member_group'\t\t=> array('group_assignment_defaults_to_two'),\n\t\t\t'smtp_server'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_port'\t\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_username'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'smtp_password'\t\t\t\t=> array('only_if_smpte_chosen'),\n\t\t\t'email_batchmode'\t\t\t=> array('batchmode_explanation'),\n\t\t\t'email_batch_size'\t\t\t=> array('batch_size_explanation'),\n\t\t\t'webmaster_email'\t\t\t=> array('return_email_explanation'),\n\t\t\t'cookie_domain'\t\t\t\t=> array('cookie_domain_explanation'),\n\t\t\t'cookie_prefix'\t\t\t\t=> array('cookie_prefix_explain'),\n\t\t\t'cookie_path'\t\t\t\t=> array('cookie_path_explain'),\n\t\t\t'deny_duplicate_data'\t\t=> array('deny_duplicate_data_explanation'),\n\t\t\t'redirect_submitted_links'\t=> array('redirect_submitted_links_explanation'),\n\t\t\t'require_secure_passwords'\t=> array('secure_passwords_explanation'),\n\t\t\t'allow_dictionary_pw'\t\t=> array('real_word_explanation', 'dictionary_note'),\n\t\t\t'censored_words'\t\t\t=> array('censored_explanation', 'censored_wildcards'),\n\t\t\t'censor_replacement'\t\t=> array('censor_replacement_info'),\n\t\t\t'password_lockout'\t\t\t=> array('password_lockout_explanation'),\n\t\t\t'password_lockout_interval' => array('login_interval_explanation'),\n\t\t\t'require_ip_for_login'\t\t=> array('require_ip_explanation'),\n\t\t\t'allow_multi_logins'\t\t=> array('allow_multi_logins_explanation'),\n\t\t\t'name_of_dictionary_file'\t=> array('dictionary_explanation'),\n\t\t\t'force_query_string'\t\t=> array('force_query_string_explanation'),\n\t\t\t'image_resize_protocol'\t\t=> array('image_resize_protocol_exp'),\n\t\t\t'image_library_path'\t\t=> array('image_library_path_exp'),\n\t\t\t'thumbnail_prefix'\t\t\t=> array('thumbnail_prefix_exp'),\n\t\t\t'member_theme'\t\t\t\t=> array('member_theme_exp'),\n\t\t\t'require_terms_of_service'\t=> array('require_terms_of_service_exp'),\n\t\t\t'email_console_timelock'\t=> array('email_console_timelock_exp'),\n\t\t\t'log_email_console_msgs'\t=> array('log_email_console_msgs_exp'),\n\t\t\t'use_membership_captcha'\t=> array('captcha_explanation'),\n\t\t\t'strict_urls'\t\t\t\t=> array('strict_urls_info'),\n\t\t\t'enable_template_routes'\t=> array('enable_template_routes_exp'),\n\t\t\t'tmpl_display_mode'\t\t\t=> array('tmpl_display_mode_exp'),\n\t\t\t'site_404'\t\t\t\t\t=> array('site_404_exp'),\n\t\t\t'channel_nomenclature'\t\t=> array('channel_nomenclature_exp'),\n\t\t\t'enable_sql_caching'\t\t=> array('enable_sql_caching_exp'),\n\t\t\t'email_debug'\t\t\t\t=> array('email_debug_exp'),\n\t\t\t'use_category_name'\t\t\t=> array('use_category_name_exp'),\n\t\t\t'reserved_category_word'\t=> array('reserved_category_word_exp'),\n\t\t\t'auto_assign_cat_parents'\t=> array('auto_assign_cat_parents_exp'),\n\t\t\t'save_tmpl_revisions'\t\t=> array('template_rev_msg'),\n\t\t\t'max_tmpl_revisions'\t\t=> array('max_revisions_exp'),\n\t\t\t'max_page_loads'\t\t\t=> array('max_page_loads_exp'),\n\t\t\t'time_interval'\t\t\t\t=> array('time_interval_exp'),\n\t\t\t'lockout_time'\t\t\t\t=> array('lockout_time_exp'),\n\t\t\t'banishment_type'\t\t\t=> array('banishment_type_exp'),\n\t\t\t'banishment_url'\t\t\t=> array('banishment_url_exp'),\n\t\t\t'banishment_message'\t\t=> array('banishment_message_exp'),\n\t\t\t'enable_search_log'\t\t\t=> array('enable_search_log_exp'),\n\t\t\t'dynamic_tracking_disabling'=> array('dynamic_tracking_disabling_info')\n\t\t);\n\t}",
"public function getDescription() {\n return $this->config['general']['description'];\n }",
"abstract public function getTextSettings();",
"public function getInstructions()\n {\n return $this->_instructions;\n }",
"protected function getInstructionsHtml()\n {\n if (!$this->getInstructions()) {\n return \"\";\n }\n\n $classAttribute = $this->getCustomAttributes()->getInstructionsClass();\n $classAttribute = $classAttribute ? ' class=\"' . $classAttribute . '\"' : \"\";\n\n $output = '<div' . $classAttribute . '>';\n $output .= $this->getInstructions();\n $output .= '</div>';\n $output .= PHP_EOL;\n\n return $output;\n }",
"public function getUsage()\n\t{\n\t\treturn sprintf('%s checkout transaction', $this->config->get('config_name'));\n\t}",
"protected function getLabel()\n\t{\n\t\treturn '<p>' . JText::_('MOD_TWEETDISPLAYBACK_AUTHENTICATION_SETUP_INSTRUCTIONS') . '</p>';\n\t}",
"public function getInstruction();",
"public function get_configuration_template() {\n\t\t$template_str = $this->get_configuration_middlesection_template();\n\t\t$template_str .= $this->get_test_button_html($this->desc);\n\t\treturn $template_str;\n\t}",
"public function getCommandText();",
"public function instructions() {\n $this->View->render('info/instructions'); // <-- path to rendered file\n }",
"protected function getTextHelp()\n {\n return array(\n 'complexidade' => 'O Nível de Complexidade está relacionado diretamente com a natureza da atividade e o esforço necessário para a sua execução ou solução de incidente. Por esforço entende-se tempo que será gasto para execução ou nível de dificuldade da demanda.',\n 'impacto' => 'O Nível de Impacto está relacionado ao efeito nos processos de negócio do Inep ou da DTDIE, o quanto os serviços serão afetados com falha, necessidade de evolução ou adaptação e qual será o transtorno, interno ou externo, pela não realização ou falha na execução da atividade.',\n 'criticidade' => 'O nível de criticidade está relacionado ao tempo de execução considerando que atrasos, na execução das atividades ou na entrega dos artefatos, podem afetar um processo de negócio do Inep ou da DTDIE.',\n 'facim' => 'O Fator de Conhecimento Interno e Maturidade- FACIM- é um indicador que baliza a perspectiva de definição do conhecimento interno e da maturidade para a execução das atividades. Este indicador tem o objetivo de criar um parâmetro que avalia o nível de maturidade e conhecimento do Inep que é transferido para o contexto da necessidade em que a atividade será inserida.'\n );\n }",
"public function getDescription(): string\n {\n return (string)($this->config['description'] ?? '');\n }",
"public function basicInstructions() {\r\n return [\r\n $this->description(),\r\n ];\r\n }",
"public function fetch_pre_drafted_text(){\n $data = config($this->input->post('key'));\n echo $data;\n }",
"public final function getLabel(){\n $config = $this->getLocalConfiguration();\n\n if(array_key_exists('label',$config)){\n return $config['label'];\n }\n\n return $this->getConfiguration()['__title'];\n }",
"public function getInstruction()\n {\n return $this->instruction;\n }",
"private static function _getText()\n {\n return geoAddon::getText('geo_addons', 'tokens');\n }",
"private function getRealUrlConfigurationTemplateContent()\n {\n $template = tx_mktools_util_miscTools::getRealUrlConfigurationTemplate();\n if (empty($template)) {\n return '';\n }\n\n return str_replace(\n '$TYPO3_CONF_VARS',\n '$GLOBALS[\\'TYPO3_CONF_VARS\\']',\n file_get_contents($template)\n );\n }",
"public function getText(): string\n {\n return $this->before.$this->text.$this->after;\n }",
"protected function getMigrator_Tool_ConfigTextService()\n {\n return $this->services['migrator.tool.config_text'] = new \\phpbb\\db\\migration\\tool\\config_text(${($_ = isset($this->services['config_text']) ? $this->services['config_text'] : $this->getConfigTextService()) && false ?: '_'});\n }"
] |
[
"0.6331551",
"0.6076512",
"0.6063883",
"0.58414894",
"0.56060964",
"0.56038326",
"0.55345505",
"0.54985046",
"0.54667777",
"0.54392076",
"0.5429755",
"0.5413888",
"0.5392617",
"0.53868264",
"0.536503",
"0.53647316",
"0.5317611",
"0.5312224",
"0.5299757",
"0.5251703",
"0.5224422",
"0.5218422",
"0.5216951",
"0.5211233",
"0.52043873",
"0.5177786",
"0.517637",
"0.5127105",
"0.5088719",
"0.5086849"
] |
0.74176586
|
1
|
Load a StewardshipPledge from PK Info
|
public static function Load($intId) {
// Use QuerySingle to Perform the Query
return StewardshipPledge::QuerySingle(
QQ::Equal(QQN::StewardshipPledge()->Id, $intId)
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StewardshipPledge object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StewardshipPledge::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->PersonId = $objReloaded->PersonId;\n\t\t\t$this->StewardshipFundId = $objReloaded->StewardshipFundId;\n\t\t\t$this->dttDateStarted = $objReloaded->dttDateStarted;\n\t\t\t$this->dttDateEnded = $objReloaded->dttDateEnded;\n\t\t\t$this->fltPledgeAmount = $objReloaded->fltPledgeAmount;\n\t\t\t$this->fltContributedAmount = $objReloaded->fltContributedAmount;\n\t\t\t$this->fltRemainingAmount = $objReloaded->fltRemainingAmount;\n\t\t\t$this->blnFulfilledFlag = $objReloaded->blnFulfilledFlag;\n\t\t\t$this->blnActiveFlag = $objReloaded->blnActiveFlag;\n\t\t}",
"public function Save($blnForceInsert = false, $blnForceUpdate = false) {\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = StewardshipPledge::GetDatabase();\n\n\t\t\t$mixToReturn = null;\n\n\t\t\ttry {\n\t\t\t\tif ((!$this->__blnRestored) || ($blnForceInsert)) {\n\t\t\t\t\t// Perform an INSERT query\n\t\t\t\t\t$objDatabase->NonQuery('\n\t\t\t\t\t\tINSERT INTO `stewardship_pledge` (\n\t\t\t\t\t\t\t`person_id`,\n\t\t\t\t\t\t\t`stewardship_fund_id`,\n\t\t\t\t\t\t\t`date_started`,\n\t\t\t\t\t\t\t`date_ended`,\n\t\t\t\t\t\t\t`pledge_amount`,\n\t\t\t\t\t\t\t`contributed_amount`,\n\t\t\t\t\t\t\t`remaining_amount`,\n\t\t\t\t\t\t\t`fulfilled_flag`,\n\t\t\t\t\t\t\t`active_flag`\n\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnActiveFlag) . '\n\t\t\t\t\t\t)\n\t\t\t\t\t');\n\n\t\t\t\t\t// Update Identity column and return its value\n\t\t\t\t\t$mixToReturn = $this->intId = $objDatabase->InsertId('stewardship_pledge', 'id');\n\n\t\t\t\t\t// Journaling\n\t\t\t\t\tif ($objDatabase->JournalingDatabase) $this->Journal('INSERT');\n\n\t\t\t\t} else {\n\t\t\t\t\t// Perform an UPDATE query\n\n\t\t\t\t\t// First checking for Optimistic Locking constraints (if applicable)\n\n\t\t\t\t\t// Perform the UPDATE query\n\t\t\t\t\t$objDatabase->NonQuery('\n\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\t`stewardship_pledge`\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t`person_id` = ' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t\t\t`stewardship_fund_id` = ' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t\t\t`date_started` = ' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t\t\t`date_ended` = ' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t\t\t`pledge_amount` = ' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t\t\t`contributed_amount` = ' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t\t\t`remaining_amount` = ' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t\t\t`fulfilled_flag` = ' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t\t\t`active_flag` = ' . $objDatabase->SqlVariable($this->blnActiveFlag) . '\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t`id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t\t\t');\n\n\t\t\t\t\t// Journaling\n\t\t\t\t\tif ($objDatabase->JournalingDatabase) $this->Journal('UPDATE');\n\t\t\t\t}\n\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\n\t\t\t// Update __blnRestored and any Non-Identity PK Columns (if applicable)\n\t\t\t$this->__blnRestored = true;\n\n\n\t\t\t// Return \n\t\t\treturn $mixToReturn;\n\t\t}",
"function loadByScholarshipID( $scholarshipID )\n {\n $condition = 'scholarship_id='.$scholarshipID;\n return $this->loadByCondition( $condition );\n }",
"private function load() {\r\n\t\t$sql_statement = 'SELECT no.contract_id, no.termination_date FROM '. TBL_NOTICE .' AS no WHERE no.notice_id = '. (int) $this->notice_id;\r\n\t\t$query = db_query($sql_statement);\r\n\r\n\t\tif(db_num_results($query) == 1) {\r\n\t\t\t$data = db_fetch_array($query);\r\n\t\t\t\t\r\n\t\t\t$this->contract_id = $data['contract_id'];\r\n\t\t\t$this->termination_date = $data['termination_date'];\r\n\t\t}\r\n\t}",
"public function loadBookingInformation()\n {\n $this->booking = Booking::with([\n 'usedCoupon',\n 'bookingPeriods',\n 'bookingAddOns.addOn',\n 'AdhocItems',\n ])->find(json_decode($this->request->booking, true)['id']);\n }",
"public function load($pk) {\n // ******* Note: $connection must be a mysqli object.\n global $connection;\n $returnvalue = false;\n try {\n if (is_array($pk)) { \n $this->setDeterminationID($pk[DeterminationID]);\n } else { ;\n $this->setDeterminationID($pk);\n };\n } \n catch (Exception $e) { \n throw new Exception($e->getMessage());\n }\n if($this->DeterminationID != NULL) {\n $sql = 'SELECT DeterminationID, TimestampCreated, TimestampModified, Version, CollectionMemberID, Addendum, AlternateName, Confidence, DeterminedDate, DeterminedDatePrecision, FeatureOrBasis, IsCurrent, Method, NameUsage, Number1, Number2, Qualifier, Remarks, Text1, Text2, TypeStatusName, YesNo1, YesNo2, YesNo3, FragmentID, TaxonID, ModifiedByAgentID, PreferredTaxonID, DeterminerID, CreatedByAgentID FROM determination WHERE DeterminationID = '.$this->DeterminationID ;\n\n $preparesql = 'SELECT DeterminationID, TimestampCreated, TimestampModified, Version, CollectionMemberID, Addendum, AlternateName, Confidence, DeterminedDate, DeterminedDatePrecision, FeatureOrBasis, IsCurrent, Method, NameUsage, Number1, Number2, Qualifier, Remarks, Text1, Text2, TypeStatusName, YesNo1, YesNo2, YesNo3, FragmentID, TaxonID, ModifiedByAgentID, PreferredTaxonID, DeterminerID, CreatedByAgentID FROM determination WHERE DeterminationID = ? ';\n\n if ($statement = $connection->prepare($preparesql)) { \n $statement->bind_param(\"i\", $this->DeterminationID);\n $statement->execute();\n $statement->bind_result($this->DeterminationID, $this->TimestampCreated, $this->TimestampModified, $this->Version, $this->CollectionMemberID, $this->Addendum, $this->AlternateName, $this->Confidence, $this->DeterminedDate, $this->DeterminedDatePrecision, $this->FeatureOrBasis, $this->IsCurrent, $this->Method, $this->NameUsage, $this->Number1, $this->Number2, $this->Qualifier, $this->Remarks, $this->Text1, $this->Text2, $this->TypeStatusName, $this->YesNo1, $this->YesNo2, $this->YesNo3, $this->FragmentID, $this->TaxonID, $this->ModifiedByAgentID, $this->PreferredTaxonID, $this->DeterminerID, $this->CreatedByAgentID);\n $statement->fetch();\n $statement->close();\n }\n\n $this->loaded = true;\n $this->dirty = false;\n } else { \n }\n return $returnvalue;\n }",
"public static function LoadById($intId, $objOptionalClauses = null) {\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}",
"public function load($pk) {\n // ******* Note: $connection must be a mysqli object.\n global $connection;\n $returnvalue = false;\n try {\n if (is_array($pk)) { \n $this->setDNASequencingRunID($pk[DNASequencingRunID]);\n } else { ;\n $this->setDNASequencingRunID($pk);\n };\n } \n catch (Exception $e) { \n throw new Exception($e->getMessage());\n }\n if($this->DNASequencingRunID != NULL) {\n $sql = 'SELECT DNASequencingRunID, TimestampCreated, TimestampModified, Version, CollectionMemberID, Number1, Number2, Number3, Ordinal, PCRCocktailPrimer, PCRForwardPrimerCode, PCRPrimerName, PCRPrimerSequence5_3, PCRReversePrimerCode, ReadDirection, Remarks, RunDate, ScoreFileName, SequenceCocktailPrimer, SequencePrimerCode, SequencePrimerName, SequencePrimerSequence5_3, Text1, Text2, Text3, TraceFileName, YesNo1, YesNo2, YesNo3, ModifiedByAgentID, DNASequenceID, CreatedByAgentID FROM dnasequencingrun WHERE DNASequencingRunID = '.$this->DNASequencingRunID ;\n\n $preparesql = 'SELECT DNASequencingRunID, TimestampCreated, TimestampModified, Version, CollectionMemberID, Number1, Number2, Number3, Ordinal, PCRCocktailPrimer, PCRForwardPrimerCode, PCRPrimerName, PCRPrimerSequence5_3, PCRReversePrimerCode, ReadDirection, Remarks, RunDate, ScoreFileName, SequenceCocktailPrimer, SequencePrimerCode, SequencePrimerName, SequencePrimerSequence5_3, Text1, Text2, Text3, TraceFileName, YesNo1, YesNo2, YesNo3, ModifiedByAgentID, DNASequenceID, CreatedByAgentID FROM dnasequencingrun WHERE DNASequencingRunID = ? ';\n\n if ($statement = $connection->prepare($preparesql)) { \n $statement->bind_param(\"i\", $this->DNASequencingRunID);\n $statement->execute();\n $statement->bind_result($this->DNASequencingRunID, $this->TimestampCreated, $this->TimestampModified, $this->Version, $this->CollectionMemberID, $this->Number1, $this->Number2, $this->Number3, $this->Ordinal, $this->PCRCocktailPrimer, $this->PCRForwardPrimerCode, $this->PCRPrimerName, $this->PCRPrimerSequence5_3, $this->PCRReversePrimerCode, $this->ReadDirection, $this->Remarks, $this->RunDate, $this->ScoreFileName, $this->SequenceCocktailPrimer, $this->SequencePrimerCode, $this->SequencePrimerName, $this->SequencePrimerSequence5_3, $this->Text1, $this->Text2, $this->Text3, $this->TraceFileName, $this->YesNo1, $this->YesNo2, $this->YesNo3, $this->ModifiedByAgentID, $this->DNASequenceID, $this->CreatedByAgentID);\n $statement->fetch();\n $statement->close();\n }\n\n $this->loaded = true;\n $this->dirty = false;\n } else { \n }\n return $returnvalue;\n }",
"function loadAssignment()\n{\n global $CFG, $PDOX, $LINK;\n $cacheloc = 'peer_assn';\n $row = Cache::check($cacheloc, $LINK->id);\n if ( $row != false && $row['json'] != 'null' ) return $row;\n $stmt = $PDOX->queryDie(\n \"SELECT assn_id, json FROM {$CFG->dbprefix}peer_assn WHERE link_id = :ID\",\n array(\":ID\" => $LINK->id)\n );\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $custom = LTIX::ltiCustomGet('config');\n // Check custom for errors and make it pretty\n if ( strlen($custom) > 1 ) {\n $decode = json_decode($custom);\n if ( $decode === null ) {\n error_log('Bad custom_config\\n'.$custom);\n $custom = null;\n } else {\n $pretty = json_encode($decode,JSON_PRETTY_PRINT);\n $custom = $pretty;\n }\n }\n\n if ( ( ! $custom || U::isEmpty($custom) ) && isset($_GET[\"inherit\"]) && isset($CFG->lessons) ) {\n $l = new Lessons($CFG->lessons);\n if ( $l ) {\n $lti = $l->getLtiByRlid($_GET['inherit']);\n if ( isset($lti->custom) ) foreach($lti->custom as $c ) {\n if (isset($c->key) && isset($c->json) && $c->key == 'config' ) {\n $custom = json_encode($c->json, JSON_PRETTY_PRINT);\n }\n }\n }\n }\n if ( $row === false && strlen($custom) > 1 ) {\n $stmt = $PDOX->queryReturnError(\n \"INSERT INTO {$CFG->dbprefix}peer_assn\n (link_id, json, created_at, updated_at)\n VALUES ( :ID, :JSON, NOW(), NOW())\n ON DUPLICATE KEY UPDATE json = :JSON, updated_at = NOW()\",\n array(\n ':JSON' => $custom,\n ':ID' => $LINK->id)\n );\n Cache::clear(\"peer_assn\");\n $stmt = $PDOX->queryDie(\n \"SELECT assn_id, json FROM {$CFG->dbprefix}peer_assn WHERE link_id = :ID\",\n array(\":ID\" => $LINK->id)\n );\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n if ( ! $row ) return $row;\n\n $row['json'] = upgradeSubmission($row['json'] );\n Cache::set($cacheloc, $LINK->id, $row);\n return $row;\n}",
"function reload_consensus( ) {\n\t\tif ( check_ajax_referer( 'ht-dms', 'nonce' ) ) {\n\n\t\t\t$dID = pods_v_sanitized( 'dID', 'post' );\n\t\t\tif ( $dID ) {\n\t\t\t\t$consensus = ht_dms_sorted_consensus_details( ht_dms_consensus_class()->sort_consensus( $dID, true ) );\n\t\t\t\twp_send_json( $consensus );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t}",
"function loadFromDb()\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy WHERE obj_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getId())\n\t\t);\n\t\tif ($result->numRows() == 1) \n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\t$this->setSurveyId($data[\"survey_id\"]);\n\t\t\t$this->setAuthor($data[\"author\"]);\n\t\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t\t$this->setIntroduction(ilRTE::_replaceMediaObjectImageSrc($data[\"introduction\"], 1));\n\t\t\tif (strcmp($data[\"outro\"], \"survey_finished\") == 0)\n\t\t\t{\n\t\t\t\t$this->setOutro($this->lng->txt(\"survey_finished\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->setOutro(ilRTE::_replaceMediaObjectImageSrc($data[\"outro\"], 1));\n\t\t\t}\n\t\t\t$this->setInvitation($data[\"invitation\"]);\n\t\t\t$this->setInvitationMode($data[\"invitation_mode\"]);\n\t\t\t$this->setShowQuestionTitles($data[\"show_question_titles\"]);\n\t\t\t$this->setStartDate($data[\"startdate\"]);\n\t\t\t$this->setEndDate($data[\"enddate\"]);\n\t\t\t$this->setAnonymize($data[\"anonymize\"]);\n\t\t\t$this->setEvaluationAccess($data[\"evaluation_access\"]);\n\t\t\t$this->loadQuestionsFromDb();\n\t\t\t$this->setStatus($data[\"status\"]);\n\t\t\t$this->setMailNotification($data['mailnotification']);\n\t\t\t$this->setMailAddresses($data['mailaddresses']);\n\t\t\t$this->setMailParticipantData($data['mailparticipantdata']);\n\t\t\t$this->setTemplate($data['template_id']);\n\t\t\t$this->setPoolUsage($data['pool_usage']);\n\t\t\t// 360°\n\t\t\t$this->set360Mode($data['mode_360']);\n\t\t\t$this->set360SelfEvaluation($data['mode_360_self_eval']);\n\t\t\t$this->set360SelfRaters($data['mode_360_self_rate']);\n\t\t\t$this->set360SelfAppraisee($data['mode_360_self_appr']);\n\t\t\t$this->set360Results($data['mode_360_results']);\n\t\t\t$this->set360SkillService($data['mode_360_skill_service']);\n\t\t\t// reminder/notification\n\t\t\t$this->setReminderStatus($data[\"reminder_status\"]);\n\t\t\t$this->setReminderStart($data[\"reminder_start\"] ? new ilDate($data[\"reminder_start\"], IL_CAL_DATE) : null);\n\t\t\t$this->setReminderEnd($data[\"reminder_end\"] ? new ilDate($data[\"reminder_end\"], IL_CAL_DATE) : null);\n\t\t\t$this->setReminderFrequency($data[\"reminder_frequency\"]);\n\t\t\t$this->setReminderTarget($data[\"reminder_target\"]);\n\t\t\t$this->setReminderLastSent($data[\"reminder_last_sent\"]);\n\t\t\t$this->setTutorNotificationStatus($data[\"tutor_ntf_status\"]);\n\t\t\t$this->setTutorNotificationRecipients(explode(\";\", $data[\"tutor_ntf_reci\"]));\n\t\t\t$this->setTutorNotificationTarget($data[\"tutor_ntf_target\"]);\n\t\t\t\n\t\t\t$this->setViewOwnResults($data[\"own_results_view\"]);\n\t\t\t$this->setMailOwnResults($data[\"own_results_mail\"]);\n\t\t}\n\t\t\n\t\t// moved activation to ilObjectActivation\n\t\tif($this->ref_id)\n\t\t{\n\t\t\tinclude_once \"./Services/Object/classes/class.ilObjectActivation.php\";\n\t\t\t$activation = ilObjectActivation::getItem($this->ref_id);\t\t\t\n\t\t\tswitch($activation[\"timing_type\"])\n\t\t\t{\t\t\t\t\n\t\t\t\tcase ilObjectActivation::TIMINGS_ACTIVATION:\t\n\t\t\t\t\t$this->setActivationLimited(true);\n\t\t\t\t\t$this->setActivationStartDate($activation[\"timing_start\"]);\n\t\t\t\t\t$this->setActivationEndDate($activation[\"timing_end\"]);\n\t\t\t\t\t$this->setActivationVisibility($activation[\"visible\"]);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\t\t\t\n\t\t\t\t\t$this->setActivationLimited(false);\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"public static function LoadByPersonIdStewardshipFundId($intPersonId, $intStewardshipFundId, $objOptionalClauses = null) {\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::AndCondition(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->PersonId, $intPersonId),\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId)\n\t\t\t\t)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}",
"public function load()\n {\n try\n {\n if (empty(self::getWNumber()))\n {\n die(\"error: the wnumber is not provided\");\n }\n else\n {\n parent::load();\n $dbh = DatabaseConnection::getInstance();\n $stmtHandle = $dbh->prepare(\"SELECT * FROM `Student` WHERE wNumber = :wNumber\");\n $stmtHandle->bindValue(\":wNumber\", self::getWNumber());\n\n $stmtHandle->setFetchMode(\\PDO::FETCH_ASSOC);\n $success = $stmtHandle->execute();\n\n if (!$success)\n {\n throw new \\PDOException(\"error: sql query execution failed.\");\n }\n else\n {\n $user = $stmtHandle->fetch();\n\n // Setting the student specific attributes value from the database\n $this->setOverallGPA($user['overallGPA']);\n $this->setMajorGPA($user['majorGPA']);\n $this->setActScore($user['ACTScore']);\n $this->setCurrentMajor($user['currentMajor']);\n $this->setFutureMajor($user['futureMajor']);\n $this->setCurrentAcademicLevel($user['currentAcademicLevel']);\n $this->setDegreeGoal($user['degreeGoal']);\n $this->setHighSchool($user['highSchool']);\n $this->setPreviousUniversity($user['previousUniversity']);\n $this->setFirstSemester($user['firstWSUSemester']);\n $this->setFirstYear($user['firstWSUYear']);\n $this->setScheduleStatus($user['scheduleStatus']);\n $this->setClubsOrganizations($user['clubOrganizations']);\n $this->setHonorsAwards($user['honorsAwards']);\n $this->setCsTopicInterests($user['csTopicInterests']);\n $this->setPastScholarshipFinancialAid($user['pastScholarshipFinancialAid']);\n $this->setGreatestAchievement($user['greatestAchievement']);\n\n // Prepare sql statement to retrieve the courses info related to this student\n $stmtHandle = $dbh->prepare(\"SELECT ConcurrentPastCourse.wNumber, \n ConcurrentPastCourse.courseStatus, \n CSCourse.courseNumber \n FROM `CSCourse` JOIN `ConcurrentPastCourse` \n ON CSCourse.courseId = ConcurrentPastCourse.courseId \n WHERE ConcurrentPastCourse.wNumber = :wNumber\n AND ConcurrentPastCourse.courseStatus = :courseStatus\");\n\n $stmtHandle->bindValue(\":wNumber\", $this->getWNumber());\n $stmtHandle->bindValue(\":courseStatus\", self::CURRENT_COURSE);\n $success = $stmtHandle->execute();\n\n if (!$success)\n {\n throw new \\PDOException(\"error: sql query execution failed.\");\n }\n else\n {\n $curr_course_list = array();\n while ($course = $stmtHandle->fetch())\n {\n array_push($curr_course_list, $course['courseNumber']);\n }\n self::setCurrentCourses($curr_course_list);\n }\n\n $stmtHandle->bindValue(\":courseStatus\", self::PREVIOUS_COURSE);\n $success = $stmtHandle->execute();\n\n if (!$success)\n {\n throw new \\PDOException(\"error: sql query execution failed.\");\n }\n else\n {\n $prev_course_list = array();\n while ($course = $stmtHandle->fetch())\n {\n array_push($prev_course_list, $course['courseNumber']);\n }\n self::setPreviousCourses($prev_course_list);\n }\n\n // Prepare sql statement to retrieve ap test info related to this student\n $stmtHandle = $dbh->prepare(\"SELECT APTest.apTestName, APTestPassed.wNumber \n FROM `APTest` JOIN `APTestPassed` \n ON APTest.apTestId = APTestPassed.apTestId \n WHERE APTestPassed.wNumber = :wNumber\");\n $stmtHandle->bindValue(\":wNumber\", $this->getWNumber());\n $success = $stmtHandle->execute();\n\n if (!$success)\n {\n throw new \\PDOException(\"error: sql query execution failed.\");\n }\n else\n {\n $test_list = array();\n while ($passed_test = $stmtHandle->fetch())\n {\n array_push($test_list, $passed_test['apTestName']);\n }\n self::setApTests($test_list);\n }\n }\n }\n }\n catch (\\PDOException $e)\n {\n throw $e;\n }\n }",
"public function supplemental_draft($round)\r\n\t{\t\r\n\t\t$this->Database_Manager->database_backup(array('Draft_Picks'));\r\n\t\t$this->Database_Manager->database_backup(array('Drafts'));\r\n\t\t$this->Database_Manager->database_backup(array('Players'));\r\n\t\t$this->Database_Manager->database_backup(array('Rosters','Supplemental_Selections'));\r\n\r\n\t\t\r\n\t\t$draft_order = $this->Drafts->get_draft_results_year($this->league_id,$this->current_year);\r\n\t\t//get the id and start time for this draft\r\n\t\tforeach($draft_order['Supplemental'] as $draft_id => $draft_data){\r\n\t\t\t$start_time = $draft_data['start_time'];\r\n\t\t}\r\n\t\t//work the array down until we have just the first or second half of the draft order, depending on which round it is\r\n\t\t$draft_order = array_pop($draft_order['Supplemental']);\r\n\t\t$draft_order=$draft_order['picks'];\r\n\t\t$half = floor(count($draft_order)/2);\r\n\t\t$draft_order = array_chunk($draft_order,$half);\r\n\t\t$draft_order=$draft_order[$round-1];\r\n\t\t//go through each pick\r\n\t\tforeach($draft_order as $pick_minus_1 => $pick_data) {\r\n\t\t\t$team_selection = $this->db->where('team_id',$pick_data['team_id'])\r\n\t\t\t\t\t\t\t->order_by('priority','ASC')\r\n\t\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t\t->get('Supplemental_Selections');\r\n\t\t\tif($team_selection->num_rows()>0){\r\n\t\t\t\t//there's a player selected, proceed with the selection\r\n\t\t\t\tforeach($team_selection->result_array() as $selection){\r\n\t\t\t\t\techo ($pick_minus_1+1).'. '.team_name_link($pick_data['team_id']).' '.player_name_link($selection['fffl_player_id']).'<br>';\r\n\t\t\t\t\t//check to make sure it's time for this draft before making selections\r\n\t\t\t\t\tif($start_time< now()){\r\n\t\t\t\t\t\t//update the draft_picks table where pick_id matches\r\n\t\t\t\t\t\t$this->db->set('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->where('pick_id',$pick_data['pick_id'])\r\n\t\t\t\t\t\t\t\t->update('Draft_Picks');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//get the free agent salary for this player to set as the salary for the new team\r\n\t\t\t\t\t\t$salary = $this->Salaries->get_free_agent_salary($selection['fffl_player_id']);\r\n\t\t\t\t\t\t//get player position\r\n\t\t\t\t\t\t$player_info = $this->Players->get_player_info(array($selection['fffl_player_id']),\"fffl_player_id\",\"position\");\r\n\t\t\t\t\t\t$position = $player_info['position'];\r\n\t\t\t\t\t\t//add to roster using salary\r\n\t\t\t\t\t\t$this->db->set('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->set('team_id',$pick_data['team_id'])\r\n\t\t\t\t\t\t\t\t->set('salary',$salary)\r\n\t\t\t\t\t\t\t\t->set('position', $position)\r\n\t\t\t\t\t\t\t\t->set('lineup_area','Roster')\r\n\t\t\t\t\t\t\t\t->insert('Rosters');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//delete any request in the supplemental selections for this player\r\n\t\t\t\t\t\t$this->db->where('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->delete('Supplemental_Selections');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}//end if team has selections > 0\r\n\t\t\t//there isn't a palyer ot pick, pass the team.\r\n\t\t\telse{\r\n\t\t\t\t//************************THIS IS OLD CODE FROM THE OLD SITE THAT MANAGED COMPENSATORY PICKS. ONLY NECESSARY TO REDO THIS CODE IF WE REINSTITUTE COMPENSATORY PICKS*************************//\r\n\t\t\t\t\t\t\t\t//There's no player to pick, so the team passes and (THIS USED TO GIVE A COMPENSATORY PICK) //needs a compensatory pick assigned\r\n\t\t\t\t\t\t\t\t$teamId=$pick_data['team_id'];\r\n\t\t\t\t\t\t\t\t//update the draft_picks table where pick_id matches\r\n\t\t\t\t\t\t\t\t$this->db->set('fffl_player_id',0)\r\n\t\t\t\t\t\t\t\t\t\t->where('pick_id',$pick_data['pick_id'])\r\n\t\t\t\t\t\t\t\t\t\t->update('Draft_Picks');\r\n\t\t\t\t\t\t\t\t//Below is what used to award a compensatory pick to a passing team\r\n\t\t\t\t\t\t\t\t/*if($s==0) { //This is the first of a new pair of passing teams. The first in the pair gets lined up with his drafting day.\r\n\t\t\t\t\t\t\t\t\tif($draftorder[$i]['pos']<11) {\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$s=2; //s=2 means the next guy gets a Saturday pick\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental+10;\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental-10;\r\n\t\t\t\t\t\t\t\t\t\t$s=1; //s=1 means the next guy gets a Friday pick\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"INSERT into SupplementalDrafts values($CurSeasonId,\".$draftorder[$i]['pick'].\",\".$draftorder[$i]['team'].\",0)\");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t} else { //This is the second passer in a pair, he gets put on the other day from the team above when s=0.\r\n\t\t\t\t\t\t\t\t\tif($s==1) { //This team gets a fRiday pick\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\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\t\r\n\t\t\t\t\t\t\t\t\t} else if($s==2) { //This team gets a Saturday pick\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental+10;\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental-10;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"INSERT into SupplementalDrafts values($CurSeasonId,\".$draftorder[$i]['pick'].\",\".$draftorder[$i]['team'].\",0)\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$s=0; //the next passer will get put with his draft day in the above IF statement\r\n\t\t\t\t\t\t\t\t\t$supplemental++; \r\n\t\t\t\t\t\t\t\t}*/\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t/*}*/\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t}//end of the draft\r\n\t\t//delete all supplemental selections for the next supplemental draft\r\n\t\tif($start_time< now()){\r\n\t\t\t$this->db->where(1)->delete('Supplemental_Selections');\r\n\t\t}\r\n\t\t\r\n\t}",
"private function _loadFromRS($r)\n {\n $pk = self::PK;\n $this->_id = (int)$r->$pk;\n $this->_date = $r->date_enreg;\n $this->_amount = $r->montant_cotis;\n //save original amount, we need it for transactions parts calulations\n $this->_orig_amount = $r->montant_cotis;\n $this->_payment_type = $r->type_paiement_cotis;\n $this->_info = $r->info_cotis;\n $this->_begin_date = $r->date_debut_cotis;\n $enddate = $r->date_fin_cotis;\n //do not work with knows bad dates...\n //the one with BC comes from 0.63/pgsl demo... Why the hell a so\n //strange date? dont know :(\n if ( $enddate !== '0000-00-00'\n && $enddate !== '1901-01-01'\n && $enddate !== '0001-01-01 BC'\n ) {\n $this->_end_date = $r->date_fin_cotis;\n }\n $adhpk = Adherent::PK;\n $this->_member = (int)$r->$adhpk;\n\n $transpk = Transaction::PK;\n if ( $r->$transpk != '' ) {\n $this->_transaction = new Transaction((int)$r->$transpk);\n }\n\n $this->_type = new ContributionsTypes((int)$r->id_type_cotis);\n if ( $this->_type->extension == 1 ) {\n $this->_is_cotis = true;\n } else {\n $this->_is_cotis = false;\n }\n }",
"abstract public function load($Type, $Key, $DetailLevel);",
"public function loadFeeByID($feeID)\n {\n }",
"public function loadStockData(){\n if (JeproshopTools::isLoadedObject($this, 'product_id')){\n // By default, the product quantity correspond to the available quantity to sell in the current shop\n $this->quantity = JeproshopStockAvailableModelStockAvailable::getQuantityAvailableByProduct($this->product_id, 0);\n $this->out_of_stock = JeproshopStockAvailableModelStockAvailable::outOfStock($this->product_id);\n $this->depends_on_stock = JeproshopStockAvailableModelStockAvailable::dependsOnStock($this->product_id);\n if (JeproshopContext::getContext()->shop->getShopContext() == JeproshopShopModelShop::CONTEXT_GROUP && JeproshopContext::getContext()->shop->getContextShopGroup()->share_stock == 1){\n $this->advanced_stock_management = $this->useAdvancedStockManagement();\n }\n }\n }",
"public function load($key);",
"function load($pid)\r\n\t{\r\n\t\tglobal $debug;\r\n\t\t$dbh = getOpenedConnection();\r\n\t\t\r\n\t\tif ($dbh == null) {\r\n\t\t\t$dbh = openDB();\r\n\t\t\tif ($dbh == null)\r\n\t\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ($pid == \"\")\r\n\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t$sql = \"\r\n\t\t\tselect\r\n\t\tId,\r\n\t\tCompetitionId,\r\n\t\tDayNo,\r\n\t\tFirstStart,\r\n\t\tLastStart,\r\n\t\tMaxStation,\r\n\t\tPatrolSpace\r\n\t\tfrom tbl_Pistol_CompetitionDay\r\n\t\twhere Id = $pid;\r\n\t\t\";\r\n\r\n\t\t$result = mysqli_query($dbh,$sql);\r\n\t\tif ($obj = mysqli_fetch_object($result))\r\n\t\t{\r\n\t\t\t$this->id = $obj->Id;\r\n\t\t\t$this->competitionId = $obj->CompetitionId;\r\n\t\t\t$this->dayNo = $obj->DayNo;\r\n\t\t\t$this->firstStart = $obj->FirstStart;\r\n\t\t\t$this->lastStart = $obj->LastStart;\r\n\t\t\t$this->maxStation = $obj->MaxStation;\r\n\t\t\t$this->patrolSpace = $obj->PatrolSpace;\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tmysqli_free_result($result);\r\n\t}",
"function TicketRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_ticket\";\n\n\t\t$pDataHash['ticket_store']['office'] = $data[0];\n\t\t$pDataHash['ticket_store']['ticket_id'] = $data[1];\n\t\t$pDataHash['ticket_store']['ticket_ref'] = $data[2];\n\t\t$pDataHash['ticket_store']['ticket_no'] = $data[3];\n\t\t$pDataHash['ticket_store']['tags'] = $data[4];\n\t\t$pDataHash['ticket_store']['clearance'] = $data[5];\n\t\t$pDataHash['ticket_store']['room'] = $data[6];\n\t\tif ( $data[7] == '[null]' )\n\t\t\t$pDataHash['ticket_store']['note'] = '';\n\t\telse\n\t\t\t$pDataHash['ticket_store']['note'] = $data[7];\n\t\tif ( $data[8] == '[null]' )\n\t\t\t$pDataHash['ticket_store']['last'] = '';\n\t\telse\n\t\t\t$pDataHash['ticket_store']['last'] = $data[8];\n\t\t$pDataHash['ticket_store']['staff_id'] = $data[9];\n\t\t$pDataHash['ticket_store']['init_id'] = $data[10];\n\t\t$pDataHash['ticket_store']['caller_id'] = $data[11];\n\t\t$pDataHash['ticket_store']['appoint_id'] = $data[12];\n\t\t$pDataHash['ticket_store']['applet'] = $data[13];\n\t\tif ( $data[14] != '[null]' ) $pDataHash['ticket_store']['memo'] = $data[14];\n\t\tif ( $data[15] == '[null]' )\n\t\t\t$pDataHash['ticket_store']['department'] = 0;\n\t\telse\n\t\t\t$pDataHash['ticket_store']['department'] = $data[15];\n\n\t\t// Create LC entry details from legacy data\n\t\tglobal $gBitSystem;\n\t\t\n\t\t$this->mDb->StartTrans();\n\t\t$this->mContentId = 0;\n\t\t$pDataHash['content_id'] = 0;\n\t\t$pDataHash['user_id'] = $pDataHash['ticket_store']['init_id'];\n\t\t$pDataHash['modifier_user_id'] = $pDataHash['ticket_store']['staff_id'];\n\t\t$pDataHash['created'] = $gBitSystem->mServerTimestamp->getTimestampFromISO($pDataHash['ticket_store']['ticket_ref'], true);\n\t\t$pDataHash['event_time'] = $pDataHash['created'];\n\t\t$pDataHash['last_modified'] = $gBitSystem->mServerTimestamp->getTimestampFromISO($pDataHash['ticket_store']['last'], true);\n\t\t$pDataHash['title'] = $pDataHash['ticket_store']['ticket_ref'].'-Ticket-'.$pDataHash['ticket_store']['ticket_no'];\n\t\t$pDataHash['content_status_id'] = 60; // Mark all records Finished - data can't be modified, so read only!\n\t\tif ( LibertyContent::store( $pDataHash ) ) {\n\t\t\t$pDataHash['ticket_store']['content_id'] = $pDataHash['content_id'];\n\t\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['ticket_store'] );\n\t\t\t$this->mDb->CompleteTrans();\n\t\t} else {\n\t\t\t$this->mDb->RollbackTrans();\n\t\t\t$this->mErrors['store'] = 'Failed to store this ticket.';\n\t\t}\t\t\t\t\n\t}",
"public function Load_from_key($key_row)\n {\n $result = $this->connection->RunQuery(\"Select * from tbl_estado_domiciliarios where ID_ESTADO_DOMICILIARIOS = \\\"$key_row\\\" \");\n while ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n $this->ID_ESTADO_DOMICILIARIOS = $row[\"ID_ESTADO_DOMICILIARIOS\"];\n $this->ID_USUARIO = $row[\"ID_USUARIO\"];\n $this->DESCRIPCION = $row[\"DESCRIPCION_ESTADO\"];\n }\n }",
"function load ($team_id) {\r\n\t\t// 2) copy to $this\t\t\r\n\t}",
"public function resetDpNpc()\n {\n if (is_null($this->mrGoldenKeyObj)\n || !$this->isPresent($this->mrGoldenKeyObj)) {\n // Creates a golden key based on the standard DpObject, moves it\n // here:\n $this->mrGoldenKeyObj = get_current_dpuniverse()->newDpObject(\n DPUNIVERSE_STD_PATH . 'DpObject.php');\n $this->mrGoldenKeyObj->addId(dp_text('key'));\n $this->mrGoldenKeyObj->title = dp_text('golden key');\n $this->mrGoldenKeyObj->titleDefinite = dp_text('the golden key');\n $this->mrGoldenKeyObj->titleIndefinite = dp_text('a golden key');\n $this->mrGoldenKeyObj->titleImg = DPUNIVERSE_IMAGE_URL\n . 'golden_key.png';\n $this->mrGoldenKeyObj->titleImgWidth = 44;\n $this->mrGoldenKeyObj->titleImgHeight = 46;\n $this->mrGoldenKeyObj->body = '<img src=\"' . DPUNIVERSE_IMAGE_URL\n . 'golden_key.png\" width=\"44\" height=\"46\" border=\"0\" '\n . 'alt=\"\" align=\"left\" style=\"margin-right: 15px\" />'\n . dp_text('A golden key.<br />You wonder what it can unlock...');\n $this->mrGoldenKeyObj->value = 180;\n $this->mrGoldenKeyObj->coinherit(DPUNIVERSE_STD_PATH . 'mass.php');\n $this->mrGoldenKeyObj->weight = 1;\n $this->mrGoldenKeyObj->volume = 1;\n $this->mrGoldenKeyObj->isNoStore = new_dp_property(TRUE);\n $this->mrGoldenKeyObj->moveDpObject($this);\n }\n }",
"function load()\n { \n $sql = \"SELECT `id`,\n `skype_name`\n FROM `\".$this->tblSkypeCourse.\"`\n WHERE `course_id` = '\".addslashes($this->course_id).\"'\";\n\n $data = claro_sql_query_get_single_row($sql);\n\n if( !empty($data) )\n {\n $this->id = $data['id'];\n $this->skype_name = $data['skype_name'];\n\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function save() {\n $keys = $this->requirement->snid ? array('snid') : array();\n return drupal_write_record('course_outline', $this->requirement, $keys);\n }",
"function getProposalViaStudentId($id) {\n $sql = \"SELECT *\n FROM proposal\n WHERE studentid = :id\";\n \n $stmt = $this->db->prepare($sql);\n $stmt->bindParam(\"id\", $id);\n $stmt->execute(); \n $row_count = $stmt->rowCount();\n $data = array();\n $proposal = new Proposal();\n \n if ($row_count)\n {\n while($row = $stmt->fetch(PDO::FETCH_ASSOC))\n {\n $proposal = new Proposal();\n $proposal->id = $row['id'];\n $proposal->studentid = $row['studentid'];\n $proposal->title = $row['title'];\n $proposal->type = $row['type'];\n $proposal->status = $row['status']; \n \n array_push($data, $proposal);\n }\n }\n \n return $data;\n }",
"public function loadLinkedFromdeterminationcitation() { \n // ForeignKey in: determinationcitation\n $t = new determinationcitation();\n }",
"public function loadFromStore() {\r\n $licenses = $this->context->dbDriver->get(RestoDatabaseDriver::LICENSES, array('licenseId' => $this->licenseId));\r\n if (!isset($licenses[$this->licenseId])) {\r\n RestoLogUtil::httpError(400, 'License ' . $this->licenseId . ' does not exist in database');\r\n }\r\n $this->description = $licenses[$this->licenseId];\r\n }",
"function sperahid() {\n\t\t// we don't need to set StoreCard to true if the card hasn't expired and also\n\t\t// we need to set the HPP to use the stored card instead of asking for a new one and\n\t\t// we probably just go ahead and charge the stored card, and only use HPP if the stored card\n\t\t// fails and we mark the stored card inactive or delete it on failure and just go with the new one on the transaction\n\t\t// results\n\n\t\t$StoreCard = (isset($_REQUEST['StoreCard']) && $_REQUEST['StoreCard'] == 'true') ? true : false;\n\n\t\t$amountDue = $_REQUEST['amountDue'];\n\n\t\t$this->load->library('protectpayapi');\n\n\t\t$applicationEnv = ENVIRONMENT;\n\n\n\t\t$parsedAccountUrlPrefix = $_SESSION['accountUrlPrefix'];\n\n\t\t$databaseName = $parsedAccountUrlPrefix . '_' . ENVIRONMENT;\n\n\t\t/** @var CI_DB_mysql_driver $primaryDatabase */\n\t\t$primaryDatabase = $this->load->database('primary', TRUE);\n\n\t\t$params = [\n\t\t\t'primaryDatabase' => $primaryDatabase,\n\t\t];\n\t\t$this->load->library('account', $params);\n\n\t\t$params = [\n\t\t\t'databaseName' => $databaseName,\n\t\t\t'primaryDatabase' => $primaryDatabase];\n\n\t\t$this->load->library('propay_api', $params);\n\n\t\t$data = [\n\t\t\t\"Amount\" => (int) $amountDue, //convert to cents\n\t\t\t\"AuthOnly\" => false,\n\t\t\t\"AvsRequirementType\" => 3,\n\t\t\t\"CardHolderNameRequirementType\" => 2,\n\t\t\t\"CssUrl\" => \"https://spera-\" . $applicationEnv . \".s3-us-west-2.amazonaws.com/pmi.css\",\n\t\t\t\"CurrencyCode\" => \"USD\",\n\t\t\t\"InvoiceNumber\" => $_SESSION['accountUrlPrefix'],\n\t\t\t\"MerchantProfileId\" => PROTECT_PAY_MERCHANT_PROFILE_ID,\n\t\t\t\"OnlyStoreCardOnSuccessfulProcess\" => $StoreCard,\n\t\t\t\"PayerAccountId\" => PROTECT_PAY_PAYER_ACCOUNT_ID,\n\t\t\t\"ProcessCard\" => true,\n\t\t\t\"Protected\" => false,\n\t\t\t\"SecurityCodeRequirementType\" => 1,\n\t\t\t\"StoreCard\" => $StoreCard,\n\t\t];\n\n\t\tif ($_REQUEST['paymentType'] == 'card') {\n\t\t\t$data[\"PaymentTypeId\"] = \"0\";\n\t\t} else if ($_REQUEST['paymentType'] == 'ach') {\n\t\t\t$data[\"PaymentTypeId\"] = \"1\";\n\t\t}\n\n\t\t$result = $this->protectpayapi\n\t\t\t->setApiBaseUrl(PROTECT_PAY_API_BASE_URL)\n\t\t\t->setBillerId(PROTECT_PAY_BILLER_ID)\n\t\t\t->setAuthToken(PROTECT_PAY_AUTH_TOKEN)\n\t\t\t->setHostedTransactionData($data)\n\t\t\t->createHostedTransaction()\n\t\t\t->getCreatedHostedTransactionInfo();\n\t\t$responseObject = json_decode($result);\n\n\t\tif ( $responseObject ) {\n\t\t\t$_SESSION['paymentType'] = $_REQUEST['paymentType'];\n\t\t\t$_SESSION['HostedTransactionIdentifier'] = $responseObject->HostedTransactionIdentifier;\n\t\t\t$_SESSION['merchantProfileId'] = PROTECT_PAY_MERCHANT_PROFILE_ID;\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode([\n\t\t\t'success' => true,\n\t\t\t'message' => $amountDue, //'Hosted Transaction Identifier Created Successfully.',\n\t\t\t'HostedTransactionIdentifier' => $_SESSION['HostedTransactionIdentifier']\n\t\t]);\n\n\t\tdie();\n\t}"
] |
[
"0.59407246",
"0.5031569",
"0.49839",
"0.48135793",
"0.476789",
"0.46664026",
"0.45890746",
"0.45130694",
"0.44946355",
"0.4485875",
"0.4406159",
"0.43964395",
"0.43550333",
"0.4331739",
"0.4317674",
"0.42368028",
"0.4225409",
"0.42069945",
"0.42037174",
"0.41951865",
"0.41901407",
"0.41821855",
"0.4162626",
"0.4156341",
"0.41455185",
"0.41289964",
"0.41278198",
"0.41271055",
"0.41169998",
"0.4114122"
] |
0.55584145
|
1
|
Static Qcodo Query method to query for a single StewardshipPledge object. Uses BuildQueryStatment to perform most of the work.
|
public static function QuerySingle(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
// Get the Query Statement
try {
$strQuery = StewardshipPledge::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// Perform the Query
$objDbResult = $objQueryBuilder->Database->Query($strQuery);
// Instantiate a new StewardshipPledge object and return it
// Do we have to expand anything?
if ($objQueryBuilder->ExpandAsArrayNodes) {
$objToReturn = array();
while ($objDbRow = $objDbResult->GetNextRow()) {
$objItem = StewardshipPledge::InstantiateDbRow($objDbRow, null, $objQueryBuilder->ExpandAsArrayNodes, $objToReturn, $objQueryBuilder->ColumnAliasArray);
if ($objItem) $objToReturn[] = $objItem;
}
if (count($objToReturn)) {
// Since we only want the object to return, lets return the object and not the array.
return $objToReturn[0];
} else {
return null;
}
} else {
// No expands just return the first row
$objDbRow = $objDbResult->GetNextRow();
if (is_null($objDbRow)) return null;
return StewardshipPledge::InstantiateDbRow($objDbRow, null, null, null, $objQueryBuilder->ColumnAliasArray);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected static function BuildQueryStatement(&$objQueryBuilder, QQCondition $objConditions, $objOptionalClauses, $mixParameterArray, $blnCountOnly) {\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = StewardshipPledge::GetDatabase();\n\n\t\t\t// Create/Build out the QueryBuilder object with StewardshipPledge-specific SELET and FROM fields\n\t\t\t$objQueryBuilder = new QQueryBuilder($objDatabase, 'stewardship_pledge');\n\t\t\tStewardshipPledge::GetSelectFields($objQueryBuilder);\n\t\t\t$objQueryBuilder->AddFromItem('stewardship_pledge');\n\n\t\t\t// Set \"CountOnly\" option (if applicable)\n\t\t\tif ($blnCountOnly)\n\t\t\t\t$objQueryBuilder->SetCountOnlyFlag();\n\n\t\t\t// Apply Any Conditions\n\t\t\tif ($objConditions)\n\t\t\t\ttry {\n\t\t\t\t\t$objConditions->UpdateQueryBuilder($objQueryBuilder);\n\t\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\t\tthrow $objExc;\n\t\t\t\t}\n\n\t\t\t// Iterate through all the Optional Clauses (if any) and perform accordingly\n\t\t\tif ($objOptionalClauses) {\n\t\t\t\tif ($objOptionalClauses instanceof QQClause)\n\t\t\t\t\t$objOptionalClauses->UpdateQueryBuilder($objQueryBuilder);\n\t\t\t\telse if (is_array($objOptionalClauses))\n\t\t\t\t\tforeach ($objOptionalClauses as $objClause)\n\t\t\t\t\t\t$objClause->UpdateQueryBuilder($objQueryBuilder);\n\t\t\t\telse\n\t\t\t\t\tthrow new QCallerException('Optional Clauses must be a QQClause object or an array of QQClause objects');\n\t\t\t}\n\n\t\t\t// Get the SQL Statement\n\t\t\t$strQuery = $objQueryBuilder->GetStatement();\n\n\t\t\t// Prepare the Statement with the Query Parameters (if applicable)\n\t\t\tif ($mixParameterArray) {\n\t\t\t\tif (is_array($mixParameterArray)) {\n\t\t\t\t\tif (count($mixParameterArray))\n\t\t\t\t\t\t$strQuery = $objDatabase->PrepareStatement($strQuery, $mixParameterArray);\n\n\t\t\t\t\t// Ensure that there are no other Unresolved Named Parameters\n\t\t\t\t\tif (strpos($strQuery, chr(QQNamedValue::DelimiterCode) . '{') !== false)\n\t\t\t\t\t\tthrow new QCallerException('Unresolved named parameters in the query');\n\t\t\t\t} else\n\t\t\t\t\tthrow new QCallerException('Parameter Array must be an array of name-value parameter pairs');\n\t\t\t}\n\n\t\t\t// Return the Objects\n\t\t\treturn $strQuery;\n\t\t}",
"public function query()\n {\n $query = xpsArt::join('sys_lock_status', 'xps_art.sys_lock_status_id', '=', 'sys_lock_status.sys_lock_status_id')\n\t\t->select([\n\t\t\t'art_id',\n\t\t\t'art_id as id',\n\t\t\t'prod_sg_id',\n\t\t\t'xps_art.descr',\n\t\t\t'mis_art',\n\t\t\t'env_id',\n\t\t\t'xps_art.sys_lock_status_id',\n\t\t\t'sys_lock_status.descr as lock_descr',\n\t\t\t'digital',\n\t\t\t'price_only'\n ]);\n\n return $this->applyScopes($query);\n }",
"public static function query()\n {\n }",
"public function query()\n {\n if($this->type ==1){\n return Upgrade::query()->where(['status'=>0,'year'=>currentYear(),'semester'=>currentSemester()]);\n }\n elseif ($this->type==2){\n return Upgrade::query()->where(['status'=>1,'year'=>currentYear(),'semester'=>currentSemester()]);\n }\n\n\n }",
"public static function query();",
"public function Query(){\r\n\t\treturn self::get_query();\r\n\t}",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StewardshipPledge object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StewardshipPledge::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->PersonId = $objReloaded->PersonId;\n\t\t\t$this->StewardshipFundId = $objReloaded->StewardshipFundId;\n\t\t\t$this->dttDateStarted = $objReloaded->dttDateStarted;\n\t\t\t$this->dttDateEnded = $objReloaded->dttDateEnded;\n\t\t\t$this->fltPledgeAmount = $objReloaded->fltPledgeAmount;\n\t\t\t$this->fltContributedAmount = $objReloaded->fltContributedAmount;\n\t\t\t$this->fltRemainingAmount = $objReloaded->fltRemainingAmount;\n\t\t\t$this->blnFulfilledFlag = $objReloaded->blnFulfilledFlag;\n\t\t\t$this->blnActiveFlag = $objReloaded->blnActiveFlag;\n\t\t}",
"public function _query()\n {\n }",
"public function query()\n {\n $query = xpsFoldsheet::select([\n\t\t'foldsheet_id as id',\n\t\t'foldsheet_id',\n\t\t'foldcat',\n\t\t'stand',\n\t\t'pag',\n\t\t'strook',\n\t\t'descr',\n\t\t'pag_in_breedte',\n\t\t'pag_in_hoogte',\n\t\t'afloop_l',\n\t\t'afloop_r',\n\t\t'afloop_b',\n\t\t'afloop_o',\n\t\t'kopwit_breed',\n\t\t'kopwit_hoog',\n\t\t'kruiswit_breed',\n\t\t'kruiswit_hoog',\n\t\t'freeswit_breed',\n\t\t'freeswit_hoog',\n\t\t'overslag_breed',\n\t\t'overslag_hoog'\n ]);\n\n return $this->applyScopes($query);\n }",
"public static function query()\n {\n return (new static)->newQuery();\n }",
"public static function query()\n {\n return (new static)->newQuery();\n }",
"public function query()\n {\n $checkouts = Checkout::query()\n ->addSelect('checkouts.id')\n ->addSelect('checkouts.asset_id')\n ->addSelect('checkouts.user_id')\n ->addSelect('checkouts.dealer_id')\n ->addSelect('checkouts.project')\n ->addSelect('checkouts.expected_return_date')\n ->addSelect('checkouts.created_at')\n ->where('checkouts.returned_date', '=', null)\n ->with('user')->with('dealer')->with('dealer.dealership')->with('asset');\n\n return $this->applyScopes($checkouts);\n }",
"public function query();",
"public function query();",
"public function query();",
"public function query() {\n\n // new, more inclusive\n $query = parent::query();\n // Add in book parent child relationships.\n $query->leftJoin('book', 'b', 'n.nid = b.nid');\n $query->addField('b', 'bid', 'book_id');\n $query->leftJoin('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->addField('ml', 'weight', 'book_weight');\n $query->addField('ml', 'mlid', 'mlid');\n $query->addField('ml', 'plid', 'plid');\n $query->orderBy('mlid');\n\n // dpq($query);\n return $query;\n }",
"public function Journal($strJournalCommand) {\n\t\t\t$objDatabase = StewardshipPledge::GetDatabase()->JournalingDatabase;\n\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tINSERT INTO `stewardship_pledge` (\n\t\t\t\t\t`id`,\n\t\t\t\t\t`person_id`,\n\t\t\t\t\t`stewardship_fund_id`,\n\t\t\t\t\t`date_started`,\n\t\t\t\t\t`date_ended`,\n\t\t\t\t\t`pledge_amount`,\n\t\t\t\t\t`contributed_amount`,\n\t\t\t\t\t`remaining_amount`,\n\t\t\t\t\t`fulfilled_flag`,\n\t\t\t\t\t`active_flag`,\n\t\t\t\t\t__sys_login_id,\n\t\t\t\t\t__sys_action,\n\t\t\t\t\t__sys_date\n\t\t\t\t) VALUES (\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->intId) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnActiveFlag) . ',\n\t\t\t\t\t' . (($objDatabase->JournaledById) ? $objDatabase->JournaledById : 'NULL') . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($strJournalCommand) . ',\n\t\t\t\t\tNOW()\n\t\t\t\t);\n\t\t\t');\n\t\t}",
"protected function _fcpoGetResponseQuery()\n {\n $blFetchCaptureResponse = (\n $this->oxorder__fcpoauthmode == 'preauthorization' &&\n $this->oxorder__oxpaymenttype == 'fcpoinvoice'\n );\n\n if ($blFetchCaptureResponse) {\n $sWhere = \"fcpo_request LIKE '%\".$this->oxorder__fcpotxid->value.\"%'\";\n $sAnd = \"\n fcpo_requesttype = 'capture'\n \";\n } else {\n $sWhere = \"fcpo_refnr = '{$this->oxorder__fcporefnr->value}' \";\n $sAnd = \"\n fcpo_requesttype = 'preauthorization' OR \n fcpo_requesttype = 'authorization'\n \";\n }\n\n $sQuery = \"\n SELECT oxid \n FROM fcporequestlog \n WHERE {$sWhere}\n AND (\n {$sAnd}\n )\n \";\n\n return $sQuery;\n }",
"public function mydraftsearch()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\t\t/*\n\t\t$criteria->condition = 'miscellaneous_fees_payment_cheque_student_id = :studentid';\n\t $criteria->params = array(':studentid' => $_REQUEST['id']);\n\t\t$criteria->condition = 'miscellaneous_fees_payment_cheque_draft_status = 2';*/\n\n\t\t$criteria->condition = \"miscellaneous_fees_payment_cheque_student_id = :studentid && miscellaneous_fees_payment_cheque_draft_status = :miscellaneous_fees_payment_cheque_draft_status\";\n\t\t$criteria->params = array (\n\t\t':studentid' => $_REQUEST['id'],\n\t\t':miscellaneous_fees_payment_cheque_draft_status' => 2,\n\t\t);\n\n\n\n\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_master_id',$this->miscellaneous_fees_payment_cheque_master_id);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_id',$this->miscellaneous_fees_payment_cheque_id);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_number',$this->miscellaneous_fees_payment_cheque_number);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_date',$this->miscellaneous_fees_payment_cheque_date,true);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_bank',$this->miscellaneous_fees_payment_cheque_bank);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_branch',$this->miscellaneous_fees_payment_cheque_branch,true);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_amount',$this->miscellaneous_fees_payment_cheque_amount);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_status',$this->miscellaneous_fees_payment_cheque_status);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_draft_status',$this->miscellaneous_fees_payment_cheque_draft_status);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_student_id',$this->miscellaneous_fees_payment_cheque_student_id);\n\t\t$criteria->compare('miscellaneous_fees_payment_cheque_receipt_id',$this->miscellaneous_fees_payment_cheque_receipt_id);\n\n\t\t$draft_data = new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t$_SESSION['draft_data']=$draft_data;\n\t\treturn $draft_data;\n\t}",
"public static function get_query()\n\t{\n\t\treturn self::new_instance_records()->get_query();\n\t}",
"public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t);\n\t\t}",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }",
"public function get_query()\n {\n }"
] |
[
"0.5473356",
"0.52180934",
"0.5198985",
"0.5161975",
"0.5119647",
"0.511177",
"0.5092372",
"0.5074925",
"0.50261426",
"0.50168496",
"0.50168496",
"0.5016482",
"0.5003073",
"0.5003073",
"0.5003073",
"0.50000995",
"0.499375",
"0.49934852",
"0.4980975",
"0.49729106",
"0.49567738",
"0.49538535",
"0.49538535",
"0.49538535",
"0.49538535",
"0.49538535",
"0.49538535",
"0.49538535",
"0.49538535",
"0.49538535"
] |
0.6320799
|
0
|
///////////////////////////// INSTANTIATIONRELATED METHODS ///////////////////////////// Instantiate a StewardshipPledge from a Database Row. Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow is calling this StewardshipPledge::InstantiateDbRow in order to perform early binding on referenced objects.
|
public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array()) {
// If blank row, return null
if (!$objDbRow)
return null;
// Create a new instance of the StewardshipPledge object
$objToReturn = new StewardshipPledge();
$objToReturn->__blnRestored = true;
$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
$strAliasName = array_key_exists($strAliasPrefix . 'person_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'person_id'] : $strAliasPrefix . 'person_id';
$objToReturn->intPersonId = $objDbRow->GetColumn($strAliasName, 'Integer');
$strAliasName = array_key_exists($strAliasPrefix . 'stewardship_fund_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_fund_id'] : $strAliasPrefix . 'stewardship_fund_id';
$objToReturn->intStewardshipFundId = $objDbRow->GetColumn($strAliasName, 'Integer');
$strAliasName = array_key_exists($strAliasPrefix . 'date_started', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_started'] : $strAliasPrefix . 'date_started';
$objToReturn->dttDateStarted = $objDbRow->GetColumn($strAliasName, 'Date');
$strAliasName = array_key_exists($strAliasPrefix . 'date_ended', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_ended'] : $strAliasPrefix . 'date_ended';
$objToReturn->dttDateEnded = $objDbRow->GetColumn($strAliasName, 'Date');
$strAliasName = array_key_exists($strAliasPrefix . 'pledge_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'pledge_amount'] : $strAliasPrefix . 'pledge_amount';
$objToReturn->fltPledgeAmount = $objDbRow->GetColumn($strAliasName, 'Float');
$strAliasName = array_key_exists($strAliasPrefix . 'contributed_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'contributed_amount'] : $strAliasPrefix . 'contributed_amount';
$objToReturn->fltContributedAmount = $objDbRow->GetColumn($strAliasName, 'Float');
$strAliasName = array_key_exists($strAliasPrefix . 'remaining_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'remaining_amount'] : $strAliasPrefix . 'remaining_amount';
$objToReturn->fltRemainingAmount = $objDbRow->GetColumn($strAliasName, 'Float');
$strAliasName = array_key_exists($strAliasPrefix . 'fulfilled_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'fulfilled_flag'] : $strAliasPrefix . 'fulfilled_flag';
$objToReturn->blnFulfilledFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
$strAliasName = array_key_exists($strAliasPrefix . 'active_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'active_flag'] : $strAliasPrefix . 'active_flag';
$objToReturn->blnActiveFlag = $objDbRow->GetColumn($strAliasName, 'Bit');
// Instantiate Virtual Attributes
foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
$strVirtualPrefix = $strAliasPrefix . '__';
$strVirtualPrefixLength = strlen($strVirtualPrefix);
if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)
$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
}
// Prepare to Check for Early/Virtual Binding
if (!$strAliasPrefix)
$strAliasPrefix = 'stewardship_pledge__';
// Check for Person Early Binding
$strAlias = $strAliasPrefix . 'person_id__id';
$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
if (!is_null($objDbRow->GetColumn($strAliasName)))
$objToReturn->objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
// Check for StewardshipFund Early Binding
$strAlias = $strAliasPrefix . 'stewardship_fund_id__id';
$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
if (!is_null($objDbRow->GetColumn($strAliasName)))
$objToReturn->objStewardshipFund = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardship_fund_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);
return $objToReturn;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function createFromDbRow($row) {\r\n $obj = self::_instantiateThisObject();\r\n $obj->copyFromDbRow($row);\r\n return $obj;\r\n }",
"public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions (if applicable)\n\t\t\t$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn StewardshipPledge::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t}",
"public static function createByBiz ($row) {\n DBC::requireNotEmpty($row, \"CourseLessonRef::createByBiz row cannot empty\");\n\n $entity = CourseLessonRefDao::getByCourseAndLesson($row[\"courseid\"], $row[\"lessonid\"]);\n if ($entity instanceof CourseLessonRef) {\n return $entity;\n }\n\n $default = array();\n $default[\"courseid\"] = 0;\n $default[\"lessonid\"] = 0;\n $default[\"pos\"] = 0;\n\n $row += $default;\n return new self($row);\n }",
"public function __construct($dbRow) {\n $this->_commentID = $dbRow['commentID'];\n $this->_comment = $dbRow['comment'];\n $this->_iSBNNo = $dbRow['iSBNNo'];\n $this->_customerID = $dbRow['customerID'];\n $this->_dateTime = $dbRow['dateTime'];\n }",
"public function __construct(DBRow $row) {\n\t\t$this->row = $row;\n\t}",
"public function __construct($dbRow) {\n $this->AddID = $dbRow['AddID'];\n //the variable product name is given the value from which was stored in the database\n $this->ProductName = $dbRow['ProductName'];\n //the variable product price is given the value from which was stored in the database\n $this->ProductPrice = $dbRow['ProductPrice'];\n //the variable product condition is given the value from which was stored in the database\n $this->ProductCondition = $dbRow['ProductCondition'];\n //the variable Product Expiry is given the value from which was stored in the database\n $this->ProductExpiry = $dbRow['ProductExpiry'];\n //the variable advert image is given the value from which was stored in the database\n $this->AdvertImage = $dbRow['AdvertImage'];\n //the variable name is given the value from which was stored in the database\n $this->Name = $dbRow['FirstName'];\n //the variable email address is given the value from which was stored in the database\n $this->EmailAddress = $dbRow['EmailAddress'];\n //the variable address is given the value from which was stored in the database\n $this->Address = $dbRow['Address'];\n //the variable mobile is given the value from which was stored in the database\n $this->Mobile = $dbRow['Mobile'];\n }",
"function &_fromRow(&$row) {\n\t\t$person = $this->newDataObject();\n\t\t$person->setId($row['person_id']);\n\t\t$person->setObjectId($row['object_id']);\n\t\t$person->setSequence($row['seq']);\n\t\t$person->setRole($row['role']);\n\t\t$person->setFirstName($row['first_name']);\n\t\t$person->setMiddleName($row['middle_name']);\n\t\t$person->setLastName($row['last_name']);\n\n\t\tHookRegistry::call('ObjectForReviewPersonDAO::_fromRow', array(&$person, &$row));\n\n\t\treturn $person;\n\t}",
"public function newRecord(array $row) : ReferenceRecord\n {\n return new ReferenceRecord($row);\n }",
"public static function create(array $row = array())\n {\n if (!isset($row['published'])) \n $row['published'] = time();\n \n if (!isset($row['modified'])) \n $row['modified'] = time();\n \n if (!isset($row['state']) \n || !in_array($row['state'], self::availableStates())) \n $row['state'] = self::STATUS_PUBLISHED;\n \n if (!isset($row['node_id'])) \n {\n $contentIni = eZINI::instance('content.ini.append.php');\n $row['node_id'] = $contentIni->variable('NodeSettings', 'ForumRootNode');\n }\n \n if (!isset($row['user_id'])) \n {\n $user = eZUser::currentUser();\n $row['user_id'] = $user->id();\n }\n \n if (!isset($row['language_id']))\n {\n $row['language_id'] = false;\n }\n $row['language_id'] = SimpleForumTools::getLanguageId($row['node_id'], $row['language_id']);\n \n $object = new self( $row );\n return $object;\n }",
"protected function createModelInstance(&$row) {\n\n // NOTE: Because $row might contain extra fields (like from a join,\n // We have to use the public 'setData' (which only tries to set fields\n // that exist).\n\n $class = $this->_modelClass;\n $id = $row[$this->getModelPrimaryKey()];\n $instance = new $class($id);\n $instance->setData($row);\n $instance->escaped = $this->escaped;\n\n return $instance;\n }",
"public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array()) {\n\t\t\t// If blank row, return null\n\t\t\tif (!$objDbRow)\n\t\t\t\treturn null;\n\n\n\t\t\t// Create a new instance of the StrategyQuestionConditional object\n\t\t\t$objToReturn = new StrategyQuestionConditional();\n\t\t\t$objToReturn->__blnRestored = true;\n\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';\n\t\t\t$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'question_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'question_id'] : $strAliasPrefix . 'question_id';\n\t\t\t$objToReturn->intQuestionId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'strategy_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'strategy_id'] : $strAliasPrefix . 'strategy_id';\n\t\t\t$objToReturn->intStrategyId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'conditional_type', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'conditional_type'] : $strAliasPrefix . 'conditional_type';\n\t\t\t$objToReturn->intConditionalType = $objDbRow->GetColumn($strAliasName, 'Integer');\n\n\t\t\t// Instantiate Virtual Attributes\n\t\t\tforeach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {\n\t\t\t\t$strVirtualPrefix = $strAliasPrefix . '__';\n\t\t\t\t$strVirtualPrefixLength = strlen($strVirtualPrefix);\n\t\t\t\tif (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)\n\t\t\t\t\t$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;\n\t\t\t}\n\n\t\t\t// Prepare to Check for Early/Virtual Binding\n\t\t\tif (!$strAliasPrefix)\n\t\t\t\t$strAliasPrefix = 'strategy_question_conditional__';\n\n\t\t\t// Check for Question Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'question_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objQuestion = TenPQuestions::InstantiateDbRow($objDbRow, $strAliasPrefix . 'question_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\t\t\t// Check for Strategy Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'strategy_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objStrategy = CannedStrategy::InstantiateDbRow($objDbRow, $strAliasPrefix . 'strategy_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\n\n\n\t\t\treturn $objToReturn;\n\t\t}",
"protected function buildDomainObject($row) {\n\t\t$packingList = new PackingList();\n\t\t$packingList->setId($row['pl_id']);\n\t\t$packingList->setPsId($row['ps_id']);\n\t\t\n\t\t//Parts\n\t\t$packingList->setParts($this->packingListPartDAO->findAllByPackingList($row['pl_id']));\n\n\t\treturn $packingList;\n\t}",
"public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array()) {\n\t\t\t// If blank row, return null\n\t\t\tif (!$objDbRow)\n\t\t\t\treturn null;\n\n\t\t\t// See if we're doing an array expansion on the previous item\n\t\t\t$strAlias = $strAliasPrefix . 'id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (($strExpandAsArrayNodes) && ($objPreviousItem) &&\n\t\t\t\t($objPreviousItem->intId == $objDbRow->GetColumn($strAliasName, 'Integer'))) {\n\n\t\t\t\t// We are. Now, prepare to check for ExpandAsArray clauses\n\t\t\t\t$blnExpandedViaArray = false;\n\t\t\t\tif (!$strAliasPrefix)\n\t\t\t\t\t$strAliasPrefix = 'comando_risco__';\n\n\n\t\t\t\t$strAlias = $strAliasPrefix . 'balancoacoesasordemproducaograde__id';\n\t\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\t\tif ((array_key_exists($strAlias, $strExpandAsArrayNodes)) &&\n\t\t\t\t\t(!is_null($objDbRow->GetColumn($strAliasName)))) {\n\t\t\t\t\tif ($intPreviousChildItemCount = count($objPreviousItem->_objBalancoAcoesAsOrdemProducaoGradeArray)) {\n\t\t\t\t\t\t$objPreviousChildItem = $objPreviousItem->_objBalancoAcoesAsOrdemProducaoGradeArray[$intPreviousChildItemCount - 1];\n\t\t\t\t\t\t$objChildItem = BalancoAcoes::InstantiateDbRow($objDbRow, $strAliasPrefix . 'balancoacoesasordemproducaograde__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);\n\t\t\t\t\t\tif ($objChildItem)\n\t\t\t\t\t\t\t$objPreviousItem->_objBalancoAcoesAsOrdemProducaoGradeArray[] = $objChildItem;\n\t\t\t\t\t} else\n\t\t\t\t\t\t$objPreviousItem->_objBalancoAcoesAsOrdemProducaoGradeArray[] = BalancoAcoes::InstantiateDbRow($objDbRow, $strAliasPrefix . 'balancoacoesasordemproducaograde__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t\t\t\t$blnExpandedViaArray = true;\n\t\t\t\t}\n\n\t\t\t\t$strAlias = $strAliasPrefix . 'comandoriscopeca__id';\n\t\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\t\tif ((array_key_exists($strAlias, $strExpandAsArrayNodes)) &&\n\t\t\t\t\t(!is_null($objDbRow->GetColumn($strAliasName)))) {\n\t\t\t\t\tif ($intPreviousChildItemCount = count($objPreviousItem->_objComandoRiscoPecaArray)) {\n\t\t\t\t\t\t$objPreviousChildItem = $objPreviousItem->_objComandoRiscoPecaArray[$intPreviousChildItemCount - 1];\n\t\t\t\t\t\t$objChildItem = ComandoRiscoPeca::InstantiateDbRow($objDbRow, $strAliasPrefix . 'comandoriscopeca__', $strExpandAsArrayNodes, $objPreviousChildItem, $strColumnAliasArray);\n\t\t\t\t\t\tif ($objChildItem)\n\t\t\t\t\t\t\t$objPreviousItem->_objComandoRiscoPecaArray[] = $objChildItem;\n\t\t\t\t\t} else\n\t\t\t\t\t\t$objPreviousItem->_objComandoRiscoPecaArray[] = ComandoRiscoPeca::InstantiateDbRow($objDbRow, $strAliasPrefix . 'comandoriscopeca__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t\t\t\t$blnExpandedViaArray = true;\n\t\t\t\t}\n\n\t\t\t\t// Either return false to signal array expansion, or check-to-reset the Alias prefix and move on\n\t\t\t\tif ($blnExpandedViaArray)\n\t\t\t\t\treturn false;\n\t\t\t\telse if ($strAliasPrefix == 'comando_risco__')\n\t\t\t\t\t$strAliasPrefix = null;\n\t\t\t}\n\n\t\t\t// Create a new instance of the ComandoRisco object\n\t\t\t$objToReturn = new ComandoRisco();\n\t\t\t$objToReturn->__blnRestored = true;\n\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';\n\t\t\t$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'comando_item_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'comando_item_id'] : $strAliasPrefix . 'comando_item_id';\n\t\t\t$objToReturn->intComandoItemId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'comando_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'comando_id'] : $strAliasPrefix . 'comando_id';\n\t\t\t$objToReturn->intComandoId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'referencia', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'referencia'] : $strAliasPrefix . 'referencia';\n\t\t\t$objToReturn->strReferencia = $objDbRow->GetColumn($strAliasName, 'VarChar');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'molde_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'molde_id'] : $strAliasPrefix . 'molde_id';\n\t\t\t$objToReturn->intMoldeId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'tamanho_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'tamanho_id'] : $strAliasPrefix . 'tamanho_id';\n\t\t\t$objToReturn->intTamanhoId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'quantidade_risco', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'quantidade_risco'] : $strAliasPrefix . 'quantidade_risco';\n\t\t\t$objToReturn->intQuantidadeRisco = $objDbRow->GetColumn($strAliasName, 'Integer');\n\n\t\t\t// Instantiate Virtual Attributes\n\t\t\tforeach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {\n\t\t\t\t$strVirtualPrefix = $strAliasPrefix . '__';\n\t\t\t\t$strVirtualPrefixLength = strlen($strVirtualPrefix);\n\t\t\t\tif (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)\n\t\t\t\t\t$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;\n\t\t\t}\n\n\t\t\t// Prepare to Check for Early/Virtual Binding\n\t\t\tif (!$strAliasPrefix)\n\t\t\t\t$strAliasPrefix = 'comando_risco__';\n\n\t\t\t// Check for ComandoItem Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'comando_item_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objComandoItem = ComandoItem::InstantiateDbRow($objDbRow, $strAliasPrefix . 'comando_item_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\t\t\t// Check for Comando Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'comando_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objComando = Comando::InstantiateDbRow($objDbRow, $strAliasPrefix . 'comando_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\t\t\t// Check for Molde Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'molde_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objMolde = Molde::InstantiateDbRow($objDbRow, $strAliasPrefix . 'molde_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\t\t\t// Check for Tamanho Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'tamanho_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objTamanho = Tamanho::InstantiateDbRow($objDbRow, $strAliasPrefix . 'tamanho_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\n\t\t\t// Check for BalancoPecasAsOrdemProducaoGrade Unique ReverseReference Binding\n\t\t\t$strAlias = $strAliasPrefix . 'balancopecasasordemproducaograde__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif ($objDbRow->ColumnExists($strAliasName)) {\n\t\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t\t$objToReturn->objBalancoPecasAsOrdemProducaoGrade = BalancoPecas::InstantiateDbRow($objDbRow, $strAliasPrefix . 'balancopecasasordemproducaograde__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t\t\telse\n\t\t\t\t\t// We ATTEMPTED to do an Early Bind but the Object Doesn't Exist\n\t\t\t\t\t// Let's set to FALSE so that the object knows not to try and re-query again\n\t\t\t\t\t$objToReturn->objBalancoPecasAsOrdemProducaoGrade = false;\n\t\t\t}\n\n\n\n\t\t\t// Check for BalancoAcoesAsOrdemProducaoGrade Virtual Binding\n\t\t\t$strAlias = $strAliasPrefix . 'balancoacoesasordemproducaograde__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName))) {\n\t\t\t\tif (($strExpandAsArrayNodes) && (array_key_exists($strAlias, $strExpandAsArrayNodes)))\n\t\t\t\t\t$objToReturn->_objBalancoAcoesAsOrdemProducaoGradeArray[] = BalancoAcoes::InstantiateDbRow($objDbRow, $strAliasPrefix . 'balancoacoesasordemproducaograde__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t\t\telse\n\t\t\t\t\t$objToReturn->_objBalancoAcoesAsOrdemProducaoGrade = BalancoAcoes::InstantiateDbRow($objDbRow, $strAliasPrefix . 'balancoacoesasordemproducaograde__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t\t}\n\n\t\t\t// Check for ComandoRiscoPeca Virtual Binding\n\t\t\t$strAlias = $strAliasPrefix . 'comandoriscopeca__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName))) {\n\t\t\t\tif (($strExpandAsArrayNodes) && (array_key_exists($strAlias, $strExpandAsArrayNodes)))\n\t\t\t\t\t$objToReturn->_objComandoRiscoPecaArray[] = ComandoRiscoPeca::InstantiateDbRow($objDbRow, $strAliasPrefix . 'comandoriscopeca__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t\t\telse\n\t\t\t\t\t$objToReturn->_objComandoRiscoPeca = ComandoRiscoPeca::InstantiateDbRow($objDbRow, $strAliasPrefix . 'comandoriscopeca__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t\t}\n\n\t\t\treturn $objToReturn;\n\t\t}",
"public static function newFromRow( object $row ) {\n\t\treturn new self(\n\t\t\t$row->epp_name,\n\t\t\t$row->eps_token,\n\t\t\t$row->ept_text,\n\t\t\tnew ConvertibleTimestamp( $row->eps_updated )\n\t\t);\n\t}",
"public static function createByBiz ($row) {\n DBC::requireNotEmpty($row, __METHOD__ . ' row cannot empty');\n\n $default = array();\n $default[\"type\"] = '';\n $default[\"data\"] = '';\n $default[\"progress\"] = 0;\n $default[\"doctorid\"] = 0;\n $default[\"diseaseid\"] = 0;\n $default['auditorid'] = 0;\n $default['patienttagtplid'] = 0;\n $default['status'] = self::STATUS_NEW;\n\n $row += $default;\n return new self($row);\n }",
"public static function createByBiz ($row) {\n DBC::requireNotEmpty($row, \"DrugSheet::createByBiz row cannot empty\");\n\n $default = array();\n $default[\"wxuserid\"] = 0;\n $default[\"userid\"] = 0;\n $default[\"patientid\"] = 0;\n $default[\"doctorid\"] = 0;\n $default[\"auditorid\"] = 0;\n $default[\"thedate\"] = date(\"Y-m-d\", time());\n $default[\"is_nodrug\"] = 0;\n $default[\"remark\"] = '';\n\n $row += $default;\n return new self($row);\n }",
"private function buildBudget(array $row) {\n $budget = new Budget();\n $budget->setId($row['id']);\n $budget->setT1($row['T1']);\n $budget->setT2($row['T2']);\n $budget->setT3($row['T3']);\n $budget->setT4($row['T4']);\n return $budget;\n }",
"public function create_student($row)\n\t\t{\n\t\t\t$student = new Student();\n\t\t\t$student->setId($row['id']);\n\t\t\t$student->setFirstName($row['firstName']);\n\t\t\t$student->setLastName($row['lastName']);\n\t\t\t$student->setGender($row['gender']);\n\t\t\t$student->setAge($row['age']);\n\t\t\t$student->setGroup($row['sgroup']);\n\t\t\t$student->setFaculty($row['faculty']);\n\t\t\t\n\t\t\treturn $student;\n\t\t}",
"protected function buildDomainObject(array $row) {\n $billet = new Billet();\n $billet->setBilletId($row['billet_id']);\n $billet->setBilletTitle($row['billet_title']);\n $billet->setBilletContent($row['billet_content']);\n return $billet;\n }",
"public function newObject(array $row = array())\n {\n return $this->object_factory->newObject($row);\n }",
"public static function createByBiz ($row) {\n DBC::requireNotEmpty($row, \"GameGngCnt::createByBiz row cannot empty\");\n\n $default = array();\n $default[\"gameplayid\"] = 0;\n $default[\"wxuserid\"] = 0;\n $default[\"rightcnt\"] = 0;\n $default[\"misscnt\"] = 0;\n $default[\"errorcnt\"] = 0;\n $default[\"allcnt\"] = 0;\n $default[\"rightrate\"] = '';\n $default[\"rightavg\"] = 0;\n\n $row += $default;\n return new self($row);\n }",
"public function createObject(array $row): Entity\n {\n\n $shift = new Shift( strtotime($row['date']),\n (int) $row['id_nurse'],\n (int) $row['id_shift']);\n\n return $shift;\n\n }",
"function _fromRow($row) {\n\t\t$monograph = parent::_fromRow($row);\n\n\t\t$monograph->setSeriesId($row['series_id']);\n\t\t$monograph->setSeriesPosition($row['series_position']);\n\t\t$monograph->setSeriesAbbrev(isset($row['series_abbrev'])?$row['series_abbrev']:null);\n\t\t$monograph->setWorkType($row['edited_volume']);\n\n\t\tHookRegistry::call('MonographDAO::_fromRow', array(&$monograph, &$row));\n\n\t\treturn $monograph;\n\t}",
"function _fromRow(&$row) {\n\t\t$footerLink = $this->newDataObject();\n\n\t\t$footerLink->setId($row['footerlink_id']);\n\t\t$footerLink->setPressId($row['press_id']);\n\t\t$footerLink->setUrl($row['url']);\n\t\t$footerLink->setCategoryId($row['footer_category_id']);\n\n\t\t$this->getDataObjectSettings('footerlink_settings', 'footerlink_id', $row['footerlink_id'], $footerLink);\n\n\t\tHookRegistry::call('FooterLinkDAO::_fromRow', array(&$footerLink, &$row));\n\n\t\treturn $footerLink;\n\t}",
"public static function createByBiz ($row) {\n DBC::requireNotEmpty($row, \"PictureDataSheetTpl::createByBiz row cannot empty\");\n\n $default = array();\n $default[\"diseaseid\"] = 0;\n $default[\"ename\"] = '';\n $default[\"title\"] = '';\n $default[\"questiontitles\"] = '';\n\n $row += $default;\n return new self($row);\n }",
"public static function createByBiz ($row) {\n DBC::requireNotEmpty($row, \"LessonUserRef::createByBiz row cannot empty\");\n\n if ($row[\"wxuserid\"] == null) {\n $row[\"wxuserid\"] = 0;\n }\n\n if ($row[\"userid\"] == null) {\n $row[\"userid\"] = 0;\n }\n\n if ($row[\"patientid\"] == null) {\n $row[\"patientid\"] = 0;\n }\n\n if ($row[\"doctorid\"] == null) {\n $row[\"doctorid\"] = 0;\n }\n\n $default = array();\n $default[\"wxuserid\"] = 0;\n $default[\"userid\"] = 0;\n $default[\"patientid\"] = 0;\n $default[\"doctorid\"] = 0;\n $default[\"courseid\"] = 0;\n $default[\"lessonid\"] = 0;\n $default[\"readtime\"] = '0000-00-00 00:00:00';\n $default[\"viewcnt\"] = 0;\n\n $row += $default;\n return new self($row);\n }",
"protected static function buildFromRow($row) {\n $class = get_called_class();\n $record = new $class();\n $record->id = array_cut($row, 'id');\n\n foreach ($row as $key => $val) {\n $record->$key = $val;\n }\n\n return $record;\n }",
"function &_returnSubscriptionFromRow(&$row) {\n\t\t$subscription = $this->createObject();\n\t\t$subscription->setId($row['subscription_id']);\n\t\t$subscription->setJournalId($row['journal_id']);\n\t\t$subscription->setUserId($row['user_id']);\n\t\t$subscription->setTypeId($row['type_id']);\n\t\t$subscription->setDateStart($this->dateFromDB($row['date_start']));\n\t\t$subscription->setDateEnd($this->dateFromDB($row['date_end']));\n\t\t$subscription->setDateRemindedBefore($this->datetimeFromDB($row['date_reminded_before']));\n\t\t$subscription->setDateRemindedAfter($this->datetimeFromDB($row['date_reminded_after']));\n\t\t$subscription->setStatus($row['status']);\n\t\t$subscription->setMembership($row['membership']);\n\t\t$subscription->setReferenceNumber($row['reference_number']);\n\t\t$subscription->setNotes($row['notes']);\n\n\t\tHookRegistry::call('SubscriptionDAO::_returnSubscriptionFromRow', array(&$subscription, &$row));\n\n\t\treturn $subscription;\n\t}",
"public function makePlace($row)\n { \n factory(Place::class, $row)->create();\n }",
"public static function createByBiz($row)\n {\n DBC::requireNotEmpty($row,\"DoctorWithdrawOrder::createByBiz row cannot empty\");\n\n $default = array();\n $default[\"userid\"] = 0;\n $default[\"doctorid\"] = 0;\n $default[\"amount\"] = 0;\n $default[\"status\"] = 0;\n $default[\"donetime\"] = '0000-00-00 00:00:00';\n $default[\"auditorid\"] = 0;\n $default[\"remark\"] = '';\n\n $row += $default;\n return new self($row);\n }"
] |
[
"0.58936715",
"0.5424951",
"0.52605414",
"0.5213605",
"0.5137157",
"0.5062834",
"0.50136495",
"0.49766704",
"0.4932962",
"0.49067116",
"0.48913214",
"0.48452914",
"0.48410317",
"0.48284176",
"0.47569084",
"0.47067425",
"0.4703189",
"0.46663445",
"0.46535507",
"0.46390006",
"0.463834",
"0.46355462",
"0.46293336",
"0.4615835",
"0.46101493",
"0.4601863",
"0.45998332",
"0.45842037",
"0.45613363",
"0.4557605"
] |
0.71215695
|
0
|
Instantiate a single StewardshipPledge object from a query cursor (e.g. a DB ResultSet). Cursor is automatically moved to the "next row" of the result set. Will return NULL if no cursor or if the cursor has no more rows in the resultset.
|
public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {
// If blank resultset, then return empty result
if (!$objDbResult) return null;
// If empty resultset, then return empty result
$objDbRow = $objDbResult->GetNextRow();
if (!$objDbRow) return null;
// We need the Column Aliases
$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;
if (!$strColumnAliasArray) $strColumnAliasArray = array();
// Pull Expansions (if applicable)
$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;
// Load up the return result with a row and return it
return StewardshipPledge::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getNewCursor()\n {\n return oci_new_cursor($this->_dbh);\n }",
"public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array()) {\n\t\t\t// If blank row, return null\n\t\t\tif (!$objDbRow)\n\t\t\t\treturn null;\n\n\n\t\t\t// Create a new instance of the StewardshipPledge object\n\t\t\t$objToReturn = new StewardshipPledge();\n\t\t\t$objToReturn->__blnRestored = true;\n\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';\n\t\t\t$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'person_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'person_id'] : $strAliasPrefix . 'person_id';\n\t\t\t$objToReturn->intPersonId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'stewardship_fund_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_fund_id'] : $strAliasPrefix . 'stewardship_fund_id';\n\t\t\t$objToReturn->intStewardshipFundId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'date_started', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_started'] : $strAliasPrefix . 'date_started';\n\t\t\t$objToReturn->dttDateStarted = $objDbRow->GetColumn($strAliasName, 'Date');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'date_ended', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_ended'] : $strAliasPrefix . 'date_ended';\n\t\t\t$objToReturn->dttDateEnded = $objDbRow->GetColumn($strAliasName, 'Date');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'pledge_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'pledge_amount'] : $strAliasPrefix . 'pledge_amount';\n\t\t\t$objToReturn->fltPledgeAmount = $objDbRow->GetColumn($strAliasName, 'Float');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'contributed_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'contributed_amount'] : $strAliasPrefix . 'contributed_amount';\n\t\t\t$objToReturn->fltContributedAmount = $objDbRow->GetColumn($strAliasName, 'Float');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'remaining_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'remaining_amount'] : $strAliasPrefix . 'remaining_amount';\n\t\t\t$objToReturn->fltRemainingAmount = $objDbRow->GetColumn($strAliasName, 'Float');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'fulfilled_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'fulfilled_flag'] : $strAliasPrefix . 'fulfilled_flag';\n\t\t\t$objToReturn->blnFulfilledFlag = $objDbRow->GetColumn($strAliasName, 'Bit');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'active_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'active_flag'] : $strAliasPrefix . 'active_flag';\n\t\t\t$objToReturn->blnActiveFlag = $objDbRow->GetColumn($strAliasName, 'Bit');\n\n\t\t\t// Instantiate Virtual Attributes\n\t\t\tforeach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {\n\t\t\t\t$strVirtualPrefix = $strAliasPrefix . '__';\n\t\t\t\t$strVirtualPrefixLength = strlen($strVirtualPrefix);\n\t\t\t\tif (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)\n\t\t\t\t\t$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;\n\t\t\t}\n\n\t\t\t// Prepare to Check for Early/Virtual Binding\n\t\t\tif (!$strAliasPrefix)\n\t\t\t\t$strAliasPrefix = 'stewardship_pledge__';\n\n\t\t\t// Check for Person Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'person_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\t\t\t// Check for StewardshipFund Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'stewardship_fund_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objStewardshipFund = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardship_fund_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\n\n\n\t\t\treturn $objToReturn;\n\t\t}",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StewardshipPledge object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StewardshipPledge::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->PersonId = $objReloaded->PersonId;\n\t\t\t$this->StewardshipFundId = $objReloaded->StewardshipFundId;\n\t\t\t$this->dttDateStarted = $objReloaded->dttDateStarted;\n\t\t\t$this->dttDateEnded = $objReloaded->dttDateEnded;\n\t\t\t$this->fltPledgeAmount = $objReloaded->fltPledgeAmount;\n\t\t\t$this->fltContributedAmount = $objReloaded->fltContributedAmount;\n\t\t\t$this->fltRemainingAmount = $objReloaded->fltRemainingAmount;\n\t\t\t$this->blnFulfilledFlag = $objReloaded->blnFulfilledFlag;\n\t\t\t$this->blnActiveFlag = $objReloaded->blnActiveFlag;\n\t\t}",
"public function getNewCursor(): mixed\n {\n return oci_new_cursor($this->dbh);\n }",
"protected function fetchObject($cursor = null, $class = 'stdClass')\n {\n if (!empty($cursor) && $cursor instanceof Statement) {\n $object = $cursor->fetch(\\PDO::FETCH_OBJ);\n } else {\n if ($this->prepared instanceof Statement) {\n $object = $this->prepared->fetch(\\PDO::FETCH_OBJ);\n }\n }\n\n if (!isset($object)) {\n return false;\n }\n\n $newObject = $object;\n if ($class !== 'stdClass') {\n $newObject = new $class;\n foreach (get_object_vars($object) as $key => $value) {\n $newObject->{$key} = $value;\n }\n }\n\n return $newObject;\n }",
"public static function QuerySingle(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {\n\t\t\t// Get the Query Statement\n\t\t\ttry {\n\t\t\t\t$strQuery = StewardshipPledge::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\n\t\t\t// Perform the Query\n\t\t\t$objDbResult = $objQueryBuilder->Database->Query($strQuery);\n\n\t\t\t// Instantiate a new StewardshipPledge object and return it\n\n\t\t\t// Do we have to expand anything?\n\t\t\tif ($objQueryBuilder->ExpandAsArrayNodes) {\n\t\t\t\t$objToReturn = array();\n\t\t\t\twhile ($objDbRow = $objDbResult->GetNextRow()) {\n\t\t\t\t\t$objItem = StewardshipPledge::InstantiateDbRow($objDbRow, null, $objQueryBuilder->ExpandAsArrayNodes, $objToReturn, $objQueryBuilder->ColumnAliasArray);\n\t\t\t\t\tif ($objItem) $objToReturn[] = $objItem;\n\t\t\t\t}\n\n\t\t\t\tif (count($objToReturn)) {\n\t\t\t\t\t// Since we only want the object to return, lets return the object and not the array.\n\t\t\t\t\treturn $objToReturn[0];\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No expands just return the first row\n\t\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\t\tif (is_null($objDbRow)) return null;\n\t\t\t\treturn StewardshipPledge::InstantiateDbRow($objDbRow, null, null, null, $objQueryBuilder->ColumnAliasArray);\n\t\t\t}\n\t\t}",
"public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions (if applicable)\n\t\t\t$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn CommunicationList::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t}",
"protected function _fetch_object()\n\t{\n\t\t$id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n\t\treturn oci_fetch_object($id);\n\t}",
"public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions (if applicable)\n\t\t\t$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn StrategyQuestionConditional::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t}",
"public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions (if applicable)\n\t\t\t$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn ComandoRisco::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t}",
"public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions (if applicable)\n\t\t\t$strExpandAsArrayNodes = $objDbResult->QueryBuilder->ExpandAsArrayNodes;\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn Characteristic::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\t\t}",
"protected function _fetchObject()\n {\n $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id;\n return @oci_fetch_object($id);\n }",
"public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t);\n\t\t}",
"public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions\n\t\t\t$objExpandAsArrayNode = $objDbResult->QueryBuilder->ExpandAsArrayNode;\n\t\t\tif (!empty ($objExpandAsArrayNode)) {\n\t\t\t\tthrow new QCallerException (\"Cannot use InstantiateCursor with ExpandAsArray\");\n\t\t\t}\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn PersonWithLock::InstantiateDbRow($objDbRow, null, null, null, $strColumnAliasArray);\n\t\t}",
"public function fetchRow()\n {\n if (!$this->_rs) {\n return false;\n }\n\n return new $this->_rowClass($this->_rs->FetchRow());\n }",
"public function FetchObject()\n\t{\n\t\tif (!$this->Result){\t//check if we have a valid result set\n\t\t\treturn false;\n\t\t}\n\n\t\t$row = mysqli_fetch_object($this->Result);\n\n\t\tif (!$row){\t//if last row, free the result set\n\t\t\tmysqli_free_result($this->Result);\n\t\t}\n\n\t\treturn $row;\n\t}",
"public static function InstantiateCursor(QDatabaseResultBase $objDbResult) {\n\t\t\t// If blank resultset, then return empty result\n\t\t\tif (!$objDbResult) return null;\n\n\t\t\t// If empty resultset, then return empty result\n\t\t\t$objDbRow = $objDbResult->GetNextRow();\n\t\t\tif (!$objDbRow) return null;\n\n\t\t\t// We need the Column Aliases\n\t\t\t$strColumnAliasArray = $objDbResult->QueryBuilder->ColumnAliasArray;\n\t\t\tif (!$strColumnAliasArray) $strColumnAliasArray = array();\n\n\t\t\t// Pull Expansions\n\t\t\t$objExpandAsArrayNode = $objDbResult->QueryBuilder->ExpandAsArrayNode;\n\t\t\tif (!empty ($objExpandAsArrayNode)) {\n\t\t\t\tthrow new QCallerException (\"Cannot use InstantiateCursor with ExpandAsArray\");\n\t\t\t}\n\n\t\t\t// Load up the return result with a row and return it\n\t\t\treturn Person::InstantiateDbRow($objDbRow, null, null, null, $strColumnAliasArray);\n\t\t}",
"public function fetch_object()\n\t{\n\t\t$object = null;\n\t\tif (current($this->result)) {\n\t\t\tforeach (current($this->result) AS $key => $value) {\n\t\t\t\t$object->$key = $value;\n\t\t\t}\n\t\t}else {\n\t\t\t$object = FALSE;\n\t\t}\n\t\tnext($this->result);\n\t\treturn $object;\n\t}",
"protected function fetchObject(string $className = 'stdClass')\n {\n $row = oci_fetch_object($this->resultID);\n\n if ($className === 'stdClass' || ! $row) {\n return $row;\n }\n if (is_subclass_of($className, Entity::class)) {\n return (new $className())->injectRawData((array) $row);\n }\n\n $instance = new $className();\n\n foreach (get_object_vars($row) as $key => $value) {\n $instance->{$key} = $value;\n }\n\n return $instance;\n }",
"public function cursor()\n {\n $this->_cursor OR $this->load();\n return $this->_cursor;\n }",
"public function fetch($fetch_style = NULL, $cursor_orientation = false, $cursor_offset = false)\n {\n }",
"public function single()\n {\n $this->executeQuery($this->statement);\n return $this->fetch($this->statement);\n }",
"protected function fetchObject($cursor = null, $class = 'stdClass')\n\t{\n\t\treturn false;\n\t}",
"private function fetch(PDOStatement $statement, $style)\n {\n $object = $statement->fetch($style);\n if ($object === false) {\n throw new Q4MException(\"Failed to fetch.\");\n }\n\n return $object;\n }",
"private function _prepareSingleRecord($queryObject){\n\n $this->debugBacktrace();\n\n $fetchType = $this->fetchType;\n \n /*\n NOTE- \n Don't reset the fetchType. Because default fetch type intentionaly has been set by user.\n So, keep it until ther user changes it. \n */\n\n //$this->fetchType = \"\"; \n\n switch ($this->fetchType){\n case \"fetch_object\":\n $record = mysqli_fetch_object($queryObject);\n break;\n case \"fetch_assoc\":\n $record = mysqli_fetch_assoc($queryObject);\n break;\n case \"fetch_array\":\n $record = mysqli_fetch_array($queryObject);\n break;\n case \"fetch_row\":\n $record = mysqli_fetch_row($queryObject);\n break;\n case \"fetch_field\":\n $record = mysqli_fetch_field($queryObject);\n break;\n }\n\n return $record;\n }",
"public function closeCursor($cursor)\n {\n return oci_free_statement($cursor);\n }",
"public function readScholarship($Scholarship){\n\n\n\t\t$Result = new Result();\t\n\t\t$Result = $this->_ScholarshipDAO->readScholarship($Scholarship);\n\t\t\n\t\tif(!$Result->getIsSuccess())\n\t\t\t$Result->setResultObject(\"Database failure in ScholarshipDAO.readScholarship()\");\t\t\n\n\t\treturn $Result;\n\n\n\t}",
"function fetch_obj($class = null)\n {\n if($class === null) { try { return $this->result->fetch(PDO::FETCH_OBJ); } catch(PDOException $e) { throw new DBException($e->getMessage()); } }\n $d = $this->fetch_assoc();\n if(!$d) return false;\n $o = new $class;\n foreach($d as $k=>$v) $o->$k = $v;\n if( method_exists($o, '__construct') ) $o->__construct();\n return $o;\n }",
"public static function cursor();",
"public function fetch_object($class_name = 'stdClass')\r\n {\r\n return $this->resultID->fetch_object($class_name);\r\n }"
] |
[
"0.5489569",
"0.53832173",
"0.5353896",
"0.5233024",
"0.5207244",
"0.51542413",
"0.50167143",
"0.49295804",
"0.49082804",
"0.49003324",
"0.48669142",
"0.48409638",
"0.483693",
"0.47665462",
"0.4708138",
"0.46226025",
"0.46124318",
"0.460808",
"0.46073705",
"0.4603312",
"0.46013337",
"0.4591882",
"0.4584276",
"0.45310417",
"0.45248592",
"0.4505955",
"0.44952717",
"0.44716397",
"0.44509095",
"0.44175017"
] |
0.6233996
|
0
|
Load a single StewardshipPledge object, by PersonId, StewardshipFundId Index(es)
|
public static function LoadByPersonIdStewardshipFundId($intPersonId, $intStewardshipFundId, $objOptionalClauses = null) {
return StewardshipPledge::QuerySingle(
QQ::AndCondition(
QQ::Equal(QQN::StewardshipPledge()->PersonId, $intPersonId),
QQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId)
)
, $objOptionalClauses
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t);\n\t\t}",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StewardshipPledge object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StewardshipPledge::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->PersonId = $objReloaded->PersonId;\n\t\t\t$this->StewardshipFundId = $objReloaded->StewardshipFundId;\n\t\t\t$this->dttDateStarted = $objReloaded->dttDateStarted;\n\t\t\t$this->dttDateEnded = $objReloaded->dttDateEnded;\n\t\t\t$this->fltPledgeAmount = $objReloaded->fltPledgeAmount;\n\t\t\t$this->fltContributedAmount = $objReloaded->fltContributedAmount;\n\t\t\t$this->fltRemainingAmount = $objReloaded->fltRemainingAmount;\n\t\t\t$this->blnFulfilledFlag = $objReloaded->blnFulfilledFlag;\n\t\t\t$this->blnActiveFlag = $objReloaded->blnActiveFlag;\n\t\t}",
"public static function LoadById($intId, $objOptionalClauses = null) {\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}",
"public static function LoadArrayByStewardshipFundId($intStewardshipFundId, $objOptionalClauses = null) {\n\t\t\t// Call StewardshipPledge::QueryArray to perform the LoadArrayByStewardshipFundId query\n\t\t\ttry {\n\t\t\t\treturn StewardshipPledge::QueryArray(\n\t\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId),\n\t\t\t\t\t$objOptionalClauses\n\t\t\t\t\t);\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"public static function LoadArrayByPersonId($intPersonId, $objOptionalClauses = null) {\n\t\t\t// Call StewardshipPledge::QueryArray to perform the LoadArrayByPersonId query\n\t\t\ttry {\n\t\t\t\treturn StewardshipPledge::QueryArray(\n\t\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->PersonId, $intPersonId),\n\t\t\t\t\t$objOptionalClauses\n\t\t\t\t\t);\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"private function load_interests(){\r\n $db = new Database();\r\n $sql = \"select * from \" . Person::PERSON_INTEREST_TABLE . \" where person_id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->execute();\r\n $its = $stm->fetchAll();\r\n foreach($its as $it){\r\n $this->interests[] = Interest::with_id($it[\"interest_id\"]);\r\n }\r\n }",
"function loadByScholarshipID( $scholarshipID )\n {\n $condition = 'scholarship_id='.$scholarshipID;\n return $this->loadByCondition( $condition );\n }",
"public function loadFeeByBankCardTypeID($cardTypeID, $bankID)\n {\n //$this->loadFeeByID(fee.ID);\n \n }",
"public function findById($experience_id);",
"public function loadFeeByID($feeID)\n {\n }",
"public function loadPersonForEdit($projectId,$personId)\n {\n $qb = $this->createQueryBuilder();\n \n $qb->addSelect('person');\n $qb->addSelect('personReg');\n $qb->addSelect('personRegOrg');\n $qb->addSelect('projectPerson');\n \n $qb->from('ZaysoCoreBundle:Person','person');\n \n $qb->leftJoin('person.registeredPersons','personReg');\n $qb->leftJoin('personReg.org','personRegOrg');\n \n $qb->leftJoin('person.projectPersons','projectPerson', \n Expr\\Join::WITH, $qb->expr()->eq('projectPerson.project', $projectId));\n \n $qb->andWhere($qb->expr()->eq('person.id',$qb->expr()->literal($personId)));\n \n return $qb->getQuery()->getOneOrNullResult(); \n \n }",
"public function Save($blnForceInsert = false, $blnForceUpdate = false) {\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = StewardshipPledge::GetDatabase();\n\n\t\t\t$mixToReturn = null;\n\n\t\t\ttry {\n\t\t\t\tif ((!$this->__blnRestored) || ($blnForceInsert)) {\n\t\t\t\t\t// Perform an INSERT query\n\t\t\t\t\t$objDatabase->NonQuery('\n\t\t\t\t\t\tINSERT INTO `stewardship_pledge` (\n\t\t\t\t\t\t\t`person_id`,\n\t\t\t\t\t\t\t`stewardship_fund_id`,\n\t\t\t\t\t\t\t`date_started`,\n\t\t\t\t\t\t\t`date_ended`,\n\t\t\t\t\t\t\t`pledge_amount`,\n\t\t\t\t\t\t\t`contributed_amount`,\n\t\t\t\t\t\t\t`remaining_amount`,\n\t\t\t\t\t\t\t`fulfilled_flag`,\n\t\t\t\t\t\t\t`active_flag`\n\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnActiveFlag) . '\n\t\t\t\t\t\t)\n\t\t\t\t\t');\n\n\t\t\t\t\t// Update Identity column and return its value\n\t\t\t\t\t$mixToReturn = $this->intId = $objDatabase->InsertId('stewardship_pledge', 'id');\n\n\t\t\t\t\t// Journaling\n\t\t\t\t\tif ($objDatabase->JournalingDatabase) $this->Journal('INSERT');\n\n\t\t\t\t} else {\n\t\t\t\t\t// Perform an UPDATE query\n\n\t\t\t\t\t// First checking for Optimistic Locking constraints (if applicable)\n\n\t\t\t\t\t// Perform the UPDATE query\n\t\t\t\t\t$objDatabase->NonQuery('\n\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\t`stewardship_pledge`\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t`person_id` = ' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t\t\t`stewardship_fund_id` = ' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t\t\t`date_started` = ' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t\t\t`date_ended` = ' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t\t\t`pledge_amount` = ' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t\t\t`contributed_amount` = ' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t\t\t`remaining_amount` = ' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t\t\t`fulfilled_flag` = ' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t\t\t`active_flag` = ' . $objDatabase->SqlVariable($this->blnActiveFlag) . '\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t`id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t\t\t');\n\n\t\t\t\t\t// Journaling\n\t\t\t\t\tif ($objDatabase->JournalingDatabase) $this->Journal('UPDATE');\n\t\t\t\t}\n\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\n\t\t\t// Update __blnRestored and any Non-Identity PK Columns (if applicable)\n\t\t\t$this->__blnRestored = true;\n\n\n\t\t\t// Return \n\t\t\treturn $mixToReturn;\n\t\t}",
"public function load($campaignId);",
"function loadByPersonID( $personID )\n {\n $condition = 'person_id='.$personID;\n return $this->loadByCondition( $condition );\n }",
"function getPartyName($party_id) {\r\nreturn $this->db->query(\"select party from cost_sharing where id=\" . $party_id)->row()->party;\r\n}",
"public static function approveMembership($personId, $groupId) {\n return DB::table('group_member')\n ->where('person_id', $personId)\n ->where('group_id', $groupId)\n ->update(array(\n 'approved' => 1\n ));\n \n }",
"public function pledges()\n {\n return $this->hasManyThrough('App\\Pledge', 'pledges_tbl');\n }",
"public function supplemental_draft($round)\r\n\t{\t\r\n\t\t$this->Database_Manager->database_backup(array('Draft_Picks'));\r\n\t\t$this->Database_Manager->database_backup(array('Drafts'));\r\n\t\t$this->Database_Manager->database_backup(array('Players'));\r\n\t\t$this->Database_Manager->database_backup(array('Rosters','Supplemental_Selections'));\r\n\r\n\t\t\r\n\t\t$draft_order = $this->Drafts->get_draft_results_year($this->league_id,$this->current_year);\r\n\t\t//get the id and start time for this draft\r\n\t\tforeach($draft_order['Supplemental'] as $draft_id => $draft_data){\r\n\t\t\t$start_time = $draft_data['start_time'];\r\n\t\t}\r\n\t\t//work the array down until we have just the first or second half of the draft order, depending on which round it is\r\n\t\t$draft_order = array_pop($draft_order['Supplemental']);\r\n\t\t$draft_order=$draft_order['picks'];\r\n\t\t$half = floor(count($draft_order)/2);\r\n\t\t$draft_order = array_chunk($draft_order,$half);\r\n\t\t$draft_order=$draft_order[$round-1];\r\n\t\t//go through each pick\r\n\t\tforeach($draft_order as $pick_minus_1 => $pick_data) {\r\n\t\t\t$team_selection = $this->db->where('team_id',$pick_data['team_id'])\r\n\t\t\t\t\t\t\t->order_by('priority','ASC')\r\n\t\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t\t->get('Supplemental_Selections');\r\n\t\t\tif($team_selection->num_rows()>0){\r\n\t\t\t\t//there's a player selected, proceed with the selection\r\n\t\t\t\tforeach($team_selection->result_array() as $selection){\r\n\t\t\t\t\techo ($pick_minus_1+1).'. '.team_name_link($pick_data['team_id']).' '.player_name_link($selection['fffl_player_id']).'<br>';\r\n\t\t\t\t\t//check to make sure it's time for this draft before making selections\r\n\t\t\t\t\tif($start_time< now()){\r\n\t\t\t\t\t\t//update the draft_picks table where pick_id matches\r\n\t\t\t\t\t\t$this->db->set('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->where('pick_id',$pick_data['pick_id'])\r\n\t\t\t\t\t\t\t\t->update('Draft_Picks');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//get the free agent salary for this player to set as the salary for the new team\r\n\t\t\t\t\t\t$salary = $this->Salaries->get_free_agent_salary($selection['fffl_player_id']);\r\n\t\t\t\t\t\t//get player position\r\n\t\t\t\t\t\t$player_info = $this->Players->get_player_info(array($selection['fffl_player_id']),\"fffl_player_id\",\"position\");\r\n\t\t\t\t\t\t$position = $player_info['position'];\r\n\t\t\t\t\t\t//add to roster using salary\r\n\t\t\t\t\t\t$this->db->set('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->set('team_id',$pick_data['team_id'])\r\n\t\t\t\t\t\t\t\t->set('salary',$salary)\r\n\t\t\t\t\t\t\t\t->set('position', $position)\r\n\t\t\t\t\t\t\t\t->set('lineup_area','Roster')\r\n\t\t\t\t\t\t\t\t->insert('Rosters');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//delete any request in the supplemental selections for this player\r\n\t\t\t\t\t\t$this->db->where('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->delete('Supplemental_Selections');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}//end if team has selections > 0\r\n\t\t\t//there isn't a palyer ot pick, pass the team.\r\n\t\t\telse{\r\n\t\t\t\t//************************THIS IS OLD CODE FROM THE OLD SITE THAT MANAGED COMPENSATORY PICKS. ONLY NECESSARY TO REDO THIS CODE IF WE REINSTITUTE COMPENSATORY PICKS*************************//\r\n\t\t\t\t\t\t\t\t//There's no player to pick, so the team passes and (THIS USED TO GIVE A COMPENSATORY PICK) //needs a compensatory pick assigned\r\n\t\t\t\t\t\t\t\t$teamId=$pick_data['team_id'];\r\n\t\t\t\t\t\t\t\t//update the draft_picks table where pick_id matches\r\n\t\t\t\t\t\t\t\t$this->db->set('fffl_player_id',0)\r\n\t\t\t\t\t\t\t\t\t\t->where('pick_id',$pick_data['pick_id'])\r\n\t\t\t\t\t\t\t\t\t\t->update('Draft_Picks');\r\n\t\t\t\t\t\t\t\t//Below is what used to award a compensatory pick to a passing team\r\n\t\t\t\t\t\t\t\t/*if($s==0) { //This is the first of a new pair of passing teams. The first in the pair gets lined up with his drafting day.\r\n\t\t\t\t\t\t\t\t\tif($draftorder[$i]['pos']<11) {\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$s=2; //s=2 means the next guy gets a Saturday pick\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental+10;\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental-10;\r\n\t\t\t\t\t\t\t\t\t\t$s=1; //s=1 means the next guy gets a Friday pick\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"INSERT into SupplementalDrafts values($CurSeasonId,\".$draftorder[$i]['pick'].\",\".$draftorder[$i]['team'].\",0)\");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t} else { //This is the second passer in a pair, he gets put on the other day from the team above when s=0.\r\n\t\t\t\t\t\t\t\t\tif($s==1) { //This team gets a fRiday pick\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\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\t\r\n\t\t\t\t\t\t\t\t\t} else if($s==2) { //This team gets a Saturday pick\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental+10;\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental-10;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"INSERT into SupplementalDrafts values($CurSeasonId,\".$draftorder[$i]['pick'].\",\".$draftorder[$i]['team'].\",0)\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$s=0; //the next passer will get put with his draft day in the above IF statement\r\n\t\t\t\t\t\t\t\t\t$supplemental++; \r\n\t\t\t\t\t\t\t\t}*/\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t/*}*/\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t}//end of the draft\r\n\t\t//delete all supplemental selections for the next supplemental draft\r\n\t\tif($start_time< now()){\r\n\t\t\t$this->db->where(1)->delete('Supplemental_Selections');\r\n\t\t}\r\n\t\t\r\n\t}",
"function getByID($investmentID) {\n $this->db->join($this->investmentTypeTable, \"{$this->investmentTable}.investmentTypeID = {$this->investmentTypeTable}.investmentTypeID\", 'left');\n// $this->db->join('fund_manager', 'fund.fundManagerID = fund_manager.fundManagerID', 'left');\n return $this->db->where('investmentInstructionID', $investmentID)\n ->get($this->investmentTable, 1)\n ->row();\n }",
"public function partyById($party_id)\n {\n $party = Party::findorfail($party_id);\n\n return $this->apiHelper::returnResource('Party', $party);\n }",
"public function index($person_id){\n \t$person = Person::with('spouses',\n 'emergency_contacts',\n 'dependents',\n 'colleges',\n 'work_experiences')\n ->find($person_id);\n \t\n return view('resource_detail.index',compact('person'));\n }",
"public function actionView($id) {\n \n \n \n $proposal = Proposal::findOne(['id_group' => $id]);\n \n if ($proposal->load(Yii::$app->request->post()) && $proposal->save()) {\n return $this->redirect(['view', 'id' => $id]);\n }\n\n $students_assgnment = MemberAssignment::find()->where(['id_group' => $id]);\n $DataProviderStudents = new \\yii\\data\\ActiveDataProvider(\n [\n 'query' => $students_assgnment,\n 'pagination' => ['pageSize' => 10]\n ]\n );\n \n $leader = Yii::$app->db->createCommand('SELECT id_students FROM tpkm_leader_assignment where id_group= '.$id)->queryScalar(); \n $member = Yii::$app->db->createCommand('SELECT id_students FROM tpkm_member_assignment where id_group= '.$id)->queryColumn(); \n $supervisior = Yii::$app->db->createCommand('SELECT id_supervisior FROM tpkm_supervisior_assignment where id_group= '.$id)->queryScalar();\n \n $akses = 0;\n if(Yii::$app->user->isGuest){\n $akses = 0;\n }\n \n //Hak Akses\n $Hakakses = [];\n \n $j=0;\n foreach ($member as $i){\n $Hakakses[$j] = $i;\n $j++;\n }\n \n $Hakakses[2] = $leader;\n $Hakakses[3] = $supervisior;\n \n $id_user;\n \n if(!Yii::$app->user->isGuest){\n if (\\common\\models\\students\\Students::find()->where(['user_id' => Yii::$app->user->id])->one() != null) {\n $id_user = \\common\\models\\students\\Students::find()->where(['user_id' => Yii::$app->user->id])->one()->dim_id;\n if($id_user == $Hakakses[0] || $id_user==$Hakakses[1] || $id_user==$Hakakses[2]){\n $akses = 1;\n }\n } \n else{\n $id_user = \\common\\models\\pegawai\\Pegawai::find()->where(['user_id' =>Yii::$app->user->id])->one()->pegawai_id;\n if($id_user==$Hakakses[3]){ \n $akses = 2;\n } \n }\n }\n \n $supervisior_assgnment = SupervisiorAssignment::findOne(['id_group' => $id]); \n $leader_assgnment = LeaderAssignment::findOne(['id_group' => $id]); \n\n $proposalRevision = ProposalRevision::find()->where(['id_proposal' => $proposal->id]);\n\n $DataProviderProposalRevision = new \\yii\\data\\ActiveDataProvider(\n [\n 'query' => $proposalRevision,\n ]);\n\n\n return $this->render('view/view', [\n 'model' => $this->findModel($id),\n 'modelStudents' => $DataProviderStudents,\n 'modelSupervisior' => $supervisior_assgnment,\n 'modelLeader' => $leader_assgnment,\n 'proposal' => $proposal,\n 'proposalRevision' => $DataProviderProposalRevision,\n 'akses'=>$akses\n ]);\n }",
"public function findAllParticipantsAsSalespersonsByProviderAndPf($idProvider, $idPurchasingFair) {\r\r\n\r\r\n $result = array();\r\r\n $query = '\r\r\n SELECT DISTINCT(p.id_participant), p.civility_participant, p.surname_participant, p.name_participant, p.email_participant, p.date_deletion_participant\r\r\n FROM participant p \r\r\n INNER JOIN assignment_participant_enterprise ape ON ape.PARTICIPANT_id_participant = p.id_participant \r\r\n INNER JOIN enterprise e ON e.id_enterprise = ape.ENTERPRISE_id_enterprise \r\r\n INNER JOIN profile pr ON pr.id_profile = e.PROFILE_id_profile\r\r\n INNER JOIN assignment_sp_store ass ON ass.PARTICIPANT_id_participant = p.id_participant\r\r\n INNER JOIN purchasing_fair pf ON pf.id_purchasing_fair = ass.PURCHASING_FAIR_id_purchasing_fair\r\r\n WHERE pr.id_profile = 1 AND e.id_enterprise = ? AND p.date_deletion_participant IS NULL AND pf.id_purchasing_fair = ?\r\r\n ';\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute(array($idProvider, $idPurchasingFair));\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $civility, $surname, $name, $email, $dateDeletion ) = $row; // Like that $idParticipant = $row['id_participant'] etc.\r\r\n $newParticipant = new Participant($civility, $surname, $name, $email, $dateDeletion, $idParticipant);\r\r\n $result[] = $newParticipant; // Adds new Participant to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }",
"public function findById($profileId);",
"public function Journal($strJournalCommand) {\n\t\t\t$objDatabase = StewardshipPledge::GetDatabase()->JournalingDatabase;\n\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tINSERT INTO `stewardship_pledge` (\n\t\t\t\t\t`id`,\n\t\t\t\t\t`person_id`,\n\t\t\t\t\t`stewardship_fund_id`,\n\t\t\t\t\t`date_started`,\n\t\t\t\t\t`date_ended`,\n\t\t\t\t\t`pledge_amount`,\n\t\t\t\t\t`contributed_amount`,\n\t\t\t\t\t`remaining_amount`,\n\t\t\t\t\t`fulfilled_flag`,\n\t\t\t\t\t`active_flag`,\n\t\t\t\t\t__sys_login_id,\n\t\t\t\t\t__sys_action,\n\t\t\t\t\t__sys_date\n\t\t\t\t) VALUES (\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->intId) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnActiveFlag) . ',\n\t\t\t\t\t' . (($objDatabase->JournaledById) ? $objDatabase->JournaledById : 'NULL') . ',\n\t\t\t\t\t' . $objDatabase->SqlVariable($strJournalCommand) . ',\n\t\t\t\t\tNOW()\n\t\t\t\t);\n\t\t\t');\n\t\t}",
"public function Fetch ($Ledger) \r\n\t{\r\n\t\tif (is_numeric($Ledger)) \r\n\t\t{\r\n\t\t\t$query = \"SELECT * FROM Ledger WHERE ID=(${Ledger})\";\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\t$query = \"SELECT * FROM Ledger WHERE Code='${Ledger}'\";\r\n\t\t}\r\n\t\tself::Event($query, \"\");\r\n\t\tif (!$this->table=mysql_query($query, $this->db)) \r\n\t\t{\r\n\t\t\tself::Error(\"Can't fetch Ledger '${Ledger}'\", mysql_error($this->db));\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\tif (!$this->field=mysql_fetch_object($this->table)) \r\n\t\t{\r\n\t\t\tself::Error(\"Can't fetch Ledger '${Ledger}'\", \"No such Ledger.\");\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t\t$this->ID = $this->field->ID;\r\n\t\t$this->AccountID = $this->field->AccountID;\r\n\t\t$this->Code = $this->field->Code;\r\n\t\t$this->Name = $this->field->Name;\r\n\t\treturn (true);\r\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=PostdegreeGraduates::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"static function from_id($id){\r\n $db = new Database();\r\n $sql = \"select * from \" . Person::PERSON_TABLE . \" where id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $id);\r\n $stm->execute();\r\n $row = $stm->fetch();\r\n $person = new Person();\r\n $person->id = $id;\r\n //to pass validation, interests are loaded separately\r\n $row[\"interests\"] = array();\r\n\r\n //mysql datetime to right format conversion\r\n $db_date = DateTime::createfromformat(\"Y-m-d H:i:s\", $row[\"admission_date\"]);\r\n $row[\"admission_date\"] = $db_date->format(\"Y-m-d g:iA\");\r\n $row[\"admission_time\"] = $db_date->format(\"g:iA\");\r\n\r\n //load values into person properties\r\n $person->from_array($row);\r\n $person->load_interests();\r\n return $person;\r\n }",
"public function find(int $post_id);",
"public static function CountByStewardshipFundId($intStewardshipFundId, $objOptionalClauses = null) {\n\t\t\t// Call StewardshipPledge::QueryCount to perform the CountByStewardshipFundId query\n\t\t\treturn StewardshipPledge::QueryCount(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}"
] |
[
"0.5877527",
"0.573441",
"0.5340851",
"0.5307946",
"0.48488498",
"0.4710844",
"0.46589264",
"0.4583667",
"0.4578754",
"0.44163078",
"0.43885362",
"0.43716204",
"0.43061036",
"0.42729712",
"0.42538303",
"0.42482415",
"0.42285535",
"0.42228845",
"0.4160258",
"0.41561076",
"0.41488585",
"0.41388032",
"0.41377157",
"0.41185638",
"0.41061392",
"0.4101287",
"0.40872547",
"0.4078822",
"0.40507892",
"0.40083033"
] |
0.6464609
|
0
|
Load an array of StewardshipPledge objects, by FulfilledFlag, ActiveFlag Index(es)
|
public static function LoadArrayByFulfilledFlagActiveFlag($blnFulfilledFlag, $blnActiveFlag, $objOptionalClauses = null) {
// Call StewardshipPledge::QueryArray to perform the LoadArrayByFulfilledFlagActiveFlag query
try {
return StewardshipPledge::QueryArray(
QQ::AndCondition(
QQ::Equal(QQN::StewardshipPledge()->FulfilledFlag, $blnFulfilledFlag),
QQ::Equal(QQN::StewardshipPledge()->ActiveFlag, $blnActiveFlag)
),
$objOptionalClauses
);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StewardshipPledge object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StewardshipPledge::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->PersonId = $objReloaded->PersonId;\n\t\t\t$this->StewardshipFundId = $objReloaded->StewardshipFundId;\n\t\t\t$this->dttDateStarted = $objReloaded->dttDateStarted;\n\t\t\t$this->dttDateEnded = $objReloaded->dttDateEnded;\n\t\t\t$this->fltPledgeAmount = $objReloaded->fltPledgeAmount;\n\t\t\t$this->fltContributedAmount = $objReloaded->fltContributedAmount;\n\t\t\t$this->fltRemainingAmount = $objReloaded->fltRemainingAmount;\n\t\t\t$this->blnFulfilledFlag = $objReloaded->blnFulfilledFlag;\n\t\t\t$this->blnActiveFlag = $objReloaded->blnActiveFlag;\n\t\t}",
"public function loadShips(): void {\n\t\t$sql = \"SELECT * FROM `npc_ship` WHERE `id_npc` = ?\";\n\t\t$this->db->query($sql, [$this->get('id')]);\n\t\t$ships = [];\n\t\twhile ($res = $this->db->next()){\n\t\t\t$npc_ship = new NPCShip();\n\t\t\t$npc_ship->update($res);\n\t\t\t$npc_ship->loadShip($this->get('margin'));\n\n\t\t\tarray_push($ships, $npc_ship);\n\t\t}\n\t\t$this->setShips($ships);\n\t}",
"public static function LoadArrayByStewardshipFundId($intStewardshipFundId, $objOptionalClauses = null) {\n\t\t\t// Call StewardshipPledge::QueryArray to perform the LoadArrayByStewardshipFundId query\n\t\t\ttry {\n\t\t\t\treturn StewardshipPledge::QueryArray(\n\t\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId),\n\t\t\t\t\t$objOptionalClauses\n\t\t\t\t\t);\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"private function loadApprovals() {\r\n global $db;\r\n\r\n $sql = sprintf(\"SELECT * FROM `forms_tracking_approvals`\r\n WHERE `tracking_id` = %s\", $this->trackingFormId);\r\n $approvals = $db->getAll($sql);\r\n\r\n\r\n if(is_array($approvals)) {\r\n foreach($approvals as $approval) {\r\n switch($approval['approval_type_id']) {\r\n case ETHICS_BEHAVIOURAL:\r\n require_once('classes/tracking/approvals/EthicsBehavioural.php');\r\n $hreb = new \\tracking\\approval\\EthicsBehavioural($this->trackingFormId);\r\n $hreb->status = $approval['approved'] == 1 ? APPROVED : PRESUBMITTED;\r\n $hreb->comments = $approval['comments'];\r\n $hreb->dateApproved = $approval['date_approved'];\r\n $hreb->dateSubmitted = $approval['date_submitted'];\r\n $this->addApproval($hreb);\r\n break;\r\n case COMMITMENTS:\r\n require_once('classes/tracking/approvals/Commitments.php');\r\n $commitments = new \\tracking\\approval\\Commitments($this->trackingFormId);\r\n $commitments->status = $approval['approved'] == 1 ? APPROVED : PRESUBMITTED;\r\n $commitments->comments = $approval['comments'];\r\n $commitments->dateApproved = $approval['date_approved'];\r\n $commitments->dateSubmitted = $approval['date_submitted'];\r\n $this->addApproval($commitments);\r\n break;\r\n case COI:\r\n require_once('classes/tracking/approvals/COI.php');\r\n $COI = new \\tracking\\approval\\COI($this->trackingFormId);\r\n $COI->status = $approval['approved'] == 1 ? APPROVED : PRESUBMITTED;\r\n $COI->comments = $approval['comments'];\r\n $COI->dateApproved = $approval['date_approved'];\r\n $COI->dateSubmitted = $approval['date_submitted'];\r\n $this->addApproval($COI);\r\n break;\r\n case DEAN_REVIEW:\r\n require_once('classes/tracking/approvals/DeanReview.php');\r\n $deanReview = new \\tracking\\approval\\DeanReview($this->trackingFormId);\r\n $deanReview->status = $approval['approved'] == 1 ? APPROVED : PRESUBMITTED;\r\n $deanReview->comments = $approval['comments'];\r\n $deanReview->dateApproved = $approval['date_approved'];\r\n $deanReview->dateSubmitted = $approval['date_submitted'];\r\n $this->addApproval($deanReview);\r\n break;\r\n case ORS_REVIEW:\r\n require_once('classes/tracking/approvals/ORSReview.php');\r\n $orsReview = new \\tracking\\approval\\ORSReview($this->trackingFormId);\r\n $orsReview->status = $approval['approved'] == 1 ? APPROVED : PRESUBMITTED;\r\n $orsReview->comments = $approval['comments'];\r\n $orsReview->dateApproved = $approval['date_approved'];\r\n $orsReview->dateSubmitted = $approval['date_submitted'];\r\n $this->addApproval($orsReview);\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n }\r\n }",
"public function get_checklist_approval_data() {\n\n $approval_data = array();\n\n $query = db_select('checklist_inspections', 'c')\n ->fields('c', array('order_num','category','unit_id','nid','approved','inspected_by','repair_data','date_submitted','follow_up_alert','comments'))\n ->condition('approved', NULL);\n $results = $query->execute();\n\n foreach ($results as $val) {\n $approval_data[] = (array) $val;\n }\n return $approval_data;\n }",
"public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t);\n\t\t}",
"public function Refresh($blnReload = false) {\n\t\t\tif ($blnReload)\n\t\t\t\t$this->objStewardshipBatch->Reload();\n\n\t\t\tif ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objStewardshipBatch->Id;\n\n\t\t\tif ($this->lstStewardshipBatchStatusType) $this->lstStewardshipBatchStatusType->SelectedValue = $this->objStewardshipBatch->StewardshipBatchStatusTypeId;\n\t\t\tif ($this->lblStewardshipBatchStatusTypeId) $this->lblStewardshipBatchStatusTypeId->Text = ($this->objStewardshipBatch->StewardshipBatchStatusTypeId) ? StewardshipBatchStatusType::$NameArray[$this->objStewardshipBatch->StewardshipBatchStatusTypeId] : null;\n\n\t\t\tif ($this->calDateEntered) $this->calDateEntered->DateTime = $this->objStewardshipBatch->DateEntered;\n\t\t\tif ($this->lblDateEntered) $this->lblDateEntered->Text = sprintf($this->objStewardshipBatch->DateEntered) ? $this->objStewardshipBatch->__toString($this->strDateEnteredDateTimeFormat) : null;\n\n\t\t\tif ($this->calDateCredited) $this->calDateCredited->DateTime = $this->objStewardshipBatch->DateCredited;\n\t\t\tif ($this->lblDateCredited) $this->lblDateCredited->Text = sprintf($this->objStewardshipBatch->DateCredited) ? $this->objStewardshipBatch->__toString($this->strDateCreditedDateTimeFormat) : null;\n\n\t\t\tif ($this->txtBatchLabel) $this->txtBatchLabel->Text = $this->objStewardshipBatch->BatchLabel;\n\t\t\tif ($this->lblBatchLabel) $this->lblBatchLabel->Text = $this->objStewardshipBatch->BatchLabel;\n\n\t\t\tif ($this->txtDescription) $this->txtDescription->Text = $this->objStewardshipBatch->Description;\n\t\t\tif ($this->lblDescription) $this->lblDescription->Text = $this->objStewardshipBatch->Description;\n\n\t\t\tif ($this->txtItemCount) $this->txtItemCount->Text = $this->objStewardshipBatch->ItemCount;\n\t\t\tif ($this->lblItemCount) $this->lblItemCount->Text = $this->objStewardshipBatch->ItemCount;\n\n\t\t\tif ($this->txtReportedTotalAmount) $this->txtReportedTotalAmount->Text = $this->objStewardshipBatch->ReportedTotalAmount;\n\t\t\tif ($this->lblReportedTotalAmount) $this->lblReportedTotalAmount->Text = $this->objStewardshipBatch->ReportedTotalAmount;\n\n\t\t\tif ($this->txtActualTotalAmount) $this->txtActualTotalAmount->Text = $this->objStewardshipBatch->ActualTotalAmount;\n\t\t\tif ($this->lblActualTotalAmount) $this->lblActualTotalAmount->Text = $this->objStewardshipBatch->ActualTotalAmount;\n\n\t\t\tif ($this->txtPostedTotalAmount) $this->txtPostedTotalAmount->Text = $this->objStewardshipBatch->PostedTotalAmount;\n\t\t\tif ($this->lblPostedTotalAmount) $this->lblPostedTotalAmount->Text = $this->objStewardshipBatch->PostedTotalAmount;\n\n\t\t\tif ($this->lstCreatedByLogin) {\n\t\t\t\t\t$this->lstCreatedByLogin->RemoveAllItems();\n\t\t\t\tif (!$this->blnEditMode)\n\t\t\t\t\t$this->lstCreatedByLogin->AddItem(QApplication::Translate('- Select One -'), null);\n\t\t\t\t$objCreatedByLoginArray = Login::LoadAll();\n\t\t\t\tif ($objCreatedByLoginArray) foreach ($objCreatedByLoginArray as $objCreatedByLogin) {\n\t\t\t\t\t$objListItem = new QListItem($objCreatedByLogin->__toString(), $objCreatedByLogin->Id);\n\t\t\t\t\tif (($this->objStewardshipBatch->CreatedByLogin) && ($this->objStewardshipBatch->CreatedByLogin->Id == $objCreatedByLogin->Id))\n\t\t\t\t\t\t$objListItem->Selected = true;\n\t\t\t\t\t$this->lstCreatedByLogin->AddItem($objListItem);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->lblCreatedByLoginId) $this->lblCreatedByLoginId->Text = ($this->objStewardshipBatch->CreatedByLogin) ? $this->objStewardshipBatch->CreatedByLogin->__toString() : null;\n\n\t\t\tif ($this->lstPaypalBatch) {\n\t\t\t\t$this->lstPaypalBatch->RemoveAllItems();\n\t\t\t\t$this->lstPaypalBatch->AddItem(QApplication::Translate('- Select One -'), null);\n\t\t\t\t$objPaypalBatchArray = PaypalBatch::LoadAll();\n\t\t\t\tif ($objPaypalBatchArray) foreach ($objPaypalBatchArray as $objPaypalBatch) {\n\t\t\t\t\t$objListItem = new QListItem($objPaypalBatch->__toString(), $objPaypalBatch->Id);\n\t\t\t\t\tif ($objPaypalBatch->StewardshipBatchId == $this->objStewardshipBatch->Id)\n\t\t\t\t\t\t$objListItem->Selected = true;\n\t\t\t\t\t$this->lstPaypalBatch->AddItem($objListItem);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->lblPaypalBatch) $this->lblPaypalBatch->Text = ($this->objStewardshipBatch->PaypalBatch) ? $this->objStewardshipBatch->PaypalBatch->__toString() : null;\n\n\t\t}",
"public function toFeatureArray($rawFeatureArray) {\r\n \r\n /*\r\n * No result - throw Not Found exception\r\n */\r\n if (!isset($rawFeatureArray) || !is_array($rawFeatureArray)) {\r\n RestoLogUtil::httpError(404);\r\n }\r\n \r\n /*\r\n * Add collection\r\n */\r\n if (!isset($this->collections[$rawFeatureArray['collection']])) {\r\n $this->collections[$rawFeatureArray['collection']] = new RestoCollection($rawFeatureArray['collection'], $this->context, $this->user, array('autoload' => true));\r\n }\r\n \r\n /*\r\n * First correct types\r\n */\r\n $rawCorrectedArray = $this->correctTypes($rawFeatureArray);\r\n \r\n /*\r\n * Initialize featureArray\r\n */\r\n $featureArray = array(\r\n 'type' => 'Feature',\r\n 'id' => $rawFeatureArray['identifier'],\r\n 'geometry' => isset($rawCorrectedArray['geometry']) ? $rawCorrectedArray['geometry'] : null,\r\n 'properties' => $this->toProperties($rawCorrectedArray)\r\n );\r\n \r\n return $featureArray;\r\n \r\n }",
"function getDetailAllMileStone($groupo_id_local,$DbConnection)\n{\n $query=\"SELECT milestone_id,milestone_name,milestone_type FROM milestone_assignment USE INDEX(mass_gid_status) WHERE group_id='$groupo_id_local' AND status=1\"; \t\t\t\t\n if($DEBUG==1){print $query;}\n $result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n /*$ms_id=$row->milestone_id; \n $ms_name=$row->milestone_name;\n $ms_type=$row->milestone_type;*/\n $data[]=array('ms_id'=>$row->milestone_id,'ms_name'=>$row->milestone_name,'ms_type'=>$row->milestone_type);\t\n }\n return $data;\n}",
"function load_active_block(){\r\n //($active_pos_x, $active_pos_y, $active_shape_matrix)\r\n require(\"pdo_save.php\");\r\n\r\n $active_block = array(\"position\"=>array(\"x\"=>0, \"y\"=>0), \"shapeMatrix\"=>0);\r\n\r\n $stmt2 = $pdo_save->query(\"SELECT * FROM active_block\");\r\n $row = $stmt2->fetch(PDO::FETCH_ASSOC );\r\n $active_block[\"position\"][\"x\"] = (int)$row[\"pos_x\"];\r\n $active_block[\"position\"][\"y\"] = (int)$row[\"pos_y\"];\r\n $active_block[\"shapeMatrix\"] = (int)$row[\"shape_matrix\"];\r\n $active_block[\"rotation\"] = (int)$row[\"rotation\"];\r\n\r\n return $active_block;\r\n}",
"public function processRead()\n {\n $shipment = $this->getEntity();\n\n $extraFields = array(\n 'order_increment_id' => $shipment->getOrder()->getIncrementId(),\n 'external_order_id' => $shipment->getOrder()->getData('external_order_id'),\n 'store' => $this->storeManager->getStore($shipment->getStoreId())->getCode()\n );\n\n $shipmentArray = array_merge($shipment->getData(), $extraFields);\n\n // add tracking information\n $tracking = array();\n foreach ($shipment->getTracksCollection() as $track) {\n if (!$track->isDeleted()) {\n $trackEntity = $this->shipmentTrackingFactory->create()\n ->setEntity($track);\n $tracking[] = $trackEntity->read();\n }\n }\n if (!empty($tracking)) {\n $shipmentArray['tracking'] = $tracking;\n }\n // add shipment items information\n if ($shipment->getAllItems()) {\n $items = array();\n foreach ($shipment->getAllItems() as $item) {\n $itemEntity = $this->shipmentItemFactory->create()\n ->setEntity($item);\n $items[] = $itemEntity->read();\n }\n $shipmentArray['items'] = $items;\n }\n return $shipmentArray;\n }",
"public function getActiveBuildingsWithSoftlandInfo()\n {\n $this->SfBuildings = TableRegistry::get('SfBuildings');\n $buildings = $this->find('all')\n ->where(['Buildings.softland_id IS NOT NULL', 'Buildings.omit' => false])\n ->join([\n 'table' => 'budgets',\n 'alias' => 'Budgets',\n 'conditions' => ['Budgets.building_id = Buildings.id']\n ])\n ->group(['Buildings.id']);\n $buildingsWithSoftlandInfo = array();\n foreach ($buildings as $building) {\n $sf_building = $this->SfBuildings->find('all', [\n 'conditions' => ['SfBuildings.CodArn' => $building['softland_id']]\n ])->first();\n $buildingsWithSoftlandInfo[$building['id']] = $sf_building['CodArn'] . ' - ' . $sf_building['DesArn'];\n }\n return $buildingsWithSoftlandInfo;\n }",
"private function loadAllFacilities(){\n $sql=\"SELECT f.id,f.facility name,f.dhis2_name,f.hub_id,\n h.ip_id, f.district_id,f.dhis2_uid,d.dhis2_uid as district_uid \n FROM backend_facilities f \n left join backend_hubs h on f.hub_id = h.id \n left join backend_districts d on d.id = f.district_id\";\n\n $facilities_array = $this->db->select($sql);\n\n $this->mongo->facilities->drop();\n \n foreach($facilities_array AS $row){\n $data=[\n 'id'=>$row->id,\n 'name'=>$row->name,\n 'dhis2_name'=>$row->dhis2_name,\n 'hub_id'=>$row->hub_id,\n 'ip_id'=>$row->ip_id,\n\n 'district_id'=>$row->district_id,\n 'dhis2_uid'=>$row->dhis2_uid,\n 'district_uid'=>$row->district_uid,\n 'updated'=>'done'\n ];\n $this->mongo->facilities->insert($data);\n }\n\n }",
"function get_pending_bookings(){\n\t\tif( get_option('dbem_bookings_approval') == 0 ){\n\t\t\treturn new EM_Bookings();\n\t\t}\n\t\t$pending = array();\n\t\tforeach ( $this->load() as $EM_Booking ){\n\t\t\tif($EM_Booking->booking_status == 0){\n\t\t\t\t$pending[] = $EM_Booking;\n\t\t\t}\n\t\t}\n\t\t$EM_Bookings = new EM_Bookings($pending);\n\t\treturn $EM_Bookings;\t\n\t}",
"static function ArrSLAinObj($arr)\n\t{\n\t\tself::$postHolidaysSlaFields->RemoveExistingRows();\n\t\tforeach($arr as $k => $v)\n\t\t{\n\t\t\tself::$postHolidaysSlaFields->AddRow();\n\t\t\tself::$postHolidaysSlaFields->HOLIDAYS_ID = self::$id;\n\t\t\tself::$postHolidaysSlaFields->SLA_ID = $v;\n\t\t}\n\t}",
"public function index()\n {\n \n $id = Auth::user()->id;\n $student_id = DB::table('user_student')->where('user_id',$id)->get(['id'])->first();\n $grievance = DB::table('table_grievance')->where('student_id',$student_id->id)->orderBy('id','asc')\n ->get(['id','type','created_at','documents']);\n $data = [];\n $i = 0;\n foreach ($grievance as $id){\n $data[$i] = $id->id;\n $i++;\n }\n $grievance_status = DB::table('table_grievance_status')->whereIn('status',['raised','addressed'])\n ->whereIn('grievance_id',$data)->orderBy('grievance_id','asc')\n ->get(['grievance_id','status','eta']);\n $i = 0;\n\n $open=[];\n \n\n for ($i = 0; $i<count($grievance_status);$i++){\n if($grievance_status[$i]->status == 'addressed')\n $action = 1;\n else\n $action = 0;\n $open[$i] = [\n 'grievance_id'=>$grievance[$i]->id,\n 'grievance_type' => $grievance[$i]->type,\n 'assigned_committee' => $grievance[$i]->type,\n 'data_of_issue' => $grievance[$i]->created_at,\n 'attachment'=> $grievance[$i]->documents,\n 'status'=>$grievance_status[$i]->status,\n 'eta'=>$grievance_status[$i]->eta,\n 'action'=>$action\n ];\n }\n\n $id = Auth::user()->id;\n $student_id = DB::table('user_student')->where('user_id',$id)->get(['id'])->first();\n $grievance_escalated = DB::table('table_grievance')->where('student_id',$student_id->id)->orderBy('id','asc')\n ->get(['id','type','created_at','documents']);\n $data_escalated = [];\n $i = 0;\n foreach ($grievance_escalated as $id){\n $data_escalated[$i] = $id->id;\n $i++;\n }\n $grievance_status_escalated = DB::table('table_grievance_status')->whereIn('status',['delayed','reopened'])\n ->whereIn('grievance_id',$data_escalated)->orderBy('grievance_id','asc')\n ->get(['grievance_id','status','eta']);\n $i = 0;\n\n $esclated=[];\n \n\n for ($i = 0; $i<count($grievance_status_escalated);$i++){\n $action = 0;\n $esclated[$i] = [\n 'grievance_id'=>$grievance_status_escalated[$i]->grievance_id,\n 'grievance_type' => $grievance_escalated[$i]->type,\n 'assigned_committee' => $grievance_escalated[$i]->type,\n 'data_of_issue' => $grievance_escalated[$i]->created_at,\n 'attachment'=> $grievance_escalated[$i]->documents,\n 'status'=>$grievance_status_escalated[$i]->status,\n 'eta'=>$grievance_status_escalated[$i]->eta,\n 'action'=>$action\n ];\n }\n\n $id =\"5\";\n //$id = Auth::user()->id;\n $student_id = DB::table('user_student')->where('user_id',$id)->get(['id'])->first();\n $grievance_solved = DB::table('table_grievance')->where('student_id',$student_id->id)->orderBy('id','asc')\n ->get(['id','type','created_at','documents']);\n $data_solved = [];\n $i = 0;\n foreach ($grievance_solved as $id){\n $data_solved[$i] = $id->id;\n $i++;\n }\n $grievance_status_solved = DB::table('table_grievance_status')->whereIn('status',['resolved'])\n ->whereIn('grievance_id',$data_solved)->orderBy('grievance_id','asc')\n ->get(['grievance_id','status','eta']);\n $i = 0;\n\n $resolved=[];\n \n\n for ($i = 0; $i<count($grievance_status_solved);$i++){\n $action = 1;\n $resolved[$i] = [\n 'grievance_id'=>$grievance_status_solved[$i]->grievance_id,\n 'grievance_type' => $grievance_solved[$i]->type,\n 'assigned_committee' => $grievance_solved[$i]->type,\n 'data_of_issue' => $grievance_solved[$i]->created_at,\n 'attachment'=> $grievance_solved[$i]->documents,\n 'status'=>$grievance_status_solved[$i]->status,\n 'eta'=>$grievance_status_solved[$i]->eta,\n 'action'=>$action\n ];\n }\n\n $result[\"open\"] = $open;\n $result[\"esclated\"] = $esclated;\n $result[\"resolved\"] = $resolved;\n\n echo json_encode($result);\n }",
"public function Save($blnForceInsert = false, $blnForceUpdate = false) {\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = StewardshipPledge::GetDatabase();\n\n\t\t\t$mixToReturn = null;\n\n\t\t\ttry {\n\t\t\t\tif ((!$this->__blnRestored) || ($blnForceInsert)) {\n\t\t\t\t\t// Perform an INSERT query\n\t\t\t\t\t$objDatabase->NonQuery('\n\t\t\t\t\t\tINSERT INTO `stewardship_pledge` (\n\t\t\t\t\t\t\t`person_id`,\n\t\t\t\t\t\t\t`stewardship_fund_id`,\n\t\t\t\t\t\t\t`date_started`,\n\t\t\t\t\t\t\t`date_ended`,\n\t\t\t\t\t\t\t`pledge_amount`,\n\t\t\t\t\t\t\t`contributed_amount`,\n\t\t\t\t\t\t\t`remaining_amount`,\n\t\t\t\t\t\t\t`fulfilled_flag`,\n\t\t\t\t\t\t\t`active_flag`\n\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnActiveFlag) . '\n\t\t\t\t\t\t)\n\t\t\t\t\t');\n\n\t\t\t\t\t// Update Identity column and return its value\n\t\t\t\t\t$mixToReturn = $this->intId = $objDatabase->InsertId('stewardship_pledge', 'id');\n\n\t\t\t\t\t// Journaling\n\t\t\t\t\tif ($objDatabase->JournalingDatabase) $this->Journal('INSERT');\n\n\t\t\t\t} else {\n\t\t\t\t\t// Perform an UPDATE query\n\n\t\t\t\t\t// First checking for Optimistic Locking constraints (if applicable)\n\n\t\t\t\t\t// Perform the UPDATE query\n\t\t\t\t\t$objDatabase->NonQuery('\n\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\t`stewardship_pledge`\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t`person_id` = ' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t\t\t`stewardship_fund_id` = ' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t\t\t`date_started` = ' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t\t\t`date_ended` = ' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t\t\t`pledge_amount` = ' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t\t\t`contributed_amount` = ' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t\t\t`remaining_amount` = ' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t\t\t`fulfilled_flag` = ' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t\t\t`active_flag` = ' . $objDatabase->SqlVariable($this->blnActiveFlag) . '\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t`id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t\t\t');\n\n\t\t\t\t\t// Journaling\n\t\t\t\t\tif ($objDatabase->JournalingDatabase) $this->Journal('UPDATE');\n\t\t\t\t}\n\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\n\t\t\t// Update __blnRestored and any Non-Identity PK Columns (if applicable)\n\t\t\t$this->__blnRestored = true;\n\n\n\t\t\t// Return \n\t\t\treturn $mixToReturn;\n\t\t}",
"private function load_interests(){\r\n $db = new Database();\r\n $sql = \"select * from \" . Person::PERSON_INTEREST_TABLE . \" where person_id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->execute();\r\n $its = $stm->fetchAll();\r\n foreach($its as $it){\r\n $this->interests[] = Interest::with_id($it[\"interest_id\"]);\r\n }\r\n }",
"public function drop_non_franchise($league_id){\r\n\t $this->Database_Manager->database_backup(array('Transactions','Rosters','Franchise','Players','Starting_Lineups'));\r\n\t $year=$this->current_year;\r\n\t //get all teams\r\n\t $all_teams = $this->Teams->get_all_team_id($league_id);\r\n\t \r\n\t //foreach team get the franchise players in array form\r\n\t foreach($all_teams as $team_id){\r\n\t \t$franchise_array = $this->get_simple_franchise_by_year($team_id,$year);\r\n\t\t\r\n\t\t//foreach roster player if not in franchise array , delete from rosters\r\n\t\t$roster_array = $this->Rosters->get_team_complete_roster($team_id);\r\n\t\tforeach($roster_array as $fffl_player_id){\r\n\t\t\tif(!in_array($fffl_player_id,$franchise_array)){\r\n\t\t\t\t//delete from roster\r\n\t\t\t\t$this->Rosters->release_player($team_id,$fffl_player_id);\r\n\t\t\t}\r\n\t\t}\r\n\t }\r\n\t \r\n\t //move teh PS players to the roster\r\n\t $this->db->where('lineup_area','PS')\r\n\t \t\t\t->set('lineup_area','Roster')\r\n\t\t\t\t->update('Rosters');\r\n\t \r\n\t //create JSON files of the draftable and supplemental players\r\n\t\t//get all players and check each one\r\n\t\t$all_players = $this->Players->get_all_player_ids(\"Players.current_team<>'RET' and Players.current_team<>'FA'\",\"fffl_player_id\",\"Players.last_name\",'ASC',0);\r\n\t\t$draftable = array();\r\n\t\t$supplemental_eligible=array();\r\n\t\tforeach($all_players['ids'] as $fffl_player_id){\r\n\t\t\t$player_info=$this->Players->get_player_info(array($fffl_player_id->fffl_player_id),'fffl_player_id','position');\r\n\r\n\t\t\tif($this->Free_Agents->get_player_number_free_agents($fffl_player_id->fffl_player_id)==2){\r\n\t\t\t\t$draftable[$fffl_player_id->fffl_player_id]=$player_info['position'];\r\n\t\t\t}\r\n\t\t\telseif($this->Free_Agents->get_player_number_free_agents($fffl_player_id->fffl_player_id)==1){\r\n\t\t\t\t$supplemental_eligible[]=$fffl_player_id->fffl_player_id;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$fp = fopen('/home1/theffflc/public_html/fantasy/assets/json/draftable.json', 'w');\r\n\t\tfwrite($fp, json_encode(array('draftable'=>$draftable)));\r\n\t\t$fp = fopen('/home1/theffflc/public_html/fantasy/assets/json/supplemental_eligible.json', 'w');\r\n\t\tfwrite($fp, json_encode(array('supplemental'=>$supplemental_eligible)));\r\n\t \r\n\t \r\n\t //reset all free agent salaries\r\n\t $this->Salaries->reset_all_free_agent_salaries();\r\n }",
"function set_dropified_tracking($_dropified_array){\n \n $db_instance = new Database();\n \n $ids = $db_instance->db_retrieve('fulfillments', Array('fulfillment_id'), Array('fulfillment_shopify_id'=>$_dropified_array['fulfillment_shopify_id']));\n \n foreach($ids as $id){\n \n $data = Array();\n $db_conditions = Array(\n 'tracking_number' => $_dropified_array['tracking_number'],\n 'fulfillment_id' => $id['fulfillment_id']\n );\n $data = $db_instance->db_retrieve('vendor_tracking', Array('tracking_number', 'fulfillment_id'), $db_conditions);\n \n if(sizeof($data) > 0){\n\n $dropified_array = Array(\n 'vendor_id' => $_dropified_array['vendor_id'],\n 'tracking_tmodified'=>$_dropified_array['tracking_tmodified']\n );\n $db_instance->db_update('vendor_tracking',$dropified_array,$db_conditions);\n\n } else {\n\n $dropified_array = Array(\n 'tracking_number' => $_dropified_array['tracking_number'],\n 'fulfillment_id' => $id['fulfillment_id'],\n 'order_id' => $_dropified_array['order_id'],\n 'vendor_id' => $_dropified_array['vendor_id'],\n 'order_receipt_id'=>$_dropified_array['order_receipt_id'],\n 'tracking_tcreate' => $_dropified_array['tracking_tcreate'],\n 'tracking_tmodified'=>$_dropified_array['tracking_tmodified']\n );\n $result = $db_instance->db_create('vendor_tracking',$dropified_array);\n\n }\n }\n unset($db_instance);\n \n return;\n}",
"public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $objPreviousItem = null, $strColumnAliasArray = array()) {\n\t\t\t// If blank row, return null\n\t\t\tif (!$objDbRow)\n\t\t\t\treturn null;\n\n\n\t\t\t// Create a new instance of the StewardshipPledge object\n\t\t\t$objToReturn = new StewardshipPledge();\n\t\t\t$objToReturn->__blnRestored = true;\n\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';\n\t\t\t$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'person_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'person_id'] : $strAliasPrefix . 'person_id';\n\t\t\t$objToReturn->intPersonId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'stewardship_fund_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'stewardship_fund_id'] : $strAliasPrefix . 'stewardship_fund_id';\n\t\t\t$objToReturn->intStewardshipFundId = $objDbRow->GetColumn($strAliasName, 'Integer');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'date_started', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_started'] : $strAliasPrefix . 'date_started';\n\t\t\t$objToReturn->dttDateStarted = $objDbRow->GetColumn($strAliasName, 'Date');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'date_ended', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'date_ended'] : $strAliasPrefix . 'date_ended';\n\t\t\t$objToReturn->dttDateEnded = $objDbRow->GetColumn($strAliasName, 'Date');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'pledge_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'pledge_amount'] : $strAliasPrefix . 'pledge_amount';\n\t\t\t$objToReturn->fltPledgeAmount = $objDbRow->GetColumn($strAliasName, 'Float');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'contributed_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'contributed_amount'] : $strAliasPrefix . 'contributed_amount';\n\t\t\t$objToReturn->fltContributedAmount = $objDbRow->GetColumn($strAliasName, 'Float');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'remaining_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'remaining_amount'] : $strAliasPrefix . 'remaining_amount';\n\t\t\t$objToReturn->fltRemainingAmount = $objDbRow->GetColumn($strAliasName, 'Float');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'fulfilled_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'fulfilled_flag'] : $strAliasPrefix . 'fulfilled_flag';\n\t\t\t$objToReturn->blnFulfilledFlag = $objDbRow->GetColumn($strAliasName, 'Bit');\n\t\t\t$strAliasName = array_key_exists($strAliasPrefix . 'active_flag', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'active_flag'] : $strAliasPrefix . 'active_flag';\n\t\t\t$objToReturn->blnActiveFlag = $objDbRow->GetColumn($strAliasName, 'Bit');\n\n\t\t\t// Instantiate Virtual Attributes\n\t\t\tforeach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {\n\t\t\t\t$strVirtualPrefix = $strAliasPrefix . '__';\n\t\t\t\t$strVirtualPrefixLength = strlen($strVirtualPrefix);\n\t\t\t\tif (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)\n\t\t\t\t\t$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;\n\t\t\t}\n\n\t\t\t// Prepare to Check for Early/Virtual Binding\n\t\t\tif (!$strAliasPrefix)\n\t\t\t\t$strAliasPrefix = 'stewardship_pledge__';\n\n\t\t\t// Check for Person Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'person_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objPerson = Person::InstantiateDbRow($objDbRow, $strAliasPrefix . 'person_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\t\t\t// Check for StewardshipFund Early Binding\n\t\t\t$strAlias = $strAliasPrefix . 'stewardship_fund_id__id';\n\t\t\t$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;\n\t\t\tif (!is_null($objDbRow->GetColumn($strAliasName)))\n\t\t\t\t$objToReturn->objStewardshipFund = StewardshipFund::InstantiateDbRow($objDbRow, $strAliasPrefix . 'stewardship_fund_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);\n\n\n\n\n\t\t\treturn $objToReturn;\n\t\t}",
"function pick_list_for_pending_shipments($id)\r\n\t\t{\r\n\t\t\t$user=$this->erpm->auth();\r\n\t\t\t$sql=\"select a.id,b.invoice_no,c.tray_name,g.town_name,f.franchise_name from pnh_m_manifesto_sent_log a \r\n\t\t\t\t\t\tjoin shipment_batch_process_invoice_link b on b.inv_manifesto_id=a.manifesto_id\r\n\t\t\t\t\t\tjoin m_tray_info c on c.tray_id=b.tray_id\r\n\t\t\t\t\t\tjoin king_invoice d on d.invoice_no=b.invoice_no\r\n\t\t\t\t\t\tjoin king_transactions e on e.transid=d.transid\r\n\t\t\t\t\t\tjoin pnh_m_franchise_info f on f.franchise_id=e.franchise_id\r\n\t\t\t\t\t\tjoin pnh_towns g on g.id=f.town_id\r\n\t\t\t\t\t\twhere a.id=? and packed=1 and shipped=0\r\n\t\t\t\t\tgroup by b.invoice_no\r\n\t\t\t\t\torder by g.town_name\";\r\n\t\t\t$pick_list_data=$this->db->query($sql,array($id))->result_Array();;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$data['pick_list_data']=$pick_list_data;\r\n\t\t\t$data['manifest_id']=$id;\r\n\t\t\t$data['page']='pending_shipments_pick_list';\r\n\t\t\t$this->load->view('admin/body/pending_shipments_pick_list',$data);\r\n\t\t}",
"public static function load_battle_index(){\n\n // Otherwise, continue normally\n global $db;\n\n // Create the index as an empty array\n $db->INDEX['BATTLES'] = array();\n\n // Default the battles index to an empty array\n $mmrpg_battles_index = array();\n\n // Define the cache file name and path given everything we've learned\n $cache_file_name = 'cache.battles.json';\n $cache_file_path = MMRPG_CONFIG_CACHE_PATH.'indexes/'.$cache_file_name;\n // Check to see if a file already exists and collect its last-modified date\n if (file_exists($cache_file_path)){ $cache_file_exists = true; $cache_file_date = date('Ymd-Hi', filemtime($cache_file_path)); }\n else { $cache_file_exists = false; $cache_file_date = '00000000-0000'; }\n\n // LOAD FROM CACHE if data exists and is current, otherwise continue so index can refresh and replace\n if (MMRPG_CONFIG_CACHE_INDEXES && $cache_file_exists && $cache_file_date >= MMRPG_CONFIG_CACHE_DATE){\n\n // Pull the battle index markup from the JSON file and decompress\n $cache_file_markup = file_get_contents($cache_file_path);\n $mmrpg_battles_index = json_decode($cache_file_markup, true);\n\n } else {\n\n // Indexing the battle data files and collect the generated markup\n $mmrpg_battles_index = rpg_battle::index_battle_data(false);\n $battles_cache_markup = json_encode($mmrpg_battles_index);\n\n // Write the index to a cache file, if caching is enabled\n if (MMRPG_CONFIG_CACHE_INDEXES === true){\n // Write the index to a cache file, if caching is enabled\n $this_cache_file = fopen($cache_file_path, 'w');\n fwrite($this_cache_file, $battles_cache_markup);\n fclose($this_cache_file);\n }\n\n }\n\n // Loop through the battles and index them after serializing\n foreach ($mmrpg_battles_index AS $token => $array){ $db->INDEX['BATTLES'][$token] = json_encode($array); }\n $db->INDEX['BATTLES_RAW'] = $db->INDEX['BATTLES'];\n\n // Additionally, include any dynamic session-based battles\n if (!empty($_SESSION['GAME']['values']['battle_index'])){\n // The session-based battles exist, so merge them with the index\n $db->INDEX['BATTLES'] = array_merge($db->INDEX['BATTLES'], $_SESSION['GAME']['values']['battle_index']);\n }\n\n // Return true on success\n return true;\n\n }",
"public function supplemental_draft($round)\r\n\t{\t\r\n\t\t$this->Database_Manager->database_backup(array('Draft_Picks'));\r\n\t\t$this->Database_Manager->database_backup(array('Drafts'));\r\n\t\t$this->Database_Manager->database_backup(array('Players'));\r\n\t\t$this->Database_Manager->database_backup(array('Rosters','Supplemental_Selections'));\r\n\r\n\t\t\r\n\t\t$draft_order = $this->Drafts->get_draft_results_year($this->league_id,$this->current_year);\r\n\t\t//get the id and start time for this draft\r\n\t\tforeach($draft_order['Supplemental'] as $draft_id => $draft_data){\r\n\t\t\t$start_time = $draft_data['start_time'];\r\n\t\t}\r\n\t\t//work the array down until we have just the first or second half of the draft order, depending on which round it is\r\n\t\t$draft_order = array_pop($draft_order['Supplemental']);\r\n\t\t$draft_order=$draft_order['picks'];\r\n\t\t$half = floor(count($draft_order)/2);\r\n\t\t$draft_order = array_chunk($draft_order,$half);\r\n\t\t$draft_order=$draft_order[$round-1];\r\n\t\t//go through each pick\r\n\t\tforeach($draft_order as $pick_minus_1 => $pick_data) {\r\n\t\t\t$team_selection = $this->db->where('team_id',$pick_data['team_id'])\r\n\t\t\t\t\t\t\t->order_by('priority','ASC')\r\n\t\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t\t->get('Supplemental_Selections');\r\n\t\t\tif($team_selection->num_rows()>0){\r\n\t\t\t\t//there's a player selected, proceed with the selection\r\n\t\t\t\tforeach($team_selection->result_array() as $selection){\r\n\t\t\t\t\techo ($pick_minus_1+1).'. '.team_name_link($pick_data['team_id']).' '.player_name_link($selection['fffl_player_id']).'<br>';\r\n\t\t\t\t\t//check to make sure it's time for this draft before making selections\r\n\t\t\t\t\tif($start_time< now()){\r\n\t\t\t\t\t\t//update the draft_picks table where pick_id matches\r\n\t\t\t\t\t\t$this->db->set('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->where('pick_id',$pick_data['pick_id'])\r\n\t\t\t\t\t\t\t\t->update('Draft_Picks');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//get the free agent salary for this player to set as the salary for the new team\r\n\t\t\t\t\t\t$salary = $this->Salaries->get_free_agent_salary($selection['fffl_player_id']);\r\n\t\t\t\t\t\t//get player position\r\n\t\t\t\t\t\t$player_info = $this->Players->get_player_info(array($selection['fffl_player_id']),\"fffl_player_id\",\"position\");\r\n\t\t\t\t\t\t$position = $player_info['position'];\r\n\t\t\t\t\t\t//add to roster using salary\r\n\t\t\t\t\t\t$this->db->set('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->set('team_id',$pick_data['team_id'])\r\n\t\t\t\t\t\t\t\t->set('salary',$salary)\r\n\t\t\t\t\t\t\t\t->set('position', $position)\r\n\t\t\t\t\t\t\t\t->set('lineup_area','Roster')\r\n\t\t\t\t\t\t\t\t->insert('Rosters');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//delete any request in the supplemental selections for this player\r\n\t\t\t\t\t\t$this->db->where('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->delete('Supplemental_Selections');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}//end if team has selections > 0\r\n\t\t\t//there isn't a palyer ot pick, pass the team.\r\n\t\t\telse{\r\n\t\t\t\t//************************THIS IS OLD CODE FROM THE OLD SITE THAT MANAGED COMPENSATORY PICKS. ONLY NECESSARY TO REDO THIS CODE IF WE REINSTITUTE COMPENSATORY PICKS*************************//\r\n\t\t\t\t\t\t\t\t//There's no player to pick, so the team passes and (THIS USED TO GIVE A COMPENSATORY PICK) //needs a compensatory pick assigned\r\n\t\t\t\t\t\t\t\t$teamId=$pick_data['team_id'];\r\n\t\t\t\t\t\t\t\t//update the draft_picks table where pick_id matches\r\n\t\t\t\t\t\t\t\t$this->db->set('fffl_player_id',0)\r\n\t\t\t\t\t\t\t\t\t\t->where('pick_id',$pick_data['pick_id'])\r\n\t\t\t\t\t\t\t\t\t\t->update('Draft_Picks');\r\n\t\t\t\t\t\t\t\t//Below is what used to award a compensatory pick to a passing team\r\n\t\t\t\t\t\t\t\t/*if($s==0) { //This is the first of a new pair of passing teams. The first in the pair gets lined up with his drafting day.\r\n\t\t\t\t\t\t\t\t\tif($draftorder[$i]['pos']<11) {\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$s=2; //s=2 means the next guy gets a Saturday pick\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental+10;\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental-10;\r\n\t\t\t\t\t\t\t\t\t\t$s=1; //s=1 means the next guy gets a Friday pick\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"INSERT into SupplementalDrafts values($CurSeasonId,\".$draftorder[$i]['pick'].\",\".$draftorder[$i]['team'].\",0)\");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t} else { //This is the second passer in a pair, he gets put on the other day from the team above when s=0.\r\n\t\t\t\t\t\t\t\t\tif($s==1) { //This team gets a fRiday pick\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\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\t\r\n\t\t\t\t\t\t\t\t\t} else if($s==2) { //This team gets a Saturday pick\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental+10;\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental-10;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"INSERT into SupplementalDrafts values($CurSeasonId,\".$draftorder[$i]['pick'].\",\".$draftorder[$i]['team'].\",0)\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$s=0; //the next passer will get put with his draft day in the above IF statement\r\n\t\t\t\t\t\t\t\t\t$supplemental++; \r\n\t\t\t\t\t\t\t\t}*/\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t/*}*/\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t}//end of the draft\r\n\t\t//delete all supplemental selections for the next supplemental draft\r\n\t\tif($start_time< now()){\r\n\t\t\t$this->db->where(1)->delete('Supplemental_Selections');\r\n\t\t}\r\n\t\t\r\n\t}",
"public function read(array $opts) {\n\t\t$scorm_scoes = $this->repo->readObject ( $opts ['objectid'], $opts ['objecttable'] );\n\t\t$scorm_tracks = $this->repo->readScormTracks ( $scorm_scoes->scorm, $opts ['timecreated'] );\n\t\treturn array_merge ( parent::read ( $opts ), [ \n\t\t\t\t'module' => $this->repo->readModule ( $scorm_scoes->scorm, 'scorm' ),\n\t\t\t\t'scorm_scoes' => $scorm_scoes,\n\t\t\t\t'scorm_tracks' => $scorm_tracks \n\t\t] );\n\t}",
"public function SaveStewardshipBatch() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstStewardshipBatchStatusType) $this->objStewardshipBatch->StewardshipBatchStatusTypeId = $this->lstStewardshipBatchStatusType->SelectedValue;\n\t\t\t\tif ($this->calDateEntered) $this->objStewardshipBatch->DateEntered = $this->calDateEntered->DateTime;\n\t\t\t\tif ($this->calDateCredited) $this->objStewardshipBatch->DateCredited = $this->calDateCredited->DateTime;\n\t\t\t\tif ($this->txtBatchLabel) $this->objStewardshipBatch->BatchLabel = $this->txtBatchLabel->Text;\n\t\t\t\tif ($this->txtDescription) $this->objStewardshipBatch->Description = $this->txtDescription->Text;\n\t\t\t\tif ($this->txtItemCount) $this->objStewardshipBatch->ItemCount = $this->txtItemCount->Text;\n\t\t\t\tif ($this->txtReportedTotalAmount) $this->objStewardshipBatch->ReportedTotalAmount = $this->txtReportedTotalAmount->Text;\n\t\t\t\tif ($this->txtActualTotalAmount) $this->objStewardshipBatch->ActualTotalAmount = $this->txtActualTotalAmount->Text;\n\t\t\t\tif ($this->txtPostedTotalAmount) $this->objStewardshipBatch->PostedTotalAmount = $this->txtPostedTotalAmount->Text;\n\t\t\t\tif ($this->lstCreatedByLogin) $this->objStewardshipBatch->CreatedByLoginId = $this->lstCreatedByLogin->SelectedValue;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\t\t\t\tif ($this->lstPaypalBatch) $this->objStewardshipBatch->PaypalBatch = PaypalBatch::Load($this->lstPaypalBatch->SelectedValue);\n\n\t\t\t\t// Save the StewardshipBatch object\n\t\t\t\t$this->objStewardshipBatch->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"function stage_get_features_status()\n{\n $features = stage_get_default('features');\n $status = array();\n\n foreach ($features as $feature => $settings) {\n $status[ $feature ] = stage_is_feature_active($feature);\n }\n\n return (object) $status;\n}",
"private function shipping_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_shipping', 200);\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', 'Shipped')->first();\n\n\t\t// load the order_map config file\n\t\tinclude_once dirname(dirname(__FILE__)).'/bmi_custom/config/order_map.php';\n\n\t\t// loop through each shipment\n\t\tforeach($query->result() as $shipment)\n\t\t{\n\t\t\t// add id to the processed array\n\t\t\t$ids_processed[] = $shipment->id;\n\n\t\t\tif(!empty($shipping_carriers[$shipment->carrier]))\n\t\t\t{\n\t\t\t\t$tracking = $shipping_carriers[$shipment->carrier] .'|'. $shipment->tracking_number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tracking = $shipment->tracking_number;\n\t\t\t}\t\n\n\t\t\t// update the status of each order with the tracking numbers\n\t\t\t$order_object = Store\\Model\\Order::find($shipment->order_id);\n\t\t\t$order_object->updateStatus($status, 0, $tracking);\n\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_shipping');\n\t\t}\t\n\t\t\n\t\t\n\t}",
"public function get_player_franchise($fffl_player_id,$league_id){\r\n $this->db->where('fffl_player_id',$fffl_player_id)\r\n \t\t\t\t\t\t\t->order_by('season','Desc');\r\n if($this->current_week==0){\r\n \r\n $this->db->where('season<'.$this->current_year);\r\n }\r\n \t\t\t\t\t\t\t$franchise_query=$this->db->get('Franchise');\r\n $franchise=array();\r\n foreach($franchise_query->result_array() as $data){\r\n \t$franchise[$data['season']][$data['team_id']]['salary']=$data['salary'];\r\n \t$franchise[$data['season']][$data['team_id']]['area']=$data['area'];\r\n \r\n }\r\n return $franchise;\r\n }",
"protected function updateLeagueStandings()\n {\n $conditions = array('needs_standings_update' => true);\n $fields = array('_id');\n $leagues_needing_update = Leagues::all(compact('conditions', 'fields'));\n }"
] |
[
"0.5375265",
"0.4872116",
"0.47254738",
"0.4618845",
"0.46018565",
"0.45833972",
"0.45779535",
"0.45545113",
"0.45355695",
"0.4519942",
"0.45011008",
"0.44625792",
"0.4451981",
"0.44453686",
"0.44423547",
"0.4436127",
"0.43532032",
"0.4323407",
"0.43116918",
"0.4294127",
"0.42756292",
"0.4272756",
"0.42708385",
"0.42675135",
"0.42375082",
"0.42332804",
"0.4231823",
"0.42240044",
"0.4223905",
"0.42074496"
] |
0.5734244
|
0
|
Load an array of StewardshipPledge objects, by PersonId Index(es)
|
public static function LoadArrayByPersonId($intPersonId, $objOptionalClauses = null) {
// Call StewardshipPledge::QueryArray to perform the LoadArrayByPersonId query
try {
return StewardshipPledge::QueryArray(
QQ::Equal(QQN::StewardshipPledge()->PersonId, $intPersonId),
$objOptionalClauses
);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function load_interests(){\r\n $db = new Database();\r\n $sql = \"select * from \" . Person::PERSON_INTEREST_TABLE . \" where person_id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->execute();\r\n $its = $stm->fetchAll();\r\n foreach($its as $it){\r\n $this->interests[] = Interest::with_id($it[\"interest_id\"]);\r\n }\r\n }",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StewardshipPledge object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StewardshipPledge::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->PersonId = $objReloaded->PersonId;\n\t\t\t$this->StewardshipFundId = $objReloaded->StewardshipFundId;\n\t\t\t$this->dttDateStarted = $objReloaded->dttDateStarted;\n\t\t\t$this->dttDateEnded = $objReloaded->dttDateEnded;\n\t\t\t$this->fltPledgeAmount = $objReloaded->fltPledgeAmount;\n\t\t\t$this->fltContributedAmount = $objReloaded->fltContributedAmount;\n\t\t\t$this->fltRemainingAmount = $objReloaded->fltRemainingAmount;\n\t\t\t$this->blnFulfilledFlag = $objReloaded->blnFulfilledFlag;\n\t\t\t$this->blnActiveFlag = $objReloaded->blnActiveFlag;\n\t\t}",
"public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t);\n\t\t}",
"public static function LoadByPersonIdStewardshipFundId($intPersonId, $intStewardshipFundId, $objOptionalClauses = null) {\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::AndCondition(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->PersonId, $intPersonId),\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId)\n\t\t\t\t)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}",
"public static function LoadArrayByStewardshipFundId($intStewardshipFundId, $objOptionalClauses = null) {\n\t\t\t// Call StewardshipPledge::QueryArray to perform the LoadArrayByStewardshipFundId query\n\t\t\ttry {\n\t\t\t\treturn StewardshipPledge::QueryArray(\n\t\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId),\n\t\t\t\t\t$objOptionalClauses\n\t\t\t\t\t);\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"public function findAllParticipantsAsSalespersonsByProviderAndPf($idProvider, $idPurchasingFair) {\r\r\n\r\r\n $result = array();\r\r\n $query = '\r\r\n SELECT DISTINCT(p.id_participant), p.civility_participant, p.surname_participant, p.name_participant, p.email_participant, p.date_deletion_participant\r\r\n FROM participant p \r\r\n INNER JOIN assignment_participant_enterprise ape ON ape.PARTICIPANT_id_participant = p.id_participant \r\r\n INNER JOIN enterprise e ON e.id_enterprise = ape.ENTERPRISE_id_enterprise \r\r\n INNER JOIN profile pr ON pr.id_profile = e.PROFILE_id_profile\r\r\n INNER JOIN assignment_sp_store ass ON ass.PARTICIPANT_id_participant = p.id_participant\r\r\n INNER JOIN purchasing_fair pf ON pf.id_purchasing_fair = ass.PURCHASING_FAIR_id_purchasing_fair\r\r\n WHERE pr.id_profile = 1 AND e.id_enterprise = ? AND p.date_deletion_participant IS NULL AND pf.id_purchasing_fair = ?\r\r\n ';\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute(array($idProvider, $idPurchasingFair));\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $civility, $surname, $name, $email, $dateDeletion ) = $row; // Like that $idParticipant = $row['id_participant'] etc.\r\r\n $newParticipant = new Participant($civility, $surname, $name, $email, $dateDeletion, $idParticipant);\r\r\n $result[] = $newParticipant; // Adds new Participant to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }",
"static function from_id($id){\r\n $db = new Database();\r\n $sql = \"select * from \" . Person::PERSON_TABLE . \" where id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $id);\r\n $stm->execute();\r\n $row = $stm->fetch();\r\n $person = new Person();\r\n $person->id = $id;\r\n //to pass validation, interests are loaded separately\r\n $row[\"interests\"] = array();\r\n\r\n //mysql datetime to right format conversion\r\n $db_date = DateTime::createfromformat(\"Y-m-d H:i:s\", $row[\"admission_date\"]);\r\n $row[\"admission_date\"] = $db_date->format(\"Y-m-d g:iA\");\r\n $row[\"admission_time\"] = $db_date->format(\"g:iA\");\r\n\r\n //load values into person properties\r\n $person->from_array($row);\r\n $person->load_interests();\r\n return $person;\r\n }",
"public function loadShips(): void {\n\t\t$sql = \"SELECT * FROM `npc_ship` WHERE `id_npc` = ?\";\n\t\t$this->db->query($sql, [$this->get('id')]);\n\t\t$ships = [];\n\t\twhile ($res = $this->db->next()){\n\t\t\t$npc_ship = new NPCShip();\n\t\t\t$npc_ship->update($res);\n\t\t\t$npc_ship->loadShip($this->get('margin'));\n\n\t\t\tarray_push($ships, $npc_ship);\n\t\t}\n\t\t$this->setShips($ships);\n\t}",
"public function populate()\n\t{\n\t\tif (!$this->index)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$records = $this->model->find(array_keys($this->index));\n\n\t\tforeach ($records as $nid => $record)\n\t\t{\n\t\t\t$this->index[$nid]->record = $record;\n\t\t}\n\n\t\treturn $records;\n\t}",
"function loadByPersonID( $personID )\n {\n $condition = 'person_id='.$personID;\n return $this->loadByCondition( $condition );\n }",
"private function save_interests(){\r\n $db = new Database();\r\n $sql = \"delete from \" . Person::PERSON_INTEREST_TABLE . \" where person_id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->execute();\r\n\r\n foreach($this->interests as $interest){\r\n $sql = \"insert into \" . Person::PERSON_INTEREST_TABLE . \" (person_id, interest_id) values (:person_id, :interest_id)\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->bindParam(':interest_id', $interest->id);\r\n $stm->execute();\r\n }\r\n $pi_stm = \"\";\r\n }",
"public function loadOfficialsForPerson($projectId,$personId)\n {\n $qbPersonPersons = $this->qbPersonPersons($projectId,$personId);\n \n // Build query\n $em = $this->getEntityManager();\n $qb = $em->createQueryBuilder();\n\n $qb->addSelect('person');\n $qb->addSelect('personRegistered');\n \n //$qb->addSelect('projectPerson');\n\n $qb->from('ZaysoCoreBundle:Person', 'person');\n $qb->leftJoin('person.personPersons', 'personPerson');\n $qb->leftJoin('person.registeredPersons', 'personRegistered'); // Limit to ayso\n \n //$qb->leftJoin('person.projectPersons', 'projectPerson');\n\n $qb->andWhere($qb->expr()->in('person.id',$qbPersonPersons->getDQL()));\n \n $qb->addOrderBy('person.nickName');\n $qb->addOrderBy('person.firstName');\n $qb->addOrderBy('person.lastName');\n\n $items = $qb->getQuery()->getResult();\n \n return $items;\n }",
"public function findAllParticipantsAsSalespersonsByProvider($idProvider) {\r\r\n\r\r\n $result = array();\r\r\n $query = '\r\r\n SELECT DISTINCT(p.id_participant), p.civility_participant, p.surname_participant, p.name_participant, p.email_participant, p.date_deletion_participant\r\r\n FROM participant p \r\r\n INNER JOIN assignment_participant_enterprise ape ON ape.PARTICIPANT_id_participant = p.id_participant \r\r\n INNER JOIN enterprise e ON e.id_enterprise = ape.ENTERPRISE_id_enterprise \r\r\n INNER JOIN profile pr ON pr.id_profile = e.PROFILE_id_profile \r\r\n WHERE pr.id_profile = 1 AND e.id_enterprise = ? AND p.date_deletion_participant IS NULL';\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute(array($idProvider));\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $civility, $surname, $name, $email, $dateDeletion ) = $row; // Like that $idParticipant = $row['id_participant'] etc.\r\r\n $newParticipant = new Participant($civility, $surname, $name, $email, $dateDeletion, $idParticipant);\r\r\n $result[] = $newParticipant; // Adds new Participant to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }",
"public function testLoadUpdatesOnly()\n {\n $nz = Country::get()->find('Code','NZ');\n $au = Country::get()->find('Code','AU');\n\n Person::create(array(\"FirstName\" => \"joe\", \"Surname\" => \"Kiwi\", \"Age\" => \"62\", \"CountryID\" => $nz->ID))->write();\n Person::create(array(\"FirstName\" => \"bruce\", \"Surname\" => \"Aussie\", \"Age\" => \"24\", \"CountryID\" => $au->ID))->write();\n\n $this->assertEquals(2, Person::get()->Count(), \"Two people exist in Person class\");\n \n $loader = new BetterBulkLoader(Person::class);\n $loader->addNewRecords = false; // don't add new records from source\n $loader->columnMap = array(\n \"firstname\" => \"FirstName\",\n \"surname\" => \"Surname\",\n \"age\" => \"Age\",\n \"country\" => \"Country.Code\"\n );\n $loader->transforms = array(\n \"Country.Code\" => array(\n \"link\" => true, //link up to existing relations\n \"create\" => false //don't create new relation objects\n )\n );\n $loader->duplicateChecks = array(\n \"FirstName\"\n );\n //set the source data. Joe has aged one year and shifted to Australia. Bruce has aged a year too, but is missing other elements, which should remain the same.\n $data = array(\n array(\"firstname\" => \"joe\", \"surname\" => \"Kiwi\", \"age\" => \"63\", \"country\" => \"AU\"),\n array(\"firstname\" => \"bruce\", \"age\" => \"25\"),\n array(\"firstname\" => \"NotEntered\", \"surname\" => \"should not be entered\", \"age\" => \"33\", \"country\" => \"NZ\"),\n array(\"firstname\" => \"NotEntered2\", \"surname\" => \"should not be entered as well\", \"age\" => \"24\", \"country\" => \"AU\")\n );\n $loader->setSource(new ArrayBulkLoaderSource($data));\n \n $results = $loader->load();\n $this->assertEquals($results->CreatedCount(), 0);\n $this->assertEquals($results->UpdatedCount(), 2);\n $this->assertEquals($results->SkippedCount(), 2);\n $this->assertEquals($results->Count(), 2);\n \n $this->assertEquals(2, Person::get()->Count(), 'Should be two instances');\n $this->assertNull(Person::get()->find('FirstName', 'NotEntered'), 'New item \"NotEntered\" should not be added to Person');\n $this->assertNull(Person::get()->find('FirstName', 'NotEntered2'), 'New item \"NotEntered2\" should not be added to Person');\n\n $joe = Person::get()->find('FirstName', 'joe');\n $this->assertSame('63', $joe->Age, 'Joe should have the age of 63');\n $this->assertSame('Australia', $joe->Country()->Title, 'Joe should have the CountryID assigned to Australia');\n\n $bruce = Person::get()->find('FirstName', 'bruce');\n $this->assertSame('25', $bruce->Age, 'Bruce should have aged by one year to 25');\n $this->assertSame('Aussie', $bruce->Surname, 'Bruce should still have the surname of Aussie');\n $this->assertSame('Australia', $bruce->Country()->Title, 'Bruce should still have the CountryID assigned for Australia');\n }",
"public function pledges()\n {\n return $this->hasManyThrough('App\\Pledge', 'pledges_tbl');\n }",
"function getRefpoolDatabank($pid,$limit)\n\t\t {\n\t\t $data = array();\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->select('candidates.id As cid');\n\t\t\t$this->db->from('pof_candidates');\n\t\t\t$this->db->join('candidates','pof_candidates.cand_id=candidates.id');\n\t\t\t$this->db->join('files', 'candidates.id=files.cand', 'left');\n\t\t\t$this->db->where('pof_candidates.pofid',$pid);\n\t\t\t$this->db->where('pof_candidates.stage','287');\n\t\t\t$this->db->group_by('pof_candidates.cand_id');\n\t\t\t$this->db->limit(20,$limit);\n\t\t\t$q = $this->db->get();\n\t\t\tif($q->num_rows()>0)\n\t\t\t {\n\t\t\t foreach($q->result() as $row)\n\t\t\t {\n\t\t\t $data[] = $row;\n\t\t\t }\n\t\t\t return $data;\n\t\t\t }\n\t\t\t }",
"function load() {\n\n $directory = array();\n\n $dm = $this->get('doctrine.odm.mongodb.document_manager');\n\n $families = $dm->createQueryBuilder('Ecc12PRHomeBundle:Family')\n ->sort('name', 'asc')\n ->getQuery()\n ->execute();\n\n foreach($families as $family) {\n $family_id = $family->getId();\n $directory[$family_id] = array(\n 'id' => $family->getId(),\n 'name' => $family->getName(),\n 'address_1' => $family->getAddress1(),\n 'address_2' => $family->getAddress2(),\n 'city' => $family->getCity(),\n 'state' => $family->getState(),\n 'zipcode' => $family->getZipcode(),\n 'country' => $family->getCountry(),\n 'phone' => $family->getPhone(),\n 'email' => $family->getEmail(),\n 'people' => array()\n );\n\n if($in_mode == \"detail\") {\n foreach($family->getPeople() as $person) {\n $person = array(\n 'id' => $person->getId(),\n 'first_name' => $person->getFirstName(),\n 'last_name' => $person->getLastName(),\n 'sort' => $person->getSort(),\n 'type' => $person->getType(),\n 'relationship' => $person->getRelationship(),\n 'email' => $person->getEmail(),\n 'phone' => $person->getPhone(),\n 'birthday' => $person->getBirthday()?\n $person->getBirthday()->format('c'):false,\n 'anniversary' => $person->getAnniversary()?\n $person->getAnniversary()->format('c'):false,\n );\n $directory[$family_id]['people'][\n \"$person[sort]_$person[first_name]$person[last_name]\"] = $person;\n }\n }\n }\n\n\n\n }",
"function loadByScholarshipID( $scholarshipID )\n {\n $condition = 'scholarship_id='.$scholarshipID;\n return $this->loadByCondition( $condition );\n }",
"function read_roster($roundid) {\n global $db;\n $roster = array();\n $stmt = $db->prepare('SELECT rosterid, Roster.racerid FROM Roster'\n .' INNER JOIN RegistrationInfo'\n .' ON Roster.racerid = RegistrationInfo.racerid'\n .' WHERE roundid = :roundid'\n .' AND passedinspection = 1'\n .' ORDER BY rosterid');\n $stmt->execute(array(':roundid' => $roundid));\n foreach ($stmt as $row) {\n $roster[] = $row['racerid'];\n }\n return $roster;\n}",
"public static function getMembershipCollection($personId) {\n $result1 = DB::select(\"SELECT V.user_id, V.participant_id, V.participant_type, \" .\n \"V.name, V.street, V.neighborhood, V.pic_small, V.pic_large, V.description \" . \n \"FROM group_member INNER JOIN view_participant V ON group_member.group_id = V.participant_id \" .\n \"INNER JOIN member ON member.member_id = V.participant_id \" .\n \"WHERE group_member.person_id = ? \" . \n \"AND group_member.watching_only = 0 \" . \n \"AND group_member.approved = 1\", array($personId));\n $result2 = DB::select(\"SELECT V.user_id, V.participant_id, V.participant_type, \" .\n \"V.name, V.street, V.neighborhood, V.pic_small, V.pic_large, V.description \" . \n \"FROM group_member INNER JOIN view_participant V ON group_member.group_id = V.participant_id \" .\n \"INNER JOIN member ON member.member_id = V.participant_id \" .\n \"WHERE group_member.person_id = ? \" . \n \"AND group_member.watching_only = 1 \" . \n \"\", array($personId));\n $result3 = DB::select(\"SELECT V.user_id, V.participant_id, V.participant_type, \" .\n \"V.name, V.street, V.neighborhood, V.pic_small, V.pic_large, V.description \" . \n \"FROM group_member INNER JOIN view_participant V ON group_member.group_id = V.participant_id \" .\n \"INNER JOIN member ON member.member_id = V.participant_id \" .\n \"WHERE group_member.person_id = ? \" . \n \"AND group_member.watching_only = 0 \" . \n \"AND group_member.approved = 0\", array($personId));\n $result = array_merge($result1, $result2, $result3);\n return $result;\n }",
"function getProposalViaStudentId($id) {\n $sql = \"SELECT *\n FROM proposal\n WHERE studentid = :id\";\n \n $stmt = $this->db->prepare($sql);\n $stmt->bindParam(\"id\", $id);\n $stmt->execute(); \n $row_count = $stmt->rowCount();\n $data = array();\n $proposal = new Proposal();\n \n if ($row_count)\n {\n while($row = $stmt->fetch(PDO::FETCH_ASSOC))\n {\n $proposal = new Proposal();\n $proposal->id = $row['id'];\n $proposal->studentid = $row['studentid'];\n $proposal->title = $row['title'];\n $proposal->type = $row['type'];\n $proposal->status = $row['status']; \n \n array_push($data, $proposal);\n }\n }\n \n return $data;\n }",
"public function loadPublications() {\n $this->_publications = DAOFactory::getPublicationDAO()->selectByIdPerson($this->_id);\n }",
"public static function LoadById($intId, $objOptionalClauses = null) {\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}",
"public function points($params) {\r\n ini_set(\"memory_limit\", \"-1\");\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n $mySearchParams = [];\r\n if (!empty($params['PenaltyPointsSearch'])) {\r\n $mySearchParams = $params['PenaltyPointsSearch'];\r\n $mySearchParams = array_filter($mySearchParams);\r\n }\r\n\r\n $connection = new \\MongoClient(Yii::$app->mongodb->dsn);\r\n $database = $connection->deepdive;\r\n $collection = $database->week_penalty_master;\r\n $cursors = $collection->find($mySearchParams);\r\n $penaltyPoints = array();\r\n foreach ($cursors as $cursor) {\r\n $penaltyPoints[] = $cursor;\r\n }\r\n $recordWithSetPoints = self::setPoints($penaltyPoints);\r\n // add conditions that should always apply here\r\n $penaltyPointsProvider = new ArrayDataProvider([\r\n 'allModels' => $recordWithSetPoints,\r\n 'pagination' => ['pageSize' => 20]\r\n ]);\r\n\r\n $this->load($params);\r\n return $penaltyPointsProvider;\r\n }",
"function getPersons(){\n\t\t \n\t\t $linksObj = new dbXML_dbLinks;\n\t\t $creatorRels = $linksObj->relToCreator;\n\t\t $contribRels = $linksObj->relToContributor;\n\t\t \n\t\t $db = $this->startDB();\n\t\t $result = false;\n\t\t \n\t\t $sql = \"SELECT actTab.uuid, links.targ_uuid, links.link_type,\n\t\t persons.combined_name, persons.last_name, persons.first_name, persons.mid_init\n\t\t FROM \".$this->penelopeTabID.\" AS actTab\n\t\t JOIN links ON actTab.uuid = links.origin_uuid\n\t\t JOIN persons ON persons.uuid = links.targ_uuid\n\t\t WHERE links.targ_type LIKE '%person%' ;\n\t\t \";\n\t\t \n\t\t $resultA = $db->fetchAll($sql);\n\t\t \n\t\t $sql =\t\"\t\n\t\t\t\tSELECT actTab.uuid, links.targ_uuid, links.link_type, \n\t\t\t\tusers.combined_name, users.last_name, users.first_name, users.mid_init\n\t\t\t\tFROM \".$this->penelopeTabID.\" AS actTab\n\t\t\t\tJOIN links ON actTab.uuid = links.origin_uuid\n\t\t\t\tJOIN users ON users.uuid = links.targ_uuid\n\t\t\t\tWHERE links.targ_type LIKE '%person%'\n\t\t\t\t \n\t\t\t\t\";\n\t\t \n\t\t $resultB = $db->fetchAll($sql);\n\t\t if($resultA && $resultB){\n\t\t\t\t$result = array();\n\t\t\t\tforeach($resultA as $row){\n\t\t\t\t\t $ukey = md5($row[\"uuid\"].$row[\"targ_uuid\"].$row[\"link_type\"]);\n\t\t\t\t\t $result[$ukey] = $row;\n\t\t\t\t}\n\t\t\t\tforeach($resultB as $row){\n\t\t\t\t\t $ukey = md5($row[\"uuid\"].$row[\"targ_uuid\"].$row[\"link_type\"]);\n\t\t\t\t\t if(!array_key_exists($ukey, $result)){\n\t\t\t\t\t\t $result[$ukey] = $row;\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t elseif($resultB && !$resultA){\n\t\t\t\t$result = $resultB;\n\t\t }\n\t\t elseif(!$resultB && $resultA){\n\t\t\t\t$result = $resultA;\n\t\t }\n\t\t \n\t\t if($result){\n\t\t\t\t\n\t\t\t\t$rawCreators = array();\n\t\t\t\t$rawContributors = array();\n\t\t\t\t$persons = array();\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t $uuid = $row[\"targ_uuid\"];\n\t\t\t\t\t $uri = self::personBaseURI.$uuid;\n\t\t\t\t\t $name = $row[\"combined_name\"];\n\t\t\t\t\t $linkType = $row[\"link_type\"];\n\t\t\t\t\t if(in_array($linkType, $creatorRels)){\n\t\t\t\t\t\t if(!array_key_exists($uri, $rawCreators)){\n\t\t\t\t\t\t\t\t$rawCreators[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t\t\t$rawCreators[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t$rawCreators[$uri][\"count\"] ++ ; \n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t elseif(in_array($linkType, $contribRels)){\n\t\t\t\t\t\t if(!array_key_exists($uri, $rawContributors)){\n\t\t\t\t\t\t\t\t$rawContributors[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t\t\t$rawContributors[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t$rawContributors[$uri][\"count\"] = $rawContributors[$uri][\"count\"] + 1; \n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if(!array_key_exists($uri, $persons)){\n\t\t\t\t\t\t $persons[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t $persons[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t\t $persons[$uri][\"count\"] ++ ; \n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//combine URIs for the same person, choose the URI with the most associated items\n\t\t\t\t$rawCreators = $this->consolidateRelatedURIs($rawCreators);\n\t\t\t\t$rawContributors = $this->consolidateRelatedURIs($rawContributors);\n\t\t\t\t$persons = $this->consolidateRelatedURIs($persons);\n\t\t\t\t\n\t\t\t\t//sort the array by count, from high to low\n\t\t\t\t$rawCreators = $this->orderURIs($rawCreators);\n\t\t\t\t$rawContributors = $this->orderURIs($rawContributors);\n\t\t\t\t$persons = $this->orderURIs($persons);\n\t\t\t\t\n\t\t\t\t$this->rawCreators = $rawCreators;\n\t\t\t\t$this->rawContributors = $rawContributors;\n\t\t\t\t$this->rawLinkedPersons = $persons;\n\t\t\t\t\n\t\t }\n\t }",
"private function loadAllFacilities(){\n $sql=\"SELECT f.id,f.facility name,f.dhis2_name,f.hub_id,\n h.ip_id, f.district_id,f.dhis2_uid,d.dhis2_uid as district_uid \n FROM backend_facilities f \n left join backend_hubs h on f.hub_id = h.id \n left join backend_districts d on d.id = f.district_id\";\n\n $facilities_array = $this->db->select($sql);\n\n $this->mongo->facilities->drop();\n \n foreach($facilities_array AS $row){\n $data=[\n 'id'=>$row->id,\n 'name'=>$row->name,\n 'dhis2_name'=>$row->dhis2_name,\n 'hub_id'=>$row->hub_id,\n 'ip_id'=>$row->ip_id,\n\n 'district_id'=>$row->district_id,\n 'dhis2_uid'=>$row->dhis2_uid,\n 'district_uid'=>$row->district_uid,\n 'updated'=>'done'\n ];\n $this->mongo->facilities->insert($data);\n }\n\n }",
"function &getByObjectForReview($objectId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT * FROM object_for_review_persons WHERE object_id = ? ORDER BY seq',\n\t\t\t(int) $objectId\n\t\t);\n\n\t\t$persons = array();\n\t\twhile (!$result->EOF) {\n\t\t\t$persons[] =& $this->_fromRow($result->GetRowAssoc(false));\n\t\t\t$result->MoveNext();\n\t\t}\n\t\t$result->Close();\n\t\treturn $persons;\n\t}",
"public function LoadSponsorIdsAndCredits() {\n $q = \"SELECT sponsorId,credits FROM DriverSponsorRelations WHERE driverId={$this->GetID()};\";\n $qresult = $this->db->sql->query($q);\n\n if ($qresult && $qresult->num_rows > 0) {\n for ($row = $qresult->fetch_assoc(); $row !== NULL; $row = $qresult->fetch_assoc()) {\n $id = $row[\"sponsorId\"];\n array_push($this->sponsorIds, $id);\n $this->credits[$id] = $row[\"credits\"];\n }\n\n $qresult->free();\n }\n else if (!$qresult) {\n return false;\n }\n\n return true;\n }",
"protected /*array<int, int>*/ function getGradersForAssignment(/*int*/ $aid)\n\t{\n\t\t// Get assignment information.\n\t\t$assignment = $this->getAssignment($aid);\n\n\t\tif($assignment === null)\n\t\t\treturn null;\n\n\t\t// Get graders for student's in assignment's section.\n\t\t$query = $this->db->prepare(\"SELECT * FROM `graders` JOIN `students` ON `graders`.`studentid` = `students`.`id` WHERE `section` = ?;\")->execute($assignment['section']);\n\t\t$graders = array();\n\n\t\tforeach($query as $row)\n\t\t\t$graders[$row['studentid']] = $row['userid'];\n\n\t\t// Get overrides for the assignment.\n\t\t$query = $this->db->prepare(\"SELECT * FROM `graders_override` WHERE `assignmentid` = ?;\")->execute($aid);\n\n\t\tforeach($query as $row)\n\t\t\t$graders[$row['studentid']] = $row['userid'];\n\n\t\treturn $graders;\n\t}",
"function loadPending($startpoint=null,$limit=null){\r\n$sql=\"SELECT DISTINCT birth_info.*, general_info.surname, general_info.othernames FROM birth_info, general_info WHERE birth_info.status='pending' AND general_info.c_id=birth_info.c_id \";\r\nreturn array_slice($this->query($sql),$startpoint,$limit);\r\n}"
] |
[
"0.60512644",
"0.51313585",
"0.508661",
"0.4990495",
"0.4921632",
"0.4902312",
"0.46427768",
"0.4635915",
"0.4611502",
"0.46062213",
"0.4598496",
"0.4594416",
"0.45610768",
"0.453081",
"0.4528327",
"0.45259276",
"0.45133382",
"0.450265",
"0.44464606",
"0.44460982",
"0.4429541",
"0.44130018",
"0.44070894",
"0.43881047",
"0.43758807",
"0.437557",
"0.4371249",
"0.43607062",
"0.4338925",
"0.4337158"
] |
0.54992783
|
1
|
Load an array of StewardshipPledge objects, by StewardshipFundId Index(es)
|
public static function LoadArrayByStewardshipFundId($intStewardshipFundId, $objOptionalClauses = null) {
// Call StewardshipPledge::QueryArray to perform the LoadArrayByStewardshipFundId query
try {
return StewardshipPledge::QueryArray(
QQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId),
$objOptionalClauses
);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StewardshipPledge object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StewardshipPledge::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->PersonId = $objReloaded->PersonId;\n\t\t\t$this->StewardshipFundId = $objReloaded->StewardshipFundId;\n\t\t\t$this->dttDateStarted = $objReloaded->dttDateStarted;\n\t\t\t$this->dttDateEnded = $objReloaded->dttDateEnded;\n\t\t\t$this->fltPledgeAmount = $objReloaded->fltPledgeAmount;\n\t\t\t$this->fltContributedAmount = $objReloaded->fltContributedAmount;\n\t\t\t$this->fltRemainingAmount = $objReloaded->fltRemainingAmount;\n\t\t\t$this->blnFulfilledFlag = $objReloaded->blnFulfilledFlag;\n\t\t\t$this->blnActiveFlag = $objReloaded->blnActiveFlag;\n\t\t}",
"public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t);\n\t\t}",
"public static function LoadByPersonIdStewardshipFundId($intPersonId, $intStewardshipFundId, $objOptionalClauses = null) {\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::AndCondition(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->PersonId, $intPersonId),\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId)\n\t\t\t\t)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}",
"private function load_interests(){\r\n $db = new Database();\r\n $sql = \"select * from \" . Person::PERSON_INTEREST_TABLE . \" where person_id=:person_id\";\r\n $stm = $db->pdo->prepare($sql);\r\n $stm->bindParam(':person_id', $this->id);\r\n $stm->execute();\r\n $its = $stm->fetchAll();\r\n foreach($its as $it){\r\n $this->interests[] = Interest::with_id($it[\"interest_id\"]);\r\n }\r\n }",
"function loadByScholarshipID( $scholarshipID )\n {\n $condition = 'scholarship_id='.$scholarshipID;\n return $this->loadByCondition( $condition );\n }",
"public static function LoadById($intId, $objOptionalClauses = null) {\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}",
"public function loadShips(): void {\n\t\t$sql = \"SELECT * FROM `npc_ship` WHERE `id_npc` = ?\";\n\t\t$this->db->query($sql, [$this->get('id')]);\n\t\t$ships = [];\n\t\twhile ($res = $this->db->next()){\n\t\t\t$npc_ship = new NPCShip();\n\t\t\t$npc_ship->update($res);\n\t\t\t$npc_ship->loadShip($this->get('margin'));\n\n\t\t\tarray_push($ships, $npc_ship);\n\t\t}\n\t\t$this->setShips($ships);\n\t}",
"function getBalancesForRestaurants($restaurants_ids_array) {\r\n $balances_for_restaurants = array();\r\n \r\n DB::useDB(B2B_B2C_COMMON);\r\n $balances = DB::query(\"SELECT id, balance from restaurant_balance WHERE id IN(\" . implode(\",\", $restaurants_ids_array) . \")\");\r\n// echo '<pre>'; var_dump($balances); echo '</pre>';\r\n \r\n foreach($restaurants_ids_array as $rest_id) {\r\n foreach($balances as $balance) {\r\n if($rest_id == $balance[\"id\"]) {\r\n $balances_for_restaurants[$balance[\"id\"]] = $balance[\"balance\"];\r\n }\r\n }\r\n }\r\n \r\n echo '<pre>'; var_dump($balances_for_restaurants); echo '</pre>';\r\n return $balances_for_restaurants;\r\n}",
"public function findAllParticipantsAsSalespersonsByProviderAndPf($idProvider, $idPurchasingFair) {\r\r\n\r\r\n $result = array();\r\r\n $query = '\r\r\n SELECT DISTINCT(p.id_participant), p.civility_participant, p.surname_participant, p.name_participant, p.email_participant, p.date_deletion_participant\r\r\n FROM participant p \r\r\n INNER JOIN assignment_participant_enterprise ape ON ape.PARTICIPANT_id_participant = p.id_participant \r\r\n INNER JOIN enterprise e ON e.id_enterprise = ape.ENTERPRISE_id_enterprise \r\r\n INNER JOIN profile pr ON pr.id_profile = e.PROFILE_id_profile\r\r\n INNER JOIN assignment_sp_store ass ON ass.PARTICIPANT_id_participant = p.id_participant\r\r\n INNER JOIN purchasing_fair pf ON pf.id_purchasing_fair = ass.PURCHASING_FAIR_id_purchasing_fair\r\r\n WHERE pr.id_profile = 1 AND e.id_enterprise = ? AND p.date_deletion_participant IS NULL AND pf.id_purchasing_fair = ?\r\r\n ';\r\r\n\r\r\n try {\r\r\n $this->pdo->beginTransaction(); // Start transaction\r\r\n $qresult = $this->pdo->prepare($query); \r\r\n $qresult->execute(array($idProvider, $idPurchasingFair));\r\r\n $this->pdo->commit(); // If all goes well the transaction is validated\r\r\n\r\r\n while( $row = $qresult->fetch() ) {\r\r\n list ( $idParticipant, $civility, $surname, $name, $email, $dateDeletion ) = $row; // Like that $idParticipant = $row['id_participant'] etc.\r\r\n $newParticipant = new Participant($civility, $surname, $name, $email, $dateDeletion, $idParticipant);\r\r\n $result[] = $newParticipant; // Adds new Participant to array\r\r\n }\r\r\n\r\r\n // $this->pdo = NULL;\r\r\n return $result;\r\r\n }\r\r\n catch(Exception $e) // In case of error\r\r\n {\r\r\n // The transaction is cancelled\r\r\n $this->pdo->rollback();\r\r\n\r\r\n // An error message is displayed\r\r\n print 'Tout ne s\\'est pas bien passé, voir les erreurs ci-dessous<br />';\r\r\n print 'Erreur : '.$e->getMessage().'<br />';\r\r\n print 'N° : '.$e->getCode();\r\r\n\r\r\n // Execution of the code is stopped\r\r\n die();\r\r\n }\r\r\n }",
"public function index($finance_id)\n {\n $finance = Finance::findOrFail($finance_id);\n\n $payments = $finance->paymentsMade;\n\n return $this->showApiCollection(PaymentMadeResource::collection($payments));\n }",
"public function loadFeeByBankCardTypeID($cardTypeID, $bankID)\n {\n //$this->loadFeeByID(fee.ID);\n \n }",
"public function getAnalystBalanceSheet($loanId)\n {\n $loan = null;\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n }\n $endUseList = null;\n $loanType = null;\n $amount = null;\n $loanTenure = null;\n if (isset($loan)) {\n $loanType = $loan->type;\n $amount = $loan->loan_amount;\n $loanTenure = $loan->loan_tenure;\n $endUseList = $loan->end_use;\n if ($loan->companySharePledged != '' && $loan->bscNscCode != '') {\n @$companySharePledged = $loan->companySharePledged;\n @$bscNscCode = $loan->bscNscCode;\n }\n }\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_BS');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $financialDataRecords = BalanceSheet::where('loan_id', '=', $loanId)->get();\n $financialDataMap = new Collection();\n //dd($financialGroups, $financialDataRecords);\n foreach ($financialDataRecords as $financialData) {\n $financialDataMap->offsetSet($financialData->period, $financialData);\n }\n $helper = new ExpressionHelper($loanId);\n $financialDataExpressionsMap = $helper->calculateBalanceSheetFormulae();\n $subViewType = 'loans.financial._analyst_financial_info';\n $formaction = 'Loans\\LoansController@postAnalystBalanceSheet';\n $validLoanHelper = new validLoanUrlhelper();\n $isPL = false;\n $setDisable = null;\n $user = Auth::getUser();\n $setDisable = $this->getIsDisabled($user, true);\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n return view('loans.createedit', compact(\n 'subViewType',\n 'endUseList',\n 'loan',\n 'loanId',\n 'formaction',\n 'loanType',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'bl_year',\n 'financialGroups',\n 'groupType',\n 'financialDataExpressionsMap',\n 'financialDataMap',\n 'isPL',\n 'validLoanHelper',\n 'setDisable',\n 'loanUserProfile',\n 'userProfileFirm',\n 'companySharePledged',\n 'bscNscCode'\n ));\n }",
"public static function LoadArrayByPersonId($intPersonId, $objOptionalClauses = null) {\n\t\t\t// Call StewardshipPledge::QueryArray to perform the LoadArrayByPersonId query\n\t\t\ttry {\n\t\t\t\treturn StewardshipPledge::QueryArray(\n\t\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->PersonId, $intPersonId),\n\t\t\t\t\t$objOptionalClauses\n\t\t\t\t\t);\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"private function loadAllFacilities(){\n $sql=\"SELECT f.id,f.facility name,f.dhis2_name,f.hub_id,\n h.ip_id, f.district_id,f.dhis2_uid,d.dhis2_uid as district_uid \n FROM backend_facilities f \n left join backend_hubs h on f.hub_id = h.id \n left join backend_districts d on d.id = f.district_id\";\n\n $facilities_array = $this->db->select($sql);\n\n $this->mongo->facilities->drop();\n \n foreach($facilities_array AS $row){\n $data=[\n 'id'=>$row->id,\n 'name'=>$row->name,\n 'dhis2_name'=>$row->dhis2_name,\n 'hub_id'=>$row->hub_id,\n 'ip_id'=>$row->ip_id,\n\n 'district_id'=>$row->district_id,\n 'dhis2_uid'=>$row->dhis2_uid,\n 'district_uid'=>$row->district_uid,\n 'updated'=>'done'\n ];\n $this->mongo->facilities->insert($data);\n }\n\n }",
"public function userConsolidatedBalances($userid){\n\n //recalculate loan Balances\n $consolidatedLoanDeductions = Userconsolidatedloan::\n where('user_id',$userid)\n ->orderBy('date_entry', 'asc')\n ->orderBy('entry_time', 'asc')\n ->get();\n\n //loop to update balances to zero\n foreach($consolidatedLoanDeductions as $item){\n $deductItem = Userconsolidatedloan::find($item->id);\n $deductItem->balance = 0.0;\n $deductItem->save();\n }\n\n //loop to update actual Balances\n foreach($consolidatedLoanDeductions as $item){\n\n //1. select all records based on that date\n $loanDeductionsByDate = $consolidatedLoanDeductions\n ->where('date_entry','=',$item->date_entry)\n ->sortBy('id');\n\n //2. check if there is more than 1 records\n if($loanDeductionsByDate->count() > 1){\n //find all deductions less than this date\n $loanDeductionsLessDate = $consolidatedLoanDeductions\n ->where('date_entry','<',$item->date_entry)\n ->sortBy('date_entry');\n //find the total balance\n $credit = $loanDeductionsLessDate->sum('credit');\n $debit = $loanDeductionsLessDate->sum('debit');\n $lessDateBalance = $debit - $credit;\n\n //enter foreach loop\n foreach($loanDeductionsByDate as $deduction){\n $loanDeductionsByDateFilter = $loanDeductionsByDate->where('id','<',$deduction->id);\n\n $credit = $loanDeductionsByDateFilter->sum('credit');\n $debit = $loanDeductionsByDateFilter->sum('debit');\n $filterDateBalance = $debit - $credit;\n //add filter date balance with less balance and update new balance for that row\n\n //find individual row\n $deductItem = Userconsolidatedloan::find($deduction->id);\n $credit = $deductItem->credit;\n $debit = $deductItem->debit;\n $diffBal = $debit - $credit;\n $deductItem->balance = $lessDateBalance + $filterDateBalance + $diffBal;\n $deductItem->save();\n }\n\n }\n else\n {\n\n //total loan Balances\n $loanBalances = $this->initialConsolidatedLoanBalances($item->user_id,$item->date_entry);\n\n //find individual row\n $deductItem = Userconsolidatedloan::find($item->id);\n $credit = $deductItem->credit;\n $debit = $deductItem->debit;\n $myBal = $debit-$credit;\n $deductItem->balance = $loanBalances + $myBal;\n $deductItem->save();\n }\n\n }\n\n }",
"public function getAll(){\n $lijst = array();\n \n $dbh = new PDO(DBConfig::$DB_CONNSTRING, DBConfig::$DB_USERNAME, DBConfig::$DB_PASSWORD);\n $sql = \"SELECT frisdrankId, naam, prijs, aantal FROM mvc_frisdrank\";\n $resultSet = $dbh->query($sql);\n foreach ($resultSet as $rij) {\n $frisdrank = Frisdrank::create($rij[\"frisdrankId\"], $rij[\"naam\"], $rij[\"prijs\"], $rij[\"aantal\"]);\n array_push($lijst, $frisdrank);\n }\n $dbh = null;\n return $lijst;\n }",
"public function supplemental_draft($round)\r\n\t{\t\r\n\t\t$this->Database_Manager->database_backup(array('Draft_Picks'));\r\n\t\t$this->Database_Manager->database_backup(array('Drafts'));\r\n\t\t$this->Database_Manager->database_backup(array('Players'));\r\n\t\t$this->Database_Manager->database_backup(array('Rosters','Supplemental_Selections'));\r\n\r\n\t\t\r\n\t\t$draft_order = $this->Drafts->get_draft_results_year($this->league_id,$this->current_year);\r\n\t\t//get the id and start time for this draft\r\n\t\tforeach($draft_order['Supplemental'] as $draft_id => $draft_data){\r\n\t\t\t$start_time = $draft_data['start_time'];\r\n\t\t}\r\n\t\t//work the array down until we have just the first or second half of the draft order, depending on which round it is\r\n\t\t$draft_order = array_pop($draft_order['Supplemental']);\r\n\t\t$draft_order=$draft_order['picks'];\r\n\t\t$half = floor(count($draft_order)/2);\r\n\t\t$draft_order = array_chunk($draft_order,$half);\r\n\t\t$draft_order=$draft_order[$round-1];\r\n\t\t//go through each pick\r\n\t\tforeach($draft_order as $pick_minus_1 => $pick_data) {\r\n\t\t\t$team_selection = $this->db->where('team_id',$pick_data['team_id'])\r\n\t\t\t\t\t\t\t->order_by('priority','ASC')\r\n\t\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t\t->get('Supplemental_Selections');\r\n\t\t\tif($team_selection->num_rows()>0){\r\n\t\t\t\t//there's a player selected, proceed with the selection\r\n\t\t\t\tforeach($team_selection->result_array() as $selection){\r\n\t\t\t\t\techo ($pick_minus_1+1).'. '.team_name_link($pick_data['team_id']).' '.player_name_link($selection['fffl_player_id']).'<br>';\r\n\t\t\t\t\t//check to make sure it's time for this draft before making selections\r\n\t\t\t\t\tif($start_time< now()){\r\n\t\t\t\t\t\t//update the draft_picks table where pick_id matches\r\n\t\t\t\t\t\t$this->db->set('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->where('pick_id',$pick_data['pick_id'])\r\n\t\t\t\t\t\t\t\t->update('Draft_Picks');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//get the free agent salary for this player to set as the salary for the new team\r\n\t\t\t\t\t\t$salary = $this->Salaries->get_free_agent_salary($selection['fffl_player_id']);\r\n\t\t\t\t\t\t//get player position\r\n\t\t\t\t\t\t$player_info = $this->Players->get_player_info(array($selection['fffl_player_id']),\"fffl_player_id\",\"position\");\r\n\t\t\t\t\t\t$position = $player_info['position'];\r\n\t\t\t\t\t\t//add to roster using salary\r\n\t\t\t\t\t\t$this->db->set('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->set('team_id',$pick_data['team_id'])\r\n\t\t\t\t\t\t\t\t->set('salary',$salary)\r\n\t\t\t\t\t\t\t\t->set('position', $position)\r\n\t\t\t\t\t\t\t\t->set('lineup_area','Roster')\r\n\t\t\t\t\t\t\t\t->insert('Rosters');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//delete any request in the supplemental selections for this player\r\n\t\t\t\t\t\t$this->db->where('fffl_player_id',$selection['fffl_player_id'])\r\n\t\t\t\t\t\t\t\t->delete('Supplemental_Selections');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}//end if team has selections > 0\r\n\t\t\t//there isn't a palyer ot pick, pass the team.\r\n\t\t\telse{\r\n\t\t\t\t//************************THIS IS OLD CODE FROM THE OLD SITE THAT MANAGED COMPENSATORY PICKS. ONLY NECESSARY TO REDO THIS CODE IF WE REINSTITUTE COMPENSATORY PICKS*************************//\r\n\t\t\t\t\t\t\t\t//There's no player to pick, so the team passes and (THIS USED TO GIVE A COMPENSATORY PICK) //needs a compensatory pick assigned\r\n\t\t\t\t\t\t\t\t$teamId=$pick_data['team_id'];\r\n\t\t\t\t\t\t\t\t//update the draft_picks table where pick_id matches\r\n\t\t\t\t\t\t\t\t$this->db->set('fffl_player_id',0)\r\n\t\t\t\t\t\t\t\t\t\t->where('pick_id',$pick_data['pick_id'])\r\n\t\t\t\t\t\t\t\t\t\t->update('Draft_Picks');\r\n\t\t\t\t\t\t\t\t//Below is what used to award a compensatory pick to a passing team\r\n\t\t\t\t\t\t\t\t/*if($s==0) { //This is the first of a new pair of passing teams. The first in the pair gets lined up with his drafting day.\r\n\t\t\t\t\t\t\t\t\tif($draftorder[$i]['pos']<11) {\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$s=2; //s=2 means the next guy gets a Saturday pick\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental+10;\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental-10;\r\n\t\t\t\t\t\t\t\t\t\t$s=1; //s=1 means the next guy gets a Friday pick\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"INSERT into SupplementalDrafts values($CurSeasonId,\".$draftorder[$i]['pick'].\",\".$draftorder[$i]['team'].\",0)\");\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t} else { //This is the second passer in a pair, he gets put on the other day from the team above when s=0.\r\n\t\t\t\t\t\t\t\t\tif($s==1) { //This team gets a fRiday pick\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' and originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\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\t\r\n\t\t\t\t\t\t\t\t\t} else if($s==2) { //This team gets a Saturday pick\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental+10;\r\n\t\t\t\t\t\t\t\t\t\t$sql2 = mysql_query(\"UPDATE draft_picks SET round=2, Supplemental='$supplemental' WHERE curOwner='$teamId' originalOwner='$originalOwner' and season='$CurSeasonId' and Supplemental>0\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$supplemental=$supplemental-10;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$sql = mysql_query(\"INSERT into SupplementalDrafts values($CurSeasonId,\".$draftorder[$i]['pick'].\",\".$draftorder[$i]['team'].\",0)\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$s=0; //the next passer will get put with his draft day in the above IF statement\r\n\t\t\t\t\t\t\t\t\t$supplemental++; \r\n\t\t\t\t\t\t\t\t}*/\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t/*}*/\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\r\n\t\t}//end of the draft\r\n\t\t//delete all supplemental selections for the next supplemental draft\r\n\t\tif($start_time< now()){\r\n\t\t\t$this->db->where(1)->delete('Supplemental_Selections');\r\n\t\t}\r\n\t\t\r\n\t}",
"public function load_district_post($id){\n\t\t$loc_list = $this->ContactBranch->find('list', array('fields' => array('id','branch'), 'order' => array('branch ASC'),\n\t\t'conditions' => array('status' => '1',\t'state_id' => $id)));\n\t\treturn $loc_list;\n\t}",
"public function load($keys)\n {\n $query = $this->db->getQuery(true);\n\n $query\n ->select(\n \"a.id, a.user_id, a.project_id, a.reward_id, a.record_date, \" .\n \"a.unique_key, a.gateway, a.gateway_data, a.auser_id, a.session_id\"\n )\n ->from($this->db->quoteName(\"#__crowdf_intentions\", \"a\"));\n\n if (!is_array($keys)) {\n $query->where(\"a.id = \" . (int)$keys);\n } else {\n foreach ($keys as $key => $value) {\n $query->where($this->db->quoteName(\"a.\".$key) . \"=\" . $this->db->quote($value));\n }\n }\n\n $this->db->setQuery($query);\n $result = $this->db->loadAssoc();\n\n if (!$result) {\n $result = array();\n }\n\n // Decode gateway data.\n $gatewayData = JArrayHelper::getValue($result, \"gateway_data\");\n $this->gateway_data = (!empty($gatewayData)) ? (array)json_decode($gatewayData, true) : (array)$gatewayData;\n\n $ignored = array(\"gateway_data\");\n $this->bind($result, $ignored);\n }",
"public function loadAllStagingDataForId($rawId) {\n $sth = $this->dbh->prepare('SELECT * FROM ' . $this->tableName . ' WHERE raw_id = ' . $rawId);\n $sth->execute();\n $stagingData = $sth->fetchAll();\n\n return $stagingData;\n }",
"public function run()\n {\n \n\n \\DB::table('scholarships')->delete();\n \n \\DB::table('scholarships')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'name' => 'NINGUNA',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 1 => \n array (\n 'id' => 2,\n 'name' => 'PREESCOLAR O KÍNDER',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 2 => \n array (\n 'id' => 3,\n 'name' => 'PRIMARIA',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 3 => \n array (\n 'id' => 4,\n 'name' => 'SECUNDARIA',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 4 => \n array (\n 'id' => 5,\n 'name' => 'PREPARATORIA O BACHILLERATO GENERAL',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 5 => \n array (\n 'id' => 6,\n 'name' => 'BACHILLERATO TECNOLÓGICO',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 6 => \n array (\n 'id' => 7,\n 'name' => 'ESTUDIOS TÉCNICOS O COMERCIALES',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 7 => \n array (\n 'id' => 8,\n 'name' => 'NORMAL DE LICENCIATURA',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 8 => \n array (\n 'id' => 9,\n 'name' => 'LICENCIATURA',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 9 => \n array (\n 'id' => 10,\n 'name' => 'ESPECIALIDAD',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 10 => \n array (\n 'id' => 11,\n 'name' => 'MAESTRÍA',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n 11 => \n array (\n 'id' => 12,\n 'name' => 'DOCTORADO',\n 'inactive' => false,\n 'created_at' => NULL,\n 'updated_at' => NULL,\n ),\n ));\n \n \n }",
"public function auto_import_cash_bond()\n {\n $this->load->model('EmployeeModel', 'employee');\n $this->load->model('CashBondModel', 'cashBond');\n $this->load->model('CashBondDetailModel', 'cashBondDetail');\n $this->load->model('StatusHistoryModel', 'statusHistory');\n $this->load->model('modules/WarehouseAPI', 'apiClient');\n\n $fromDate = date('Y-m-d', strtotime('-30 days'));\n\n try {\n $payments = $this->apiClient->get('cash-bond/payment', [\n 'type' => 'OB TPS',\n 'is_realized' => 1,\n 'from_date' => format_date($fromDate),\n ]);\n $cashBonds = $this->cashBond->getBy([\n 'cash_bond_type' => CashBondModel::TYPE_OTHER,\n 'no_cash_bond' => array_column(if_empty($payments, []), 'no_payment')\n ]);\n\n foreach ($payments as &$payment) {\n $payment = (array)$payment;\n $isEdit = false;\n foreach ($cashBonds as $index => $cashBond) {\n if ($payment['no_payment'] == $cashBond['no_cash_bond']) {\n $isEdit = true;\n $employeePayment = $this->employee->getBy(['ref_employees.id_user' => $payment['created_by']], true);\n $this->cashBond->update([\n 'id_employee' => if_empty((!empty($employeePayment) ? $employeePayment['id'] : ''), null),\n 'id_bank_account' => get_if_exist($payment, 'id_bank_account', null),\n 'no_cash_bond' => $payment['no_payment'],\n 'cash_bond_type' => CashBondModel::TYPE_OTHER,\n 'cash_bond_date' => $payment['created_at'],\n 'settlement_date' => $payment['realized_at'],\n 'requisite_description' => if_empty($payment['description'], 'OB TPS ' . $payment['no_reference']),\n 'amount_request' => $payment['amount_request'],\n 'description' => $payment['customer_name'] . ' - ' . $payment['no_reference'],\n 'created_by' => $payment['created_by'],\n ], $cashBond['id']);\n\n $this->cashBondDetail->delete(['id_cash_bond' => $cashBond['id']]);\n $this->cashBondDetail->create([\n 'id_cash_bond' => $cashBond['id'],\n 'invoice_date' => if_empty(format_date($payment['payment_date']), null),\n 'payment_date' => if_empty(format_date($payment['payment_date']), null),\n 'no_invoice' => $payment['no_invoice'],\n 'amount' => $payment['amount'],\n 'description' => $payment['no_reference'],\n 'created_by' => $payment['created_by'],\n ]);\n\n $cashBond = $this->cashBond->getById($cashBond['id']);\n $this->statusHistory->create([\n 'type' => StatusHistoryModel::TYPE_CASH_BOND,\n 'id_reference' => $cashBond['id'],\n 'status' => CashBondModel::STATUS_VALIDATED,\n 'description' => 'Auto merge data ' . $cashBond['no_cash_bond'],\n 'data' => json_encode([\n 'cash_bond' => $cashBond,\n 'cash_bond_detail' => $this->cashBondDetail->getBy(['id_cash_bond' => $cashBond['id']]),\n 'payment' => $payment,\n 'creator' => UserModel::loginData('name')\n ])\n ]);\n\n unset($cashBonds[$index]);\n break;\n }\n }\n\n if (!$isEdit) {\n $employeePayment = $this->employee->getBy(['ref_employees.id_user' => $payment['created_by']], true);\n $this->cashBond->create([\n 'id_employee' => if_empty((!empty($employeePayment) ? $employeePayment['id'] : ''), null),\n 'id_bank_account' => get_if_exist($payment, 'id_bank_account', null),\n 'no_cash_bond' => $payment['no_payment'],\n 'cash_bond_type' => CashBondModel::TYPE_OTHER,\n 'cash_bond_date' => $payment['created_at'],\n 'settlement_date' => $payment['realized_at'],\n 'source' => CashBondModel::SOURCE_IMPORT,\n 'requisite_description' => if_empty($payment['description'], 'OB TPS ' . $payment['no_reference']),\n 'amount_request' => $payment['amount_request'],\n 'description' => $payment['customer_name'] . ' - ' . $payment['no_reference'],\n 'created_by' => $payment['created_by'],\n 'status' => CashBondModel::STATUS_VALIDATED\n ]);\n $cashBondId = $this->db->insert_id();\n\n $this->cashBondDetail->create([\n 'id_cash_bond' => $cashBondId,\n 'invoice_date' => if_empty(format_date($payment['payment_date']), null),\n 'payment_date' => if_empty(format_date($payment['payment_date']), null),\n 'no_invoice' => $payment['no_invoice'],\n 'amount' => $payment['amount'],\n 'description' => $payment['no_reference'],\n 'created_by' => $payment['created_by'],\n ]);\n\n $cashBond = $this->cashBond->getById($cashBondId);\n $this->statusHistory->create([\n 'type' => StatusHistoryModel::TYPE_CASH_BOND,\n 'id_reference' => $cashBondId,\n 'status' => CashBondModel::STATUS_VALIDATED,\n 'description' => 'Auto import data ' . $payment['no_payment'],\n 'data' => json_encode([\n 'cash_bond' => $cashBond,\n 'payment' => $payment,\n 'creator' => UserModel::loginData('name')\n ])\n ]);\n }\n }\n } catch (GuzzleException $e) {\n log_message('error', $e->getMessage());\n }\n }",
"protected function updateLeagueStandings()\n {\n $conditions = array('needs_standings_update' => true);\n $fields = array('_id');\n $leagues_needing_update = Leagues::all(compact('conditions', 'fields'));\n }",
"static function ArrSLAinObj($arr)\n\t{\n\t\tself::$postHolidaysSlaFields->RemoveExistingRows();\n\t\tforeach($arr as $k => $v)\n\t\t{\n\t\t\tself::$postHolidaysSlaFields->AddRow();\n\t\t\tself::$postHolidaysSlaFields->HOLIDAYS_ID = self::$id;\n\t\t\tself::$postHolidaysSlaFields->SLA_ID = $v;\n\t\t}\n\t}",
"public function index()\n {\n \n $id = Auth::user()->id;\n $student_id = DB::table('user_student')->where('user_id',$id)->get(['id'])->first();\n $grievance = DB::table('table_grievance')->where('student_id',$student_id->id)->orderBy('id','asc')\n ->get(['id','type','created_at','documents']);\n $data = [];\n $i = 0;\n foreach ($grievance as $id){\n $data[$i] = $id->id;\n $i++;\n }\n $grievance_status = DB::table('table_grievance_status')->whereIn('status',['raised','addressed'])\n ->whereIn('grievance_id',$data)->orderBy('grievance_id','asc')\n ->get(['grievance_id','status','eta']);\n $i = 0;\n\n $open=[];\n \n\n for ($i = 0; $i<count($grievance_status);$i++){\n if($grievance_status[$i]->status == 'addressed')\n $action = 1;\n else\n $action = 0;\n $open[$i] = [\n 'grievance_id'=>$grievance[$i]->id,\n 'grievance_type' => $grievance[$i]->type,\n 'assigned_committee' => $grievance[$i]->type,\n 'data_of_issue' => $grievance[$i]->created_at,\n 'attachment'=> $grievance[$i]->documents,\n 'status'=>$grievance_status[$i]->status,\n 'eta'=>$grievance_status[$i]->eta,\n 'action'=>$action\n ];\n }\n\n $id = Auth::user()->id;\n $student_id = DB::table('user_student')->where('user_id',$id)->get(['id'])->first();\n $grievance_escalated = DB::table('table_grievance')->where('student_id',$student_id->id)->orderBy('id','asc')\n ->get(['id','type','created_at','documents']);\n $data_escalated = [];\n $i = 0;\n foreach ($grievance_escalated as $id){\n $data_escalated[$i] = $id->id;\n $i++;\n }\n $grievance_status_escalated = DB::table('table_grievance_status')->whereIn('status',['delayed','reopened'])\n ->whereIn('grievance_id',$data_escalated)->orderBy('grievance_id','asc')\n ->get(['grievance_id','status','eta']);\n $i = 0;\n\n $esclated=[];\n \n\n for ($i = 0; $i<count($grievance_status_escalated);$i++){\n $action = 0;\n $esclated[$i] = [\n 'grievance_id'=>$grievance_status_escalated[$i]->grievance_id,\n 'grievance_type' => $grievance_escalated[$i]->type,\n 'assigned_committee' => $grievance_escalated[$i]->type,\n 'data_of_issue' => $grievance_escalated[$i]->created_at,\n 'attachment'=> $grievance_escalated[$i]->documents,\n 'status'=>$grievance_status_escalated[$i]->status,\n 'eta'=>$grievance_status_escalated[$i]->eta,\n 'action'=>$action\n ];\n }\n\n $id =\"5\";\n //$id = Auth::user()->id;\n $student_id = DB::table('user_student')->where('user_id',$id)->get(['id'])->first();\n $grievance_solved = DB::table('table_grievance')->where('student_id',$student_id->id)->orderBy('id','asc')\n ->get(['id','type','created_at','documents']);\n $data_solved = [];\n $i = 0;\n foreach ($grievance_solved as $id){\n $data_solved[$i] = $id->id;\n $i++;\n }\n $grievance_status_solved = DB::table('table_grievance_status')->whereIn('status',['resolved'])\n ->whereIn('grievance_id',$data_solved)->orderBy('grievance_id','asc')\n ->get(['grievance_id','status','eta']);\n $i = 0;\n\n $resolved=[];\n \n\n for ($i = 0; $i<count($grievance_status_solved);$i++){\n $action = 1;\n $resolved[$i] = [\n 'grievance_id'=>$grievance_status_solved[$i]->grievance_id,\n 'grievance_type' => $grievance_solved[$i]->type,\n 'assigned_committee' => $grievance_solved[$i]->type,\n 'data_of_issue' => $grievance_solved[$i]->created_at,\n 'attachment'=> $grievance_solved[$i]->documents,\n 'status'=>$grievance_status_solved[$i]->status,\n 'eta'=>$grievance_status_solved[$i]->eta,\n 'action'=>$action\n ];\n }\n\n $result[\"open\"] = $open;\n $result[\"esclated\"] = $esclated;\n $result[\"resolved\"] = $resolved;\n\n echo json_encode($result);\n }",
"function array_SIByFabId($fabId) {\n\t\t$sql = \"SELECT f.*, n.Supp_FinishingNum\n\t\t\t\tFROM fabric f, finishing n\n\t\t\t\tWHERE fabID=$fabId\n\t\t\t\tAND f.FinID = n.FinID\";\n\t\t\n\t\tmysql_connect(DB_SERVER, DB_USER, DB_PASSWORD) or die(mysql_error());\n\t\tmysql_select_db(DB_NAME) or die(mysql_error());\n \t$result = mysql_query($sql) or die(mysql_error());\n\t\t\t\n\t\t// only want the 1st result\n\t\twhile($row=mysql_fetch_array($result)){\n\t\t\t//var_dump($row);\n\t\t\treturn $row;\n \t\t}\n\t\t\n\t}",
"public function run()\n {\n \n\n \\DB::table('communes')->delete();\n \n \\DB::table('communes')->insert(array (\n 0 => \n array (\n 'id' => 120101,\n 'district_id' => 1201,\n 'code' => '120101',\n 'title' => 'Tonle Basak',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 1 => \n array (\n 'id' => 120102,\n 'district_id' => 1201,\n 'code' => '120102',\n 'title' => 'Boeng Keng Kang Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 2 => \n array (\n 'id' => 120103,\n 'district_id' => 1201,\n 'code' => '120103',\n 'title' => 'Boeng Keng Kang Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 3 => \n array (\n 'id' => 120104,\n 'district_id' => 1201,\n 'code' => '120104',\n 'title' => 'Boeng Keng Kang Ti Bei',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 4 => \n array (\n 'id' => 120105,\n 'district_id' => 1201,\n 'code' => '120105',\n 'title' => 'Olympic',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 5 => \n array (\n 'id' => 120106,\n 'district_id' => 1201,\n 'code' => '120106',\n 'title' => 'Tuol Svay Prey Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 6 => \n array (\n 'id' => 120107,\n 'district_id' => 1201,\n 'code' => '120107',\n 'title' => 'Tuol Svay Prey Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 7 => \n array (\n 'id' => 120108,\n 'district_id' => 1201,\n 'code' => '120108',\n 'title' => 'Tumnob Tuek',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 8 => \n array (\n 'id' => 120109,\n 'district_id' => 1201,\n 'code' => '120109',\n 'title' => 'Tuol Tumpung Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 9 => \n array (\n 'id' => 120110,\n 'district_id' => 1201,\n 'code' => '120110',\n 'title' => 'Tuol Tumpung Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 10 => \n array (\n 'id' => 120111,\n 'district_id' => 1201,\n 'code' => '120111',\n 'title' => 'Boeng Trabaek',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 11 => \n array (\n 'id' => 120112,\n 'district_id' => 1201,\n 'code' => '120112',\n 'title' => 'Phsar Daeum Thkov',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 12 => \n array (\n 'id' => 120201,\n 'district_id' => 1202,\n 'code' => '120201',\n 'title' => 'Phsar Thmei Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 13 => \n array (\n 'id' => 120202,\n 'district_id' => 1202,\n 'code' => '120202',\n 'title' => 'Phsar Thmei Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 14 => \n array (\n 'id' => 120203,\n 'district_id' => 1202,\n 'code' => '120203',\n 'title' => 'Phsar Thmei Ti Bei',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 15 => \n array (\n 'id' => 120204,\n 'district_id' => 1202,\n 'code' => '120204',\n 'title' => 'Boeng Reang',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 16 => \n array (\n 'id' => 120205,\n 'district_id' => 1202,\n 'code' => '120205',\n 'title' => 'Phsar Kandal Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 17 => \n array (\n 'id' => 120206,\n 'district_id' => 1202,\n 'code' => '120206',\n 'title' => 'Phsar Kandal Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 18 => \n array (\n 'id' => 120207,\n 'district_id' => 1202,\n 'code' => '120207',\n 'title' => 'Chakto Mukh',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 19 => \n array (\n 'id' => 120208,\n 'district_id' => 1202,\n 'code' => '120208',\n 'title' => 'Chey Chummeah',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 20 => \n array (\n 'id' => 120209,\n 'district_id' => 1202,\n 'code' => '120209',\n 'title' => 'Phsar Chas',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 21 => \n array (\n 'id' => 120210,\n 'district_id' => 1202,\n 'code' => '120210',\n 'title' => 'Srah Chak',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 22 => \n array (\n 'id' => 120211,\n 'district_id' => 1202,\n 'code' => '120211',\n 'title' => 'Voat Phnum',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 23 => \n array (\n 'id' => 120301,\n 'district_id' => 1203,\n 'code' => '120301',\n 'title' => 'Ou Ruessei Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 24 => \n array (\n 'id' => 120302,\n 'district_id' => 1203,\n 'code' => '120302',\n 'title' => 'Ou Ruessei Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 25 => \n array (\n 'id' => 120303,\n 'district_id' => 1203,\n 'code' => '120303',\n 'title' => 'Ou Ruessei Ti Bei',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 26 => \n array (\n 'id' => 120304,\n 'district_id' => 1203,\n 'code' => '120304',\n 'title' => 'Ou Ruessei Ti Buon',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 27 => \n array (\n 'id' => 120305,\n 'district_id' => 1203,\n 'code' => '120305',\n 'title' => 'Monourom',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 28 => \n array (\n 'id' => 120306,\n 'district_id' => 1203,\n 'code' => '120306',\n 'title' => 'Mittapheap',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 29 => \n array (\n 'id' => 120307,\n 'district_id' => 1203,\n 'code' => '120307',\n 'title' => 'Veal Vong',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 30 => \n array (\n 'id' => 120308,\n 'district_id' => 1203,\n 'code' => '120308',\n 'title' => 'Boeng Proluet',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 31 => \n array (\n 'id' => 120401,\n 'district_id' => 1204,\n 'code' => '120401',\n 'title' => 'Phsar Depou Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 32 => \n array (\n 'id' => 120402,\n 'district_id' => 1204,\n 'code' => '120402',\n 'title' => 'Phsar Depou Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 33 => \n array (\n 'id' => 120403,\n 'district_id' => 1204,\n 'code' => '120403',\n 'title' => 'Phsar Depou Ti Bei',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 34 => \n array (\n 'id' => 120404,\n 'district_id' => 1204,\n 'code' => '120404',\n 'title' => 'Tuek L\\'ak Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 35 => \n array (\n 'id' => 120405,\n 'district_id' => 1204,\n 'code' => '120405',\n 'title' => 'Tuek L\\'ak Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 36 => \n array (\n 'id' => 120406,\n 'district_id' => 1204,\n 'code' => '120406',\n 'title' => 'Tuek L\\'ak Ti Bei',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 37 => \n array (\n 'id' => 120407,\n 'district_id' => 1204,\n 'code' => '120407',\n 'title' => 'Boeng Kak Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 38 => \n array (\n 'id' => 120408,\n 'district_id' => 1204,\n 'code' => '120408',\n 'title' => 'Boeng Kak Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 39 => \n array (\n 'id' => 120409,\n 'district_id' => 1204,\n 'code' => '120409',\n 'title' => 'Phsar Daeum Kor',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 40 => \n array (\n 'id' => 120410,\n 'district_id' => 1204,\n 'code' => '120410',\n 'title' => 'Boeng Salang',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 41 => \n array (\n 'id' => 120501,\n 'district_id' => 1205,\n 'code' => '120501',\n 'title' => 'Dangkao',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 42 => \n array (\n 'id' => 120507,\n 'district_id' => 1205,\n 'code' => '120507',\n 'title' => 'Pong Tuek',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 43 => \n array (\n 'id' => 120508,\n 'district_id' => 1205,\n 'code' => '120508',\n 'title' => 'Prey Veaeng',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 44 => \n array (\n 'id' => 120510,\n 'district_id' => 1205,\n 'code' => '120510',\n 'title' => 'Prey Sa',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 45 => \n array (\n 'id' => 120512,\n 'district_id' => 1205,\n 'code' => '120512',\n 'title' => 'Krang Pongro',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 46 => \n array (\n 'id' => 120513,\n 'district_id' => 1205,\n 'code' => '120513',\n 'title' => 'Prateah Lang',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 47 => \n array (\n 'id' => 120514,\n 'district_id' => 1205,\n 'code' => '120514',\n 'title' => 'Sak Sampov',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 48 => \n array (\n 'id' => 120515,\n 'district_id' => 1205,\n 'code' => '120515',\n 'title' => 'Cheung Aek',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 49 => \n array (\n 'id' => 120516,\n 'district_id' => 1205,\n 'code' => '120516',\n 'title' => 'Kong Noy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 50 => \n array (\n 'id' => 120517,\n 'district_id' => 1205,\n 'code' => '120517',\n 'title' => 'Preaek Kampues',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 51 => \n array (\n 'id' => 120518,\n 'district_id' => 1205,\n 'code' => '120518',\n 'title' => 'Roluos',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 52 => \n array (\n 'id' => 120519,\n 'district_id' => 1205,\n 'code' => '120519',\n 'title' => 'Spean Thma',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 53 => \n array (\n 'id' => 120520,\n 'district_id' => 1205,\n 'code' => '120520',\n 'title' => 'Tien',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 54 => \n array (\n 'id' => 120601,\n 'district_id' => 1206,\n 'code' => '120601',\n 'title' => 'Stueng Mean chey',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 55 => \n array (\n 'id' => 120602,\n 'district_id' => 1206,\n 'code' => '120602',\n 'title' => 'Boeng Tumpun',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 56 => \n array (\n 'id' => 120606,\n 'district_id' => 1206,\n 'code' => '120606',\n 'title' => 'Chak Angrae Leu',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 57 => \n array (\n 'id' => 120607,\n 'district_id' => 1206,\n 'code' => '120607',\n 'title' => 'Chak Angrae Kraom',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 58 => \n array (\n 'id' => 120702,\n 'district_id' => 1207,\n 'code' => '120702',\n 'title' => 'Tuol Sangke',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 59 => \n array (\n 'id' => 120703,\n 'district_id' => 1207,\n 'code' => '120703',\n 'title' => 'Svay Pak',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 60 => \n array (\n 'id' => 120704,\n 'district_id' => 1207,\n 'code' => '120704',\n 'title' => 'Kilomaetr Lekh Prammuoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 61 => \n array (\n 'id' => 120706,\n 'district_id' => 1207,\n 'code' => '120706',\n 'title' => 'Ruessei Kaev',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 62 => \n array (\n 'id' => 120711,\n 'district_id' => 1207,\n 'code' => '120711',\n 'title' => 'Chrang Chamreh Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 63 => \n array (\n 'id' => 120712,\n 'district_id' => 1207,\n 'code' => '120712',\n 'title' => 'Chrang Chamreh Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 64 => \n array (\n 'id' => 120801,\n 'district_id' => 1208,\n 'code' => '120801',\n 'title' => 'Phnom Penh Thmei',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 65 => \n array (\n 'id' => 120802,\n 'district_id' => 1208,\n 'code' => '120802',\n 'title' => 'Tuek Thla',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 66 => \n array (\n 'id' => 120803,\n 'district_id' => 1208,\n 'code' => '120803',\n 'title' => 'Khmuonh',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 67 => \n array (\n 'id' => 120807,\n 'district_id' => 1208,\n 'code' => '120807',\n 'title' => 'Krang Thnong',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 68 => \n array (\n 'id' => 120901,\n 'district_id' => 1209,\n 'code' => '120901',\n 'title' => 'Trapeang Krasang',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 69 => \n array (\n 'id' => 120903,\n 'district_id' => 1209,\n 'code' => '120903',\n 'title' => 'Phleung Chheh Roteh',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 70 => \n array (\n 'id' => 120904,\n 'district_id' => 1209,\n 'code' => '120904',\n 'title' => 'Chaom Chau',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 71 => \n array (\n 'id' => 120905,\n 'district_id' => 1209,\n 'code' => '120905',\n 'title' => 'Kakab',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 72 => \n array (\n 'id' => 120906,\n 'district_id' => 1209,\n 'code' => '120906',\n 'title' => 'Samraong Kraom',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 73 => \n array (\n 'id' => 120908,\n 'district_id' => 1209,\n 'code' => '120908',\n 'title' => 'Boeng Thum',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 74 => \n array (\n 'id' => 120909,\n 'district_id' => 1209,\n 'code' => '120909',\n 'title' => 'Kamboul',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 75 => \n array (\n 'id' => 120910,\n 'district_id' => 1209,\n 'code' => '120910',\n 'title' => 'Kantaok',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 76 => \n array (\n 'id' => 120911,\n 'district_id' => 1209,\n 'code' => '120911',\n 'title' => 'Ovlaok',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 77 => \n array (\n 'id' => 120913,\n 'district_id' => 1209,\n 'code' => '120913',\n 'title' => 'Snaor',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 78 => \n array (\n 'id' => 121001,\n 'district_id' => 1210,\n 'code' => '121001',\n 'title' => 'Chrouy Changvar',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 79 => \n array (\n 'id' => 121002,\n 'district_id' => 1210,\n 'code' => '121002',\n 'title' => 'Preaek Lieb',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 80 => \n array (\n 'id' => 121003,\n 'district_id' => 1210,\n 'code' => '121003',\n 'title' => 'Preaek Ta Sek',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 81 => \n array (\n 'id' => 121004,\n 'district_id' => 1210,\n 'code' => '121004',\n 'title' => 'Kaoh Dach',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 82 => \n array (\n 'id' => 121005,\n 'district_id' => 1210,\n 'code' => '121005',\n 'title' => 'Bak Kaeng',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 83 => \n array (\n 'id' => 121101,\n 'district_id' => 1211,\n 'code' => '121101',\n 'title' => 'Preaek Phnov',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 84 => \n array (\n 'id' => 121102,\n 'district_id' => 1211,\n 'code' => '121102',\n 'title' => 'Ponhea Pon',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 85 => \n array (\n 'id' => 121103,\n 'district_id' => 1211,\n 'code' => '121103',\n 'title' => 'Samraong',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 86 => \n array (\n 'id' => 121104,\n 'district_id' => 1211,\n 'code' => '121104',\n 'title' => 'Kouk Roka',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 87 => \n array (\n 'id' => 121105,\n 'district_id' => 1211,\n 'code' => '121105',\n 'title' => 'Ponsang',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 88 => \n array (\n 'id' => 121201,\n 'district_id' => 1212,\n 'code' => '121201',\n 'title' => 'Chhbar Ampov Ti Muoy',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 89 => \n array (\n 'id' => 121202,\n 'district_id' => 1212,\n 'code' => '121202',\n 'title' => 'Chbar Ampov Ti Pir',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 90 => \n array (\n 'id' => 121203,\n 'district_id' => 1212,\n 'code' => '121203',\n 'title' => 'Nirouth',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 91 => \n array (\n 'id' => 121204,\n 'district_id' => 1212,\n 'code' => '121204',\n 'title' => 'Preaek Pra',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 92 => \n array (\n 'id' => 121205,\n 'district_id' => 1212,\n 'code' => '121205',\n 'title' => 'Veal Sbov',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 93 => \n array (\n 'id' => 121206,\n 'district_id' => 1212,\n 'code' => '121206',\n 'title' => 'Preaek Aeng',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 94 => \n array (\n 'id' => 121207,\n 'district_id' => 1212,\n 'code' => '121207',\n 'title' => 'Kbal Kaoh',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n 95 => \n array (\n 'id' => 121208,\n 'district_id' => 1212,\n 'code' => '121208',\n 'title' => 'Preaek Thmei',\n 'status' => 'ACTIVE',\n 'created_at' => NULL,\n 'updated_at' => NULL,\n 'deleted_at' => NULL,\n ),\n ));\n \n \n }",
"public function getPaymentsByIllnessId(int $illnessId) : array\n {\n if (NO_DATABASE) {\n return [new Payment(\n 1, $illnessId, 'Payment for drugs', rand(25, 50), rand(1,3)\n )];\n }\n\n $sql = \"SELECT p.pay_id,p.pay_name,p.pay_cost,p.number\n FROM payments p\n WHERE ill_id=? \";\n //$sql=\"SELECT SUM(pay_cost) FROM payments WHERE ill_id='$illnessId'\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute([$illnessId]);\n\n $payments = [];\n\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)){\n $payments[] = new Payment(\n $row['pay_id'],\n \t $illnessId,\n \t $row['pay_name'],\n \t $row['pay_cost'],\n \t $row['number']\n );\n }\n\n return $payments;\n }",
"function budgetsys_line_load_all_lids() {\n \n $query = db_select('budgetsys_line', 'bl'); // Select FROM budget_sys\n $query->fields('bl',array('lid')); // oid, o.title\n\n $result = $query->execute()->fetchCol(); // Execute and place in an array keyed by the oid\n return $result;\n}",
"public function get_branch_stock_correction() {\n $branch_stock_list = $this->Branch_stock_Model->get_branch_stock();\n $date = get_current_date();\n if (!empty($branch_stock_list)) {\n $arr = array();\n foreach ($branch_stock_list as $branch_stock) {\n if ($branch_stock->product_id == 103) {\n $branchwise_product_store_from_previous_date_by_product_id_branch_id = $this->db->query(\"SELECT * FROM branchwise_product_store WHERE product_store_date <= '$date' AND product_id='$branch_stock->product_id' AND branch_id='$branch_stock->branch_id' ORDER BY id DESC LIMIT 1\")->row();\n $branch_stock_data = array(\n 'id' => $branch_stock->id,\n 'branchwise_product_store' => $branchwise_product_store_from_previous_date_by_product_id_branch_id->id,\n 'product_id' => $branchwise_product_store_from_previous_date_by_product_id_branch_id->product_id,\n 'branch_id' => $branchwise_product_store_from_previous_date_by_product_id_branch_id->branch_id,\n 'stock' => (int) $branchwise_product_store_from_previous_date_by_product_id_branch_id->closing_stock,\n );\n array_push($arr, $branch_stock_data);\n// $this->db->where('id', $branch_stock_data['id']);\n// $this->Branch_stock_Model->db->update('branch_stock', $branch_stock_data);\n }\n }\n echo 'branch Stock';\n echo '<br>';\n echo '<pre>';\n print_r($arr);\n echo '</pre>';\n die();\n }\n }"
] |
[
"0.53728527",
"0.53458977",
"0.53291637",
"0.5022825",
"0.46346647",
"0.4578413",
"0.45455202",
"0.45321396",
"0.44502804",
"0.44122058",
"0.44083855",
"0.44061434",
"0.43923214",
"0.43774915",
"0.43194717",
"0.4293493",
"0.42700285",
"0.4234069",
"0.42295778",
"0.42244276",
"0.4204626",
"0.42030483",
"0.41939825",
"0.41705692",
"0.414768",
"0.41453695",
"0.41281536",
"0.41244584",
"0.41177937",
"0.4117556"
] |
0.61861306
|
0
|
Count StewardshipPledges by StewardshipFundId Index(es)
|
public static function CountByStewardshipFundId($intStewardshipFundId, $objOptionalClauses = null) {
// Call StewardshipPledge::QueryCount to perform the CountByStewardshipFundId query
return StewardshipPledge::QueryCount(
QQ::Equal(QQN::StewardshipPledge()->StewardshipFundId, $intStewardshipFundId)
, $objOptionalClauses
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function bdpp_trending_post_count() {\n\t\t\n\t\t$prefix\t\t= BDPP_META_PREFIX;\n\t\t$post_id \t= isset( $_POST['post_id'] ) ? bdpp_clean_number( $_POST['post_id'] ) : '';\n\t\t\n\t\tif( !empty( $post_id ) ) {\n\t\t\t\n\t\t\t// Getting existing views\n\t\t\t$views = get_post_meta( $post_id, $prefix.'post_views', true );\n\t\t\t$views = !empty( $views ) ? $views : 0;\n\n\t\t\t// Update view\n\t\t\tupdate_post_meta( $post_id, $prefix.'post_views', ($views+1) );\n\n\t\t\t$result['success'] = 1;\n\t\t} else {\n\t\t\t$result['success'] = 0;\n\t\t}\n\t\twp_send_json($result);\n\t}",
"public function getSmashIdxCount()\n {\n return $this->count(self::_SMASH_IDX);\n }",
"function apachesolr_index_status($env_id) {\n $remaining = 0;\n $total = 0;\n\n foreach (entity_get_info() as $entity_type => $info) {\n $bundles = apachesolr_get_index_bundles($env_id, $entity_type);\n if (empty($bundles)) {\n continue;\n }\n\n $table = apachesolr_get_indexer_table($entity_type);\n $query = db_select($table, 'aie')\n ->condition('aie.status', 1)\n ->condition('aie.bundle', $bundles)\n ->addTag('apachesolr_index_' . $entity_type);\n\n $total += $query->countQuery()->execute()->fetchField();\n\n $query = _apachesolr_index_get_next_set_query($env_id, $entity_type);\n $remaining += $query->countQuery()->execute()->fetchField();\n }\n return array('remaining' => $remaining, 'total' => $total);\n}",
"public function incomming ()\n {\n $stock = 0;\n\n foreach ($this->batches as $batch) {\n $edge = $batch->article()->edge($this);\n\n $stock = $stock + $edge->count;\n }\n\n return $stock;\n }",
"public function getTotal()\n {\n return $this->hasMany(Ward::className(), ['district_id' => 'id'])->count();\n }",
"public function updaterArticlesCount()\n {\n //return $this->hasOne('NationRegion','id','nation_region_id');\n return $this->updater_articles()\n ->selectRaw('updated_user, count(*) as aggregate')\n ->groupBy('updated_user');\n }",
"function countHit() {\n\n $this->saveField('hits', $this->data['Ringsite']['hits']+1, false);\n }",
"public function existFlaggingCount($nid);",
"public static function countbuyerpost()\n {\n $get_total_spots = DB::table('intra_hp_buyer_posts as bp')\n ->join('intra_hp_buyer_seller_routes as sr', 'sr.fk_buyer_seller_post_id', '=', 'bp.id')\n ->leftjoin('lkp_localities as fromLoctn', 'sr.from_location', '=', 'fromLoctn.id')\n ->leftjoin('lkp_localities as toLoctn', 'sr.to_location', '=', 'toLoctn.id')\n ->select('bp.id',\n 'sr.city_id',\n 'bp.type_basis',\n 'bp.is_private_public',\n 'bp.lkp_service_id',\n 'bp.last_date',\n DB::raw(\"(select vehicle_type FROM lkp_vehicle_types WHERE id=sr.vehicle_type_id AND is_active = 1) as vehicle\"),\n DB::raw(\"(select city_name FROM lkp_cities WHERE id=sr.city_id ) as city_name\"),\n DB::raw(\"(select locality_name FROM lkp_localities WHERE id=fromLoctn.id) as from_location\"),\n DB::raw(\"(select locality_name FROM lkp_localities WHERE id=toLoctn.id) as to_location\")\n )\n ->where('bp.is_active', 1)\n ->where('bp.lead_type', INTRA_HYPER_SPOT)\n ->where('sr.is_active', 1)\n ->where('bp.lkp_service_id','=',_INTRACITY_)\n ->where('sr.lkp_service_id','=',_INTRACITY_)\n ->where('sr.is_seller_buyer', 1)\n ->count();\n\n /** For Total Number of Buyer Post Terms **/\n $get_total_terms = DB::table('intra_hp_buyer_posts as bp')\n ->join('intra_hp_buyer_seller_routes as sr', 'sr.fk_buyer_seller_post_id', '=', 'bp.id')\n ->leftjoin('lkp_localities as fromLoctn', 'sr.from_location', '=', 'fromLoctn.id')\n ->leftjoin('lkp_localities as toLoctn', 'sr.to_location', '=', 'toLoctn.id')\n ->select('bp.id',\n 'sr.city_id',\n 'bp.type_basis',\n 'bp.is_private_public',\n 'bp.lkp_service_id',\n 'bp.last_date',\n DB::raw(\"(select vehicle_type FROM lkp_vehicle_types WHERE id=sr.vehicle_type_id AND is_active = 1) as vehicle\"),\n DB::raw(\"(select city_name FROM lkp_cities WHERE id=sr.city_id ) as city_name\"),\n DB::raw(\"(select locality_name FROM lkp_localities WHERE id=fromLoctn.id) as from_location\"),\n DB::raw(\"(select locality_name FROM lkp_localities WHERE id=toLoctn.id) as to_location\")\n )\n ->where('bp.is_active', 1)\n ->where('bp.lead_type', INTRA_HYPER_TERM)\n ->orderBy('bp.id', 'DESC')\n ->where('sr.is_active', 1)\n ->where('sr.is_seller_buyer', 1)\n ->where('sr.lkp_service_id','=',_INTRACITY_)\n ->count();\n\n /** For Total Number Private **/\n $get_total_private = DB::table('intra_hp_buyer_posts as bp')\n ->join('intra_hp_buyer_seller_routes as sr', 'sr.fk_buyer_seller_post_id', '=', 'bp.id')\n ->leftjoin('lkp_localities as fromLoctn', 'sr.from_location', '=', 'fromLoctn.id')\n ->leftjoin('lkp_localities as toLoctn', 'sr.to_location', '=', 'toLoctn.id')\n ->select('bp.id',\n 'sr.city_id',\n 'bp.type_basis',\n 'bp.is_private_public',\n 'bp.lkp_service_id',\n 'bp.last_date',\n DB::raw(\"(select vehicle_type FROM lkp_vehicle_types WHERE id=sr.vehicle_type_id AND is_active = 1) as vehicle\"),\n DB::raw(\"(select city_name FROM lkp_cities WHERE id=sr.city_id ) as city_name\"),\n DB::raw(\"(select locality_name FROM lkp_localities WHERE id=fromLoctn.id) as from_location\"),\n DB::raw(\"(select locality_name FROM lkp_localities WHERE id=toLoctn.id) as to_location\")\n )\n ->where('bp.is_active', 1)\n ->where('bp.is_private_public', _PRIVATE_)\n ->where('sr.is_active', 1)\n ->where('sr.is_seller_buyer', 1)\n ->where('sr.lkp_service_id','=',_INTRACITY_)\n ->count();\n\n\n /** For Total Number Public **/\n $get_total_public = DB::table('intra_hp_buyer_posts as bp')\n ->join('intra_hp_buyer_seller_routes as sr', 'sr.fk_buyer_seller_post_id', '=', 'bp.id')\n ->leftjoin('lkp_localities as fromLoctn', 'sr.from_location', '=', 'fromLoctn.id')\n ->leftjoin('lkp_localities as toLoctn', 'sr.to_location', '=', 'toLoctn.id')\n ->select('bp.id',\n 'sr.city_id',\n 'bp.type_basis',\n 'bp.is_private_public',\n 'bp.lkp_service_id',\n 'bp.last_date',\n DB::raw(\"(select vehicle_type FROM lkp_vehicle_types WHERE id=sr.vehicle_type_id AND is_active = 1) as vehicle\"),\n DB::raw(\"(select city_name FROM lkp_cities WHERE id=sr.city_id ) as city_name\"),\n DB::raw(\"(select locality_name FROM lkp_localities WHERE id=fromLoctn.id) as from_location\"),\n DB::raw(\"(select locality_name FROM lkp_localities WHERE id=toLoctn.id) as to_location\")\n )\n ->where('bp.is_active', 1)\n ->where('bp.is_private_public', _PUBLIC_)\n ->where('sr.is_active', 1)\n ->where('sr.is_seller_buyer', 1)\n ->where('sr.lkp_service_id','=',_INTRACITY_)\n ->count();\n\n\n return response()->json([\n\n 'total_buyerpost_spots' => $get_total_spots,\n 'total_private_post' => $get_total_private,\n 'total_public_post' => $get_total_public,\n 'get_total_terms' => $get_total_terms\n\n\n ]);\n\n }",
"public function getListBadgeCountByRangeDate($badges, $startDate='', $endDate='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\t \r\n\t\t$rsm = new \\Doctrine\\ORM\\Query\\ResultSetMapping;\r\n\t \r\n\t\t$select = array();\r\n\t\t$i = 0;\r\n\r\n\t\tforeach($badges as $badge => $levels) {\r\n\t\t\tforeach($levels as $level) {\r\n\t\t\t\t$filter = array('a.id');\r\n\t\t\t\tif($badge != 'total') {\r\n\t\t\t\t\t$filter[] = 'a.category = \\''.$badge.'\\'';\r\n\t\t\t\t}\r\n\t\t\t\tif($level > 0){\r\n\t\t\t\t\t$filter[] = 'a.level = '.( (int) $level );\r\n\t\t\t\t}\r\n\t\t\t\t$rsm->addScalarResult('c'.$i, 'c'.$i);\r\n\t\t\t\t$select[] = 'SUM(CASE WHEN '.implode(' AND ',$filter).' THEN 1 ELSE 0 END) AS c'.$i++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(a.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND a.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"a.created_at <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"a.created_at >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"a.created_at IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createNativeQuery('\r\n\t\t\tSELECT '.implode(',',$select).' FROM reward_achievement a\r\n\t\t\tWHERE ' . $dateRange, $rsm);\r\n\t\treturn array_values( $query->getSingleResult() );\r\n\t}",
"public function countStudentsFree(){\n return Talleresdet::find()->where(['talleres_id'=>$this->id])->\n andWhere(['codtra' => null]) \n ->count();\n \n }",
"function xstats_displayShipProductionOfBuilder( $gameId, $shipBuilderId, $numberOfRows ) {\n include ('../../inc.conf.php');\n $shipBuilderIndex = xstats_getPlayerIndex($gameId, $shipBuilderId);\n $query = \"SELECT DISTINCT(shipclassid) FROM skrupel_xstats_ships ships INNER JOIN skrupel_xstats_shipowner shipowner ON (ships.shipid=shipowner.shipid AND ships.sinceturn=shipowner.turn AND ships.gameid=shipowner.gameid) WHERE shipowner.ownerid=\".$shipBuilderId.\" AND ships.gameId=\".$gameId.\" \";\n $result = @mysql_query($query) or die(mysql_error());\n $shipClassArray = array();\n while($row = @mysql_fetch_row($result)) {\n $shipClassArray[] = $row[0];\n }\n $shipClassCountArray = array();\n foreach( $shipClassArray as $shipClassId) {\n $query = \"SELECT COUNT(shipclassid) FROM skrupel_xstats_ships ships INNER JOIN skrupel_xstats_shipowner shipowner ON (ships.shipid=shipowner.shipid AND ships.sinceturn=shipowner.turn AND ships.gameid=shipowner.gameid) WHERE shipowner.ownerid=\".$shipBuilderId.\" AND ships.gameId=\".$gameId.\" AND shipclassid=\".$shipClassId;\n $result = @mysql_query($query) or die(mysql_error());\n while($row = @mysql_fetch_row($result)) {\n $shipClassCountArray[$shipClassId] = $row[0];\n }\n }\n //get number of all built ships of this builder\n $query = \"SELECT COUNT(1) FROM skrupel_xstats_ships ships INNER JOIN skrupel_xstats_shipowner shipowner ON (ships.shipid=shipowner.shipid AND ships.sinceturn=shipowner.turn AND ships.gameid=shipowner.gameid) WHERE shipowner.ownerid=\".$shipBuilderId.\" AND ships.gameId=\".$gameId;\n $result = @mysql_query($query) or die(mysql_error());\n $result = @mysql_fetch_row($result);\n $numberOfShipsProduced = $result[0];\n $shipClassArray = array();\n echo( '<h4>Gebaute Schiffstypen von <font color=\"'.$spielerfarbe[$shipBuilderIndex].'\"> '.xstats_getPlayerNick($shipBuilderId).'</font> (Gesamtproduktion: '.$numberOfShipsProduced.' Schiffe)</h4>');\n echo '<table class=\"shiptable\"border=\"0\">';\n echo '<tr><th>Schiff</th><th>Anzahl</th><th>Anteil an Produktion</th><th>Tech Level</th><th>Masse</th><th>Frachtraum</th></tr>';\n arsort($shipClassCountArray);\n $shipClassArray = array_keys($shipClassCountArray);\n for( $i = 0; $i < count( $shipClassArray ); $i++ ) {\n if( $i+1 > $numberOfRows) {\n break;\n }\n $classId = $shipClassArray[$i];\n $classIdCount = $shipClassCountArray[$shipClassArray[$i]];\n //get one of the stats lines\n $query = \"SELECT * FROM skrupel_xstats_ships ships INNER JOIN skrupel_xstats_shipowner shipowner ON (ships.shipid=shipowner.shipid AND ships.sinceturn=shipowner.turn AND ships.gameid=shipowner.gameid) WHERE shipowner.ownerid=\".$shipBuilderId.\" AND ships.gameId=\".$gameId.\" AND shipclassid=\".$classId;\n $result = @mysql_query($query) or die(mysql_error());\n $result = @mysql_fetch_array($result);\n //ship description\n echo '<td>'.xstats_getShipIcon( $result['shiprace'], $result['picturesmall'], $shipBuilderIndex).' '.$result['shipclass'].'</td>';\n //abs count\n echo '<td class=\"highlight\">'.$classIdCount.'</td>';\n //perc count\n $perc = number_format((100*$classIdCount/$numberOfShipsProduced),1);\n echo '<td class=\"highlight\"><img src=\"pie.php?perc='.$perc.'&size=30\"><span>'.$perc.'%</span></td>';\n //tech level of the hull\n echo '<td>'.$result['levelhull'].'</td>';\n //mass\n echo '<td>'.$result['mass'].' kT</td>';\n //cargo\n echo '<td>'.$result['cargomax'].' kT</td>';\n echo '<tr>';\n }\n echo '</table>';\n echo '<br>';\n}",
"public function _count();",
"public function getGroupTagsCount()\r\n {\r\n $tmpGroup = new Warecorp_Group_Base();\r\n $EntityTypeId = $tmpGroup->EntityTypeId;\r\n $EntityTypeName = $tmpGroup->EntityTypeName;\r\n unset($tmpGroup);\r\n\r\n $group = Warecorp_Group_Factory::loadById($this->getGroupId());\r\n $members = $group->getMembers()->setAssocValue('zua.id')->returnAsAssoc()->getList();\r\n\r\n $query = $this->_db->select();\r\n $query->from(array('ztr' => 'zanby_tags__relations'), array());\r\n $query->joininner(array('ztd' => 'zanby_tags__dictionary'), 'ztr.tag_id = ztd.id', array(new Zend_Db_Expr('COUNT(DISTINCT ztd.id)')));\r\n\r\n if ( $this->getWhere() ) $query->where($this->getWhere());\r\n $query->where('entity_type_id = ?', $EntityTypeId);\r\n $query->where('entity_id = ?', $this->getGroupId());\r\n $query->where('ztr.status IN (?)', $this->getTagStatus());\r\n\r\n return $this->_db->fetchOne($query);\r\n }",
"public function findCount()\n {\n return $this->getEntityManager()\n ->createQuery(\"SELECT t.number, COUNT(f.id) as cnt\n FROM GazMainBundle:Finance f\n LEFT JOIN f.terminal t\n LEFT JOIN f.clientSale cs\n\t\t\t\t\t\t\tLEFT JOIN f.clientBuy cb\n\t\t\t\t\t\t\tWHERE f.financeType = FALSE\n\t\t\t\t\t\t\tGROUP BY t.number\n\t\t\t\t\t\t\tORDER BY t.number ASC\n \")\n ->getResult();\n }",
"public function countStates()\n {\n if ($this->isNonexistent) return 0;\n\n if (!is_null($this->countStates)) return $this->countStates;\n\n return $this->countStates = FeedbackState::find()->where([\n 'feedback_id' => $this->id,\n ])->count();\n }",
"public function testCountStadium()\n\t{\n \t$this->assertEquals(12, Stadium::count());\n }",
"function countRefPool($pid)\n\t\t {\n\t\t $sql = \"SELECT COUNT(*) As cnt FROM pof_candidates WHERE pofid =\".$pid.\" AND stage ='287' \";\n\t $q = $this->db->query($sql);\n\t $row = $q->row();\n\t return $row->cnt;\n\t\t }",
"function countOnhold($pid)\n\t\t {\n\t\t $sql = \"SELECT COUNT(*) As cnt FROM pof_candidates WHERE pofid =\".$pid.\" AND stage ='285' \";\n\t $q = $this->db->query($sql);\n\t $row = $q->row();\n\t return $row->cnt;\n\t\t }",
"abstract public function getCount(GridViewRequest $request) : int;",
"public function countEntities(): int;",
"function party_count()\r\n\t{\r\n\t\t$this->db->select('Party_dtl_id');\r\n\t\t$this->db->from('party_details');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->num_rows();\r\n\t}",
"function getCountOfTransferedNativePig($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud -> sql(\"SELECT *, COUNT(farmer_id_fk) FROM pigs_tbl WHERE farmer_id_fk='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['COUNT(farmer_id_fk)'];\n\t}\n\t$crud->disconnect();\n}",
"function save_places_count_in_district()\n{\n $districts = DataManager::getDistricts();\n foreach ($districts as $dis)\n {\n $count = DataManager::getPlaceCountOnDistrict(substr($dis->district, 0,6));\n /* update */\n }\n}",
"public function getUnapprovedCount();",
"function allposts_count($tabel)\n { \n $query = $this->db->where(array(\"fc_status\" => \"F\",\"fc_approve\" => \"0\"))->get($tabel);\n return $query->num_rows(); \n }",
"private function ts_countHits()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n if ( $this->count_hits[ $this->curr_tableField ] != null )\n {\n return $this->count_hits[ $this->curr_tableField ];\n }\n\n\n // Short var\n $count_hits = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'count_hits' ];\n switch ( $count_hits )\n {\n case( true ):\n $this->count_hits[ $this->curr_tableField ] = true;\n break;\n default:\n $this->count_hits[ $this->curr_tableField ] = false;\n break;\n }\n\n // RETURN\n return $this->count_hits[ $this->curr_tableField ];\n }",
"final public function count(): int\n {\n return count($this->index);\n }",
"public function getCount() {\n return count($this->indices);\n }",
"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}"
] |
[
"0.49721476",
"0.49162194",
"0.49112445",
"0.48865727",
"0.48854074",
"0.48551312",
"0.48538372",
"0.47963116",
"0.4761107",
"0.47584665",
"0.4749194",
"0.47282234",
"0.4715904",
"0.47093776",
"0.4692234",
"0.46730337",
"0.4651862",
"0.46453387",
"0.46275288",
"0.46137556",
"0.46113464",
"0.46006033",
"0.45993888",
"0.4597903",
"0.45939258",
"0.4585852",
"0.45846537",
"0.4576107",
"0.45721924",
"0.45711774"
] |
0.5480738
|
0
|
Reload this StewardshipPledge from the database.
|
public function Reload() {
// Make sure we are actually Restored from the database
if (!$this->__blnRestored)
throw new QCallerException('Cannot call Reload() on a new, unsaved StewardshipPledge object.');
// Reload the Object
$objReloaded = StewardshipPledge::Load($this->intId);
// Update $this's local variables to match
$this->PersonId = $objReloaded->PersonId;
$this->StewardshipFundId = $objReloaded->StewardshipFundId;
$this->dttDateStarted = $objReloaded->dttDateStarted;
$this->dttDateEnded = $objReloaded->dttDateEnded;
$this->fltPledgeAmount = $objReloaded->fltPledgeAmount;
$this->fltContributedAmount = $objReloaded->fltContributedAmount;
$this->fltRemainingAmount = $objReloaded->fltRemainingAmount;
$this->blnFulfilledFlag = $objReloaded->blnFulfilledFlag;
$this->blnActiveFlag = $objReloaded->blnActiveFlag;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved PersonWithLock object.');\n\n\t\t\t$this->DeleteFromCache();\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = PersonWithLock::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->strFirstName = $objReloaded->strFirstName;\n\t\t\t$this->strLastName = $objReloaded->strLastName;\n\t\t\t$this->strSysTimestamp = $objReloaded->strSysTimestamp;\n\t\t}",
"public function reload ()\r\n {\r\n $this->_load();\r\n }",
"public function Save($blnForceInsert = false, $blnForceUpdate = false) {\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = StewardshipPledge::GetDatabase();\n\n\t\t\t$mixToReturn = null;\n\n\t\t\ttry {\n\t\t\t\tif ((!$this->__blnRestored) || ($blnForceInsert)) {\n\t\t\t\t\t// Perform an INSERT query\n\t\t\t\t\t$objDatabase->NonQuery('\n\t\t\t\t\t\tINSERT INTO `stewardship_pledge` (\n\t\t\t\t\t\t\t`person_id`,\n\t\t\t\t\t\t\t`stewardship_fund_id`,\n\t\t\t\t\t\t\t`date_started`,\n\t\t\t\t\t\t\t`date_ended`,\n\t\t\t\t\t\t\t`pledge_amount`,\n\t\t\t\t\t\t\t`contributed_amount`,\n\t\t\t\t\t\t\t`remaining_amount`,\n\t\t\t\t\t\t\t`fulfilled_flag`,\n\t\t\t\t\t\t\t`active_flag`\n\t\t\t\t\t\t) VALUES (\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t\t\t' . $objDatabase->SqlVariable($this->blnActiveFlag) . '\n\t\t\t\t\t\t)\n\t\t\t\t\t');\n\n\t\t\t\t\t// Update Identity column and return its value\n\t\t\t\t\t$mixToReturn = $this->intId = $objDatabase->InsertId('stewardship_pledge', 'id');\n\n\t\t\t\t\t// Journaling\n\t\t\t\t\tif ($objDatabase->JournalingDatabase) $this->Journal('INSERT');\n\n\t\t\t\t} else {\n\t\t\t\t\t// Perform an UPDATE query\n\n\t\t\t\t\t// First checking for Optimistic Locking constraints (if applicable)\n\n\t\t\t\t\t// Perform the UPDATE query\n\t\t\t\t\t$objDatabase->NonQuery('\n\t\t\t\t\t\tUPDATE\n\t\t\t\t\t\t\t`stewardship_pledge`\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t`person_id` = ' . $objDatabase->SqlVariable($this->intPersonId) . ',\n\t\t\t\t\t\t\t`stewardship_fund_id` = ' . $objDatabase->SqlVariable($this->intStewardshipFundId) . ',\n\t\t\t\t\t\t\t`date_started` = ' . $objDatabase->SqlVariable($this->dttDateStarted) . ',\n\t\t\t\t\t\t\t`date_ended` = ' . $objDatabase->SqlVariable($this->dttDateEnded) . ',\n\t\t\t\t\t\t\t`pledge_amount` = ' . $objDatabase->SqlVariable($this->fltPledgeAmount) . ',\n\t\t\t\t\t\t\t`contributed_amount` = ' . $objDatabase->SqlVariable($this->fltContributedAmount) . ',\n\t\t\t\t\t\t\t`remaining_amount` = ' . $objDatabase->SqlVariable($this->fltRemainingAmount) . ',\n\t\t\t\t\t\t\t`fulfilled_flag` = ' . $objDatabase->SqlVariable($this->blnFulfilledFlag) . ',\n\t\t\t\t\t\t\t`active_flag` = ' . $objDatabase->SqlVariable($this->blnActiveFlag) . '\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t`id` = ' . $objDatabase->SqlVariable($this->intId) . '\n\t\t\t\t\t');\n\n\t\t\t\t\t// Journaling\n\t\t\t\t\tif ($objDatabase->JournalingDatabase) $this->Journal('UPDATE');\n\t\t\t\t}\n\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\n\t\t\t// Update __blnRestored and any Non-Identity PK Columns (if applicable)\n\t\t\t$this->__blnRestored = true;\n\n\n\t\t\t// Return \n\t\t\treturn $mixToReturn;\n\t\t}",
"public function reload() {\n $this->store->reload();\n }",
"public function reload()\r\n {\r\n $id = $this->get( $this->pkName() );\r\n $this->reload( $id );\r\n return $this;\r\n }",
"public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn StewardshipPledge::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StewardshipPledge()->Id, $intId)\n\t\t\t);\n\t\t}",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved StrategyQuestionConditional object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = StrategyQuestionConditional::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->QuestionId = $objReloaded->QuestionId;\n\t\t\t$this->StrategyId = $objReloaded->StrategyId;\n\t\t\t$this->ConditionalType = $objReloaded->ConditionalType;\n\t\t}",
"public function reload() {\n $this->sessionData = null;\n $this->getAllValues();\n }",
"public function reload()\n {\n return $this->repository->reload();\n }",
"public function refresh()\n {\n if ($this->_id === false) {\n return $this;\n }\n\n $values = self::$driver->loadModel($this);\n\n if (!is_array($values)) {\n return $this;\n }\n\n // clear any relations\n $this->_relationships = [];\n\n return $this->refreshWith($values);\n }",
"public function reload()\n {\n $this->getEntityDao()->reload();\n\n return $this;\n }",
"public function reload() {\n\t\t$bucket = $this->bucket();\n\t\t$r = $bucket->get($this->_key);\n\t\treturn $this->update($r->data);\n\t}",
"public function refresh()\n {\n $this->entityManager->refresh($this);\n }",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved ComandoRisco object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = ComandoRisco::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->ComandoItemId = $objReloaded->ComandoItemId;\n\t\t\t$this->ComandoId = $objReloaded->ComandoId;\n\t\t\t$this->strReferencia = $objReloaded->strReferencia;\n\t\t\t$this->MoldeId = $objReloaded->MoldeId;\n\t\t\t$this->TamanhoId = $objReloaded->TamanhoId;\n\t\t\t$this->intQuantidadeRisco = $objReloaded->intQuantidadeRisco;\n\t\t}",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved Person object.');\n\n\t\t\t$this->DeleteFromCache();\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = Person::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->strFirstName = $objReloaded->strFirstName;\n\t\t\t$this->strLastName = $objReloaded->strLastName;\n\t\t}",
"public function unload()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->orm = null;\n\n $this->multiRef = [];\n $this->i18n = null;\n\n }",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved CommunicationList object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = CommunicationList::Load($this->intId);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->EmailBroadcastTypeId = $objReloaded->EmailBroadcastTypeId;\n\t\t\t$this->MinistryId = $objReloaded->MinistryId;\n\t\t\t$this->strName = $objReloaded->strName;\n\t\t\t$this->strToken = $objReloaded->strToken;\n\t\t\t$this->strDescription = $objReloaded->strDescription;\n\t\t\t$this->blnSubscribable = $objReloaded->blnSubscribable;\n\t\t}",
"public function refresh()\n {\n foreach($this->records as $rec) {\n $rec->refresh($this->conn);\n }\n }",
"public function refresh()\r\n {\r\n /* @var $record BaseActiveRecord */\r\n $record = static::findOne($this->getPrimaryKey(false));\r\n if ($record === null) {\r\n return false;\r\n }\r\n foreach ($this->attributes() as $name) {\r\n $this->_attributes[$name] = $record->hasAttribute($name) ? $record->getAttribute($name) : null;\r\n }\r\n $this->setOldAttributes($record->getOldAttributes());\r\n\r\n\r\n foreach ($record->getRelatedRecords() as $relationName => $records) {\r\n $this->populateRelation($relationName, $records);\r\n }\r\n $this->afterRefresh();\r\n\r\n return true;\r\n }",
"public function refresh()\n {\n $this->initialize();\n\n if (!$this->rowExistsInDatabase()) {\n throw new Exception\\RuntimeException('Cannot refresh the data not exists in database.');\n }\n $where = $this->processPrimaryKeyWhere();\n\n $statement = $this->sql->prepareStatement($this->sql->select()->where($where));\n $result = $statement->execute();\n $rowData = $result->current();\n unset($statement, $result); // cleanup\n\n // make sure data and original data are in sync after save\n $this->populate($rowData, true);\n return $this;\n }",
"function onReload()\n {\n try\n {\n Transaction::open( $this->connection );\n $repository = new Repository( $this->activeRecord );\n // cria um critério de seleção de dados\n $criteria = new Criteria;\n $criteria->setProperty('order', 'id');\n \n if (isset($this->filter))\n {\n $criteria->add($this->filter);\n }\n \n // carreta os objetos que satisfazem o critério\n $objects = $repository->load($criteria);\n $this->datagrid->clear();\n if ($objects)\n {\n foreach ($objects as $object)\n {\n // adiciona o objeto na DataGrid\n $this->datagrid->addItem($object);\n }\n }\n Transaction::close();\n }\n catch (Exception $e)\n {\n new Message($e->getMessage());\n }\n }",
"public function Reload() {\n\t\t\t// Make sure we are actually Restored from the database\n\t\t\tif (!$this->__blnRestored)\n\t\t\t\tthrow new QCallerException('Cannot call Reload() on a new, unsaved Characteristic object.');\n\n\t\t\t// Reload the Object\n\t\t\t$objReloaded = Characteristic::Load($this->intIdcharacteristic);\n\n\t\t\t// Update $this's local variables to match\n\t\t\t$this->SpeciesIdspecies = $objReloaded->SpeciesIdspecies;\n\t\t\t$this->strTitle = $objReloaded->strTitle;\n\t\t\t$this->strDescription = $objReloaded->strDescription;\n\t\t\t$this->strPicturesPath = $objReloaded->strPicturesPath;\n\t\t\t$this->CharacteristicIdcharacteristic = $objReloaded->CharacteristicIdcharacteristic;\n\t\t\t$this->strIdentifier = $objReloaded->strIdentifier;\n\t\t}",
"public function refresh() {\n $data = self::getWhere($this->_getPKValue(), TRUE, FALSE);\n if (!empty($data) && is_array($data)) {\n $this->_setData($data);\n return TRUE;\n }\n \n return FALSE;\n \n }",
"public function reload();",
"public function reload();",
"public function reload();",
"public function reload();",
"public function Refresh($blnReload = false) {\n\t\t\tif ($blnReload)\n\t\t\t\t$this->objStewardshipBatch->Reload();\n\n\t\t\tif ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objStewardshipBatch->Id;\n\n\t\t\tif ($this->lstStewardshipBatchStatusType) $this->lstStewardshipBatchStatusType->SelectedValue = $this->objStewardshipBatch->StewardshipBatchStatusTypeId;\n\t\t\tif ($this->lblStewardshipBatchStatusTypeId) $this->lblStewardshipBatchStatusTypeId->Text = ($this->objStewardshipBatch->StewardshipBatchStatusTypeId) ? StewardshipBatchStatusType::$NameArray[$this->objStewardshipBatch->StewardshipBatchStatusTypeId] : null;\n\n\t\t\tif ($this->calDateEntered) $this->calDateEntered->DateTime = $this->objStewardshipBatch->DateEntered;\n\t\t\tif ($this->lblDateEntered) $this->lblDateEntered->Text = sprintf($this->objStewardshipBatch->DateEntered) ? $this->objStewardshipBatch->__toString($this->strDateEnteredDateTimeFormat) : null;\n\n\t\t\tif ($this->calDateCredited) $this->calDateCredited->DateTime = $this->objStewardshipBatch->DateCredited;\n\t\t\tif ($this->lblDateCredited) $this->lblDateCredited->Text = sprintf($this->objStewardshipBatch->DateCredited) ? $this->objStewardshipBatch->__toString($this->strDateCreditedDateTimeFormat) : null;\n\n\t\t\tif ($this->txtBatchLabel) $this->txtBatchLabel->Text = $this->objStewardshipBatch->BatchLabel;\n\t\t\tif ($this->lblBatchLabel) $this->lblBatchLabel->Text = $this->objStewardshipBatch->BatchLabel;\n\n\t\t\tif ($this->txtDescription) $this->txtDescription->Text = $this->objStewardshipBatch->Description;\n\t\t\tif ($this->lblDescription) $this->lblDescription->Text = $this->objStewardshipBatch->Description;\n\n\t\t\tif ($this->txtItemCount) $this->txtItemCount->Text = $this->objStewardshipBatch->ItemCount;\n\t\t\tif ($this->lblItemCount) $this->lblItemCount->Text = $this->objStewardshipBatch->ItemCount;\n\n\t\t\tif ($this->txtReportedTotalAmount) $this->txtReportedTotalAmount->Text = $this->objStewardshipBatch->ReportedTotalAmount;\n\t\t\tif ($this->lblReportedTotalAmount) $this->lblReportedTotalAmount->Text = $this->objStewardshipBatch->ReportedTotalAmount;\n\n\t\t\tif ($this->txtActualTotalAmount) $this->txtActualTotalAmount->Text = $this->objStewardshipBatch->ActualTotalAmount;\n\t\t\tif ($this->lblActualTotalAmount) $this->lblActualTotalAmount->Text = $this->objStewardshipBatch->ActualTotalAmount;\n\n\t\t\tif ($this->txtPostedTotalAmount) $this->txtPostedTotalAmount->Text = $this->objStewardshipBatch->PostedTotalAmount;\n\t\t\tif ($this->lblPostedTotalAmount) $this->lblPostedTotalAmount->Text = $this->objStewardshipBatch->PostedTotalAmount;\n\n\t\t\tif ($this->lstCreatedByLogin) {\n\t\t\t\t\t$this->lstCreatedByLogin->RemoveAllItems();\n\t\t\t\tif (!$this->blnEditMode)\n\t\t\t\t\t$this->lstCreatedByLogin->AddItem(QApplication::Translate('- Select One -'), null);\n\t\t\t\t$objCreatedByLoginArray = Login::LoadAll();\n\t\t\t\tif ($objCreatedByLoginArray) foreach ($objCreatedByLoginArray as $objCreatedByLogin) {\n\t\t\t\t\t$objListItem = new QListItem($objCreatedByLogin->__toString(), $objCreatedByLogin->Id);\n\t\t\t\t\tif (($this->objStewardshipBatch->CreatedByLogin) && ($this->objStewardshipBatch->CreatedByLogin->Id == $objCreatedByLogin->Id))\n\t\t\t\t\t\t$objListItem->Selected = true;\n\t\t\t\t\t$this->lstCreatedByLogin->AddItem($objListItem);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->lblCreatedByLoginId) $this->lblCreatedByLoginId->Text = ($this->objStewardshipBatch->CreatedByLogin) ? $this->objStewardshipBatch->CreatedByLogin->__toString() : null;\n\n\t\t\tif ($this->lstPaypalBatch) {\n\t\t\t\t$this->lstPaypalBatch->RemoveAllItems();\n\t\t\t\t$this->lstPaypalBatch->AddItem(QApplication::Translate('- Select One -'), null);\n\t\t\t\t$objPaypalBatchArray = PaypalBatch::LoadAll();\n\t\t\t\tif ($objPaypalBatchArray) foreach ($objPaypalBatchArray as $objPaypalBatch) {\n\t\t\t\t\t$objListItem = new QListItem($objPaypalBatch->__toString(), $objPaypalBatch->Id);\n\t\t\t\t\tif ($objPaypalBatch->StewardshipBatchId == $this->objStewardshipBatch->Id)\n\t\t\t\t\t\t$objListItem->Selected = true;\n\t\t\t\t\t$this->lstPaypalBatch->AddItem($objListItem);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->lblPaypalBatch) $this->lblPaypalBatch->Text = ($this->objStewardshipBatch->PaypalBatch) ? $this->objStewardshipBatch->PaypalBatch->__toString() : null;\n\n\t\t}",
"function reload_consensus( ) {\n\t\tif ( check_ajax_referer( 'ht-dms', 'nonce' ) ) {\n\n\t\t\t$dID = pods_v_sanitized( 'dID', 'post' );\n\t\t\tif ( $dID ) {\n\t\t\t\t$consensus = ht_dms_sorted_consensus_details( ht_dms_consensus_class()->sort_consensus( $dID, true ) );\n\t\t\t\twp_send_json( $consensus );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t}",
"public function refresh(): void\n {\n $this->query('SELECT 1')->execute();\n }"
] |
[
"0.54728454",
"0.5471684",
"0.54434055",
"0.54234797",
"0.5400114",
"0.53165555",
"0.52890617",
"0.5254038",
"0.5234782",
"0.5203394",
"0.51827973",
"0.5172557",
"0.50905883",
"0.5037387",
"0.5028398",
"0.4965485",
"0.49507892",
"0.49454638",
"0.49453503",
"0.49292684",
"0.4910662",
"0.48314142",
"0.4815693",
"0.4799021",
"0.4799021",
"0.4799021",
"0.4799021",
"0.47746363",
"0.47728646",
"0.47670618"
] |
0.83003294
|
0
|
Stops started Mink sessions.
|
public static function stopMinkSessions() {
self::$mink->stopSessions();
self::$mink = null;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop() {}",
"public function stop() {\n\t\t$this->invoke(\"stop\");\n\t}",
"public function stop()\n {\n }",
"abstract public function stop();",
"public static function stop()\n {\n if (self::$_sessionBenchmarkOn) {\n self::$_sessionBenchmarkFinish = microtime(TRUE);\n }\n }",
"public function stop(): void;",
"public function stop(): void;",
"public function stop(): void;",
"public function stop(): void;",
"public function stop(): void;",
"public static function stop()\n {\n }",
"public function stop()\n {\n // TODO: Implement stop() method.\n }",
"public function stop()\n {\n }",
"public function stop()\n {\n // nop\n }",
"public function stop()\r\n {\r\n\r\n }",
"public function stop()\n {\n\n }",
"public function stop()\n {\n // Put your code here;\n }",
"public function stop()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_STOPPED);\n\t}",
"public function stop() {\n\t\t// Setup\n\t\t$options = array(\n\t\t\t'appName' => 'cakedaemon',\n\t\t\t'logLocation' => TMP . \"logs\" . DS . 'cakedaemon.log'\n\t\t);\n\n\t\tSystem_Daemon::setOptions($options);\n\t\tSystem_Daemon::stopRunning();\n\t}",
"public function kill()\n {\n session_regenerate_id();\n $_SESSION[CCID] = array(); // session_unset();\n session_destroy();\n }",
"public function stop()\n {\n $this->mark('__stop');\n }",
"public function stop() {\n $cmd = sprintf(\"./control.sh stop %s -game %s\", $this->sid, $this->gameId);\n ssh($cmd, $this->host);\n DB::get()->query(\"UPDATE `servers` SET `status` = 0 WHERE `serverID` = '\" . $this->serverId . \"'\");\n }"
] |
[
"0.68962294",
"0.68962294",
"0.68962294",
"0.68962294",
"0.68962294",
"0.68962294",
"0.68962294",
"0.68962294",
"0.6855274",
"0.6817548",
"0.6588094",
"0.6573066",
"0.65690076",
"0.6564834",
"0.6564834",
"0.6564834",
"0.6564834",
"0.6564834",
"0.6544543",
"0.6535092",
"0.6528063",
"0.6467498",
"0.6445631",
"0.642154",
"0.6385136",
"0.6339436",
"0.63171124",
"0.6279615",
"0.62126136",
"0.61885786"
] |
0.8589254
|
1
|
Returns default show command.
|
private function getDefaultShowCmd() {
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return 'explorer.exe $s';
}
switch(PHP_OS) {
case 'Darwin':
return 'open %s';
case 'Linux':
case 'FreeBSD':
return 'xdg-open %s';
}
return null;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function show(command $command)\n {\n //\n }",
"public function show($command, $params, $user);",
"public function getCommand();",
"public function cli_help() {}",
"public function show()\n {\n $command = '';\n $results = '';\n return view('gae-support-l5::artisan', compact(['command', 'results']));\n }",
"public function show($id)\n {\n return 'show';\n }",
"public function show($id)\r\n {\r\n return 'show';\r\n }",
"public function getCommand()\n {\n return $this->getPath() . \" -\" . $this->getFlags();\n }",
"public function command(): string;",
"public function show($id)\n {\n return 'show';\n }",
"public function getCommand() {}",
"public function show($id)\n {\n \n return \"show\";\n }",
"public function getCommand()\n {\n }",
"public function getHelp()\n\t{\n\t return '<info>Console Tool</info>';\n\t}",
"public function show($id)\n {\n return\"show\";\n }",
"public function get_help(){\n $tmp=self::_pipeExec('\"'.$this->cmd.'\" --extended-help');\n return $tmp['stdout'];\n }",
"public function show() {\n\t}",
"public function show(/*$id*/)\n {\n return 'show';\n }",
"private function printListOfCommands()\n {\n /**\n * @var Padding\n */\n $padding = $this->cli->padding(50)->char(' ');\n $padding->label(' <bold><blue>show dbs:</blue></bold>')->result('show database names');\n $padding->label(' <bold><blue>show collection:</blue></bold>')->result('show collections in current database');\n $padding->label(' <bold><blue>use:</blue></bold>')->result('set current database');\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"protected function getConsole_Command_Extension_ShowService()\n {\n return $this->services['console.command.extension.show'] = new \\phpbb\\console\\command\\extension\\show(${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['log']) ? $this->services['log'] : $this->getLogService()) && false ?: '_'});\n }",
"public function command()\n\t{\n\t\treturn $this->command;\n\t}",
"public function command()\n\t{\n\t\treturn $this->command;\n\t}",
"public function getCommand()\n {\n return sprintf('use %s', $this->_tube);\n }",
"abstract protected function getCommand();",
"public function command()\n {\n return $this->command;\n }",
"public function fullCommand() {\n \n return str_finish(self::EXECUTABLE.' '.$this->options, ' ').$this->url;\n }",
"public function show()\n {\n return view('superadmin::show');\n }"
] |
[
"0.66694593",
"0.637217",
"0.63148296",
"0.62687373",
"0.62531674",
"0.6225458",
"0.6189536",
"0.6186525",
"0.6170437",
"0.6166553",
"0.6166497",
"0.61276996",
"0.61008567",
"0.60733634",
"0.6048689",
"0.6048275",
"0.6043454",
"0.60129493",
"0.59919757",
"0.5971635",
"0.5971635",
"0.5971635",
"0.5971109",
"0.59544814",
"0.59544814",
"0.5939506",
"0.5938412",
"0.5907166",
"0.59059906",
"0.59049577"
] |
0.7500238
|
1
|
Delete PlatformCode by ID
|
public function deleteById($platformcodeId);
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function delPlatform($id)\n {\n global $mysqli;\n $sql=\"DELETE FROM platforms WHERE platformID=$id \";\n $mysqli->query($sql)or die(\"query failed due to \".mysqli_error());\n logSuccess(\"platform deleted successfully\");\n }",
"public function deleteFromCode($code)\n {\n return parent::deleteFromCode($code);\n }",
"public function delete($code)\n {\n $this->_bootstrap();\n \n $resTable = Mage::getSingleton('core/resource')->getTableName('core/resource');\n $read = Mage::getSingleton('core/resource')->getConnection('core_read');\n $write = Mage::getSingleton('core/resource')->getConnection('core_write');\n \n $select = $read->select()->from($resTable, array('code', 'version', 'data_version'));\n $select->where('code = ?', $code);\n $resourceCollection = $read->fetchAll($select);\n if (count($resourceCollection) === 0) {\n throw new Exception(\n \"This resource does not exist in the core_resource table. \n Try running zf show mage-core-resource to find the correct name.\"\n );\n }\n \n $write->delete($resTable, \"code = '{$code}'\");\n $write->closeConnection();\n $this->_response->appendContent(\n \"Core Resource {$code} deleted successfully\",\n array('color' => array('green'))\n );\n }",
"public function delete_code($params=null) {\n $code_id = $params['code_id'];\n $uri = \"/cpaas/auth/v1/\".$this->client->user_id.\"/codes/\".$code_id;\n $url = $this->client->_root.$uri;\n $response = $this->client->_request('DELETE', $url);\n\n // check if test response\n if ($this->client->check_if_test($response)) {\n\n return $response;\n }\n // check if error response\n if ($this->client->check_if_error($response)) {\n $response = $this->client->build_error_response($response);\n\n return $response;\n }\n\n $custom_response = array();\n $custom_response['code_id'] = $code_id;\n $custom_response['success'] = true;\n\n return $custom_response;\n }",
"public function delete($id){\n\t\t$sql=\"DELETE FROM sy_color_codes WHERE id = ?\";\n\t\t$req = $this->runRequest($sql, array($id));\n\t}",
"public function deleteProgramDomainId();",
"public function destroy($id)\n {\n if (Auth::user()->ability('superadministrator', 'delete-platforms')){\n $platform=PlatForm::findOrFail($id);\n if ($platform->delete()){\n return redirect()->route('platforms.index')->with('success','Well Done!');\n }else{\n return redirect()->back()->with('error','Something Wrong!');\n }\n }\n return abort(403,config('yyxt.permission_deny'));\n }",
"function delete( $pc_id ) {\n\n $query = \"DELETE FROM \" . $this->partner_code_table . \" \" .\n \"WHERE pc_id='\" . $pc_id . \"'\";\n\n return( $this->gCI->db->query( $query ) );\n }",
"public function delete_promocode(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_PATH);\n\t\t}else {\n\t\t\t$promocode_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $promocode_id);\n\t\t\t$this->promocodes_model->commonDelete(PROMOCODES,$condition);\n\t\t\t$this->setErrorMessage('success','Promocode deleted successfully');\n\t\t\tredirect(ADMIN_PATH.'/promocodes/display_promocodes');\n\t\t}\n\t}",
"public function delete($id){\n\t\t$sql = 'DELETE FROM shoppingcart_courseregcodeitemannotation WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public static function deleteSite($code) {\n\t\t\\core\\Core::$db->exec('DELETE FROM \"ark_site\" WHERE si_code=?', array((string)$code));\n\t}",
"public function actionDeleteCode($id)\n {\n $this->findCodeModel($id)->delete();\n\n return $this->redirect(['promotions/codes']);\n }",
"function delete($code_zone)\n {\n $req = 'DELETE FROM ' . self::TABLE . ' WHERE ' . self::CODE_ZONE . '= :code_zone';\n $param = Array(\n ':code_zone' => $code_zone\n );\n\n return $this->execute($req, $param);\n }",
"public function destroy(Code $code)\n {\n //\n }",
"function deleteAbonne($code) {\n global $serv;\n $req = \"DELETE FROM abonnes WHERE Code = '$code';\";\n $res = db_execSQL($req,$serv);\n }",
"public function delete($GUN_BBL_CODE);",
"public function deleteForCode($id) {\n\t\t$q = $this->queryCode($id);\n\t\tif ($q->count() == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn boolval($q->delete());\n\t}",
"public function delete($code)\n {\n //this thread\n Thread::where('code',$code)->delete();\n }",
"public function delete($pk = null) {\r\n\t//public function delete($id) {\r\n\t\t$res = $this->jLanguageTable->delete($pk);\r\n\t\t$res = $res & $this->jfLanguageExt->delete($pk);\r\n\t\treturn $res;\r\n\t}",
"public function delete(){\n $id = $_POST['id'];\n Cita::destroy($id);\n }",
"public function destroy($id)\n {\n $industry= Industry::find($id)->delete();\n }",
"public function deleteByIdType($id, $type);",
"abstract public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"public function deleteById($id);",
"function delComponent($id);"
] |
[
"0.7288525",
"0.6505059",
"0.63998044",
"0.6319747",
"0.63186884",
"0.6250832",
"0.61340326",
"0.6104642",
"0.60968256",
"0.60391253",
"0.6032522",
"0.6001046",
"0.59929764",
"0.59882116",
"0.5975672",
"0.5854586",
"0.5850863",
"0.58318466",
"0.57893926",
"0.57674724",
"0.57528585",
"0.5727578",
"0.570817",
"0.56969965",
"0.56969965",
"0.56969965",
"0.56969965",
"0.56969965",
"0.56969965",
"0.5691493"
] |
0.8694049
|
0
|
getAllMattersParentChildrenListTrimmed is men to be used by search page on referrals page
|
public function getAllMattersParentChildrenListTrimmed()
{
$matters = self::getAllMatters();
$clean_matters = [];
foreach ($matters as $matter) {
$clean_matters[] = [
'id' => $matter['MatterID'],
'text' => $matter['MatterName'],
'ParentId' => $matter['ParentId'],
'ParentName' => $matter['ParentName'],
'MatterName' => $matter['MatterName'],
'MatterID' => $matter['MatterID'],
'Tag' => $matter['Tag'],
];
}
$matters = self::array_sort( $clean_matters, 'MatterName', SORT_ASC );
$output = self::buildTree($matters, 50) ;
return $output;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getSelectableParents()\n {\n $roles = $this->all();\n $tree = $this->findChildren($roles, 0, 1);\n\n //recursively go trough the array and delete....\n\n $trimmed_tree = $this->removeTreeNode($tree, $this->id);\n return $trimmed_tree;\n\n\n\n\n }",
"public function getMattersDatasetTrimmed()\n { \n $matters = self::getAllMattersParentChildrenListTrimmed();\n $dataset = [];\n foreach( $matters as $key => $matter ):\n \n //Copy matters removing their childrens and store it in the dataset\n $m_copy = $matter;\n unset($m_copy['children']);\n $dataset[$key] = $m_copy;\n \n if( isset( $matter['children'] ) ):\n\n $pos = 0;\n foreach( $matter['children'] as $first_child ):\n //For each subgroup of legal matters get the name and make it disable to select on plugin, un less is an specific issue of level 2\n if( isset( $first_child['children'] ) ):\n\n //Copy subgroup removing their childrens and store it in the dataset\n $fc_copy = $first_child;\n $fc_copy['disabled'] = true; //Disable to select on plugin\n $fc_copy['Tag'] .= ', ' . $matter['text']; //Add all specific matters to the sub group tags/keywords\n\n unset($fc_copy['children']);\n $parent_post = $pos;\n $dataset[$key]['children'][$pos] = $fc_copy;\n\n foreach( $first_child['children'] as $second_child ):\n //Each specific matter should be under each sub group title in the options with their own tag\n $pos++;\n\n if( !isset( $second_child['children'] ) ):\n $dataset[$key]['children'][$pos] = $second_child;\n endif;\n //Add all specific matters to the parent sub group tags/keywords\n $dataset[$key]['children'][$parent_post]['Tag'] .= ', ' . $second_child['text'];\n\n endforeach;\n\n else:\n $dataset[$key]['children'][$pos] = $first_child;\n endif;\n $pos++;\n endforeach;\n endif;\n\n endforeach;\n\n array_pop( $dataset );\n\n return array_reverse($dataset);\n }",
"public function get_parents(){\n\t\treturn $this->master->parent_list_construct();\n\t}",
"public function stageChildren()\n {\n return AdminHelp::get()->filter(array(\n 'ParentID' => $this->ID\n ));\n }",
"public function getAdminMenu( ) {\n \t$parent = $this->find('all', array(\n 'conditions' => array(\n 'Page.parent_id IS NULL',\n ),\n 'contain'=>array(\n ),\n 'fields'=>array('Page.lft', 'Page.rght'),\n 'order'=>array('Page.lft' => 'ASC')\n ));\n\t\t\n\t\t$recs = array(); \n foreach($parent as $v){\n \t$info = $this->find('threaded', array(\n\t 'conditions' => array(\n\t 'Page.lft >=' => $v['Page']['lft'], \n\t 'Page.rght <=' => $v['Page']['rght'],\n\t ),\n\t 'contain'=>array()\n\t ));\n\t \n\t $recs = array_merge($recs, $info);\n\t }\n\t\t\n\t\treturn $recs;\n }",
"public function primaries()\n {\n return Menu::doesntHave('parent')->paginate(request('perpage') ?? 10);\n }",
"public function getRenderParents(): bool;",
"function get_hierarchy_filter($setting,$optparent=null,$branchparent=0,$published=null,$maxlevel=9999)\n {\n $data=$this->_prepareData(null,$optparent,$published) ;\n $children=$this->_make_relation($data) ;\n // echo \"<br>---list Child----<br>\"; print_r($children);\n $list = $this->_filter_recurse($branchparent, $children, '', $maxlevel,0,'',$setting);\n //echo \"<br>---list ----<br>\"; print_r($list);\n return $list;\n }",
"public function getChildrenQuery()\n {\n return null;\n }",
"private function getParentsFilter() : string\n {\n return empty($this->parent) ? '' : ' AND \\'' . $this->parent . '\\' in parents';\n }",
"private function parents() {\n return array_map(array($this, 'page_info_from_id'), $this->parent_ids());\n }",
"public function getBrowsableTree() {}",
"public function getBrowsableTree() {}",
"protected function deleteChildren() {}",
"public function getBrowsableTree() {}",
"public function getFolderListLeavesOutNavigationalEntries() {}",
"function get_all_children_list()\r\n {\r\n $this->db->from($this->table);\r\n $this->db->where('removed', '0');\r\n $this->db->order_by('lastname', 'asc');\r\n $query = $this->db->get();\r\n\r\n return $query->result();\r\n }",
"public function getExpandedList() {}",
"public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function getParents() {}",
"public function all_parent()\r\n\t{\r\n\t\t$query = $this->db->select('*')->get('menu')->result_array(); \r\n\t \treturn $query;\r\n\t}",
"public function getChildrenForArbo()\n {\n $filtreEnfant = ' and 1=1 ';\n $oUtilisateur = Utilisateur::getConnected();\n if ($oUtilisateur && ! $oUtilisateur->isRoot()) {\n if ((sizeof(self::getForbiddenID($this->mode)) > 0)) {\n $filtreEnfant .= \" and ID_PAGE not in (\" . implode(',', self::getForbiddenID($this->mode)) . \")\";\n }\n }\n\n return $this->getChildren($filtreEnfant);\n }",
"public function getIsShowChildrenDefault();",
"public function grandChildren() {\n return $this->children()->children();\n }",
"private function get_filterItemsTree()\n {\n $arr_return = array();\n\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n\n // Set cObj->data treeview\n $this->cObjData_setFlagTreeview();\n // Set marker treeview\n $this->markerArray[ '###TREEVIEW###' ] = 1;\n\n // Get table and field\n //list( $table, $field ) = explode( '.', $this->curr_tableField );\n // Get TS filter configuration\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n //$conf_array = $this->conf_view['filter.'][$table . '.'][$field . '.'];\n // Needed for tree_setOneDim( )\n $this->arr_rowsTablefield = $this->rows;\n\n // Removes all rows with a null key\n // @todo: 120521, dwildt : rows with key null should removed before counting hits!\n // sum of hits can be wrong\n unset( $this->arr_rowsTablefield[ null ] );\n\n // Get the labels for the fields uid, value and treeParentField\n $this->uidField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n $this->valueField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n $this->treeParentField = $this->sql_filterFields[ $this->curr_tableField ][ 'treeParentField' ];\n\n\n\n// //////////////////////////////////////////////////////\n// //\n// // Order the values\n//\n// // Get the values for ordering\n// // @todo: 121018, dwildt, is multisort needed?\n// $arr_value = array( );\n// foreach ( $this->arr_rowsTablefield as $key => $row )\n// {\n// $arr_value[$key] = $row[$this->valueField];\n// }\n// // Get the values for ordering\n//\n// // Set DESC or ASC\n// if ( strtolower( $conf_array['order.']['orderFlag'] ) == 'desc' )\n// {\n// $order = SORT_DESC;\n// }\n// if ( strtolower( $conf_array['order.']['orderFlag'] ) != 'desc' )\n// {\n// $order = SORT_ASC;\n// }\n// // Set DESC or ASC\n//\n// // Order the rows\n// array_multisort( $arr_value, $order, $this->arr_rowsTablefield );\n// // Order the values\n\n unset( $this->tmpOneDim );\n // Parent uid of the root records: 0 of course\n $uid_parent = 0;\n // Set rows of the current tablefield to a one dimensional array\n $this->tree_setOneDim( $uid_parent );\n // Get the renderd tree. Each element of the returned array contains HTML tags.\n $arr_tableFields = $this->tree_getRendered();\n $items = implode( null, $arr_tableFields );\n unset( $this->tmpOneDim );\n\n\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n\n $items = $this->get_filterWrap( $items );\n\n // Unset cObj->data treeview\n $this->cObjData_unsetFlagTreeview();\n // Unset marker treeview\n unset( $this->markerArray[ '###TREEVIEW###' ] );\n\n // RETURN\n $trimItems = trim( $items );\n if ( !empty( $trimItems ) )\n {\n $arr_return[ 'data' ][ 'items' ] = $items;\n }\n else\n {\n unset( $arr_return );\n }\n return $arr_return;\n }",
"public function get_children();",
"private function _getAllPromotorParent()\n {\n // Get promotor parent\n $promotors = $this->promotor->getAllByType(['panasonic', 'arco', 'tl']); \n \n // Set container\n $parents = [\n 'data' => [],\n 'list' => []\n ];\n \n foreach ($promotors as $promotor)\n {\n $key = 'type-'.$promotor->type;\n \n if (!array_key_exists($key, $parents['data']))\n \n {\n $parents['data'][$key] = [];\n }\n \n $parents['data'][$key][] = (int) $promotor->ID;\n \n // Push parent to list\n $parents['list'][$promotor->ID] = $promotor->name .' ('. $promotor->type.')';\n }\n \n return $parents;\n }",
"public function parentList()\n {\n return output($this->UserDetails->where([\"roleId\"=>$this->getUserRoleId('parent')])->read(),'success','SM001','',\"\");\n }",
"public function getChildrenQuery();",
"public function admin_getParents() {\n\t\tif (empty($this->request->data[$this->modelClass]['menu_id'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->set('json', $this->{$this->modelClass}->getParents($this->request->data[$this->modelClass]['menu_id']));\n\t}"
] |
[
"0.6041208",
"0.5751979",
"0.5751957",
"0.55909216",
"0.55325735",
"0.5508117",
"0.5479631",
"0.54768145",
"0.53848267",
"0.5338396",
"0.53180057",
"0.53043497",
"0.53043497",
"0.5304182",
"0.5303072",
"0.53013927",
"0.5274685",
"0.525104",
"0.52434933",
"0.5240219",
"0.52382743",
"0.52246827",
"0.5219994",
"0.52106214",
"0.5198688",
"0.517941",
"0.51439106",
"0.5121234",
"0.50982594",
"0.5086684"
] |
0.780527
|
0
|
[getMattersDatasetTrimmed is used to provide an array to the search function that select2 uses in just 2 leves because more levels are not allowed]
|
public function getMattersDatasetTrimmed()
{
$matters = self::getAllMattersParentChildrenListTrimmed();
$dataset = [];
foreach( $matters as $key => $matter ):
//Copy matters removing their childrens and store it in the dataset
$m_copy = $matter;
unset($m_copy['children']);
$dataset[$key] = $m_copy;
if( isset( $matter['children'] ) ):
$pos = 0;
foreach( $matter['children'] as $first_child ):
//For each subgroup of legal matters get the name and make it disable to select on plugin, un less is an specific issue of level 2
if( isset( $first_child['children'] ) ):
//Copy subgroup removing their childrens and store it in the dataset
$fc_copy = $first_child;
$fc_copy['disabled'] = true; //Disable to select on plugin
$fc_copy['Tag'] .= ', ' . $matter['text']; //Add all specific matters to the sub group tags/keywords
unset($fc_copy['children']);
$parent_post = $pos;
$dataset[$key]['children'][$pos] = $fc_copy;
foreach( $first_child['children'] as $second_child ):
//Each specific matter should be under each sub group title in the options with their own tag
$pos++;
if( !isset( $second_child['children'] ) ):
$dataset[$key]['children'][$pos] = $second_child;
endif;
//Add all specific matters to the parent sub group tags/keywords
$dataset[$key]['children'][$parent_post]['Tag'] .= ', ' . $second_child['text'];
endforeach;
else:
$dataset[$key]['children'][$pos] = $first_child;
endif;
$pos++;
endforeach;
endif;
endforeach;
array_pop( $dataset );
return array_reverse($dataset);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getAllMattersParentChildrenListTrimmed()\n {\n $matters = self::getAllMatters();\n $clean_matters = [];\n foreach ($matters as $matter) {\n $clean_matters[] = [\n 'id' => $matter['MatterID'], \n 'text' => $matter['MatterName'], \n 'ParentId' => $matter['ParentId'], \n 'ParentName' => $matter['ParentName'],\n 'MatterName' => $matter['MatterName'],\n 'MatterID' => $matter['MatterID'],\n 'Tag' => $matter['Tag'],\n\n ];\n }\n $matters = self::array_sort( $clean_matters, 'MatterName', SORT_ASC ); \n $output = self::buildTree($matters, 50) ;\n return $output;\n }",
"protected function _prepareSubset() {}",
"private function filterLevels()\n {\n if(empty($this->levels)) {\n return;\n }\n\n $this->query->andWhere(['IN', 'level', $this->levels]);\n }",
"public function getMedicinesToSelectBox() {\n\t\t$data = $this->database->table(self::TABLE_NAME)->fetchAll();\n\t\t$result = [];\n\n\t\tforeach ($data as $key => $value)\n\t\t\t$result[$value->ID_leku] = $value->nazev_leku;\n\n\t\treturn $result;\n\t}",
"function getFilterLevel(){\n\t$data = M('user');\n\t$level_set = Array();\n\t$result = $data->where(Array('reserved_1' => 'normal'))->group('level')->order('level desc')->select();\n\tforeach($result as $value)\n\t\tarray_push($level_set, $value['level']);\n\n\treturn $level_set;\n}",
"public function substituteSubpartArrayDataProvider() {}",
"function calcDim_obsolete($model) {\r\n\r\n $xmin = 0;\r\n $xmax = 0;\r\n $ymin = 0;\r\n $ymax = 0;\r\n $zmin = 0;\r\n $zmax = 0;\r\n $firstvertex = true;\r\n \r\n $facets = $model->getFacets();\r\n \r\n foreach ($facets as $triangle) {\r\n \r\n $verts = array($triangle->v1(), $triangle->v2(), $triangle->v3());\r\n \r\n foreach ($verts as $v) {\r\n \r\n if ($firstvertex) {\r\n \r\n $xmin = $v->x();\r\n $xmax = $v->x();\r\n $ymin = $v->y();\r\n $ymax = $v->y();\r\n $zmin = $v->z();\r\n $zmax = $v->z();\r\n $firstvertex = false;\r\n \r\n } else {\r\n \r\n $vx = $v->x();\r\n $vy = $v->y();\r\n $vz = $v->z();\r\n \r\n if ($vx < $xmin)\r\n $xmin = $vx;\r\n\r\n if ($vx > $xmax)\r\n $xmax = $vx;\r\n\r\n if ($vy < $ymin)\r\n $ymin = $vy;\r\n\r\n if ($vy > $ymax)\r\n $ymax = $vy;\r\n\r\n if ($vz < $zmin)\r\n $zmin = $vz;\r\n\r\n if ($vz > $zmax)\r\n $zmax = $vz;\r\n }\r\n }\r\n }\r\n \r\n return array(\"DimX\" => $xmax - $xmin,\r\n \"DimY\" => $ymax - $ymin,\r\n \"DimZ\" => $zmax - $zmin);\r\n}",
"public function nilai_dimensi($mine,$data){\n\t\t$tahun=$data['tahun'];\n\t\t$hasil = $this->db->query(\"select b.id_rekomendasi,nilai,a.kriteria,b.top,b.bottom from (select AVG(hasilq1) as nilai,'Collaborate' kriteria,1 id from assessment where target='$mine' AND tahun=$tahun UNION\nselect AVG(hasilq2) as nilai,'Empower Diversity' kriteria,2 id from assessment where target='$mine' AND tahun=$tahun UNION\nselect AVG(hasilq3) as nilai,'Honesty' kriteria,3 id from assessment where target='$mine' AND tahun=$tahun UNION\nselect AVG(hasilq4) as nilai,'Commitment' kriteria,4 id from assessment where target='$mine' AND tahun=$tahun UNION\nselect AVG(hasilq5) as nilai,'Care & Polite' kriteria,5 id from assessment where target='$mine' AND tahun=$tahun UNION\nselect AVG(hasilq6) as nilai,'Fast & Easy' kriteria,6 id from assessment where target='$mine' AND tahun=$tahun UNION \nselect AVG(hasilq7) as nilai,'Adaptive & Creative' kriteria,7 id from assessment where target='$mine' AND tahun=$tahun UNION \nselect AVG(hasilq8) as nilai,'Persistent' kriteria,8 id from assessment where target='$mine' AND tahun=$tahun UNION \nselect AVG(hasilq9) as nilai,'Compliance' kriteria,9 id from assessment where target='$mine' AND tahun=$tahun UNION \nselect AVG(hasilq10) as nilai,'Risk Management' kriteria,10 id from assessment where target='$mine' AND tahun=$tahun ) a JOIN rekomendasi b on a.id=b.id_rekomendasi ORDER BY nilai DESC\");\n\t\tif($hasil->num_rows() > 0){\n\t\t\treturn $hasil->result();\n\t\t} else{\n\t\t\treturn array();\n\t\t}\n\t}",
"public function drillAcross(){\n $attendences = unserialize($_SESSION['attendences']);\n $hasteam = unserialize($_SESSION['hasteam']);\n $commonDimension = $_SESSION['commonDimension'];\n $commonTbl = explode('.',$commonDimension)[0];\n $measures1 = $_SESSION['measure'];\n $measures2 = $_SESSION['hasTeamMeasure'];\n $slices = $_SESSION['slice'];\n $mea2Col = explode('(',$measures2)[1];\n $mea2Col = explode(')',$mea2Col)[0];\n\n // Initialize query statement that will use in this function\n $select = 'SELECT DISTINCT ';\n $join = ' INNER JOIN ';\n $group = ' GROUP BY ';\n $on = ' ON ';\n $equal = ' = ';\n $apos = \"'\"; //apostrophe\n $from = \" FROM \";\n \n // start generate query by adding select statement\n $firstQuery = $select;\n $firstQuery .= ' * '.$from;\n $firstQuery .= $attendences->tblName.\" \";\n \n // If there is slice and dice\n if(!empty($slices)){\n // get all tableName for slice and dice\n foreach($slices as $key => $slice){\n $keyArr[] = $slice->dimension;\n }\n // get the unique table from key array\n $uniqueKey = array_unique($keyArr);\n foreach($uniqueKey as $ky){\n foreach($slices as $key => $slice){\n if($ky == $slice->dimension){\n $val[$ky][] = $slice->value;\n }\n }\n }\n // join the dimension for slice\n foreach($uniqueKey as $ky){\n $firstQuery .= $join;\n $refTbl = explode('.',$ky)[0];\n $firstQuery .= $refTbl;\n $firstQuery .= $on;\n $firstQuery .= $attendences->tblName . '.' . $attendences->reference[$refTbl];\n $firstQuery .= $equal;\n $firstQuery .= $refTbl .'.'.$attendences->dimension[$refTbl]->pkey.\" \";\n }\n\n // add where statement if there is slice\n // loop through all the value\n $firstQuery .= ' WHERE ';\n foreach($val as $dim => $values){\n $firstQuery .= $dim;\n $firstQuery .= ' IN (';\n foreach($values as $index=>$value){\n $firstQuery .= $apos.$value.$apos;\n if($value != end($values)){\n $firstQuery .= \",\";\n }\n }\n $firstQuery .= \")\";\n if($values != end($val)){\n $firstQuery .= \" AND \";\n }\n }\n }\n\n // Start generating outer query\n // outer query\n $secondQuery = 'SELECT ';\n\n // add measure from fact table 1\n if(!empty($measures1)){\n foreach($measures1 as $measure){\n $secondQuery .= $measure;\n if($measure != end($measures1)){\n $secondQuery .= \",\";\n }\n }\n }\n\n // add the selected common dimension and loop until the highest hierarchy\n $dimension = $attendences->dimension[$commonTbl];\n $cd = explode('.',$commonDimension)[1];\n $arrKey = array_keys($dimension->column);\n $index = array_search($cd,$arrKey);\n \n while($index != -1 ){\n $secondQuery.=',';\n $secondQuery .= $dimension->column[$arrKey[$index]].\" \";\n $index--;\n }\n\n // add measure from fact table 2\n if(!empty($measures2)){\n $secondQuery .= \",\";\n $secondQuery .= $measures2;\n\n }\n\n\n // concat the inner query to outer query\n $secondQuery .= $from;\n $secondQuery .= \"( \";\n $secondQuery .= $firstQuery;\n $secondQuery .= \") as tbl\";\n \n\n // join the unique table with second fact and common dimension\n $secondQuery .= $join;\n $secondQuery .= $hasteam->tblName . $on;\n $secondQuery .= 'tbl'.\".\";\n $secondQuery .= $attendences->reference[$commonTbl];\n $secondQuery .= $equal;\n $secondQuery .= $hasteam->tblName.\".\".$hasteam->reference[$commonTbl];\n\n $secondQuery .= $join;\n $secondQuery .= $commonTbl . $on;\n $secondQuery .= $hasteam->tblName.\".\".$hasteam->reference[$commonTbl];\n $secondQuery .= $equal;\n $secondQuery .= $commonTbl.\".\".$attendences->dimension[$commonTbl]->pkey;\n \n\n // add the group by statement by looping until highest hierarchy\n $secondQuery .= $group;\n $dimension = $attendences->dimension[$commonTbl];\n $cd = explode('.',$commonDimension)[1];\n $arrKey = array_keys($dimension->column);\n $index = array_search($cd,$arrKey);\n \n while($index != -1 ){\n $secondQuery .= $dimension->column[$arrKey[$index]].\" \";\n $index--;\n if($index != -1){\n $secondQuery.=',';\n }\n }\n\n // Display the result dynamically same as generatePivot()\n // Start PDO connection\n $pivotStmt = $this->connect()->prepare($secondQuery);\n $pivotStmt->execute();\n\n $ttlCol = $pivotStmt->columnCount();\n $column = array();\n\n for ($counter = 0; $counter < $ttlCol; $counter ++) {\n $meta = $pivotStmt->getColumnMeta($counter);\n $column[] = $meta['name'];\n }\n \n $result = array();\n\n if($pivotStmt->rowCount()){\n while($row = $pivotStmt->fetch()){\n foreach($column as $col){\n $result[$col][] = $row[$col];\n }\n }\n\n $rowCount = $pivotStmt->rowCount();\n print('<div class=\"container-fluid\">');\n print('<div class=\"table-responsive table-responsive-sm\">');\n print \"<table class='table table-striped table-hover'>\";\n print '<thead class=\"\"><tr>';\n print '<tr>';\n for($j=0;$j<2;$j++){\n print '<th>'.'</th>';\n }\n $colspan = $ttlCol - 1;\n print '</tr>';\n print(\"<th scope='row'> Count </th>\");\n foreach($column as $col){\n print '<th>'.$col.'</th>';\n }\n print '</tr>';\n print '</thead>';\n for($i=0; $i < $rowCount; $i++){\n print('<tr>');\n print(\"<td scope='row'>\".$i.\"</td>\");\n foreach($column as $col){\n print('<td>'.$result[$col][$i].'</td>');\n }\n print('</tr>');\n }\n print '</table>';\n print '</div>';\n print '</div>';\n\n } \n }",
"public function getFiltred(array &$data);",
"private function processExtraData() {\n $benchsDatasize = $this->dbConnection->get_rows(\"SELECT DISTINCT bench_type,bench,datasize FROM aloja2.execs e WHERE 1 AND valid = 1 AND filter = 0 \".DBUtils::getFilterExecs().\" GROUP BY bench_type,bench,datasize ORDER BY bench ASC \");\n $dataBenchs = array();\n $availDatasizes = array();\n foreach($benchsDatasize as $row) {\n $datasize = $this->roundDatasize($row['datasize']);\n if(!isset($availDatasizes[$row['bench_type']]) ||\n !isset($availDatasizes[$row['bench_type']][$row['bench']]) ||\n !in_array($datasize, $availDatasizes[$row['bench_type']][$row['bench']])) {\n $dataBenchs[$row['bench_type']][$row['bench']][] = $row['datasize'];\n $availDatasizes[$row['bench_type']][$row['bench']][] = $datasize;\n }\n }\n\n $this->additionalFilters['datasizesInfo'] = json_encode($dataBenchs);\n\n //Getting scale factors per bench\n $scaleFactors = array();\n $benchsScaleFactors = $this->dbConnection->get_rows(\"SELECT DISTINCT bench_type,bench,scale_factor FROM aloja2.execs e WHERE 1 AND valid = 1 AND filter = 0 \".DBUtils::getFilterExecs().\" GROUP BY bench_type,bench,scale_factor ORDER BY bench ASC \");\n foreach($benchsScaleFactors as $row) {\n $scaleFactor = $row['scale_factor'];\n $scaleFactors[$row['bench_type']][$row['bench']][] = $scaleFactor;\n }\n\n $this->additionalFilters['scaleFactorsInfo'] = json_encode($scaleFactors);\n\n //Getting providers / clusters\n $providerClusters = array();\n $clusters = $this->dbConnection->get_rows(\"SELECT provider,id_cluster FROM aloja2.clusters ORDER BY provider DESC \");\n foreach($clusters as $row) {\n $providerClusters[$row['provider']][] = $row['id_cluster'];\n }\n\n $this->additionalFilters['providerClusters'] = json_encode($providerClusters);\n }",
"function get_model_option_items($model_structure, $current_model_id, $mark_id, $level)\n {\n if (is_array($model_structure['childs'][$mark_id])) {\n foreach ($model_structure['childs'][$mark_id] as $model_id) {\n if ($current_model_id == $model_id) {\n $selected = \" selected \";\n } else {\n $selected = \"\";\n }\n $rs .= '<option value=\"' . $model_id . '\" ' . $selected . '>' . str_repeat(' * ', $level + 2) . $model_structure['model'][$model_id]['name'] . '</option>';\n //$rs .= '<option value=\"'.$model_id.'\" '.$selected.'>'.str_repeat(' _ ', $level+1).$model_id.'</option>';\n //$rs .= $this->get_model_option_items( $model_structure, $current_model_id );\n }\n }\n return $rs;\n }",
"public function filters() {\n\t\treturn array(\n\t\t 'name' => array(array('trim')),\n\t\t);\n\t}",
"public function trimSqlReallyTrimsAllWhitespaceDataProvider() {}",
"public function morphologys2()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_morphology', 'morphology_id', 'se_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'morphology_id', 'org_id', 'project_id', 'created_by', 'updated_by')\n ->withTimestamps();\n }",
"public function select_datasets()\n {\n return array_diff($this->db->list_tables(), array('users', 'users_groups', 'user_visualisation', 'places', 'groups', 'login_attempts'));\n }",
"public function filters()\n {\n return [\n 'src' => \"trim\"\n ];\n }",
"public function filtering();",
"public function stripGroupByForGroupByKeywordDataProvider() {}",
"public function getCommonSelectFieldsReturnsCorrectFieldsDataProvider() {}",
"public function LcargarComboUnidadMedidaMaterialSeleccionado($datos) {\n $oDLaboratorio = new DLaboratorio();\n $resultado = $oDLaboratorio->DcargarComboUnidadMedidaMaterialSeleccionado($datos);\n return $resultado;\n }",
"public function substituteMarkerAndSubpartArrayRecursiveResolvesMarkersAndSubpartsArrayDataProvider() {}",
"public function filtering(): string;",
"public function LcargarComboTipoUnidadMedidaMaterialSeleccionado($datos) {\n $oDLaboratorio = new DLaboratorio();\n $resultado = $oDLaboratorio->DcargarComboTipoUnidadMedidaMaterialSeleccionado($datos);\n return $resultado;\n }",
"public function selectMix($data)\n {\n $explode = strtoupper($data['search']['value']);\n $res = $this->db->query(\n \"SELECT kdav.*\n FROM\n (\n SELECT\n skdav.*,\n ROW_NUMBER () OVER (ORDER BY production_date DESC) as pagination\n FROM\n (\n SELECT mfo.*\n FROM\n (SELECT mm.*, ma.kode kode\n FROM mo.mo_mixing mm, mo.mo_absensi ma\n WHERE ma.id_produksi = mm.mixing_id AND ma.category_produksi = 'Mixing'\n GROUP BY mm.mixing_id, ma.kode\n ORDER BY extract(month from mm.production_date) desc, extract(year from mm.production_date) desc, extract(day from mm.production_date), ma.kode) mfo\n WHERE\n (\n component_code LIKE '%{$explode}%'\n OR component_description LIKE '%{$explode}%'\n OR production_date::text LIKE '%{$explode}%'\n OR shift LIKE '%{$explode}%'\n OR kode LIKE '{%$explode%}'\n )\n ) skdav\n ) kdav\n WHERE\n pagination BETWEEN {$data['pagination']['from']} AND {$data['pagination']['to']}\"\n )->result_array();\n\n return $res;\n }",
"public function morphologys1()\n {\n return $this->belongsToMany('App\\SkeletalElement', 'se_morphology', 'se_id', 'morphology_id')\n ->withoutGlobalScope(ProjectScope::class)\n ->withPivot('se_id', 'morphology_id', 'org_id', 'project_id', 'created_by', 'updated_by')\n ->withTimestamps();\n }",
"protected function filterDropdownFields(): array\n {\n return [];\n }",
"public function LcargarComboTipoUnidadMedidaMuestraSeleccionado() {\n $oDLaboratorio = new DLaboratorio();\n $resultado = $oDLaboratorio->DcargarComboTipoUnidadMedidaMuestraSeleccionado();\n return $resultado;\n }",
"private function _sanitize_data($data){\n\t\t// Remove fields which potentially can damage the tree structure\n\t\tif(is_array($data))\n\t\t{\n\t\t\tunset($data['lft']);\n\t\t\tunset($data['rgt']);\n\t\t}\n\t\telseif(is_object($data))\n\t\t{\n\t\t\tunset($data->lft);\n\t\t\tunset($data->rgt);\n\t\t}\n\n\t\tif(isset($data['type']))\n\t\t{\n\t\t\t$data['type'] = implode('|', $data['type']);\n\t\t}\n\n\t\t// ensure entry_id is set correctly for sql strict_mode\n\t\tif(isset($data['entry_id']) && $data['entry_id'] != '')\n\t\t{\n\t\t\t$data['entry_id'] = (int) $data['entry_id'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['entry_id'] = NULL;\n\t\t}\n\n\t\tunset($data['tree_id']);\n\t\tunset($data['is_root']);\n\t\tunset($data['parent_lft']);\n\t\treturn $data;\n\t}",
"public function normalizeData() : array;"
] |
[
"0.49565417",
"0.474383",
"0.46065176",
"0.4442641",
"0.44393682",
"0.44177708",
"0.4400285",
"0.43622193",
"0.43422592",
"0.43101874",
"0.43053916",
"0.43047035",
"0.430197",
"0.42942518",
"0.42784917",
"0.42692244",
"0.42650217",
"0.42218328",
"0.42133167",
"0.4193449",
"0.41784453",
"0.4158365",
"0.41491506",
"0.41441262",
"0.4136871",
"0.41314772",
"0.41174302",
"0.41015658",
"0.40998656",
"0.40997186"
] |
0.6819859
|
0
|
Test that we can construct an instance of UrlResult
|
public function test__construct()
{
$urlResult = new \MphpFlickrPhotosGetInfo\Result\UrlResult($this->getAdapter());
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testGetUrl()\n {\n $urlResult = new \\MphpFlickrPhotosGetInfo\\Result\\UrlResult($this->getAdapter());\n $this->assertSame($this->getAdapter()->getUrl(), $urlResult->getUrl());\n }",
"public function testGetUrlParams()\n {\n //Mock request\n $request = Mockery::mock('Request');\n $request->shouldReceive(\"get\")->andReturn([\n 'test1' => '11111',\n 'test2' => '22222',\n '_url' => 'http://www.test.com/',\n ]);\n\n //register\n $this->di->set('request', $request, true);\n\n //create class\n $class = new ControllerBase();\n\n $result = $this->callMethod(\n $class,\n 'getUrlParams',\n []\n );\n\n //check result\n $this->assertInternalType('array', $result);\n $this->assertEquals($result['test1'], '11111');\n $this->assertEquals($result['test2'], '22222');\n }",
"public function testUrlReconstruction() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['TestQuery']);\n\n\t\t(new Verify(\n\t\t\t'check that GetURL() reconstructed an accurate URL.',\n\t\t\t$router->GetURL()\n\t\t))->equals('http://www.nether.io/test');\n\n\t\treturn;\n\t}",
"public function create( $url );",
"public function testToValueMakeUrl()\n {\n $expected = Url::class;\n\n $input = [\n 'type' => 'uri.url',\n 'value' => 'https://as.xcd'\n ];\n\n $sut = new Value();\n\n $result = $sut->toValue($input);\n\n $this->assertInstanceOf($expected, $result);\n }",
"public function createRequest($url);",
"public function testGetType()\n {\n $urlResult = new \\MphpFlickrPhotosGetInfo\\Result\\UrlResult($this->getAdapter());\n $this->assertSame($this->getAdapter()->getType(), $urlResult->getType());\n }",
"public function testConstructorCreateUrl($expectedUrl, $dbObj)\n {\n $resultUrl = $dbObj->getUrl(); \n $this->assertEquals($expectedUrl, $resultUrl);\n }",
"public function create($urlact, $url);",
"public function createReturnsUrlAndToken()\n {\n $expectedToken = 'cadec62c0cf4d12ff0a0a2ba77641aa8c9362eb4c9352762fc39a4d42d8658c9';\n $this->tokenMock->method('random')\n ->willReturn($expectedToken);\n\n $urlSubstring = 'omise/callback/threedsecure';\n $expectedUrl = \"http://localhost/{$urlSubstring}?token={$expectedToken}\";\n\n $this->urlMock->method('getUrl')\n ->willReturn($expectedUrl);\n\n $urlArray = $this->model->create($urlSubstring);\n\n $this->assertEquals(count($urlArray), 2);\n $this->assertArrayHasKey('token', $urlArray);\n $this->assertArrayHasKey('url', $urlArray);\n $this->assertEquals($urlArray['url'], $expectedUrl);\n $this->assertEquals($urlArray['token'], $expectedToken);\n }",
"public function testGetUrl_urlSet_setReturned()\n {\n $sEndpointUrl = 'http://www.oxid-esales.com/index.php?anid=article';\n\n $oCurl = oxNew('oxCurl');\n $oCurl->setUrl($sEndpointUrl);\n $sUrlToCall = $oCurl->getUrl();\n\n $this->assertEquals($sEndpointUrl, $sUrlToCall, 'Url should be same as provided from config.');\n }",
"protected function createUrl($url)\n {\n return new Url($url);\n }",
"public function test($url)\n {\n }",
"public function fetchResult($url);",
"public function make($url)\n {\n return new Url($url);\n }",
"public function test_getUrl_returnsString()\n\t{\n\t\t$url = 'http://example.com';\n\t\t\n\t\t$request = new Post($url);\n\t\t\n\t\t$this->assertEquals($url, $request->getUrl());\n\t}",
"public static function from_url($url)\n {\n }",
"public function test_it_should_throw_an_exception_on_invalid_url()\n {\n SourceFactory::create('unknown');\n }",
"public function testGetUrl() {\n $link = $this->getMock('Route\\RouteLink');\n $link->test = 1;\n $name = new Route\\RouteName('url-name', $link);\n $this->assertEquals('url-name', $name->GetUrl());\n }",
"public function testGetUrlsUsingPOST()\n {\n }",
"public function __construct(protected string $url)\n {\n //\n }",
"function __construct($url)\n {\n $this->url = $url;\n }",
"public function __construct(UrlGenerator $url)\n {\n $this->url = $url;\n }",
"public function testUrlFunction(): void\n {\n $this->assertSame(Router::url('/'), url('/'));\n }",
"public function test_it_should_not_throw_en_exception_on_valid_url($url = '', $expected = '')\n {\n $actual = SourceFactory::create($url);\n $this->assertInstanceOf($expected, $actual);\n }",
"public function testURL()\r\n {\r\n\r\n $testData = array(\r\n 'url' => '',\r\n 'url2' => '1e20',\r\n 'url3' => false,\r\n 'url4' => 'invalid.domain.111 ',\r\n 'url5' => 'http://abv.bg'\r\n );\r\n\r\n $validator = new Validator($testData);\r\n $validator->addRule('url', 'url', ['url']);\r\n $validator->addRule('url2', 'url2', ['required', 'url']);\r\n $validator->addRule('url3', 'url3', ['required', 'url']);\r\n $validator->addRule('url4', 'url4', ['required', 'url']);\r\n $validator->addRule('url5', 'url5', ['required', 'url']);\r\n\r\n $this->assertFalse($validator->validate());\r\n $this->assertFalse($validator->isValid());\r\n\r\n\r\n /** The field is not required, so it can be empty and contains no valid url name */\r\n $this->assertFalse($validator->hasErrors('url'), $validator->getFieldError('url'));\r\n $this->assertTrue($validator->hasErrors('url2'), $validator->getFieldError('url2'));\r\n $this->assertTrue($validator->hasErrors('url3'), $validator->getFieldError('url3'));\r\n $this->assertTrue($validator->hasErrors('url4'), $validator->getFieldError('url4'));\r\n $this->assertFalse($validator->hasErrors('url5'), $validator->getFieldError('url5'));\r\n }",
"public function __construct($url){\n $this->url = $url;\n }",
"public function __construct(Url $url) {\n $this->url = $url;\n }",
"public function __construct()\r\n {\r\n $this->geturl();\r\n }",
"public function testUrlFullUrlReturnFromRoute(): void\n {\n $url = 'http://example.com/posts/view/1';\n\n $route = $this->getMockBuilder('Cake\\Routing\\Route\\Route')\n ->onlyMethods(['match'])\n ->setConstructorArgs(['/{controller}/{action}/*'])\n ->getMock();\n $route->expects($this->any())\n ->method('match')\n ->willReturn($url);\n\n Router::createRouteBuilder('/')->connect($route);\n\n $result = Router::url(['controller' => 'Posts', 'action' => 'view', 1]);\n $this->assertSame($url, $result);\n }"
] |
[
"0.7427949",
"0.6502077",
"0.6494774",
"0.63784486",
"0.63549155",
"0.63417876",
"0.6287089",
"0.6260201",
"0.6237623",
"0.62372756",
"0.6195931",
"0.61865216",
"0.61578786",
"0.6105983",
"0.60349333",
"0.6012021",
"0.60075116",
"0.5986312",
"0.5970276",
"0.59052426",
"0.588436",
"0.5868115",
"0.58332855",
"0.5770734",
"0.5736692",
"0.5733681",
"0.5723312",
"0.5690576",
"0.56791395",
"0.5676317"
] |
0.72890127
|
1
|
Test that attempting to construct with an invalid adapter throws an InvalidAdapterException
|
public function test__constructThrowsInvalidAdapterException()
{
$mockAdapter = $this->getMock('MphpFlickrBase\Adapter\Interfaces\Result\ResultAdapterInterface');
$this->assertInstanceOf('MphpFlickrBase\Adapter\Interfaces\Result\ResultAdapterInterface', $mockAdapter);
$this->assertNotInstanceOf('MphpFlickrPhotosGetInfo\Adapter\Interfaces\Result\TagResultAdapterInterface', $mockAdapter);
$urlResult = new \MphpFlickrPhotosGetInfo\Result\UrlResult($mockAdapter);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testCreateWillThrowFactoryExceptionIfProvidedAdapterIsInvalid(): void\r\n {\r\n $factory = new ContainerFactory();\r\n\r\n $config = [\r\n 'adapter' => 123, // invalid adapter!\r\n ];\r\n\r\n $this->expectException(FactoryException::class);\r\n $this->expectExceptionMessage(sprintf(\r\n 'The \\'adapter\\' configuration option must be a object of type \\'%s\\'; \\'%s\\' provided in \\'%s\\'',\r\n ContainerAdapterInterface::class,\r\n gettype($config['adapter']),\r\n ContainerFactory::class\r\n ));\r\n\r\n $factory->create($config);\r\n }",
"public function testInvalidTypeException() {\n\t\t$options = array(\n\t\t\t'adapter' => 'foo'\n\t\t);\n\t\t$this->expectException('/Could not find adapter `Foo`/');\n\t\tFixture::load('models/Posts', $options);\n\t}",
"public function testCreateWillThrowFactoryExceptionIfTheAdapterConfigurationOptionIsNotProvided(): void\r\n {\r\n $factory = new ContainerFactory();\r\n\r\n $this->expectException(FactoryException::class);\r\n $this->expectExceptionMessage(sprintf(\r\n 'The \\'adapter\\' configuration option is required in \\'%s\\'',\r\n ContainerFactory::class\r\n ));\r\n\r\n $factory->create([]);\r\n }",
"protected function _checkAdapter()\n {\n $notDefined = !is_object($this->_adapter);\n $isAdapter = $this->_adapter instanceof AdapterInterface;\n\n if ($notDefined || !$isAdapter) {\n throw new InvalidArgumentException(\n \"You need to set the database adapter for this schema loader.\"\n );\n }\n }",
"public function testConstructorInvalidType()\n\t{\n\t\t$this->expectException(\\RuntimeException::class);\n\t\tnew Builder('foo');\n\t}",
"public function testCreatingNewAssettoCorsaReaderWithInvalidData()\n {\n $this->expectException(\\Simresults\\Exception\\CannotReadData::class);\n $reader = new Data_Reader_AssettoCorsa('Unknown data for reader');\n }",
"public function testConstructorWithBadTxTypeThrowsException(): void\r\n {\r\n $this->expectException(TransactionException::class);\r\n $this->expectExceptionMessageRegExp('/string or array/');\r\n\r\n $obj = new \\stdClass();\r\n new Transaction($obj);\r\n }",
"abstract protected function createAdapter();",
"public function paginatorAdapterQuerybuilderConstructException(DatabaseTester $I)\n {\n $I->wantToTest('Paginator\\Adapter\\QueryBuilder - __construct() - exception');\n\n $I->expectThrowable(\n new Exception(\n \"Parameter 'builder' must be an instance \" .\n \"of Phalcon\\Mvc\\Model\\Query\\Builder\"\n ),\n function () {\n $paginator = new QueryBuilder(\n [\n 'builder' => new stdClass(),\n 'limit' => 10,\n 'page' => 1,\n ]\n );\n }\n );\n }",
"public function testDiceInvalidRegister()\n {\n $dice = new DiceAdapter();\n $dice->register();\n }",
"public function testItShouldThrowExceptionWhenInvalidConfigOptions()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('List drivers MUST not empty.');\n\n new ChainDriver([]);\n }",
"public function testCallingGetOauthModelWithoutADatabaseAdapterThrowsAnException()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage('Db Must be provided to get Oauth Model');\n $this->expectExceptionCode(0);\n\n $request = new Request($this->config, []);\n $request->getOauthModel();\n }",
"public function testInvalidBundle() {\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessage('Could not load the \"invalid\" order item type.');\n\n $order_item = OrderItem::create([\n 'type' => 'invalid',\n 'title' => 'My order item',\n 'quantity' => '2',\n 'unit_price' => new Price('9.99', 'USD'),\n ]);\n }",
"public function testNotMarshallsDueToInvalidItemType()\n {\n $this->marshaller->marshall(array());\n }",
"public function testAddExeptionForInvalidTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::create('table1');\n }",
"public function testContainerDoesntAcceptInvalidConfigType()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container(new \\stdClass());\n }",
"public function testMakeWithInvalidDriverThrowsException()\n\t{\n\t\t\\Orchestra\\Widget::make('menus');\n\t}",
"public function testInvalidClient()\n {\n $this->expectException(\\Exception::class);\n $cl = CF::getClient([\n \"registrar\" => \"InvalidRegistrar\"\n ]);\n }",
"public function testXMLtoArrayFunctionWithNotValidXML()\n {\n $this->expectException(InvalidXMLFormat::class);\n\n $this->mockTrait->xmlToArray('not xml');\n }",
"public function testUnknownDataSourceType(): void\n {\n $dataSourceType = 'not-handled';\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage(\n AssertionException::inArray(\n $dataSourceType,\n MetaService::AVAILABLE_DATA_SOURCE_TYPES,\n 'MetaService::dataSourceType'\n )->getMessage()\n );\n new MetaService(1, 'Meta 1', 'average', 1, $dataSourceType);\n }",
"protected static function createAdapterFromItems($items)\n {\n if ($items instanceof Traversable) {\n $items = ArrayUtils::iteratorToArray($items);\n }\n if (! is_array($items)) {\n throw new Exception\\InvalidArgumentException(\n 'The factory needs an associative array '\n . 'or a Traversable object as an argument when '\n . \"it's used with one parameter\"\n );\n }\n if (! isset($items['adapter']) && ! isset($items['items'])) {\n throw new Exception\\InvalidArgumentException(\n 'The factory needs an associative array '\n . 'or a Traversable object with keys '\n . '\"adapter\" and \"items\"'\n );\n }\n $adapter = $items['adapter'];\n $items = $items['items'];\n\n return static::getAdapterFromManager($items, $adapter);\n }",
"public function testImportingQueueEngineFailure(): void\n {\n $this->expectException('\\InvalidArgumentException');\n\n Queue::setConfig('fail', []);\n Queue::engine('fail');\n }",
"public function testConstructor_invalidClass()\n {\n new DataPoint('uniqueid', 'an offense', new \\DateTime(), 'Gotham', ['lat' => 0, 'lon' => 0], 'FELONY', '1337');\n }",
"public function testInvalidDriver () {\n $extension = new AlyxGrayOathTokenExtension();\n $config = $this->getConfig ('invalid_driver');\n $extension->load (array ($config), new ContainerBuilder());\n }",
"public function createAdapter() : AdapterInterface;",
"public function testInvalidConfigurationForConstructor($config)\n {\n new AbstractConfigurationInstance($config);\n }",
"public function testOfMethodThrowsException()\n {\n $this->expectException('InvalidArgumentException');\n\n $stub = new Grid($this->getContainer(), []);\n $stub->of('id');\n }",
"public function testGetNodeWhenInvalid()\n {\n // stub `get node` method from `configurator` mock\n $this->configurator->expects($this->once())\n ->method('getNode')\n ->with($this->equalTo('something'))\n ->will($this->throwException(new \\RuntimeException()));\n\n // create new `client`\n $client = new Client($this->configurator);\n\n // assert\n $client->getNode('something');\n }",
"public function testCreate()\n {\n $exception = InvalidArgumentException::create('tested value', 123.456, ['string', GrammarInterface::class]);\n $this->assertEquals(\n 'Tested value expected to be string or Finesse\\QueryScribe\\GrammarInterface, double given',\n $exception->getMessage()\n );\n\n $exception = InvalidArgumentException::create('Argument $foo', new Raw(''), ['foo']);\n $this->assertEquals(\n 'Argument $foo expected to be foo, Finesse\\QueryScribe\\Raw given',\n $exception->getMessage()\n );\n }",
"public static function adapterNotFound()\n {\n return new self('Cannot resolve adapter for Pagerfanta with the dataset included.');\n }"
] |
[
"0.7950066",
"0.7397903",
"0.6794294",
"0.66880673",
"0.65995187",
"0.6472877",
"0.6406719",
"0.6368889",
"0.6308904",
"0.62370926",
"0.6162188",
"0.61039186",
"0.60891813",
"0.60059494",
"0.6003531",
"0.5996118",
"0.5918089",
"0.58713216",
"0.58711827",
"0.58585757",
"0.5852121",
"0.58487034",
"0.5836569",
"0.5832237",
"0.5822868",
"0.5822854",
"0.58208257",
"0.58130103",
"0.58093625",
"0.5778568"
] |
0.77857065
|
1
|
Test that we can retrieve the url value
|
public function testGetUrl()
{
$urlResult = new \MphpFlickrPhotosGetInfo\Result\UrlResult($this->getAdapter());
$this->assertSame($this->getAdapter()->getUrl(), $urlResult->getUrl());
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function test_getUrl_returnsString()\n\t{\n\t\t$url = 'http://example.com';\n\t\t\n\t\t$request = new Post($url);\n\t\t\n\t\t$this->assertEquals($url, $request->getUrl());\n\t}",
"public function testGetUrl_urlSet_setReturned()\n {\n $sEndpointUrl = 'http://www.oxid-esales.com/index.php?anid=article';\n\n $oCurl = oxNew('oxCurl');\n $oCurl->setUrl($sEndpointUrl);\n $sUrlToCall = $oCurl->getUrl();\n\n $this->assertEquals($sEndpointUrl, $sUrlToCall, 'Url should be same as provided from config.');\n }",
"public function testGetURL()\n {\n $pagSeguroController = new PagSeguroController();\n\n $url = $pagSeguroController->getURL('/teste');\n\n if($pagSeguroController::MODE == 'development') {\n $this->assertEquals('https://ws.sandbox.pagseguro.uol.com.br/teste', $url);\n } else {\n $this->assertEquals('https://ws.pagseguro.uol.com.br/', $url);\n }\n }",
"public function get_url();",
"public function test($url)\n {\n }",
"public function testIfStockManagementHasUrl()\n {\n $this->assertNotNull($this->stock->getUrl());\n }",
"public function getURL();",
"public function getURL();",
"abstract public function get_url_read();",
"function get_url()\n {\n }",
"public function testDemoteAutomatchUrlUsingGET()\n {\n }",
"public function getURL ();",
"public function testURL()\r\n {\r\n\r\n $testData = array(\r\n 'url' => '',\r\n 'url2' => '1e20',\r\n 'url3' => false,\r\n 'url4' => 'invalid.domain.111 ',\r\n 'url5' => 'http://abv.bg'\r\n );\r\n\r\n $validator = new Validator($testData);\r\n $validator->addRule('url', 'url', ['url']);\r\n $validator->addRule('url2', 'url2', ['required', 'url']);\r\n $validator->addRule('url3', 'url3', ['required', 'url']);\r\n $validator->addRule('url4', 'url4', ['required', 'url']);\r\n $validator->addRule('url5', 'url5', ['required', 'url']);\r\n\r\n $this->assertFalse($validator->validate());\r\n $this->assertFalse($validator->isValid());\r\n\r\n\r\n /** The field is not required, so it can be empty and contains no valid url name */\r\n $this->assertFalse($validator->hasErrors('url'), $validator->getFieldError('url'));\r\n $this->assertTrue($validator->hasErrors('url2'), $validator->getFieldError('url2'));\r\n $this->assertTrue($validator->hasErrors('url3'), $validator->getFieldError('url3'));\r\n $this->assertTrue($validator->hasErrors('url4'), $validator->getFieldError('url4'));\r\n $this->assertFalse($validator->hasErrors('url5'), $validator->getFieldError('url5'));\r\n }",
"public abstract function getURL();",
"protected static function _url(){\n if (self::$_ruleValue) {\n $str = filter_var(trim(self::$_elementValue), FILTER_VALIDATE_URL);\n if (!$str) {\n self:: setErrorMessage(\"Enter valid URL\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }",
"public function testSetAndGetUrl()\n {\n $url = \"data/2.5/weather?lat=&lon=&appid=&units=metric\";\n $this->getWeather->setUrl();\n $expected = $this->getWeather->getUrl();\n\n $this->assertEquals($url, $expected);\n }",
"public function testUrlSetting()\n {\n $this->assertEquals(\n $this->graphDbUri,\n $this->graphDb->getBaseUri(),\n 'Hm, it seems like we can not get the URI back.'\n );\n \n }",
"public function testUrlFunction(): void\n {\n $this->assertSame(Router::url('/'), url('/'));\n }",
"public function testPromoteAutomatchUrlUsingGET()\n {\n }",
"public function testRejectAutomatchUrlUsingGET()\n {\n }",
"public function testUrlOption()\n {\n $this->assertProduces('text [url=http://example.com/?a=b&c=d]this is a \"link\"[/url]', 'text <a href=\"http://example.com/?a=b&c=d\">this is a "link"</a>');\n }",
"public function get_url()\n {\n }",
"public function testGetUri()\n {\n $this->assertEquals(\"hello/?test=true\", $this->_req->getUri());\n }",
"public function testToValueMakeUrl()\n {\n $expected = Url::class;\n\n $input = [\n 'type' => 'uri.url',\n 'value' => 'https://as.xcd'\n ];\n\n $sut = new Value();\n\n $result = $sut->toValue($input);\n\n $this->assertInstanceOf($expected, $result);\n }",
"public function testUrlReconstruction() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['TestQuery']);\n\n\t\t(new Verify(\n\t\t\t'check that GetURL() reconstructed an accurate URL.',\n\t\t\t$router->GetURL()\n\t\t))->equals('http://www.nether.io/test');\n\n\t\treturn;\n\t}",
"public function test_getSourceUrl_sourceUrlFieldIsNotEmpty_returnCorrectly()\r\n\t{\r\n\t\t$expected = \"aDummySourcelUrl\";\r\n\t\t$this->service->sourceUrl = $expected;\r\n\t\t$actual = $this->service->getsourceurl();\r\n\t\t$this->assertEquals($expected, $actual);\r\n\t}",
"public function testUrlParam()\n {\n $this->assertProduces('text [url]http://example.com/?a=b&c=d[/url] more text', 'text <a href=\"http://example.com/?a=b&c=d\">http://example.com/?a=b&c=d</a> more text');\n }",
"public function testUrl() {\n $this->assertEquals('http://domain.com?key=ber', Sanitize::url('http://domain.com?key=Über'));\n $this->assertEquals('http%3A%2F%2Fdomain.com%3Fkey%3D%C3%9Cber', Sanitize::url(urlencode('http://domain.com?key=Über')));\n }",
"abstract public function getUrl();",
"public function testGetUrlElementReturnsRequestedElementFromPath()\n {\n $server = ['PATH_INFO' => 'foo/bar/baz'];\n $request = new Request($this->config, $server);\n $this->assertEquals('foo', $request->getUrlElement(0));\n $this->assertEquals('bar', $request->getUrlElement(1));\n $this->assertEquals('baz', $request->getUrlElement(2));\n }"
] |
[
"0.7307561",
"0.69567806",
"0.6939215",
"0.6930271",
"0.6888509",
"0.6884988",
"0.6873097",
"0.6873097",
"0.6873039",
"0.68669677",
"0.6865132",
"0.68160766",
"0.6812406",
"0.67993337",
"0.6790025",
"0.67834586",
"0.6774536",
"0.6645556",
"0.6617677",
"0.6613017",
"0.6597545",
"0.6594222",
"0.65384465",
"0.6525275",
"0.65153146",
"0.6514966",
"0.6506884",
"0.6481406",
"0.6479185",
"0.6457667"
] |
0.73083085
|
0
|
/ Plugin Name: Simple Meta shortcode Plugin URI: Description: A light plugin that allows you to easly shorcode your post meta data. Author: Riad Boukirou Version: 0.1 Author URI:
|
function sm_shortcode( $atts ) {
$a = shortcode_atts( array(
'post-id' => get_the_ID() ,
'key' => '',
'single' => false,
), $atts );
return get_post_meta( $a["post-id"], $a["key"], $a["post-id"] ) ;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function add_shortcode_for_our_plugin ($attr , $content = null ){\n\t\textract(shortcode_atts(array(\n\t\t\t'post_type'=>'post',\n\t\t\t'posts_per_page'=>2,\n\t\t\t\n\t\t\t\n\t\t\n\t\t), $attr,'our_shortcode' ));\n\t\n\t$query = new WP_Query(array(\n\t\t'post_type'=>$post_type,\n\t\t'posts_per_page'=>$posts_per_page,\n\t\n\t));\n\t\n\tif($query->have_posts()):\n\t\t$output = '<div class=\"recent_posts\"><ul>';\n\t\t$i=0;\n\t\twhile($query->have_posts()){\n\t\t\t\n\t\t\t$query->the_post();\n\t\t\tif($i == 0):\n\t\t\t$output .= '<li><a href=\"'.get_the_permalink().'\" style=\"color:red;\" >'.get_the_title().'</a></li>';\n\t\t\telse:\n\t\t\t$output .= '<li><a href=\"'.get_the_permalink().'\">'.get_the_title().'</a></li>';\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t$i++; }\n\t\twp_reset_postdata();\n\t$output .= '</ul></div>';\n\treturn $output;\n\telse:\n\t return 'no post found';\n\t\n\tendif;\n\t\n\t\n\t\n\t\n\t\n\t\n}",
"public function add_meta() {\n\t\techo \"\\n<meta data-plugin='a04_vertical_button' name='description' content='a sample meta description for this website'/>\\n\\n\";\n\t}",
"function pw_sample_plugin_shortcode($atts) {\n\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'id' => '',\n\t\t\t'author_name' => '',\n\t\t\t'year' => '',\n\t\t\t'category' => '',\n\t\t\t'tag' => '',\n\t\t\t'publisher' => '',\n\t\t),\n\t\t$atts,\n\t\t'book'\n\t);\n\n\t$id = $atts['id'];\n\t$author_name = $atts['author_name'];\n\t$year = $atts['year'];\n\t$category = $atts['category'];\n\t$tag = $atts['tag'];\n\t$publisher = $atts['publisher'];\n\n}",
"public function get_shortcode() {\n\t\t$args = array();\n\t\tforeach ($this->args as $k => $v) {\n\t\t\t// Only include info if it's not the default... save space and easier to read shortcodes\n\t\t\tif (isset($this->defaults[$k]) && $this->defaults[$k] != $v) { // && (!empty($this->defaults[$k]) && !empty($v))) {\n\t\t\t\tif ( !empty($v) ) {\n\t\t\t\t\tif ( is_array($v) ) {\n\t\t\t\t\t\t$args[] = $k.'=\"'.implode(',', $v).'\"';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$args[] = $k.'=\"'.$v.'\"';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Direct filtering on a field\n\t\t\telseif (!isset($this->defaults[$k])) {\n\t\t\t\t$args[] = $k.'=\"'.$v.'\"';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$args = implode(' ', $args);\n\t\tif (!empty($args)) {\n\t\t\t$args = ' '.$args;\n\t\t}\n\t\treturn '[summarize-posts'.$args.']';\n\t}",
"function Add_Shortcode_metabox() \n{\n add_meta_box('shortcode_metabox_id', 'Shordcode', 'Display_Shortcode_metabox', 'Flipbox');\n}",
"function the_meta()\n {\n }",
"function sb_slideshow_shortcode_meta() {\n\tglobal $post;\n\techo sb_slideshow_embed_input( $post->ID );\n}",
"function html5_shortcode_demo($atts, $content = null)\n{\n return '<div class=\"shortcode-demo\">' . do_shortcode($content) . '</div>'; // do_shortcode allows for nested Shortcodes\n}",
"function hybrid_entry_meta() {\n\n\t$meta = '';\n\n\tif ( 'post' == get_post_type() )\n\t\t$meta = '<p class=\"entry-meta\">' . __( '[entry-terms taxonomy=\"category\" before=\"Posted in \"] [entry-terms taxonomy=\"post_tag\" before=\"| Tagged \"] [entry-comments-link before=\"| \"]', 'hybrid' ) . '</p>';\n\n\telseif ( is_page() && current_user_can( 'edit_page', get_the_ID() ) )\n\t\t$meta = '<p class=\"entry-meta\">[entry-edit-link]</p>';\n\n\techo apply_atomic_shortcode( 'entry_meta', $meta );\n}",
"function shortcode ( $content ) {\n return short_code ( $content );\n}",
"function prfx_custom_meta() {\r\n add_meta_box( 'prfx_meta', __( 'SEO\\'s H1 Title', 'prfx-textdomain' ), 'prfx_meta_callback', 'page', $context = 'normal', $priority = 'high' );\r\n}",
"public function shortcode($atts) {\n global $wpdb;\n if (isset($atts['slug'])) {\n $q=$wpdb->prepare(\n \"SELECT id \".\n \"FROM {$wpdb->prefix}h5p_contents \".\n \"WHERE slug=%s\",\n $atts['slug']\n );\n $row=$wpdb->get_row($q,ARRAY_A);\n\n if ($wpdb->last_error) {\n return sprintf(__('Database error: %s.', $this->plugin_slug), $wpdb->last_error);\n }\n\n if (!isset($row['id'])) {\n return sprintf(__('Cannot find H5P content with slug: %s.', $this->plugin_slug), $atts['slug']);\n }\n\n $atts['id']=$row['id'];\n }\n\n $id = isset($atts['id']) ? intval($atts['id']) : NULL;\n $content = $this->get_content($id);\n if (is_string($content)) {\n // Return error message if the user has the correct cap\n return current_user_can('edit_h5p_contents') ? $content : NULL;\n }\n\n // Log view\n new H5P_Event('content', 'shortcode',\n $content['id'],\n $content['title'],\n $content['library']['name'],\n $content['library']['majorVersion'] . '.' . $content['library']['minorVersion']);\n\n return $this->add_assets($content);\n }",
"function omfg_mobile_pro_pagecontent () {\n\n\tglobal $post, $wp_query;\n\t\n\t// Post ID\n\t$postid = $wp_query->post->ID;\n\t$page_content = get_post_meta($postid, '_omfg_page_content', true);\n\t$page_content = do_shortcode($page_content);\n\t$page_content = wpautop($page_content, 1);\n\t\n\techo $page_content;\n\n}",
"function html5_shortcode_demo( $atts, $content = null ) {\n return '<div class=\"shortcode-demo\">' . do_shortcode( $content ) . '</div>'; // do_shortcode allows for nested Shortcodes\n}",
"function plugin_starter_shortcode_1() {\r\n\t// This is just for showing that the shortcut works\r\n\treturn '<div class=\"starter-test\">This is the output of this shortcode</div>';\r\n}",
"function sm_custom_meta() {\n\tadd_meta_box('sm_meta', __( 'Post Destacado', 'sm-textdomain' ), 'sm_meta_callback', 'post' );\n}",
"function acf_shortcode($atts)\n{\n}",
"function fumseck_pagemeta() {\n\t\n\t// Initialize\n\t\n\t$output = '';\n\tglobal $post;\n\t$post_id = $post->ID;\n\t\n\t\n\t// Get metadata for the page from WordPress\n\t\n\t$post_title = get_the_title($post_id);\n\t$post_permalink = get_permalink($post_id);\n\t\n\t$post_has_featured_image = has_post_thumbnail( $post_id );\n\t\n\tif( $post_has_featured_image ) {\n\t\t$post_featured_image_large = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large'); // [URL, w, h, resized?]\n\t};\n\t\n\t$post_summary = wp_strip_all_tags( get_field( '_summary', $post_id, true ));\n\t\n\t\n\tif ( ! $post_summary ) {\t\t// if no summary, try a manual excerpt\n\t\t$post_summary = $post->post_excerpt;\n\t};\t// TODO: do something if there's no manual excerpt either\n\n\t\n\t// Static metadata\n\t\n\t$output .= '<meta name=\"twitter:site\" content=\"@gpaumier\"><meta name=\"twitter:creator\" content=\"@gpaumier\">';\t\n\t$output .= '<meta name=\"twitter:domain\" content=\"guillaumepaumier.com\">';\t\n\t$output .= '<meta property=\"fb:admins\" content=\"710543474\" />';\n\t//$output .= '<meta property=\"fb:admins\" content=\"579323492087704\" />';\n\t$output .= '<meta property=\"article:author\" content=\"https://www.facebook.com/gllmpmr\" />';\n\t$output .= '<meta property=\"article:publisher\" content=\"https://www.facebook.com/gllmpmr\" />';\n\t\n\t$output .= '<meta property=\"og:type\" content=\"article\" />'; // TODO: be more specific\n\t\n\t// Common metadata\n\t\n\t$output .= '<meta property=\"og:site_name\" content=\"' . get_bloginfo( 'name' ) . '\"/>';\n\t\n\t$output .= '<meta name=\"twitter:title\" content=\"' . $post_title . '\">';\n\t$output .= '<meta property=\"og:title\" content=\"' . $post_title . '\"/>';\n\t\n\t\n\t$output .= '<meta property=\"og:url\" content=\"' . $post_permalink . '\" />';\n\t\n\t\n\t$output .= '<meta property=\"og:description\" content=\"' . $post_summary . '\" />';\n\t\n\t// TODO: add locale\n\t\n\tif ( get_post_format( $post_id ) === 'image' ) {\n\t\t\n\t\t$output .= '<meta name=\"twitter:card\" content=\"photo\">';\n\t\t$output .= '<meta name=\"twitter:image\" content=\"' . $post_featured_image_large[0] . '\">';\n\t\t$output .= '<meta name=\"twitter:image:width\" content=\"' . $post_featured_image_large[1] . '\">';\n\t\t$output .= '<meta name=\"twitter:image:height\" content=\"' . $post_featured_image_large[2] . '\">';\n\t\t$output .= '<meta property=\"og:image:width\" content=\"' . $post_featured_image_large[1] . '\" />';\n\t\t$output .= '<meta property=\"og:image:height\" content=\"' . $post_featured_image_large[2] . '\" />';\n\t\t\n\t} else {\t// Not a photo\n\t\t\n\t\t$output .= '<meta name=\"twitter:description\" content=\"' . $post_summary . '\">';\n\t\t\n\t\tif( $post_has_featured_image ) {\n\t\t\t\n\t\t\t$output .= '<meta name=\"twitter:card\" content=\"summary_large_image\">';\n\t\t\t$output .= '<meta name=\"twitter:image:src\" content=\"' . $post_featured_image_large[0] . '\">';\n\t\t\t$output .= '<meta property=\"og:image\" content=\"' . $post_featured_image_large[0] . '\" />';\n\t\t\t$output .= '<meta property=\"og:image:width\" content=\"' . $post_featured_image_large[1] . '\" />';\n\t\t\t$output .= '<meta property=\"og:image:height\" content=\"' . $post_featured_image_large[2] . '\" />';\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$output .= '<meta name=\"twitter:card\" content=\"summary\">';\n\t\t}\n\t\t\n\t};\n\t\n\n\techo $output;\n}",
"public function add_short_code()\n {\n add_shortcode('colorYourLife', array($this, 'generate_short_code_content'));\n }",
"function my_shortcode() {\n\n$options = get_option('foodrecipecptplugin_settings');\nreturn \"<p>Recipe Name:\" . $options['foodrecipecptplugin_text_field_0'] . \"</p>\".\"<p>Category: \" . $options['foodrecipecptplugin_text_field_1'].\"</p>\".\"<p>Ingredients: \". $options['foodrecipecptplugin_text_field_2'].\"</p>\".\"<p>Recipe Instructions: \" . $options['foodrecipecptplugin_text_field_3'] . \"</p>\";\n}",
"function html5_shortcode_demo_2( $atts, $content = null ) {\n return '<h2>' . $content . '</h2>';\n}",
"function qr_shortcode_render( $atts ) {\n $qr_meta = get_post_meta( $atts['id'], $atts['metakey'] , false );\n\n return $qr_meta[0]['image'];\n}",
"function register_my_custom_shortcode( $shortcodes ) {\n\t// Add new shortcode\n\t$shortcodes['heading2'] = array(\n\t\t// Shortcode name\n\t\t'name' => __( 'Heading 2', 'textdomain' ),\n\t\t// Shortcode type. Can be 'wrap' or 'single'\n\t\t// Example: [b]this is wrapped[/b], [this_is_single]\n\t\t'type' => 'wrap',\n\t\t// Shortcode group.\n\t\t// Can be 'content', 'box', 'media' or 'other'.\n\t\t// Groups can be mixed, for example 'content box'\n\t\t'group' => 'content',\n\t\t// List of shortcode params (attributes)\n\t\t'atts' => array(\n\t\t\t// Style attribute\n\t\t\t'style' => array(\n\t\t\t\t// Attribute type.\n\t\t\t\t// Can be 'select', 'color', 'bool' or 'text'\n\t\t\t\t'type' => 'select',\n\t\t\t\t// Available values\n\t\t\t\t'values' => array(\n\t\t\t\t\t'default' => __( 'Default', 'textdomain' ),\n\t\t\t\t\t'small' => __( 'Small', 'textdomain' )\n\t\t\t\t),\n\t\t\t\t// Default value\n\t\t\t\t'default' => 'default',\n\t\t\t\t// Attribute name\n\t\t\t\t'name' => __( 'Style', 'textdomain' ),\n\t\t\t\t// Attribute description\n\t\t\t\t'desc' => __( 'Heading 2 style', 'textdomain' )\n\t\t\t)\n\t\t),\n\t\t// Default content for generator (for wrap-type shortcodes)\n\t\t'content' => __( 'Heading 2 text', 'textdomain' ),\n\t\t// Shortcode description for cheatsheet and generator\n\t\t'desc' => __( 'Styled heading 2', 'textdomain' ),\n\t\t// Custom icon (font-awesome)\n\t\t'icon' => 'plus',\n\t\t// Name of custom shortcode function\n\t\t// IMPORTANT: this is the name of the next function\n\t\t'function' => 'my_custom_shortcode',\n\t);\n\t// Return modified data\n\treturn $shortcodes;\n}",
"function addMeta() {\n\t\n\tif( class_exists('acf') ) {\n\n\t$meta_description = get_field('meta_description', 'option');\n\t$meta_keywords = get_field('meta_keywords', 'option');\n\t$meta_author = get_field('meta_author', 'option');\n\t$meta_og_image = get_field('meta_og_img', 'option');\n\t$meta_img_full = $meta_og_image['url'];\n\n\t}\n\n\tif ( $meta_description ) {\n\t\techo '<meta name=\"description\" content=\"'.$meta_description.'\">'; \n\t}\n\n\tif ( $meta_keywords ) {\n\t\techo '<meta name=\"keywords\" content=\"'.$meta_keywords.'\">'; \n\t}\n\n\tif ( $meta_author ) {\n\t\techo '<meta name=\"author\" content=\"'.$meta_author.'\">'; \n\t}\n\n\tif ( $meta_og_image ) {\n\t\techo '<meta name=\"twitter:card\" content=\"summary\" />';\n\t\techo '<meta property=\"og:image\" content=\"'.$meta_img_full.'\" />';\n\t}\n\n}",
"public function create_shortcode_meta_box() {\n\t\tglobal $post;\n\t?>\n\t\t<div class=\"text-input-with-button-container copyable\">\n\t\t\t<input name=\"justart_slider_shortcode\" value=\"<?php esc_html_e( '[justart-slider id=\"' . $post->ID . '\"]' ); ?>\" readonly />\n\t\t\t<button type=\"button\" class=\"button button-secondary icon copy\">Copy</button>\n\t\t</div>\n\t<?php\n\t}",
"function update_post( $post, $plugin_name, $plugin_info ) {\n echo \"Updating post: \" . $post->ID;\n echo PHP_EOL;\n //echo \"New slug:\" . $plugin_info->\n $parts = explode( '/', $plugin_name );\n $slug = $parts[0];\n echo \"New slug: \" . $slug;\n echo PHP_EOL;\n echo \"New plugin name: \" . $plugin_name;\n echo PHP_EOL;\n echo \"Name: \" . $plugin_info['Name'];\n echo PHP_EOL;\n //echo \"Title: \" . $plugin_info['Title'];\n //echo PHP_EOL;\n //echo \"Desc: \" . $plugin_info['Description'];\n if ( $plugin_info['Name'] !== $plugin_info['Title']) { gob(); }\n\n\n //print_r( $plugin_info );\n\n if ( true ) {\n update_post_meta($post->ID, '_oikp_slug', $slug);\n update_post_meta($post->ID, '_oikp_name', $plugin_name);\n update_post_meta($post->ID, '_oikp_desc', $plugin_info['Name']);\n $plugin_uri = isset( $plugin_info['PluginURI']) ? $plugin_info['PluginURI'] : '';\n update_post_meta($post->ID, '_oikp_uri', $plugin_uri );\n }\n //$_POST['_oikp_slug'] = $this->component;\n //$_POST['_oikp_name'] = $this->get_plugin_file_name();\n // $_POST['_oikp_desc'] = $this->get_plugin_name();\n //$_POST['_oikp_uri'] = $this->get_plugin_uri();\n\n}",
"function tcsn_post_meta() {\n\n\tglobal $post;\n\tif ( ! is_page() && 'page' != $post->post_type ) {\n\t\t$post_footer_metadata = ( get_post_format() ? '<a class=\"post-format-meta\" href=\"' . get_post_format_link( get_post_format() ) . '\">' . get_post_format_string( get_post_format() ) . '</a>' : '' \t\t);\n\t} \n\t\techo '<span class=\"post-meta\">' . $post_footer_metadata. '</span>'; \n\t\t\n\t// Post author\n\tif ( 'post' == get_post_type() ) {\n\t\tprintf( 'By <span class=\"author vcard margin-less\"><a class=\"url fn n\" href=\"%1$s\" title=\"%2$s\" rel=\"author\">%3$s</a></span><span class=\"text-sep\">/</span>',\n\t\t\tesc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),\n\t\t\tesc_attr( sprintf( __( 'View all posts by %s', 'tcsn_theme' ), get_the_author() ) ),\n\t\t\tget_the_author()\n\t\t);\n\t}\n\t\n\t// Post date\n\tif ( ! has_post_format( 'link' ) && 'post' == get_post_type() )\n\t\ttcsn_post_date();\n\t\t\n\t// Categories\n\t$categories_list = get_the_category_list( __( ', ', 'tcsn_theme' ) );\n\tif ( $categories_list ) {\n\t\techo 'in <span class=\"categories-links\">' . $categories_list . '</span>';\n\t}\n\t\n\t// Tags\n\tif ( ! is_single() ) {\n\t\t$tag_list = get_the_tag_list( '', __( ', ', 'tcsn_theme' ) );\n\t\tif ( $tag_list ) {\n\t\t\techo '<span class=\"text-sep\">/</span> tags <span class=\"tags-links\">' . $tag_list . '</span>';\n\t\t}\n\t}\n\t\n\telse {\n\t\t$tag_list = get_the_tag_list( '', __( ', ', 'tcsn_theme' ) );\n\t if ( $tag_list ) {\n\t\techo '<span class=\"text-sep\">/</span> tags <span class=\"tags-links\">' . $tag_list . '</span>';\n\t } \n\t}\n}",
"function kurama_custom_meta() {\n add_meta_box( 'kurama_meta', __( 'Display Options', 'kurama' ), 'kurama_meta_callback', 'page','side','high' );\n}",
"function m_custom_meta() {\r\n add_meta_box( 'sm_meta', __( 'Featured Posts', 'sm-textdomain' ), 'sm_meta_callback', 'post' );\r\n add_meta_box( 'mm_meta', __( 'Main Posts', 'sm-textdomain' ), 'mm_meta_callback', 'post' );\r\n\r\n}",
"function mr_megaresult_shortcode_handler( $attrs, $content=null) {\n return \"look, a shortcode!\";\n}"
] |
[
"0.70828265",
"0.6838259",
"0.6690986",
"0.6593363",
"0.65779173",
"0.65209293",
"0.65119934",
"0.6497491",
"0.6484403",
"0.64677715",
"0.646133",
"0.6453369",
"0.6447194",
"0.6445118",
"0.64407486",
"0.64314324",
"0.63998425",
"0.63974226",
"0.63912475",
"0.6359737",
"0.6306171",
"0.6300594",
"0.62742144",
"0.6267847",
"0.625382",
"0.6250929",
"0.62440383",
"0.6199978",
"0.61893404",
"0.6179612"
] |
0.7576378
|
0
|
An example of how to populate a new sfWordnikWord object using it's populate method.
|
public function executeNewWord(sfWebRequest $request) {
$word = new sfWordnikWord();
// NOTE -- changed this from `getGetParameter` to `getParameter.` (andyinabox - 2010-05-20)
$word->populate(Wordnik::getWordObject($request->getParameter("word")));
// $word->name = $request->getGetParameter("word");
// $word->Definitions[]->text = "To see if something works.";
// $word->Examples[]->text = "Let's test this motor, see if it works.'";
// $word->RelatedWords[]->text = "try";
$word->save();
$this->success = "Awesome.";
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function populate();",
"public function WordCollection()\n {\n $myWords = parent::WordCollection();\n\n if(!$myWords->loadedFromFile())\n {\n // English Words\n $myWords->addText(\"en-us\", \"TITLE\", \"Module Login\");\n\n // Portuguese Words\n $myWords->addText(\"pt-br\", \"TITLE\", \"Módulo de Login\");\n }\n\n return $myWords;\n }",
"public function makeWord()\n {\n return $this->setDocumentPropertiesWithMetas(new PhpWord());\n }",
"public function create(array $data) {\r\n return $this->word->create($data);\r\n }",
"protected function setUp() {\n $this->object = new wordArrayBuilder;\n }",
"public function __construct()\n {\n\t\t\n\t $this->properties['badwordId'] = null;\n\n\t $this->properties['substitution'] = null;\n\n\t $this->properties['word'] = null;\n }",
"public function words()\n {\n return self::create('',$this->provider->words()); \n }",
"public function callInitializeSearchWordDataInTsfe() {}",
"abstract public function populate();",
"public function newAction()\n {\n $entity = new Word();\n $form = $this->createForm(new WordType($this->get('security.context')), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function executeWordnik(sfWebRequest $request)\n {\n \t$dictionary = new Wordnik();\n\t\t// NOTE -- changed this from `getGetParameter` to `getParameter.`\n\t\t// The former wasn't working for some reason, $word was coming up empty\n\t\t// andyinabox - 2010-05-20\n \t$word = $request->getParameter('word');\n \t$this->definitions = $dictionary->getRawDefinitions($word, true);\n \t$this->related = $dictionary->getRawRelatedWords($word);\n \t$this->examples = $dictionary->getRawExamples($word);\n \t$this->wotd = $dictionary->getRawWordOfTheDay();\n \t$this->random = $dictionary->getRawRandomWord();\n \t$this->defsArray = Wordnik::getAllDefinitions($word);\n \t$this->firstDef = Wordnik::getFirstDefinition($word);\n }",
"public function run()\n {\n FileWord::query()->delete();\n\n DB::beginTransaction();\n\n FileWordFactory::new()\n ->count(10)\n ->create()\n ->each(function (FileWord $dokumenWord) {\n $tempDocxFilename = \"temp.docx\";\n $tempHTMLFilename = \"temp.html\";\n $docxObject = $this->getRandomWordDocument();\n\n $docxWriter = IOFactory::createWriter($docxObject, \"Word2007\");\n $docxWriter->save(__DIR__ . DIRECTORY_SEPARATOR . $tempDocxFilename);\n\n $htmlWriter = IOFactory::createWriter($docxObject, \"HTML\");\n $htmlWriter->save(__DIR__ . DIRECTORY_SEPARATOR . $tempHTMLFilename);\n\n $dokumenWord->update([\n \"konten_html\" => $this->extractBodyContent(__DIR__ . DIRECTORY_SEPARATOR . $tempHTMLFilename)\n ]);\n\n $dokumenWord\n ->addMediaFromDisk($tempDocxFilename, \"seeders\")\n ->usingFileName(Str::snake($dokumenWord->nama) . \".docx\")\n ->toMediaCollection(FileWord::COLLECTION_WORD_FILE);\n\n unlink(__DIR__ . DIRECTORY_SEPARATOR . $tempHTMLFilename);\n });\n\n DB::commit();\n }",
"public function initialize()\n {\n $this->setSchema(\"dogner\");\n $this->setSource(\"tips\");\n }",
"public function newAction()\n {\n // Get request and entity manager\n $request = $this->container->get('request_stack')->getCurrentRequest();\n $em = $this->getDoctrine()->getManager();\n\n // Create UserWord form\n $userword = new UserWord();\n $form = $this->createForm('AppBundle\\Form\\UserWordType', $userword);\n\n // Process the form\n if ($this->process($form, $request, $em)) {\n return $this->redirect($this->generateUrl('app_userword_edit', array('id' => $userword->getId())));\n }\n\n return $this->render('/userword/new.html.twig', array(\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n\t{\n\t\treturn view('words.create');\n\t}",
"public function load()\n {\n $input = $this->getCleanInput();\n $this->populate($input);\n }",
"public function __construct($text) {\n\t\t$this->map = $this->returnWords($text);\n\t}",
"public function run()\n {\n factory(Field::class)->create(['title' => 'Português']);\n factory(Field::class)->create(['title' => 'Matemática']);\n factory(Field::class)->create(['title' => 'Geografia']);\n factory(Field::class)->create(['title' => 'História']);\n factory(Field::class)->create(['title' => 'Química']);\n factory(Field::class)->create(['title' => 'Física']);\n factory(Field::class)->create(['title' => 'Sociologia']);\n }",
"protected function setUp() {\n $this->object = new Dictionary;\n }",
"public function createAction(Request $request)\n {\n $entity = new Word();\n $form = $this->createForm(new WordType($this->get('security.context')), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n if (strlen($this->container->parameters['startupdict_from_email']) && \n strlen($this->container->parameters['startupdict_to_email'])) {\n $message = \\Swift_Message::newInstance()\n ->setSubject('Startup Dict. - New word to validate')\n ->setFrom($this->container->parameters['startupdict_from_email'])\n ->setTo($this->container->parameters['startupdict_to_email'])\n ->setBody(\n $this->renderView(\n 'InfuseDictionaryBundle:Emails:new.txt.twig',\n array('entity' => $entity)\n )\n )\n ;\n $this->get('mailer')->send($message);\n }\n\n $this->get('session')->getFlashBag()->add('success', 'Your word has been saved. We will review it soon as posisble. Thanks.');\n\n return $this->redirect($this->generateUrl('word_show', array('slug' => $entity->getSlug())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"private function installWords()\n {\n $data = file(__DIR__ . '/../bad_words_pl.txt');\n\n $bom = pack('H*', 'EFBBBF');\n\n $rows = [];\n foreach ($data as $row) {\n $rows[] = [trim(preg_replace(\"/^$bom/\", '', $row))];\n }\n\n Yii::$app\n ->db\n ->createCommand()\n ->batchInsert($this->table, ['word'], $rows)\n ->execute();\n }",
"public function populate($object)\n {\n }",
"public function create()\n {\n return view('banglawords.bangla-word-create');\n }",
"public function build($word, $content);",
"public function run() {\n factory(Document::class, 10)->create();\n }",
"public function __construct(string $word_list = '')\n {\n if (!empty($word_list)) {\n $this->wordList = $word_list;\n }\n }",
"public function create()\n {\n return view('words.create');\n }",
"protected function setup()\n {\n parent::setup();\n\n $db_test_entry = $this->parent->get_record();\n $db_test = $db_test_entry->get_test();\n $test_type_name = $db_test->get_test_type()->name;\n\n if( $test_type_name != 'ranked_word' )\n throw lib::create( 'exception\\runtime',\n 'Widget requires test type to be ranked word, not ' . \n $test_type_name, __METHOD__ );\n\n $language = $db_test_entry->get_assignment()->get_participant()->language;\n $language = is_null( $language ) ? 'en' : $language;\n \n $word_list = array();\n $intrusion_list = array();\n foreach( $db_test_entry->get_test_entry_ranked_word_list() as $db_test_entry_ranked_word )\n {\n $data = \n array(\n 'id' => $db_test_entry_ranked_word->id,\n 'selection' => is_null( $db_test_entry_ranked_word->selection ) ? '' :\n $db_test_entry_ranked_word->selection, \n 'word_candidate' => \n is_null( $db_test_entry_ranked_word->word_candidate ) ? '' :\n $db_test_entry_ranked_word->word_candidate );\n\n if( !is_null( $db_test_entry_ranked_word->word_id ) )\n {\n $word_list[ $db_test_entry_ranked_word->get_word()->word ] = $data;\n }\n else\n {\n $intrusion_list[] = $data;\n }\n } \n\n $modifier = lib::create( 'database\\modifier' );\n $modifier->order( 'rank' );\n $entry_data = array();\n\n // Get the list of ranked words in order.\n // Create data for the rows in the transcribe widget's table.\n foreach( $db_test->get_ranked_word_set_list( $modifier )\n as $db_ranked_word_set )\n {\n // Get the word in the participant's language.\n $word_id = 'word_' . $language . '_id';\n $db_word = lib::create( 'database\\word', $db_ranked_word_set->$word_id );\n if( array_key_exists( $db_word->word, $word_list ) )\n {\n $entry_data[] = array(\n 'id' => $word_list[ $db_word->word ][ 'id' ],\n 'word_id' => $db_word->id,\n 'word' => $db_word->word, \n 'selection' => $word_list[ $db_word->word ][ 'selection' ],\n 'word_candidate' => $word_list[ $db_word->word ][ 'word_candidate' ] );\n }\n }\n\n foreach( $intrusion_list as $intrusion )\n {\n $entry_data[] = array(\n 'id' => $intrusion[ 'id' ],\n 'word_id' => '',\n 'word' => '',\n 'selection' => '',\n 'word_candidate' => $intrusion[ 'word_candidate' ] ); \n }\n $this->set_variable( 'entry_data', $entry_data );\n }",
"public function run()\n {\n // populate document_types table\n factory(DocumentType::class, 13)->create();\n }",
"public function create()\n {\n return view('admin.words.create');\n }"
] |
[
"0.5869498",
"0.5840815",
"0.5813661",
"0.5723923",
"0.56400746",
"0.55870193",
"0.55770427",
"0.557179",
"0.54856634",
"0.5474488",
"0.5329248",
"0.5325011",
"0.53058934",
"0.52985054",
"0.52843726",
"0.5251206",
"0.523383",
"0.5199812",
"0.5160779",
"0.51354116",
"0.5126687",
"0.50778896",
"0.50729847",
"0.5058654",
"0.5057733",
"0.5035131",
"0.5025796",
"0.5025015",
"0.49922037",
"0.4990628"
] |
0.61660933
|
0
|
================================================== CHECKBOX AUTOMATIC PLANNING
|
function drawOptionAutomatic() {
global $automaticRunPlanning,$displayWidthPlan;?>
<div style="white-space:nowrap;">
<?php if (isNewGui()) htmlDrawSwitch('automaticRunPlan',$automaticRunPlanning);?>
<span title="<?php echo i18n('automaticRunPlanHelp');?>" dojoType="dijit.form.CheckBox"
<?php if (isNewGui()) echo 'style="display:none"';?>
type="checkbox" id="automaticRunPlan" name="automaticRunPlan" id="automaticRunPlan" class="whiteCheck"
<?php if ( $automaticRunPlanning) {echo 'checked="checked"'; } ?> >
<script type="dojo/connect" event="onChange" args="evt">
saveUserParameter('automaticRunPlanning',((this.checked)?'1':'0'));
</script>
</span> <?php if ($displayWidthPlan>1250) echo i18n('automaticRunPlan'); else echo i18n('automaticRunPlanShort');?>
</div>
<?php
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function drawOptionLeftWork() {\r\n global $saveShowWork;?>\r\n <table width=\"100%\">\r\n <tr class=\"checkboxLabel\">\r\n <td >\r\n <?php echo ucfirst(i18n(\"labelShowLeftWork\".((isNewGui()?'':'Short'))));?>\r\n </td>\r\n <td style=\"width:36px\">\r\n <div title=\"<?php echo i18n('showLeftWork')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowLeftWork\" name=\"listShowLeftWork\" class=\"whiteCheck\"\r\n <?php if ($saveShowWork=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowWork',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n </td>\r\n </tr>\r\n </table>\r\n<?php \r\n}",
"function VM_GUIstepCheckHost()\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t//Preset values for making screenshots\n\tif ($_GET['screenshot'] == 1)\n\t{\n\t\t$_SESSION['VM_createStep'] = VM_stepCheckHost;\n\t\t$_SESSION['VM_host'] = \"localhost\";\n\t}\n\t\n\t//Check if this part should be shown in the current step\n\tif ($_SESSION['VM_createStep'] < VM_stepCheckHost)\n\t\treturn(false);\n\n\t//Check if the client is running and offer wake-on-lan if not\n\tif (CLIENT_isrunning($_SESSION['VM_host']))\n\t{\n\t\t//Get current disk and memory usage\n\t\t$freeDiskSpace = (CLIENT_getCurrentFreeSpaceInDir($_SESSION['VM_host'], \"/m23/vms\") / 1024);\n\t\t$memoryUsage = CLIENT_getCurrentMemoryUsage($_SESSION['VM_host']);\n\t\t\n\t\t$cpuInfoHTML = HWINFO_getCPU($_SESSION['VM_host']);\n\n\t\t$VBoxVer = VM_getVBoxVersion($_SESSION['VM_host']);\n\n\t\t//convert the switch status to readable information\n\t\t$readableStatus = VM_convertSwitchStatusInfo(VM_STATE_ON);\n\n\t\techo(\"\n\t\t\t<tr><td colspan=\\\"2\\\"><hr></td></tr>\n\t\t\t<tr><td>$readableStatus[text]</td><td align=\\\"right\\\">$readableStatus[imgTag]</td></tr>\n\t\t\t<tr><td>$I18N_vboxVersion</td><td align=\\\"right\\\">$VBoxVer</td></tr>\n\t\t\t<tr><td colspan=\\\"2\\\"><hr></td></tr>\n\t\t\t<tr><td colspan=\\\"2\\\"><span class=\\\"title\\\">$I18N_hardware_info</span></td></tr>\n\t\t\t<tr><td>CPU</td><td>$cpuInfoHTML</td></tr>\n\t\t\t<tr><td>$I18N_freeDiskSpace</td><td align=\\\"right\\\">\".number_format($freeDiskSpace, 0, \",\",\".\").\" MB</td></tr>\n\t\t\t<tr><td>$I18N_totalMemory</td><td align=\\\"right\\\">\".number_format($memoryUsage['all'] / 1024, 0, \",\",\".\").\" MB</td></tr>\n\t\t\t<tr><td>$I18N_freeMemory</td><td align=\\\"right\\\">\".number_format($memoryUsage['free'] / 1024, 0, \",\",\".\").\" MB</td></tr>\n\t\t\t\");\n\t\t\n\t\t//If the client is accessible go forward to the next step\n\t\t$_SESSION['VM_createStep'] = VM_stepCreateGuest;\n\t}\n\telse\n\t{\n\t\tif (HTML_submit(\"BUT_wol\",$I18N_wakeUp))\n\t\t\tCLIENT_wol($_SESSION['VM_host']);\n\n\t\tHTML_submit(\"BUT_refresh\",$I18N_refresh);\n\n\t\t//convert the switch status to readable information\n\t\t$readableStatus = VM_convertSwitchStatusInfo(VM_STATE_OFF);\n\n\t\techo(\"\n\t\t\t<tr><td colspan=\\\"2\\\"><hr></td></tr>\n\t\t\t<tr><td>$readableStatus[text]</td><td align=\\\"right\\\">$readableStatus[imgTag]</td></tr>\n\t\t\t<tr><td>\".BUT_wol.\"</td><td>\".BUT_refresh.\"</td></tr>\");\n\t}\n}",
"function ffw_port_multicheck_callback( $args ) {\n global $ffw_port_settings;\n\n foreach( $args['options'] as $key => $option ):\n if( isset( $ffw_port_settings[$args['id']][$key] ) ) { $enabled = $option; } else { $enabled = NULL; }\n echo '<input name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\" type=\"checkbox\" value=\"' . $option . '\" ' . checked($option, $enabled, false) . '/> ';\n echo '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\">' . $option . '</label><br/>';\n endforeach;\n echo '<p class=\"description\">' . $args['desc'] . '</p>';\n}",
"function drawOptionsDisplay() {\r\n global $saveShowWbs, $saveShowClosed, $saveShowResource,$planningType, $showListFilter,$showClosedPlanningVersion;?>\r\n <table width=\"100%\">\r\n <?php if ($planningType!='contract' and $planningType!='version') {?>\r\n <tr class=\"checkboxLabel\">\r\n <td><?php echo ucfirst(i18n(\"labelShowWbs\".((isNewGui())?'':'Short')));?></td>\r\n <td width=\"35px\">\r\n <div title=\"<?php echo ucfirst(i18n('showWbs'));?>\" dojoType=\"dijit.form.CheckBox\" \r\n class=\"whiteCheck\" type=\"checkbox\" id=\"showWBS\" name=\"showWBS\"\r\n <?php if ($saveShowWbs=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowWbs',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n </td>\r\n </tr>\r\n <?php }?>\r\n <tr class=\"checkboxLabel\" <?php echo ($planningType=='version')?'style=\"height:25px\"':''?>>\r\n <td><?php echo ucfirst(i18n(\"labelShowIdle\".((isNewGui() or $planningType=='version')?'':'Short')));?></td>\r\n <td style=\"width: 30px;\">\r\n <?php if ($planningType=='version') {?>\r\n <div title=\"<?php echo i18n('labelShowIdle')?>\" dojoType=\"dijit.form.CheckBox\" \r\n class=\"whiteCheck\" type=\"checkbox\" id=\"showClosedPlanningVersion\" name=\"showClosedPlanningVersion\"\r\n <?php if ($showClosedPlanningVersion=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningVersionShowClosed',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n <?php } else {?>\r\n <div title=\"<?php echo ucfirst(i18n('showIdleElements'));?>\" dojoType=\"dijit.form.CheckBox\" \r\n class=\"whiteCheck\" type=\"checkbox\" id=\"listShowIdle\" name=\"listShowIdle\"\r\n <?php if ($saveShowClosed=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowClosed',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n <?php }?>\r\n </td>\r\n </tr>\r\n <?php \r\n if (strtoupper(Parameter::getUserParameter('displayResourcePlan'))!='NO' and ($planningType=='planning' or $planningType=='global' or $planningType=='contract' or $planningType=='version') ) {?>\r\n <tr class=\"checkboxLabel\" <?php echo ($planningType=='version')?'style=\"height:25px\"':''?>>\r\n <td>\r\n <?php if ($planningType=='version') {?><div id=\"displayRessource\" style=\"visibility:<?php echo ($showListFilter=='true')?'visible':'hidden';?>;\"><?php }?>\r\n <?php echo ucfirst(i18n(\"labelShowResource\".((isNewGui() or $planningType=='version')?'':'Short')));?>\r\n <?php if ($planningType=='version') {?></div><?php }?>\r\n </td>\r\n <td style=\"width: 30px;\">\r\n <?php if ($planningType=='version') {?><div id=\"displayRessourceCheck\" style=\"visibility:<?php echo ($showListFilter=='true')?'visible':'hidden';?>!important;\"><?php }?>\r\n <div title=\"<?php echo ucfirst(i18n('showResources'));?>\" dojoType=\"dijit.form.CheckBox\" \r\n class=\"whiteCheck\" type=\"checkbox\" \r\n <?php if ($planningType=='version') {?>id=\"showRessourceComponentVersion\" name=\"showRessourceComponentVersion\"<?php } else { ?>id=\"listShowResource\" name=\"listShowResource\"<?php }?> \r\n <?php if ($saveShowResource=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowResource',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n <?php if ($planningType=='version') {?></div><?php }?>\r\n </td>\r\n </tr>\r\n <?php \r\n }?>\r\n </table>\r\n<?php \r\n}",
"function ras_poll_prefs() {\n\t\t\tpagetop(\"Poll Preferences\", \"Poll Settings\");\n\t\t\t\n\tswitch (gps('step')) {\n\t\tcase 'new_select':\n \t\tras_new_select(); \n \t\tbreak;\n\t\tcase 'edit_select':\n \t\tras_edit_select(gps('poll_id')); \n \tbreak;\n\t\tcase 'delete_select':\n \t\tras_delete_select(gps('poll_id'));\n \tbreak;\n\t\tcase '' : poll_list();\n\t}\n}",
"function ffw_port_checkbox_callback( $args ) {\n global $ffw_port_settings;\n\n $checked = isset($ffw_port_settings[$args['id']]) ? checked(1, $ffw_port_settings[$args['id']], false) : '';\n $html = '<input type=\"checkbox\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" value=\"1\" ' . $checked . '/>';\n $html .= '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}",
"function pt_checkbox_pause_render()\n\t\t{ \n\t\t\t$options = get_option( 'pt_settings' );\n\t\t\t?>\n\t\t\t<input type='checkbox' name='pt_settings[pt_checkbox_field_pause]' value=\"1\" <?php checked( @$options['pt_checkbox_field_pause'], 1 ); ?>>\n\t\t\t<?php\n\t\t}",
"public function performChecks(){\n\t\t\n\t}",
"public function postConfigure()\n\t{\n\t\tforeach ($this->restrictions as $type => $restrictions)\n\t\t{\n\t\t\tif (!empty($restrictions))\n\t\t\t{\n\t\t\t\t$this->debug->setFlag($type, $restrictions);\n\t\t\t}\n\t\t}\n\n\t\t$this->config->force_winner = $this->force_winner;\n\n\t\t$factory = new OLPBlackbox_Factory_Legacy_OLPBlackbox();\n\t\t$this->blackbox = $factory->getBlackbox();\n\t}",
"function checkboxes(){\n if($this->ChkReal->Checked){\n $this->avance_real = 'Si';\n }else{\n $this->avance_real = 'No';\n }\n if($this->ChkProg->Checked){\n $this->avance_prog = 'Si';\n }else{\n $this->avance_prog = 'No';\n }\n if($this->ChkComent->Checked){\n $this->comentario = 'Si';\n }else{\n $this->comentario = 'No';\n }\n if($this->ChkPermiso->Checked){\n $this->permiso = 'Si';\n }else{\n $this->permiso = 'No';\n }\n if($this->ChkTipoA->Checked){\n $this->tipo_admon = 'Si';\n }else{\n $this->tipo_admon = 'No';\n }\n }",
"function floating_guest_activate(){\n //Variables que vamos a utilizar\n \tglobal $mybb, $cache, $db, $lang;\n\n $lang->load(\"floating_guest\", false, true);\n \n // Crear el grupo de opciones\n $query = $db->simple_select(\"settinggroups\", \"COUNT(*) as rows\");\n $rows = $db->fetch_field($query, \"rows\");\n\n $new_groupconfig = array(\n 'name' => 'floating_guest',\n 'title' => $lang->vfi_title,\n 'description' => $lang->vfi_title_descrip,\n 'disporder' => $rows+1,\n 'isdefault' => 0\n );\n\n $group['gid'] = $db->insert_query(\"settinggroups\", $new_groupconfig);\n\n // Crear las opciones del plugin a utilizar\n $new_config = array();\n\n $new_config[] = array(\n 'name' => 'floating_guest_active',\n 'title' => $lang->vfi_power,\n 'description' => $lang->vfi_power_descrip,\n 'optionscode' => 'yesno',\n 'value' => '1',\n 'disporder' => 10,\n 'gid' => $group['gid']\n );\n\n $new_config[] = array(\n 'name' => 'floating_guest_css',\n 'title' => $lang->vfi_cssdiv,\n 'description' => $lang->vfi_cssdiv_descrip,\n 'optionscode' => 'textarea',\n 'value' => 'opacity:0.85;\nfilter: alpha(opacity=85);\nborder:2px solid #2266AA; \nborder-radius: 10px;\n-ms-border-radius: 10px;\n-moz-border-radius: 10px;\n-webkit-border-radius: 10px;\n-ms-box-shadow: inset 0 0 10px #000000;\n-moz-box-shadow: inset 0 0 10px #000000;\n-webkit-box-shadow: inset 0 0 10px #000000;\nbox-shadow: inset 0 0 10px #000000;',\n 'disporder' => 20,\n 'gid' => $group['gid']\n );\n\n $new_config[] = array(\n 'name' => 'floating_guest_text1',\n 'title' => $lang->vfi_text1,\n 'description' => $lang->vfi_text1_descrip,\n 'optionscode' => 'text',\n 'value' => 'Hello, Guest!',\n 'disporder' => 30,\n 'gid' => $group['gid']\n );\n \n $new_config[] = array(\n 'name' => 'floating_guest_text1css',\n 'title' => $lang->vfi_csstext1,\n 'description' => $lang->vfi_csstext1_descrip,\n 'optionscode' => 'textarea',\n 'value' => $db->escape_string('color:blue; \nfont-family:\\'Lucida Console\\';\nfont-size:16px;\ntext-shadow:0.3em 0.3em 0.2em #060;'),\n 'disporder' => 40,\n 'gid' => $group['gid']\n ); \n \n $new_config[] = array(\n 'name' => 'floating_guest_text2',\n 'title' => $lang->vfi_text2,\n 'description' => $lang->vfi_text2_descrip,\n 'optionscode' => 'textarea',\n 'value' => 'Please <a href=\"member.php?action=register\">Register</a>, or <a href=\"member.php?action=login\">Login</a><br />\nto see entire forum content...<br />',\n 'disporder' => 50,\n 'gid' => $group['gid']\n ); \n\n $new_config[] = array(\n 'name' => 'floating_guest_text2css',\n 'title' => $lang->vfi_csstext2,\n 'description' => $lang->vfi_csstext2_descrip,\n 'optionscode' => 'textarea',\n 'value' => $db->escape_string('color:black; \nfont-family:\\'Georgia\\';\nfont-size:14px;\ntext-shadow:0.3em 0.3em 0.2em #600;'),\n 'disporder' => 60,\n 'gid' => $group['gid']\n );\n\n $new_config[] = array(\n 'name' => 'floating_guest_img',\n 'title' => $lang->vfi_img,\n 'description' => $lang->vfi_img_descrip,\n 'optionscode' => 'text',\n 'value' => 'images/floating_guest/background.jpg',\n 'disporder' => 70,\n 'gid' => $group['gid']\n ); \n\n $new_config[] = array(\n 'name' => 'floating_guest_width',\n 'title' => $lang->vfi_width,\n 'description' => $lang->vfi_width_descrip,\n 'optionscode' => 'text',\n 'value' => '300',\n 'disporder' => 80,\n 'gid' => $group['gid']\n );\n\n $new_config[] = array(\n 'name' => 'floating_guest_height',\n 'title' => $lang->vfi_height,\n 'description' => $lang->vfi_height_descrip,\n 'optionscode' => 'text',\n 'value' => '70',\n 'disporder' => 90,\n 'gid' => $group['gid']\n );\n \n $new_config[] = array(\n 'name' => 'floating_guest_align',\n 'title' => $lang->vfi_aligny,\n 'description' => $lang->vfi_aligny_descrip,\n 'optionscode' => 'select \\n 1='.$lang->vfi_up.' \\n 2='.$lang->vfi_down,\n 'value' => '1',\n 'disporder' => 100,\n 'gid' => $group['gid']\n ); \n \n $new_config[] = array(\n 'name' => 'floating_guest_align_hv',\n 'title' => $lang->vfi_alignx,\n 'description' => $lang->vfi_alignx_descrip, \n 'optionscode' => 'select \\n 1='.$lang->vfi_left.' \\n 2='.$lang->vfi_right,\n 'value' => '1',\n 'disporder' => 110,\n 'gid' => $group['gid']\n ); \n \n foreach($new_config as $array => $content)\n {\n $db->insert_query(\"settings\", $content);\n }\n\n rebuild_settings();\n\n //Archivo requerido para reemplazo de plantillas\n\trequire \"../inc/adminfunctions_templates.php\";\n //Reemplazos que vamos a hacer en las plantillas 1.- Platilla 2.- Contenido a Reemplazar 3.- Contenido que reemplaza lo anterior\n\tfind_replace_templatesets('headerinclude', '#^(.*)$#s', \"\\\\1\\r\\n\" . '<script type=\"text/javascript\" src=\"{\\$mybb->settings[\\'bburl\\']}/jscripts/floating_guest.js\"></script>');\n find_replace_templatesets(\"header_welcomeblock_guest\", '#^(.*)$#s', '{\\$floating_guest}' . \"\\\\1\\r\\n\");\n //Se actualiza la info de las plantillas\n\t$cache->update_forums();\n\n return true;\n\n}",
"protected static function ui_center_box($db_vars, $user_prefs, $label)\n {\n $GE = new cCleanArray($db_vars);\n $b = self::boxify($db_vars);\n $box_h = $b[\"size_h\"];\n $box_v = $b[\"size_v\"];\n\n $lng = $GE->lookatTerrainLon->float;\n $lat = $GE->lookatTerrainLat->float;\n\n //try to pick a smart height for the box walls\n $h = min($b[\"slantrange\"] / 2, max(10, $GE->lookatTerrainAlt->float / -2));\n \n $heading = $GE->lookatHeading->float;\n \n //calculate displacements and convert to lon/lat\n $toplt = self::displacement_coordinates($lat, $lng, $heading, $box_h, $box_v, -1, 1);\n $toprt = self::displacement_coordinates($lat, $lng, $heading, $box_h, $box_v, 1, 1);\n $botlt = self::displacement_coordinates($lat, $lng, $heading, $box_h, $box_v, -1, -1);\n $botrt = self::displacement_coordinates($lat, $lng, $heading, $box_h, $box_v, 1, -1);\n \n $box_kml = \"\n <Placemark>\n <name>Select Region: $label</name>\n <Style>\n <LineStyle>\n <color>{$user_prefs[\"Box Color\"]}</color>\n <width>3</width>\n </LineStyle>\n </Style>\n <LineString>\n <tessellate>1</tessellate>\n <extrude>1</extrude>\n <altitudeMode>relativeToSeaFloor</altitudeMode>\n <coordinates>\n $toplt,$h\n $toprt,$h\n $botrt,$h\n $toplt,$h\n $botlt,$h\n $toprt,$h\n $botrt,$h\n $botlt,$h\n </coordinates>\n </LineString>\n </Placemark>\n\n \";\n \n list($h_lng, $h_lat) = \n explode(\",\", self::displacement_coordinates($lat, $lng, $heading, $box_h, $box_v, 0, 0.85));\n\n list($v_lng, $v_lat) = \n explode(\",\", self::displacement_coordinates($lat, $lng, $heading, $box_h, $box_v, -0.85, 0));\n\n $h_kml = self::kml_rep_placemark(round($box_h * 2, 1) . \" m\", $h_lat, $h_lng, \"/img/measure.png\");\n $v_kml = self::kml_rep_placemark(round($box_v * 2, 1) . \" m\", $v_lat, $v_lng, \"/img/measure.png\");\n\n return $box_kml . $h_kml . $v_kml;\n }",
"function drawOptionCriticalPath() {\r\n?>\r\n <div style=\"white-space:nowrap; <?php echo (isNewGui())?'margin-right:6px;margin-top:5px;':'position:absolute; bottom:5px;left:10px;'; ?>\" class=\"checkboxLabel\">\r\n <?php if (isNewGui()) {?><?php echo ucfirst(i18n('criticalPath'));?> <?php }?>\r\n <span title=\"<?php echo ucfirst(i18n('criticalPath'));?>\" dojoType=\"dijit.form.CheckBox\"\r\n type=\"checkbox\" id=\"criticalPathPlanning\" name=\"criticalPathPlanning\" class=\"whiteCheck\"\r\n <?php if ( Parameter::getUserParameter('criticalPathPlanning')=='1') {echo 'checked=\"checked\"'; } ?> > \r\n <script type=\"dojo/connect\" event=\"onChange\" args=\"evt\">\r\n saveUserParameter('criticalPathPlanning',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script> \r\n </span>\r\n <?php if (!isNewGui()) {?> <?php echo i18n('criticalPath');?><?php }?>\r\n </div>\r\n<?php \r\n}",
"public function MyExecute()\r\n\t{\r\n Utility::turnDebugOn();\r\n //config switch\r\n// $this->addPortToVlan(\"172.16.254.2\",2143,\"tagged\",1);\r\n// $this->addPortToVlan(\"172.16.254.2\",2143,\"tagged\",2); \r\n// $this->addPortToVlan(\"172.16.254.2\",2143,\"tagged\",3); \r\n// $this->addPortToVlan(\"172.16.254.2\",2143,\"tagged\",4); \r\n// \r\n// $this->addPortToVlan(\"172.16.254.2\",2343,\"tagged\",1);\r\n// $this->addPortToVlan(\"172.16.254.2\",2343,\"tagged\",2); \r\n// $this->addPortToVlan(\"172.16.254.2\",2343,\"tagged\",3);\r\n// $this->addPortToVlan(\"172.16.254.2\",2343,\"tagged\",4); \r\n \r\n// $this->apRadioControl($this->scenario->GetDevice('AP2'),\"Disabled\");\r\n// \r\n// Utility::insertBreakPoint(); \r\n// \r\n// $this->apRadioControl($this->scenario->GetDevice('AP2'),\"Enabled\");\r\n// \r\n// $this->syncAPs();\r\n \r\n// if($this->checkPage()==TRUE)\r\n// {\r\n// Utility::insertBreakPoint(\"hahahahaha\"); \r\n// }\r\n// else\r\n// {\r\n// system(\"banner baga\");\r\n// }\r\n \r\n\r\n $MYVSC=new VSC(\"V2\",\"V2\",\"WPA2(AES/CCMP)\",\"802.1X\");\r\n $MYVSC->commit();\r\n \r\n// $MYVSC=new VSC(\"V3\",\"V3\",\"WEP\",\"HTML\");\r\n// $my_wireless=new WirelessProtection();\r\n// $my_wireless->setWirelessProtectionType(\"WEP\");\r\n// $my_wireless->setKeySource(\"STATIC\");\r\n// $my_wireless->setKey(array( \"c67347dd12a787b7a132f690d0\", \"c67347dd12a797b7a132f690d1\", \"c673a7dd12a787b7a132f690d2\", \"c67347dd16a787b7a132f690d3\", \"2\", \"HEX\"));\r\n// $MYVSC->configureWirelessProtection($my_wireless); \r\n// $MYVSC->commit();\r\n \r\n $MYVSC=new VSC(\"V3\",\"V3\",\"WPA(TKIP)\",\"HTML\");\r\n $my_wireless=new WirelessProtection();\r\n $my_wireless->setWirelessProtectionType(\"WPA(TKIP)\");\r\n $my_wireless->setKeySource(\"STATIC\");\r\n $my_wireless->setKey(\"26d4a5f7cf549710a7aae2db4e712027\");\r\n $MYVSC->configureWirelessProtection($my_wireless); \r\n $MYVSC->commit();\r\n \r\n \r\n \r\n// $MYVSC=new VSC(\"V4\",\"V4\",\"None\",\"MAC\");\r\n// $MYVSC->commit();\r\n// \r\n// $MYVSC=new VSC(\"V5\",\"V5\",\"None\",\"HTML_MAC\");\r\n// $MYVSC->commit();\r\n// \r\n // $MYVSC=new VSC(\"V6\",\"V6\",\"WEP\",\"802.1X\");\r\n// $MYVSC->commit();\r\n// \r\n// $MYVSC=new VSC(\"V7\",\"V7\",\"WPA2(AES/CCMP)\",\"802.1X\");\r\n// $MYVSC->commit();\r\n// \r\n// $MYVSC=new VSC(\"V8\",\"V8\",\"WPA/WPA2\",\"802.1X\");\r\n// $MYVSC->commit();\r\n// $MYVSC=new VSC(\"V2\",\"V2\",\"WEP\");\r\n// $MYVSC->commit(); \r\n// \r\n// $MYVSC=new VSC(\"V3\",\"V3\",\"WEP\",\"HTML\"); \r\n// $MYVSC->commit(); \r\n// \r\n \r\n Utility::insertBreakPoint(); \r\n return \"passed\";\r\n \r\n\t}",
"public function control(){\r\n $result=\"\";\r\n $prec=new PlanningElement($this->predecessorId);\r\n $succ=new PlanningElement($this->successorId); \r\n $precList=$prec->getPredecessorItemsArray();\r\n $succList=$succ->getSuccessorItemsArray();\r\n if (array_key_exists('#' . $this->successorId,$precList)) {\r\n $result.='<br/>' . i18n('errorDependencyLoop');\r\n }\r\n if (array_key_exists('#' .$this->predecessorId,$succList)) {\r\n $result.='<br/>' . i18n('errorDependencyLoop');\r\n }\r\n if ($this->predecessorId==$this->successorId) {\r\n $result.='<br/>' . i18n('errorDependencyLoop');\r\n }\r\n $defaultControl=parent::control();\r\n if ($defaultControl!='OK') {\r\n $result.=$defaultControl;\r\n }if ($result==\"\") {\r\n $result='OK';\r\n }\r\n return $result;\r\n }",
"protected function preDispatchChecked () {\n\t\t/** @var $this \\MvcCore\\Ext\\Forms\\Field|\\MvcCore\\Ext\\Forms\\Field\\Props\\TabIndex */\n\n\t\t// set opposite label side than default from form.\n\t\t$labelSideDefault = $this->form->GetFieldsLabelSideDefault();\n\t\t$this->labelSide = $labelSideDefault === \\MvcCore\\Ext\\Forms\\IField::LABEL_SIDE_LEFT\n\t\t\t? \\MvcCore\\Ext\\Forms\\IField::LABEL_SIDE_RIGHT\n\t\t\t: \\MvcCore\\Ext\\Forms\\IField::LABEL_SIDE_LEFT;;\n\n\t\t// never set up render mode no label for checkbox:\n\t\t$formDefaultFieldRenderMode = $this->form->GetFieldsRenderModeDefault();\n\t\tif ($formDefaultFieldRenderMode === \\MvcCore\\Ext\\IForm::FIELD_RENDER_MODE_LABEL_AROUND) {\n\t\t\t$this->renderMode = \\MvcCore\\Ext\\IForm::FIELD_RENDER_MODE_LABEL_AROUND;\n\t\t} else if ($this->renderMode !== \\MvcCore\\Ext\\IForm::FIELD_RENDER_MODE_LABEL_AROUND) {\n\t\t\t$this->renderMode = \\MvcCore\\Ext\\IForm::FIELD_RENDER_MODE_NORMAL;\n\t\t}\n\t}",
"function save_object()\n {\n plugin::save_object();\n\n $this->gotoLpdEnable_dialog->save_object();\n if($this->gotoLpdEnable_dialog->is_account){\n $this->gotoLpdEnable = $this->gotoLpdEnable_dialog->save();\n }else{\n $this->gotoLpdEnable = array();\n }\n\n /* Save checkbox state */\n if (isset ($_POST['gotoXMethod'])){\n foreach (array(\"gotoScannerEnable\") as $val){\n\n if($this->acl_is_writeable($val)){\n if (!isset ($_POST[\"$val\"])){\n $this->$val= FALSE;\n } else {\n $this->$val= TRUE;\n }\n }\n }\n } \n\n if(isset($_POST['gotoXDriver'])){\n if(isset($_POST['AutoSync'])){\n $this->AutoSync = true;\n }else{\n $this->AutoSync = false;\n }\n }\n\n /* Default entries can use blank hsync/vsync entries */\n if ($this->dn != \"\" && $this->cn != \"default\" && $this->cn != \"default\"){\n\n /* But only if no auto sync is enabled... */\n if (!$this->AutoSync){\n\n /* Check vsync for correct usage */\n $val= preg_replace (\"/\\s/\", \"\", $this->gotoXVsync);\n if (!preg_match (\"/^\\d+(\\.\\d+)?([-]\\d+(\\.\\d+)?)?$/\", $val) && $this->acl_is_writeable(\"gotoXVsync\")){\n $message[]= msgPool::invalid(_(\"Vertical synchronization range\"));\n } elseif ($this->acl_is_writeable(\"gotoXVsync\")){\n list($v1,$v2)= preg_split (\"/[-+]/\", $val);\n if ($v2 != \"\"){\n if ($v1 > $v2){\n $message[]= msgPool::invalid(_(\"Vertical synchronization range\"));\n }\n }\n }\n\n /* Check hsync for correct usage */\n $val= preg_replace (\"/\\s/\", \"\", $this->gotoXHsync);\n if (!preg_match (\"/^\\d+(\\.\\d+)?([-]\\d+(\\.\\d+)?)?$/\", $val) && $this->acl_is_writeable(\"gotoXHsync\")){\n $message[]= msgPool::invalid(_(\"Horizontal synchronization range\"));\n } elseif ($this->acl_is_writeable(\"gotoXHsync\")){\n list($v1,$v2)= preg_split (\"/[-+]/\", $val);\n if ($v2 != \"\"){\n if ($v1 > $v2){\n $message[]= msgPool::invalid(_(\"Horizontal synchronization range\"));\n }\n }\n }\n }\n }\n }",
"function PKG_listSelectedpackages($client,$distr,$release)\n{\nCHECK_FW(CC_clientname, $client);\n\ninclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\nHTML_jsCheckboxChanger('JS_checkboxChanger');\nHTML_checkboxChangerButtons('BUT_checkboxChanger');\n\n//search for all packages witn status wait4acc\n$sql = \"SELECT package,params,normalPackage,id,installedSize,priority FROM `clientjobs` WHERE client='$client' AND status='wait4acc' ORDER BY package, normalPackage\";\n$result = DB_query($sql); //FW ok\n\necho(JS_checkboxChanger.\"\n\t<tr>\n\t\t<td></td>\n\t\t<td><span class=\\\"subhighlight\\\">$I18N_status</span></td>\n\t\t<td><span class=\\\"subhighlight\\\">$I18N_package_name</span></td>\n\t\t<td><span class=\\\"subhighlight\\\">$I18N_size</span></td>\n\t\t<td><span class=\\\"subhighlight\\\">$I18N_parameter</span></td>\n\t\t<td><span class=\\\"subhighlight\\\">$I18N_options</span></td>\n\t\t<td><span class=\\\"subhighlight\\\">$I18N_priority</span></td>\n\t\t<td>\".BUT_checkboxChanger.\"</td>\n\t</tr>\n\t\");\n\n\n$i=0;\n\n$allInstalledSize=0;\n$packageAmount=0;\n\nwhile ($line=mysql_fetch_row($result))\n\t{\n\t $status=PKG_getClientjobsStatus($client,$line[0],$distr,$line[1],$line[2]);\n\n\n\t $packageID = $line[3];\n\n\t\tif ($line[0]==\"m23normalRemove\")\n\t\t\t$allInstalledSize-=$line[4];\n\t\telse\n\t\t\t$allInstalledSize+=$line[4];\n\t $packageAmount++;\n\t $isNormal = false;\n\n\tif (($i % 2) == 0)\n\t\t$col = 'bgcolor=\"#A4D9FF\" bordercolor=\"#A4D9FF\"';\n\telse\n\t\t$col = '';\n\n\tif ($line[0]=='m23normal')\n\t\t{\n\t\t\t$isNormal = true;\n\t\t\t$cbBaseName=\"CB_rmNormalpkg\";\n\t\t\t$jobImg=\"<img src=\\\"/gfx/button_ok-mini.png\\\" alt=\\\"$I18N_install\\\" longdesc=\\\"$I18N_install\\\" title=\\\"$I18N_install\\\">\";\n\t\t}\n\telseif ($line[0]=='m23normalRemove')\n\t\t{\n\t\t\t$isNormal = true;\n\t\t\t$cbBaseName=\"CB_rmNormalRemovepkg\";\n\t\t\t$jobImg=\"<img src=\\\"/gfx/button_cancel-mini.png\\\" alt=\\\"$I18N_deinstall\\\" longdesc=\\\"$I18N_deinstall\\\" title=\\\"$I18N_deinstall\\\">\";\n\t\t}\n\telse\n\t\t$jobImg=\"\";\n\n\t if ($isNormal)\n\t\t{//adds remove line for m23normal + m23normalRemove packages\n\n\t\t $var=$cbBaseName.$i;\n\t\t echo(\"\n\t\t \t<tr $col>\n\t\t\t\t<td>$jobImg</td>\n\t\t\t\t<td valign=\\\"top\\\">$status</td>\n\t\t\t\t<td valign=\\\"top\\\"><b>\".$line[2].\"</b></td>\n\t\t\t\t<td valign=\\\"top\\\">\".number_format((float)$line[4]/1024,2).\" MB</td>\n\t\t\t\t<td valign=\\\"top\\\">\".PKG_listParams($line[1]).\"</td>\n\t\t\t\t<td valign=\\\"top\\\"><CENTER>\".PKG_hasOptions($line[2], $packageID, $distr, $client, $release).\"</CENTER></td>\n\t\t\t\t<td valign=\\\"top\\\"><CENTER>\".$line[5].\"</CENTER></b></td>\n\t\t\t\t<td valign=\\\"top\\\"><CENTER><input type=\\\"checkbox\\\" name=\\\"$var\\\" value=\\\"\".$line[2].\"\\\"></CENTER></td>\n\t\t\t</tr>\\n\");\n\t\t}\n\telse\n\t\t{//adds remove line for other packages\n\t\t $var=\"CB_rmpkg\".$i;\n\t\t echo(\"\n\t\t \t<tr $col>\n\t\t\t\t<td>$jobImg</td>\n\t\t\t\t<td valign=\\\"top\\\">$status</td>\n\t\t\t\t<td valign=\\\"top\\\"><b>\".$line[0].\"</b></td>\n\t\t\t\t<td valign=\\\"top\\\">\".number_format((float)$line[4]/1024,2).\" MB</td>\n\t\t\t\t<td valign=\\\"top\\\">\".PKG_listParams($line[1]).\"</td>\n\t\t\t\t<td valign=\\\"top\\\"><CENTER>\".PKG_hasOptions($line[0], $packageID, $distr, $client, $release).\"</CENTER></td>\n\t\t\t\t<td valign=\\\"top\\\"><CENTER>\".$line[5].\"</CENTER></b></td>\n\t\t\t\t<td valign=\\\"top\\\"><CENTER><input type=\\\"checkbox\\\" name=\\\"$var\\\" value=\\\"\".$line[0].\"\\\"></CENTER></td>\n\t\t\t</tr>\\n\");\n\t\t}\n\t $i++;\n\t};\n\techo(\"\n\t\t<tr>\n\t\t\t<td colspan=\\\"7\\\">\n\t\t\t\t<hr>\n\t\t\t\t$I18N_packageAmount: $packageAmount<br>\n\t\t\t\t$I18N_wholeSize: \".number_format((float)$allInstalledSize/1024,2).\" MB<br>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t\".BUT_checkboxChanger.\"\n\t\t\t</td>\n\t\t</tr>\");\n}",
"public function course_bank_conncheck() {\n global $CFG;\n\n $html = $this->box_start();\n $html .= $this->heading(\n get_string('connchecktitle', 'tool_coursebank'),\n 3\n );\n // Hide the button, and then show it with js if it is enabled.\n $html .= html_writer::start_tag('div',\n array('class' => 'conncheckbutton-div hide')\n );\n $buttonattr = array(\n 'id' => 'conncheck',\n 'type' => 'button',\n 'class' => 'conncheckbutton',\n 'value' => get_string('conncheckbutton', 'tool_coursebank')\n );\n $html .= html_writer::tag('input', '', $buttonattr);\n $html .= html_writer::end_tag('div');\n\n // Display ordinary link, and hide it with js if it is enabled.\n $html .= html_writer::start_tag('div',\n array('class' => 'conncheckurl-div')\n );\n $nonjsparams = array('action' => 'conncheck');\n $nonjsurl = new moodle_url(\n $CFG->wwwroot.'/admin/tool/coursebank/check_connection.php',\n $nonjsparams\n );\n $html .= html_writer::link(\n $nonjsurl,\n get_string('conncheckbutton', 'tool_coursebank'),\n array('class' => 'conncheckurl')\n );\n $html .= html_writer::end_tag('div');\n\n $html .= html_writer::start_tag('div',\n array('class' => 'check-div hide'));\n $imgattr = array(\n 'class' => 'hide',\n 'src' => $CFG->wwwroot.'/pix/i/loading_small.gif',\n 'alt' => get_string('checking', 'tool_coursebank')\n );\n\n $html .= html_writer::empty_tag('img', $imgattr);\n $inputattr = array(\n 'type' => 'hidden',\n 'name' => 'wwwroot',\n 'value' => $CFG->wwwroot,\n 'class' => 'wwwroot'\n );\n $html .= html_writer::tag('input', '', $inputattr);\n $html .= html_writer::end_tag('div');\n\n // Success notification.\n $urltarget = isset($this->get_config()->url) ? $this->get_config()->url : null;\n $html .= $this->course_bank_check_notification(\n 'conncheck',\n 'success',\n get_string('connchecksuccess', 'tool_coursebank', $urltarget)\n );\n\n // Failure notification.\n $html .= $this->course_bank_check_notification(\n 'conncheck',\n 'fail',\n get_string('conncheckfail', 'tool_coursebank', $urltarget)\n );\n\n $html .= $this->box_end();\n\n return $html;\n }",
"function agst_pmpro_checkout_boxes()\n{\n?>\n<table id=\"pmpro_pricing_fields\" class=\"pmpro_checkout\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n<thead>\n\t<tr>\n\t\t<th>\n\t\t\t<?php _e('Australian Residents', 'pmpro-australia-gst');?>\n\t\t</th>\t\t\t\t\t\t\n\t</tr>\n</thead>\n<tbody> \n\t<tr>\t\n\t\t<td>\n\t\t\t<div>\t\t\t\t\n\t\t\t\t<input id=\"taxregion\" name=\"taxregion\" type=\"checkbox\" value=\"1\" <?php if(!empty($_REQUEST['taxregion']) || !empty($_SESSION['taxregion'])) {?>checked=\"checked\"<?php } ?> /> <label for=\"taxregion\" class=\"pmpro_normal pmpro_clickable\"><?php _e('Check this box if your billing address is in Australia.', 'pmpro-australia-gst');?></label>\n\t\t\t</div>\t\t\t\t\n\t\t</td>\n\t</tr>\n</tbody>\n</table>\n<?php\n}",
"function drawOptionResource() {\r\n global $saveShowNullAssignment, $saveShowProject;?>\r\n <table width=\"100%\">\r\n <tr class=\"checkboxLabel\">\r\n <td style=\"min-width:80px;<?php if (!isNewGui()) echo 'text-align:right;padding-right:10px;';?>\"><?php echo ucfirst(i18n(\"labelShowAssignmentWithoutWork\".((isNewGui())?'':'Short')));?></td>\r\n <td style=\"width:36px\">\r\n <div title=\"<?php echo i18n('titleShowAssignmentWithoutWork')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowNullAssignment\" name=\"listShowNullAssignment\" class=\"whiteCheck\" \r\n <?php if ($saveShowNullAssignment=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('listShowNullAssignment',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n </td>\r\n </tr>\r\n <tr class=\"checkboxLabel\">\r\n <td style=\"min-width:80px;<?php if (!isNewGui()) echo 'text-align:right;padding-right:10px;';?>\"><?php echo ucfirst(i18n(\"labelShowProjectLevel\".((isNewGui())?'':'Short')));?></td>\r\n <td tyle=\"width:36px\">\r\n <div title=\"<?php echo i18n('showProjectLevel')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowProject\" name=\"listShowProject\" class=\"whiteCheck\"\r\n <?php if ($saveShowProject=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowProject',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n </td>\r\n </table>\r\n<?php \r\n}",
"function wpfifc_activate() {\r\n\t\t$wpfifc_curr_option =\tget_option('wpfifc_image_padding');\r\n\t\tif( !$wpfifc_curr_option ){\r\n\t\t\tupdate_option('wpfifc_image_padding', '2' );\r\n\t\t}\r\n\t\t$wpfifc_curr_option =\tget_option('wpfifc_default_columns');\r\n\t\tif( !$wpfifc_curr_option ){\r\n\t\t\tupdate_option('wpfifc_default_columns', '3' );\r\n\t\t}\r\n\t\t$wpfifc_curr_option =\tget_option('wpfifc_default_size');\r\n\t\tif(!$wpfifc_curr_option){\r\n\t\t\tupdate_option('wpfifc_default_size', 'thumbnail' );\r\n\t\t}\r\n\t\t$wpfifc_curr_option =\tget_option('wpfifc_genesis_taxonomy');\r\n\t\tif(!$wpfifc_curr_option){\r\n\t\t\tupdate_option('wpfifc_genesis_taxonomy', array() );\r\n\t\t}\r\n\t\t$wpfifc_curr_option =\tget_option('wpfifc_genesis_position');\r\n\t\tif(!$wpfifc_curr_option){\r\n\t\t\tupdate_option('wpfifc_genesis_position', 'left');\r\n\t\t}\r\n\t}",
"public function enablePlaques()\n\t{\n\t\t$this->_plaques = true;\n\t}",
"function check()\n {\n /* Call common method to give check the hook */\n $message= plugin::check();\n $message = array_merge($message,$this->gotoLpdEnable_dialog->check());\n\n if($this->gotoXMethod != \"default\"){\n $xdmcp_types = $this->config->data['SERVERS']['TERMINAL_SESSION_TYPES'];\n $available_servers = array();\n foreach($xdmcp_types as $servername =>$supported_types){\n if(in_array_strict(strtoupper($this->gotoXMethod),$supported_types)){\n $available_servers[] = $servername;\n }\n }\n foreach($this->selected_xdmcp_servers as $server){\n if(!in_array_strict($server,$available_servers)){\n $message[] = _(\"Remote desktop settings contains servers that do not support the selected connection method.\");\n break;\n }\n }\n }\n\n return ($message);\n }",
"function set_checkpoint()\n\t{\n\t\t$this->guardar();\n\t}",
"function thesod_page_preloader_settings_box($post, $type = false) {\n\twp_nonce_field('thesod_page_preloader_settings_box', 'thesod_page_preloader_settings_box_nonce');\n\tif($type === 'term') {\n\t\tif(get_term_meta($post->term_id, 'thesod_page_data', true)) {\n\t\t\t$page_data = thesod_get_sanitize_page_preloader_data($post->term_id, array(), $type);\n\t\t} else {\n\t\t\t$page_data = thesod_theme_options_get_page_settings('blog');\n\t\t}\n\t} elseif(in_array($type, array('default', 'blog', 'search'))) {\n\t\t$page_data = thesod_theme_options_get_page_settings($type);\n\t} else {\n\t\tif(get_post_meta($post->ID, 'thesod_page_data', true)) {\n\t\t\t$page_data = thesod_get_sanitize_page_preloader_data($post->ID);\n\t\t} else {\n\t\t\t$page_data = thesod_theme_options_get_page_settings('default');\n\t\t}\n\t}\n?>\n<input name=\"thesod_page_data[enable_page_preloader]\" type=\"checkbox\" id=\"enable_page_preloader\" value=\"1\" <?php checked($page_data['enable_page_preloader'], 1); ?> />\n<label for=\"enable_page_preloader\"><?php esc_html_e('Enable Page Preloader', 'thegem'); ?></label>\n<?php\n}",
"function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }",
"public function setConfigCheckOnline($input) {\n\t\t$this->_configCheckOnline = ($input ? 1 : 0);\n\t}",
"function checkPanelMode()\n\t{\n\t\tswitch ($this->display_mode)\n\t\t{\n\t\t\tcase \"view\":\n\t\t\t\t$this->displayStatusPanel();\n\t\t\t\tbreak;\n\n\t\t\tcase \"setup\":\n\t\t\t\t$this->displayProcessPanel();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function cera_grimlock_prefooter_callback() {\n\t\tcera_grimlock_widget_areas( 'prefooter', 4 );\n\t}"
] |
[
"0.5659854",
"0.547961",
"0.54039997",
"0.5303556",
"0.5279145",
"0.5220914",
"0.51782197",
"0.50749904",
"0.50562024",
"0.50557554",
"0.50136596",
"0.5005632",
"0.5000856",
"0.49479902",
"0.49247244",
"0.49145606",
"0.48987886",
"0.48533565",
"0.48283458",
"0.48002085",
"0.47969055",
"0.47930264",
"0.47832322",
"0.4773441",
"0.4762607",
"0.47606927",
"0.47502732",
"0.47372493",
"0.4726888",
"0.47163695"
] |
0.6059588
|
0
|
================================================== CHECKBOX SAVE DATES
|
function drawOptionSaveDates() {
global $projectDate, $saveDates; ?>
<span title="<?php echo i18n('saveDates')?>" dojoType="dijit.form.CheckBox"
type="checkbox" id="listSaveDates" name="listSaveDates" class="whiteCheck"
<?php if ($projectDate) {echo 'disabled'; } ?>
<?php if ( $saveDates) {echo 'checked="checked"'; } ?> >
<script type="dojo/method" event="onChange" >
refreshJsonPlanning();
</script>
</span>
<span for="listSaveDates"><?php echo i18n("saveDates");?></span>
<?php
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function save_dates() {\n\t\t// Nothing to do here.\n\t}",
"function save() {\n\t\tif ($this->input->post('contracts_show_due')) {\n\n\t\t\t$this->mdl_mcb_data->save('contracts_show_due', $this->input->post('contracts_show_due'));\n\n\t\t}\n\n\t\telse {\n\n\t\t\t$this->mdl_mcb_data->save('contracts_show_due', \"FALSE\");\n\n\t\t}\n\t}",
"protected function saveDate()\n\t{\n\t\t$this->year = FilterSingleton::number($_POST['year']);\n\t\t$this->month = FilterSingleton::number($_POST['month']); \n\n\t\tif($this->year !== 0 && $this->month !== 0){\n\t\t\tsetcookie(\"date\", json_encode([$this->year, $this->month]), time()+3600, '/');\n\t\t}\n\t\telse {\n\t\t\tif( isset($_COOKIE['date']) ){\n\t\t\t\t$date = json_decode($_COOKIE['date'], true);\n\t\t\t\t$this->year = $date[0];\n\t\t\t\t$this->month = $date[1];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->year = getdate()['year'];\n\t\t\t\t$this->month = getdate()['mon'];\n\t\t\t}\n\t\t}\n\t}",
"public function saveDayResult(){\n\n $this->check == 0 ? $result = 0 : $result = count($this->check);\n\n $date = $this->date;\n\n $listResult[] = $this->check;\n\n dayresult::addRow($date, $result, serialize($listResult), Yii::$app->user->id);\n }",
"public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n $start_date = strtotime($start_date);\n $this->setData(\"start_date\", date(\"Y-m-d\", $start_date));\n\n // We only need to do end dates if they are provided.\n if ($end_date = $this->getData(\"end_date\"))\n {\n $end_date = strtotime($end_date);\n $this->setData(\"end_date\", date(\"Y-m-d\", $end_date));\n }\n else\n {\n $this->setData(\"end_date\", NULL);\n }\n\n parent::save();\n }",
"public function save()\n {\n $date_time = date('Y-m-d H:i:s');\n //inputs from view via ajax post [code: code, name: name, value: value, date: date_]\n $indicator = array(\n 'code' => $this->input->post('code', true),\n 'name' => $this->input->post('name', true),\n 'value' => $this->input->post('value', true),\n 'date' => $this->input->post('date', true),\n 'created' => $date_time\n\n );\n if($this->model->save($indicator))\n echo 1;\n else\n echo 0;\n }",
"function checkSaveButtons() {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values=0;\n if (count($this->arrTableParameters['grps'])) {\n\t $arrSave['grps'] = $this->arrTableParameters['grps'];\n\t $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n \t$arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData,array());\n\t $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n\t\t\t\texit;\n }\n }\n }",
"public function save_working_days() {\n $this->settings_model->delete_all('tbl_working_days');\n\t\t\n $day_id = $this->input->post('day', TRUE);\n $day = $this->input->post('day_id', TRUE);\n $this->settings_model->_table_name = \"tbl_working_days\"; // table name\n $this->settings_model->_primary_key = \"working_days_id\"; // $id \n if (!empty($day)) {\n foreach ($day as $value) {\n $data['flag'] = 0;\n $data['day_id'] = $value;\n\t\t\t\t$data['id_gsettings'] = $this->session->userdata('id_gsettings');\n if (!empty($day_id)) {\n foreach ($day_id as $days) {\n if ($value == $days) {\n $data['flag'] = 1;\n }\n }\n }\n $this->settings_model->save($data);\n }\n }\n //To display confimation message.\n $type = \"success\";\n $message = \"Working Days Successfully Saved!\";\n set_message($type, $message);\n redirect('admin/settings/set_working_days');\n }",
"public function beforeSave() {\n foreach ($this->dateFields as $item) {\n $this->data[$this->name][$item] = $this->_date4Db($this->data[$this->name][$item]);\n }\n return parent::beforeSave();\n }",
"protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }",
"public function save ()\n {\n $this->objMysql->_insert (\"calendar.calendar_holidays\", [\n \"CALENDAR_UID\" => $this->calendar_uid,\n \"CALENDAR_HOLIDAY_NAME\" => $this->calendar_holiday_name,\n \"CALENDAR_HOLIDAY_START\" => $this->calendar_holiday_start,\n \"CALENDAR_HOLIDAY_END\" => $this->calendar_holiday_end\n ]\n );\n }",
"public function saveConditions()\n {\n foreach($this->reportsConditions as $k => $v) {\n $v->save();\n }\n }",
"function saveForm(){\t\n\t\t$this->saveFormBase();\n\t\t$this->saveFormGeoCoverage();\n\t\t$this->saveVaFormResolution();\n\t\tif ($this->dataset->nbModForm >0) $this->saveModForm();\n\t\tif ($this->dataset->nbSatForm >0) $this->saveSatForm();\n\t\tif ($this->dataset->nbInstruForm >0) $this->saveInstruForm();\n\t\t$this->saveFormGrid();\n\t\t//Parameter\n\t\t$this->saveFormVariables($this->dataset->nbVars);\n\t\t//REQ DATA_FORMAT\n\t\t$this->dataset->required_data_formats = array();\n\t\t$this->dataset->required_data_formats[0] = new data_format;\n\t\t$this->dataset->required_data_formats[0]->data_format_id = $this->exportValue('required_data_format');\n\t}",
"public function save() {\r\n $data = array(\r\n 'HolidayDate' => date('Y-m-d', strtotime($this->input->post('HolidayDate'))),\r\n 'Category' => $this->Category\r\n );\r\n $this->db->insert('tbl_holidays', $data);\r\n }",
"public function save()\n {\n // UPDATE (since records were produced from [attendances] table itself\n //\n //TODO: date validation - should comply with attendances table\n\n $connection = new database();\n $columns = '';\n\n for ($i = 1; $i <= $_GET['total_days']; $i++) {\n $columns .= \"day\" . $i . \"=?,\";\n }\n $columns = substr($columns, 0, -1);\n\n $sql = \"UPDATE attendances SET {$columns} WHERE attendance_id=?\";\n //var_dump($sql);\n //var_dump($_POST);\n\n foreach ($_POST as $attendances) {\n foreach ($attendances as $attendance_id => $month) {\n // $attendance_id;\n $data = array();\n foreach ($month as $day) {\n $data[] .= $day;\n }\n $data[] .= $attendance_id;\n $connection->update($sql, $data);\n }\n }\n //var_dump($data);\n //die();\n // TODO: to redirect, need set $_POST['curriculum'] and $_POST['month']\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=attendances&action=index\");\n }",
"public function save(){\n\n \t$sql = \"INSERT INTO \" . self::TABLENAME . \" (ora_aterizare, de_la, \n \t compania)\n \t\t\tVALUES ('$this->ora_aterizare', '$this->de_la', \n \t\t\t'$this->compania')\";\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n \t$db->getConnection()->exec($sql);\n\n \treturn \"Datele au fost introduse cu succes.\";\n }",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }",
"public function saveData()\r\n {\r\n \r\n }",
"public function save($data)\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\t$filter = JFilterInput::getInstance();\n\t\t\n\t\t$db = JFactory::getDbo();\n\t $query = $db->getQuery(true);\n\t\t\n\t\t$calendarDays = $this->getCalendarDays($data['calendaroflessons']);\n\t\t$checkedDays = $calendarDays['checkedays'];\n\t\t$unCheckedDays = $calendarDays['uncheckedays'];\n\t\t\n\t\t//Save the end date in sql format\n\t\tuksort($checkedDays, array($this, \"date_compare\"));\n\t\t$data['end_date'] = date(\"Y-m-d\",strtotime(key( array_slice( $checkedDays, -1, 1, TRUE ))));\n\t\t\n\t\t//Actual hours for week Convert in seconds\n\t\t$hoursForWeek = strtotime('1970-01-01 '.$data['hours_for_week'].' UTC');\n\t\t//Actual days for week\n\t\t$daysForWeek = $data['days_for_week'];\n\t\t\n\t\t//Total duration we can't change during the course \n\t\t$duration = $data[\"duration_in_hours\"] * 60 * 60;//Convert duration from hours to seconds\n\n\t\t//Re-Calculate hours for week and days for week\n\t\t$totalDaysAndHoursForWeek = $this->getTotalDaysAndHoursForWeek($data[\"weeklyfrequency\"]);\n\t\t//We check this for brief course like one or two days\n\t\tif ($totalDaysAndHoursForWeek['totalHoursForWeek'] > $duration)\n\t\t{\n\t\t\t$this->setError('COM_COOLTOURAMAN_HOURS_GT_TO_DURATION_ERROR');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Save the calculate hours for week\n\t\t$data['hours_for_week'] = $totalDaysAndHoursForWeek['totalHoursForWeek'];\n\t\t//Save the calculate days for week\n\t\t$data['days_for_week'] = implode(',', array_keys($totalDaysAndHoursForWeek['totalDaysForWeek']));\n\t\n\t\t//Rebuild the new calendar array; WARNING: (Itsn't possible when the course started) \t\t\n\t\tif (($data[\"start_date\"] !== $input->get('start_date_beforetosave')) ||\n\t\t\t((int)$data[\"duration_in_hours\"] !== (int)$input->get('duration_in_hours_beforetosave'))\n\t\t )\n\t\t{\n\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t}\n\t\telse if ($hoursForWeek !== $data['hours_for_week'] || $daysForWeek !== $data['days_for_week'])\n\t\t{\n\t\t\t\n\t\t\t$timeZone = new DateTimeZone(JFactory::getConfig()->get('offset'));\n\t\t\t$now = JFactory::getDate('now', $timeZone);\n\t\t\t$currentTime = $now->toUnix();\n\t\t\t$timesStamp = $this->stringToDate(array_keys($checkedDays));\n\t\t\t$firstCourseDay = min($timesStamp);\n\t\t\t$lastCourseDay = max($timesStamp);\n\t\t\t$closestTimestamp = $this->closestNumber($timesStamp, $currentTime); //find closest date\n\t\t\t$closestDate = array_search($closestTimestamp, $timesStamp);\n\t\t\t$spentDuration = 0;\n\t\t\t$calendarToSave = $this->getCalendarPart($data['calendaroflessons'], $closestDate, $spentDuration);\n\t\t\t$remainingTime = 0;\n\t\t\tif ($duration > $spentDuration)\n\t\t\t\t$remainingTime = ($duration - $spentDuration)/60/60;\n\t\t\t\n\t\t\tif ($remainingTime > 0)\n\t\t\t{\t\n\t\t\t\t//Course has yet to start make a new calendar\n\t\t\t\tif ($firstCourseDay > $currentTime)\n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t\t\telse if ($currentTime >= $firstCourseDay && $currentTime <= $lastCourseDay) //merge old calendar part whit new one \n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $remainingTime, $now->format('d-m-Y', true), $calendarToSave);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($firstCourseDay > $currentTime)\n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t\t\telse\n\t\t\t\t\t$data['calendaroflessons'] = $calendarToSave;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($calendarDays['total_checked_duration'] != $duration)\n\t\t\t{\n\t\t\t\t$msg = '';\n\t\t\t\tif ($calendarDays['total_checked_duration'] > $duration)\n\t\t\t\t\t$msg = JText::_('COM_COOLTOURAMAN_DAYS_GT_TO_DURATION_ERROR', true);\n\t\t\t\telseif ($calendarDays['total_checked_duration'] < $duration)\n\t\t\t\t\t$msg = JText::_('COM_COOLTOURAMAN_DAYS_LT_TO_DURATION_ERROR', true);\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->setError($msg);\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Convert hours for week in human readble\n\t\t$data['hours_for_week'] = gmdate(\"H:i\", $data['hours_for_week']); \n\n\t\tif (isset($data['created_by_alias']))\n\t\t{\n\t\t\t$data['created_by_alias'] = $filter->clean($data['created_by_alias'], 'TRIM');\n\t\t}\n\t\t\n\t\tif ($data[\"teacher_id\"] !== $input->get('teacher_id_beforetosave'))\n\t\t{\t\n\t\t\t//Delete actual relate from teacher to the course\n\t\t\t$conditions = array(\n\t\t\t\t$db->quoteName('course_id') . ' = '.$input->getInt('id'), \n\t\t\t\t$db->quoteName('teacher_id') . ' = ' . $input->getInt('teacher_id_beforetosave')\n\t\t\t);\n\t\t\t$query->delete($db->quoteName('#__cooltouraman_course_teacher_relations'));\n\t\t\t$query->where($conditions);\n\t\t\t \n\t\t\techo $query->__toString();\n\t\t\t$db->setQuery($query);\n\t\t\t \n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//Add new relate from teacher to the course\n\t\t\t$columns = array('course_id', 'teacher_id');\n\t\t\t$values = array($input->getInt('id'), (int)$data[\"teacher_id\"]);\n\t\t\t$query\n\t\t\t\t->insert($db->quoteName('#__cooltouraman_course_teacher_relations'))\n\t\t\t\t->columns($db->quoteName($columns))\n\t\t\t\t->values(implode(',', $values));\n\t\t\t\t\n\t\t\t$db->setQuery($query);\n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query->clear();\n\t\t//Join course to the students; First delete all relations;\n\t\t$conditions = array(\n\t\t\t$db->quoteName('course_id') . ' = '.$input->getInt('id')\n\t\t);\n\t\t$query->delete($db->quoteName('#__cooltouraman_course_student_relations'));\n\t\t$query->where($conditions);\n\t\t$db->setQuery($query);\n\t\t\n\t\tif(!$db->execute())\n\t\t{\n\t\t\t$this->setError($db->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t$query->clear();\n\t\t// Second relate each student to the course\n\t\t$values = array();\n\t\tforeach($data['attendanceregister']['students'] as $i => $student)\n\t\t\tif (is_numeric($student['id']))\n\t\t\t\t$values[] = $input->getInt('id').','.(int)$student['id'];\n\t\tif (!empty($values))\n\t\t{\n\t\t\t$columns = array('course_id', 'student_id');\n\t\t\t$query\n\t\t\t\t->insert($db->quoteName('#__cooltouraman_course_student_relations'))\n\t\t\t\t->columns($db->quoteName($columns))\n\t\t\t\t->values($values);\n\t\t\t\t\n\t\t\t$db->setQuery($query);\n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Alter the title for save as copy\n\t\tif ($input->get('task') == 'save2copy')\n\t\t{\n\t\t\t$origTable = clone $this->getTable();\n\t\t\t$origTable->load($input->getInt('id'));\n\n\t\t\tif ($data['title'] == $origTable->title)\n\t\t\t{\n\t\t\t\tlist($title, $alias) = $this->generateNewTitle($data['catid'], 'copy', $data['title']);\n\t\t\t\t$data['title'] = $title;\n\t\t\t}\n\t\t\t\n\t\t\t$data['state'] = 0;\n\n\t\t}\n\t\t\n\t\tif (parent::save($data))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"function save();",
"function save();",
"public function afterSave()\n\t{\n\t\t//annoying on every edit, move to a checkbox on form and handle in controller\n\t}",
"public function onManagerSubmitAppointments() {\nglobal $_LW;\nif (!empty($_LW->_POST['dropdown_checked']) && !empty($_LW->_POST['items'])) { // handle checked item requests\n\t$this->saveChecked($_LW->_POST['dropdown_checked'], $_LW->_POST['items']);\n};\n}",
"public function save(){\n\n \t$sql = \"INSERT INTO \" . self::TABLENAME . \" (ora_decolare, destinatia, \n \t compania)\n \t\t\tVALUES ('$this->ora_decolare', '$this->destinatia', \n \t\t\t'$this->compania')\";\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n \t$db->getConnection()->exec($sql);\n\n \treturn \"Datele au fost introduse cu succes.\";\n }",
"function save_all() {\n\n // do not save another demo history if we already have one\n if (isset($this->ale_demo_history['demo_settings_date'])) {\n return;\n }\n\n $local_ale_demo_history = array();\n\n $local_ale_demo_history['page_on_front'] = get_option('page_on_front');\n $local_ale_demo_history['show_on_front'] = get_option('show_on_front');\n $local_ale_demo_history['nav_menu_locations'] = get_theme_mod('nav_menu_locations');\n\n $sidebar_widgets = get_option('sidebars_widgets');\n $local_ale_demo_history['sidebars_widgets'] = $sidebar_widgets;\n\n $used_widgets = $this->get_used_widgets($sidebar_widgets);\n\n\n if (is_array($used_widgets)) {\n foreach ($used_widgets as $used_widget) {\n $local_ale_demo_history['used_widgets'][$used_widget] = get_option('widget_' . $used_widget);\n }\n }\n\n $local_ale_demo_history['theme_options'] = get_option(ALETHEME_THEME_OPTIONS_NAME);\n $local_ale_demo_history['ale_social_networks'] = get_option('ale_social_networks');\n $local_ale_demo_history['demo_settings_date'] = time();\n update_option(ALETHEME_SHORTNAME . '_demo_history', $local_ale_demo_history);\n }",
"function do_save(){\n\t\t// check that number and post_ID is set\n\t\tif( empty($this->post_ID) || empty($this->number) ) return false;\n\t\t\n\t\t// check that we have data in POST\n\t\tif( $this->id_base != 'checkbox' && (\n\t\t\t\tempty($_POST['field-'.$this->id_base][$this->number]) ||\n\t\t\t\t!is_array($_POST['field-'.$this->id_base][$this->number])\n\t\t\t)\n\t\t )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$input = @$_POST['field-'.$this->id_base][$this->number];\n\t\t// get real values\n\t\t$values = $this->save( $input );\n\t\t// save to post meta\n\t\tupdate_post_meta($this->post_ID, $this->slug, $values);\n\t\treturn true;\n\t}",
"public function saveToDCA(array &$arrData)\n {\n parent::saveToDCA($arrData);\n $arrData['fields'][$this->field_name]['inputType'] = \"checkboxWizard\";\n $arrData['fields'][$this->field_name]['sql'] = \"mediumtext NULL\";\n }",
"public function saveSettings()\n {\n $this->store->save($this->data);\n }",
"public function sarbacane_save_widget() {\n\t\t$this->save_newsletter ();\n\t}",
"function save_test_completed_date()\n\t{\n\t\t$this->load->model('frontendmodel');\n\n\t\t$this->frontendmodel->update_test_completed_date();\n\t}"
] |
[
"0.72497934",
"0.6566495",
"0.62101555",
"0.61642176",
"0.60172373",
"0.5877637",
"0.5819018",
"0.5806848",
"0.58035785",
"0.5791143",
"0.5721607",
"0.57198083",
"0.56605744",
"0.5660248",
"0.5653409",
"0.55907065",
"0.55380285",
"0.54999566",
"0.54963183",
"0.54858476",
"0.54858476",
"0.54828537",
"0.54826784",
"0.54812634",
"0.5480249",
"0.54799205",
"0.5440398",
"0.54279506",
"0.54237163",
"0.5422353"
] |
0.68850607
|
1
|
================================================== BUTTONS FOR PLANNING FUNCTIONS (save validated dates, baselines, print, pdf export)
|
function drawButtonsPlanning() {
global $canPlan,$showValidationButton, $planningType;?>
<table>
<tr>
<?php
if ($canPlan and ($planningType=='planning' or $planningType=='global') ) {
if($showValidationButton){
?>
<td colspan="1" width="32px">
<button id="savePlanningButton" dojoType="dijit.form.Button" showlabel="false"
title="<?php echo i18n('validatePlanning');?>"
iconClass="dijitButtonIcon dijitButtonIconValidPlan" class="buttonIconNewGui detailButton">
<script type="dojo/connect" event="onClick" args="evt">
showPlanSaveDates();
return false;
</script>
</button>
</td>
<?php
}
?>
<td colspan="1" width="32px">
<button id="saveBaselineButton" dojoType="dijit.form.Button" showlabel="false"
title="<?php echo i18n('savePlanningBaseline');?>"
iconClass="dijitButtonIcon dijitButtonIconSavePlan" class="buttonIconNewGui detailButton">
<script type="dojo/connect" event="onClick" args="evt">
showPlanningBaseline();
return false;
</script>
</button>
</td>
<?php
}
?>
<td colspan="1" width="32px">
<button title="<?php echo i18n('printPlanning')?>"
dojoType="dijit.form.Button"
id="listPrint" name="listPrint"
iconClass="dijitButtonIcon dijitButtonIconPrint" class="buttonIconNewGui detailButton" showLabel="false">
<script type="dojo/connect" event="onClick" args="evt">
<?php
$ganttPlanningPrintOldStyle=Parameter::getGlobalParameter('ganttPlanningPrintOldStyle');
if (!$ganttPlanningPrintOldStyle) {$ganttPlanningPrintOldStyle="NO";}
if ($ganttPlanningPrintOldStyle=='YES') {?>
showPrint("../tool/jsonPlanning.php", 'planning');
<?php } else { ?>
showPrint("planningPrint.php", 'planning');
<?php }?>
</script>
</button>
</td>
<td colspan="1" width="32px">
<button title="<?php echo i18n('reportPrintPdf')?>"
dojoType="dijit.form.Button"
id="listPrintPdf" name="listPrintPdf"
iconClass="dijitButtonIcon dijitButtonIconPdf" class="buttonIconNewGui detailButton" showLabel="false">
<script type="dojo/connect" event="onClick" args="evt">
var paramPdf='<?php echo Parameter::getGlobalParameter("pdfPlanningBeta");?>';
if(paramPdf!='false') planningPDFBox();
else showPrint("../tool/jsonPlanning_pdf.php", 'planning', null, 'pdf');
</script>
</button>
</td>
<?php if ($planningType=='planning' or $planningType=='global') {?>
<td width="32px" style="padding-right:10px;">
<button title="<?php echo i18n('reportExportMSProject')?>"
dojoType="dijit.form.Button"
id="listPrintMpp" name="listPrintMpp"
iconClass="dijitButtonIcon dijitButtonIconMSProject" class="buttonIconNewGui detailButton" showLabel="false">
<script type="dojo/connect" event="onClick" args="evt">
showPrint("../tool/jsonPlanning.php", 'planning', null, 'mpp');
</script>
</button>
<input type="hidden" id="outMode" name="outMode" value="" />
</td>
<?php }?>
</tr>
</table>
<?php
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function export_preview_data()\n {\n }",
"public function export_preview_data()\n {\n }",
"public function export_preview_data()\n {\n }",
"public function exportButton ()\n\t{\n\t}",
"function showForm() \n{\n\tglobal $Variables, $CalcSettings, $PdfSettings, $Lang;\n\n\t$vars = $Variables->OutVar;\n\t$lang = $Variables->LangVar;\n\t\n\t// Calculating DownPaymentValue, monthly taxes and insurance payments.\n\t$DownPaymentValue = $Variables->HomeValue * $Variables->DownPayment / 100;\n\n\t$Amount = $Variables->HomeValue - $DownPaymentValue;\n\t$Amount2 = 0.8 * $Variables->HomeValue;\n\t$Amount3 = 0.2 * $Variables->HomeValue - $DownPaymentValue;\t\n\n\tif ($Variables->PMISel == '0')\n\t\t$PMI = $Variables->PMI;\n\telse\n\t\t$PMI = $Amount * $Variables->PMI / 100;\n\n\t$MonthlyPMI = $PMI / 12;\n\t\n\t$PointsValue = $Amount * $Variables->Points / 100;\n\t$PointsValue2 = $Amount2 * $Variables->Points2 / 100;\n\t$PointsValue3 = $Amount3 * $Variables->Points3 / 100;\n\t\n\t$AmountFinanced = $Amount;\n\t$AmountFinanced2 = $Amount2;\n\t$AmountFinanced3 = $Amount3;\n\t\n\t// Calculating an actual monthly payment, including interest during the life of loan\n\t$MonthlyPayment = & Calc::PeriodPayment($AmountFinanced, $Variables->Interest, $Variables->Length);\n\t$MonthlyPayment2 = & Calc::PeriodPayment($AmountFinanced2, $Variables->Interest2, $Variables->Length2);\n\t$MonthlyPayment3 = & Calc::PeriodPayment($AmountFinanced3, $Variables->Interest3, $Variables->Length3);\n\n\t// Calculating LTV ratio in percent.\n\t$LoanToValue = ($Variables->Amount / $Variables->HomeValue) * 100;\n\n\t// If LTV ratio is greater than 80% (i.e. DownPaymentValue is less than 20%), then \n\t// PMI (Personal Mortgage Insurance) must be applied.\n if ($LoanToValue > 80) {\n $vars['MonthlyPMI'] = number_format($MonthlyPMI, '2', '.', ',');\n $vars['LoanToValue'] = number_format($LoanToValue, '2', '.', ',');\n }\n\telse\n\t{\n\t\t$MonthlyPMI = 0;\n\t\t$PMI = 0;\n\t}\n\n $MonthlyTotal = $MonthlyPayment + $MonthlyPMI;\n $MonthlyTotal2 = $MonthlyPayment2;\n $MonthlyTotal3 = $MonthlyPayment3;\n $MonthlyTotal2and3 = $MonthlyPayment2 + $MonthlyPayment3;\n \n $TotalClosing = $PointsValue + $Variables->Closing;\n $TotalClosing2 = $PointsValue2 + $Variables->Closing2;\n $TotalClosing3 = $PointsValue3 + $Variables->Closing3;\n $TotalClosing2and3 = $TotalClosing2 + $TotalClosing3;\n\n $Upfront = $TotalClosing + $DownPaymentValue;\n $Upfront2and3 = $TotalClosing2and3 + $DownPaymentValue;\n \n\t$options = new AmortizationOptions();\n\t$options->PMI = $PMI;\n\t$options->PeriodPayment = $MonthlyPayment;\n\t\n\t$AmortizationTable = Calc::BuildAmortizationTable($Variables->HomeValue, $AmountFinanced, $Variables->Interest, $Variables->Length, $options);\n\t\n\t$options = new AmortizationOptions();\n\t$options->PeriodPayment = $MonthlyPayment2;\n\t$AmortizationTable2 = Calc::BuildAmortizationTable($Variables->HomeValue, $AmountFinanced2, $Variables->Interest2, $Variables->Length2, $options);\n\t\n\t$options = new AmortizationOptions();\n\t$options->PeriodPayment = $MonthlyPayment3;\n\t$AmortizationTable3 = Calc::BuildAmortizationTable($Variables->HomeValue, $AmountFinanced3, $Variables->Interest3, $Variables->Length3, $options);\n\t\n\t$AmortizationTable2and3 = Calc::ConsolidateTables($AmortizationTable2, $AmortizationTable3);\n\n\t$TotalInterestPaid2and3 = $AmortizationTable2->InterestPaid + $AmortizationTable3->InterestPaid;\n\t$TotalPaymentAmount2and3 = $AmortizationTable2->PaymentAmount + $AmortizationTable3->PaymentAmount;\n\t\n\t\n\t$vars['AmortizationTable'] = $AmortizationTable;\n\t$vars['AmortizationTable2'] = $AmortizationTable2;\n\t$vars['AmortizationTable3'] = $AmortizationTable3;\n\t$vars['AmortizationTable2and3'] = $AmortizationTable2and3;\n \n\t// Assembling an array for output.\n\t// Assigning calculated values to the output array.\n\t$vars['DownPaymentValue'] = number_format($DownPaymentValue, '2', '.', ',');\n\n\t$vars['PointsValue'] = number_format($PointsValue, '2', '.', ',');\n\t$vars['PointsValue2'] = number_format($PointsValue2, '2', '.', ',');\n\t$vars['PointsValue3'] = number_format($PointsValue3, '2', '.', ',');\n\n\t$vars['TotalClosing'] = number_format($TotalClosing, '2', '.', ',');\n\t$vars['TotalClosing2and3'] = number_format($TotalClosing2and3, '2', '.', ',');\n\n\t$vars['Upfront'] = number_format($Upfront, '2', '.', ',');\n\t$vars['Upfront2and3'] = number_format($Upfront2and3, '2', '.', ',');\n\t\n\t$vars['AmountFinanced'] = number_format($AmountFinanced, '2', '.', ',');\n\t$vars['AmountFinanced2'] = number_format($AmountFinanced2, '2', '.', ',');\n\t$vars['AmountFinanced3'] = number_format($AmountFinanced3, '2', '.', ',');\n\t\n//\t$vars['MonthlyTaxes'] = number_format($MonthlyTaxes, '2', '.', ',');\n//\t$vars['MonthlyInsurance'] = number_format($MonthlyInsurance,'2', '.', ',');\n\t$vars['MonthlyPayment'] = number_format($MonthlyPayment, '2', '.', ',');\n\t$vars['MonthlyPayment2'] = number_format($MonthlyPayment2, '2', '.', ',');\n\t$vars['MonthlyPayment3'] = number_format($MonthlyPayment3, '2', '.', ',');\n\t\n\t$vars['MonthlyPMI'] = number_format($MonthlyPMI, '2', '.', ',');\n\t$vars['MonthlyPMI2'] = number_format(0, '2', '.', ',');\n\t$vars['MonthlyPMI3'] = number_format(0, '2', '.', ',');\n\t\n\t$vars['TotalPMI'] = $AmortizationTable->TotalPMI;\n\t$vars['TotalPMI2'] = number_format(0, '2', '.', ',');\n\t$vars['TotalPMI3'] = number_format(0, '2', '.', ',');\n\n\t$vars['TotalPaymentAmount'] = number_format($AmortizationTable->PaymentAmount + $AmortizationTable->PMI, '2', '.', ',');\n\t$vars['TotalPaymentAmount2and3'] = number_format($TotalPaymentAmount2and3, '2', '.', ',');\n\n\t$vars['TotalInterestPaid'] = $AmortizationTable->TotalInterestPaid;\n\t$vars['TotalInterestPaid2and3'] = number_format($TotalInterestPaid2and3, '2', '.', ',');\n\t\n\t$vars['MonthsWithPMI'] = $AmortizationTable->TotalPeriodsWithPMI;\n\t$vars['MonthlyTotal'] = number_format($MonthlyTotal, '2', '.', ',');\n\t$vars['MonthlyTotal2'] = number_format($MonthlyTotal2, '2', '.', ',');\n\t$vars['MonthlyTotal3'] = number_format($MonthlyTotal3, '2', '.', ',');\n\t$vars['MonthlyTotal2and3'] = number_format($MonthlyTotal2and3, '2', '.', ',');\n\n\tif (!empty($Variables->PDFGen))\n\t{\n\t\t$pdf = new PDF('P', 'mm', $PdfSettings->PageSize);\n\t\t$pdf->AllowFooter = true;\n\t\t$pdf->SetFont($PdfSettings->FontName, '', 9);\n\t\tif (strtolower($PdfSettings->PageSize) == 'legal' || strtolower($PdfSettings->PageSize) == 'letter') $pdf->SetLeftMargin(13); else $pdf->SetLeftMargin(10);\n\t\tif (strtolower($PdfSettings->PageSize) == 'legal' || strtolower($PdfSettings->PageSize) == 'letter') $pdf->SetRightMargin(13); else $pdf->SetRightMargin(10);\n\t\t$pdf->SetCompression(false);\n\t\t$pdf->AddPage();\n\t\n\t\t// Calculator's header\n\t\t$pdf->SetHeaderMode();\n\t\t$pdf->Cell(190, 10, $lang['Calc10Title'], 1, 1, 'C', 1, '');\n\t\t\n\t\t$pdf->SetTableHeaderMode('input');\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(160, 6, $lang['InputInfo'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(160, 6, $lang['PropertyInfo'], 1, 0, 'C', 1, '');\n\t\t$pdf->SetTableMode();\n\t\t$pdf->Ln();\n\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(80, 6, $lang['HomeValue'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(80, 6, $lang['Currency'] . $vars['HomeValue'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(160, 6, $lang['AdditionalInfo'], 1, 0, 'C', 1, '');\n\t\t$pdf->SetTableMode();\n\t\t$pdf->Ln();\n\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(80, 6, $lang['AnnualPMI'], 1, 0, 'R', 1, '');\n\t\tif ($Variables->PMISel == 0)\n\t\t\t$pdf->Cell(80, 6, $CalcSettings->Currency . $vars['PMI'], 1, 0, 'C', 1, '');\n\t\telse \n\t\t\t$pdf->Cell(80, 6, $vars['PMI'] . '%', 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(80, 6, $lang['DownPayment'], 1, 0, 'R', 1, '');\n\t\tif ($Variables->DownPaymentSel == 0)\n\t\t\t$pdf->Cell(80, 6, $CalcSettings->Currency . $vars['DownPayment'], 1, 0, 'C', 1, '');\n\t\telse \n\t\t\t$pdf->Cell(80, 6, $vars['DownPayment'] . '%', 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(40, 6, ' ', 1, 0, '', 1);\n\t\t$pdf->Cell(40, 6, $lang['Standard'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['80PercentLoan'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['SecondLoan'], 1, 0, 'C', 1, '');\n\t\t$pdf->SetTableMode();\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['Interest'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Interest'] . ' %', 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Interest2'] . ' %', 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Interest3'] . ' %', 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['Length'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Length'] . ' ' . $lang['Years'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Length2'] . ' ' . $lang['Years'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Length3'] . ' ' . $lang['Years'], 1, 0, 'C', 1, '');\t\t\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['Points'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Points'] . ' %', 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Points2'] . ' %', 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['Points3'] . ' %', 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['ClosingCost'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['Closing'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['Closing2'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['Closing3'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t\n\t\t\n\t\t$pdf->SetTableHeaderMode('result');\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(160, 6, $lang['FinancialAnalysis'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(40, 6, ' ', 1, 0, '', 1);\n\t\t$pdf->Cell(40, 6, $lang['Standard'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['80PercentLoan'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Second'], 1, 0, 'C', 1, '');\n\t\t$pdf->SetTableMode();\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['PointsValue'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['PointsValue'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['PointsValue2'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['PointsValue3'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['ClosingCost'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['Closing'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['Closing2'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['Closing3'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['TotalClosingCost'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['TotalClosing'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(80, 6, $lang['Currency'] . $vars['TotalClosing2and3'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['DownPayment'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(120, 6, $lang['Currency'] . $vars['DownPaymentValue'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(40, 6, $lang['UpfrontCost'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['Upfront'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(80, 6, $lang['Currency'] . $vars['Upfront2and3'], 1, 0, 'C', 1, '');\n\t\t$pdf->SetTableMode();\n\t\t$pdf->Ln();\n\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(40, 6, $lang['AmountFinanced'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['AmountFinanced'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['AmountFinanced2'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['AmountFinanced3'], 1, 0, 'C', 1, '');\n\t\t$pdf->SetTableMode();\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['MonthlyPIShort'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['MonthlyPayment'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['MonthlyPayment2'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['MonthlyPayment3'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['MonthsWithPMI'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $vars['MonthsWithPMI'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, '0', 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, '0', 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['MonthlyPMI'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['MonthlyPMI'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . '0.00', 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . '0.00', 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(40, 6, $lang['MonthlyPayment'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['MonthlyTotal'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(80, 6, $lang['Currency'] . $vars['MonthlyTotal2and3'], 1, 0, 'C', 1, '');\n\t\t$pdf->SetTableMode();\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['TotalInterestPaid'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['TotalInterestPaid'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(80, 6, $lang['Currency'] . $vars['TotalInterestPaid2and3'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->Cell(40, 6, $lang['TotalPMI'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['TotalPMI'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['TotalPMI2'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['TotalPMI3'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->Cell(15, 6, ' ');\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(40, 6, $lang['TotalPaymentAmount'], 1, 0, 'R', 1, '');\n\t\t$pdf->Cell(40, 6, $lang['Currency'] . $vars['TotalPaymentAmount'], 1, 0, 'C', 1, '');\n\t\t$pdf->Cell(80, 6, $lang['Currency'] . $vars['TotalPaymentAmount2and3'], 1, 0, 'C', 1, '');\n\t\t$pdf->SetTableMode();\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t\n\t\t// Calculator's footprint\n\t\t$pdf->SetFootprintMode();\n\t\t$pdf->MultiCell(190, 4, $PdfSettings->FootPrint);\n\t\t\n\t\t$pdf->AddPage();\n\n\t\t// Calculator's header\n\t\t$pdf->SetHeaderMode();\n\t\t$pdf->Cell(190, 10, $lang['Calc10Title'], 1, 1, 'C', 1, '');\n\t\n\t\t// Schedule's header\n\t\t$pdf->SetTableHeaderMode('schedule');\n\t\t$pdf->Cell(190, 6, $lang['PaymentSchedule'], 1, 0, 'C', 1, '');\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(100, 5, $lang['PaymentSchedule'], 1, 0, 'C', 0, '');\n\t\t$pdf->Cell(0.3, 5, '' , 1, 0, '', 1);\n\t\t$pdf->Cell(89.7, 5, $lang['ConsolidatedSchFor2Loans'], 1, 0, 'C', 0, '');\t\n\t\t$pdf->SetTableMode();\n\n\t\t$pdf->Ln();\n\t\t\n\t\t// Schedule's columns headers\n\t\t$pdf->SetTableBreakerMode();\n\t\t$pdf->Cell(10, 5, $lang['Period'], 1, 0, 'C', 1);\n\t\t$pdf->Cell(30, 5, $lang['InterestPaid'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['Principal'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['RemainingBalance'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(0.3, 5, '' , 1, 0, '', 1);\n\t\t$pdf->Cell(29.7, 5, $lang['InterestPaid'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['Principal'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['RemainingBalance'], 1, 0, 'R', 1);\n\t\t$pdf->SetTableMode(false);\n\t\t$pdf->Ln();\n\n\t\t$pdf->SetFontSize(7);\n\t\t// Schedule table\n\t\t$arr = $AmortizationTable->Schedule;\n\t\t$fullBalance2 = false;\n\t\t$fill = false;\n\t\tforeach($arr as $period)\n\t\t{\n\t\t\tif ($period->Type == 'SubTotal')\n\t\t\t{\n\t\t\t\t$pdf->Cell(10, 4, $period->Period, 'L', 0, 'C', $fill);\n\t\t\t\t$pdf->Cell(30, 4, $period->InterestPaid, 'L', 0, 'R', $fill);\n\t\t\t\t$pdf->Cell(30, 4, $period->PrincipalApplied, 'L', 0, 'R', $fill);\n\t\t\t\t$pdf->Cell(30, 4, $period->RemainingBalance, 'LR', 0, 'R', $fill);\n\t\t\t\t$pdf->Cell(0.5, 4, '' , 1, 0, '', 1);\n\t\t\t\t\n\t\t\t\t$period2 = $AmortizationTable2and3->Schedule[$period->Period * 13 - 1];\n\t\t\t\t\n\t\t\t\tif ($period2 == null && !$fullBalance2)\n\t\t\t\t{\n\t\t\t\t\t$i = ($period->Period)*13 - 1;\n\t\t\t\t\twhile($period2 == null)\n\t\t\t\t\t\t$period2 = $AmortizationTable2and3->Schedule[$i--];\n\n\t\t\t\t\tif ($period2->RemainingBalance == 0 || $period2->RemainingBalance == null)\n\t\t\t\t\t\t$fullBalance2 = true;\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t$pdf->Cell(29.5, 4, $period2->InterestPaid, 'LR', 0, 'R', $fill);\n\t\t\t\t$pdf->Cell(30, 4, $period2->PrincipalApplied, 'L', 0, 'R', $fill);\n\t\t\t\t$pdf->Cell(30, 4, $period2->RemainingBalance, 'LR', 0, 'R', $fill);\n\n\t\t\t\t$pdf->Ln();\n\t\t\t\t$fill=!$fill;\n\t\t\t} \n\t\t}\n\t\t\n\t\t// Schedule's columns footers\n\t\t$pdf->SetTableBreakerMode();\n\t\t$pdf->Cell(10, 5, $lang['Period'], 1, 0, 'C', 1);\n\t\t$pdf->Cell(30, 5, $lang['InterestPaid'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['Principal'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['RemainingBalance'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['InterestPaid'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['Principal'], 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $lang['RemainingBalance'], 1, 0, 'R', 1);\n\t\t$pdf->SetTableMode(false);\n\t\t$pdf->Ln();\n\t\t\n\t\t$pdf->SetTableMode(true);\n\t\t$pdf->Cell(10, 5, ' ', 1, 0, 'C', 1);\n\t\t$pdf->Cell(30, 5, $AmortizationTable->TotalInterestPaid, 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $AmortizationTable->TotalPrincipalApplied, 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $AmortizationTable->TotalRemainingBalance, 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $AmortizationTable2and3->TotalInterestPaid, 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $AmortizationTable2and3->TotalPrincipalApplied, 1, 0, 'R', 1);\n\t\t$pdf->Cell(30, 5, $AmortizationTable2and3->TotalRemainingBalance, 1, 0, 'R', 1);\n\t\t$pdf->SetTableMode(false);\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t\t\t\n\t\t// Calculator's footprint\n\t\t$pdf->SetFootprintMode();\n\t\t$pdf->MultiCell(190, 4, $PdfSettings->FootPrint);\n\t\t\n\t\t$pdf->Output();\n\t}\n\telse \n\t{\n\t\t// Creating a Smarty class instance and assigning values array to it.\n\t\t$smarty = new Smarty();\n\t\t$smarty->assign('vars', $vars);\n\t\t$smarty->assign('lang', $Variables->LangVar);\n\t\t\n\t\t$content = $smarty->fetch($Variables->Template.'/form10.tpl');\n\t\t\n\t\t// Displaying form with values or returning content\n\t\tif ($CalcSettings->ReturnContent)\n\t\t\treturn $content;\n\t\telse\n\t\t\techo $content;\n\t}\n}",
"function lendingform_export_page() {\r\n global $lendingform_global;\r\n global $base_url;\r\n $html = '';\r\n \r\n // only accessible in subdomain\r\n if (!lendingform_siemens_is_subdomain()) {\r\n return drupal_not_found();\r\n }\r\n \r\n if (variable_get('lendingform_siemens_cron_once_' . $lendingform_global->pid, 0) == 1) {\r\n return drupal_not_found();\r\n }\r\n \r\n // description\r\n $html .= 'Export progress';\r\n $html .= '<div id=\"lendingform-export-bar-wrapper\"></div>';\r\n $html .= '<div id=\"lendingform-progress-value\">0%</div>';\r\n $html .= '<div id=\"lendingform-export-message\"></div>';\r\n $html .= '<div id=\"lendingform-export-complete\" style=\"display:none\" class=\"messages status\"><h2 class=\"element-invisible\">Status message</h2>completed ' . l(t('continue'), $base_url) .'</div>';\r\n \r\n \r\n // call for transfering of elements\r\n $exports = module_invoke_all('lendingform_export_transfer');\r\n \r\n \r\n // Pass data to javascript for ajax processing\r\n $data = array('siemens_lendingform_export' => array('data' => $exports));\r\n drupal_add_js($data, array('type' => 'setting'));\r\n \r\n \r\n return $html;\r\n}",
"function CanvassProgressReport($iFYID)\n{\n $pdf = new PDF_CanvassBriefingReport();\n\n $curY = 10;\n\n $pdf->SetFont('Times', '', 24);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, gettext('Canvass Progress Report').' '.date(SystemConfig::getValue(\"sDateFormatLong\")));\n $pdf->SetFont('Times', '', 14);\n\n $curY += 10;\n\n $pdf->SetFont('Times', '', 12);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchName'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchAddress'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchCity').', '.SystemConfig::getValue('sChurchState').' '.SystemConfig::getValue('sChurchZip'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchPhone').' '.SystemConfig::getValue('sChurchEmail'));\n $curY += 10;\n $pdf->SetFont('Times', '', 14);\n\n $nameX = 20;\n $doneX = 70;\n $toDoX = 85;\n $percentX = 110;\n\n $pdf->SetFont('Times', 'B', 14);\n $pdf->WriteAt($nameX, $curY, gettext('Name'));\n $pdf->WriteAt($doneX, $curY, gettext('Done'));\n $pdf->WriteAt($toDoX, $curY, gettext('Assigned'));\n $pdf->WriteAt($percentX, $curY, gettext('Percent'));\n $pdf->SetFont('Times', '', 14);\n\n $curY += 6;\n\n $totalToDo = 0;\n $totalDone = 0;\n\n // Get all the canvassers\n $canvassGroups = ['Canvassers', 'BraveCanvassers'];\n foreach ($canvassGroups as $cgName) {\n $rsCanvassers = CanvassGetCanvassers(gettext($cgName));\n if ($rsCanvassers == 0) {\n continue;\n }\n\n while ($aCanvasser = mysqli_fetch_array($rsCanvassers)) {\n // Get all the families for this canvasser\n $sSQL = 'SELECT fam_ID from family_fam WHERE fam_Canvasser = '.$aCanvasser['per_ID'];\n $rsCanvassees = RunQuery($sSQL);\n\n $thisCanvasserToDo = mysqli_num_rows($rsCanvassees);\n $thisCanvasserDone = 0;\n\n while ($aCanvassee = mysqli_fetch_array($rsCanvassees)) {\n // Get all the canvass input entered so far by this canvasser\n $sSQL = 'SELECT can_ID from canvassdata_can WHERE can_famID='.$aCanvassee['fam_ID'].\n ' AND can_FYID='.$iFYID;\n $rsCanvassData = RunQuery($sSQL);\n\n if (mysqli_num_rows($rsCanvassData) == 1) {\n ++$thisCanvasserDone;\n }\n }\n\n $totalToDo += $thisCanvasserToDo;\n $totalDone += $thisCanvasserDone;\n\n // Write the status output line for this canvasser\n $pdf->WriteAt($nameX, $curY, $aCanvasser['per_FirstName'].' '.$aCanvasser['per_LastName']);\n $pdf->WriteAt($doneX, $curY, $thisCanvasserDone);\n $pdf->WriteAt($toDoX, $curY, $thisCanvasserToDo);\n if ($thisCanvasserToDo > 0) {\n $percentStr = sprintf('%.0f%%', ($thisCanvasserDone / $thisCanvasserToDo) * 100);\n } else {\n $percentStr = 'N/A';\n }\n $pdf->WriteAt($percentX, $curY, $percentStr);\n $curY += 6;\n }\n }\n\n // Summary status\n $pdf->SetFont('Times', 'B', 14);\n\n $pdf->WriteAt($nameX, $curY, gettext('Total'));\n $pdf->WriteAt($doneX, $curY, $totalDone);\n $pdf->WriteAt($toDoX, $curY, $totalToDo);\n $percentStr = sprintf('%.0f%%', ($totalDone / $totalToDo) * 100);\n $pdf->WriteAt($percentX, $curY, $percentStr);\n\n $pdf->Output('CanvassProgress'.date(SystemConfig::getValue(\"sDateFormatLong\")).'.pdf', 'D');\n}",
"public function actionExportToPdf()\n {\n if(TODOS == 0)\n {\n $cursoDisponibleServidorPublico = CursoDisponibleServidorPublico::model() -> findAll(array('condition'=>'activo = true'));\n }\n\n if(TODOS == 1)\n {\n $cursoDisponibleServidorPublico = CursoDisponibleServidorPublico::model() -> findAll();\n }\n\n if ($cursoDisponibleServidorPublico == null || count($cursoDisponibleServidorPublico) == 0)\n return;\n $this->renderPartial(\"exportPdf\", array('cursoDisponibleServidorPublico' => $cursoDisponibleServidorPublico));\n }",
"public function tms_report() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n if (!empty($_POST)) {\n\n\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_POST['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n $displayText = \"Total Amount Received for Paid invoices :\";\n $export_url = '?payStatus=1';\n } else if ($_POST['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n $displayText = \"Total Amount Due for unpaid invoices :\";\n $export_url = '?payStatus=2';\n }\n $data['text'] = $displayText;\n $year = $_POST['yearVal'];\n $month = $_POST['monthVal'];\n $training_score1 = $_POST['trainingStatus'];\n $export_url .='&yearVal=' . $year . '&monthVal=' . $month;\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n $export_url .= '&trainingStatus=' . $training_score1;\n $temp_data = array();\n if ($_POST['payStatus'] == '1') {\n $data['result'] = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_POST['payStatus'] == '2') {\n $data['result'] = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n $data['page_title'] = 'TMS Reports';\n $data['export_url'] = $export_url;\n $data['main_content'] = 'reports/tms_report';\n $this->load->view('layout', $data);\n }",
"function draw() {\n\t\t$currentMonthInfo = getdate($this->_monthTimestamp);\n\t\t$nextMonthInfo = getdate($this->_nextMonthTimestamp());\n\t\t$prevMonthInfo = getdate($this->_previousMonthTimestamp());\n\t\t\n\t\t$prevLinkTop = \"\";\n\t\t$nextLinkTop = \"\";\n\t\t$prevLinkBottom = \"\";\n\t\t$nextLinkBottom = \"\";\n\t\t$extraVars = \"\";\n\t\t$varBase = \"\";\n\t\tif ($this->_submitMethod == \"post\") {\n\t\t\tif (sizeof($this->_extraVars) > 0) {\n\t\t\t\tforeach ($this->_extraVars as $extraVar=>$extraVal) {\n\t\t\t\t\t$extraVars .= \"<input type=\\\"hidden\\\" name=\\\"\".htmlentities($extraVar).\"\\\" value=\\\"\".htmlentities($extraVal).\"\\\" />\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$varBase = \"<a href=\\\"javascript: document.forms['%s'].submit()\\\"><form name=\\\"%s\\\" action=\\\"\".$_SERVER['PHP_SELF'].\"\\\" method=\\\"post\\\" style=\\\"display: inline; margin: 0; padding: 0\\\"><input type=\\\"hidden\\\" name=\\\"\".$this->_monthParamName.\"\\\" value=\\\"%s\\\" /><input type=\\\"hidden\\\" name=\\\"\".$this->_yearParamName.\"\\\" value=\\\"%s\\\" />\".$extraVars.\"</form>%s</a>\";\n\t\t\t$prevLinkTop = sprintf($varBase, \"prevLinkTop\", \"prevLinkTop\", $prevMonthInfo['mon'], $prevMonthInfo['year'], \"<span class=\\\"link_arrows\\\"><<</span> <span class=\\\"link_month\\\">\".$prevMonthInfo['month'].\"</span> <span class=\\\"link_year\\\">\".$prevMonthInfo['year'].\"</span>\");\n\t\t\t$nextLinkTop = sprintf($varBase, \"nextLinkTop\", \"nextLinkTop\", $nextMonthInfo['mon'], $nextMonthInfo['year'], \"<span class=\\\"link_month\\\">\".$nextMonthInfo['month'].\"</span> <span class=\\\"link_year\\\">\".$nextMonthInfo['year'].\"</span> <span class=\\\"link_arrows\\\">>></span>\");\n\t\t\t$prevLinkBottom = sprintf($varBase, \"prevLinkBottom\", \"prevLinkBottom\", $prevMonthInfo['mon'], $prevMonthInfo['year'], \"<span class=\\\"link_arrows\\\"><<</span> <span class=\\\"link_month\\\">\".$prevMonthInfo['month'].\"</span> <span class=\\\"link_year\\\">\".$prevMonthInfo['year'].\"</span>\");\n\t\t\t$nextLinkBottom = sprintf($varBase, \"nextLinkBottom\", \"nextLinkBottom\", $nextMonthInfo['mon'], $nextMonthInfo['year'], \"<span class=\\\"link_month\\\">\".$nextMonthInfo['month'].\"</span> <span class=\\\"link_year\\\">\".$nextMonthInfo['year'].\"</span> <span class=\\\"link_arrows\\\">>></span>\");\n\t\t}\n\t\telse {\n\t\t\tif (sizeof($this->_extraVars) > 0) {\n\t\t\t\tforeach ($this->_extraVars as $extraVar=>$extraVal) {\n\t\t\t\t\t$extraVars .= \"&\".urlencode($extraVar).\"=\".urlencode($extraVal);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$varBase = \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?\".$this->_monthParamName.\"=%s&\".$this->_yearParamName.\"=%s\".$extraVars.\"\\\">%s</a>\";\n\t\t\t$prevLinkTop = $prevLinkBottom = sprintf($varBase, $prevMonthInfo['mon'], $prevMonthInfo['year'], \"<span class=\\\"link_arrows\\\"><<</span> <span class=\\\"link_month\\\">\".$prevMonthInfo['month'].\"</span> <span class=\\\"link_year\\\">\".$prevMonthInfo['year'].\"</span>\");\n\t\t\t$nextLinkTop = $nextLinkBottom = sprintf($varBase, $nextMonthInfo['mon'], $nextMonthInfo['year'], \"<span class=\\\"link_month\\\">\".$nextMonthInfo['month'].\"</span> <span class=\\\"link_year\\\">\".$nextMonthInfo['year'].\"</span> <span class=\\\"link_arrows\\\">>></span>\");\n\t\t}\n\t\t\n\t\tprint '<div class=\"calendar_container\">\n\t<table class=\"calendar\">\n\t\t<tr class=\"calendar_title_row_top\">\n\t\t\t<td class=\"calendar_cell calendar_previous_link\" colspan=\"'.(($this->_showPreWeekColumn) ? '3' : '2').'\">'.$prevLinkTop.'</td>\n\t\t\t<td class=\"calendar_cell calendar_title\" colspan=\"3\"><span>'.$this->calendarTitleCellContent().'</span></td>\n\t\t\t<td class=\"calendar_cell calendar_next_link\" colspan=\"'.(($this->_showPostWeekColumn) ? '3' : '2').'\">'.$nextLinkTop.'</td>\n\t\t</tr>\n\t\t<tr class=\"calendar_header_row_top\">'.\"\\n\";\n\t\tif ($this->_showPreWeekColumn) print '\t\t\t<th class=\"calendar_cell calendar_column_0\" width=\"0\"><span>'.$this->_fillContent($this->preWeekColumnHeader()).'</span></th>'.\"\\n\";\n\t\tprint '\t\t\t<th class=\"calendar_cell calendar_column_1\" width=\"14%\"><span>'.$this->_fillContent($this->SundayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_2\" width=\"14%\"><span>'.$this->_fillContent($this->MondayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_3\" width=\"14%\"><span>'.$this->_fillContent($this->TuesdayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_4\" width=\"14%\"><span>'.$this->_fillContent($this->WednesdayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_5\" width=\"14%\"><span>'.$this->_fillContent($this->ThursdayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_6\" width=\"14%\"><span>'.$this->_fillContent($this->FridayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_7\" width=\"14%\"><span>'.$this->_fillContent($this->SaturdayColumnHeader()).'</span></th>'.\"\\n\";\n\t\tif ($this->_showPostWeekColumn) print '\t\t\t<th class=\"calendar_cell calendar_column_8\" width=\"0\"><span>'.$this->_fillContent($this->postWeekColumnHeader()).'</span></th>'.\"\\n\";\n\t\tprint '\t\t</tr>'.\"\\n\";\n\t\t\t\n\t\t$iDaysPerWeek = 7;\n\t\t$iCurrDay = 0;\n\t\t$iCurrWeek = 1;\n\t\t$iCounter = 0;\n\n\t\t//Write any initial blank days\n\t\tif ($currentMonthInfo['wday'] > 0) {\n\t\t\tprint '\t\t<tr class=\"calendar_week_row\" id=\"calendar_week_'.$iCurrWeek.'\">'.\"\\n\";\n\t\t\tif ($this->_showPreWeekColumn) print '\t\t\t<td class=\"calendar_cell calendar_column_0 calendar_day calendar_day_0\" id=\"calendar_week_'.$iCurrWeek.'_column_0\"><div class=\"calendar_day_date\"><span> </span></div><div class=\"calendar_day_content\"><span>'.((array_key_exists($iCurrWeek,$this->_preWeekArray)) ? $this->_fillContent($this->_preWeekArray[($iCurrWeek)]) : \"\").'</span></div></td>'.\"\\n\";\n\t\t\twhile ($iCounter < $currentMonthInfo['wday'] && $iCounter < $iDaysPerWeek) {\n\t\t\t\tprint '\t\t\t<td class=\"calendar_cell calendar_column_'.(($iCounter % $iDaysPerWeek) + 1).' calendar_day calendar_day_0\">\n\t\t\t\t<div class=\"calendar_day_container\">\n\t\t\t\t\t<div class=\"calendar_day_date\"><span> </span></div>\n\t\t\t\t\t<div class=\"calendar_day_content\"><span> </span></div>\n\t\t\t\t</div>\n\t\t\t</td>'.\"\\n\";\n\t\t\t\t$iCounter++;\n\t\t\t}\n\t\t\tif ($iCounter % $iDaysPerWeek == $iDaysPerWeek) {\n\t\t\t\tif ($this->_showPostWeekColumn) print '\t\t\t<td class=\"calendar_cell calendar_column_8 calendar_day calendar_day_0\" id=\"calendar_week_'.$iCurrWeek.'_column_8\"><div class=\"calendar_day_date\"><span> </span></div><div class=\"calendar_day_content\"><span>'.((array_key_exists($iCurrWeek,$this->_postWeekArray)) ? $this->_fillContent($this->_postWeekArray[($iCurrWeek)]) : \"\").'</span></div></td>'.\"\\n\";\n\t\t\t\tprint '\t\t</tr>'.\"\\n\";\n\t\t\t\t$iCurrWeek++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//Pick up at the first day and continue through end of month\n\t\twhile ($iCurrDay < $this->_currentMonthNumDays) {\n\t\t\t$this->_dayTimestamp = mktime(0,0,0,$this->_currentMonth,($iCurrDay + 1),$this->_currentYear);\n\t\t\t\n\t\t\tif ($iCounter % $iDaysPerWeek == 0) {\n\t\t\t\tprint '\t\t<tr class=\"calendar_week_row\" id=\"calendar_week_'.$iCurrWeek.'\">'.\"\\n\";\n\t\t\t\tif ($this->_showPreWeekColumn) print '\t\t\t<td class=\"calendar_cell calendar_column_0 calendar_day calendar_day_0\" id=\"calendar_week_'.$iCurrWeek.'_column_0\"><div class=\"calendar_day_date\"><span> </span></div><div class=\"calendar_day_content\"><span>'.((array_key_exists($iCurrWeek,$this->_preWeekArray)) ? $this->_fillContent($this->_preWeekArray[($iCurrWeek)]) : \"\").'</span></div></td>'.\"\\n\";\n\t\t\t}\n\t\t\t\n\t\t\tprint '\t\t\t<td class=\"calendar_cell calendar_column_'.(($iCounter % $iDaysPerWeek) + 1).' calendar_day '.((trim($this->_dateArray[($iCurrDay + 1)]) == \"\") ? 'calendar_day_no_content' : 'calendar_day_with_content').((date('Ymd') == date('Ymd',mktime(0,0,0,$this->_currentMonth,$iCurrDay + 1,$this->_currentYear))) ? ' calendar_day_today' : '').'\" id=\"calendar_date_'.($iCurrDay + 1).'\">\n\t\t\t\t<div class=\"calendar_day_container\">\n\t\t\t\t\t<div class=\"calendar_day_date\"><span>'.($iCurrDay + 1).'</span></div>\n\t\t\t\t\t<div class=\"calendar_day_content\"><span>'.((array_key_exists($iCurrDay + 1,$this->_dateArray)) ? $this->_fillContent($this->_dateArray[($iCurrDay + 1)]) : \"\").'</span></div>\n\t\t\t\t</div>\n\t\t\t</td>'.\"\\n\";\n\t\t\t\n\t\t\tif ($iCounter % $iDaysPerWeek == $iDaysPerWeek - 1) {\n\t\t\t\tif ($this->_showPostWeekColumn) print '\t\t\t<td class=\"calendar_cell calendar_column_8 calendar_day calendar_day_0\" id=\"calendar_week_'.$iCurrWeek.'_column_8\"><div class=\"calendar_day_date\"><span> </span></div><div class=\"calendar_day_content\"><span>'.((array_key_exists($iCurrWeek,$this->_postWeekArray)) ? $this->_fillContent($this->_postWeekArray[($iCurrWeek)]) : \"\").'</span></div></td>'.\"\\n\";\n\t\t\t\tprint '\t\t</tr>'.\"\\n\";\n\t\t\t\t$iCurrWeek++;\n\t\t\t}\n\t\t\t\n\t\t\t$iCurrDay++;\n\t\t\t$iCounter++;\n\t\t}\n\t\t\n\t\t//Write any remaining TD's\n\t\tif (($iCounter % $iDaysPerWeek) > 0 && ($iCounter % $iDaysPerWeek) <= ($iDaysPerWeek - 1)) {\n\t\t\twhile (($iCounter % $iDaysPerWeek) !== 0) {\n\t\t\t\tprint '\t\t\t<td class=\"calendar_cell calendar_column_'.(($iCounter % $iDaysPerWeek) + 1).' calendar_day calendar_day_0\">\n\t\t\t\t<div class=\"calendar_day_container\">\n\t\t\t\t\t<div class=\"calendar_day_date\"><span> </span></div>\n\t\t\t\t\t<div class=\"calendar_day_content\"><span> </span></div>\n\t\t\t\t</div>\n\t\t\t</td>'.\"\\n\";\n\t\t\t\t$iCounter++;\n\t\t\t}\n\t\t\tif ($this->_showPostWeekColumn) print '\t\t\t<td class=\"calendar_cell calendar_column_8 calendar_day calendar_day_0\" id=\"calendar_week_'.$iCurrWeek.'_column_8\"><div class=\"calendar_day_date\"><span> </span></div><div class=\"calendar_day_content\"><span>'.((array_key_exists($iCurrWeek,$this->_postWeekArray)) ? $this->_fillContent($this->_postWeekArray[($iCurrWeek)]) : \"\").'</span></div></td>'.\"\\n\";\n\t\t\tprint '\t\t</tr>'.\"\\n\";\n\t\t}\n\t\t\n\t\t//Reset dayTimestamp to beginning of month\n\t\t$this->_dayTimestamp = $this->_monthTimestamp;\n\t\t\n\t\t//Finish writing table elements\n\t\tprint '\t\t<tr class=\"calendar_header_row_bottom\">'.\"\\n\";\n\t\tif ($this->_showPreWeekColumn) print '\t\t\t<th class=\"calendar_cell calendar_column_0\" width=\"0\"><span>'.$this->_fillContent($this->preWeekColumnHeader()).'</span></th>'.\"\\n\";\n\t\tprint '\t\t\t<th class=\"calendar_cell calendar_column_1\" width=\"14%\"><span>'.$this->_fillContent($this->SundayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_2\" width=\"14%\"><span>'.$this->_fillContent($this->MondayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_3\" width=\"14%\"><span>'.$this->_fillContent($this->TuesdayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_4\" width=\"14%\"><span>'.$this->_fillContent($this->WednesdayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_5\" width=\"14%\"><span>'.$this->_fillContent($this->ThursdayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_6\" width=\"14%\"><span>'.$this->_fillContent($this->FridayColumnHeader()).'</span></th>\n\t\t\t<th class=\"calendar_cell calendar_column_7\" width=\"14%\"><span>'.$this->_fillContent($this->SaturdayColumnHeader()).'</span></th>'.\"\\n\";\n\t\tif ($this->_showPostWeekColumn) print '\t\t\t<th class=\"calendar_cell calendar_column_8\" width=\"0\"><span>'.$this->_fillContent($this->postWeekColumnHeader()).'</span></th>'.\"\\n\";\n\t\tprint '\t\t</tr>\n\t\t<tr class=\"calendar_title_row_bottom\">\n\t\t\t<td class=\"calendar_cell calendar_previous_link\" colspan=\"'.(($this->_showPreWeekColumn) ? '3' : '2').'\">'.$prevLinkBottom.'</td>\n\t\t\t<td class=\"calendar_cell calendar_title\" colspan=\"3\"><span>'.$this->calendarTitleCellContent().'</span></td>\n\t\t\t<td class=\"calendar_cell calendar_next_link\" colspan=\"'.(($this->_showPostWeekColumn) ? '3' : '2').'\">'.$nextLinkBottom.'</td>\n\t\t</tr>\n\t</table>\n</div>'.\"\\n\";\n\t}",
"function genrate_inspectorassessmenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(7,15,15,15,14,16,\n\t\t 12,13,12,12,21,11,\n\t\t\t\t\t\t\t\t 15,12);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No.: ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t//$vehiclelicno\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t\tif($c==10){\n\t\t\t\n\t\t\t\t$this->SetFont('Arial', 'B', 5);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $c == 9 || $c == 11 || $c == 13 || $c == 12){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name = \tucfirst($val['AssessmentVehicleMaster']['vc_customer_name']);\n\t\t $dt_created_date=\t\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no=\t\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no= \t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no=\t\t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t\t$vc_prtype_name = \t\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om = \t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate =\t\t\t \tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable =\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[13], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t\n\t}",
"function genrate_inspectorpaymenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name) {\n\t\n\t\t$columnwidtharrays = array(10,24,26,26,28,26,25,24);\n\t\t\n\t\t$heightdynamic = 12;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 7);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_assessment_no = \t$val['AssessmentVehicleMaster']['vc_assessment_no'];\n\t\t $vc_customer_name=\t\t$val['AssessmentVehicleMaster']['vc_customer_name'];\n\t\t $dt_assessment_date=\tdate('d-M-y', strtotime($val['AssessmentVehicleMaster']['dt_assessment_date']));\n\t\t $nu_total_payable_amount= number_format($val['AssessmentVehicleMaster']['nu_total_payable_amount'],2,'.',',');\n\t\t $vc_mdc_paid=\t\t\tnumber_format($val['AssessmentVehicleMaster']['vc_mdc_paid'],2,'.',',');\n\t\t\t$dt_received_date = \tdate('d M Y', strtotime($val['AssessmentVehicleMaster']['dt_received_date']));\n\t\t $vc_prtype_name = \t\t$val['PaymentStatus']['vc_prtype_name'];\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_assessment_date, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_total_payable_amount, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_mdc_paid, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_received_date, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}",
"function genrate_inspectorvehiclehistorypdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t \n\t\t$columnwidtharrays = array(10,30,26,26,23,18,20,20,16);\n\t\t\n\t\t$heightdynamic =8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164 ,8, '',0,'','L',true);\t\t\t\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name =\t\tucfirst($val['CustomerProfile']['vc_customer_name']);\n\t\t $vc_vehicle_lic_no =\t\t$val['VehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no =\t\t$val['VehicleDetail']['vc_vehicle_reg_no'];\n\t\t $dt_created_date =\t\tdate('d M Y', strtotime($val['VehicleDetail']['dt_created_date']));\n\t\t $vc_prtype_name =\t\t$val['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_v_rating =\t\tnumber_format($val['VehicleDetail']['vc_v_rating']);\n\t\t $vc_dt_rating =\t\tnumber_format($val['VehicleDetail']['vc_dt_rating']);\n\t\t $vc_rate =\t\tnumber_format($val['VehicleDetail']['vc_rate'],2,'.',',');\n\t\t\t\n\t\t\t$font_size=7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_v_rating, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_dt_rating, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' =>$vc_rate, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}",
"function shwdtls(){\r\n\t\t\t\t\t\techo \"<h1>Curriculum Vitae</h1>\";\r\n\t\t\t\t\t\techo \"<h2>Personal Details</h2>\";\r\n\t\t\t\t\t\techo \"Name: \".$this->name.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Admn No: \".$this->admnno.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Date of Birth: \".$this->dob.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Nationality: \".$this->nationality.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Gender: \".$this->gender.\"<br><br>\";\r\n\t\t\t\t\t\techo \"E-mail: \".$this->email.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Skype ID: \".$this->skypeid.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Mobile No: \".$this->mobno.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Category: \".$this->category.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Contact Address: \".$this->caddress.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Permanent Address: \".$this->paddress.\"<br><br>\";\r\n\t\t\t\t\t\techo \"<h2>Academic Details</h2>\";\r\n\t\t\t\t\t\techo \"Examination Passed: X<br><br>\";\r\n\t\t\t\t\t\techo \"Board/University: \".$this->boarduniv.\"<br>\";\r\n\t\t\t\t\t\techo \"Year of Passing: \".$this->year.\"<br>\";\r\n\t\t\t\t\t\techo \"Percentage/CGPA: \".$this->percgpa.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Examination Passed: XII<br><br>\";\r\n\t\t\t\t\t\techo \"Board/University: \".$this->boarduniv.\"<br>\";\r\n\t\t\t\t\t\techo \"Year of Passing: \".$this->year.\"<br>\";\r\n\t\t\t\t\t\techo \"Percentage/CGPA: \".$this->percgpa.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Examination Passed: Graduation<br><br>\";\r\n\t\t\t\t\t\techo \"Board/University: \".$this->boarduniv.\"<br>\";\r\n\t\t\t\t\t\techo \"Year of Passing: \".$this->year.\"<br>\";\r\n\t\t\t\t\t\techo \"Percentage/CGPA: \".$this->percgpa.\"<br><br>\";\r\n\t\t\t\t\t\techo \"<h2>Experience</h2>\";\r\n\t\t\t\t\t\techo \"Organisation/Institute: \".$this->insti.\"<br>\";\r\n\t\t\t\t\t\techo \"Start Date: \".$this->strdate.\"<br>\";\r\n\t\t\t\t\t\techo \"End Date: \".$this->stpdate.\"<br><br>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"public function invoice_audit_trail_export_PDF() {\n //Read page parameter to display report\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $company_id = $this->input->get('company_id');\n\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $query = $this->reportsModel->get_invoice_audit_trail($tenant_id, NULL, NULL, $field, $order_by, $payment_status, $start_date, $end_date, $invoice_id, $company_id);\n $this->load->helper('pdf_reports_helper');\n return invoice_audit_trail_report_PDF($query, $tenant_details);\n }",
"function print_panel() {\t\n\t\tif ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) {\n\t\t\t$this->print_saved_message();\n\t\t}\n\t\tif ( isset($_REQUEST['reset']) && $_REQUEST['reset'] ) {\n\t\t\t$this->print_reset_message();\n\t\t}\n\t\n\t\t$this->print_heading();\n\t\t$this->print_options();\n\t\t$this->print_footer();\n\t}",
"function _export()\n\t{\n\t\t$title=get_page_title('EXPORT');\n\n\t\tif (!array_key_exists('tables',$_POST)) warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));\n\n\t\t$xml=export_to_xml($_POST['tables'],post_param_integer('comcode_xml',0)==1);\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_EXPORT_RESULTS_SCREEN',array('TITLE'=>$title,'XML'=>$xml));\n\t}",
"function genrate_assessmenthistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(9,15,15,14,15,14,13,12,13,27,12,17,13);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) || \n\t\t(isset($vehiclelicno) && !empty($vehiclelicno))){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t\t//vehiclelicno\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 || $c == 8 || $c == 10 || $c == 11 || $c == 12 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 6);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_created_date =\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no =\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no =\t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no = \t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_prtype_name =\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t\t$vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}",
"function genrate_inspectorvehicleloghistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n \n\t\t$columnwidtharrays = array(15,17,16,20,15,15,15,15,27,16,18);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c = 0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t \n\n\t\t if( $c == 0 || $c ==3 || $c ==6 || $c ==7|| $c ==9|| $c ==8){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 12, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 12, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 6, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_log_date = \t\t\tdate('d M Y', strtotime($val['VehicleLogDetail']['dt_log_date']));\n\t\t $vc_vehicle_reg_no=\t\t$val['VehicleLogDetail']['vc_vehicle_reg_no'];\n\t\t $vc_vehicle_lic_no=\t\t$val['VehicleLogDetail']['vc_vehicle_lic_no'];\n\t\t $vc_driver_name= \t\t$val['VehicleLogDetail']['vc_driver_name'];\n\t\t $nu_start_ometer=\t\tnumber_format($val['VehicleLogDetail']['nu_start_ometer']);\n\t\t\t$nu_end_ometer = \t\tnumber_format($val['VehicleLogDetail']['nu_end_ometer']);\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1){\n\t\t\t\t\n\t\t\t\t$origin = $val['VehicleLogDetail']['vc_other_road_orign_name'];\n\t\t\t\t$destination = $val['VehicleLogDetail']['vc_other_road_destination_name'];\n\t\t\t\t$nu_km_traveled = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t\t$origin = $val['VehicleLogDetail']['vc_orign_name'];\n\t\t\t\t$destination = $val['VehicleLogDetail']['vc_destination_name'];\n\t\t\t\t$nu_km_traveled = number_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1)\n\t\t\t\t$ch_road_type = 'Other Road';\n\t\t\telse\n\t\t\t\t$ch_road_type = 'Namibian Road';\n\t\t\t\t\t\t\t\n\t\t // $vc_orign_name = \t\t$val['VehicleLogDetail']['vc_orign_name'];\n\t\t // $vc_destination_name = \t$val['VehicleLogDetail']['vc_destination_name'];\n\t\t // $nu_km_traveled = \t\tnumber_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t // $nu_other_road_km_traveled = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t $dt_created_date =\t\tdate('d M Y', strtotime($val['VehicleLogDetail']['dt_created_date']));\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_log_date, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_driver_name, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_start_ometer, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_end_ometer, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t$col[] = array('text' => $ch_road_type, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $origin, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $destination, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_km_traveled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t}\n\t}",
"function glReport() {\n if ($this->session->userdata('role') == 550 || $this->session->userdata('role') == 551) {\n if (!empty($_POST)) {\n if (isset($_POST['type'])) {\n if ($_POST['type'] == \"pdf\") {\n $collaboratore = $this->input->post('txtCollaboratore');\n $accompagnatore = $this->input->post('txtAccompagnatore');\n\n $glExportReportData = $this->_getGlReportData($collaboratore, $accompagnatore);\n $data['report_table_data'] = $glExportReportData['report_table_data'];\n\n $pdfFileName = \"Webservice_Report\";\n $reportHTML = $this->load->view(\"webservice_report_view\", $data, TRUE);\n downloadhtmltopdf($reportHTML, $pdfFileName);\n } else {\n $collaboratore = $this->input->post('txtCollaboratore');\n $accompagnatore = $this->input->post('txtAccompagnatore');\n\n $glExportReportData = $this->_getGlReportData($collaboratore, $accompagnatore);\n $report_data = $glExportReportData['report_table_data'];\n $grand_total = $passeggero_start = $passeggero_si_start = 0;\n $exportData = array();\n $prev_codice_prodotto = '';\n foreach ($report_data as $rdata) {\n $passeggero_start = ( $prev_codice_prodotto != $rdata['codice_prodotto'] ) ? 0 : $passeggero_start;\n $passeggero_si_start = ( $prev_codice_prodotto != $rdata['codice_prodotto'] ) ? 0 : $passeggero_si_start;\n\n if ($rdata['codice_prodotto'] != 'Total') {\n if ($rdata['pax'] > 1 && ( $rdata['type'] == 'Reimbursement' || $rdata['type'] == 'Presentation' )) {\n $passeggero_arr = $this->webservicemodel->getPasseggero($rdata['collaboratore'], $rdata['accompagnatore'], $rdata['codice_prodotto']);\n $passeggero = explode(\",\", $passeggero_arr['passeggero']);\n for ($i = 0; $i < $rdata['pax']; $i++) {\n $pax = 1;\n $total = $rdata['amount_per_pax'] * $pax;\n $grand_total = $grand_total + $total;\n $pass = isset($passeggero[$passeggero_start])?$passeggero[$passeggero_start]:'';\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => $pass,\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $pax,\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $total\n );\n $passeggero_start++;\n }\n } else if ($rdata['type'] == 'GLF') {\n $passeggero_arr = $this->webservicemodel->getPasseggeroSi($rdata['collaboratore'], $rdata['accompagnatore'], $rdata['codice_prodotto']);\n $passeggero = explode(\",\", $passeggero_arr['passeggero']);\n\n $total = $rdata['amount_per_pax'] * $rdata['pax'];\n $grand_total = $grand_total + $total;\n\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => $passeggero[$passeggero_si_start],\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $rdata['pax'],\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $rdata['total_reimbursement']\n );\n $passeggero_si_start++;\n } else {\n $total = $rdata['amount_per_pax'] * $rdata['pax'];\n $grand_total = $grand_total + $total;\n\n $exportData[] = array(\n 'Collaboratore' => $rdata['collaboratore'],\n 'Accompagnatore' => $rdata['accompagnatore'],\n 'Campus' => $rdata['campus'],\n 'Product Code' => $rdata['codice_prodotto'],\n 'Pax Name' => ( $rdata['type'] == 'Reimbursement' || $rdata['type'] == 'Presentation' ) ? $rdata['passeggero'] : \"\",\n 'Type' => $rdata['type'],\n 'Group' => $rdata['group'],\n 'Pax' => $rdata['pax'],\n 'Amount Per Pax' => $rdata['amount_per_pax'],\n 'Total' => $rdata['total_reimbursement']\n );\n }\n }\n $prev_codice_prodotto = $rdata['codice_prodotto'];\n }\n if (!empty($exportData)) {\n // Empty row before total\n $exportData[] = array(\n 'Collaboratore' => '',\n 'Accompagnatore' => '',\n 'Campus' => '',\n 'Product Code' => '',\n 'Pax Name' => '',\n 'Type' => '',\n 'Group' => '',\n 'Pax' => '',\n 'Amount Per Pax' => '',\n 'Total' => ''\n );\n\n $exportData[] = array(\n 'Collaboratore' => 'Total',\n 'Accompagnatore' => '',\n 'Campus' => '',\n 'Product Code' => '',\n 'Pax Name' => '',\n 'Type' => '',\n 'Group' => '',\n 'Pax' => '',\n 'Amount Per Pax' => '',\n 'Total' => $grand_total\n );\n }\n\n $this->load->library('export');\n $this->export->exportUsingPhpExcel($exportData, 'webserviceglreport');\n }\n } else {\n $data['title'] = 'plus-ed.com | Export by GL';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Export by GL';\n\n $data['collaboratore'] = $this->input->post('txtCollaboratore');\n $data['accompagnatore'] = $this->input->post('txtAccompagnatore');\n\n $glReportData = $this->_getGlReportData($data['collaboratore'], $data['accompagnatore']);\n $data['reportData'] = $glReportData['report_data'];\n $data['report_table_data'] = $glReportData['report_table_data'];\n $data['report_analysis_data'] = $glReportData['report_analysis_data'];\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_gl_report_data', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n\t\t\t\t\t\t//echo \"<pre>\";print_r($data);die;\n $this->ltelayout->view('lte/reimbursement/webservice_gl_report_data', $data);\n }\n }\n } else {\n $data['title'] = 'plus-ed.com | Export by GL';\n $data['breadcrumb1'] = 'Webservice management';\n $data['breadcrumb2'] = 'Export by GL';\n\n $data['accompagnatore'] = $this->webservicemodel->getDistinctDataByField('accompagnatore');\n $data['collaboratore'] = $this->webservicemodel->getDistinctDataByField('collaboratore');\n\n if (APP_THEME == \"OLD\")\n $this->load->view('plused_webservice_gl_report', $data);\n else { // if(APP_THEME == \"LTE\")\n $data['pageHeader'] = $data['breadcrumb2'];\n $data['optionalDescription'] = \"\";\n $this->ltelayout->view('lte/reimbursement/webservice_gl_report', $data);\n }\n }\n } else {\n redirect('backoffice', 'refresh');\n }\n }",
"function genrate_inspectorvehiclelogsheet_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(17,20,15,15,18,14,13,13,15,25,25);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+25);\n\t\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(165, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(165, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t}\n\t}\n\t\n\t\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($c == 4 || $c == 7 || $c == 8 || $c == 1|| $c == 9){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n\t\t\t\tif($c==$length ){\n\n\t\t\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\n\t\t\t\t\t$this->SetY($y); //Reset the write point\n\n\t\t\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\n\t\t\t\t\t$this->SetY($y); //Reset the write point\n\n\t\t\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $LogDate = !empty ($val['VehicleLogDetail']['dt_log_date']) ? \n date('d M Y', strtotime($val['VehicleLogDetail']['dt_log_date'])):\n '';\n\t\t $vc_customer_name=\t\tucfirst($val['VehicleLogMaster']['vc_customer_name']);\n\t\t $vc_vehicle_reg_no=\t\t$val['VehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_vehicle_lic_no=\t\t$val['VehicleLogDetail']['vc_vehicle_lic_no'];\n\t\t $vc_driver_name=\t\t$val['VehicleLogDetail']['vc_driver_name'];\n\t\t\t$StartOMet = \t\t\tisset($val['VehicleLogDetail']['nu_start_ometer']) ?$val['VehicleLogDetail']['nu_start_ometer']:'';\n\t\t $EndOMet = \t\t\t\tisset($val['VehicleLogDetail']['nu_end_ometer']) ?$val['VehicleLogDetail']['nu_end_ometer']:'';\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1){\n\t\t\t\n\t\t\t$origin = $val['VehicleLogDetail']['vc_other_road_orign_name'];\n\t\t\t$destination = $val['VehicleLogDetail']['vc_other_road_destination_name'];\n\t\t\t//$kmtravldnamroad = number_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t\t$KmTraV = $val['VehicleLogDetail']['nu_other_road_km_traveled'];\n\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t$origin = $val['VehicleLogDetail']['vc_orign_name'];\n\t\t\t$destination = $val['VehicleLogDetail']['vc_destination_name'];\n\t\t\t$KmTraV = $val['VehicleLogDetail']['nu_km_traveled'];\n\t\t\t//$kmtrvldotheroad = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t\t\n\t\t\t}\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1)\n\t\t\t$ch_road_type= 'Other Road';\n\t\t\telse\n\t\t\t$ch_road_type= 'Namibian Road';\n\t\t\t\t\t\t\t\n\t\t\t\n//\t\t\t$vc_orign_name =\t\t$val['VehicleLogDetail']['vc_orign_name'];\n\t//\t $vc_destination_name=\t$val['VehicleLogDetail']['vc_destination_name'];\n\t\t//\t$KmTraV = \t\t\t\tisset($val['VehicleLogDetail']['nu_km_traveled']) ?$val['VehicleLogDetail']['nu_km_traveled']:'';\n\t\t // $KmTravOth = \t\t\tisset($val['VehicleLogDetail']['nu_other_road_km_traveled']) ?$val['VehicleLogDetail']['nu_other_road_km_traveled']:'';\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $LogDate, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_driver_name, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' => number_format($StartOMet), 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => number_format($EndOMet), 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $ch_road_type, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t$col[] = array('text' => $origin, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' =>$destination, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' =>number_format($KmTraV), 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\n\t\t}\n\t\n\t}",
"public function postProcess()\n {\n $grandTotal = 0;\n //CRM_Utils_System::flushCache();\n $values = $this->controller->exportValues();\n $grantThresholds = CRM_Core_OptionGroup::values('grant_thresholds', TRUE);\n $maxLimit = $grantThresholds['Maximum number of checks per pdf file'];\n $programID = implode(',',$values['grant_program']);\n\n // Get payment status ID\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'name' => 'grant_payment_status',\n );\n $result = civicrm_api('OptionGroup', 'get', $params);\n if ($result['is_error'] || empty($result['values'])) {\n CRM_Core_Error::fatal(ts('No \"grant_payment_status\" option group. Please refer to extension installation instructions.'));\n }\n $optionID = $result['values'][0]['id'];\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'option_group_id' => $optionID,\n 'name' => 'Printed',\n );\n $result = civicrm_api('OptionValue', 'get', $params);\n if ($result['is_error'] || empty($result['values'])) {\n CRM_Core_Error::fatal(ts('No \"Printed\" grant payment status option. Please refer to extension installation instructions.'));\n }\n $paidStatus[] = $result['values'][0]['value'];\n\n // Reprinted payment status\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'option_group_id' => $optionID,\n 'name' => 'Reprinted',\n );\n $result = civicrm_api('OptionValue', 'get', $params);\n if (!empty($result['values'])) {\n $paidStatus[] = $result['values'][0]['value'];\n }\n\n $paid = implode(',', $paidStatus); // payment status to include\n $minAmount = $values['t4a_min_payment'];\n\n // Get dates\n if ($values['start_date']['d'] != '' && $values['start_date']['M'] != '' && $values['start_date']['Y'] != '' &&\n $values['end_date']['d'] != '' && $values['end_date']['M'] != '' && $values['end_date']['Y'] != '') {\n $startDate = $values['start_date']['Y'] . '-' . $values['start_date']['M'] . '-' . $values['start_date']['d'];\n $endDate = $values['end_date']['Y'] . '-' . $values['end_date']['M'] . '-' . $values['end_date']['d'];\n }\n\n $select = \"select * from \";\n $count = \"select count(1) from \";\n $query = \"(select a.contact_id as id, a.currency, sum(a.amount) as total_amount from\n (select distinct p.id, p.contact_id, p.currency, p.payment_created_date, p.amount from civicrm_payment p\n inner join civicrm_entity_payment ep on p.id = ep.payment_id and ep.entity_table = 'civicrm_grant'\n inner join civicrm_grant g on ep.entity_id = g.id\n where g.grant_program_id in ($programID) and p.payment_status_id in ($paid) \";\n\n if (isset($startDate)) {\n $query .= \"and p.payment_date >= '\" . $startDate . \"' and p.payment_date <= '\" . $endDate . \"' \";\n }\n\n // Filter by contact\n if (isset($values['t4a_contact_id']) && $values['t4a_contact_id'] != '') {\n $query .= \"AND p.contact_id in (\" . $values['t4a_contact_id'] . ') ';\n }\n\n $query .= \") a\n group by a.contact_id) b\n WHERE b.total_amount > $minAmount\";\n\n $daoCount = CRM_Grant_DAO_Grant::singleValueQuery($count . $query); // Surely there's a better way of doing this?\n\n if ($daoCount > 0) {\n for ($i=0; $i<$daoCount; $i=$i+$maxLimit) {\n $dao = CRM_Grant_DAO_Grant::executeQuery($select . $query.\" LIMIT $i, $maxLimit\");\n $grantPayment = $payment_details = $amountsTotal = $details = array();\n while($dao->fetch()) {\n if (isset($amountsTotal[$dao->id])) {\n $amountsTotal[$dao->id] += $dao->total_amount;\n }\n else {\n $amountsTotal[$dao->id] = $dao->total_amount;\n }\n\n // Aggregate payments per contact id\n if (!empty($details[$dao->id]['total_amount'])) {\n $details[$dao->id]['total_amount'] += $dao->total_amount;\n } else {\n $details[$dao->id]['total_amount'] = $dao->total_amount;\n }\n $details[$dao->id]['currency'] = $dao->currency;\n\n }\n $totalAmount = 0;\n foreach ($details as $id => $value) {\n $grantPayment[$id]['contact_id'] = $id;\n $grantPayment[$id]['t4a_year'] = $values['t4a_year'];\n $grantPayment[$id]['first_name'] = $this->getFirstName($id);\n $grantPayment[$id]['last_name'] = $this->getLastName($id);\n $grantPayment[$id]['payable_to_address'] =\n CRM_Utils_Array::value('address', CRM_Grant_BAO_GrantProgram::getAddress($id, NULL, true));\n $grantPayment[$id]['amount'] = $details[$id]['total_amount'];\n $grantPayment[$id]['payer'] = wordwrap($values['t4a_payer'], 20, '<br />');\n $grantPayment[$id]['box'] = $values['t4a_box'];\n\n // Get contact's SIN\n $sinID = CRM_T4Ageneration_Form_GenerateXML::returnCustomFieldID();\n $params = array('entityID' => $id, 'custom_' . $sinID => 1);\n $sinResult = CRM_Core_BAO_CustomValueTable::getValues($params);\n // Insert spaces in SIN\n $sinArray = str_split($sinResult['custom_' . $sinID], 3);\n $grantPayment[$id]['sin'] = implode(' ', $sinArray);\n\n $totalAmount += $details[$id]['total_amount'];\n }\n\n $grandTotal += $totalAmount;\n $downloadNamePDF = check_plain('T4');\n $downloadNamePDF .= '_'.date('Ymdhis');\n $this->assign('grantPayment', $grantPayment);\n $downloadNamePDF .= '.pdf';\n $fileName = CRM_Utils_File::makeFileName($downloadNamePDF);\n $files[] = $fileName = $this->makePDF($fileName, $grantPayment, 'Grant Payment T4');\n }\n $config = CRM_Core_Config::singleton();\n\n $fileDAO = new CRM_Core_DAO_File();\n $fileDAO->uri = $fileName;\n $fileDAO->mime_type = 'application/zip';\n $fileDAO->upload_date = date('Ymdhis');\n $fileDAO->save();\n $grantPaymentFile = $fileDAO->id;\n\n $entityFileDAO = new CRM_Core_DAO_EntityFile();\n $entityFileDAO->entity_table = 'civicrm_contact';\n $entityFileDAO->entity_id = $_SESSION[ 'CiviCRM' ][ 'userID' ];\n $entityFileDAO->file_id = $grantPaymentFile;\n $entityFileDAO->save();\n\n //make Zip\n $zipFile = check_plain('T4').'_'.date('Ymdhis').'.zip';\n foreach($files as $file) {\n $source[] = $config->customFileUploadDir.$file;\n }\n $exportFormat = new CRM_Financial_BAO_ExportFormat_CSV();\n $zip = $exportFormat->createZip($source, $config->customFileUploadDir.$zipFile);\n\n foreach($source as $sourceFile) {\n unlink($sourceFile);\n }\n\n CRM_Core_Session::setStatus(ts('T4s have been generated.'), NULL, 'no-popup');\n\n $directory = strstr($config->customFileUploadDir, 'sites');\n global $base_url;\n $filePath = $base_url . '/' . $directory . $zipFile;\n $this->assign('download', $filePath);\n\n // Redirect to XML file generation. Maybe redirecting back to the grant search page would be best,\n // but we'd need a way to trigger the download ideally without overloading any templates\n CRM_Utils_System::redirect(CRM_Utils_System::url( 'civicrm/grant/t4adownload', 'reset=1&download='.$zipFile));\n } else {\n CRM_Core_Session::setStatus(ts('No payments exist for the given time period, program and contacts.'), NULL, 'no-popup');\n }\n\n parent::postProcess();\n }",
"private function btn_payments(){\n\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] === VISIT_OUT_OF_SCOPE) \n\t\t\t|| ($this->rec['v_status']!= STATUS_YES) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t|| (is_object(VM::$e) && VM::$e->isEventEndorsed())\n\t\t\t)) $this->dbg('not_my_case '.$this->rec['av_lastname']);\n\n bTiming()->cpu(__function__);\n $reply = array();\n foreach(bForm_vm_Visit::_getPolicies($this->rec) as $p=>$descr){\n // The event policy has precedence over the visit policy\n if (!empty(VM::$e) && ($p_e = @VM::$E_V_policies[$p]) && !VM::$e->getPolicy($p_e)) continue;\n if (empty($descr['i'])) continue; \n\n $yes_no = (bool)bForm_vm_Visit::_getPolicy($p,$this->rec);\n $this->dbg(\"$p $descr[i] - \".var_export($yes_no,True),True);\n $icon = '';\n // don't draw useless button for the passed events\n if(!$not_my_case && (($yes_no || ($this->rec['v_end'] > time()-30*86400)))){\n\t$already_paid = Null;\n\tswitch($p){\n\t \n\tcase VM_V_provideOffice:\n\t if (myOrg()->eaMembers()->isMember($this->rec['av_id'])){\n\t $av = loader::getInstance_new('bForm_Avatar_vm',$this->rec['av_id'],array('fatal','nocache'));\n\t if ($av->isE(True) && $av->get_staffOffice()) break;\n\t }\n\t $already_paid = '';\n\t $hasRightTo = 'assign_offices';\n\t $paid = 'provided';\n\t break;\n\n\tcase VM_E_provideLunches:\n\tcase VM_E_conferenceDinner:\n\t if ($already_paid === Null){\n\t $already_paid = '';\n\t b_debug::var_dump($descr['i'],'already_paid===Null');\n\t }\n\t break;\n\n\tcase VM_V_payPerdiem:\n\t if ($already_paid === Null){\n\t $already_paid = (bool)(is_object($this->exp) && $this->exp->scholarshipP(False,False));\n\t $hasRightTo = 'setup_reimbursement';\n\t $paid = 'paid';\n\t }\n\t break;\n\n\tcase VM_V_payTrip:\n\t if ($already_paid === Null){\n\t $already_paid = (bool)(is_object($this->exp) && $this->exp->scholarshipT(False,False));\n\t $hasRightTo = 'setup_reimbursement';\n\t $paid = 'paid';\n\t }\n\t break;\n\n\tdefault:\n\t}\n\t \n\tif ($already_paid !== Null){\n\t // Show either a click-able button or just an icon\n\t $img = @$descr['i'] . ($yes_no ? '_on' : '_off');\n\t $icon = (!$already_paid && VM::hasRightTo($hasRightTo,$this->rec)\n\t\t ? bIcons()->getButton(array('class'=>'form-submit',\n\t\t\t\t\t 'i'=>$img,\n\t\t\t\t\t 'c'=>($yes_no ? 'only_online' : 'only_online opacity_on'),\n\t\t\t\t\t 'd'=>$descr['i'].($yes_no ? '' : ' not').\" to be $paid, click to change\",\n\t\t\t\t\t 'l'=>b_url::same(\"?resetcache_once=1&toggle_once=$p&v_id=\".$this->rec['v_id'],$this->anchor())))\n\t\t : bIcons()->get (array('i'=>$img,\n\t\t\t\t\t 'c'=>($yes_no ? 'only_online' : 'only_online opacity_on'),\n\t\t\t\t\t 'd'=>$descr['i'].($yes_no ? '' :' not').\" $paid\")));\n\t}\n }else{\n\t$this->dbg('too old visit '.$this->rec['av_lastname']);\n }\n $reply[] = $icon;\n }\n bTiming()->cpu();\n return $reply;\n }",
"function checkSaveButtons() {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values=0;\n if (count($this->arrTableParameters['grps'])) {\n\t $arrSave['grps'] = $this->arrTableParameters['grps'];\n\t $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n \t$arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData,array());\n\t $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n\t\t\t\texit;\n }\n }\n }",
"public function preview(Request $request) {\n $export_type = $request->get('export_type');\n $this->store->set('export_type', $export_type);\n\n $build = [];\n $build['status_messages'] = [\n '#type' => 'status_messages',\n '#weight' => -10,\n ];\n\n $entity = $this->getEntityFromStorage();\n $data = $this->storyJsonBuilder->build($entity);\n\n foreach ($this->pageplannerManager->providedFields() as $field_name => $field_label) {\n if (!empty($data[$field_name])) {\n // If the Pageplanner property is an array, fetch the array value.\n $value = $data[$field_name];\n if (is_array($value)) {\n if (isset($value['value'])) {\n $value = $value['value'];\n }\n else {\n $value = implode(', ', $value);\n }\n }\n $build[$field_name] = [\n '#type' => 'item',\n '#title' => $field_label,\n '#markup' => $value,\n ];\n }\n }\n\n $url = Url::fromRoute('pageplanner.pageplanner_export.process');\n $url->setOptions([\n 'attributes' => [\n 'class' => ['use-ajax', 'button'],\n 'data-dialog-type' => 'modal',\n 'data-dialog-options' => Json::encode(['width' => '80%']),\n ],\n ]);\n\n $build['process'] = [\n '#type' => 'link',\n '#title' => t('Export to Pageplanner'),\n '#url' => $url,\n '#weight' => 25,\n ];\n $build['#attached']['library'][] = 'core/drupal.dialog.ajax';\n\n return $build;\n }",
"public function exportPDF() { \n $this->load->helper('pdf_helper');\n $data['activities'] = $this->mod_activities->exportAllDatas('activities');\n $this->load->view('include/BE/activities/pdfexport', $data);\n }",
"public function run()\n {\n $sort = 0;\n\n $page = FormBuilder::createPage('SuranceBay Signature Agreement', UserStatusHistory::STATUS_SURANCE_BAY);\n\n $section = FormBuilder::createSection('SuranceBay Signature Agreement', $page->id, $sort++);\n FormBuilder::addSubline($section, 'Please read and agree to the terms below.');\n FormBuilder::createField(\"I hereby authorize Surancebay, LLC and it’s general agency customers (the \\\"Authorized Parties\\\") to affix or append a copy of my signature, as set forth below, to any and all required signature fields on forms and agreements of any insurance carrier (a “Carrier“) designated by me through the SURELC software, business submission, or through any other means, including without limitation, by email or orally. The Authorized Parties shall be permitted to complete and submit all such forms and agreements on my behalf for the purposes of becoming authorized to sell Carrier insurance products. I hereby release, indemnify and hold harmless the Authorized Parties against any and all claims, demands, losses, damages, and causes of action, including expenses, costs and reasonable attorney’s fees which they may sustain or incur as a result of carrying out the authority granted hereunder.<br><br>By my signature below, I certify that the information I have submitted to the Authorized Parties is correct to the best of my knowledge and acknowledge that I have read and reviewed the forms and agreements which the Authorized Parties have been authorized to affix my signature. I agree to indemnify and hold any third party harmless from and against any and all claims, demands, losses, damages, and causes of action, including expenses, costs and reasonable attorney’s fees which such third party may incur as a result of its reliance on any form or agreement bearing my signature pursuant to this authorization.\", FormField::TYPE_HTML, FormField::WIDTH_FULL, $section->id);\n FormBuilder::createField('I agree to the terms.', FormField::TYPE_CHECKBOX, FormField::WIDTH_FULL, $section->id);\n\n $section = FormBuilder::createSection('Printed Name', $page->id, $sort++);\n FormBuilder::createField('', FormField::TYPE_TEXT, FormField::WIDTH_HALF, $section->id, '', 1);\n\n $section = FormBuilder::createSection('Signature', $page->id, $sort++);\n FormBuilder::addSubline($section, 'Please make sure to sign your full name. Initials are not accepted. Illegible signatures are not accepted.');\n FormBuilder::createField('', FormField::TYPE_SIGNATURE, FormField::WIDTH_HALF, $section->id);\n }",
"public function planning()\n\t{\n \n $this->load->model('datum_model');\n \n\n $data['titel'] = 'Planning';\n $data['gebruiker'] = $this->authex->getGebruikerInfo();\n \n $datums= $this->datum_model->get();\n $i=0;\n foreach ($datums as $datum) {\n $datums[$i]->datum = zetOmNaarDDMMYYYY($datums[$i]->datum);\n \n $i++;\n }\n $data['datums'] = $datums;\n \n $data['auteur'] = \"Lorenzo M.| Arne V.D.P. | Kim M. | <u>Eloy B.</u> | <u>Sander J.</u>\";\n $data['link'] = 'admin/index';\n\n \n $partials = array('hoofding' => 'main_header', 'menu' => 'main_menu', 'inhoud' => 'planning_admin');\n \n $this->template->load('main_master', $partials, $data);\n\t}",
"function sendExport() {\n\tglobal $orgcode;\n\tglobal $filename;\n\tglobal $firstdate;\n\tglobal $lastdate;\n\t$headers = [\n\t\t\"ORGCODE\",\t//0\n\t\t\"PARTICIP\",\n\t\t\"ENROLL\",\n\t\t\"PAYER\",\n\t\t\"STATE\",\n\t\t\"GLUCTEST\",\t//5\n\t\t\"GDM\",\n\t\t\"RISKTEST\",\n\t\t\"AGE\",\n\t\t\"ETHNIC\",\n\t\t\"AIAN\",\t\t//10\n\t\t\"ASIAN\",\n\t\t\"BLACK\",\n\t\t\"NHOPI\",\n\t\t\"WHITE\",\n\t\t\"SEX\",\t\t//15\n\t\t\"HEIGHT\",\n\t\t\"EDU\",\n\t\t\"DMODE\",\n\t\t\"SESSID\",\n\t\t\"SESSTYPE\",\t//20\n\t\t\"DATE\",\n\t\t\"WEIGHT\",\n\t\t\"PA\"\n\t];\n\t\n\t$data = [$headers];\n\t$noncompliant = [$headers];\n\t$today = new DateTime(\"NOW\");\n\t\n\t// get all participant data\n\t$records = \\REDCap::getData(PROJECT_ID);\n\t$project = new \\Project(PROJECT_ID);\n\t\n\t// get year value for when these records were created or first logged update\n\t$recordCreationDates = [];\n\t$sql = \"SELECT pk, ts FROM redcap_log_event WHERE project_id=\" . PROJECT_ID . \" and pk in (\" . implode(array_keys($records), \", \") . \") and (description=\\\"Create record\\\" OR description=\\\"Update record\\\") ORDER BY pk ASC, ts ASC\";\n\t$query = db_query($sql);\n\twhile ($row = db_fetch_assoc($query)) {\n\t\tif (!isset($recordCreationDates[$row['pk']])) {\n\t\t\t$recordCreationDates[$row['pk']] = substr($row['ts'], 2, 2);\n\t\t}\n\t}\n\t\n\t// regex for getting labels for project fields (like state, sess_type, etc)\n\t$labelPattern = \"/(\\d+),?\\s?(.+?)(?=\\x{005c}\\x{006E}|$)/\";\n\t\n\tforeach ($records as $rid => $record) {\n\t\t$eid = array_keys($record)[0];\n\t\t\n\t\t// skip if orgcode set and not match\n\t\tif (isset($orgcode) and $orgcode != $record[$eid]['orgcode']) {\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t// skip if have diabietes\n\t\tif ($record[$eid]['have_diabetes'] == 1 or $record[$eid]['enter_roster'] == 0) continue;\n\t\t\n\t\t$line = array_fill(0, 23, null);\n\t\t$line[0] = $record[$eid]['orgcode'];\n\t\t\n\t\t// determine participant ID\n\t\t$participantID = $recordCreationDates[$rid];\n\t\tpreg_match_all($labelPattern, $project->metadata['participant_id_group']['element_enum'], $matches);\n\t\t$participantID .= trim($matches[2][$record[$eid]['participant_id_group'] - 1]);\n\t\t$participantID .= $record[$eid]['participant_id_group'];\n\t\tpreg_match_all(\"/\\d+/\", $record[$eid]['participant_employee_id'], $matches);\n\t\t$participantID .= $matches[0][0];\n\t\t\n\t\t$line[1] = $participantID;\n\t\t$line[2] = $record[$eid]['program_referral'] === null ? 10 : $record[$eid]['program_referral'];\n\t\t$line[3] = $record[$eid]['payer'] === null ? 9 : $record[$eid]['payer'];\n\t\tpreg_match_all($labelPattern, $project->metadata['state']['element_enum'], $matches);\n\t\tpreg_match(\"/- ([A-Z]{2})(?:\\s|$)/\", $matches[2][$record[$eid]['state'] - 1], $matches);\n\t\t$line[4] = $matches[1];\n\t\t$line[5] = $record[$eid]['gluctest'] == 1 ? 1 : 2;\n\t\t$line[6] = $record[$eid]['gdm'] == 1 ? 1 : 2;\n\t\t$line[7] = $record[$eid]['risktest'] == 1 ? 1 : 2;\n\t\t$dob = new DateTime($record[$eid]['dob']);\n\t\t$line[8] = $dob->diff($today)->format('%y');\n\t\t$line[9] = $record[$eid]['ethnicity'] == null ? 9 : $record[$eid]['ethnicity'];\n\t\t$line[10] = $record[$eid]['race'][1] == 1 ? 1 : 2;\n\t\t$line[11] = $record[$eid]['race'][2] == 1 ? 1 : 2;\n\t\t$line[12] = $record[$eid]['race'][3] == 1 ? 1 : 2;\n\t\t$line[13] = $record[$eid]['race'][4] == 1 ? 1 : 2;\n\t\t$line[14] = $record[$eid]['race'][5] == 1 ? 1 : 2;\n\t\t$line[15] = $record[$eid]['sex'] == null ? 9 : $record[$eid]['sex'];\n\t\tpreg_match_all($labelPattern, $project->metadata['height']['element_enum'], $matches);\n\t\tpreg_match_all(\"/[0-9]{1,2}/\", $matches[2][$record[$eid]['height'] - 1], $matches);\n\t\t$line[16] = @((int) $matches[0][0] * 12 + (int) $matches[0][1]);\n\t\t$line[17] = $record[$eid]['education'] == null ? 9 : $record[$eid]['education'];\n\t\t\n\t\t$instanceSum = 0;\n\t\tforeach ($record['repeat_instances'][$eid]['sessionscoaching_log'] as $i => $instance) {\n\t\t\t// only add data that's within last 6 months!\n\t\t\t$sess_date = $instance[\"sess_actual_date\"];\n\t\t\tif (empty($sess_date)) {\n\t\t\t\t$sess_date = $instance[\"sess_scheduled_date\"];\n\t\t\t}\n\t\t\t\n\t\t\t$thisdate = strtotime($sess_date);\n\t\t\tif (empty($sess_date) or (!empty($firstdate) and $firstdate > $thisdate) or (!empty($lastdate) and $lastdate < $thisdate)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$instanceSum++;\n\t\t\t$line_copy = $line;\n\t\t\t$line_copy[18] = $instance['sess_mode'];\n\t\t\t$line_copy[19] = $instance['sess_id'];\n\t\t\tif ($instance[\"sess_month\"] >= 7) {\n\t\t\t\t$line_copy[19] = 99;\n\t\t\t\t$line_copy[20] = \"CM\";\n\t\t\t}\n\t\t\tif ($instance[\"sess_month\"] >= 7)\n\t\t\t\t$line_copy[20] = \"OM\";\n\t\t\tpreg_match_all($labelPattern, $project->metadata['sess_type']['element_enum'], $matches);\n\t\t\tpreg_match_all(\"/\\(([A-Z]|[A-Z][A-Z])\\)/\", $matches[2][$instance['sess_type'] - 1], $matches);\n\t\t\t$line_copy[20] = $matches[1][0];\n\t\t\t$line_copy[21] = $sess_date == null ? null : date(\"m/d/Y\", strtotime($sess_date));\n\t\t\t$line_copy[22] = $instance['sess_weight'];\n\t\t\t$line_copy[23] = $instance['sess_pa'];\n\t\t\t\n\t\t\t$session_attended = false;\n\t\t\tif ($instance[\"sess_attended\"] or $instance['sess_weight'] or $instance['sess_pa'])\n\t\t\t\t$session_attended = true;\n\t\t\t\n\t\t\tvalidateLine($line_copy, $session_attended);\n\t\t\t\n\t\t\t// if session is marked as attended but weight and/or pa values not included, use 999\n\t\t\tif ($instance[\"sess_attended\"] and empty($line_copy[22]))\n\t\t\t\t$line_copy[22] = 999;\n\t\t\tif ($instance[\"sess_attended\"] and empty($line_copy[23]))\n\t\t\t\t$line_copy[23] = 999;\n\t\t\t\n\t\t\t// if error messages were appended...\n\t\t\tif (isset($line_copy[24]) and isset($_GET['noncompliant'])) {\n\t\t\t\t$noncompliant[] = $line_copy;\n\t\t\t}\n\t\t\t\n\t\t\t// no errors and no non-compliant param\n\t\t\tif (!isset($line_copy[24]) and !isset($_GET['noncompliant'])) {\n\t\t\t\t$data[] = $line_copy;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// send participant records with no session data to noncompliant set\n\t\tif ($instanceSum == 0)\n\t\t\t$noncompliant[] = $line;\n\t}\n\t\n\theader('Content-Type: text/csv');\n\theader(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\t$fp = fopen('php://output', 'wb');\n\t\n\t// non-compliance report\n\tif (isset($_GET['noncompliant'])) {\n\t\t$data = $noncompliant;\n\t}\n\t\n\tforeach ($data as $line) {\n\t\tfputcsv($fp, $line, ',');\n\t}\n\tfclose($fp);\n}",
"public function export_tms_report() {\n set_time_limit(0);\n ini_set(\"memory_limit\", \"-1\");\n if (!empty($_GET)) {\n $tenant_id = $this->session->userdata('userDetails')->tenant_id;\n if ($_GET['payStatus'] == '1') {\n $payment_status = \"PAID','PARTPAID\";\n } else if ($_GET['payStatus'] == '2') {\n $payment_status = \"NOTPAID','PARTPAID\";\n }\n $data['text'] = $displayText;\n $year = $_GET['yearVal'];\n $month = $_GET['monthVal'];\n $training_score1 = $_GET['trainingStatus'];\n\n if ($training_score1 == '1') {\n $training_score = 'C';\n } else if ($training_score1 == '2') {\n $training_score = \"NYC','2NYC\";\n } else if ($training_score1 == '3') {\n $training_score = 'ABS';\n } else if ($training_score1 == '4') {\n $training_score = \"C','NYC','2NYC\";\n }\n\n\n if ($_GET['payStatus'] == '1') {\n $result = $this->reportsModel->tms_paid_report($tenant_id, $payment_status, $year, $month, $training_score);\n } else if ($_GET['payStatus'] == '2') {\n $result = $this->reportsModel->tms_unpaid_report($tenant_id, $payment_status, $year, $month, $training_score);\n }\n }\n\n $this->load->helper('export_helper');\n export_tms_report_page($result);\n }"
] |
[
"0.58637434",
"0.58636934",
"0.58636934",
"0.5847548",
"0.57767624",
"0.57760006",
"0.57531655",
"0.5726628",
"0.56941247",
"0.5663761",
"0.5659412",
"0.562788",
"0.5623138",
"0.5618093",
"0.56057066",
"0.5590653",
"0.5584795",
"0.55837923",
"0.557998",
"0.55151945",
"0.55114275",
"0.5476409",
"0.54627824",
"0.5455081",
"0.5450618",
"0.54420483",
"0.5429179",
"0.5420682",
"0.5420093",
"0.54196686"
] |
0.68727154
|
0
|
================================================== CHECKBOX FOR CRITICAL PATH
|
function drawOptionCriticalPath() {
?>
<div style="white-space:nowrap; <?php echo (isNewGui())?'margin-right:6px;margin-top:5px;':'position:absolute; bottom:5px;left:10px;'; ?>" class="checkboxLabel">
<?php if (isNewGui()) {?><?php echo ucfirst(i18n('criticalPath'));?> <?php }?>
<span title="<?php echo ucfirst(i18n('criticalPath'));?>" dojoType="dijit.form.CheckBox"
type="checkbox" id="criticalPathPlanning" name="criticalPathPlanning" class="whiteCheck"
<?php if ( Parameter::getUserParameter('criticalPathPlanning')=='1') {echo 'checked="checked"'; } ?> >
<script type="dojo/connect" event="onChange" args="evt">
saveUserParameter('criticalPathPlanning',((this.checked)?'1':'0'));
refreshJsonPlanning();
</script>
</span>
<?php if (!isNewGui()) {?> <?php echo i18n('criticalPath');?><?php }?>
</div>
<?php
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function drawOptionLeftWork() {\r\n global $saveShowWork;?>\r\n <table width=\"100%\">\r\n <tr class=\"checkboxLabel\">\r\n <td >\r\n <?php echo ucfirst(i18n(\"labelShowLeftWork\".((isNewGui()?'':'Short'))));?>\r\n </td>\r\n <td style=\"width:36px\">\r\n <div title=\"<?php echo i18n('showLeftWork')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowLeftWork\" name=\"listShowLeftWork\" class=\"whiteCheck\"\r\n <?php if ($saveShowWork=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowWork',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n </td>\r\n </tr>\r\n </table>\r\n<?php \r\n}",
"function drawOptionAutomatic() {\r\n global $automaticRunPlanning,$displayWidthPlan;?>\r\n <div style=\"white-space:nowrap;\">\r\n <?php if (isNewGui()) htmlDrawSwitch('automaticRunPlan',$automaticRunPlanning);?>\r\n <span title=\"<?php echo i18n('automaticRunPlanHelp');?>\" dojoType=\"dijit.form.CheckBox\" \r\n <?php if (isNewGui()) echo 'style=\"display:none\"';?>\r\n type=\"checkbox\" id=\"automaticRunPlan\" name=\"automaticRunPlan\" id=\"automaticRunPlan\" class=\"whiteCheck\"\r\n <?php if ( $automaticRunPlanning) {echo 'checked=\"checked\"'; } ?> > \r\n <script type=\"dojo/connect\" event=\"onChange\" args=\"evt\">\r\n saveUserParameter('automaticRunPlanning',((this.checked)?'1':'0'));\r\n </script> \r\n </span> <?php if ($displayWidthPlan>1250) echo i18n('automaticRunPlan'); else echo i18n('automaticRunPlanShort');?>\r\n </div>\r\n<?php \r\n}",
"function drawOptionResource() {\r\n global $saveShowNullAssignment, $saveShowProject;?>\r\n <table width=\"100%\">\r\n <tr class=\"checkboxLabel\">\r\n <td style=\"min-width:80px;<?php if (!isNewGui()) echo 'text-align:right;padding-right:10px;';?>\"><?php echo ucfirst(i18n(\"labelShowAssignmentWithoutWork\".((isNewGui())?'':'Short')));?></td>\r\n <td style=\"width:36px\">\r\n <div title=\"<?php echo i18n('titleShowAssignmentWithoutWork')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowNullAssignment\" name=\"listShowNullAssignment\" class=\"whiteCheck\" \r\n <?php if ($saveShowNullAssignment=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('listShowNullAssignment',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n </td>\r\n </tr>\r\n <tr class=\"checkboxLabel\">\r\n <td style=\"min-width:80px;<?php if (!isNewGui()) echo 'text-align:right;padding-right:10px;';?>\"><?php echo ucfirst(i18n(\"labelShowProjectLevel\".((isNewGui())?'':'Short')));?></td>\r\n <td tyle=\"width:36px\">\r\n <div title=\"<?php echo i18n('showProjectLevel')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowProject\" name=\"listShowProject\" class=\"whiteCheck\"\r\n <?php if ($saveShowProject=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowProject',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n </td>\r\n </table>\r\n<?php \r\n}",
"function drawOptionSaveDates() {\r\n global $projectDate, $saveDates; ?>\r\n <span title=\"<?php echo i18n('saveDates')?>\" dojoType=\"dijit.form.CheckBox\"\r\n type=\"checkbox\" id=\"listSaveDates\" name=\"listSaveDates\" class=\"whiteCheck\"\r\n <?php if ($projectDate) {echo 'disabled'; } ?> \r\n <?php if ( $saveDates) {echo 'checked=\"checked\"'; } ?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n refreshJsonPlanning();\r\n </script>\r\n </span>\r\n <span for=\"listSaveDates\"><?php echo i18n(\"saveDates\");?></span>\r\n<?php \r\n}",
"public function testUi() {\n // Create a File field.\n $field_name = mb_strtolower($this->randomMachineName());\n $this->createFileField($field_name, 'node', $this->contentType);\n\n // Ensure File (Field) Paths Pathauto settings are present and available.\n $this->drupalGet(\"admin/structure/types/manage/{$this->contentType}/fields/node.{$this->contentType}.{$field_name}\");\n // Redirect checkbox is present in File (Field) Path settings.\n $this->assertSession()\n ->fieldExists('third_party_settings[filefield_paths][redirect]');\n\n $element = $this->xpath('//input[@name=:name]/@disabled', [':name' => 'third_party_settings[filefield_paths][redirect]']);\n $this->assertEmpty($element, 'Redirect checkbox is not disabled.');\n }",
"function checkbox($args) {\r\n\t\t$args = $this->apply_default_args($args) ;\r\n\t\techo \"<input name='$this->options_name[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $this->options[$args['id']]); \r\n\t\techo \" /> <span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t\t\r\n\t}",
"protected function createPathIfNeeded() {}",
"protected function _checkPath()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'check that path is given on error or normal page',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $path = array();\n\n if ($this->_get) {\n $path[0] = $this->_get->path();\n $path[1] = $this->_get->path(TRUE);\n } else {\n $path[0] = $path[1] = get::realPath($this->_options['test']);\n }\n\n return $path;\n }",
"function render_checkbox( $args ) {\n\t\t\t$optionValue = Link_WP_LinkID::get_option_value( $args['key'] );\n\t\t\t$checked = $optionValue === null ? '' : checked( 1, $optionValue, false );\n\n\t\t\t?>\n\t\t\t<input type=\"checkbox\" value=\"1\"\n\t\t\t name=\"<?php echo \"link_linkid_settings[\" . $args['key'] . \"]\" ?>\" <?php echo $checked ?>>\n\t\t\t<p class=\"description\"><?php echo $args[\"description\"] ?></p>\n\t\t\t<?php\n\t\t}",
"function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }",
"function validatePath($path)\n{\n $msg = \"<img src=\\\"../images/red.gif\\\" alt=\\\"\\\" title=\\\"Path is not Valid\\\"><br><font color=\\\"#ff0000\\\">Path is not Valid</font>\";\n if (is_dir($path)) {\n if (is_writable($path)) {\n $msg = \"<img src=\\\"../images/green.gif\\\" alt=\\\"\\\" title=\\\"Valid\\\">\";\n } else {\n $msg = \"<img src=\\\"../images/red.gif\\\" alt=\\\"\\\" title=\\\"Path is not Writable\\\"><br><font color=\\\"#ff0000\\\">Path is not Writable -- make sure you chmod +w this path</font>\";\n }\n }\n return $msg;\n}",
"public function validPathStrDataProvider() {}",
"function checkCMSPath() {\n global $_ARRLANG, $arrFiles;\n\n $statusMsg = \"\";\n\n if (!ini_get('safe_mode')) {\n if (!file_exists($_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].'/index.php')) {\n return str_replace(\"[PATH]\", $_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'], $_ARRLANG['TXT_PATH_DOES_NOT_EXIST']);\n } else {\n foreach (array_keys($arrFiles) as $file) {\n if (!file_exists($_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].$file)) {\n $statusMsg .= str_replace(\"[FILE]\", $_SESSION['installer']['config']['documentRoot'].$_SESSION['installer']['config']['offsetPath'].$file, $_ARRLANG['TXT_CANNOT_FIND_FIlE']);\n }\n }\n if (empty($statusMsg)) {\n return true;\n } else {\n return $statusMsg;\n }\n }\n } else {\n return true;\n }\n }",
"abstract public function checkboxOnClick();",
"protected function getParentCheckboxLabel()\n {\n return 'pintushi.config.system_configuration.use_default';\n }",
"public static function renderCheckbox();",
"function checkBoxChecked($chkName, $optional){\n\t\t$checkBoxString = '';\n\t\t$chkText = '';\n\t\t\tif ( $_GET[$chkName->value]== 'on'){\n\t\t\t\t$chkText = 'checked';\n\t\t\t}\n\t\t\t $checkBoxString = $checkBoxString . '<input ' .$chkText. ' type=\"checkbox\" id=\"' .$chkName->value. '\" name=\"' .$chkName->value. '\" class=\"' .$chkName->class. '\" ' . $optional . '>' .$chkName->label. ' ';\n\t\t\n\t\treturn $checkBoxString;\n\t}",
"function ambit_compass_validate_path($element, &$form_state) {\n\tmodule_load_include('inc', 'ambit', 'ambit.compass');\n $errors = ambit_compass_check_path($element['#value']);\n if ($errors) {\n form_set_error('compass][ambit_compass_path', implode('<br />', $errors));\n }\n}",
"function display_file_checkbox($id, $part)\r\n{\r\n\tif (isset($_GET['selectall']))\r\n\t{\r\n\t\t$checked='checked';\r\n\t}\r\n\t$return_value='<input type=\"checkbox\" name=\"'.$part.'_'.$id.'\" value=\"'.$id.'\" '.$checked.' />';\r\n\treturn $return_value;\r\n}",
"public function currentPathIsValidPrintVariantPath() {\r\n $path = \\Drupal::request()->getRequestUri();\r\n $path_data = explode('/', $path);\r\n\r\n if (!isset($path_data[1]) || $path_data[1] != 'ppi') {\r\n return FALSE;\r\n }\r\n if (!isset($path_data[2])) {\r\n return FALSE;\r\n }\r\n\r\n if (!isset($path_data[3]) || $path_data[3] != 'quick_clone') {\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }",
"private function setPath($path) {\n return;\n }",
"public function hookConfigForm()\n {\n?>\n<div class=\"field\">\n <label for=\"collection_tree_alpha_order\">Order the collection tree alphabetically?</label>\n <div class=\"inputs\">\n <?php echo __v()->formCheckbox('collection_tree_alpha_order', \n null, \n array('checked' => (bool) get_option('collection_tree_alpha_order'))); ?>\n <p class=\"explanation\">This does not affect the order of the collections \n browse page.</p>\n </div>\n</div>\n<?php\n }",
"private function edit($path) {\n\t\tif($this->is_back()) {\n\t\t\t$this->unset_module_variable('edit');\n\t\t\tlocation(array());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$f = $this->init_module(Libs_QuickForm::module_name());\n\t\t\n\t\tif($path)\n\t\t\t$f->setDefaults(array('path'=>$path));\n\n\t\t$f->addElement('text', 'path', __('Menu entry path'),array('maxlength'=>255));\n\t\t$f->addRule('path',__('This field is required'),'required');\n\t\t$f->addRule('path',__('Field too long, max 255 chars'),'maxlength',255);\n\t\t$f->registerRule('check_path', 'callback', 'check_path', $this);\n\t\t$f->addRule('path',__('Specified path already exists'),'check_path');\n\t\t\n\t\t$save_b = & $f->createElement('submit', null, __('OK'));\n\t\t$back_b = & $f->createElement('button', null, __('Cancel'), $this->create_back_href());\n\t\t$f->addGroup(array($save_b,$back_b),'submit_button');\n\t\t\n\t\tif($f->validate()) {\n\t\t\t$ret = $f->exportValue('path');\n\t\t\t$data = $this->get_module_variable('data');\n\t\t\tif($path) {\n\t\t\t\tforeach($data as & $row) {\n\t\t\t\t\tif($row==$path) $row = $ret;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$data[] = $ret;\n\t\t\t}\n\t\t\t$this->set_module_variable('data',$data);\n\t\t\t$this->unset_module_variable('edit');\n\t\t\tlocation(array());\n\t\t\treturn;\n\t\t}\n\t\t$f->display();\n\t}",
"protected static function getPathThisScriptNonCli() {}",
"function setPath($path) {\n if (substr($path,-1)!=\"/\") $path.=\"/\";\n //if (!file_exists($path)) echo \"<div>Path $path not found</div>\";\n $this->mat = $path;\n return true;\n }",
"public function checkWorkspaceCurrent() {}",
"public function isSystemPath()\n {\n $parts = $this->_getPathParts();\n return (count($parts) < 3) ||\n (count($parts) == 3 && $this->containerType === FileSystem::FOLDER_TYPE_PERSONAL);\n }",
"private function check_path()\n\t{\n\t\t$ar = func_get_args();\n\t\tforeach ( $ar as $a ){\n\t\t\tif ( !is_string($a) ||\n (strpos($a,'./') !== false) ||\n (strpos($a,'/') === 0) ){\n\t\t\t\tdie(\"The path $a is not an acceptable value\");\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}",
"function drawOptionAllProject() { \r\n global $projectDate;?> \r\n <span title=\"<?php echo i18n(\"projectDate\")?>\" dojoType=\"dijit.form.CheckBox\"\r\n type=\"checkbox\" id=\"projectDate\" name=\"projectDate\" class=\"whiteCheck\"\r\n <?php if ($projectDate) {echo 'checked=\"checked\"'; } ?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('projectDate',((this.checked)?'1':'0'));\r\n var now = formatDate(new Date());\r\n if (this.checked == false) {\r\n //dojo.setAttr('startDatePlanView', 'value', date.toLocaleDateString());\r\n dijit.byId('startDatePlanView').set(\"value\",now);\r\n enableWidget(\"startDatePlanView\");\r\n enableWidget(\"endDatePlanView\");\r\n enableWidget(\"listSaveDates\");\r\n } else {\r\n dijit.byId('startDatePlanView').reset();\r\n dijit.byId('endDatePlanView').reset();\r\n dijit.byId('listSaveDates').set('checked', false);\r\n disableWidget(\"startDatePlanView\");\r\n disableWidget(\"endDatePlanView\");\r\n disableWidget(\"listSaveDates\");\r\n }\r\n refreshJsonPlanning();\r\n </script>\r\n </span>\r\n <span for=\"projectDate\"><?php echo i18n(\"projectDate\");?></span>\r\n<?php \r\n}",
"private function check_Check_Box($sorce){\r\n\r\n if (!isset($sorce['checkbox'])){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_checkbox','You must accept rules');\r\n\r\n Session::delete('w_checkbox');\r\n }\r\n\r\n #Save our choice\r\n else Session::put('w_checkbox',\"checked\");\r\n }"
] |
[
"0.5743497",
"0.53806967",
"0.5268399",
"0.52244884",
"0.52199936",
"0.5200469",
"0.5171296",
"0.5153462",
"0.5145952",
"0.50820106",
"0.5079995",
"0.50787973",
"0.5053911",
"0.5048998",
"0.5024847",
"0.49905547",
"0.49757126",
"0.4960597",
"0.4959653",
"0.49422473",
"0.4933749",
"0.49263874",
"0.4919635",
"0.49054408",
"0.48941305",
"0.4887862",
"0.48730534",
"0.48673573",
"0.4865044",
"0.48614252"
] |
0.7565079
|
0
|
================================================== CHECKBOX SHOW LEFT WORK
|
function drawOptionLeftWork() {
global $saveShowWork;?>
<table width="100%">
<tr class="checkboxLabel">
<td >
<?php echo ucfirst(i18n("labelShowLeftWork".((isNewGui()?'':'Short'))));?>
</td>
<td style="width:36px">
<div title="<?php echo i18n('showLeftWork')?>" dojoType="dijit.form.CheckBox"
type="checkbox" id="listShowLeftWork" name="listShowLeftWork" class="whiteCheck"
<?php if ($saveShowWork=='1') { echo ' checked="checked" '; }?> >
<script type="dojo/method" event="onChange" >
saveUserParameter('planningShowWork',((this.checked)?'1':'0'));
refreshJsonPlanning();
</script>
</div>
</td>
</tr>
</table>
<?php
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function checkboxes(){\n if($this->ChkReal->Checked){\n $this->avance_real = 'Si';\n }else{\n $this->avance_real = 'No';\n }\n if($this->ChkProg->Checked){\n $this->avance_prog = 'Si';\n }else{\n $this->avance_prog = 'No';\n }\n if($this->ChkComent->Checked){\n $this->comentario = 'Si';\n }else{\n $this->comentario = 'No';\n }\n if($this->ChkPermiso->Checked){\n $this->permiso = 'Si';\n }else{\n $this->permiso = 'No';\n }\n if($this->ChkTipoA->Checked){\n $this->tipo_admon = 'Si';\n }else{\n $this->tipo_admon = 'No';\n }\n }",
"protected function preDispatchChecked () {\n\t\t/** @var $this \\MvcCore\\Ext\\Forms\\Field|\\MvcCore\\Ext\\Forms\\Field\\Props\\TabIndex */\n\n\t\t// set opposite label side than default from form.\n\t\t$labelSideDefault = $this->form->GetFieldsLabelSideDefault();\n\t\t$this->labelSide = $labelSideDefault === \\MvcCore\\Ext\\Forms\\IField::LABEL_SIDE_LEFT\n\t\t\t? \\MvcCore\\Ext\\Forms\\IField::LABEL_SIDE_RIGHT\n\t\t\t: \\MvcCore\\Ext\\Forms\\IField::LABEL_SIDE_LEFT;;\n\n\t\t// never set up render mode no label for checkbox:\n\t\t$formDefaultFieldRenderMode = $this->form->GetFieldsRenderModeDefault();\n\t\tif ($formDefaultFieldRenderMode === \\MvcCore\\Ext\\IForm::FIELD_RENDER_MODE_LABEL_AROUND) {\n\t\t\t$this->renderMode = \\MvcCore\\Ext\\IForm::FIELD_RENDER_MODE_LABEL_AROUND;\n\t\t} else if ($this->renderMode !== \\MvcCore\\Ext\\IForm::FIELD_RENDER_MODE_LABEL_AROUND) {\n\t\t\t$this->renderMode = \\MvcCore\\Ext\\IForm::FIELD_RENDER_MODE_NORMAL;\n\t\t}\n\t}",
"function idem_pop_up_inner_meta_box_cb( $post )\n{ \n $checked = ($post->ID == getDefault() ) ? \"checked\" : \"\";\n $check = \"<label>Par default</label><input type='checkbox' \" . $checked . \" name='idem_pop_up_default' value='1' >\";\n echo $check;\n}",
"function ndf_reset_button_show_callback($args) {\n\t$ndf_reset_button_show = get_option( 'ndf_reset_button_show', 1 );\n\n\t$html = '<input type=\"checkbox\" id=\"ndf_reset_button_show\" name=\"ndf_reset_button_show\" value=\"1\" ' . checked( 1, $ndf_reset_button_show, false ) . '/>'; \n\techo $html;\n}",
"function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }",
"function wpvideocoach_show_dashboard_slider() {\r\n\tglobal $wpvideocoach_dashboard_slider;\r\n\tif($wpvideocoach_dashboard_slider == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}",
"function pt_checkbox_pause_render()\n\t\t{ \n\t\t\t$options = get_option( 'pt_settings' );\n\t\t\t?>\n\t\t\t<input type='checkbox' name='pt_settings[pt_checkbox_field_pause]' value=\"1\" <?php checked( @$options['pt_checkbox_field_pause'], 1 ); ?>>\n\t\t\t<?php\n\t\t}",
"function checkbox($args) {\r\n\t\t$args = $this->apply_default_args($args) ;\r\n\t\techo \"<input name='$this->options_name[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $this->options[$args['id']]); \r\n\t\techo \" /> <span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t\t\r\n\t}",
"abstract public function checkboxOnClick();",
"function wiki_shown_hidden($post){\n\t\t\n\t\t$status = get_post_meta($post->ID,'wiki-contributons-status',true);\n\t\t\n\t?>\t\n\t\tTo hide the table check the box \n\t\t\n\t\t<input type=\"checkbox\" value=\"hide\" name=\"wiki-tabel-shownorhide\" <?php checked('hide',$status); ?> /> \n\t\n\t<?php\t\n\t}",
"function pm_toggle_walled_garden_callback($args) {\n $options = get_option('pm_display_options'); \n \n // Next, we update the name attribute to access this element's ID in the context of the display options array \n // We also access the show_header element of the options collection in the call to the checked() helper function \n $html = '<input type=\"checkbox\" id=\"walled_garden\" name=\"pm_display_options[walled_garden]\" value=\"1\" ' . checked(1, $options['walled_garden'], false) . '/>'; \n\n // Here, we'll take the first argument of the array and add it to a label next to the checkbox \n $html .= '<label for=\"walled_garden\"> ' . $args[0] . '</label>'; \n \n echo $html; \n \n}",
"function ShowInCheckBox( $Table, $name_fld, $cols, $val, $position = \"left\", $disabled = NULL, $sort_name = 'move', $asc_desc = 'asc', $show_sublevels=0, $level=NULL,$alternativeFieldLevel = '' )\n {\n //$Tbl = new html_table(1);\n\n $row1 = NULL;\n if (empty($name_fld)) $name_fld=$Table;\n\n $tmp_db = DBs::getInstance();\n $q = \"SELECT * FROM `\".$Table.\"` WHERE 1 LIMIT 1\";\n $res = $tmp_db->db_Query($q);\n// echo '<br>q='.$q.' res='.$res.' $tmp_db->result='.$tmp_db->result;\n if ( !$res ) return false;\n if ( !$tmp_db->result ) return false;\n $fields_col = mysql_num_fields($tmp_db->result);\n\n $q = \"SELECT * FROM `\".$Table.\"` WHERE `lang_id`='\"._LANG_ID.\"'\";\n //echo '<br>$level='.$level;\n if(empty($alternativeFieldLevel)){\n if( $tmp_db->IsFieldExist($Table, 'level') ) $q = $q.\" AND `level`='\".$level.\"'\";\n }else{ $q .= \" AND `\".$alternativeFieldLevel.\"`='\".$level.\"' \";}\n if ($fields_col>4) $q = $q.\" ORDER BY `$sort_name` $asc_desc\";\n// echo '<br>$q='.$q;\n\n $res = $tmp_db->db_Query($q);\n if (!$res) return false;\n $rows = $tmp_db->db_GetNumRows();\n $arr_data = array();\n for( $i = 0; $i < $rows; $i++ )\n {\n $row000 = $tmp_db->db_FetchAssoc();\n $arr_data[$i] = $row000;\n }\n\n $col_check=1;\n ?>\n <table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" align=\"left\" class=\"checkbox_tbl\">\n <tr>\n <?\n for( $i = 0; $i < $rows; $i++ )\n {\n $row1 = $arr_data[$i];\n if ($col_check > $cols) {\n ?></tr><tr><?\n $col_check=1;\n }\n\n $checked ='>';\n if (is_array($val)) {\n if (isset($val))\n foreach($val as $k=>$v)\n {\n if (isset($k) and ($v==$row1['cod'])) $checked = \" checked\".$checked;\n //echo '<br>$k='.$k.' $v='.$v.' $row1[cod]='.$row1['cod'];\n }\n }\n if ( $position == \"left\" ) $align= 'left';\n else $align= 'right';\n ?><td align=\"<?=$align?>\" valign=\"top\" class=\"checkbox\"><?\n\n if ( $position == \"left\" ) {\n //echo \"<table border='0' cellpadding='1' cellspacing='0'><tr><td><input class='checkbox' type='checkbox' name='\".$name_fld.\"[]' value='\".$row1['cod'].\"' \".$disabled.\" \".$checked.'</td><td>'.stripslashes($row1['name']).'</td></tr></table>';\n ?>\n <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n <tr>\n <td valign=\"top\"><input class=\"checkbox\" type=\"checkbox\" name=\"<?=$name_fld;?>[]\" value=\"<?=$row1['cod'];?>\" <?=$disabled;?> <?=$checked;?> </td>\n <td class=\"checkbox_td\"><?=stripslashes($row1['name']);?></td>\n </tr>\n </table>\n <?\n }\n else {\n //echo stripslashes($row1['name']).\"<input class='checkbox' type='checkbox' name='\".$name_fld.\"[]' value='\".$row1['cod'].\"' \".$disabled.\" \".$checked;\n ?>\n <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n <tr>\n <td valign=\"top\">\n <td class=\"checkbox_td\"><?=stripslashes($row1['name']);?></td>\n <td><input class=\"checkbox\" type=\"checkbox\" name=\"<?=$name_fld;?>[]\" value=\"<?=$row1['cod'];?>\" <?=$disabled;?> <?=$checked;?> </td>\n </tr>\n </table>\n <?\n }\n\n\n //======= show sublevels START ===========\n if( $show_sublevels==1){\n ?>\n <table border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n <tr>\n <td style=\"padding:0px 0px 0px 20px;\"><?\n $this->ShowInCheckBox( $Table, $name_fld, 1, $val, $position, $disabled, $sort_name, $asc_desc, $show_sublevels, $row1['cod']);\n ?>\n </td>\n </tr>\n </table>\n <?\n }\n //======= show sublevels END ===========\n ?></td><?\n $col_check++;\n }\n ?>\n </tr>\n </table>\n <?\n }",
"function ndf_category_5_filter_show_callback($args) {\n\t$ndf_category_5_filter_show = get_option( 'ndf_category_5_filter_show', 1 );\n\n\t$html = '<input type=\"checkbox\" id=\"ndf_category_5_filter_show\" name=\"ndf_category_5_filter_show\" value=\"1\" ' . checked( 1, $ndf_category_5_filter_show, false ) . '/>'; \n\techo $html;\n}",
"function ed_setting_show_editor_callback(){\n\techo '<input\n\tname=\"ed_setting_show_editor\"\n\tid=\"ed_setting_show_editor\"\n\ttype=\"checkbox\"\n\tvalue=\"1\"\n\tclass=\"code\"\n\n\t' . checked(1, get_option('ed_setting_show_editor'), false).' />\n\tChoose if details should be in editor';\n}",
"function wpvideocoach_hide_dashboard_slider() {\r\n\tglobal $wpvideocoach_dashboard_slider;\r\n\tif($wpvideocoach_dashboard_slider == 1){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}",
"function snoc_marquee_meta_box_option() {\r\n global $post;\r\n wp_nonce_field( basename( __FILE__ ), 'wpse_our_nonce' );\r\n $checkbox_value = get_post_meta($post->ID, '_marquee_latest_news', true);\r\n ?>\r\n <p>Please select option for text rotation on black bar.</p>\r\n <label><input name=\"marquee_news_check\" type=\"radio\" value=\"Yes\" <?php if($checkbox_value == \"Yes\"){ echo 'checked'; }?>>Yes </label>\r\n <label><input name=\"marquee_news_check\" type=\"radio\" value=\"No\" <?php if($checkbox_value != \"Yes\"){ echo 'checked'; }?>>No</label>\r\n <?php \r\n}",
"public static function renderCheckbox();",
"function wa_wcc_hide_if_empty(){\n\t\techo '\n\t\t<div id=\"wa_wcc_hide_if_empty\" class=\"wplikebtns\">';\n\n\t\tforeach($this->choices as $val => $trans)\n\t\t{\n\t\t\techo '\n\t\t\t<input id=\"rll-galleries-'.$val.'\" type=\"radio\" name=\"wa_wcc_settings[hide_if_empty]\" value=\"'.esc_attr($val).'\" '.checked(($val === 'yes' ? TRUE : FALSE), $this->options['settings']['hide_if_empty'], FALSE).' />\n\t\t\t<label for=\"rll-galleries-'.$val.'\">'.$trans.'</label>';\n\t\t}\n\n\t\techo '</div>';\n\t}",
"function checkbox_init(){\n add_meta_box(\"closing\", \"Closed ?\", \"closing\", \"closings\", \"normal\", \"high\");\n add_meta_box(\"delayed\", \"Delayed / Message ?\", \"delayed\", \"closings\", \"normal\", \"high\");\n add_meta_box(\"message_delayed\", \"Message:\", \"message_delayed\", \"closings\", \"normal\", \"high\");\n}",
"function wpvideocoach_show_toolbar_link()\r\n{\r\n\tglobal $wpvideocoach_toolbar_link;\r\n\tif( $wpvideocoach_toolbar_link == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}",
"public function viewLeftMenu()\n\t{\n\t\t$viewLevelResult\t= $this->manageLeftMenu('V', '0', '', '', '0', '0');\n\t\treturn $viewLevelResult;\n\t}",
"function ShowInRadioBox( $Table, $name_fld, $cols, $val, $position = \"left\", $disabled = NULL, $sort_name = 'move', $asc_desc = 'asc' )\n {\n //$Tbl = new html_table(1);\n\n $row1 = NULL;\n if (empty($name_fld)) $name_fld=$Table;\n\n $tmp_db = DBs::getInstance();\n $q = \"SELECT * FROM `\".$Table.\"` WHERE 1 LIMIT 1\";\n $res = $tmp_db->db_Query($q);\n //echo '<br>q='.$q.' res='.$res.' $tmp_db->result='.$tmp_db->result;\n if ( !$res ) return false;\n if ( !$tmp_db->result ) return false;\n $fields_col = mysql_num_fields($tmp_db->result);\n\n if ($fields_col>4) $q = \"select * from `\".$Table.\"` where lang_id='\"._LANG_ID.\"' order by `$sort_name` $asc_desc\";\n else $q = \"select * from `\".$Table.\"` where lang_id='\"._LANG_ID.\"'\";\n\n $res = $tmp_db->db_Query($q);\n if (!$res) return false;\n $rows = $tmp_db->db_GetNumRows();\n\n $col_check=1;\n //$Tbl->table_header();\n //$Tbl->tr();\n echo '<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" align=\"left\" ><tr>';\n for( $i = 0; $i < $rows; $i++ )\n {\n $row1 = $tmp_db->db_FetchAssoc();\n if ($col_check > $cols) {\n //$Tbl->tr();\n echo '</tr><tr>';\n $col_check=1;\n }\n\n $checked ='>';\n if ($val==$row1['cod']) $checked = \" checked\".$checked;\n\n if ( $position == \"left\" ) $align= 'left';\n else $align= 'right';\n echo \"\\n<td align=\".$align.\" valign='middle' class='checkbox'>\";\n\n if ( $position == \"left\" ) echo \"<input class='checkbox' type='radio' name='\".$name_fld.\"' value='\".$row1['cod'].\"' \".$disabled.\" \".$checked.' '.stripslashes($row1['name']);\n else echo stripslashes($row1['name']).\"<input class='checkbox' type='checkbox' name=\".$name_fld.\" value='\".$row1['cod'].\"' \".$disabled.\" \".$checked;\n echo \"</td>\";\n $col_check++;\n }\n echo '</tr></table>';\n //$Tbl->table_footer();\n }",
"function user_login_edit()\n{\n\t$Feul = new Feul;\n\t$member_checkbox = '';\n\tif($Feul->showMembersPermBox() == true)\n\t{\n\t\t$member_checkbox = \"checked\";\t\n\t}\n\t?>\n\t\t<div style=\"margin-top:20px;\">\n\t\t\t<p>\n\t\t\t\t<label style=\"display:inline!important; margin-right:10px;\" for=\"member-only\">Только для зарегистрированных:</label>\n\t\t\t\t<input style=\"width:auto;\" type=\"checkbox\" value=\"yes\" name=\"member-only\" <?php echo $member_checkbox; ?> />\n\t\t\t</p>\n\t\t</div> \n\t<?php\n}",
"private function check_Check_Box($sorce){\r\n\r\n if (!isset($sorce['checkbox'])){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_checkbox','You must accept rules');\r\n\r\n Session::delete('w_checkbox');\r\n }\r\n\r\n #Save our choice\r\n else Session::put('w_checkbox',\"checked\");\r\n }",
"function question_category_form_checkbox($name, $checked) {\n echo '<div><input type=\"hidden\" id=\"' . $name . '_off\" name=\"' . $name . '\" value=\"0\" />';\n echo '<input type=\"checkbox\" id=\"' . $name . '_on\" name=\"' . $name . '\" value=\"1\"';\n if ($checked) {\n echo ' checked=\"checked\"';\n }\n echo ' onchange=\"getElementById(\\'displayoptions\\').submit(); return true;\" />';\n echo '<label for=\"' . $name . '_on\">';\n print_string($name, 'quiz');\n echo \"</label></div>\\n\";\n}",
"function open_none($value){\n\n\t\tforeach ($this->values as $key => $val){\n\t\t\tif ($key!=$value) $sbianca.=\"\\n document.forms[0].{$key}.checked=false;\";\n\t\t}\n\t\t$this->check_js.=\"\n\t\t\t\tif (document.forms[0].{$value}.checked) {\n\t\t\t\t\t$sbianca\n\t\t\t\t}\n\t\t\t\";\n\t}",
"function rs_focus($post)\n{\n wp_nonce_field('rs_meta_box', 'rs_meta_box_nonce');\n $value = get_post_meta($post->ID, '_focus', true);\n echo '<label for=\"rs_focus\"><input type=\"checkbox\" name=\"rs_focus\" id=\"rs_focus\" value=\"1\" ' . (!empty($value) ? 'checked' : '') . '> Post destacado</label>';\n}",
"function checked($checked, $current = \\true, $display = \\true)\n {\n }",
"function wpvideocoach_show_introduction()\r\n{\r\n\tglobal $wpvideocoach_introduction;\r\n\tif($wpvideocoach_introduction == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}",
"public function show_in_panel() {\n\t\treturn false;\n\t}"
] |
[
"0.60780036",
"0.60588133",
"0.5923007",
"0.5899996",
"0.58007455",
"0.5728363",
"0.57097316",
"0.5694922",
"0.56814504",
"0.56776834",
"0.56487805",
"0.5632516",
"0.5625049",
"0.5605939",
"0.5568388",
"0.5546875",
"0.5533344",
"0.5527992",
"0.54983914",
"0.5489566",
"0.546971",
"0.5464659",
"0.5419245",
"0.5414922",
"0.5414374",
"0.54131746",
"0.54029477",
"0.5387434",
"0.53861856",
"0.5364891"
] |
0.6477185
|
0
|
================================================== CHECKBOX FOR RESOURCE
|
function drawOptionResource() {
global $saveShowNullAssignment, $saveShowProject;?>
<table width="100%">
<tr class="checkboxLabel">
<td style="min-width:80px;<?php if (!isNewGui()) echo 'text-align:right;padding-right:10px;';?>"><?php echo ucfirst(i18n("labelShowAssignmentWithoutWork".((isNewGui())?'':'Short')));?></td>
<td style="width:36px">
<div title="<?php echo i18n('titleShowAssignmentWithoutWork')?>" dojoType="dijit.form.CheckBox"
type="checkbox" id="listShowNullAssignment" name="listShowNullAssignment" class="whiteCheck"
<?php if ($saveShowNullAssignment=='1') { echo ' checked="checked" '; }?> >
<script type="dojo/method" event="onChange" >
saveUserParameter('listShowNullAssignment',((this.checked)?'1':'0'));
refreshJsonPlanning();
</script>
</div>
</td>
</tr>
<tr class="checkboxLabel">
<td style="min-width:80px;<?php if (!isNewGui()) echo 'text-align:right;padding-right:10px;';?>"><?php echo ucfirst(i18n("labelShowProjectLevel".((isNewGui())?'':'Short')));?></td>
<td tyle="width:36px">
<div title="<?php echo i18n('showProjectLevel')?>" dojoType="dijit.form.CheckBox"
type="checkbox" id="listShowProject" name="listShowProject" class="whiteCheck"
<?php if ($saveShowProject=='1') { echo ' checked="checked" '; }?> >
<script type="dojo/method" event="onChange" >
saveUserParameter('planningShowProject',((this.checked)?'1':'0'));
refreshJsonPlanning();
</script>
</div>
</td>
</table>
<?php
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function checkbox($args) {\r\n\t\t$args = $this->apply_default_args($args) ;\r\n\t\techo \"<input name='$this->options_name[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $this->options[$args['id']]); \r\n\t\techo \" /> <span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t\t\r\n\t}",
"function render_checkbox( $args ) {\n\t\t\t$optionValue = Link_WP_LinkID::get_option_value( $args['key'] );\n\t\t\t$checked = $optionValue === null ? '' : checked( 1, $optionValue, false );\n\n\t\t\t?>\n\t\t\t<input type=\"checkbox\" value=\"1\"\n\t\t\t name=\"<?php echo \"link_linkid_settings[\" . $args['key'] . \"]\" ?>\" <?php echo $checked ?>>\n\t\t\t<p class=\"description\"><?php echo $args[\"description\"] ?></p>\n\t\t\t<?php\n\t\t}",
"public static function cris_check_callback($args) {\n $options = self::get_options();\n if (array_key_exists('name', $args))\n $name = esc_attr($args['name']);\n if (array_key_exists('description', $args))\n $description = esc_attr($args['description']);\n if ($name == 'cris_sync_check') {\n print \"<p>\";\n printf(__('%1s Wichtig! %2s Lesen Sie vor der Aktivierung unbedingt die Hinweise in unserem %3s Benutzerhandbuch! %3s', 'fau-cris'), '<strong>', '</strong>', '<a href=\"https://www.wordpress.rrze.fau.de/plugins/fau-cris/erweiterte-optionen/\">', '</a>');\n print \"<p>\";\n }\n if (array_key_exists('options', $args)) {\n $checks = $args['options'];\n foreach ($checks as $_k => $_v) { ?>\n <label>\n <input name=\"<?php printf('%s[' . $name . '][' . $_k . ']', self::option_name); ?>\"\n type='checkbox'\n value='1'\n <?php\n if (array_key_exists($name, $options) && array_key_exists($_k, $options[$name])) {\n print checked($options[$name][ $_k], 1, false);\n }\n ?>\n >\n <?php print $_v; ?>\n </label><br />\n <?php }\n } else { ?>\n <label><input name=\"<?php printf('%s[' . $name . ']', self::option_name); ?>\" type='checkbox' value='1' <?php\n if (array_key_exists($name, $options)) {\n print checked($options[$name], 1, false);\n }\n ?> >\n <?php if (isset($description)) { ?>\n <span class=\"description\"><?php echo $description; ?></span></label>\n <?php }\n }\n }",
"function drawOptionLeftWork() {\r\n global $saveShowWork;?>\r\n <table width=\"100%\">\r\n <tr class=\"checkboxLabel\">\r\n <td >\r\n <?php echo ucfirst(i18n(\"labelShowLeftWork\".((isNewGui()?'':'Short'))));?>\r\n </td>\r\n <td style=\"width:36px\">\r\n <div title=\"<?php echo i18n('showLeftWork')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowLeftWork\" name=\"listShowLeftWork\" class=\"whiteCheck\"\r\n <?php if ($saveShowWork=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowWork',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div> \r\n </td>\r\n </tr>\r\n </table>\r\n<?php \r\n}",
"private function check_Check_Box($sorce){\r\n\r\n if (!isset($sorce['checkbox'])){\r\n\r\n $this->_flag = false;\r\n\r\n Session::put('e_checkbox','You must accept rules');\r\n\r\n Session::delete('w_checkbox');\r\n }\r\n\r\n #Save our choice\r\n else Session::put('w_checkbox',\"checked\");\r\n }",
"function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }",
"public static function renderCheckbox();",
"public function check(Resource $resource);",
"public function isItemChecked($name);",
"function checkbox($args = '', $checked = false) {\r\n $defaults = array('name' => '', 'id' => false, 'class' => false, 'group' => '', 'special' => '', 'value' => '', 'label' => false, 'maxlength' => false);\r\n extract(wp_parse_args($args, $defaults), EXTR_SKIP);\r\n\r\n $return = '';\r\n // Get rid of all brackets\r\n if (strpos(\"$name\", '[') || strpos(\"$name\", ']')) {\r\n $replace_variables = array('][', ']', '[');\r\n $class_from_name = $name;\r\n $class_from_name = \"wpi_\" . str_replace($replace_variables, '_', $class_from_name);\r\n } else {\r\n $class_from_name = \"wpi_\" . $name;\r\n }\r\n // Setup Group\r\n $group_string = '';\r\n if ($group) {\r\n if (strpos($group, '|')) {\r\n $group_array = explode(\"|\", $group);\r\n $count = 0;\r\n foreach ($group_array as $group_member) {\r\n $count++;\r\n if ($count == 1) {\r\n $group_string .= \"$group_member\";\r\n } else {\r\n $group_string .= \"[$group_member]\";\r\n }\r\n }\r\n } else {\r\n $group_string = \"$group\";\r\n }\r\n }\r\n // Use $checked to determine if we should check the box\r\n $checked = strtolower($checked);\r\n if ($checked == 'yes' ||\r\n $checked == 'on' ||\r\n $checked == 'true' ||\r\n ($checked == true && $checked != 'false' && $checked != '0')) {\r\n $checked = true;\r\n } else {\r\n $checked = false;\r\n }\r\n $id = ($id ? $id : $class_from_name);\r\n $insert_id = ($id ? \" id='$id' \" : \" id='$class_from_name' \");\r\n $insert_name = ($group_string ? \" name='\" . $group_string . \"[$name]' \" : \" name='$name' \");\r\n $insert_checked = ($checked ? \" checked='checked' \" : \" \");\r\n $insert_value = \" value=\\\"$value\\\" \";\r\n $insert_class = \" class='$class_from_name $class wpi_checkbox' \";\r\n $insert_maxlength = ($maxlength ? \" maxlength='$maxlength' \" : \" \");\r\n // Determine oppositve value\r\n switch ($value) {\r\n case 'yes':\r\n $opposite_value = 'no';\r\n break;\r\n case 'true':\r\n $opposite_value = 'false';\r\n break;\r\n }\r\n // Print label if one is set\r\n if ($label)\r\n $return .= \"<label for='$id'>\";\r\n // Print hidden checkbox\r\n $return .= \"<input type='hidden' value='$opposite_value' $insert_name />\";\r\n // Print checkbox\r\n $return .= \"<input type='checkbox' $insert_name $insert_id $insert_class $insert_checked $insert_maxlength $insert_value $special />\";\r\n if ($label)\r\n $return .= \" $label</label>\";\r\n return $return;\r\n }",
"public static function bkap_add_resource_section_callback( $product_id ) {\n \t\t\n \t?>\n \t<span class=\"bkap_type_box\" style=\"margin-left: 15%;\"> \n\n <?php foreach ( self::bkap_get_extra_options() as $key => $option ) :\n if ( metadata_exists( 'post', $product_id, '_' . $key ) ) {\n $bkap_resource_option = get_post_meta( $product_id, '_bkap_resource', true );\n\n $selected_value = '';\n if( $bkap_resource_option == \"on\" ){\n $selected_value = 'checked';\n }\n \n } else {\n $selected_value = 'yes' === ( isset( $option['default'] ) ? $option['default'] : 'no' );\n }\n \n ?>\n <label for=\"<?php echo esc_attr( $option['id'] ); ?>\" class=\"<?php echo esc_attr( $option['wrapper_class'] ); ?> tips\" data-tip=\"<?php echo esc_attr( $option['description'] ); ?>\">\n <?php echo esc_html( $option['label'] ); ?>:\n <input type=\"checkbox\" name=\"<?php echo esc_attr( $option['id'] ); ?>\" id=\"<?php echo esc_attr( $option['id'] ); ?>\" <?php echo $selected_value; ?> />\n </label>\n <?php endforeach; ?>\n </span>\n\n <?php\n }",
"abstract public function checkboxOnClick();",
"function checkboxes(){\n if($this->ChkReal->Checked){\n $this->avance_real = 'Si';\n }else{\n $this->avance_real = 'No';\n }\n if($this->ChkProg->Checked){\n $this->avance_prog = 'Si';\n }else{\n $this->avance_prog = 'No';\n }\n if($this->ChkComent->Checked){\n $this->comentario = 'Si';\n }else{\n $this->comentario = 'No';\n }\n if($this->ChkPermiso->Checked){\n $this->permiso = 'Si';\n }else{\n $this->permiso = 'No';\n }\n if($this->ChkTipoA->Checked){\n $this->tipo_admon = 'Si';\n }else{\n $this->tipo_admon = 'No';\n }\n }",
"function ffw_port_multicheck_callback( $args ) {\n global $ffw_port_settings;\n\n foreach( $args['options'] as $key => $option ):\n if( isset( $ffw_port_settings[$args['id']][$key] ) ) { $enabled = $option; } else { $enabled = NULL; }\n echo '<input name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\" type=\"checkbox\" value=\"' . $option . '\" ' . checked($option, $enabled, false) . '/> ';\n echo '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . '][' . $key . ']\">' . $option . '</label><br/>';\n endforeach;\n echo '<p class=\"description\">' . $args['desc'] . '</p>';\n}",
"function rt_button_boolean($target,$title = 'enable')\n{\n return rt_ui_button($title, $target, 'check');\n}",
"function r_userclass_check($fieldname, $curval = '', $optlist = \"\")\n{\n// echo \"Call r_userclass_check: {$curval}<br />\";\n global $e_userclass;\n if (!is_object($e_userclass)) $e_userclass = new user_class;\n $ret = $e_userclass->uc_checkboxes($fieldname,$curval,$optlist);\n if ($ret) $ret = \"<div class='check-block'>\".$ret.\"</div>\";\n return $ret;\n}",
"function output_checkbox_row( string $label, string $key, bool $checked = false ): void {\n\twp_enqueue_style( 'wpinc-meta-field' );\n\t?>\n\t<div class=\"wpinc-meta-field-single checkbox\">\n\t\t<label>\n\t\t\t<span class=\"checkbox\"><input <?php name_id( $key ); ?> type=\"checkbox\" <?php echo esc_attr( $checked ? 'checked' : '' ); ?>></span>\n\t\t\t<span><?php echo esc_html( $label ); ?></span>\n\t\t</label>\n\t</div>\n\t<?php\n}",
"public function isChecked() {}",
"function ffw_port_checkbox_callback( $args ) {\n global $ffw_port_settings;\n\n $checked = isset($ffw_port_settings[$args['id']]) ? checked(1, $ffw_port_settings[$args['id']], false) : '';\n $html = '<input type=\"checkbox\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" value=\"1\" ' . $checked . '/>';\n $html .= '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}",
"function callback_checkbox(array $args)\n {\n }",
"function wpvideocoach_show_toolbar_link()\r\n{\r\n\tglobal $wpvideocoach_toolbar_link;\r\n\tif( $wpvideocoach_toolbar_link == 0){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}",
"public function manageroleandresourceAction()\n {\n if ($this->_request->isPost()) {\n $rid = (int)$this->_request->getPost('rid');\n $aryChecked = $this->_request->getPost('chkRes');\n\n require_once 'Admin/Bll/Role.php';\n $bllRole = Admin_Bll_Role::getDefaultInstance();\n $result = $bllRole->updateRoleOfResource($rid, $aryChecked);\n\n echo $result ? 'true' : 'false';\n }\n }",
"function adleex_resource_add_boxes() {\n\n //add supported meta_box\n\n\n}",
"function snoc_marquee_meta_box_option() {\r\n global $post;\r\n wp_nonce_field( basename( __FILE__ ), 'wpse_our_nonce' );\r\n $checkbox_value = get_post_meta($post->ID, '_marquee_latest_news', true);\r\n ?>\r\n <p>Please select option for text rotation on black bar.</p>\r\n <label><input name=\"marquee_news_check\" type=\"radio\" value=\"Yes\" <?php if($checkbox_value == \"Yes\"){ echo 'checked'; }?>>Yes </label>\r\n <label><input name=\"marquee_news_check\" type=\"radio\" value=\"No\" <?php if($checkbox_value != \"Yes\"){ echo 'checked'; }?>>No</label>\r\n <?php \r\n}",
"function checkbox( \n\t $name, $title, $value = null, \n\t $required = false, \n\t $attributes = null,\n\t $options = array(),\n\t $datatype = Form::DATA_STRING\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_CHECKBOX,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t $options,\n\t $datatype\n );\n\t}",
"abstract protected function check_resources(Modulistica_resources $resources);",
"function drawOptionSaveDates() {\r\n global $projectDate, $saveDates; ?>\r\n <span title=\"<?php echo i18n('saveDates')?>\" dojoType=\"dijit.form.CheckBox\"\r\n type=\"checkbox\" id=\"listSaveDates\" name=\"listSaveDates\" class=\"whiteCheck\"\r\n <?php if ($projectDate) {echo 'disabled'; } ?> \r\n <?php if ( $saveDates) {echo 'checked=\"checked\"'; } ?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n refreshJsonPlanning();\r\n </script>\r\n </span>\r\n <span for=\"listSaveDates\"><?php echo i18n(\"saveDates\");?></span>\r\n<?php \r\n}",
"function render_field_checkbox($field)\n {\n }",
"public function callback_multicheck( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $html = '<fieldset>';\n\n foreach ( $args['options'] as $key => $label ) {\n $checked = isset( $value[$key] ) ? $value[$key] : '0';\n $html .= sprintf( '<label for=\"wpuf-%1$s[%2$s]\">', $name_id, $key );\n $html .= sprintf( '<input type=\"checkbox\" class=\"checkbox\" id=\"wpuf-%1$s[%2$s]\" name=\"%1$s[%2$s]\" value=\"%2$s\" %3$s %4$s/>', $name_id, $key, checked( $checked, $key, false ), $disable );\n $html .= sprintf( '%1$s</label><br>', $label );\n }\n\n $html .= $this->get_field_description( $args );\n $html .= '</fieldset>';\n\n echo $html;\n }",
"function zen_draw_checkbox_field($name, $value = '', $checked = false, $parameters = '') {\n return zen_draw_selection_field($name, 'checkbox', $value, $checked, $parameters);\n }"
] |
[
"0.5818097",
"0.56413907",
"0.5613685",
"0.55978835",
"0.5589455",
"0.5584539",
"0.5558722",
"0.54701906",
"0.5408777",
"0.53962284",
"0.5384876",
"0.53800905",
"0.5365522",
"0.53610593",
"0.53264445",
"0.5311213",
"0.5301871",
"0.5260353",
"0.5251036",
"0.5240194",
"0.52328986",
"0.5226671",
"0.5187923",
"0.51768094",
"0.51630855",
"0.51587856",
"0.51541257",
"0.51501197",
"0.5146523",
"0.5145225"
] |
0.5948904
|
0
|
Return int value for param from .env
|
public static function getInt($param)
{
$value = filter_var(self::get($param), FILTER_VALIDATE_INT);
return $value;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function int_val(string $key, int $default = null): ?int\n{\n $val = env($key, $default);\n\n if (is_numeric($val)) {\n return intval($val);\n }\n\n return $default;\n}",
"public static function getParameterKeySinceId()\n {\n return config('consts.ParameterSinceId');\n }",
"public function id(): ?int\n {\n // Get the value from the variable\n $resourceId = request()->route(\n // Set the variable\n $this->resourceVariable()\n );\n\n return is_numeric($resourceId)\n ? (int) $resourceId\n : null;\n }",
"public function get_sendgrid_api_key() {\n\t\t$query = $this->db\n\t\t\t->select(\"variable, value\")\n\t\t\t->where('variable', 'sendgrid_api_key')\n\t\t\t->get('settings');\n\t\tif ($query->num_rows() === 1) {\n\t\t\t$res = $query->row();\n\t\t\treturn $res->value ? $res->value : $res->default_value;\n\t\t}\n\t\treturn NULL;\n\t}",
"public static function GetInt($param, $default = 0, $source = null) {\r\n $source = $source ?: $_GET;\r\n return isset($source[$param]) && is_numeric($source[$param]) ? intVal($source[$param]) : $default;\r\n }",
"private function fetchSeed(): int\n {\n $seed = \\getenv('PHPUNIT_SEED');\n\n if (!$seed) {\n try {\n $seed = \\random_int(1, 9999);\n } catch (\\Exception $e) {\n $seed = 1;\n }\n }\n\n return (int)$seed;\n }",
"function envvalue($name, $default)\n{\n $value = getenv($name);\n return $value == false ? $default : $value;\n}",
"function getEnvValue($name)\n{\n return $_ENV[$name] ?? getenv($name);\n}",
"function actual($tipo_elemento){\n\treturn isset($_GET[\"$tipo_elemento\"]) ? (int)$_GET[\"$tipo_elemento\"]:1;\n}",
"function env_get( $variable ){\n\t\t// not this function!\n\t\t$data = file_get_contents( 'env/env.json' );\n\t\t$json = json_decode( $data, true );\n\t\treturn $json[ $variable ];\n\t}",
"function get_param_integer($name, $default = false, $not_string_ok = false)\n{\n $m_default = ($default === false) ? false : (isset($default) ? (($default === 0) ? '0' : strval($default)) : '');\n $ret = __param($_GET, $name, $m_default, true); // do not set $ret to mixed(), breaks bootstrapping\n if ((!isset($default)) && ($ret === '')) {\n return null;\n }\n if (!is_numeric($ret)) {\n if (substr($ret, -1) === '/') {\n $ret = substr($ret, 0, strlen($ret) - 1);\n }\n if (!is_numeric($ret)) { // Bizarre situation (bug in IIS?)\n $matches = array();\n if (preg_match('#^(\\d+)\\#[\\w]*$#', $ret, $matches) !== 0) {\n $ret = $matches[1];\n } else {\n if ($not_string_ok) {\n return $default;\n }\n require_code('failure');\n $ret = _param_invalid($name, $ret, false);\n }\n }\n }\n if ($ret === '0') {\n return 0;\n }\n if ($ret === '1') {\n return 1;\n }\n $reti = intval($ret);\n $retf = floatval($reti);\n if (($retf > 2147483647.0) || ($retf < -2147483648.0)) { // TODO: #3046 in tracker\n require_code('failure');\n _param_invalid($name, null, false);\n }\n return $reti;\n}",
"public function getApiSiteParameter();",
"public function getInt($name);",
"function api_key() {\n\tif(check_value(chevereto_config('api_key'))) return chevereto_config('api_key');\n}",
"private static function getEnvKey($string)\n {\n preg_match('~%env\\((.*?)\\)%~', $string, $matches);\n\n return (count($matches) > 0) ? $matches[1] : null;\n }",
"public static function getParameterKeyMaxId()\n {\n return config('consts.ParameterMaxId');\n }",
"public function get(string $key) : int;",
"public function getAppId(): int;",
"protected function getInt($clave) {\n if(isset($_REQUEST[$clave]) && !empty($_REQUEST[$clave])){\n $_REQUEST[$clave] = filter_input($_REQUEST[$clave], $clave, FILTER_VALIDATE_INT);\n return $_REQUEST[$clave];\n }\n \n return 0;\n }",
"public static function getParameterKeyAccountId()\n {\n return config('consts.ParameterAccountId');\n }",
"protected function get_param($param) {\n if ($this->params !== null && isset($this->params[$param])) {\n return $this->params[$param];\n } else {\n $staticname = \"default$param\";\n assert(isset(static::$$staticname));\n return static::$$staticname;\n }\n }",
"function pagina_actual() {\n return isset($_GET['p']) ? (int)$_GET['p'] : 1;\n}",
"public static function getParameterKeyPage()\n {\n return config('consts.ParameterPage');\n }",
"public function get_api_key(){\n\t\t$apikey = array_key_exists( 'apikey', $this->bvars) ? $this->bvars['apikey'] : false;\n\t\tif (!$apikey) {\t\t\t\n\t\t\t$this->get_errors()->add( new \\gcalc\\error( 10100 ) );\n\t\t\treturn 'anonymous';\n\t\t}\n\t\treturn $apikey;\n\t}",
"public function value(): int;",
"function env($key) {\n\n\t\tif ($key == 'HTTPS') {\n\t\t\tif (isset($_SERVER) && !empty($_SERVER)) {\n\t\t\t\treturn (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');\n\t\t\t} else {\n\t\t\t\treturn (strpos(env('SCRIPT_URI'), 'https://') === 0);\n\t\t\t}\n\t\t}\n\n\t\tif ($key == 'SCRIPT_NAME') {\n\t\t\tif (env('CGI_MODE')) {\n\t\t\t\t$key = 'SCRIPT_URL';\n\t\t\t}\n\t\t}\n\n\t\t$val = null;\n\t\tif (isset($_SERVER[$key])) {\n\t\t\t$val = $_SERVER[$key];\n\t\t} elseif (isset($_ENV[$key])) {\n\t\t\t$val = $_ENV[$key];\n\t\t} elseif (getenv($key) !== false) {\n\t\t\t$val = getenv($key);\n\t\t}\n\n\t\tif ($key == 'REMOTE_ADDR' && $val == env('SERVER_ADDR')) {\n\t\t\t$addr = env('HTTP_PC_REMOTE_ADDR');\n\t\t\tif ($addr != null) {\n\t\t\t\t$val = $addr;\n\t\t\t}\n\t\t}\n\n\t\tif ($val !== null) {\n\t\t\treturn $val;\n\t\t}\n\n\t\tswitch ($key) {\n\t\t\tcase 'DOCUMENT_ROOT':\n\t\t\t\t$offset = 0;\n\t\t\t\tif (!strpos(env('SCRIPT_NAME'), '.php')) {\n\t\t\t\t\t$offset = 4;\n\t\t\t\t}\n\t\t\t\treturn substr(env('SCRIPT_FILENAME'), 0, strlen(env('SCRIPT_FILENAME')) - (strlen(env('SCRIPT_NAME')) + $offset));\n\t\t\tbreak;\n\t\t\tcase 'PHP_SELF':\n\t\t\t\treturn r(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME'));\n\t\t\tbreak;\n\t\t\tcase 'CGI_MODE':\n\t\t\t\treturn (substr(php_sapi_name(), 0, 3) == 'cgi');\n\t\t\tbreak;\n\t\t}\n\t\treturn null;\n\t}",
"function get_api_key()\n{\n return get_global_value('api-key');\n}",
"private function getParamCatId()\n {\n $catid = $this->getMenuParams()->get( 'catid', 0 );\n return (int)$catid;\n }",
"public\n function getConstant(\n string $constant\n ): ?int {\n return $this->getConstants()[$constant] ?? null;\n }",
"public function getIssueNumber()\n {\n return $this->getParameter('issueNumber');\n }"
] |
[
"0.6807368",
"0.548647",
"0.54851514",
"0.5480439",
"0.5469344",
"0.5342796",
"0.5314924",
"0.53064466",
"0.52946174",
"0.5292211",
"0.52719086",
"0.52539617",
"0.5223219",
"0.52221334",
"0.5208147",
"0.5193771",
"0.5186182",
"0.51838315",
"0.5182297",
"0.5169142",
"0.5132747",
"0.51291853",
"0.51284575",
"0.51202166",
"0.51109856",
"0.5105632",
"0.50969946",
"0.5096687",
"0.50682276",
"0.5048952"
] |
0.56933755
|
1
|
/ Valida que la fecha de la cita no sea menor a la actual
|
public function ValidarFecha($attribute){
$today = new DateTime();
$fecha = new DateTime($this->fecha_presupuesto);
if( ($fecha < $today) && ($fecha->format('Y-m-d') <> $today->format('Y-m-d')) ){
$this->addError($attribute,"La fecha del presupusto no puede ser menor a la fecha actual.");
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function validaNascimento($ano, $mes, $dia)\n{\n\n $dataCheck = $ano.'-'.$mes.'-'.$dia;\n if (checkdate($mes, $dia, $ano) && $dataCheck<=date('Y-m-d'))\n return true;\n else return false;\n}",
"function validar_Fecha()\n {\n $this->resource = 'Actividades';\n $fecha_menor = strtotime(\"2021-01-01 00:00:00\");\n $fecha_mayor = strtotime(\"2050-01-01 00:00:00\");\n $fecha_entrada = strtotime($this->fecha);\n\n if ($this->no_vacio($this->fecha) === false) {\n $this->code = '70027';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n } else if ($this->formato_fecha($this->fecha) === false) {\n $this->code = '70028';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n } else if ($fecha_entrada > $fecha_mayor) {\n $this->code = '70029';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n } else if ($fecha_entrada < $fecha_menor) {\n $this->code = '70030';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n }\n }",
"function fecha_valida($fecha){\n if(ereg( \"([0-9]{2})/([0-9]{2})/([0-9]{4})\",$fecha)){\n ereg( \"([0-9]{2})/([0-9]{2})/([0-9]{4})\", $fecha, $mifecha);\n $ok = checkdate($mifecha[2],$mifecha[1],$mifecha[3]);\n if($ok){\n $actual = date(\"Y-m-d\");\n $older = \"1900-01-01\";\n $dtime = strtotime(fecha_mysql($fecha));\n $dtime_ac = strtotime($actual);\n $dtime_ol = strtotime($older);\n if($dtime>$dtime_ac || $dtime<$dtime_ol){\n return false;\n }else{\n return true;\n }\n }else{\n // fecha fuera del calendario\n return false;\n } \n }else{\n // formato no valido\n return false;\n }\n}",
"public function validacion_fecha($fec){\n \n self::set_fecha($fec); // asignar la fecha\n $partes= explode(\"-\", self::get_fecha()); \n echo \"<br><br>\";\n echo \"Fecha Ingresada <br><br>\";\n print_r($partes);\n $actual = array(date(\"Y\"),date(\"m\"),date(\"d\"));\n echo \"<br><br>\";\n echo \"Fecha actual <br><br>\";\n print_r($actual);\n \n if(self::escritura_valida($partes) && self::fecha_mayor_actual($actual, $partes)) // si es valida la escritura y la fecha es mayor a la actual es correcta la fecha\n {\n return true;\n }\n else{\n return false;\n }\n }",
"function fechaInvalida($fecha){\n $valores = explode('-', $fecha);\n if(count($valores) == 3 && checkdate($valores[1], $valores[2], $valores[0])){\n return false;\n }\n return true;\n }",
"function fecha_entrega($fecha_entrega)\n\t{\n\t\t$hoy = date('Y-m-d');\n\t\t$fecha_valida = date('Y-m-d',strtotime('+3 day',strtotime($hoy)));\n\t\tif($fecha_entrega < $fecha_valida)\n\t\t{\n\t\t\t$this->CI->form_validation->set_message('fecha_entrega', \"El campo %s debe de ser por lo menos 3 días hábiles después de la fecha de la orden de compra.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"function fecha_instalacion($fecha_instalacion)\n\t{\n\t\t$hoy = date('Y-m-d');\n\t\t$fecha_valida = date('Y-m-d',strtotime('+3 day',strtotime($hoy)));\n\t\t$fecha_maxima = date('Y-m-d',strtotime('+6 month',strtotime($hoy)));\n\t\tif(($fecha_instalacion < $fecha_valida) || ($fecha_instalacion > $fecha_maxima))\n\t\t{\n\t\t\t$this->CI->form_validation->set_message('fecha_instalacion', \"El campo %s debe de ser por lo menos 3 días hábiles después de la fecha de la orden de compra y menor a 6 meses de la misma.\");\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"function __validFecha2($fecha){\n $test_arr = explode('-', $fecha);\n if (count($test_arr) == 3) {\n if (checkdate($test_arr[1], $test_arr[2], $test_arr[0])) {//YEAR / MES / DIA\n return true;\n }\n return false;\n }\n return false;\n }",
"function comprobar_FechaNacimiento()\n\t{\n\t$correcto = true; //variable booleana que comprueba si el atributo cuumple o no lo especificado\n\n\t//si los atributos estan vacios\n\tif (strlen($this->FechaNacimiento) == 0)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"FechaNacimiento\", \"codigoincidencia\" => \"00001\" ,\"mensajeerror\" => \"FechaNacimiento vacio\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\treturn $correcto;\n}",
"private function validatePassportIssuedDate() {\n $issued_date = DateTime::createFromFormat( 'd.m.Y', $this->passport_issued_date );\n\n if ( $issued_date < DateTime::createFromFormat( 'd.m.Y', '01.10.1997' ) ) {\n $this->errors[] = [ 'Паспорт должен быть выдан не позднее 1 октября 1997 года' ];\n }\n\n if ( $issued_date > new DateTime( 'tomorrow' ) ) {\n $this->errors[] = [ 'Паспорт не может быть выдан в будущем' ];\n }\n }",
"public function testValidationOk($date)\n {\n // We set the \"fake\" time with timeTravel method\n $this->timeTravel('2018-11-26 00:00:00');\n $notPastDateConstraint = new NotPastDate();\n $notPastDateValidator = $this->initValidator();\n\n $this->purchase->setDateOfVisit($date);\n $notPastDateValidator->validate($this->purchase, $notPastDateConstraint);\n }",
"public function getDATE_VALIDITE()\n {\n return $this->DATE_VALIDITE;\n }",
"public function validateDate()\n {\n if (\n ($from = $this->getAvailableFrom()) &&\n ($till = $this->getAvailableTill()) &&\n $from->InPast() &&\n $till->InFuture()\n ) {\n return true;\n }\n\n return false;\n }",
"function comprobar_fecha_inicio($fecha_entrada,$fecha_salida){\r\n // echo $fecha_salida;\r\n //echo $fecha_actual = strtotime(date(\"d-m-Y H:i:00\",time()));\r\n if( (empty($fecha_entrada))){\r\n return 'Las fechas no pueden estar vacias';\r\n }\r\n}",
"function __validFecha($fecha){\n $test_arr = explode('/', $fecha);\n if (count($test_arr) == 3) {\n if (checkdate($test_arr[1], $test_arr[0], $test_arr[2])) {//MES / DIA / YEAR\n return true;\n }\n return false;\n }\n return false;\n }",
"function _validarFecha($valor) {\n if (! ($tiempo = strtotime($valor))) return false; \n $d = date('Y-m-d H:i:s', $tiempo);\n $datetime = explode(' ', $d);\n if ('00:00:00' == $datetime[1]){\n return $datetime[0];\n } else {\n return $d;\n }\n }",
"function validar_fecha_stock($fechaStock)\n{\n //$fecha = date('d-m-Y');\n $fecha = date('d/m/Y');\n //$fecha = strftime($fecha);\n\n if ($fecha == $fechaStock) {\n return true;\n }\n\n return false;\n}",
"function validateDate($Fecha, $Formato = 'Ymd')\n{\n $d = DateTime::createFromFormat($Formato, $Fecha);\n return $d && $d->format($Formato) == $Fecha;\n}",
"function validate_date() {\n # Check the date is in ISO date format\n if (ereg('(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])', $this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error(\"Validation for date ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Blank Date\n return \"0000-00-00\";\n }\n }",
"private function checkDatesValidity(){\n\t\t$valid=true;\n\t\t$today = date(\"Y-m-d\");\n\t\tif($this->validFrom!=\"\" && $this->validFrom!=\"0000-00-00\" && $today<$this->validFrom) $valid=false;\n\t\tif($this->validUntil!=\"\" && $this->validUntil!=\"0000-00-00\" && $today>$this->validUntil) $valid=false;\n\t\treturn $valid;\n\t}",
"function fecha_no_paso($dia,$mes,$anio){\r\n$dia_hoy=date(\"d\");\r\n$mes_hoy=date(\"m\");\r\n$anio_hoy=date(\"Y\");\r\n\r\n$dif_en_meses=(($mes-$mes_hoy)+(12*($anio-$anio_hoy)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($dia<$dia_hoy)){return(0);}\r\nreturn(1);\r\n}",
"public function checkValidity()\n {\n // le pb est que la propriété publicationDate est de type dateTime or les tests initiaux\n // se basent sur un format de type date --> ce qui génère une erreur de type notice\n \n return true;\n }",
"function ValidarFechas($fechaIngreso, $fechaInicio){\n\t// $fechaInicio = formatDateSeparador(\"d/m/Y\", $fechaInicio, '-' );\t\t\n\t\n\t// date_format($fechaInicio,\"d/m/Y\");\t\n\tif( !isFechaValida($fechaIngreso) ) return 'Fecha Ingreso Invalida '.$fechaIngreso;\n\tif( !isFechaValida($fechaInicio) ) return 'Fecha Inicio Invalida '.$fechaInicio;\n\t\n\t$dias = dateDiff($fechaIngreso, $fechaInicio);\n\tif($dias < 0) return 'Fecha Inicio de la exposicion, Debe ser mayor/igual a la fecha de Ingreso a la empresa. ';\n\t\n\t$hoy = date(\"d/m/Y\");\n\t$dias = dateDiff($fechaInicio, $hoy);\n\tif($dias < 0) return 'Fecha Inicio de la exposicion, Debe ser menor/igual a la fecha actual. ';\n\t\n\treturn '';\n\t\n}",
"function fechaPrestacionXLimite($fprestacion, $fprest_limite) {\r\n $pr = ((strtotime($fprest_limite) - strtotime($fprestacion)) / 86400); //limite de la prestacion - fecha prestacion\r\n $ctrl_fechapresta['debito'] = false;\r\n if ($pr < 0) {\r\n\r\n $ctrl_fechapresta['debito'] = true;\r\n $ctrl_fechapresta['id_error'] = 71;\r\n $ctrl_fechapresta['msj_error'] = 'Fecha de Prestacion supera el limite para el periodo liquidado';\r\n }\r\n return $ctrl_fechapresta;\r\n}",
"private function validate_expire_date($value)\n \t{\n \t$current_month=date(\"m\");\n\t\t$current_year=date(\"Y\"); \n\t\t$current_date=$current_year.$current_month;\n\t\t$expire_date=$value;\n\t\t\t\n\t\tif ($expire_date >= $current_date) {\n\t\t\treturn 1; // valid expire date\n\t\t}\n\t\telse {\n\t\t\treturn 0; /* card expired */\n\t\t}\n\t\t\n \t}",
"public function verifDate($attribute) {\n $time = new \\DateTime('now', new \\DateTimeZone('America/Guayaquil'));\n $currentDate = $time->format('Y-m-d h:m:s');\n\n if ($this->$attribute <= $currentDate) {\n $this->addError($attribute, 'No puede ser menor a la fecha actual');\n }\n }",
"public function testValidationKo($date)\n {\n // We set the \"fake\" time with timeTravel method\n $this->timeTravel('2018-11-26 00:00:00');\n $notPastDateConstraint = new NotPastDate();\n $notPastDateValidator = $this->initValidator($notPastDateConstraint->message);\n\n $this->purchase->setDateOfVisit($date);\n $notPastDateValidator->validate($this->purchase, $notPastDateConstraint);\n\n }",
"public function checkVacationInput($errorId, $date, $isExpire)\n {\n //return;\n\n //$input = document . getElementById($inputId);\n //$d = $this->dateStart;\n $d = $date;\n if ($isExpire) {\n $d = $date - $this->ONE_DAY; //$d.setDate($d.getDate() - 1);\n }\n\n //$el = $errorId ? $('#' + $errorId) : null;\n if (!$d || !$this->checkVacation($d)) {\n //$(input) . removeClass('warning-field');\n //if (el) el . hide();\n return $date;\n }\n // это выходной!\n do {\n $d = $d + $this->ONE_DAY; //new Date(d . getTime() + ONE_DAY);\n } while ($this->checkVacation($d));\n //$(input) . addClass('warning-field');\n $newDate = $isExpire ? $d + $this->ONE_DAY : $d;\n return $newDate;\n /*if (el) {\n if (isExpire)\n el . html('Дата, предшествующая дню просрочки, установлена на выходной день. Согласно <a style=\"color:#990000\" target=\"_blank\" href=\"https://dogovor-urist.ru/кодексы/гк_рф_1/статья_193/\">ст. 193 ГК РФ</a> необходимо изменить дату на ближайший рабочий день.<br><a href=\"javascript:\" onclick=\"$el = document.getElementById(\\'' + inputId + '\\'); el.value=\\'' + newDate + '\\'; el.onchange()\">Изменить на ' + newDate + '</a>');\n else\n el . html('Дата установлена на выходной день. Согласно <a style=\"color:#990000\" target=\"_blank\" href=\"https://dogovor-urist.ru/кодексы/гк_рф_1/статья_193/\">ст. 193 ГК РФ</a> необходимо изменить дату на ближайший рабочий день. <a href=\"javascript:\" onclick=\"$el = document.getElementById(\\'' + inputId + '\\'); el.value=\\'' + newDate + '\\'; el.onchange()\">Изменить на ' + newDate + '</a>');\n el . show();\n }*/\n }",
"function validar_datos ($hora_inicio, $hora_fin, $fecha_inicio=null, $fecha_fin=null){\n \n if(!isset($fecha_inicio)){\n return ($hora_inicio < $hora_fin);\n }\n else{\n return (($hora_inicio < $hora_fin) && ($fecha_inicio < $fecha_fin));\n }\n }",
"private function compare_with_date()\n {\n }"
] |
[
"0.7211633",
"0.71130294",
"0.7104857",
"0.7024683",
"0.7018319",
"0.6964844",
"0.6942067",
"0.6753298",
"0.6715358",
"0.6564063",
"0.64971185",
"0.64956445",
"0.6481189",
"0.6461642",
"0.6425491",
"0.6420492",
"0.6398571",
"0.6383489",
"0.63787854",
"0.63691384",
"0.6368309",
"0.6364302",
"0.63580555",
"0.63527435",
"0.633562",
"0.63273686",
"0.63068616",
"0.6292346",
"0.6289404",
"0.6277567"
] |
0.7161741
|
1
|
Test that loading from the Web source returns a CertInfo object.
|
public function test_it_should_return_an_certificate()
{
$web = new Web('somefile');
$this->assertInstanceOf(CertInfo::class, $web->load());
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function test_it_should_return_an_invalid_certificate_on_bogus_certificate()\n {\n $web = new Web('somesource');\n $cert = $web->load();\n $this->assertInstanceOf(CertInfo::class, $cert);\n }",
"public function test_an_invalid_source_location_returns_an_invalid_certificate()\n {\n $web = new Web('somesource');\n $cert = $web->load();\n $this->assertFalse($cert->isValid());\n }",
"protected abstract function fetch_public_cert(&$request);",
"public function testDecodeCertificate()\n {\n\n $this->post('api/decodeCertificate', ['certificate' => $this->getCertificate()])\n ->seeJsonEquals(\n [\n 'common_name' => 'ssltools.sslutil.com',\n 'subject_altname' => null,\n 'organization' => 'SSL Test',\n 'organization_unit' => 'Development',\n 'country_code' => 'AU',\n 'valid_from' => 1514617406,\n 'valid_to' => 1546153406,\n 'issuer' => [\n 'C' => 'AU',\n 'CN' => 'ssltools.sslutil.com',\n 'L' => 'Sydney',\n 'O' => 'SSL Test',\n 'ST' => 'NSW',\n 'OU' => 'Development'\n ],\n 'key_size' => 2048,\n 'serial_number' => '14225341186233066637',\n 'is_expired' => false,\n 'is_has_ev' => false,\n 'is_host_match' => null\n ]\n\n );\n }",
"public function testGetCertificate()\n {\n }",
"public function testDecodeCertificateRequest()\n {\n\n $this->post('api/decodeCertificateRequest', ['certificateRequest' => $this->getCertificateRequest()])\n ->seeJsonEquals(\n [\n 'city' => 'Sydney',\n 'common_name' => 'ssltools.sslutil.com',\n 'country_code' => 'AU',\n 'email' => null,\n 'key_size' => 2048,\n 'organization' => 'SSL Test',\n 'organization_unit' => 'Development',\n 'state' => 'NSW'\n ]\n );\n }",
"protected abstract function fetch_private_cert(&$request);",
"public function testDownloadCertificateImage()\n {\n }",
"protected function fetch_public_cert(&$request) {\n // (1) do a lookup in a table of trusted certs keyed off of consumer \n // (2) fetch via http using a url provided by the requester \n // (3) some sort of specific discovery code based on request \n // \n // either way should return a string representation of the certificate \n throw Exception(\"fetch_public_cert not implemented\"); \n }",
"public function testConvertCertToPem()\n {\n $class = new \\ReflectionClass(JWKFetcher::class);\n $method = $class->getMethod('convertCertToPem');\n $method->setAccessible(true);\n\n $test_string_1 = '';\n for ($i = 1; $i <= 64; $i++) {\n $test_string_1 .= 'a';\n }\n\n $test_string_2 = '';\n for ($i = 1; $i <= 64; $i++) {\n $test_string_2 .= 'b';\n }\n\n $returned_pem = $method->invoke(new JWKFetcher(), $test_string_1.$test_string_2);\n $pem_parts = explode( PHP_EOL, $returned_pem );\n $this->assertEquals( 5, count($pem_parts) );\n $this->assertEquals( '-----BEGIN CERTIFICATE-----', $pem_parts[0] );\n $this->assertEquals( $test_string_1, $pem_parts[1] );\n $this->assertEquals( $test_string_2, $pem_parts[2] );\n $this->assertEquals( '-----END CERTIFICATE-----', $pem_parts[3] );\n }",
"public function testGetCertificateSetup()\n {\n }",
"public function testRequestCertificateSetup()\n {\n }",
"public function testGetterMethod()\n {\n $publickey = '-----BEGIN CERTIFICATE-----\nMIIDijCCAvOgAwIBAgIJAOXBQLEpMB4rMA0GCSqGSIb3DQEBBQUAMIGLMQswCQYD\nVQQGEwJKUDEOMAwGA1UECBMFVG9reW8xETAPBgNVBAcTCFNoaW5qdWt1MRAwDgYD\nVQQKEwdleGFtcGxlMRAwDgYDVQQLEwdleGFtcGxlMRQwEgYDVQQDEwtleGFtcGxl\nLmNvbTEfMB0GCSqGSIb3DQEJARYQcm9vdEBleGFtcGxlLmNvbTAeFw0wOTEwMTUw\nODMyNDdaFw0xOTEwMTMwODMyNDdaMIGLMQswCQYDVQQGEwJKUDEOMAwGA1UECBMF\nVG9reW8xETAPBgNVBAcTCFNoaW5qdWt1MRAwDgYDVQQKEwdleGFtcGxlMRAwDgYD\nVQQLEwdleGFtcGxlMRQwEgYDVQQDEwtleGFtcGxlLmNvbTEfMB0GCSqGSIb3DQEJ\nARYQcm9vdEBleGFtcGxlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA\norhSQotOymjP+lnDqRvrlYWKzd3M8vE82U7emeS9KQPtCBoy+fXP/kMEMxG/YU+c\nNAS/2BLFGN48EPM0ZAQap384nx+TNZ6sGuCJa60go8yIWff72DZjSZI6otfPjC9S\nNlxOnNLNAfGWAiaCcuBP1uJVhyrs1pu7SaEXBOP4pQ0CAwEAAaOB8zCB8DAdBgNV\nHQ4EFgQU3mEIdWrvKu+yuwIJD2WczQLI3j4wgcAGA1UdIwSBuDCBtYAU3mEIdWrv\nKu+yuwIJD2WczQLI3j6hgZGkgY4wgYsxCzAJBgNVBAYTAkpQMQ4wDAYDVQQIEwVU\nb2t5bzERMA8GA1UEBxMIU2hpbmp1a3UxEDAOBgNVBAoTB2V4YW1wbGUxEDAOBgNV\nBAsTB2V4YW1wbGUxFDASBgNVBAMTC2V4YW1wbGUuY29tMR8wHQYJKoZIhvcNAQkB\nFhByb290QGV4YW1wbGUuY29tggkA5cFAsSkwHiswDAYDVR0TBAUwAwEB/zANBgkq\nhkiG9w0BAQUFAAOBgQAO2ZKL0/tPhpVfbOoSXl+tlmTyyb8w7mCnjYYWwcwUAf1N\nylgYxKPrKfamjZKpeRY487VbTee1jfud709oIK5l9ghjz64kPRn/AYHTRwRkBKbb\nwuBWH4L6Rw3ml0ODXW64bdTx/QsAv5M1SyCp/nl8R27dz3MX2D1Ov2o4ipTlZw==\n-----END CERTIFICATE-----';\n $this->assertEquals('testuser', $this->consumer->getKey());\n $this->assertEquals('testpass', $this->consumer->getSecret());\n $this->assertEquals($publickey, $this->consumer->getPublicKey());\n }",
"function get_ssl_detail($url) {\n $url = (strpos($url, \"https://\") !== false) ? $url : '';\n $certinfo = '';\n if ($url) {\n $orignal_parse = parse_url($url, PHP_URL_HOST);\n $get = stream_context_create(array(\"ssl\" => array(\"capture_peer_cert\" => TRUE)));\n $read = stream_socket_client(\"ssl://\" . $orignal_parse . \":443\", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);\n $cert = stream_context_get_params($read);\n $certinfo = openssl_x509_parse($cert['options']['ssl']['peer_certificate']);\n }\n return ($certinfo) ? $certinfo : false;\n}",
"public function get_certificate() {\n return self::extract_key($this->get_certificate_file());\n }",
"public function testQueryCertificates()\n {\n }",
"protected function fetch_private_cert(&$request) {\n // (1) do a lookup in a table of trusted certs keyed off of consumer \n // \n // either way should return a string representation of the certificate \n throw Exception(\"fetch_private_cert not implemented\"); \n }",
"public function certificate() {\n return $this->info['certinfo'];\n }",
"public function get_cert() {\n\t\t$options = array(\n\t\t\t'headers' => array(\n\t\t\t\t'Accept' => 'application/x-pem-file',\n\t\t\t\t'Platform' => 'wordpress',\n\t\t\t),\n\t\t);\n\n\t\treturn $this->make_request( 'GET', 'certs/jwt.pem', $options, 'v1', false );\n\t}",
"public function get_certificate_file() {\n return '../data/certificates/' . hash_secure($this->name) . '.crt';\n }",
"private function has_certificate() {\n\t\t// Get siteurl.\n\t\t$home_url = get_option( 'siteurl' );\n\n\t\t// Change siteurl protocol.\n\t\tif ( preg_match( '/^http\\:/s', $home_url ) ) {\n\t\t\t$home_url = str_replace( 'http', 'https', $home_url );\n\t\t}\n\n\t\t$site_url = add_query_arg(\n\t\t\t'sgCacheCheck', // The key.\n\t\t\t'022870ae06716782ce17e4f6e7f69cc2', // The value.\n\t\t\t$home_url\n\t\t);\n\n\t\tini_set( 'user_agent', 'SG-Optimizer 3.0.2;' );\n\t\t// Create a streams context.\n\t\t$stream = stream_context_create(\n\t\t\tarray(\n\t\t\t\t'ssl' => array(\n\t\t\t\t\t'capture_peer_cert' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$read = @fopen( $site_url, 'rb', false, $stream );\n\t\t$cont = @stream_context_get_params( $read );\n\n\t\treturn is_null( $cont['options']['ssl']['peer_certificate'] ) ? false : true;\n\t}",
"private function get_from_link($url){\n $curl = curl_init($url); \n \n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($curl, CURLOPT_CAINFO, '../app/Models/cacert.pem');\n \n $output = curl_exec($curl);\n \n curl_close($curl);\n \n return $output; \n }",
"public function getCert(): ?string\n {\n }",
"public function getCertificate()\n {\n if (array_key_exists(\"certificate\", $this->_propDict)) {\n if (is_a($this->_propDict[\"certificate\"], \"\\GuzzleHttp\\Psr7\\Stream\") || is_null($this->_propDict[\"certificate\"])) {\n return $this->_propDict[\"certificate\"];\n } else {\n $this->_propDict[\"certificate\"] = \\GuzzleHttp\\Psr7\\Utils::streamFor($this->_propDict[\"certificate\"]);\n return $this->_propDict[\"certificate\"];\n }\n }\n return null;\n }",
"function ssl_cert_found($url) {\n\n\t// First, strip the subfolder from the passed url, if any\n\t$parsedurl = parse_url($url);\n\t$url = 'ssl://' . $parsedurl['host'] . ':443'; \n\t\n\t// Next, check the ssl stream context for certificate info \n\t$result = false;\n\t$context = stream_context_create (array(\"ssl\" => array(\"capture_peer_cert\" => true, \"verify_peer\" => true, \"allow_self_signed\" => true)));\n\t$stream = @stream_socket_client($url, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);\n\tif ($stream !== false)\n\t{\n\t\t$params = stream_context_get_params($stream);\n\t\t$result = isset($params[\"options\"][\"ssl\"][\"peer_certificate\"]) ? true : false;\n\t}\n return $result;\n}",
"public function testCreateCertificates()\n {\n }",
"function getCertificateFile()\n {\n return $this->_certificateFile;\n }",
"function file_get_contents_secure( $location, $validate_url = true ){\n $location = urlencode( $location );\n \n // If we need to validate the URL\n if( $validate_url == true ){\n \n // Check that the URL is valid and is HTTPS\n if( ! validate_url( $location, true ) ){\n\n return false;\n\n }\n \n }\n \n // Incase the file doesn't exist and an exception is thrown - courtesy of http://php.net/manual/en/function.file-get-contents.php#120366\n try{\n \n $context = stream_context_create( array('ssl' => array('verify_peer' => TRUE ) ));\n $contents = file_get_contents( $location, false, $context );\n \n if( $contents !== false ){\n \n return $contents;\n \n } else {\n \n return false;\n \n }\n \n } catch( Exception $e ){\n \n // File didn't exist, so return false\n return false;\n \n }\n \n}",
"public function testLinkAttributesToCertificate()\n {\n }",
"function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n\n $timeout = 2; // Initialise cURL timeout\n $useragent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0';\n\n curl_setopt($ch, CURLOPT_USERAGENT, $useragent);\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Return the webpage data as a string\n \n // curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n // curl_setopt ($ch, CURLOPT_HEADER, 0);\n // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n // curl_setopt($ch, CURLOPT_CAINFO, 'https://'.$_SERVER['HTTP_HOST'].'/scotiabeautycom.crt');\n // curl_setopt($ch, CURLOPT_CAINFO, 'https://'.$_SERVER['HTTP_HOST'].'/cacert.pem');\n\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Setting cURL's timeout option\n\n if (curl_exec($ch) === FALSE) {\n\n curl_exec($ch);\n \n echo '<p><strong>Curl returns FALSE.</strong></p>';\n echo '<p><strong>Curl Error:</strong> <em>'.curl_error($ch).'</em></p>';\n\n echo '<pre>';\n print_r(curl_getinfo($ch));\n echo '</pre>';\n\n } \n\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 \n return $data; // Returning the data from the function\n}"
] |
[
"0.7462147",
"0.7099127",
"0.6180642",
"0.601722",
"0.59560156",
"0.58785397",
"0.585389",
"0.58463436",
"0.5795436",
"0.57218194",
"0.57035893",
"0.56722283",
"0.56566113",
"0.5519399",
"0.5465089",
"0.5460221",
"0.5427534",
"0.5419434",
"0.5372021",
"0.533614",
"0.5330176",
"0.52996945",
"0.52541476",
"0.524513",
"0.5197986",
"0.51942044",
"0.5183638",
"0.5181061",
"0.51807076",
"0.51728916"
] |
0.8150528
|
0
|
Test that loading from a File source returns a certificate, even if this certificate is not valid.
|
public function test_it_should_return_an_invalid_certificate_on_bogus_certificate()
{
$web = new Web('somesource');
$cert = $web->load();
$this->assertInstanceOf(CertInfo::class, $cert);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function test_an_invalid_source_location_returns_an_invalid_certificate()\n {\n $web = new Web('somesource');\n $cert = $web->load();\n $this->assertFalse($cert->isValid());\n }",
"public function test_it_should_return_an_certificate()\n {\n $web = new Web('somefile');\n $this->assertInstanceOf(CertInfo::class, $web->load());\n }",
"function openssl_cms_read(string $input_filename, &$certificates): bool {}",
"public function testDecodeCertificate()\n {\n\n $this->post('api/decodeCertificate', ['certificate' => $this->getCertificate()])\n ->seeJsonEquals(\n [\n 'common_name' => 'ssltools.sslutil.com',\n 'subject_altname' => null,\n 'organization' => 'SSL Test',\n 'organization_unit' => 'Development',\n 'country_code' => 'AU',\n 'valid_from' => 1514617406,\n 'valid_to' => 1546153406,\n 'issuer' => [\n 'C' => 'AU',\n 'CN' => 'ssltools.sslutil.com',\n 'L' => 'Sydney',\n 'O' => 'SSL Test',\n 'ST' => 'NSW',\n 'OU' => 'Development'\n ],\n 'key_size' => 2048,\n 'serial_number' => '14225341186233066637',\n 'is_expired' => false,\n 'is_has_ev' => false,\n 'is_host_match' => null\n ]\n\n );\n }",
"public function testGetCertificate()\n {\n }",
"public function get_certificate_file() {\n return '../data/certificates/' . hash_secure($this->name) . '.crt';\n }",
"function setPayPalCertificate($fileName) {\n if (is_readable($fileName)) {\n $handle=null;\n $certificate=null;\n $size=null;\n \n $handle=fopen($fileName, \"r\");\n if (!$handle){\n echo 'Paypal cert could not be opened';\n }\n $size=filesize($fileName);\n \n $certificate=fread($handle, $size);\n if (!$certificate){\n echo 'Paypal cert could not be read';\n }\n fclose($handle);\n\n \t if ($certificate !== false) {\n\t\t\t $this->paypalCertificate = $certificate;\n\t\t\t $this->paypalCertificateFile = $fileName;\n\t\t\t return true;\n \t }\n }\n return false;\n }",
"function getCertificateFile()\n {\n return $this->_certificateFile;\n }",
"private function verify($fileName = \"\", $fileContent = \"\"){\n if (empty($fileName) && empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be empty simultaneously.\");\n }\n if (!empty($fileName) && !empty($fileContent)){\n throw new Exception(\"Filename and fileContent can not be passed simultaneously.\");\n }\n if (!empty($fileName) && !file_exists($fileName)){\n throw new Exception(\"File with given filename does not exist.\");\n }\n if (! file_exists($this->tmpDir) || ! is_writable($this->tmpDir)){\n throw new Exception(\"Tmp dir does not exist or is not writable.\");\n }\n\n $randomId = uniqid();\n if (!empty($fileContent)){\n $fileName = sprintf(\"%s/%s.pdf\", $this->tmpDir, $randomId);\n file_put_contents($fileName, $fileContent);\n }\n\n $file = file_get_contents($fileName);\n\n $filters = $this->getFilters($file);\n if (empty($filters)){\n throw new Exception(\"Filter section in given file was not found.\");\n }\n\n $byteRange = $this->getByteRange($file);\n if (empty($byteRange)){\n throw new Exception(\"ByteRange section in given file was not found.\");\n }\n\n $binarySignature = $this->getBinarySignature($file);\n if (empty($binarySignature)){\n throw new Exception(\"Signature section in given file was not found.\");\n }\n\n $extFile = sprintf(\"%s/%s.ext.pdf\", $this->tmpDir, $randomId);\n if (! $this->removeSigatureFromPdf($fileName, $extFile, $byteRange)){\n throw new Exception(\"Extracting a signature from given file was not successfull.\");\n }\n\n $certPem = sprintf(\"%s/%s.pem\", $this->tmpDir, $randomId);\n $certPkcs7 = sprintf(\"%s/%s.pkcs7\", $this->tmpDir, $randomId);\n if (! $this->createPKCS7FromSignature($binarySignature, $certPem, $certPkcs7)){\n throw new Exception(\"Creating a certificate from signature was not successfull.\");\n }\n\n $certDer = sprintf(\"%s/%s.der\", $this->tmpDir, $randomId);\n if (! $this->convertPKCS7ToDER($certPkcs7, $certDer)){\n throw new Exception(\"Conversion of a certificate from PKCS7 to DER was not successfull.\");\n }\n\n $countCertsSignature = $this->convertPKCS7ToPEM($certPkcs7, $certPem);\n if ($countCertsSignature <= 0){\n throw new Exception(\"Conversion of a certificate from PKCS7 to PEM was not successfull.\");\n }\n\n// if($countCertsSignature>1) $countCertsSignature = 1; //onma, je problem s vice certifikaty, v PDF je vetsinou hned prvni soukromy klic\n for ($pocet=0; $pocet<$countCertsSignature; $pocet++ ) {\n $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $pocet));\n $cislo = $parsedCert['subject']['serial'];\n if ($cislo<>'') $pocet = 999999; //vyskocime\n }\n// $parsedCert = $this->parseCert(sprintf(\"%s.%d\", $certPem, $countCertsSignature - 1));\n\n\n $digest = sprintf(\"%s/%s.dig.bin\", $this->tmpDir, $randomId);\n $digests = $this->extractSignedDigest($certDer, $digest);\n if (empty($digests) || (empty($digests[\"rsaEncoded\"]) && empty($digests[\"messageDigest\"]) && empty($digests[\"PKCS7Data\"]))){\n throw new Exception(\"Extracting of a signed digest from certificate was not successfull.\");\n }\n\n $publicKey = sprintf(\"%s/%s.pubkey.pem\", $this->tmpDir, $randomId);\n\n $fileHashes = array(\n \"sha256\" => hash_file(\"sha256\", $extFile),\n \"sha1\" => hash_file(\"sha1\", $extFile),\n \"md5\" => hash_file(\"md5\", $extFile)\n );\n $signedHashes = array();\n\n if(!empty($digests[\"rsaEncoded\"])){\n if (! $this->createPublicKeyFromPEM($certPem, $publicKey)){\n throw new Exception(\"Creating of a public key from certificate was not successfull.\");\n }\n\n foreach($digests[\"rsaEncoded\"] as $dg){\n if(!empty($dg)){\n $decDigest = sprintf(\"%s.dec\", $dg);\n if (! $this->decryptBinaryDigest($dg, $decDigest, $publicKey)){\n throw new Exception(\"Decryption of a signed digest from certificate was not successfull.\");\n }\n if(file_exists($decDigest)){\n $signedHashes[] = strtolower(substr(bin2hex(file_get_contents($decDigest)), self::MAGIC));\n }\n }\n }\n }\n\n if(!empty($digests[\"messageDigest\"])){\n foreach($digests[\"messageDigest\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(!empty($digests[\"PKCS7Data\"])){\n foreach($digests[\"PKCS7Data\"] as $md){\n $signedHashes[] = strtolower($md);\n }\n }\n\n if(self::ENABLE_CLEANING){\n $this->rm($extFile);\n $this->rm($certPem);\n $this->rm($certPkcs7);\n $this->rm($certDer);\n $this->rm($publicKey);\n $this->rm($digest);\n if($countCertsSignature > 0){\n for($i = 0; $i < $countCertsSignature; $i++){\n $this->rm(sprintf(\"%s.%d\", $certPem, $i));\n }\n }\n if(!empty($digests[\"rsaEncoded\"])){\n foreach($digests[\"rsaEncoded\"] as $rsa){\n $this->rm(sprintf(\"%s\", $rsa));\n $this->rm(sprintf(\"%s.dec\", $rsa));\n }\n }\n if(!empty($fileContent)){\n $this->rm($fileName);\n }\n }\n\n foreach ($fileHashes as $algo => $hash) {\n if(in_array($hash, $signedHashes)){\n $r = array(\n \"result\" => true,\n \"alg\" => $algo,\n \"hash\" => $hash\n );\n return array_merge($r, $parsedCert);\n }\n }\n\n return array(\n \"result\" => false,\n \"fileHashes\" => $fileHashes,\n \"signedHashes\" => $signedHashes\n );\n }",
"public function testMissingCertificate()\n {\n\n $this->post('api/decodeCertificate', [])\n ->seeJsonEquals(\n [\n 'error' => [\n 'message' => '422 Unprocessable Entity',\n 'errors' => [\n 'certificate' => [\n 'The certificate field is required.'\n ]\n ],\n 'status_code' => 422\n ]\n ]\n\n );\n }",
"public function testGetCertificateSetup()\n {\n }",
"public function testInvalidCertificate()\n {\n $this->post('api/decodeCertificate', ['certificate' => 'invalidCertificate'])\n ->seeJsonEquals(\n [\n 'error' => [\n 'message' => 'Certificate parse failed',\n 'status_code' => 500\n ]\n ]\n\n );\n }",
"protected function __validCerts($cert = null){\n\t\t//$privateKey\t\t= $this->pathCertificado.$this->filename_privateKey;\n\t\t$publicKey\t\t= $this->pathCertificado.$this->filename_publicKey;\n\t\t//$certificado\t= $this->pathCertificado.$this->filename_certificado;\n\t\t//$filename_pfx\t= $this->filename_pfx;\n\t\t//$cert = null;\n\n\t\tif(is_file($publicKey)){\n\t\t\t$this->certificadoIsOpend = true;\n\t\t\t$cert = file_get_contents($publicKey);\n\t\t} else {\n\t\t\t$this->certificadoIsOpend = false;\n\t\t}\n\n\t\tif (is_null($cert)){\n\t\t\t$this->setLog(\"Certificado não foi aberto.\", 3);\n\t\t\treturn array('status'=>false,'strError'=>\"Certificado não foi aberto.\");\n\t\t}\n\t\tif (!$data = openssl_x509_read($cert)){\n\t\t\t$this->setLog(\"Erro no certificado, ele não pode ser lido pelo OpenSSL.\",3);\n\t\t\treturn array('status'=>false,'strError'=>\"Erro no certificado, ele não pode ser lido pelo OpenSSL.\");\n\t\t}\n\n\t\t$status = true;\n\t\t$strError = \"\";\n\t\t$cert_data = openssl_x509_parse($data);\n\t\t//var_dump($cert_data);exit;\n\t\t$this->name = $cert_data['name'];\n\t\t$this->CommonName\t= isset($cert_data['subject']['CN'])?$cert_data['subject']['CN']:'';\n\t\t$this->OrgUnit\t\t= \"\";\n\t\tif(isset($cert_data['subject']['OU']) and is_array($cert_data['subject']['OU'])){\n\t\t\tforeach ($cert_data['subject']['OU'] as $indice=>$ou){\n\t\t\t\t$this->OrgUnit\t\t.= \"[\".($indice+1).\"] \".$ou.\"\\r\\n\";\n\t\t\t}\n\t\t} else {\n\t\t\t$this->OrgUnit\t\t.= $cert_data['subject']['OU'].\"\\r\\n\";\n\t\t}\n\t\t$this->Location\t\t= isset($cert_data['subject']['L'])?$cert_data['subject']['L']:'';\n\t\t$this->State\t\t= isset($cert_data['subject']['ST'])?$cert_data['subject']['ST']:\"\";\n\t\t$this->Country\t\t= isset($cert_data['subject']['C'])?$cert_data['subject']['C']:'';\n\n\t\t//Reformata a data de validade - yy-mm-dd\n\t\t$anoF = substr($cert_data['validFrom'],0,2);\n\t\t$mesF = substr($cert_data['validFrom'],2,2);\n\t\t$diaF = substr($cert_data['validFrom'],4,2);\n\t\t//obtem o timeestamp da data de validade do certificado\n\t\t$dValidFrom = gmmktime(0,0,0,$mesF,$diaF,$anoF);\n\n\t\t//Reformata a data de validade - yy-mm-dd\n\t\t$ano = substr($cert_data['validTo'],0,2);\n\t\t$mes = substr($cert_data['validTo'],2,2);\n\t\t$dia = substr($cert_data['validTo'],4,2);\n\t\t//obtem o timeestamp da data de validade do certificado\n\t\t$dValid = gmmktime(0,0,0,$mes,$dia,$ano);\n\n\t\t$this->timeValidFrom = $dValidFrom;\n\t\t$this->timeValid = $dValid;\n\t\t// obtem o timestamp da data de hoje\n\t\t$dHoje = gmmktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\"));\n\t\t// compara a data de validade com a data atual\n\t\tif ($dValid < $dHoje ){\n\t\t\t$status = false;\n\t\t\t$strError = \"Erro no certificado: Certificado expirou em {$dia}/{$mes}/{$ano}\";\n\t\t}\n\t\t//diferenca em segundos entre os timestamp\n\t\t$diferenca = $dValid - $dHoje;\n\t\t// convertendo para dias\n\t\t$diferenca = round($diferenca /(60*60*24),0);\n\t\t//carregando a propriedade\n\t\t$daysToExpire = $diferenca;\n\t\t//Convertendo para meses e carregando a propriedade\n\t\t$m = ($ano * 12 + $mes);\n\t\t$n = (date(\"y\") * 12 + date(\"m\"));\n\t\t//numero de meses ate o certificado expirar\n\t\t$monthsToExpire = ($m-$n);\n\t\tif($status==false){\n\t\t\t$this->setLog($strError,3);\n\t\t}\n\n\t\treturn array('status'=>$status,'strError'=>$strError,'name'=>$this->name,'meses'=>$monthsToExpire,'dias'=>$daysToExpire,'dtExpire'=>$cert_data['validTo']);\n\t}",
"private static function loadCACertificates(): void\n {\n if (!empty(self::$caCertificates)) {\n // the certificates have already been loaded\n return;\n }\n\n $caCertificates = [];\n\n // Load Trusted CA's, first the .cer which are DER certificates (binary)\n $files = glob(__DIR__ . self::TRUSTED_ROOT_CERTIFICATE_DIRECTORY . '*.cer', GLOB_ERR);\n\n foreach ($files as $filename) {\n // The certificate is DER, we have to convert it to PEM\n $rootCertificateDer = file_get_contents(realpath($filename));\n $rootCertificatePem = OpenSSLUtility::coerceBinaryCertificate($rootCertificateDer);\n $rootCertificate = openssl_x509_read($rootCertificatePem);\n\n $rootCertificateParsed = openssl_x509_parse($rootCertificate);\n\n $rootPublicKey = openssl_pkey_get_public($rootCertificate);\n $rootPublicKeyDetails = openssl_pkey_get_details($rootPublicKey);\n\n $caCertificates[$rootCertificateParsed['hash']] = [\n 'filename' => realpath($filename),\n 'certificate' => $rootCertificate,\n 'parsed' => $rootCertificateParsed,\n 'pem' => $rootCertificatePem,\n 'der' => $rootCertificateDer,\n 'public_key' => $rootPublicKeyDetails['key'],\n 'hash' => $rootCertificateParsed['hash'],\n ];\n }\n\n // Load Trusted CA's, then the .crt which are PEM certificates (base64)\n $files = glob(__DIR__ . self::TRUSTED_ROOT_CERTIFICATE_DIRECTORY . '*.crt', GLOB_ERR);\n\n foreach ($files as $filename) {\n // The certificate is PEM, we can use it as-is, but we'll still need the DER file later on\n $rootCertificatePem = file_get_contents(realpath($filename));\n $rootCertificateDer = self::certificatePemToDer($rootCertificatePem);\n $rootCertificate = openssl_x509_read($rootCertificatePem);\n\n $rootCertificateParsed = openssl_x509_parse($rootCertificate);\n\n $rootPublicKey = openssl_pkey_get_public($rootCertificate);\n $rootPublicKeyDetails = openssl_pkey_get_details($rootPublicKey);\n\n $caCertificates[$rootCertificateParsed['hash']] = [\n 'filename' => realpath($filename),\n 'certificate' => $rootCertificate,\n 'parsed' => $rootCertificateParsed,\n 'pem' => $rootCertificatePem,\n 'der' => $rootCertificateDer,\n 'public_key' => $rootPublicKeyDetails['key'],\n 'hash' => $rootCertificateParsed['hash'],\n ];\n }\n\n // Store it in our Static variable\n self::$caCertificates = $caCertificates;\n\n return;\n }",
"public function testDownloadCertificateImage()\n {\n }",
"function file_get_contents_secure( $location, $validate_url = true ){\n $location = urlencode( $location );\n \n // If we need to validate the URL\n if( $validate_url == true ){\n \n // Check that the URL is valid and is HTTPS\n if( ! validate_url( $location, true ) ){\n\n return false;\n\n }\n \n }\n \n // Incase the file doesn't exist and an exception is thrown - courtesy of http://php.net/manual/en/function.file-get-contents.php#120366\n try{\n \n $context = stream_context_create( array('ssl' => array('verify_peer' => TRUE ) ));\n $contents = file_get_contents( $location, false, $context );\n \n if( $contents !== false ){\n \n return $contents;\n \n } else {\n \n return false;\n \n }\n \n } catch( Exception $e ){\n \n // File didn't exist, so return false\n return false;\n \n }\n \n}",
"public function setPayPalCertificate($fileName)\n {\n if (is_readable($fileName))\n {\n $certificate = openssl_x509_read(file_get_contents($fileName));\n\n if ($certificate !== FALSE)\n {\n $this->paypalCertificate = $certificate;\n $this->paypalCertificateFile = $fileName;\n\n return TRUE;\n }\n }\n\n return FALSE;\n }",
"public function get_certificate() {\n return self::extract_key($this->get_certificate_file());\n }",
"function setCertificate($certificateFilename, $privateKeyFilename) {\n $result = false;\n\n if (is_readable($certificateFilename) && is_readable($privateKeyFilename))\n {\n $certificate=null;\n $handle=fopen($certificateFilename, \"r\");\n $size=filesize($certificateFilename);\n $certificate=fread($handle,$size);\n fclose($handle);\n\n $privateKey=null; \n $handle=fopen($privateKeyFilename,\"r\");\n $size=filesize($privateKeyFilename);\n $privateKey=fread($handle, $size);\n fclose($handle);\n \n \t if (($certificate !== false) && ($privateKey !== false) && openssl_x509_check_private_key($certificate, $privateKey)) {\n\t\t\t $this->certificate = $certificate;\n\t\t\t $this->certificateFile = $certificateFilename;\n\t\t\t $this->privateKey = $privateKey;\n\t\t\t $this->privateKeyFile = $privateKeyFilename;\n\t\t\t $result = true;\n \t }\n }\n\n return $result;\n }",
"function openssl_x509_export_to_file(#[LanguageLevelTypeAware([\"8.0\" => \"OpenSSLCertificate|string\"], default: \"resource|string\")] $certificate, string $output_filename, bool $no_text = true): bool {}",
"function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates, array $ca_info = [], ?string $untrusted_certificates_filename, ?string $content, ?string $pk7, ?string $sigfile, int $encoding = OPENSSL_ENCODING_SMIME): bool {}",
"public function loadPfxFile(string $filename, string $password)\n {\n if (!file_exists($filename)) {\n throw new XmlSignatureValidatorException(sprintf('File not found: %s', $filename));\n }\n\n $pkcs12 = file_get_contents($filename);\n\n if (!$pkcs12) {\n throw new XmlSignatureValidatorException(sprintf('File could not be read: %s', $filename));\n }\n\n $this->loadPfx($pkcs12, $password);\n }",
"function createCertFingerprint($filename) {\r\n $fp = fopen(\"security/\" . $filename, \"r\");\r\n \r\n if(!$fp) {\r\n return false;\r\n }\r\n $cert = fread($fp, 8192);\r\n fclose($fp);\r\n\r\n $data = openssl_x509_read($cert);\r\n\r\n if(!openssl_x509_export($data, $data)) {\r\n\r\n return false;\r\n }\r\n \r\n $data = str_replace(\"-----BEGIN CERTIFICATE-----\", \"\", $data);\r\n $data = str_replace(\"-----END CERTIFICATE-----\", \"\", $data);\r\n\r\n $data = base64_decode($data);\r\n\r\n $fingerprint = sha1($data);\r\n \r\n $fingerprint = strtoupper( $fingerprint );\r\n \r\n return $fingerprint;\r\n \r\n }",
"public function testDecodeCertificateRequest()\n {\n\n $this->post('api/decodeCertificateRequest', ['certificateRequest' => $this->getCertificateRequest()])\n ->seeJsonEquals(\n [\n 'city' => 'Sydney',\n 'common_name' => 'ssltools.sslutil.com',\n 'country_code' => 'AU',\n 'email' => null,\n 'key_size' => 2048,\n 'organization' => 'SSL Test',\n 'organization_unit' => 'Development',\n 'state' => 'NSW'\n ]\n );\n }",
"function openssl_x509_checkpurpose(\n #[LanguageLevelTypeAware([\"8.0\" => \"OpenSSLCertificate|string\"], default: \"resource|string\")] $certificate,\n int $purpose,\n #[PhpStormStubsElementAvailable(from: '5.3', to: '7.0')] array $ca_info,\n #[PhpStormStubsElementAvailable(from: '7.1')] array $ca_info = [],\n ?string $untrusted_certificates_file\n): int|bool {}",
"public function testIsVendorFileThrowsExceptionIfNoValidFileReferenceIsProvided()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorFile(__DIR__ . '/this/files/does/not/exist');\n }",
"public function testRequestCertificateSetup()\n {\n }",
"public function verifyFile($fileName){\n if (empty($fileName)){\n throw new Exception(\"Filename can not be empty.\");\n }\n return $this->verify($fileName, null);\n }",
"#[LanguageLevelTypeAware([\"8.0\" => \"OpenSSLCertificate|false\"], default: \"resource|false\")]\nfunction openssl_x509_read(#[LanguageLevelTypeAware([\"8.0\" => \"OpenSSLCertificate|string\"], default: \"resource|string\")] $certificate) {}",
"function openssl_pkcs7_verify(\n string $input_filename,\n int $flags,\n ?string $signers_certificates_filename,\n array $ca_info = [],\n ?string $untrusted_certificates_filename,\n ?string $content,\n #[PhpStormStubsElementAvailable(\"7.2\")] ?string $output_filename\n): int|bool {}"
] |
[
"0.7602867",
"0.70826757",
"0.6145778",
"0.61355513",
"0.61056215",
"0.60823023",
"0.6003386",
"0.5955131",
"0.58452815",
"0.5821699",
"0.5795241",
"0.5772825",
"0.57656336",
"0.5721717",
"0.57123196",
"0.5684935",
"0.56510997",
"0.5558494",
"0.55413264",
"0.55343443",
"0.5531566",
"0.55113363",
"0.5497751",
"0.5480341",
"0.54086006",
"0.5398472",
"0.5394835",
"0.5386795",
"0.53779775",
"0.53695256"
] |
0.71948373
|
1
|
/ write_log($message[, $logfile]) Parameters: $message: Message to be logged $logfile: Path of log file to write to. Optional. Default is log/session.log.
|
function write_log($message, $logfile='log/session.log') {
// Get time of request
if( ($time = $_SERVER['REQUEST_TIME']) == '') {
$time = time();
}
// Get IP address
if( ($remote_addr = $_SERVER['REMOTE_ADDR']) == '') {
$remote_addr = "REMOTE_ADDR_UNKNOWN";
}
// Format the date and time
$date = date("Y-m-d H:i:s", $time);
// Append to the log file
if($fd = @fopen($logfile, "a")) {
$result = fputcsv($fd, array($date, $remote_addr, $message));
fclose($fd);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function _log($message)\n{\n\tfwrite($GLOBALS['logfile'], date(\"Y-m-d H:i:s :: \", time()) . $message . \"\\n\");\n}",
"public function write_log($log_file, $log_tag=\"i\", $log_msg){\n $fh = $this->open_log_file($log_file);\n\n $log_txt = \"[\".self::timestamp().\"]\";\n $log_txt .= \" \";\n $log_txt .= \"[\".$this->LOG_TAG[$log_tag].\"]\";\n $log_txt .= \" \";\n $log_txt .= $log_msg;\n $log_txt .= \"\\n\";\n\n fwrite($fh, $log_txt);\n @flush();\n fclose($fh);\n }",
"function writeLog($logmsg)\n{\n global $conf;\n if (! $conf['enable_logging']) {return;}\n if ($conf['logfile']==\"syslog\") {\n syslog(LOG_INFO,$logmsg);\n } else {\n if (!($fp=fopen($conf['logfile'], \"a\"))) {\n return;\n }\n $now=date(\"Y-d-m H:i:s\");\n fputs($fp, \"$now $logmsg\\n\");\n fclose($fp);\n }\n}",
"function logWrite($msg) {\n\tglobal $logfile;\n\t$fh = fopen($logfile, 'a');\n\tfwrite($fh, \"$msg\\n\");\n\tfclose($fh);\n}",
"function write_log($log_file, $log_message)\t{\n\t\t$mylogfile = fopen($log_file, \"a\") or die(\"Unable to open file!\");\n\t\tfwrite($mylogfile, date('Y-m-d H:i:s') . \" IP:\" . str_pad(get_client_ip(),15) . \" \" . $log_message . \"\\n\");\n\t\tfclose($mylogfile);\n\t}",
"function _log($message) {\n file_put_contents(\n LOG_FILE, \n $message,\n FILE_APPEND\n );\n}",
"public static function write($logFile, $msg) {\r\n \t$fp = fopen($logFile, 'a');\r\n \t$log = '### '.date('d.m.Y H:i:s:'.substr(microtime(), 2, 3)).' ##############'.\"\\n\".$msg.\"\\n\\n\";\r\n \tfwrite($fp, $log);\r\n \tfclose($fp);\r\n }",
"function logMessage($logLevel, $message)\n{\n $date = date(\"Y-m-d\");\n $filename = \"log-$date.log\";\n $today = date(\"Y-m-d H:i:s\");\n $handle = fopen($filename, 'a');\n fwrite($handle, $today . ' ' . $logLevel . ' ' . $message . PHP_EOL);\n fclose($handle);\n}",
"public static function logMessage($logLevel, $message) \n/*\tUpdate logMessage(); it should no longer need to open and close \nits own file handle, instead use the $handle property.*/\n\t{\n\t\t$stringToWrite = PHP_EOL . \"[{$logLevel}] $message\";\n\t\tfwrite(self::handle, $stringToWrite);\n\t}",
"function logMessage($level, $message) {\t\n// time and date functions assigned to variables\n\t$time = date(\"H:i:s\");\n\t$date = date(\"Y-m-d\");\n// filename created with current date. A new file will be created every day\n\t$filename = \"log-\" . $date . \".log\";\n\n// handle opens the file and appends new information to the end\n\t$handle = fopen($filename, 'a');\n\n// writes the date, time, and message to the file, then closes it\n\tfwrite($handle,PHP_EOL . $date . $time . $level . $message);\n\tfclose($handle);\n\n}",
"public function logMessage($logLevel, $message)\n\t\t{\n\t\t // Set timezone and date format\n\t\t // date_default_timezone_set('America/Chicago');\n\t\t\t// $date = date('Y-m-d');\n\t\t \n\t\t // Assign a file to the filename property inside the instance of the Log class\n\t\t\t// $this->filename = \"log {$date}.log\";\n\t\t // $handle = fopen($this->filename, 'a+');\n\t\t fwrite($this->handle, PHP_EOL.date(\"Y-m-d H:i:s\") . \" [$logLevel] $message\");\n\t\t // fclose($handle);\n\t\t}",
"protected function write_to_log( $message = '' ) {\r\n\t\t$file = $this->get_file();\r\n\t\t$file .= $message;\r\n\t\t@file_put_contents( $this->file, $file );\r\n\t}",
"private static function writeToLogFile($message)\n {\n file_put_contents(Config::get('log_file'), utf8_encode(date(Config::get('time_format')) . ' ' . $message . \"\\n\"), FILE_APPEND);\n }",
"function logger($msg)\n{\n\n $filename = $_SERVER['DOCUMENT_ROOT'].'/Utils/Logs/log.txt';\n $msg = date(\"[d/m] h:i:sa\") . \": \". $msg . \"\\n\";\n\n file_put_contents( $filename, $msg, FILE_APPEND);\n}",
"public function log( $message = '' ) {\r\n\t\t$message = date( 'Y-n-d H:i:s' ) . ' - ' . $message . \"\\r\\n\";\r\n\t\t$this->write_to_log( $message );\r\n\r\n\t}",
"public static function write($message)\n {\n $name = date('d-m-Y') . '.log';\n $logDir = ROOT . \"Logs/\";\n\n //Creates logs dir\n if (!file_exists($logDir)) {\n mkdir($logDir, 0655, true);\n }\n //Creates lof file\n if (!file_exists($name)) {\n touch($logDir . $name);\n }\n\n file_put_contents(\n $logDir . $name,\n '[' . date('d-m-Y H:i:s') .'] ' . $message . \"\\n\",\n FILE_APPEND\n );\n }",
"function log1($msg)\n{\n if(WRITE_LOG == false)\n return;\n date_default_timezone_set('Europe/Vienna');\n $now = date(\"Y-m-d H:i:s\");\n $line = sprintf(\"%s => %s\\r\\n\", $now, $msg);\n file_put_contents(LOG_FILE, $line, FILE_APPEND);\n}",
"protected function log($msg, $file = 'log', $newline = true)\n\t{\n\t\tif ($newline) {\n\t\t\t$msg = date('D, j M H:i:s') . ' ' . $msg . \"\\n\";\n\t\t}\n\t\techo $msg;\n\t\tfile_put_contents(LOG_DIR . $file, $msg, FILE_APPEND);\n\t}",
"static public function write($log , $state = 1){\n\t$finename = \"log/\" . date(self::$_config['filepattern']) . \".log\";\n\t$fp = fopen($finename , \"a\");\n\t$message = \"\";\n\tswitch($state){\n\tcase 1:\n\t $message = \"[info]\\t\";\n\t\tbreak;\n\tcase 2:\n\t $message = \"[warning]\\t\";\n\t\tbreak;\n\tcase 3:\n\t $message = \"[error]\\t\";\n\t\tbreak;\n\t}\n\t$message = $message . \" \" . date(\"H:i:s\") .' ' . $log . PHP_EOL;\n\tfwrite($fp , $message);\n\tfclose($fp);\t\n }",
"public static function log($msg){\n\t\tself::createLogExist();\n\n\t\t$fichier = fopen('log/log.txt', 'r+');\n\t\tfputs($fichier, $msg);\n\t}",
"function logMessage($level, $message)\n{\n // fwrite($file, \"[$level] $message\" . PHP_EOL);\n // fclose($file);\n\n $backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2)[0];\n $file = fopen('app.log', \"a\");\n fwrite($file, \"[$level] \" . date(DATE_ISO8601) . \" \" . $backtrace[\"file\"] . \":\" . $backtrace[\"line\"] .\n \" $message\" . PHP_EOL);\n fclose($file);\n}",
"public function write($file, $message)\n {\n // TODO get $config-values from a config class and delete global\n global $config;\n if (!$this->handle[$file]) {\n $this->handle[$file] = $this->_getFileHandle($file);\n }\n $message = strip_tags($message);\n // we don't need linebreaks in the log\n $search = array(\"\\n\",\"\\r\");\n $replace = array ('','');\n $message = str_replace($search, $replace, $message);\n $logMessage = date('d.m.Y H:i:s') . ' '. $message . \"\\n\";\n $_SESSION['log']['actions'][] = $logMessage;\n $filename = $this->getLogfile($file);\n if (@filesize($filename) > $config['log_maxsize']) {\n Log::delete($file);\n }\n //save to log file\n if ($_SESSION['config']['logcompression'] == 1) {\n $res = @gzwrite($this->handle[$file], $logMessage);\n } else {\n $res = @fwrite($this->handle[$file], $logMessage);\n }\n return $res;\n }",
"function WriteLog($log_file)\n{\n global $SPECIAL_VALUES;\n\n@\t$log_fp = fopen($log_file,\"a\");\n\n\tif (!$log_fp)\n\t\treturn;\n\t$date = gmdate(\"H:i:s d-M-y T\");\n\t$entry = $date.\":\".$SPECIAL_VALUES[\"email\"].\",\".\n\t\t\t$SPECIAL_VALUES[\"realname\"].\",\".$SPECIAL_VALUES[\"subject\"].\"\\n\";\n\tfwrite($log_fp,$entry);\n\tfclose($log_fp);\n}",
"function write_log($text,$level=null) {\r\n\t\tif ($level === null) {\r\n\t\t\t$level = 'DEBUG';\r\n\t\t}\r\n\t\t$caller = getCaller();\r\n\t\t$filename = 'Phlex.log';\r\n\t\t$text = date(DATE_RFC2822) . ' [ '.$level.' ] '.$caller . \" - \" . $text . PHP_EOL;\r\n\t\tif (!file_exists($filename)) { touch($filename); chmod($filename, 0666); }\r\n\t\tif (filesize($filename) > 2*1024*1024) {\r\n\t\t\t$filename2 = \"$filename.old\";\r\n\t\t\tif (file_exists($filename2)) unlink($filename2);\r\n\t\t\trename($filename, $filename2);\r\n\t\t\ttouch($filename); chmod($filename,0666);\r\n\t\t}\r\n\t\tif (!is_writable($filename)) die;\r\n\t\tif (!$handle = fopen($filename, 'a+')) die;\r\n\t\tif (fwrite($handle, $text) === FALSE) die;\r\n\t\tfclose($handle);\r\n\t}",
"public function lwrite($message) {\n\t\t// if file pointer doesn't exist, then open log file\n\t\tif (!$this->fp) {\n\t\t\t$this->lopen();\n\t\t}\n\t\t// define script name\n\t\t$script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n\t\t// define current time\n\t\t$time = date('H:i:s');\n\t\t// write current time, script name and message to the log file\n\t\tfwrite($this->fp, \"$time ($script_name) $message\". $this->nl);\n\t}",
"public function lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('m-d-y H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\n }",
"public function log(string $message): void\n {\n $filePointer = fopen($this->file, \"a\");\n\n $logMsg = date('Y-m-d H:i:s') . \"\\t\\t\" . $message . \"\\n\";\n\n //rewind($filePointer);\n fwrite($filePointer, $logMsg);\n fclose($filePointer);\n }",
"public function lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\n }",
"public function lwrite($message){\n // if file pointer doesn't exist, then open log file\n if (!$this->fp) $this->lopen();\n // define script name\n $script_name = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);\n // define current time\n $time = date('H:i:s');\n // write current time, script name and message to the log file\n fwrite($this->fp, \"$time ($script_name) $message\\n\");\n }",
"private function writelog() {\r\n\r\n $dir = APP_PATH . 'tmp/log';\r\n //IF 'tmp/log' is file, delete it.\r\n if (is_file($dir)) {\r\n unlink(APP_PATH . 'tmp/log');\r\n }\r\n //IF 'tmp/log' is not exists, create it as folder.\r\n if (!dir_exists($dir)) {\r\n __mkdirs(APP_PATH . 'tmp/log');\r\n }\r\n //IF 'tmp/log' is exists as folder, the create logs under it.\r\n if (dir_exists($dir) && is_dir($dir)) {\r\n $date = date(\"Y-m-d H:i:s\", time());\r\n $arr = array('-', ':');\r\n $date = trim(str_replace($arr, '', $date));\r\n $cnt = $this->spArgs('msg');\r\n $str = $date . '\\t' . $cnt;\r\n file_put_contents(APP_PATH . 'tmp/log/log_' . $date . '.log', $str, FILE_APPEND);\r\n }\r\n return TRUE;\r\n }"
] |
[
"0.7662275",
"0.7511298",
"0.73815906",
"0.7373889",
"0.7371189",
"0.72691953",
"0.71529275",
"0.7009658",
"0.689738",
"0.6883024",
"0.68557763",
"0.681926",
"0.67920625",
"0.677573",
"0.67672193",
"0.6757084",
"0.6745794",
"0.6685829",
"0.6681875",
"0.66586304",
"0.6641417",
"0.6641378",
"0.66115373",
"0.65975976",
"0.65844244",
"0.65763247",
"0.6567022",
"0.656693",
"0.656693",
"0.65390176"
] |
0.7963543
|
0
|
Check Balance Check Paybill balance
|
public function check_balance()
{
$data = array(
'CommandID' => 'AccountBalance',
'PartyA' => $this->paybill,
'IdentifierType' => '4',
'Remarks' => 'Remarks or short description',
'Initiator' => $this->initiator_username,
'SecurityCredential' => $this->get_credential(),
'QueueTimeOutURL' => $this->balance_check_result_url,
'ResultURL' => $this->balance_check_result_url
);
$data = json_encode($data);
$url = $this->base_url . 'accountbalance/v1/query';
$response = $this->submit_request($url, $data);
return $response;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract function checkBalance();",
"public function checkBalance()\n {\n echo \"Check Balance of Dhanmondi Branch<br>\";\n }",
"public function checkBalance()\n {\n if ($this->_client) {\n $balance = $this->_client->checkBalance();\n\n if ($balance['balance'] <= env('SMS_CREDIT_THRESHOLD')) {\n // Send warning email\n $subject = 'SMS service balance running low';\n $vars = ['balance'=>$balance];\n \\Mail::send(['text'=>'errors.sms_balance'], $vars, function($message) use ($subject)\n {\n $message->to(env('DEVELOPER_EMAIL'))->subject($subject);\n });\n }\n }\n }",
"public function test_validate_withdraw_balance()\n {\n $amount = 5000;\n $balance = $this->obj->get_balance();\n $withdraw = $this->obj->validate_withdraw_balance($amount);\n if($amount < $balance){\n $this->assertTrue($withdraw);\n }else{\n $this->assertFalse($withdraw);\n }\n \n }",
"function balanceCheck($data) {\n \tif(isset($this->data['Bidbutler']['balance'])) {\n\t \tif(!empty($this->data['Bidbutler']['balance'])) {\n\t\t \tif($this->data['Bidbutler']['balance'] < $data['bids']) {\n\t\t \t\treturn false;\n\t\t \t}\n\t \t} else {\n\t \t\treturn false;\n\t \t}\n \t}\n\n \treturn true;\n }",
"public function balance () {\n\t\t\t// get the response from the api server in json format\n\t\t\t$response = $this->request();\n\t\t\tif ($response->status == 1 || $response->remarks == 'success') {\n\t\t\t\treturn $response->balance;\n\t\t\t}\n\t\t\t$this->error = $response->remarks;\n\t\t\t\n\t\t\treturn 0;\n\t\t}",
"function balance($wallet_id = null) {\n\t\tif(empty($wallet_id)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/balance';\n\t\t\t$json = file_get_contents($url);\n\t\t\t$data = json_decode($json);\n\t\t\tif(!$data->successful) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn $data->balance;\n\t\t\t}\n\t\t}\n\t}",
"function validTransferAmount($account,$amount){\r\n\tif($account[0]=='1'){\r\n\t\t$db = new mysqli(\"localhost\",\"root\",\"***\",\"onlinebanking\");\r\n\t\t$amount = $db -> real_escape_string($amount);\r\n\t\t$rChequing = $db -> query(\"SELECT balance FROM chequingaccounts WHERE account_num='$account'\");\r\n\t\t$db -> close();\r\n\r\n\t\t$chequingBalance = $rChequing -> fetch_all(MYSQLI_ASSOC);\r\n\t\tif(empty($chequingBalance)){\r\n\t\t\treturn False;\r\n\t\t}else{\r\n\t\t\tif($chequingBalance[0]['balance']>=$amount){\r\n\t\t\t\treturn True;\r\n\t\t\t}else{\r\n\t\t\t\treturn False;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}elseif($account[0]='2'){\r\n\t\t$db = new mysqli(\"localhost\",\"root\",\"***\",\"onlinebanking\");\r\n\t\t$amount = $db -> real_escape_string($amount);\r\n\t\t$rSavings = $db -> query(\"SELECT balance FROM savingsaccounts WHERE account_num='$account'\");\r\n\t\t$db -> close();\r\n\r\n\t\t$savingsBalance = $rSavings -> fetch_all(MYSQLI_ASSOC);\r\n\t\tif(empty($savingsBalance)){\r\n\t\t\treturn False;\r\n\t\t}else{\r\n\t\t\tif($savingsBalance[0]['balance']>=$amount){\r\n\t\t\t\treturn True;\r\n\t\t\t}else{\r\n\t\t\t\treturn False;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\treturn False;\r\n\t}\r\n}",
"public function accountBalance() {\n $data = [\n 'Initiator' => $this->initiatorUsername,\n 'SecurityCredential' => $this->securityCredential,\n 'CommandID' => 'AccountBalance',\n 'PartyA' => $this->shortCode,\n 'IdentifierType' => '4',\n 'Remarks' => 'Checking Account Balance',\n 'QueueTimeOutURL' => $this->apiBaseUrl.'/mobilepay/bal/time_out',\n 'ResultURL' => $this->apiBaseUrl.'/mobilepay/bal/result'\n ];\n return $this->remotePostCall('mpesa/accountbalance/v1/query', $data);\n }",
"function cf_cashbank_valid_amount($params)\n\t{\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\t// debug($params);\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$invoice_id = $params->invoice_id;\n\t\t$str = \"SELECT (net_amount - (select coalesce(sum(amount),0) from cf_cashbank_line t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.invoice_id = t1.id $id)) as amount \n\t\t\tfrom cf_invoice t1 where t1.id = $invoice_id\";\n\t\t$row = $this->db->query($str)->row();\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"public function getBalance()\r\n {\r\n return $this->config->post($this->url, [\r\n 'checkbalance' => 1,\r\n 'token' => self::$token\r\n ]);\r\n }",
"public function checkAction()\n {\n $result = $this->_checkBalance();\n $this->getResponse()->setBody($result);\n }",
"function usdt_bal()\n{\n try {\n require_once app_path('jsonRPCClient.php');\n $bitcoin_username = owndecrypt(get_wallet_keydetail('USDT', 'XDC_username'));\n $bitcoin_password = owndecrypt(get_wallet_keydetail('USDT', 'XDC_password'));\n $bitcoin_portnumber = owndecrypt(get_wallet_keydetail('USDT', 'portnumber'));\n $bitcoin_host = owndecrypt(get_wallet_keydetail('USDT', 'host'));\n $bitcoin = new jsonRPCClient(\"http://$bitcoin_username:$bitcoin_password@$bitcoin_host:$bitcoin_portnumber/\");\n\n if ($bitcoin) {\n $address_list = $bitcoin->omni_getwalletbalances();\n $bal = 0;\n if ($address_list) {\n foreach ($address_list as $list) {\n if ($list['propertyid'] == 31) {\n $bal = $list['balance'];\n }\n }\n }\n\n return $bal;\n }\n\n } catch (\\Exception $exception) {\n return 0;\n }\n}",
"public function getBalance();",
"public function getbalance()\n {\n $theAccountBalance = [\"currency\" => \"NGN\", \"balance\"=> 0];\n try {\n $thePaystack = new Paystack();\n $theCurrentAcctBalance = $thePaystack->checkBalance();\n if ( isset($theCurrentAcctBalance['data']) && count($theCurrentAcctBalance['data'])){\n $theAccountBalance = $theCurrentAcctBalance['data'][0];\n }\n } catch (\\Throwable $th) {\n //throw $th;\n return $th;\n }\n\n return $theAccountBalance;\n }",
"public function getbalance(){\n $balance = $this->_run('getbalance');\n return $balance;\n }",
"public function getBalance()\n {\n return $this->ozioma->balance->check();\n }",
"public function balance() : int;",
"function _getBalance()\n {\n $url = 'cmd=account';\n\n $response = $this->_callURL($url);\n\n if (is_a($response, 'PEAR_Error')) {\n return PEAR::raiseError(sprintf(_(\"Send failed. %s\"), $response['error_message']));\n }\n\n if (!array_key_exists('error_code', $response)) {\n return $response['balance'];\n } else {\n return $this->getError($response['error_message'], _(\"Could not check balance. %s\"));\n }\n }",
"public function balance()\n {\n $credit = $this->query->where('type_id', Transaction::TYPE_CREDIT)->sum('amount');\n $debit = $this->query->where('type_id', Transaction::TYPE_DEBIT)->sum('amount');\n return $credit - $debit;\n }",
"public function transferBalance($post)\n {\n $response = array();\n //Get user details By token\n $userData = $this->getUserModel()->getUserByToken($post['token']);\n \n $currentDate = $this->getAppService()->getDate();\n //Check Request\n if ($post['type'] == 'debit') {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n \n if (count($localUserData)) {\n //check account status\n if ($localUserData['accountStatus'] == 'Active') {\n //check request Bal\n if (($localUserData['avaiPurchaseBal'] - $this->signupBal) >= $post['balance']) {\n //generate bal request code\n $transferCodeMatch = true;\n while ($transferCodeMatch == true) {\n \n $transferCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($transferCode);\n if (count($getUserInfo) == 0) {\n $transferCodeMatch = false;\n }\n }\n try {\n //set transfer code\n $updateUserData = array (\n 'balReqCode' => $transferCode,\n 'balReq' => $post['balance']\n );\n $this->getUserModel()->updateUser($localUserData['Id'], $updateUserData);\n \n //set notification message\n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Reject chips : '.$post['balance'].'.Code :'.$transferCode,\n 'date' => $this->getAppService()->getDateTime()\n );\n $this->getNotificationModel()->createNotification($notificationData);\n \n $response['status'] = 'success';\n $response['message'] = 'Transfer code send successfully.';\n $response['bal'] = $userData['avaiTransBal'];\n \n } catch (\\Exception $e) {\n $response['status'] = 'error';\n $response['message'] = 'Something went wrong : Please try agaign.';\n }\n \n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User does not have efficient balance.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getUserByPhoneNo($post['phoneNo']);\n //Transfer credit Balance\n if ($userData['avaiTransBal'] >= $post['balance']) {\n if (count($localUserData) > 0) {\n if ($localUserData['accountStatus'] == 'Active') {\n \n //START TRANSACTION\n $em = $this->getController()->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n try {\n $em->getConnection()->beginTransaction();\n \n //check date records exist if not then create new if Yes then use Id\n $getTicketDate = $this->getTicketDateModel()->getTicketDate($userData['Id'],$currentDate);\n\n if (count($getTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $userData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $userData['avaiTransBal'],\n );\n\n $getDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $dateId = $getDateEntity->Id;\n } else {\n $dateId = $getTicketDate['Id'];\n }\n \n if ($localUserData['userRoll'] == 'local') {\n $localUser = array (\n 'avaiPurchaseBal' => $post['balance'],\n 'totalWinBal' => 0,\n );\n //Update Local user balance.\n $this->getUserModel()->updateUserBal($localUserData['Id'],$localUser);\n \n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Receive chips : '.$post['balance'],\n 'date' => $this->getAppService()->getDateTime()\n ); \n //set notification message\n $this->getNotificationModel()->createNotification($notificationData);\n } else {\n //check date records exist if not then create new if Yes then use Id\n $getLocalTicketDate = $this->getTicketDateModel()->getTicketDate($localUserData['Id'],$currentDate);\n \n if (count($getLocalTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $localUserData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $localUserData['avaiTransBal'],\n );\n\n $getLocalDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $localDateId = $getLocalDateEntity->Id;\n } else {\n $localDateId = $getLocalTicketDate['Id'];\n }\n $localUser = array (\n 'avaiTransBal' => $localUserData['avaiTransBal'] + $post['balance'],\n );\n //Update Local user balance.\n $this->getUserModel()->updateUser($localUserData['Id'],$localUser);\n \n $transactionData = array (\n 'dateId' => $localDateId,\n 'userId' => $userData['Id'],\n 'agentId' => $localUserData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Debit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n }\n \n $agentUser = array (\n 'avaiTransBal' => $userData['avaiTransBal'] - $post['balance'],\n );\n //Update Agent user balance.\n $this->getUserModel()->updateUser($userData['Id'],$agentUser);\n \n $transactionData = array (\n 'dateId' => $dateId,\n 'userId' => $localUserData['Id'],\n 'agentId' => $userData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Credit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n \n $response['status'] = 'success';\n $response['message'] = 'Chips transfer successfully.';\n $response['bal'] = $userData['avaiTransBal'] - $post['balance'];\n\n $em->getConnection()->commit();\n } catch (\\Exception $e) {\n $em->getConnection()->rollback();\n $response['status'] = 'error';\n $response['message'] = $e->getMessage();//'Internal Error. Please try agaign.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = 'you do have not efficient balance.';\n }\n }\n return $response;\n }",
"public function hasBalance()\n {\n return $this->balance !== null;\n }",
"public function askBalance()\n {\n $this->ask('Now about your account, how much you want to deposit?', function (Answer $answer) {\n $this->account_balance = $answer->getText();\n\n $this->askCurrency();\n });\n }",
"public function balance()\n\t{\n\t\treturn $this->curl('/ovo/balance', Constant::HTTP_POST);\n\t}",
"public static function readBalance($db) {\n // Prepares and executes the query.\n $query = \"SELECT SUM(t2.amount) AS balance FROM bills AS t1 LEFT JOIN payments AS t2 ON t1.payment = t2.id WHERE paid=true\";\n $stmt = $db->prepare($query);\n\n // Executes the query. If no record was found return 0. Else update the Attributes of the Bill Object.\n $stmt->execute();\n $count = $stmt->rowCount();\n if($count == 0){\n return 0;\n }\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $balance = $row['balance'];\n\n return $balance;\n }",
"public function getWalletBalance()\n {\n }",
"public function get_balance_amount($bill_id) {\r\n\r\n\t\t$query = $this->db->get_where('bill', array('bill_id' => $bill_id));\r\n\r\n\t\tif ($query->num_rows() > 0){\r\n\r\n\t\t\t$bill = $query->row_array();\r\n\r\n\t\t\t$balance_amount = $bill['due_amount'];\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$balance_amount = 0;\r\n\r\n\t\t}\r\n\r\n\t\treturn $balance_amount;\r\n\r\n\r\n\r\n }",
"public function test_validate_deposit()\n {\n $amount = 5000;\n $deposit = $this->obj->validate_deposit($amount);\n $this->assertLessThanOrEqual(40000,$amount);\n $this->assertTrue($deposit);\n }",
"function kv_bank_balance(){\n $today = Today();\n $today = date2sql($today);\n// $sql = \"SELECT bank_act, bank_account_name, bank_curr_code, SUM(amount) balance FROM \" . TB_PREF . \"bank_trans bt\n// INNER JOIN \" . TB_PREF . \"bank_accounts ba ON bt.bank_act = ba.id WHERE trans_date <= '$today' AND inactive <> 1 GROUP BY bank_act, bank_account_name ORDER BY bank_account_name\";\n\n $sql = \"select b.account_name as bank_account_name,ROUND(sum(amount),2) balance from 0_gl_trans a \nleft join 0_chart_master b on b.account_code = a.account \n inner join 0_bank_accounts c on c.account_code=b.account_code \n where a.tran_date <= '$today' \ngroup by account order by b.account_name limit 10\";\n\n $result = db_query($sql);\n //echo trans(\"Bank Account Balances\");//display_title($title);\n ?>\n <table class=\"table table-hover\">\n <thead class=\"text-warning\">\n <tr>\n <th>Account</th>\n <th style=\"text-align: right;\">Balance</th>\n </tr>\n </thead><?php $k = 0; //row colour counter\n while ($myrow = db_fetch($result)) {\n alt_table_row_color($k);\n label_cell($myrow[\"bank_account_name\"]);\n amount_cell($myrow['balance']);\n end_row();\n }\n end_table(1);\n}",
"function validateMember($member, $shareId, $balance) {\n\t\t$status = 1; // se inicializa el status y luego cambia si entra en las condiciones de bloqueo\n\t\t$message = '';\n\n\t\tif($balance < 0) {\n\t\t\t$balanceStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_SALDO_DEUDOR'); // Archivo config\n\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($balanceStatus,$status);\n\t\t\t$status = $status - $balanceStatus;\n\t\t}\n\n\t\t$records = $this->recordRepository->getBlockedRecord($member);\n\t\tif(count($records)) {\n\t\t\tforeach ($records as $key => $value) {\n\t\t\t\t$recordStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_BLOQUEO_EXPEDIENTE');\n\t\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($recordStatus,$status);\n\t\t\t\t$status = $status - $recordStatus;\n\t\t\t\t$message .= 'Bloqueo activo por expediente :'.$value->id.', hasta la fecha '.$value->expiration_date.'<br>';\n\t\t\t}\n\t\t}\n\n\t\t$share = $this->shareRepository->find($shareId);\n\n\t\tif($share && $share->shareType && $share->shareType()->first()->access == 0) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* La Accion no posee acceso <br>';\n\t\t}\n\n\n\t\tif($share && $share->permit == 1) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* La accion '.$share->share_number.' tiene un permiso activo y no puede ingresar <br>';\n\t\t}\n\t\tif($share->status === 0) {\n\t\t\t$shareStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_ACCION_INACTIVA');\n\t\t\t// $status = $this->accessControlHelper->getAccesControlStatus($shareStatus,$status);\n\t\t\t$status = $status - $shareStatus;\n\t\t\t$message .= '* Accion Inactiva <br>';\n\t\t}\n\n\t\t$personStatus = $this->checkPersonStatus($member);\n\t\tif($personStatus === \"Inactivo\"){\n\t\t\t$personStatus = Config::get('partners.ACCESS_CONTROL_STATUS.SOCIO_INACTIVO');\n\t\t\t// $status = $this->getAccesControlStatus($personStatus,$status);\n\t\t\t$status = $status - $personStatus;\n\t\t\t$message .= '* Socio Inactivo <br>';\n\t\t}\n\t\tif($message !== '') {\n\t\t\t$currentPerson = $this->personModel->query(['name', 'last_name', 'rif_ci', 'card_number'])->where('id', $member)->first();\n\t\t\t$name = '<strong>'.$currentPerson->name.' '.$currentPerson->last_name.'</strong> Carnet: '.$currentPerson->card_number;\n\t\t\t$message = '<br><div><div>'.$name.'</div><div>'.$message.'</div></div>';\n\t\t}\n\t\t// se retorna el mensaje de error y el estatus , estos valores son usados para el registro final de cada miembro\n\t\treturn (object)[ 'message' => $message, 'status' => $status ];\n\t}"
] |
[
"0.7905807",
"0.7766445",
"0.73912644",
"0.7310934",
"0.7189555",
"0.70503175",
"0.69931203",
"0.6900509",
"0.6888066",
"0.688416",
"0.6859427",
"0.6832991",
"0.68174773",
"0.6789373",
"0.6704706",
"0.6674944",
"0.662398",
"0.6622932",
"0.6608864",
"0.6592967",
"0.65906185",
"0.6533495",
"0.6521816",
"0.6444362",
"0.641008",
"0.64050794",
"0.63753617",
"0.63745236",
"0.6369224",
"0.63566905"
] |
0.78098285
|
1
|
standard return object for functions that need to validate parameters and then return a value. The value property is whatever the function will ordinarily return, and should always be set. The msg property is optional, and contains error (e.g. failed validation) or success messages where appropriate
|
function returnValue() {
$return = array(
"value" => null,
"msg" => null
);
return (object) $return;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getReturnedValue();",
"public function validate(){\r\n\t\t// make validation\r\n\t\t$res = Validator::validate( $this->value, $this->constraints );\r\n\t\tif ( !$res )\r\n\t\t\t$this->has_error = true;\r\n\r\n\t\treturn $res;\r\n\t}",
"abstract public function validate($value, Result $result);",
"public function getInvalidValue();",
"public function getErrorMessage();",
"public function getErrorMessage();",
"public function validAndGetErrorMsg() {\r\n require_once 'Samus/Samus_CRUD/Samus_CRUD_RequestValidator.php';\r\n $req = new Samus_CRUD_RequestValidator($this->object);\r\n $req->init();\r\n return $req->result();\r\n }",
"public function checkValue()\r\n\t{\r\n\t\treturn $this->_v('checkValue', 'xsdfsdfdsfdsfsf');\r\n\t}",
"function validate_callback_function($field, $value, $existing_value){\n\t\n\t$error = false;\n\t$value = 'just testing';\n\t/*\n\tdo your validation\n\t\n\tif(something){\n\t\t$value = $value;\n\t}elseif(somthing else){\n\t\t$error = true;\n\t\t$value = $existing_value;\n\t\t$field['msg'] = 'your custom error message';\n\t}\n\t*/\n\t\n\t$return['value'] = $value;\n\tif($error == true){\n\t\t$return['error'] = $field;\n\t}\n\treturn $return;\n\t\n}",
"public function getValidationResult();",
"function validate_callback_function($field, $value, $existing_value){\r\n\t\r\n\t$error = false;\r\n\t$value = 'just testing';\r\n\t/*\r\n\tdo your validation\r\n\t\r\n\tif(something){\r\n\t\t$value = $value;\r\n\t}elseif(somthing else){\r\n\t\t$error = true;\r\n\t\t$value = $existing_value;\r\n\t\t$field['msg'] = 'your custom error message';\r\n\t}\r\n\t*/\r\n\t\r\n\t$return['value'] = $value;\r\n\tif($error == true){\r\n\t\t$return['error'] = $field;\r\n\t}\r\n\treturn $return;\r\n\t\r\n}",
"abstract public function getIsValidValue($value);",
"abstract public function getMsgError();",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"public function test_function() {\n if ($this->authenticationerror) {\n return (object) array('error' => self::AUTH_ERROR);\n } else {\n return (object) array(\n 'error' => self::OK,\n 'moreHelp' => 'No more help available',\n 'pi' => 3.14,\n 'answerToLifeAndEverything' => 42,\n 'oOok' => true\n );\n }\n }",
"abstract function validator();",
"public function validate($value)\n {\n\n $hasError = false;\n $results = array();\n foreach ($this->validators as $key => $validator) {\n if ($value != null) {\n $result = $validator->validate($value);\n $results[$key] = $result;\n if ($result->isValid() == false) {\n $hasError = true;\n }\n } else {\n if ($validator->isRequired() == true) {\n $hasError = true;\n }\n }\n }\n if ($hasError == false) {\n $result = $this->createResult(true, $this->messages['default']);\n } else {\n $result = $this->createResult(false, $this->messages['default']);\n }\n $result->setResults($results);\n\n return $result;\n\n }",
"abstract protected function getValue();",
"public function _validateSubmission($value, $params) {\n $values = $value;\n\n $validator = $this->app->validator->create('string', array('required' => false));\n $text = $validator->clean($values->get('text'));\n $subject = $validator->clean($values->get('subject'));\n $body = $validator->clean($values->get('body'));\n\n $value = $this->app->validator\n\t\t\t\t->create('email', array('required' => $params->get('required')), array('required' => 'Please enter an email address.'))\n\t\t\t\t->clean($values->get('value'));\n\n\t\treturn compact('value', 'text', 'subject', 'body');\n }",
"public function validate(mixed $value): mixed\n {\n if ($this->boolean) {\n if (is_string($value)) {\n $value = Session::stringToBoolean($value);\n\n if ($value === null) {\n throw Exceptional::UnexpectedValue(\n 'Invalid boolean value found for argument: ' . $this->name\n );\n }\n }\n\n if ($value === true) {\n return true;\n } elseif (\n $value === false ||\n $value === null\n ) {\n return false;\n }\n\n return false;\n } else {\n if ($value === null) {\n if (!$this->optional) {\n throw Exceptional::UnexpectedValue(\n 'No value found for argument: ' . $this->name\n );\n } else {\n return $this->defaultValue;\n }\n }\n\n if (\n $this->pattern !== null &&\n !mb_ereg($this->pattern, Coercion::toString($value))\n ) {\n throw Exceptional::UnexpectedValue(\n 'Value does not match pattern for argument: ' . $this->name\n );\n }\n\n return $value;\n }\n }",
"protected function checkValue() {\n if($this->required) {\n if($this->regularExpression) {\n if(preg_match($this->regularExpression, $this->value)) {\n $returnValue = TRUE;\n } else {\n $returnValue = FALSE;\n $this->error = TRUE;\n }\n } elseif($this->callBack) {\n if(call_user_func($this->callBack, $this->value)) {\n $returnValue = TRUE;\n } else {\n $returnValue = FALSE;\n $this->error = TRUE;\n }\n } elseif(!(bool)$this->value) {\n $returnValue = FALSE;\n } else {\n $returnValue = TRUE;\n }\n } else {\n $returnValue = TRUE;\n }\n\n return $returnValue;\n }",
"public function getReturnVal()\n {\n return $this->return_value;\n }",
"abstract protected function validateValue($value);",
"public function checkRequired($value,$messages) {\r\n if($value==\"\")\r\n return $messages;\r\n }",
"function summary(&$values) {\n $erroneousField = NULL;\n $response = $this->setActiveFieldValues($values, $erroneousField);\n $errorRequired = FALSE;\n $missingField = '';\n $this->_params = &$this->getActiveFieldParams();\n\n foreach ($this->_requiredFields as $requiredField) {\n if(empty($this->_params['id']) && empty($this->_params[$requiredField])) {\n $errorRequired = TRUE;\n $missingField .= ' ' . $requiredField;\n CRM_Contact_Import_Parser_Contact::addToErrorMsg($this->_entity, $requiredField);\n }\n }\n\n if ($errorRequired) {\n array_unshift($values, ts('Missing required field(s) :') . $missingField);\n return CRM_Import_Parser::ERROR;\n }\n\n $errorMessage = NULL;\n //@todo add a validate fn to the apis so that we can dry run against them to check\n // pseudoconstants\n if ($errorMessage) {\n $tempMsg = \"Invalid value for field(s) : $errorMessage\";\n array_unshift($values, $tempMsg);\n $errorMessage = NULL;\n return CRM_Import_Parser::ERROR;\n }\n return CRM_Import_Parser::VALID;\n }",
"public function getValue(): mixed;",
"public function getValue(): mixed;"
] |
[
"0.62400067",
"0.6088036",
"0.60677207",
"0.60036135",
"0.59968567",
"0.59968567",
"0.5977556",
"0.5911403",
"0.5905566",
"0.59006",
"0.5897033",
"0.58928365",
"0.5741645",
"0.57213855",
"0.57213855",
"0.57213855",
"0.57213855",
"0.5660931",
"0.560876",
"0.554426",
"0.55388534",
"0.5537816",
"0.55372494",
"0.5522384",
"0.5490943",
"0.54883355",
"0.5481532",
"0.5477382",
"0.54748523",
"0.54748523"
] |
0.65595526
|
0
|
select a user by ID
|
function selectUser($id) {
$connection = openDb();
$id = (int) $id;
//Using prepared statements and parameterized queries:
$sql = "SELECT * FROM users_view WHERE ID = ?";
$stmt = $connection->stmt_init();
if(!$stmt->prepare($sql)) {
return false;
}
$stmt->bind_param("i",$id);
return executeQueryPrepared($stmt, $connection, true);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }",
"public function selectUserById($id){\r\n //2 prepare la requete\r\n $stmt=$connexion->prepare(\r\n \"SELECT *\r\n FROM User\r\n WHERE id=:id\"\r\n );\r\n //3 execute la requete\r\n $stmt->execute(\r\n array('id'=>$id)\r\n );\r\n // 4 Recuperation resultat et stockage ds variable\r\n $user=$stmt->fetchObject('User');\r\n // 5 retourne la variable (reslutat)\r\n return $user;\r\n }",
"public function selectUserbyId($ID)\n {\n\n $this->result = @$this->dbConnection->query(\"SELECT * FROM Users WHERE UserId = '$ID' \");\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n }",
"function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }",
"public function getUser($id);",
"public function getUserById($id) {\n\t\t\n\t}",
"abstract public function fetchUserById($id);",
"public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }",
"public function selectViaId($id){\n$sql = \"SELECT id, login, email, password, id_droits FROM utilisateurs WHERE id = :id\";\n$stmt = $this->pdo->prepare($sql);\n$stmt->execute([\n 'id' => $id\n]);\n$userid = $stmt->fetch(PDO::FETCH_ASSOC);\nif(!$userid)\n{\n return false;\n}\n else\n {\n return $userid;\n }\n}",
"function selectAccountByUserId($id) {\n $connection = openDb();\n $id = escape($id,$connection);\n $id = (int) $id;\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM accounts WHERE USER = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}",
"public function selectById($id);",
"public function selectById($id);",
"public function getUserById($id)\n {\n\t $result = $this->getUserDbTable()->select()\n \t\t\t\t\t\t\t\t\t ->where('user_id = ?', (int)$id, 'INT')\n \t\t\t\t\t\t\t\t\t ->query()->fetch();\n \tif($result) return $result;\n }",
"public function selectById($id)\n {\n $db = $this->database->connect();\n $statement = $db->prepare(\"SELECT * FROM users WHERE id = :id\");\n $statement->bindParam(':id', $id);\n $statement->execute();\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n return new User(\n $result['first_name'],\n $result['last_name'],\n $result['username'],\n $result['password']\n );\n }",
"function findUser($id) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"SELECT * FROM user WHERE _user_Id = ?;\";\n $q = $conn->prepare($sql);\n $q->execute(array($id));\n $user = $q->fetchObject('\\App\\User');\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n\n return $user;\n }",
"public function getUser($id = null);",
"public function getUserById($id){\n $query = $this->db->get_where('user', array('k_id_user' => $id));\n return $query->row();\n }",
"public function SelectUserId($con,$id){\n $command = \"SELECT * from user_ WHERE id = '$id' \";\n $result = mysqli_query($con,$command);\n $row = mysqli_fetch_row($result);\n return $row;\n }",
"public function SelectUserById($id)\r\n {\r\n $result = $this->customPDO->SelectSingleRow('users', 'WHERE User_Id = ' . $id);\r\n return new UserWrapper($result);\r\n }",
"function getUserId($user_name){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_username='$user_name'\", 'user_id');\n}",
"public function user($id)\n {\n return $this->where('user_id', $id);\n }",
"public function findById($id){\n $user = $this->DB->query(\"SELECT u.* FROM user u WHERE u.id = $id\")->fetch(PDO::FETCH_ASSOC);\n return $user;\n }",
"public function findUserById()\n {\n $this->db->query('SELECT * FROM user WHERE id = :id');\n $this->db->bind(':id', $_SESSION['id']);\n \n $row = $this->db->single();\n \n return $row; \n }",
"protected function select() {\n\t\t// Validate.\n\t\tif (!$this->validateForm()) {\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\t\tnonce_generate();\n\n\t\t// Get user.\n\t\t$user = $this->Users->get((int) $_POST['user_id']);\n\n\t\t// Send to error page when user doesn't exist.\n\t\tif (empty($user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Forward to the user edit page.\n\t\tredirect(ABSURL . 'management/users/edit/' . $user['username']);\n\t}",
"public function getUserById($id){\n $this->db->query('SELECT * FROM users WHERE us_id = :id');\n // Bind values\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n\n }",
"function find_selected_user() {\n\tglobal $selectedUser;\t\n\tif (isset($_GET[\"id\"])) {\n\t\t$userId=(int) ($_GET[\"id\"]);\n\t\t$selectedUser=get_user($userId);\n\t\t$_SESSION[\"id\"]=$userId;\n\t\tif(!$selectedUser) {\n\t\t\terror_log(\"find_selected_user: selected user not found for user_id=\".$userId,0);\n\t\t}\n\t} elseif (isset($_SESSION[\"id\"])) {\n\t\t$userId=(int) ($_SESSION[\"id\"]);\n\t\t$selectedUser=get_user($userId);\n\t\tif(!$selectedUser) {\n\t\t\terror_log(\"find_selected_user: selected user not found for user_id=\".$userId,0);\n\t\t}\n\t}\telse $selectedUser=null;\t\n}",
"function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}",
"function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}",
"function find_user($user_id) {\n global $db;\n $sql = \"SELECT * FROM users WHERE id = :user_id;\";\n $params = array(\n ':user_id' => $user_id\n );\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($records) {\n // user_id is a unique field, so only 1 record should be selected.\n return $records[0];\n }\n // if nothing is returned earlier, then return NULL\n return NULL;\n}",
"public static function get_user($user_id);"
] |
[
"0.77708954",
"0.75158393",
"0.74531996",
"0.7376245",
"0.7363985",
"0.7294908",
"0.7284252",
"0.72501427",
"0.7233375",
"0.7204514",
"0.715932",
"0.715932",
"0.7108903",
"0.705682",
"0.705676",
"0.7038046",
"0.70080334",
"0.700467",
"0.70042306",
"0.70039237",
"0.69997346",
"0.69950527",
"0.69917774",
"0.69864476",
"0.6985682",
"0.69853204",
"0.6963768",
"0.6963758",
"0.6953377",
"0.69522786"
] |
0.76145726
|
1
|
Update account balance of the sender/recipient during a transaction
|
function updateBalance($sender, $recipient, $amount) {
$senderBalance = selectAccountById($sender)->BALANCE;
$recipientBalance = selectAccountById($recipient)->BALANCE;
$newSenderBalance = $senderBalance - $amount;
$newRecipientbalance = $recipientBalance + $amount;
$connection = openDb();
//Using prepared statements and parameterized queries:
$sql = "UPDATE accounts SET BALANCE = ? WHERE ID = ?";
$stmt = $connection->stmt_init();
if(!$stmt->prepare($sql)) {
return false;
}
$stmt->bind_param("di",$newSenderBalance,$sender);
if (!executeNonQuery($stmt, $connection)) {
return false;
}
$connection = openDb();
//Using prepared statements and parameterized queries:
$sql = "UPDATE accounts SET BALANCE = ? WHERE ID = ?";
$stmt = $connection->stmt_init();
if(!$stmt->prepare($sql)) {
return false;
}
$stmt->bind_param("ss",$newRecipientbalance,$recipient);
return executeNonQuery($stmt, $connection);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function UpdateAccountBalances () \r\n {\r\n $table = \"BALANCE\";\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove old ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"CREATE TEMPORARY TABLE ${table} SELECT ReceiptID AS AccountID, SUM(Total) As Receipts, (0) AS Payments FROM Transaction GROUP BY ReceiptID ORDER BY ReceiptID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"INSERT INTO ${table} SELECT PaymentID AS AccountID, (0) AS Receipts, SUM(Total) AS Payments FROM Transaction GROUP BY PaymentID ORDER BY PaymentID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account SET Receipts=(0.00), Payments=(0.00), Balance=(0.00)\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't clear Account table balances\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Receipts=${table}.Receipts\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Payments=${table}.Payments\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove new ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n return (true);\r\n }",
"private function updateBalance()\n {\n if (!auth()->user()->hasRole('admin')) {\n auth()->user()->update([\n 'credit' => auth()->user()->credit - $this->totalCost()\n ]);\n }\n }",
"public function update($amount)\n {\n $currentBalance = auth()->user()->balance->amount;\n $newAmount = $currentBalance + $amount;\n auth()->user()->balance()->update(['amount' => $newAmount]);\n }",
"private function updateWallet ($vendor, $transaction) {\n $commission = $this->calculateCommission($transaction->type, $vendor->user_id, $transaction->amount);\n $distCommission = $this->calculateCommission($transaction->type, $vendor->parent_id, $transaction->amount);\n $superDistId = Vendor::where('user_id', $vendor->parent_id)->first()->parent_id;\n $superDistCommission = $this->calculateCommission($transaction->type, $superDistId, $transaction->amount);\n\n\n // Perform Wallet Updations for Amount Transacted\n if ($transaction->type == 1 || $transaction->type == 2) {\n $vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $vendor->balance\n ]);\n\n $key = $transaction->type == 1 ? 'debit_id' : ($transaction->type == 2 ? 'credit_id' : '');\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n $dipl_vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $dipl_vendor->save();\n $dipl_amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $dipl_vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $dipl_vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $dipl_vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $dipl_amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n }\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n\n // Perform Wallet Updations for Commission\n if ($commission && $dipl_vendor->commission && $vendor->commission) {\n if ($commission['rate_type'] == 1)\n $vendor->balance += $commission['rate'];\n if ($commission['rate_type'] == 2)\n $vendor->balance += $transaction->amount * $commission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => 1,\n 'amount' => $commission['rate'],\n 'balance' => $vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $commission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n\n if ($distCommission && $dipl_vendor->commission) {\n $distributor = Vendor::where('user_id', $vendor->parent_id)->lockForUpdate()->first();\n if ($distributor && $distributor->commission == 1) {\n if ($distCommission['rate_type'] == 1)\n $distributor->balance += $distCommission['rate'];\n if ($distCommission['rate_type'] == 2)\n $distributor->balance += $transaction->amount * $distCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $distributor->id,\n 'transaction_type' => 1,\n 'amount' => $distCommission['rate'],\n 'balance' => $distributor->balance\n ]);\n\n $distributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $distributor->id,\n 'amount' => $distCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n } \n }\n\n if ($superDistCommission && $dipl_vendor->commission) {\n $superDistributor = Vendor::where('user_id', $superDistId)->lockForUpdate()->first();\n if ($superDistributor && $superDistributor->commission == 1) {\n if ($superDistCommission['rate_type'] == 1)\n $superDistributor->balance += $superDistCommission['rate'];\n if ($superDistCommission['rate_type'] == 2)\n $superDistributor->balance += $transaction->amount * $superDistCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $superDistributor->id,\n 'transaction_type' => 1,\n 'amount' => $superDistCommission['rate'],\n 'balance' => $superDistributor->balance\n ]);\n\n $superDistributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $superDistributor->id,\n 'amount' => $superDistCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n \n }\n\n return $vendor->balance;\n }",
"function transfer($details,$fromAccount=true){\n\t\n\t// The sending account and the database:\n\tglobal $verifiedAccount,$dz;\n\t\n\tif(!isset($details['ToAddress'])){\n\t\t\n\t\t// Get an address for the username (inline updates details):\n\t\tgetAddress($details);\n\t\t\n\t}\n\t\n\t// Get the commodity:\n\t$commodity=$details['Commodity'];\n\t\n\t// The amount too:\n\t$amount=$details['Amount'];\n\t\n\t// Get the to address:\n\t$toAddress=$details['ToAddress'];\n\t\n\t// Is this an internal transfer? (I.e. within this same bank):\n\t$internalTransfer=(!$toAddress);\n\t\n\t$balance=null;\n\t\n\t// Is it coming from the bank itself, or from an account?\n\tif($fromAccount){\n\t\t\n\t\t// Find a suitable 'from' balance.\n\t\t// (There should only ever be one. Just in case though, we don't want to lock more than one row):\n\t\t$balance=$dz->get_row('select `ID` from `Bank.Account.Balances` where `Account`='.$verifiedAccount.' and `Commodity`=\"'.$commodity.'\" and `Amount`>='.$amount);\n\t\t\n\t\tif(!$balance){\n\t\t\t\n\t\t\t// Not enough funds in the right currency.\n\t\t\terror('account/nofunds');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Lock the amount in that balance row.\n\t\t// If a locked amount is present at startup then a crash occured during a transaction.\n\t\t// If it's severe, the balances can be rebuilt from the transaction history.\n\t\t$locked=$dz->query(\n\t\t\t'update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`+'.$amount.\n\t\t\t',`Amount`=`Amount`-'.$amount.' where `ID`='.$balance['ID'].' and `Amount`>='.$amount\n\t\t);\n\t\t\n\t\t// Did we successfully lock?\n\t\tif(!$locked){\n\t\t\t\n\t\t\t// Not enough funds in the right currency.\n\t\t\terror('account/nofunds');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Ok! We've locked the balance.\n\t\t\t\n\t\t// Create a transaction row:\n\t\t$dz->query(\n\t\t\t'insert into `Bank.Transactions`(`Account`,`Type`,`Reference`,`ItemInformation`,`Amount`,`Commodity`,`Username`,`Title`,`TimeAt`,`Name`) values('.\n\t\t\t$verifiedAccount.',2,\"'.escape($details['Reference'],false).'\",\"'.escape($details['ItemInformation'],false).'\",'.$amount.',\"'.$commodity.'\",\"'.$details['Username'].'\",\"'.escape($details['Title'],false).'\",'.time().',\"'.escape($details['Name'],false).'\")');\n\t\t\n\t}\n\t\n\tif($internalTransfer){\n\t\t\n\t\t// It's an internal transaction.\n\t\t// Name needs to be changed first (it's the name of the sender, which we don't know at this point):\n\t\t$details['Name']='';\n\t\t\n\t\t// Update the receiving account:\n\t\treceive($details);\n\t\t\n\t}else{\n\t\t\n\t\t// Interbank transfer.\n\t\t// Need to select some suitable balances to use to send with.\n\t\t// For now, we'll just assume that a single balance can be found that has enough in it:\n\t\t$balanceRow=$dz->get_row('select `Bank.Balances`.`Key`,`Bank.Balances`.`Private`,`Root.Balances`.`Balance` from `Bank.Balances` left join `Root.Balances` on `Root.Balances`.`Key`=`Bank.Balances`.`Key` where `Root.Balances`.`Commodity`=\"'.$commodity.'\" and `Root.Balances`.`Balance`>='.$amount);\n\t\t\n\t\tif(!$balanceRow){\n\t\t\t// This bank doesn't have a single balance with enough funds in it.\n\t\t\t// A more advanced implementation would combine multiple balances to ensure there's enough.\n\t\t\t// For now though, and to avoid making the consumer freak out, we'll just say the transaction amount is too high:\n\t\t\terror('amount/toohigh');\n\t\t}\n\t\t\n\t\t// Get the from address:\n\t\t$fromAddress=bin2hex($balanceRow['Key']);\n\t\t\n\t\t// Get the target group:\n\t\t$toGroup=$details['ToGroup'];\n\t\t\n\t\tif(strlen($toAddress)!=130){\n\t\t\t\n\t\t\t// It's binary.\n\t\t\t$toAddress=bin2hex($toAddress);\n\t\t\t\n\t\t}\n\t\t\n\t\t// Perform a global transfer now:\n\t\tglobalTransfer($fromAddress,$toAddress,$toGroup,$amount,$balanceRow['Balance'],$balanceRow['Private']);\n\t\t\n\t}\n\t\n\t// Success!\n\t\n\tif($balance){\n\t\n\t\t// Now unlock the amount in the sender:\n\t\t$dz->query(\n\t\t\t'update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`-'.$amount.\n\t\t\t' where ID='.$balance['ID']\n\t\t);\n\t\n\t}\n\t\n}",
"function deposit($amount) {\n $this->balance += $amount;\n }",
"public function updated(Transaction $transaction)\n {\n if ($transaction->is_complete) {\n $paymentPlan = $transaction->payment_plan;\n $points = $paymentPlan->apply_bonus ? $paymentPlan->priceWithBonus : $paymentPlan->price;\n $currentBalance = $transaction->user()->first()->balance()->first();\n $currentBalance->update(['points' => $points + $currentBalance->points]);\n }\n }",
"private static function logTransactionUpdateBalance($userId,$transactionType,$amount){\n if($transactionType != 'charge'){\n // Update User Balance\n $User = User::where('id',$userId)->select('id','balance')->first();\n if($transactionType == 'withdraw'){\n $User->balance = $User->balance - $amount;\n }\n if(in_array($transactionType,['refund','profit'])){\n $User->balance = $User->balance + $amount;\n }\n if($User->balance < 0){\n $User->balance = 0;\n }\n $User->save();\n }\n }",
"function updateBalance($balance){\r\n //$db = new Database();\r\n // $conn = $db->getConnect();\r\n \r\n //run query to get balance\r\n $sql = \"UPDATE `SAVING` SET BALANCE= $balance\";\r\n $result = $this->conn->query($sql);\r\n \r\n if ($result){ \r\n //update successful\r\n //$conn->close();\r\n return 1;\r\n }\r\n else{\r\n // update failed\r\n //$conn->close();\r\n return 0;\r\n }\r\n }",
"public function transfer_to(Request $request, $customer_sender_id)\n {\n\n $customer = DB::select('SELECT * FROM customers WHERE id = ?', [$customer_sender_id]);\n\n //\n $rules = [\n\t\t\t'amount' => 'required|numeric|max:'.$customer[0]->balance,\n\t\t\t'recipient_customer_id' => 'required|numeric'\n\t\t];\n\n\t\t$validator = Validator::make($request->all(), $rules);\n\t\tif ($validator->fails()) {\n\t\t\treturn redirect()->back()->withErrors($validator)->withInput();\n\t\t};\n\n\n\n\n\n // If it gets validated correcty\n $transaction_id = DB::insert('INSERT INTO `transfers` \n (`sender_id`, `receiver_id`, `amount`)\n VALUES \n (?, ?, ?)', [\n $customer_sender_id, $request->recipient_customer_id, $request->amount\n ]);\n\n // if the transaction is successful\n if ($transaction_id > 0) {\n // SENDER gets amount SUBSTRACTED\n DB::update('UPDATE `customers` \n SET\n `balance` = `balance`-?\n WHERE `id` = ?', [\n $request->amount,\n $customer_sender_id\n ]);\n\n // RECIPIENT gets amount ADDED\n DB::update('UPDATE `customers` \n SET\n `balance` = `balance`+?\n WHERE `id` = ?', [\n $request->amount,\n $request->recipient_customer_id\n ]);\n }\n\n return redirect()->back()->with('message', 'Transaction finished successfully');\n }",
"public function update(Request $request, Debt $debt)\n {\n\n\n if ($request->type == 'credit') {\n if ($request->account_id != $debt->account_id) {\n $prev_account = Account::find($debt->account_id);\n $prev_account->total_sum = $prev_account->total_sum + $debt->total_sum;\n $prev_account->save();\n\n $curr_account = Account::find($request->account_id);\n $curr_account->total_sum = $curr_account->total_sum - $request->total_sum;\n $curr_account->save();\n } else {\n $curr_account = Account::find($request->account_id);\n $curr_account->total_sum = $curr_account->total_sum - $request->total_sum;\n $curr_account->save();\n }\n }else {\n if ($request->account_id != $debt->account_id) {\n $prev_account = Account::find($debt->account_id);\n $prev_account->total_sum = $prev_account->total_sum - $debt->total_sum;\n $prev_account->save();\n\n $curr_account = Account::find($request->account_id);\n $curr_account->total_sum = $curr_account->total_sum + $request->total_sum;\n $curr_account->save();\n } else {\n $curr_account = Account::find($request->account_id);\n $curr_account->total_sum = $curr_account->total_sum + $request->total_sum;\n $curr_account->save();\n }\n }\n\n $debt->account_id = $request->account_id;\n $debt->total_sum = $request->total_sum;\n $debt->type = $request->type;\n $debt->currency = $request->currency;\n $debt->agent_id = $request->agent_id;\n $debt->comment = $request->comment;\n\n $debt->save();\n\n return redirect('debts');\n\n }",
"public function processTransfer($fromAccount, $toAccount, $amount)\n {\n $dbTransaction = $this->db->beginTransaction();\n\n $transaction = new PaymentTransaction();\n $transaction->save();\n\n $debetPayment = new Payment();\n $debetPayment->transaction_id = $transaction->id;\n $debetPayment->account_id = $fromAccount->id;\n $debetPayment->type_id = PaymentType::DEBET;\n $debetPayment->amount = $amount;\n $debetPayment->save();\n\n $creditPayment = new Payment();\n $creditPayment->transaction_id = $transaction->id;\n $creditPayment->account_id = $toAccount->id;\n $creditPayment->type_id = PaymentType::CREDIT;\n $creditPayment->amount = $amount;\n $creditPayment->save();\n\n // perform addition via database because in application decimal values will be converted to float\n\n $this->db->createCommand()->update(\n $fromAccount->tableName(),\n ['amount' => new DbExpression('amount - :amount')],\n ['id' => $fromAccount->id],\n [':amount' => $amount]\n )->execute();\n\n $this->db->createCommand()->update(\n $toAccount->tableName(),\n ['amount' => new DbExpression('amount + :amount')],\n ['id' => $toAccount->id],\n [':amount' => $amount]\n )->execute();\n\n $fromAccount->refresh();\n $toAccount->refresh();\n\n $this->state_id = TransferState::ACCEPTED;\n $this->save();\n\n $dbTransaction->commit();\n }",
"function deposit($connection,$amount,$accno){\r\n try {\r\n $connection->beginTransaction();\r\n\r\n $accno = $_SESSION['accno'];\r\n $sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n\r\n\r\n $final_bal = $amount + Services::getforAccountsBalance($connection,$accno);\r\n //do not deposit to self\r\n if($accno ==$_SESSION['accno']){\r\n return false;\r\n };\r\n //update balance\r\n $statement->execute(array(':balance' => $final_bal,':account'=>$accno));\r\n\r\n if($statement->rowCount()<1){\r\n return false;\r\n }\r\n //update transaction history\r\n $insert_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,\r\n balance) VALUES(:accno,:date,:debit,:credit,:balance)\";\r\n $stmt = $connection->prepare($insert_sql);\r\n $stmt->execute(array(':accno'=>$accno,':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$amount,':balance'=>$final_bal));\r\n //$stmt = $connection->prepare($insert_sql);\r\n // if($stmt->rowCount()<1){\r\n // echo \"Insert failed\";\r\n // }else{\r\n // echo \"string\";\r\n // }\r\n $connection->commit();\r\n return true;\r\n } catch (Exception $e) {\r\n\r\n $connection->rollBack();\r\n return false;\r\n }\r\n\r\n }",
"public function updateAccountBalance($amount)\n {\n return $amount == 0 ? $this : $this->saveNewBalance($amount);\n }",
"public function deposit($amount)\n {\n $this->balance += $amount;\n $this->save();\n }",
"public function submit_transfer(Request $request) {\n $receiver = User::where('account_number', $request->account)->first();\n $sender = User::where('id', Auth::id())->first();\n $txnId = 'TRF/'. date('ymd') . '/' .Str::upper(Str::random(10));\n $min = Config::get('minimum_transfer', 100);\n\n if ($sender->balance < $request->amount) {\n return redirect()->back()->with('fail', 'Insufficient balance to complete this transaction');\n }\n\n if ($min > $request->amount) {\n return redirect()->back()->with('fail', \"Minimum amount to transfer is equivalent of $$min\");\n }\n\n // Check for valid user\n if (!$receiver) {\n return redirect()->back()->with('fail', 'Please provide a valid user account number');\n }\n\n // Compare user currency type\n if ($receiver->account_type != $request->currency) {\n return redirect()->back()\n ->with('fail', \"Receiver's account does not support currency type: $request->currency\");\n }\n\n $receiverTxnData['account_name'] = $sender->fullName;\n $receiverTxnData['account_number'] = $sender->account_number;\n $receiverTxnData['txnId'] = $txnId;\n $receiverTxnData['type'] = 'Credit';\n $receiverTxnData['amount'] = $request->amount;\n $receiverTxnData['currency'] = $request->currency;\n $receiverTxnData['status'] = 'SUCCESSFUL';\n\n $senderTxnData['account_name'] = $receiver->fullName;\n $senderTxnData['account_number'] = $receiver->account_number;\n $senderTxnData['txnId'] = $txnId;\n $senderTxnData['type'] = 'Debit';\n $senderTxnData['amount'] = $request->amount;\n $senderTxnData['currency'] = $request->currency;\n $senderTxnData['status'] = 'SUCCESSFUL';\n\n DB::transaction(function () use ($receiver, $sender, $request, $receiverTxnData, $senderTxnData) {\n $sender->balance -= $request->amount;\n $sender->transactions()->create($senderTxnData);\n $sender->save();\n\n $receiver->balance += $request->amount;\n $receiver->transactions()->create($receiverTxnData);\n $receiver->save();\n });\n\n return redirect()->route('user.dashboard')->with('success', 'Transaction was successful');\n }",
"function update_money($account,$total_money,$input_money){\n\t\t$total_money -= $input_money;\n\t\tglobal $connection;\n\t\t$query_mn = mysqli_query($connection,\"UPDATE khachhang SET `money`=$total_money WHERE account='$account'\" );\n\t\treturn $total_money;\n\t}",
"function _updateTransaction($ItemUser)\r\n {\r\n //add amount to wallet\r\n $data['Transaction']['user_id'] = $ItemUser['user_id'];\r\n $data['Transaction']['foreign_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['class'] = 'SecondUser';\r\n $data['Transaction']['amount'] = $ItemUser['discount_amount'];\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AddedToWallet;\r\n $data['Transaction']['payment_gateway_id'] = $ItemUser['payment_gateway_id'];\r\n $transaction_id = $this->User->Transaction->log($data);\r\n if (!empty($transaction_id)) {\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $ItemUser['discount_amount']\r\n ) , array(\r\n 'User.id' => $ItemUser['user_id']\r\n ));\r\n }\r\n //Buy item transaction\r\n $transaction['Transaction']['user_id'] = $ItemUser['user_id'];\r\n $transaction['Transaction']['foreign_id'] = $ItemUser['id'];\r\n $transaction['Transaction']['class'] = 'ItemUser';\r\n $transaction['Transaction']['amount'] = $ItemUser['discount_amount'];\r\n $transaction['Transaction']['transaction_type_id'] = (!empty($ItemUser['is_gift'])) ? ConstTransactionTypes::ItemGift : ConstTransactionTypes::BuyItem;\r\n $transaction['Transaction']['payment_gateway_id'] = $ItemUser['payment_gateway_id'];\r\n if (!empty($ItemUser['rate'])) {\r\n $transaction['Transaction']['currency_id'] = $ItemUser['currency_id'];\r\n $transaction['Transaction']['converted_currency_id'] = $ItemUser['converted_currency_id'];\r\n $transaction['Transaction']['converted_amount'] = $ItemUser['authorize_amt'];\r\n $transaction['Transaction']['rate'] = $ItemUser['rate'];\r\n }\r\n $this->User->Transaction->log($transaction);\r\n //user update\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount -' . $ItemUser['discount_amount']\r\n ) , array(\r\n 'User.id' => $ItemUser['user_id']\r\n ));\r\n }",
"function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}",
"public function UpdateAccountBalance ($AccountID) \r\n {\r\n Balance::Event (\"Updating Balance for Account ${AccountID}.\", \"\");\r\n if (!is_integer($AccountID)) \r\n {\r\n Balance::Error (\"Can't update Balance for Account '${AccountID}'\", \"Key must be integer.\");\r\n return (false);\r\n }\r\n $Receipts = Balance::Receipts($AccountID);\r\n $Payments = Balance::Payments($AccountID);\r\n $query = \"UPDATE Account SET Receipts=(${Receipts}), Payments=(${Payments}), Balance=((${Receipts})-(${Payments})) WHERE ID=(${AccountID})\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Balance for Account '${AccountID}'\");\r\n return (false);\r\n }\r\n return (true);\r\n }",
"public function update_party_balance($party_id = null, $transaction_type = 'entry', $medium = 0, $amount = 0)\n {\n //convert amount to positive\n\n $amount = abs($amount);\n $party_current_balance = $company_current_balance = 0;\n\n //update client / party account if needed\n if ($transaction_type == 'entry' || $transaction_type == 'return') {\n $party_sql = sprintf(\"SELECT balance FROM ac_balance WHERE idparty = %d AND medium = %d\", $party_id, $medium);\n $party_current_balance = $this->get_custom_select_query($party_sql, 1, true);\n }\n\n $company_sql = sprintf(\"SELECT balance FROM ac_balance WHERE idparty = %d AND medium = %d\", BALANCE, $medium);\n $company_current_balance = $this->get_custom_select_query($company_sql, 1, true);\n\n if ($transaction_type == 'entry' || $transaction_type == 'return') {\n $party_current_balance = $party_current_balance[0]['balance'];\n }\n\n $company_current_balance = $company_current_balance[0]['balance'];\n\n switch ($transaction_type) {\n case 'entry' :\n {\n $party_current_balance -= $amount;\n $company_current_balance += $amount;\n break;\n }\n case 'return' :\n {\n $party_current_balance += $amount;\n $company_current_balance -= $amount;\n break;\n }\n case 'invest' :\n {\n $company_current_balance += $amount;\n break;\n }\n case 'draw' :\n {\n $company_current_balance -= $amount;\n break;\n }\n\n default:\n {\n $company_current_balance += $amount;\n }\n }\n\n //update company account\n $flag = $this->update_column('ac_balance', array('balance'), array($company_current_balance), array('f'), \"\", \"\", \"\", \"idparty=\" . BALANCE . \" AND medium = $medium\");\n\n //update client / party account if needed\n if ($flag == 1 && ($transaction_type == 'entry' || $transaction_type == 'return')) {\n $flag = $this->update_column('ac_balance', array('balance'), array($party_current_balance), array('f'), \"\", \"\", \"\", \"idparty=\" . $party_id . \" AND medium = $medium\");\n }\n\n return ($flag == 1) ? true : false;\n }",
"public function balance($table, $parameters = array()) {\n\t\t\t$response = array(\n\t\t\t\t'message' => array(\n\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t'text' => ($defaultMessage = 'Error adding balance amount to your account, please try again.')\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['data']['balance']) &&\n\t\t\t\t!empty($parameters['user']['id'])\n\t\t\t) {\n\t\t\t\t$response['message']['text'] = 'Invalid account balance amount, please try again.';\n\t\t\t\t$balanceData = $this->fetch('products', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'type' => 'balance'\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'id',\n\t\t\t\t\t\t'minimum_quantity',\n\t\t\t\t\t\t'maximum_quantity',\n\t\t\t\t\t\t'type'\n\t\t\t\t\t),\n\t\t\t\t\t'limit' => 1,\n\t\t\t\t\t'sort' => array(\n\t\t\t\t\t\t'field' => 'modified',\n\t\t\t\t\t\t'order' => 'DESC'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (\n\t\t\t\t\t!empty($balanceData['count']) &&\n\t\t\t\t\tis_numeric($parameters['data']['balance'])\n\t\t\t\t) {\n\t\t\t\t\t$response['message']['text'] = 'Balance amount added must be <strong>less than ' . number_format($balanceData['data'][0]['maximum_quantity'], 2, '.', ',') . ' ' . $this->settings['billing']['currency'] . '</strong> and <strong>greater than ' . number_format($balanceData['data'][0]['minimum_quantity'], 2, '.', ',') . ' ' . $this->settings['billing']['currency'] . '</strong>, please try again.';\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t$parameters['data']['balance'] < $balanceData['data'][0]['maximum_quantity'] &&\n\t\t\t\t\t\t$parameters['data']['balance'] > $balanceData['data'][0]['minimum_quantity']\n\t\t\t\t\t) {\n\t\t\t\t\t\t$response['message']['text'] = $defaultMessage;\n\t\t\t\t\t\t$invoiceConditions = array(\n\t\t\t\t\t\t\t'cart_items' => sha1($parameters['data']['balance'] . uniqid() . time()),\n\t\t\t\t\t\t\t'status' => 'unpaid',\n\t\t\t\t\t\t\t'subtotal' => $parameters['data']['balance'],\n\t\t\t\t\t\t\t'total' => $parameters['data']['balance'],\n\t\t\t\t\t\t\t'user_id' => $parameters['user']['id']\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$invoiceData = array(\n\t\t\t\t\t\t\t$invoiceConditions\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ($this->save('invoices', $invoiceData)) {\n\t\t\t\t\t\t\t$invoice = $this->fetch('invoices', array(\n\t\t\t\t\t\t\t\t'conditions' => $invoiceConditions,\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($invoice['count'])) {\n\t\t\t\t\t\t\t\t$response = array(\n\t\t\t\t\t\t\t\t\t'message' => array(\n\t\t\t\t\t\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t\t\t\t\t\t'text' => 'Invoice for balance payment created successfully.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'redirect' => $this->settings['base_url'] . 'invoices/' . $invoice['data'][0] . '#payment'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $response;\n\t\t}",
"function withdrawal($account, $amount, $id_user) {\r\n\r\n //Crear la conexión\r\n $base = conection();\r\n\r\n //Verificar que el usuario tenga disponible ese dinero\r\n $sql = \"SELECT balance, pending FROM users WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result = $base->prepare($sql);\r\n\r\n //Ejecutar consulta\r\n $result->execute(array(\":id_user\"=>$id_user));\r\n\r\n //Contar registros encontrados\r\n $count = $result->rowCount();\r\n \r\n //Verificar si se ingresó el registro\r\n if ($count > 0) {\r\n\r\n while ($row=$result->fetch(PDO::FETCH_ASSOC)) {\r\n $balance = $row[\"balance\"];\r\n $pending = $row[\"pending\"];\r\n }\r\n\r\n if ($balance >= $amount) {\r\n\r\n //Restamos el dienro al usuario\r\n $new_balance = $balance - $amount;\r\n $new_pending = $pending + $amount;\r\n \r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_new_balance = \"UPDATE `users` SET `balance`= :balance, `pending`= :pending WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result_new_balance = $base->prepare($sql_new_balance);\r\n\r\n //Ejecutar consulta\r\n $result_new_balance->execute(array(\":balance\"=>$new_balance, \":pending\"=>$new_pending, \":id_user\"=>$id_user));\r\n\r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_withdrawal = \"INSERT INTO `withdrawal`(`account`, `amount`, `date`, `id_user`) VALUES (:account, :amount , NOW(), :id_user)\";\r\n\r\n //Preparar consulta\r\n $result_withdrawal = $base->prepare($sql_withdrawal);\r\n\r\n //Ejecutar consulta\r\n $result_withdrawal->execute(array(\":account\"=>$account, \":amount\"=>$amount, \":id_user\"=>$id_user));\r\n\r\n $count_withdrawal = $result_withdrawal->rowCount();\r\n\r\n if ($count_withdrawal > 0) {\r\n\r\n //Enviar email\r\n $msg = \"The user with the id $id_user has requested a withdrawal in the amount of $amount for their Payeer account $account\";\r\n \r\n mail(\"[email protected]\", \"New Withdrawal request - $id_user\", $msg);\r\n\r\n return \"<b>Your withdrawal request has been sent</b>\\nIn less than 24 hours your order will be processed\";\r\n }\r\n\r\n }else {\r\n return \"You don't have enough funds\";\r\n }\r\n \r\n }else {\r\n return \"fatal error 3\";\r\n }\r\n\r\n}",
"public function transfer($from_user_id, $to_user_id, $amount)\n {\n $dateNow = new Nette\\Utils\\DateTime();\n $amount = number_format($amount, 2, '.', '');\n $this->database->beginTransaction();\n // out\n $this->database->table(self::TRANSFERS_TABLE_NAME)->insert([\n 'from_user_id' => $from_user_id,\n 'to_user_id' => $to_user_id,\n 'type' => self::TRANSFER_TYPE_OUT,\n 'amount' => $amount,\n 'dt' => $dateNow\n ]);\n if ($from_user_id != 0) {\n $from_user = $this->database->table(self::USERS_TABLE_NAME)->get($from_user_id);\n // check rules\n if (\n ($from_user)\n && ($from_user->balance > 0)\n && ($from_user->balance >= $amount)\n ) {\n $this->database->table(self::USERS_TABLE_NAME)\n ->where('id', $from_user_id)\n ->update([\n 'balance' => $from_user->balance - $amount,\n ]);\n } else {\n $this->database->rollBack();\n return false;\n }\n }\n if ($to_user_id != 0) {\n // TODO: one query\n $to_user = $this->database->table(self::USERS_TABLE_NAME)->get($to_user_id);\n $this->database->table(self::USERS_TABLE_NAME)\n ->where('id', $to_user_id)\n ->update([\n 'balance' => $to_user->balance + $amount,\n ]);\n }\n $this->database->commit();\n return true;\n }",
"public function setAmount($balance)\n {\n $this->amount = (int) $balance;\n }",
"public function withdrawImpl($db, $amount){\n $stmt = $db->query(\"SELECT balance FROM account where id = \".$this->id);\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $balance = $row['balance'];\n $need = $amount - $balance;\n if($need > 0){\n // Get all the other accounts that are owned by the owners of this\n // account\n $sql = \"SELECT DISTINCT(account_id) FROM account JOIN account_owner ON account_id = account_owner.account_id WHERE id <> $id AND (\";\n $first = true;\n foreach($this->getOwners() as $owner){\n if(!$first){\n $ccl.=\" OR \";\n }\n $first = false;\n $ccl .= \"owner = \".$owner->getId();\n }\n $ccl .= \")\";\n $stmt = $db->query($sql);\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n foreach($results as $row){\n if($need <= 0){\n break;\n }\n $toTransfer = $otherBalance > $need ? $need : $otherBalance;\n if($toTransfer > 0 ){\n $other = $row['account_id'];\n $stmt = $db->query(\"SELECT balance FROM account WHERE id = $other\");\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $otherBalance = $row['balance'];\n $otherBalance -= $toTransfer;\n $balance += $toTransfer;\n $db->exec(\"UPDATE account SET balance = $otherBalance WHERE id = $other\");\n $db->exec(\"UPDATE account SET balance = $balance WHERE id = \".$this->id);\n $db->exec(\"INSERT INTO account_charge (account_id, charge) VALUES ($other, \\\"transfer $toTransfer to account \".$this->id.\"\\\")\");\n $need -= $toTransfer;\n }\n }\n if($need > 0){\n return false;\n }\n }\n $db->exec(\"UPDATE account set balance = \".$balance - $amount.\" WHERE id = \".$this->id);\n return true;\n }",
"public function updateBankerCredit()\n {\n $user = User::whereHas(\"roles\", function($q){$q->where(\"name\", \"Banker\");})->first();\n\n $total = Credit::where('credit_type', 0)->sum('value');\n $user->free_credits = $total;\n $total = Credit::where('credit_type', 1)->sum('value');\n $user->paid_credits = $total;\n $user->save();\n }",
"public function actionDepositMoney()\n {\n // Recevei the POST params\n $request = Yii::$app->request;\n $user_id = $request->post('user_id');\n $amount_currency = $request->post('amount_currency');\n $wallet_currency = $request->post('wallet_currency');\n $amount = $request->post('amount');\n\n // Check the mandatory fields\n if (empty($user_id)) {\n throw new BadRequestHttpException('The user ID must be informed.');\n } else if (empty($amount_currency)) {\n throw new BadRequestHttpException('The amount currency must be informed.');\n } else if (empty($wallet_currency)) {\n throw new BadRequestHttpException('The wallet currency must be informed.');\n } else if (empty($amount)) {\n throw new BadRequestHttpException('The amount must be informed.');\n } else {\n // Prepare the input\n $amount = floatval($amount);\n $amount_currency = strtoupper($amount_currency);\n $wallet_currency = strtoupper($wallet_currency);\n\n // Try to retrieve the wallet info\n $wallet = Wallet::find()->where(['user_id' => $user_id])->andWhere(['currency' => $wallet_currency])->one();\n\n // Check if the wallet exists\n if (isset($wallet) && !empty($wallet)) {\n // Check if needs to convert\n if (strcmp($amount_currency, $wallet_currency) != 0) {\n // Gets the new currency quotation\n $result = $this->actionConvertCurrency($amount_currency, $wallet_currency, $amount);\n\n // Check if the conversion happend succesfully\n if (isset($result) && !empty($result)) {\n // Set the new wallet balance with conversion\n $wallet->balance += $result['converted_amount'];\n } else {\n throw new HttpException('It was not possible to contact the currency exchange server.');\n }\n } else {\n // Set the new wallet balance without conversion\n $wallet->balance += $amount;\n }\n\n // Update the the wallet balance\n if ($wallet->save()) {\n // Log the transaction as complete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n }\n\n // Return the wallet updated\n return $wallet;\n } else {\n // Log the transaction as incomplete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n }\n\n throw new ServerErrorHttpException(\"It wasn't possible to complete the deposit\");\n }\n } else {\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' was not found.');\n }\n }\n }",
"public function actionWithdrawMoney()\n {\n // Recevei the POST params\n $request = Yii::$app->request;\n $user_id = $request->post('user_id');\n $amount_currency = $request->post('amount_currency');\n $wallet_currency = $request->post('wallet_currency');\n $amount = $request->post('amount');\n\n // Check the mandatory fields\n if (empty($user_id)) {\n throw new BadRequestHttpException('The user ID must be informed.');\n } else if (empty($amount_currency)) {\n throw new BadRequestHttpException('The amount currency must be informed.');\n } else if (empty($wallet_currency)) {\n throw new BadRequestHttpException('The wallet currency must be informed.');\n } else if (empty($amount)) {\n throw new BadRequestHttpException('The amount must be informed.');\n } else {\n // Prepare the input\n $amount = floatval($amount);\n $amount_currency = strtoupper($amount_currency);\n $wallet_currency = strtoupper($wallet_currency);\n\n // Try to retrieve the wallet info\n $wallet = Wallet::find()->where(['user_id' => $user_id])->andWhere(['currency' => $wallet_currency])->one();\n\n // Check if the wallet exists\n if (isset($wallet) && !empty($wallet)) {\n // Check if needs to convert\n if (strcmp($amount_currency, $wallet_currency) != 0) {\n // Gets the new currency quotation\n $result = $this->actionConvertCurrency($amount_currency, $wallet_currency, $amount);\n\n // Check if the conversion happend succesfully\n if (isset($result) && !empty($result)) {\n // Check if the wallet have enough fund\n if ($wallet->balance >= $result['converted_amount']) {\n // Perform the balance withdraw with conversion\n $wallet->balance -= $result['converted_amount'];\n } else {\n // Log the transaction as complete\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' does not have enough fund for this operation.');\n }\n } else {\n throw new HttpException('It was not possible to contact the currency exchange server.');\n }\n } else {\n // Check if the wallet have enough fund\n if ($wallet->balance >= $amount) {\n // Perform the balance withdraw without conversion\n $wallet->balance -= $amount;\n } else {\n // Log the transaction as incomplete\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' does not have enough fund for this operation.');\n }\n }\n\n // Update the the wallet balance\n if ($wallet->save()) {\n // Log the transaction as complete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n } else {\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n }\n\n // Return the wallet updated\n return $wallet;\n } else {\n // Log the transaction as incomplete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n } else {\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n }\n\n throw new ServerErrorHttpException(\"It wasn't possible to complete the withdraw\");\n }\n } else {\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' was not found.');\n }\n }\n }",
"public function updateInvoiceBalance(\\PDO $dbh, $paymentAmount, $user) {\n\t\t// positive payment amounts reduce a balance.\n\t\t// Neg payments increase a bal.\n\t\tif ($this->idInvoice > 0) {\n\n\t\t\t$balAmt = $this->invRs->Balance->getStoredVal ();\n\t\t\t$newBal = $balAmt - $paymentAmount;\n\n\t\t\t$this->invRs->Balance->setNewVal ( $newBal );\n\n\t\t\t$attempts = $this->invRs->Payment_Attempts->getStoredVal ();\n\t\t\t$this->invRs->Payment_Attempts->setNewVal ( ++ $attempts );\n\n\t\t\tif ($newBal == 0) {\n\t\t\t\t$this->invRs->Status->setNewVal ( InvoiceStatus::Paid );\n\t\t\t} else {\n\t\t\t\t$this->invRs->Status->setNewVal ( InvoiceStatus::Unpaid );\n\t\t\t}\n\n\t\t\t$this->invRs->Last_Updated->setNewVal ( date ( 'Y-m-d H:i:s' ) );\n\t\t\t$this->invRs->Updated_By->setNewVal ( $user );\n\n\t\t\tEditRS::update ( $dbh, $this->invRs, array (\n\t\t\t\t\t$this->invRs->idInvoice\n\t\t\t) );\n\t\t\tEditRS::updateStoredVals ( $this->invRs );\n\t\t} else {\n\t\t\tthrow new PaymentException( 'Cannot make payments on a blank invoice record. ' );\n\t\t}\n\t}"
] |
[
"0.68273365",
"0.67030984",
"0.66548747",
"0.6495199",
"0.64870554",
"0.64142996",
"0.63911796",
"0.62955135",
"0.62158316",
"0.61740804",
"0.6151145",
"0.6146981",
"0.6131763",
"0.61168474",
"0.607866",
"0.605699",
"0.6014469",
"0.60078704",
"0.6000516",
"0.59528303",
"0.59445256",
"0.59238887",
"0.5898364",
"0.5883827",
"0.58736914",
"0.5859791",
"0.5839077",
"0.5825912",
"0.57959884",
"0.5787032"
] |
0.74089664
|
0
|
select account account by account number
|
function selectAccountByNumber($accountNumber) {
$connection = openDb();
//Using prepared statements and parameterized queries:
$sql = "SELECT * FROM accounts WHERE ACCOUNT_NUMBER = ?";
$stmt = $connection->stmt_init();
if(!$stmt->prepare($sql)) {
return false;
}
$stmt->bind_param("s",$accountNumber);
return executeQueryPrepared($stmt, $connection, true);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function findAccountByNum($numero){\n $sql = \"SELECT * FROM compte WHERE numero='$numero'\";\n \n global $db;\n\n return $db->query($sql)->fetch();\n }",
"public function getAccessFromAccount($account){\n $table = \"access\";\n $fields[] = \"access\";\n $where[\"account\"] = $account;\n $data = Database_Mysql::select($table,$fields,$where);\n if($data)\n return $data[0][\"access\"];\n else\n return false;\n }",
"function selectTransactionsByAccountId($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM transaction_view WHERE SENDER_ACCOUNT = ? OR RECIPIENT_ACCOUNT = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"si\",$id,$id);\n\n return executeQueryPrepared($stmt, $connection);\n}",
"public function getAccount();",
"public function getAuthFromAccount($account){\n $table = \"access\";\n $fields[] = \"auth\";\n $where[\"account\"] = $account;\n $data = Database_Mysql::select($table,$fields,$where);\n if($data)\n return $data[0][\"auth\"];\n else\n return false;\n }",
"function getAccountId($account_name)\n\t{\n\t\t global $log;\n $log->info(\"in getAccountId \".$account_name);\n\t\tglobal $adb;\n\t\tif($account_name != '')\n\t\t{\n\t\t\t$sql = \"select accountid from ec_account where accountname='\".$account_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$accountid = $adb->query_result($result,0,\"accountid\");\n\t\t}\n\t\treturn $accountid;\n\t}",
"function obtain_offer($acc_number)\n\t{\n\t return $this->db->select()\n\t\t ->from('pamm_accounts') \n\t\t ->where(\"login\",$acc_number)\n\t\t ->get()->result();\n\t}",
"public static function account($accountId) {\n //Return the information for $accountId\n return self::get('accounts/' . $accountId);\n }",
"public function getAccount($bitcoinaddress);",
"public function getAccount(int $accountNumber): Account\n {\n foreach ($this->_accounts as $account) {\n if ($accountNumber == $account->getAccountNumber()) {\n return $account;\n }\n }\n return null;\n }",
"function mint_get_account($session, $token, $account_name) {\n // mint needs some info to log in\n $_post = array(\n \"input\" => '[' . json_encode(array(\n \"args\" => array(\n \"types\" => array(\"OTHER_PROPERTY\"),\n ),\n \"id\" => \"115485\",\n \"service\" => \"MintAccountService\",\n \"task\" => \"getAccountsSorted\", \n )) . ']',\n );\n $session->URLFetch(\"https://wwws.mint.com/bundledServiceController.xevent?token=\" . $token, $_post);\n $_obj = json_decode($session->response);\n \n // 115485 seems to be a magic/arbitrary number that mint labels the object in it's return json\n foreach ($_obj->response->{115485}->response as $account) {\n if ($account->name == $account_name) {\n return $account->accountId;\n }\n }\n Debug::trace('could not find an account named ' . $account_name . ' in your mint.com account');\n}",
"function obtain_single($acc_number,$tid)\n\t{\n\t return $this->db->select('pamm_invested_accounts_status')\n\t\t ->from('pamm_invested_accounts') \n\t\t ->where(\"pamm_invested_accounts_login\",$acc_number)\n\t\t ->where(\"pamm_invested_accounts_tid\",$tid)\n\t\t ->get()->result();\n\t}",
"public function get_account_active($acc_number)\n\t{\n\t return $this->db->select('active')\n\t\t ->from('pamm_accounts') \n\t\t ->where(\"login\",$acc_number)\n\t\t ->get()->result();\n\t}",
"function getDetailbank_account($statement,$customefield){\n $xstr=\"SELECT $customefield FROM bank_account $statement\";\n $query = $this->db->query($xstr);\n $row = $query->row();\n return $row;\n }",
"public function getAccountID();",
"function get_account_color($acc_number)\n\t{\n\t return $this->db->select('color')\n\t\t ->from('pamm_accounts') \n\t\t ->where(\"login\",$acc_number)\n\t\t ->get()->result();\n\t}",
"public static function getAccount($account = null, $attribut = PLEXCEL_SUPPLEMENTAL)\n {\n return plexcel_get_account(self::getConnection(), $account, $attribut );\n }",
"public function getAccountCode();",
"public function getAccountCode();",
"function media_theplatform_mpx_get_accounts_select() {\n // Check for the signIn token.\n $mpx_token = media_theplatform_mpx_variable_get('token', NULL);\n if (!$mpx_token) {\n return t('There was an error with your request.');\n }\n // Get the list of accounts from thePlatform.\n $url = 'http://access.auth.theplatform.com/data/Account?schema=1.3.0&form=json&byDisabled=false&token=' . $mpx_token;\n $result = drupal_http_request($url);\n $result_data = drupal_json_decode($result->data);\n\n global $user;\n\n if (empty($result_data['entryCount']) || $result_data['entryCount'] == 0) {\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => '0 accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n //return FALSE;\n drupal_set_message(t('The logged in user does not have the privilege to set the account.'), 'warning');\n return array();\n }\n $accounts = array();\n $accounts_data = array();\n\n foreach ($result_data['entries'] as $entry) {\n $title = $entry['title'];\n $key = rawurlencode($title);\n $accounts[$key] = $title;\n }\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => count($accounts) . ' accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n // Sort accounts alphabetically.\n natcasesort($accounts);\n return $accounts;\n}",
"public function getAccountNumber()\n {\n return $this->hasOne(AccountNumber::className(), ['id' => 'account_number_id']);\n }",
"public function getAccount($key = null);",
"public function findAccount()\r\n {\r\n // get current user id\r\n $loginUser = $_SESSION[\"loginUser\"];\r\n $userId = $loginUser->getId();\r\n \r\n // search accounts from database\r\n $accountList = $this->accountHandler->findAccount($userId);\r\n \r\n require_once ('view/UserHome.php');\r\n }",
"public function findByAccount($name);",
"public function getAccountNumber()\n {\n return $this->account_number;\n }",
"public function getAccountNumber()\n {\n return $this->account_number;\n }",
"public function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')\n {\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\trequire_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';\n\n\t\t$pcgver = $conf->global->CHARTOFACCOUNTS;\n\n\t\t$sql = \"SELECT DISTINCT ab.numero_compte as account_number, aa.label as label, aa.rowid as rowid, aa.fk_pcg_version\";\n\t\t$sql .= \" FROM \" . MAIN_DB_PREFIX . \"accounting_bookkeeping as ab\";\n\t\t$sql .= \" LEFT JOIN \" . MAIN_DB_PREFIX . \"accounting_account as aa ON aa.account_number = ab.numero_compte\";\n\t\t$sql .= \" AND aa.active = 1\";\n\t\t$sql .= \" INNER JOIN \" . MAIN_DB_PREFIX . \"accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version\";\n\t\t$sql .= \" AND asy.rowid = \" . $pcgver;\n\t\t$sql .= \" AND ab.entity IN (\" . getEntity('accountancy') . \")\";\n\t\t$sql .= \" ORDER BY account_number ASC\";\n\n\t\tdol_syslog(get_class($this) . \"::select_account\", LOG_DEBUG);\n\t\t$resql = $this->db->query($sql);\n\n\t\tif (! $resql) {\n\t\t\t$this->error = \"Error \" . $this->db->lasterror();\n\t\t\tdol_syslog(get_class($this) . \"::select_account \" . $this->error, LOG_ERR);\n\t\t\treturn - 1;\n\t\t}\n\n\t\t$out = ajax_combobox($htmlname, $event);\n\n\t\t$options = array();\n\t\t$selected = null;\n\n\t\twhile ($obj = $this->db->fetch_object($resql)) {\n\t\t\t$label = length_accountg($obj->account_number) . ' - ' . $obj->label;\n\n\t\t\t$select_value_in = $obj->rowid;\n\t\t\t$select_value_out = $obj->rowid;\n\n\t\t\tif ($select_in == 1) {\n\t\t\t\t$select_value_in = $obj->account_number;\n\t\t\t}\n\t\t\tif ($select_out == 1) {\n\t\t\t\t$select_value_out = $obj->account_number;\n\t\t\t}\n\n\t\t\t// Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number\n\t\t\t// Because same account_number can be share between different accounting_system and do have the same meaning\n\t\t\tif (($selectid != '') && $selectid == $select_value_in) {\n\t\t\t\t$selected = $select_value_out;\n\t\t\t}\n\n\t\t\t$options[$select_value_out] = $label;\n\t\t}\n\n\t\t$out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', 'maxwidth300');\n\t\t$this->db->free($resql);\n\t\treturn $out;\n\t}",
"public function get_compte_racine($account = null)\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\t\t$pcgver = $conf->global->CHARTOFACCOUNTS;\n\n\t\t$sql = \"SELECT root.account_number, root.label as label\";\n\t\t$sql .= \" FROM \" . MAIN_DB_PREFIX . \"accounting_account as aa\";\n\t\t$sql .= \" INNER JOIN \" . MAIN_DB_PREFIX . \"accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version\";\n\t\t$sql .= \" AND asy.rowid = \" . $pcgver;\n\t\t$sql .= \" LEFT JOIN \" . MAIN_DB_PREFIX . \"accounting_account as parent ON aa.account_parent = parent.rowid\";\n\t\t$sql .= \" LEFT JOIN \" . MAIN_DB_PREFIX . \"accounting_account as root ON parent.account_parent = root.rowid\";\n\t\t$sql .= \" WHERE aa.account_number = '\" . $account . \"'\";\n\t\t$sql .= \" AND parent.active = 1\";\n\t\t$sql .= \" AND root.active = 1\";\n\t\t$sql .= \" AND aa.entity IN (\" . getEntity('accountancy') . \")\";\n\n\t\tdol_syslog(get_class($this) . \"::select_account sql=\" . $sql, LOG_DEBUG);\n\t\t$resql = $this->db->query($sql);\n\t\tif ($resql) {\n\t\t\t$obj = '';\n\t\t\tif ($this->db->num_rows($resql)) {\n\t\t\t\t$obj = $this->db->fetch_object($resql);\n\t\t\t}\n\n\t\t\treturn $obj->label;\n\t\t} else {\n\t\t\t$this->error = \"Error \" . $this->db->lasterror();\n\t\t\tdol_syslog(__METHOD__ . \" \" . $this->error, LOG_ERR);\n\n\t\t\treturn -1;\n\t\t}\n\t}",
"function get_begin_saldo_account()\n {\n $this->db->select('accounts.id, accounts.currency, accounts.name, accounts.alias, accounts.code, accounts.classification_id');\n $this->db->from('accounts,classifications');\n $this->db->where('accounts.classification_id = classifications.id');\n \n $names = array('harta', 'modal', 'kewajiban');\n $this->db->where_in('classifications.type', $names);\n $this->db->where('accounts.deleted', NULL);\n \n $this->db->order_by('accounts.code','asc');\n return $this->db->get(); \n }",
"public function show($id)\n {\n return Account::select('*')->where('account_number',$id)->get();\n }"
] |
[
"0.6708825",
"0.6240628",
"0.6205301",
"0.6190598",
"0.6172556",
"0.6149282",
"0.59818846",
"0.59575427",
"0.5952666",
"0.5938245",
"0.59314466",
"0.5873333",
"0.5860979",
"0.5849527",
"0.5838269",
"0.58285064",
"0.58229834",
"0.58207095",
"0.58207095",
"0.57939404",
"0.5787006",
"0.57855654",
"0.5754218",
"0.5753304",
"0.57512134",
"0.57512134",
"0.5750489",
"0.57456344",
"0.57212967",
"0.57032925"
] |
0.6854743
|
0
|
select account account by user id
|
function selectAccountByUserId($id) {
$connection = openDb();
$id = escape($id,$connection);
$id = (int) $id;
//Using prepared statements and parameterized queries:
$sql = "SELECT * FROM accounts WHERE USER = ?";
$stmt = $connection->stmt_init();
if(!$stmt->prepare($sql)) {
return false;
}
$stmt->bind_param("i",$id);
return executeQueryPrepared($stmt, $connection, true);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function getAccount ($id = null) {\n if (!$id) { \n $id = session::getUserId();\n }\n $db = new db();\n $row = $db->selectOne('account', 'id', $id);\n return $row;\n }",
"function selectAccountById($id) {\n $connection = openDb();\n\n //Using prepared statements:\n $id = (int) $id;\n $sql = \"SELECT * FROM accounts WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}",
"function getUserById($user_id) {\n $query = \"SELECT * FROM users_account WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $user_id\n );\n \n $result = $this->db_handle->runQuery($query, $paramType, $paramValue);\n return $result;\n }",
"public function findAccount()\r\n {\r\n // get current user id\r\n $loginUser = $_SESSION[\"loginUser\"];\r\n $userId = $loginUser->getId();\r\n \r\n // search accounts from database\r\n $accountList = $this->accountHandler->findAccount($userId);\r\n \r\n require_once ('view/UserHome.php');\r\n }",
"function selectTransactionsByAccountId($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM transaction_view WHERE SENDER_ACCOUNT = ? OR RECIPIENT_ACCOUNT = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"si\",$id,$id);\n\n return executeQueryPrepared($stmt, $connection);\n}",
"public function getAccount( $id )\n\t{\n\t\t$stmt = $this->connection->prepare('SELECT a.id, username, avatar, email, expire FROM ' . Configure::get('database/prefix') . 'accounts as a LEFT JOIN ' . Configure::get('database/prefix') . 'sessions as s ON s.id = a.sessid WHERE a.id = :uid');\n\t\t$stmt->bindValue(':uid', Security::sanitize($id, 'integer'), PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$users = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt->closeCursor();\n\n\t\tif( !empty($users) )\n\t\t{\n\t\t\t$users['email'] = Security::decryptData($users['email']);\n\t\t}\n\n\t\treturn $users;\n\t}",
"public function account($id_user) \n\t{\n\t\t$data = array();\n\t\t\n\t\t//user data\n\t\t$where = array('id' => $id_user);\n\t\t$user = $this->user->get($where);\n\t\t\n\t\t$data['user_data'] = null;\n\t\tif (isset($user[0])) {\n\t\t\t$data['user_data'] = $user[0];\n\t\t}\n\t\t\n\t\t//user bet\n\t\t$data['user_bets'] = $this->get_bets($id_user);\n\t\t\n\t\t//user rides\n\t\t$data['user_rides'] = $this->get_rides($id_user);\n\t\t\n\t\t//users stats\n\t\t$data['user_stats'] = $this->get_stats($id_user);\n\t\t\n\t\t$this->layout->view('user/account', $data);\n\t}",
"public function getUser($id);",
"function getUserFromId($userId) {\n $statement = 'SELECT id, username, email, role_id, banned FROM USER WHERE id = (?)';\n $query = $this->prepare($statement);\n $query->execute([$userId]);\n return $query->fetch();\n }",
"public function getUser($account_id) {\n $this->db->select('*');\n $this->db->where('account_id', $account_id);\n $this->db->where('archive', 1);\n $res = $this->db->get('users');\n $result = $res->result_array();\n if ($result) {\n return $result;\n } else {\n return FALSE;\n }\n }",
"public function getUser($id){\n \t$sql = \"select * from `usuarios` where `id` = '$id'\";\n \t$result = parent::executaQuery($sql);\n $row = mysqli_fetch_object ( $result );\n return $row;\n }",
"function account($id)\r\n{\r\n mysql_selectdb(SQL_AUTH_DATABASE);\r\n $query = \"SELECT * FROM `account` WHERE `id` = $id\";\r\n $sql = mysql_query($query);\r\n return mysql_fetch_array($sql);\r\n \r\n}",
"abstract public function fetchUserById($id);",
"public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }",
"public static function get_user($user_id);",
"function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }",
"public function findByUser($id) {\n\t $this->db->select('*')\n\t ->from($this->getSource())\n\t ->where(\"userId = ?\");\n\t \n\t $this->db->execute([$id]);\n\t return $this->db->fetchAll();\n\t}",
"public function getUserById($id)\n {\n\t $result = $this->getUserDbTable()->select()\n \t\t\t\t\t\t\t\t\t ->where('user_id = ?', (int)$id, 'INT')\n \t\t\t\t\t\t\t\t\t ->query()->fetch();\n \tif($result) return $result;\n }",
"public function getAccount();",
"public function getUserById($id) {\n\t\t\n\t}",
"public function SelectUserId($con,$id){\n $command = \"SELECT * from user_ WHERE id = '$id' \";\n $result = mysqli_query($con,$command);\n $row = mysqli_fetch_row($result);\n return $row;\n }",
"function getUserById($id){\n\t\tglobal $db;\n\t\t$query = \"SELECT * FROM t_attendees WHERE id=\" . $id;\n\t\t$result = mysqli_query($db, $query);\n\t\t$user = mysqli_fetch_assoc($result);\n\t\treturn $user;\n\t}",
"public function loadAccount($id){\n try{\n \n $sql = 'SELECT * FROM accounts WHERE idaccount=:id';\n $query = pdo()->prepare($sql);\n $query->bindValue(':id', $id, PDO::PARAM_INT);\n $query->execute();\n $res = $query->fetch(PDO::FETCH_ASSOC);\n $query->closeCursor();\n if($res){\n $this->_idaccount = $res['idaccount'];\n $this->_email = $res['email'];\n $this->_username = $res['username'];\n $this->_password = $res['password'];\n $this->_validationkey = $res['validationkey'];\n $this->_rang = $res['rang'];\n return $this;\n }\n return false;\n \n }\n catch(Exception $e)\n {\n trigger_error('Echec lors de l\\'inscription : '.$e->getMessage(), E_USER_ERROR);\n }\n }",
"function account_user($uid)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('account');\n\t\t$this->db->where('pack_status','Y');\n\t\t$this->db->where('paystatus','TRUE');\n\t\t$this->db->where('approved','Y');\n\t\t$this->db->where('status','Y');\n\t\t$this->db->where('deleted','N');\n\t\t$this->db->where('user_id',$uid);\n\t\t$query = $this->db->get();\n\t\treturn $query;\t\n\t}",
"public function selectUserById($id){\r\n //2 prepare la requete\r\n $stmt=$connexion->prepare(\r\n \"SELECT *\r\n FROM User\r\n WHERE id=:id\"\r\n );\r\n //3 execute la requete\r\n $stmt->execute(\r\n array('id'=>$id)\r\n );\r\n // 4 Recuperation resultat et stockage ds variable\r\n $user=$stmt->fetchObject('User');\r\n // 5 retourne la variable (reslutat)\r\n return $user;\r\n }",
"public static function getAccountById($account_id){\n $stmt = Dbh::connect() ->PREPARE(\"SELECT * FROM accounts WHERE account_id=?\");\n $stmt->execute([$account_id]);\n $account = array();\n if($stmt->rowCount()){\n while ($row = $stmt->fetch()){\n $account = array(\"id\"=>$row['account_id'], \"email\"=>$row['email'], \"firstName\"=>$row['first_name'], \"lastName\"=>$row['last_name'],\n \"type\"=>$row['account_type'],\"password\"=>$row['password'],\"subscription\"=>$row['subscription']);\n }\n return $account;\n } else {\n\t\t\treturn false;\n\t\t}\n }",
"public function account()\n {\n return $this->belongsTo(CommunityFacade::getUserClass(), 'account_id');\n }",
"function selectUser($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM users_view WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}",
"public function getUserIdWithUsername($id);",
"function get_user_by_user_id($user_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_id`='$user_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}"
] |
[
"0.70628655",
"0.6842537",
"0.67984635",
"0.67195326",
"0.6679563",
"0.6550828",
"0.64835685",
"0.6463842",
"0.64523494",
"0.6444841",
"0.643139",
"0.63601404",
"0.63414294",
"0.63248354",
"0.6324651",
"0.63052547",
"0.6295274",
"0.62917644",
"0.6253331",
"0.62479407",
"0.62372494",
"0.6208831",
"0.6207719",
"0.6199767",
"0.6189848",
"0.61868864",
"0.61865723",
"0.617655",
"0.61717504",
"0.6154419"
] |
0.7779418
|
0
|
Import devolution by invoice
|
private function importDevolucao($fileName)
{
$userId = getCurrentUserId();
$key = (string) $this->protNfe->infProt->chNFe;
$cfop = (int) $this->getProducts()[0]->prod->CFOP;
$tipoOperacao = null;
if (in_array($cfop, Config::get('core.notas.devolucao'))) {
$tipoOperacao = 'devolucao';
} elseif (in_array($cfop, Config::get('core.notas.estorno'))) {
$tipoOperacao = 'estorno';
} else {
throw new \Exception('CFOP inválido para devolução!', 7);
}
// Data
$dateTime = \DateTime::createFromFormat('Y-m-d\TH:i:sP', $this->nfe->ide->dhEmi);
$date = $dateTime->format('Y-m-d');
$parent = null;
if ($ref = $this->nfe->ide->NFref->refNFe) {
$parent = Nota::withTrashed()->where('chave', '=', $ref)->first();
}
if (!$parent) {
throw new \Exception('Não foi possível encontrar a nota de referência para a devolução', 7);
}
$devolucao = Devolucao::firstOrNew([
'chave' => $key,
'nota_id' => $parent->id
]);
$devolucao->usuario_id = $userId;
$devolucao->nota_id = $parent->id;
$devolucao->chave = $key;
$devolucao->arquivo = $fileName;
$devolucao->tipo = ($tipoOperacao == 'estorno') ? 1 : 0;
$devolucao->data = $date;
if ($devolucao->save()) {
Log::info('Devolução de nota importada ' . $devolucao->id);
} else {
Log::warning('Não foi possível importar a devolução da nota de venda: ' . $parent->id);
return false;
}
return $devolucao;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"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}",
"function XSAInvoicing($InvoiceNo, $orderno, $debtorno, $TypeInvoice, $tag, $serie, $folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronicEmbarque='';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\tif ($TypeInvoice == 11) {\n\t\t$tabla = 'notesorders';\n\t}else{\n\t\t$tabla = 'salesorders';\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\n\t\tFROM debtortrans \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\tsalesman,locations,paymentterms\n\n\t\tWHERE debtortrans.order_ = salesorders.orderno\n\n\t\tAND debtortrans.type=\".$TypeInvoice.\"\n\t\tAND debtortrans.transno=\" . $InvoiceNo . \"\n\t\tAND debtortrans.tagref=\" . $tag . \"\n\n\t\tAND debtortrans.debtorno=debtorsmaster.debtorno\n\t\tAND salesorders.paytermsindicator=paymentterms.termsindicator\n\t\tAND debtortrans.debtorno=custbranch.debtorno\n\t\tAND debtortrans.branchcode=custbranch.branchcode\n\t\tAND salesorders.salesman=salesman.salesmancode\n\t\tAND salesorders.fromstkloc=locations.loccode \";\n\tif ($_SESSION['UserID']=='admin') {\n\n\t\t//echo '<pre>sql:<br>'.$SQLInvoice.'<br>';\n\t}\n\t$Result=DB_query($SQLInvoice,$db);\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\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=1\n\t\t\t\tand debtortranstaxesclient.iddoc = \".$myrow['id'];\n\t\t\t\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$charelectronictaxsfederal='';\n\t\t\t$charelectronictaxsfederalini='|'.chr(13).chr(10).'06';\n\t\t\twhile ($regs = DB_fetch_array($rs)){\n\t\t\t\t$charelectronictaxsfederal.=$charelectronictaxsfederalini.\"|\".$regs['nametax'].\"|\".$regs['percent'].\"|\".$regs['amount'];\n\t\t\t\t$totretencionfederal=$totretencionfederal+$regs['amount'];\n\t\t\t}\n\t\t}\n\t\t\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\t\t\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\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$metodoPago = $myrow['paymentname'];\n\t\tif ($metodoPago==\"\")\n\t\t\t$metodoPago = \"No Identificado\";\n\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\")\n\t\t\t$nocuenta = \"No Identificado\";\n\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= FormatNumberERP($myrow['ovamount']);\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= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\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= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']+$totalretencion);\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=FormatNumberERP($myrow['ovgst']);\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\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\"){\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\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=FormatNumberERP($myrowdis['descuento']);\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\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=FormatNumberERP($myrowdis['descuento']);\n\t\t\t}\t\n\t\t}\n\t\t$descuento=FormatNumberERP($descuento);\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$totalx=str_replace(',', '', FormatNumberERP($totaletras));\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\", FormatNumberERP($total));\n\t\t$montoctvs2 = $separa2[1];\n\t\t\n\t\t\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t\n\t\t$zeroPad = \"\";\n\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t} else {\n\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t}\n\t\t\n\t\tif ($moneda=='MXN') {\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t} else {\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t}\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=FormatRateNumberERP(1/$myrow['cambio']);\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\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\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\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\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\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=FormatNumberERP($montopago);\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\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\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\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=\"Telefono. \".$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\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\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$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\t\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n\t\t\n\t}\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\t$decimalplaces=6;\n\n\t\n\tif ($rfccliente!=\"XAXX010101000\"){//\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\tFROM stockmoves,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\t\n\t\t\t\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.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\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\tFROM stockmoves,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\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t}\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=$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=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\tif($_SESSION['DescrLargaFact'] == $myrow2['mbflag']){\n\t\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'].' '.$myrow2['longdescription'];\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\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,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\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\t$trab=$myrowprop['val'];\n\t\t\t\tif ($xt==0){\n\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\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\t\t\t$descrnarrative=\"\";\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\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\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=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\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\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'];\n\t\t\t$numberserie=\"\";\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\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;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**/\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\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=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\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\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\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}\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\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\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$nolinea=$nolinea+1;\n\t\t\t\n\t\t\t\n\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,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\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=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\tif($TipoAgrupacionXTag==1){\n\t\t\t\t\t$taxratetotal=FormatNumberERP((($myrow3['taxrate']*($myrow2['subtotal']))*$myrow2['quantity']));\n\t\t\t\t}else{\n\t\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t}\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\tif($TipoAgrupacionXTag==1){\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\t\t\t\tFROM stockmoves,stockmaster\n\t\t\t\t\t left JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno ,\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\t\t\n\t\t\t\t\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\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\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\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=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\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,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t \t\tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\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\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\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\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\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;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\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=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\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$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=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\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=FormatNumberERP($myrow2['subtotal']+$taxtotalratex);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']+$taxtotalratex);\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$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}\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\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\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\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\t}\n\t\n\t// ivas retenidos\n//\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronictaxsfederal.$charelectronictaxslocal.$charelectronicEmbarque;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsfederal.$charelectronictaxs.$charelectronictaxslocal.$charelectronicEmbarque;\n\t\t$cadenaenviada=$cadenaenvio;//retornarString($cadenaenvio);\n\n\t}\n\t//echo $cadenaenviada;\n\treturn $cadenaenviada;\n}",
"function XSAInvoicing($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db,$nivelfacturacion=2,$descripcionOT='',$OT=''){\n\t// *********************************************** //\n // ********************************************** //\n // ******** No dejar echo en la funcion *********//\n // ******** Declarar Variables a usar ******** //\n // ******** Afecta al punto de venta ********* //\n // ****************************************** //\n // ***************************************** //\n\t\n $debug_sql = false;\n\t$charelectronic='01'; //Cad 01, pos 0\n\t$charelectronicEmbarque='';\n\t$charelectronic=$charelectronic.'|'.$serie; //Cad 01, pos 1\n\t$serieelect=$serie;\n $pedimento=\"\";\n $subtotalInvoice=0;\n $versionAddenda=0;\n \n if(isset($_GET['versionAddenda'])){\n $versionAddenda = $_GET['versionAddenda'];\n }\n\n if(isset($_POST['versionAddenda'])){\n $versionAddenda = $_POST['versionAddenda'];\n }\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; //Cad 01, pos 2\n\t$charelectronic=$charelectronic.'|'.$folioelect; //Cad 01, pos 3\n\t$charelectronictaxsfederal='';\n\t$charelectronictaxslocal='';\n\t$charelectronictaxsret = '';\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$rfccliente = \"\";\n\t$TipoAgrupacionXTag = \"\";\n $branch= \"\";\n $descrestante = \"\";\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\n\t$arrayBDBombeo = array('erptycqsa','erptycqsa_CAPA','erptycqsa_DES' );\n\t$strFiltroBombeo=\"\";\n\tif(in_array($_SESSION['DatabaseName'], $arrayBDBombeo)){\n\t\tif($TypeInvoice=='66'){\n\t\t\t$strFiltroBombeo=\" AND stockmoves.stockid != 'SB'\";\n\t\t}\n\t\t\n\t}\n\n\t//Agregar datos de CFDI 3.3\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\t\tdebtortrans.c_TipoDeComprobante,\n\t\t\tdebtortrans.c_UsoCFDI,\n\t\t\tdebtortrans.c_paymentid,\n\t\t\tdebtortrans.claveFactura,\n\t\t\tcurrencies.decimalplaces,\n\t\t\tcoalesce(log_cancelacion_sustitucion.id,0) as idsustitucion\n\t\tFROM debtortrans\n\t\t\tLEFT JOIN log_cancelacion_sustitucion ON debtortrans.id = log_cancelacion_sustitucion.id\n\t\t\tLEFT JOIN currencies ON currencies.currabrev = debtortrans.currcode\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 salesman on salesorders.salesman=salesman.salesmancode \n\t\t\tleft join locations on salesorders.fromstkloc=locations.loccode ,\n\t\t\tpaymentterms \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\n if($_SESSION['UserID'] == \"desarrollo\"){\n echo '<pre> SQLInvoice 1 :<br>'.$SQLInvoice.'<br>';\n\n \t// echo \"<br>SQL XSAInvoicing: <pre>\";\n \t// \tprint_r($SQLInvoice);\n \t// echo \"</pre><br>\";\n\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$blnFacturaAnticipo3_3 = false;\n\t$blnFlagAnticipo3_3 = false;\n\t$strLegendAnticipo=\"\";\n\t$dblImporteDescuentoAnticipo=0;\n\t//$strSearchAnticipo=\"\";\n\t$strSQLAnticipo=\"\";\n\t$queryFacturaAnticipo=\"\";\n\t$montoNotesorders_invoice = 0;\n\t\n\t$categoriaAnticipo=\"ANT\";\n\n\t$strSearchAnticipo=\"\";\n\t$myrow['type'] = \"\";\n\t$myrow['orderno'] = \"\";\n\t$myrow['iddocto'] = \"\";\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t$myrow['type'] = $myrow['type'];\n\t\t$myrow['orderno'] = $myrow['orderno'];\n\t\t$myrow['iddocto'] = $myrow['iddocto'];\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, sec_taxes.c_Impuesto, sec_taxes.c_TipoFactor, sec_taxes.percent\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, sec_taxes.c_Impuesto, sec_taxes.c_TipoFactor, sec_taxes.percent\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'].\"|\".$regs['c_Impuesto'].\"|\".$regs['c_TipoFactor'].\"|\".$regs['percent'];\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'].\"|\".$regs['c_Impuesto'].\"|\".$regs['c_TipoFactor'].\"|\".$regs['percent'];\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, sec_taxes.flagimpuestolocal, sec_taxes.c_Impuesto, sec_taxes.c_TipoFactor, sec_taxes.percent\n\t\t\t\tfrom 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'].\"|\".$regs['flagimpuestolocal'].\"|\".$regs['c_Impuesto'].\"|\".$regs['c_TipoFactor'].\"|\".$regs['percent'];\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\n\t\tif($myrow['idsustitucion'] > 0){\n\t\t\t//Para las factuas de sustitucion que tome la fecha actual\n\t\t\t\n\t\t\t$fechainvoice = date('Y/m/d h:i:s');\n\t\t}\n\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice; //Cad 01, pos 4\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\n\t\t\t$metodosDePagos = explode(\",\", $myrow['cadenacodesat']);\n\t\t\t$metodoPago=$metodosDePagos[0];\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\n\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$subtotalInvoice = $subtotal;\n\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\n\t\t$charelectronic=$charelectronic.'|'.$subtotal; //Cad 01, pos 5\n\t\t\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\tif($TypeInvoice=='11'){\n\t\t\t$total = abs($total);\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$total; //Cad 01, pos 6\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; //Cad 01, pos 7\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret; //Cad 01, pos 8\n\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XEXX010101000\" 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\n\t\t\n\n\t\t// if($_SESSION['DatabaseName'] == \"erppisumma\" or $_SESSION['DatabaseName'] == \"erppisumma_CAPA\" or $_SESSION['DatabaseName'] == \"erppisumma_DES\"){\n\t\t// \t$categoriaAnticipo=\"AN1\";\n\t\t// }\n\n\t\tif ($_SESSION['FacturaVersion'] == \"3.3\") {\n\t\t\t//Obtener si es una factura de anticipo\n\t\t\t$queryFacturaAnticipo=\"SELECT debtortrans.id,debtortrans.folio\t\t\t\t\n\t\t\t\t\t\t\t\t FROM stockmaster \n\t\t\t\t\t\t\t\t\t\tINNER JOIN stockmoves on stockmoves.stockid=stockmaster.stockid \n\t\t\t\t\t\t\t\t\t\tINNER JOIN debtortrans ON debtortrans.type=stockmoves.type and debtortrans.transno=stockmoves.transno\n\t\t\t\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t\t\t\t\tSELECT ca1.transid_allocto, (sum(amt)/1.16) as monto\n\t\t\t\t\t\t\t\t\t\t\tFROM debtortrans dt1 \n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN debtorsmaster dm ON dt1.debtorno = dm.debtorno \n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN custallocns ca1 ON dt1.id = ca1.transid_allocfrom \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE dt1.id='\".$myrow['id'].\"'\n\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY ca1.transid_allocto\n\t\t\t\t\t\t\t\t\t\t) as x ON debtortrans.id = x.transid_allocto\n\t\t\t\t\t\t\t\t\tWHERE stockmaster.flagadvance=1 AND stockmoves.qty<0\n\t\t\t\t\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t\t\t\t\t(debtortrans.invtext NOT LIKE '%cancel%')\n\t\t\t\t\t\t\t\t\t\t\tor (debtortrans.invtext LIKE '%cancel%' and debtortrans.ovamount <> 0)\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\tAND\tdebtortrans.id='\".$myrow['id'].\"';\";\n \t\tif($_SESSION['UserID'] == \"desarrollo\"){\n \t\t\t//echo \"<br>sql ANTICIPO1: \".$queryFacturaAnticipo;\n \t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$resultFacturaAnticipo = DB_query($queryFacturaAnticipo,$db);\n\n\t\t\tif(DB_num_rows($resultFacturaAnticipo)<=0){\n\t\t\t\tif($_SESSION['DatabaseName'] == \"erpgruposii\" or $_SESSION['DatabaseName'] == \"erpgruposii_CAPA\" or $_SESSION['DatabaseName'] == \"erpgruposii_DES\"){\n\t\t\t\t\t$strSearchAnticipo=\" AND stockmaster.categoryid != 55\";\n\t\t\t\t\t$categoriaAnticipo=\"55\";\n\t\t\t\t}else{\n\t\t\t\t\t// if($_SESSION['DatabaseName'] == \"erppisumma\" or $_SESSION['DatabaseName'] == \"erppisumma_CAPA\" or $_SESSION['DatabaseName'] == \"erppisumma_DES\"){\n\t\t\t\t\t// \t$strSearchAnticipo=\" AND stockmaster.categoryid != 'AN1'\";\n\t\t\t\t\t// \t$categoriaAnticipo=\"AN1\";\n\t\t\t\t\t// }else{\n\t\t\t\t\t// \t$strSearchAnticipo=\" AND stockmaster.categoryid != 'ANT'\";\n\t\t\t\t\t// }\n\t\t\t\t\t$strSearchAnticipo=\" AND stockmaster.categoryid != 'ANT'\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//$strLegendAnticipo=\"'CFDI por remanente de un anticipo'\";\n\t\t\t}else{\n\t\t\t\t$blnFacturaAnticipo3_3 = true;\n\n\t\t\t}\n\n\t\t\tif($TypeInvoice == 11 OR $TypeInvoice=='119'){\n\t\t\t\t$strSearchAnticipo=\"\";\n\t\t\t\t$categoriaAnticipo=\"\";\n\t\t\t\t$blnFacturaAnticipo3_3 = true;\n\t\t\t}\n\t\t\t//blnFacturaAnticipo3_3 ES UNA FACTURA DE REMISION O NO LO ES\n\t\t\tif (!$blnFacturaAnticipo3_3) {\n\t\t\t\t$strSQLAnticipo=\"SELECT stockmoves.transno,\n\t\t\t \t\t\tstockmoves.type,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tsum((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\tsum((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price)) AS subtotal,\n\t\t\t\t\t\tsum(stockmoves.price) AS fxprice\n\t\t\t\t\tFROM stockmoves\n\t\t\t\t\tINNER JOIN stockmaster on 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 stockmaster.categoryid='\". $categoriaAnticipo .\"'\n\t\t\t\t\tAND stockmaster.units ='Actividad'\n\t\t\t\t\tAND (stockmoves.show_on_inv_crds=1 or stockmoves.stockid ='facturaremision')\n\t\t\t\t\tGROUP BY stockmoves.transno,stockmoves.type,stockmoves.tagref;\";\n\t\t\t\t\tif($_SESSION['UserID']==\"desarrollo\"){\n\t\t\t\t\t\techo \"<br>sql ANTICIPO: \".$strSQLAnticipo;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$resultAnticipo=DB_query($strSQLAnticipo,$db);\n\t\t\t\tif (DB_num_rows($resultAnticipo)>0) {\n\t\t\t\t\t$blnFlagAnticipo3_3 = true;\n\t\t\t\t\t$strLegendAnticipo=\"CFDI por remanente de un anticipo\";\n\t\t\t\t\t$myRowAnticipo=DB_fetch_array($resultAnticipo);\n\t\t\t\t\t$dblImporteDescuentoAnticipo=$myRowAnticipo['subtotal'];\n\t\t\t\t\t$dblImporteDescuentoAnticipo=abs($dblImporteDescuentoAnticipo);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//**** SE COMENTA POR QUE ESTA DUPLICANDO DESCUENTO ***************\n\t\t\t// if($TypeInvoice==66){\n\t\t\t// \t$queryCFDI=\"SELECT SUM(monto) as m\n\t\t\t// \t\t\t\tFROM notesorders_invoice \n\t\t\t// \t\t\t\tLEFT JOIN debtortrans on notesorders_invoice.transid_relacion = debtortrans.id\n\t\t\t// \t\t\t\tWHERE notesorders_invoice.transid = '\".$myrow['id'].\"'\";\n\t\t\t// \t// echo \"<br>QuerySql; <pre>\";\n\t\t\t// \t// \tprint_r($queryCFDI);\n\t\t\t// \t// echo \"</pre><br>\";\n\t\t\t// \t$resultCFDI=DB_query($queryCFDI,$db);\n\t\t\t// \t$myrowCFDI = DB_fetch_array($resultCFDI);\n\t\t\t// \t$dblImporteDescuentoAnticipo += $myrowCFDI['m'];\n\t\t\t// \t$blnFlagAnticipo3_3 = true;\n\t\t\t// \t$blnFacturaAnticipo3_3 = true;\n\t\t\t// \t//echo \"<br>Monto; \".$dblImporteDescuentoAnticipo;\n\t\t\t// }\n\t\t\t\t//<ANTICIPOS/>\n\t\t\t//blnFlagAnticipo3_3 ES UNA APLICACION DE ANTYICIPO\n\t\t\tif($blnFlagAnticipo3_3){\n\t\t\t\t$charelectronic=$charelectronic.'|'.($descuento + $dblImporteDescuentoAnticipo ) ; //Cad 01, pos 9\n\t\t\t}else{\n\t\t\t\t$charelectronic=$charelectronic.'|'.$descuento ; //Cad 01, pos 9\n\t\t\t}\n\t\t}else{\n\t\t\t$charelectronic=$charelectronic.'|'.$descuento ; //Cad 01, pos 9\n\t\t}\n\t\t\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|'; //Cad 01, pos 10\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; //Cad 01, pos 11\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda; //Cad 01, pos 12\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; //Cad 01, pos 13\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; //Cad 01, pos 14\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; //Cad 01, pos 15\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; //Cad 01, pos 16\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; //Cad 01, pos 17\n\n\t\t//cometarios nivel factura\n\t\t$charelectronic=$charelectronic.'|'.$myrow['invtext']; //Cad 01, pos 18\n\n\t\t//Agregar datos de CFDI 3.3\n\t\t$charelectronic=$charelectronic.'|'.$myrow['c_TipoDeComprobante']; // TipoDeComprobante //Cad 01, pos 20\n\t\t$charelectronic=$charelectronic.'|'.$myrow['c_UsoCFDI']; // UsoCFDI //Cad 01, pos 21\n\t\t$charelectronic=$charelectronic.'|'.$myrow['c_paymentid']; // MetodoPago //Cad 01, pos 22\n\t\t$charelectronic=$charelectronic.'|'.$myrow['claveFactura']; // Confirmacion //Cad 01, pos 23\n\t\t$charelectronic=$charelectronic.'|'.$myrow['decimalplaces']; // decimalplaces //Cad 01, pos 24\n\n\t\t// datos de la forma de pago\n\t\t//$charelectronic=$charelectronic.$charelectronicdetailUUID;\n\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\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\n\t\t//DATOS DE ANTICIPO\n\t\t$strSQLNotaCredito=\"\";\n\t\t$resultNotaCredito=\"\";\n\t\t//echo \"facturaversion:\".$_SESSION['FacturaVersion'];\n\t\tif ($_SESSION['FacturaVersion'] == \"3.3\") {\n\t\t\t//<ANTICIPOS>\n\t\t\t//Si no es una factura de anticipo obtenemos uuid relacionados(donde se esta aplicando)\n\t\t\t//\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br> Si no es una factura de anticipo obtenemos uuid relacionados(donde se esta aplicando)\";\n echo \"<br/>blnFacturaAnticipo3_3: \".$blnFacturaAnticipo3_3;\n echo \"<br/>TypeInvoice: \".$TypeInvoice;\n }\n $charRelacion = \"\";\n\t\t\tif (!$blnFacturaAnticipo3_3 and $TypeInvoice!=66) {\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br>iNGRESO 1\";\n }\n\t\t\t\t//$blnFlagAnticipo3_3 = true;\t\t\n\t\t\t\t/*DB_data_seek($resultAnticipo,0);\n\t\t\t\t$myRowAnticipo=DB_fetch_array($resultAnticipo);\n\t\t\t\t$dblImporteDescuentoAnticipo=$myRowAnticipo['subtotal'];\n\t\t\t\t$dblImporteDescuentoAnticipo=abs($dblImporteDescuentoAnticipo);*/\n\n $strSQLUUID = \" SELECT UUID FROM log_cancelacion_sustitucion WHERE transNo='\".$InvoiceNo.\"' AND type ='\".$TypeInvoice.\"'\";\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br> SQL sustitucion: \".$strSQLUUID;\n }\n $resultSQLUUID=DB_query($strSQLUUID,$db);\n if(DB_num_rows($resultSQLUUID)>0){\n while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n $charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n $charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n }\n\n }else{\n $strSQLUUID=\"SELECT debtortrans.uuid\n FROM stockmoves\n INNER JOIN (SELECT stockmoves.stkmovid\n FROM stockmoves\n INNER JOIN debtortrans on stockmoves.type = debtortrans.type and stockmoves.transno = debtortrans.transno and stockmoves.tagref = debtortrans.tagref\n inner join stockmaster on stockmoves.stockid = stockmaster.stockid\n AND stockmoves.type=\". $TypeInvoice .\"\n AND stockmoves.transno=\". $InvoiceNo .\"\n AND stockmoves.tagref=\". $tag .\"\n AND stockmaster.categoryid='\". $categoriaAnticipo .\"'\n AND stockmaster.units ='Actividad'\n AND (stockmoves.show_on_inv_crds=1 or stockmoves.stockid ='facturaremision')) dtstkmovid on stockmoves.stkmoveno = dtstkmovid.stkmovid\n INNER JOIN debtortrans on stockmoves.type = debtortrans.type and stockmoves.transno = debtortrans.transno and stockmoves.tagref = debtortrans.tagref ;\";\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br><br><pre>: ANTICIPOS\".$strSQLUUID.\"<br>\";\n }\n //********************** NUEVA CONSULTA PARA LOS ANTICIPOS **************************\n $strSQLUUID = \"SELECT DISTINCT debtortrans.folio, debtortrans.transno, debtortrans.type, transidanticipo, d.ref1 , (SELECT uuid FROM debtortrans d1 WHERE d1.id = d.ref1) AS uuid\n FROM salesinvoiceadvance \n INNER JOIN debtortrans ON debtortrans.id = salesinvoiceadvance.transidinvoice\n INNER JOIN debtortrans d ON d.id = salesinvoiceadvance.transidanticipo\n WHERE debtortrans.type = \". $TypeInvoice .\"\n AND debtortrans.transno = '\". $InvoiceNo .\"';\";\n\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br><br><pre>: ANTICIPOS2: \".$strSQLUUID.\"<br>\";\n }\n //********************** NUEVA CONSULTA PARA LOS ANTICIPOS **************************\n \n $resultSQLUUID=DB_query($strSQLUUID,$db);\n while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n $charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n $charelectronic=$charelectronic.'|07|'.$myrowUUID['uuid'];\n \n }\n }\n\n\t\t\t}\n if($blnFacturaAnticipo3_3==true and $TypeInvoice!=66) {\n $strSQLUUID = \" SELECT UUID FROM log_cancelacion_sustitucion WHERE transNo='\".$InvoiceNo.\"' AND type ='\".$TypeInvoice.\"'\";\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br> SQL sustitucion FLAGADVANCE: \".$strSQLUUID;\n }\n $resultSQLUUID=DB_query($strSQLUUID,$db);\n while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n $charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n $charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n }\n }\n\n\t\t\tif(isset($TypeInvoice) and $TypeInvoice==66){\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br>iNGRESO 2\";\n }\n\n $strSQLUUID = \" SELECT UUID FROM log_cancelacion_sustitucion WHERE transNo='\".$InvoiceNo.\"' AND type ='\".$TypeInvoice.\"'\";\n if($_SESSION['UserID']==\"desarrollo\"){\n echo \"<br> SQL sustitucion: \".$strSQLUUID;\n }\n $resultSQLUUID=DB_query($strSQLUUID,$db);\n if(DB_num_rows($resultSQLUUID)>0){\n\t\t\t\t\twhile ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n \t\t\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n \t\t\t\t\t$charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n \t\t\t\t\t\n \t\t\t\t}\n }else{\n $queryCFDI=\"SELECT '07' as c_TipoRelacion,debtortrans.uuid\n FROM notesorders_invoice \n LEFT JOIN debtortrans ON notesorders_invoice.transid_relacion = debtortrans.id\n WHERE notesorders_invoice.transid = '\".$myrow['id'].\"'\";\n $queryCFDI = \"SELECT DISTINCT '07' as c_TipoRelacion, debtortrans.folio, debtortrans.transno, debtortrans.type, transidanticipo, d.ref1 , (SELECT uuid FROM debtortrans d1 WHERE d1.id = d.ref1) AS uuid\n FROM salesinvoiceadvance \n INNER JOIN debtortrans ON debtortrans.id = salesinvoiceadvance.transidinvoice\n INNER JOIN debtortrans d ON d.id = salesinvoiceadvance.transidanticipo\n WHERE debtortrans.type = \". $TypeInvoice .\"\n AND debtortrans.transno = '\". $InvoiceNo .\"';\";\n $resultCFDI=DB_query($queryCFDI,$db);\n //echo \"<pre>sql:\".$queryCFDI;\n while ($myrowCFDI = DB_fetch_array($resultCFDI)) {\n $charelectronic=$charelectronic.'|'.chr(13).chr(10).'011';\n $charelectronic=$charelectronic.'|'.$myrowCFDI['c_TipoRelacion'];\n $charelectronic=$charelectronic.'|'.$myrowCFDI['uuid'];\n }\n\n }\n\t\t\t}\n\n\n\t\t\t//<ANTICIPOS/>\n\n\t\t\t//<NOTACREDITO>\n\t\t\t//echo \"<br>ver: \".$TypeInvoice;\n\t\t\tif(isset($TypeInvoice) and $TypeInvoice==11 ){\n\t\t\t\t$strSQLNotaCredito=\"SELECT debtortrans.id,debtortrans.uuid,'03' AS c_TipoRelacion\n\t\t\t\t\tFROM notesorderdetails\n\t\t\t\t\tLEFT JOIN debtortrans ON notesorderdetails.transid_invoice = debtortrans.id\n\t\t\t\t\tWHERE notesorderdetails.orderno = \".$myrow['order_'].\"\n\t\t\t\t\tGROUP BY debtortrans.id\n\t\t\t\t\tORDER BY debtortrans.id \";\n\t\t\t\t\n\t\t\t\t$resultNotaCredito=DB_query($strSQLNotaCredito,$db);\n\t\t\t\twhile ($myrowNCUUID=DB_fetch_array($resultNotaCredito)) {\n\t\t\t\t\t//validar si tiene relacion\n\t\t\t\t\t//if(isset($myrowNCUUID['uuid'])){\n\t\t\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'012';\n\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowNCUUID['c_TipoRelacion'].'|'.$myrowNCUUID['uuid'];\n\t\t\t\t\t\n\t\t\t\t\t//}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//<NOTACREDITO/>\n\n\n\t\t}\n\t\t//$dblImporteDescuentoAnticipo=$descuento + $dblImporteDescuentoAnticipo;\n\t\t$subtotalInvoice = $subtotalInvoice + $dblImporteDescuentoAnticipo + $montoNotesorders_invoice;\n\t\t$charelectronicdetailUUID='';\n\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 $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\t$colonia=$myrow['braddress6'];\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\n\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\t\t$usaactivos= true;\n\n\t\tif(($versionAddenda == 2 ) AND ($_SESSION['DatabaseName'] == 'erppisumma' OR $_SESSION['DatabaseName'] == 'erppisumma_CAPA' OR $_SESSION['DatabaseName'] == 'erppisumma_DES' ) ){\n\n\t\t\t$addendaLowes = \"LEFT JOIN stockaddendahomedepot ON stockaddendahomedepot.stockid = stockmoves.stockid AND stockaddendahomedepot.addendaid = 2 \";\n\t\t\t$upc = \",stockaddendahomedepot.upc_ean \";\n\t\t}else{\n\t\t\t$upc = \"\";\n\t\t\t$addendaLowes = \"\";\n\t\t}\n\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 \".$upc;\n\t\t\n\t\t$joins_activo .= \" LEFT JOIN leasingCharges ON stockmoves.ref2 = leasingCharges.idleasincharges \";\n\t\t$joins_activo .= $addendaLowes;\n $joins_activo .= \"LEFT JOIN fixedassets ON leasingCharges.serialno = fixedassets.serialno AND leasingCharges.barcode= fixedassets.barcode \";\n\t}\n\t\n\n $totalRowAnticipo=0;\n //\n if($_SESSION['UserID'] ==\"desarrollo\"){\n \t//echo \"<br>\".$rfccliente .\" \".$_SESSION['DesgloseIVA'];\n }\n //Se cambio el RFC ya que tenia el generico local como generico extranjero\n\tif ($rfccliente!=\"XEXX010101000\" OR $_SESSION['DesgloseIVA']==1){\n\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t$sqldetails = 'SELECT distinct stockmoves.stkmoveno,\n\t\t\t\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 ' . $strFiltroBombeo .'\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 .'\" '. $strSearchAnticipo . '\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 distinct 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.anticipo, stockmoves.ref2 ' . $cols_activo . '\n\t\t\t\tFROM stockmoves' . $joins_activo . ',stockmaster,stockcategory\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid ' . $strFiltroBombeo .'\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 .'\" '. $strSearchAnticipo . '\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\t\t\t';\n\t\t}\n\n\t\tif ($_SESSION['UserID'] == \"desarrollo\") {\n\t\t\techo \"<pre>sqldetails: 29147 \".$sqldetails;\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\tif($TypeInvoice == 11){\n \t$sqlAnt =\" SELECT abs(sum(qty* price)) totalAnt FROM stockmoves WHERE type = 11 AND transno = '\".$InvoiceNo.\"' AND qty<0 \";\n\n \t//echo \"SQL: \".$sql;\n \t$ResultAnt = DB_query($sqlAnt, $db);\n \tif(DB_num_rows($ResultAnt)>0){\n \t\t$blnFlagAnticipo3_3 = true;\n \t\t$rowAnt = DB_fetch_array($ResultAnt);\n \t\t$dblImporteDescuentoAnticipo = $rowAnt['totalAnt'];\n \t}\n \t\n }\n\t\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\tif(($TypeInvoice == '11' AND $myrow2['quantity'] >0) OR $TypeInvoice != '11'){// PARA NOTAS DE CREDITO CON ANT PROVISIONAL\n\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\n //echo \"<br>\".$subtotal. \" * \". $dblImporteDescuentoAnticipo . \" / \".$subtotalInvoice;\n //echo \"<br>\".$myrow2['subtotal']. \" * \". $dblImporteDescuentoAnticipo . \" / \".$subtotalInvoice;\n //dblImporteDescuentoAnticipo saber cuanto sobro de anticipo\n //PROVISIONAL PARA NOTAS DE CREDITO\n \n //PROVISIONAL PARA NOTAS DE CREDITO\n if($_SESSION['FacturaVersion'] == \"3.3\" and $blnFlagAnticipo3_3==true){\n \tif($myrow2['subtotal'] >=1.1 ){\n \t\t//Se omite opcion por el prorrateo\n \t\t//$totalRowAnticipo=(($myrow2['subtotal'] * $dblImporteDescuentoAnticipo) / $subtotalInvoice);\n \t\t$subPartida=$myrow2['subtotal'];\n \t\tif( $subPartida <= $dblImporteDescuentoAnticipo){\n \t\t\t$totalRowAnticipo = $subPartida -1;\n \t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t}elseif ($subPartida > $dblImporteDescuentoAnticipo) {\n \t\t\tif(($subPartida - $dblImporteDescuentoAnticipo) < 0.1){\n \t\t\t\t$totalRowAnticipo = $subPartida -1;\n \t\t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t\t}else{\n \t\t\t\t$totalRowAnticipo = $dblImporteDescuentoAnticipo;\n \t\t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t\t}\n \t\t}\n \t}else{\n \t\t$totalRowAnticipo='0.00';\n \t}\n\t }\n\t if($_SESSION['FacturaVersion'] == \"3.3\" and $blnFlagAnticipo3_3==true AND $TypeInvoice ='11'){ \n // PARA NOTA DE CREDITO\n\n\t }else{\n\t \t$totalRowAnticipo = $myrow2['anticipo'];\n\t }\n\t \n\n\t\t\tif(($versionAddenda == 2) AND ($_SESSION['DatabaseName'] == 'erppisumma' OR $_SESSION['DatabaseName'] == 'erppisumma_CAPA' OR $_SESSION['DatabaseName'] == 'erppisumma_DES' ) ){\n\t\t\t\t$stockid = $myrow2['upc_ean']; \n\n\t\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t\t$stockcantidad=number_format($myrow2['cantidad_activo'],$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t\t\t$stockcantidadCompleta = $myrow2['quantity'];\n\t\t\t\t}\n\t\t\t}\n else if ($usaactivos && !empty($myrow2['ref2'])){\n \t$stockid = $myrow2['barcode']; \n \t//$stockcantidad=number_format($myrow2['cantidad_activo'],$decimalplaces,'.','');\n \t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n \t$stockcantidadCompleta = $myrow2['quantity'];\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'].' '.$strLegendAnticipo.' ';\n\t\t\t}else{\n\t\t\t\t//$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t\t$stockdescrip=$myrow2['description'].' '.$strLegendAnticipo.' ';\n\t\t\t}\n\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t$stockdescrip=$myrow2['desc_activo'].' '.$strLegendAnticipo.' ';\n\t\t\t}\n\t\t\t// if (!empty($myrow2['upc_ean'])){\n\t\t\t// \t$UPCAddenda =$myrow2['upc_ean'];\n\t\t\t// }\n\t\t\t\n\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid ;\n\n\t\t\t\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: \".$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 if (strpos(\"@\".$_SESSION[\"DatabaseName\"], \"servillantas\")) {\n $traba=explode(\" \",$myrowprop['val']);\n $noTraba=$traba[0];\n $descrprop=$descrprop.' '.$myrowprop['label'].':'.$noTraba;\n }else{\n $descrprop=$descrprop.' '.$myrowprop['label'].':'.$myrowprop['val'];\n }\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$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\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\t\t\t// para tyqsa;\n\t\t\tif($TypeInvoice == 119 AND ($_SESSION['DatabaseName']=='erptycqsa' OR $_SESSION['DatabaseName']=='erptycqsa_CAPA') ){\n\t\t\t\t$sqlrestante = \"SELECT quantity ordenada, concat(' Cant. Restante: ',quantity-abs(sum(qty) ),' M3' )remisionada \n\t\t\t\t\t\tFROM debtortrans \n\t\t\t\t\t\tINNER JOIN stockmoves ON stockmoves.type = debtortrans.type AND debtortrans.transno = stockmoves.transno\n\t\t\t\t\t\tINNER JOIN salesorderdetails ON salesorderdetails.orderno = debtortrans.order_ AND stockmoves.stockid= salesorderdetails.stkcode\n\t\t\t\t\t\tWHERE debtortrans.order_='\".$orderno.\"' AND stockmoves.type =119 AND stockmoves.transno <='\".$InvoiceNo.\"' AND stockmoves.stockid='\".$stockid.\"' AND debtortrans.tagref IN (5,6,16);\";\n\t\t\t\t//echo \"<br> calculo restante= \".$sqlrestante;\n\t\t\t\t$resultrestante=DB_query($sqlrestante,$db);\n\t\t\t\twhile ($myrowrestante=DB_fetch_array($resultrestante)){\n\t\t\t\t\t$descrestante = $myrowrestante['remisionada'];\n\t\t\t\t}\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.$descrestante;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie.$descrestante;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative.$numberserie.$descrestante;\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\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\t$stockprecio=number_format($myrow2['fxprice'],$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($_SESSION['FacturaVersion'] == \"3.3\"){\n\t\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t\t//\t$stockneto=number_format(($myrow2['fxnet']/$myrow2['cantidad_activo']),$decimalplaces,'.','');\n\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'],$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\tif($blnFlagAnticipo3_3){\n\t\t\t\t\t\t//echo \"<br>((\".$myrow2['subtotal'].\" * \".$dblImporteDescuentoAnticipo.\")/\".$subtotalInvoice.\")\";\n\t\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'] - $totalRowAnticipo,$decimalplaces,'.','');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'],$decimalplaces,'.','');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif ($usaactivos && !empty($myrow2['ref2'])){\n\t\t\t\t\t$stockneto=number_format(($myrow2['fxnet']/$myrow2['cantidad_activo']),$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\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) {\t\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\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\n\t\t\t$subtotal=number_format($myrow2['totaldescuento'] + $totalRowAnticipo ,$decimalplaces,'.','');\n\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\t//Validación de No. pedimento\n\t\t\tif($_SESSION['DatabaseName'] == 'erppisumma_DES' || $_SESSION['DatabaseName'] == 'erppisumma' || $_SESSION['DatabaseName'] == 'erppisumma_CAPA'){\n\t\t\t\t$sqladuana=\"SELECT nopedimento\n\t\t\t\t\t\tFROM pediment_aduanas \n\t\t\t\t\t\tWHERE orderno='\" . $orderno . \"'\n\t\t\t \t\t\t\tAND stockid='\" . $stockid . \"'\n\t\t\t \t\t\t\tAND orderlineno = '\" . $movorderlineno . \"'\";\n\t if ($_SESSION['UserID'] == \"desarrollo\"){\n\t\t\t\t\t//echo '<br/> sql aduanas: '.$sqladuana;\n\t\t\t\t} \n\t\t\t\tdebug_sql($sqladuana, __LINE__,false,__FILE__);\n\t\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\t\tif (DB_num_rows($Result)==0) {\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\t$nopedimento=\"\";\n\t\t\t\t}else{\n\t\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t\t$nopedimento=$myrowaduana['nopedimento'];\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t\t\n\t\t\t\t\t//$numberaduana=$myrowaduana['noaduana'];\n\t\t\t\t\t//$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t\t//$nameaduana = $separaaduana[0];\n\t\t\t\t\t//$numberaduana= $separaaduana[1];\n\t\t\t\t\t//$fechaaduana= $separaaduana[2];\n\t\t\t\t\t/*if (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*){\n\t\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$nameaduana = $myrowaduana['aduana'];\n\t\t\t\t\t$numberaduana = $myrowaduana['noaduana'];\n\t\t\t\t\t$fechaaduana = $myrowaduana['fechaaduana'];\n\t\t\t\t\t$pedimento = $myrowaduana['pedimento'];*/\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t$nopedimento=\"\";\n\t\t\t}\n \n\t\t\tif($myrow['type'] == 66) { \n // Si es factura remision\n\t\t\t\t$ordernotmp = $myrow['orderno'];\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\t\t\t\t\t//Validación de No. pedimento\n\t\t\t\t\tif($_SESSION['DatabaseName'] == 'erppisumma_DES' || $_SESSION['DatabaseName'] == 'erppisumma' || $_SESSION['DatabaseName'] == 'erppisumma_CAPA'){\n\t\t\t\t\t\t$sqladuana=\"SELECT nopedimento\n\t\t\t\t\t\t\t\tFROM pediment_aduanas \n\t\t\t\t\t\t\t\tWHERE orderno='\" . $myrow['orderno'] . \"'\n\t\t\t\t\t \t\t\t\tAND stockid='\" . $stockid . \"'\n\t\t\t\t\t \t\t\t\tAND orderlineno = '\" . $movorderlineno . \"'\";\n\t\t\t if ($_SESSION['UserID'] == \"desarrollo\"){\n\t\t\t\t\t\t\techo '<br/> sql aduanas 66-1: '.$sqladuana;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t\t$fechaaduana = '';\n\t\t\t\t\t\t\t$nopedimento = $rowtmp['nopedimento'];\n\t\t\t\t\t\t\t$nameaduana = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\t\";\n\n\t\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t\t$nopedimento = $rowtmp['pedimento'];\n\t\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nopedimento;\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\t\t\ttaxauthorities.c_Impuesto\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\t\t\t\ttaxcalculationorder,\n\t\t\t\t\t\t\t\t\ttaxontax,\n\t\t\t\t\t\t\t\t\ttaxauthorities.description,\n\t\t\t\t\t\t\t\t\ttaxauthorities.c_Impuesto\n\t\t\t\t\t\t\t\t\tFROM stockmovestaxes\n\t\t\t\t\t\t\t\t\tLEFT JOIN taxauthorities ON taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t\t\t\tWHERE stkmoveno=\".$stkmoveno;\n\t\t\t}\n\n\t\t\tif($_SESSION['UserID'] ==\"desarrollo\"){\n\t\t\t\techo \"<br>sqlstockmovestaxes:<pre>\". $sqlstockmovestaxes .\"</pre>\";\n\t\t\t}\n\n \n debug_sql($sqlstockmovestaxes, __LINE__,$debug_sql,__FILE__);\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\tif ($_SESSION['UserID'] == \"admin\") {\n\t\t\t\t//echo \"<br>sqlstockmovestaxes 1: \".$sqlstockmovestaxes;\n\t\t\t}\n\t\t\t//Agregar datos de CFDI 3.3\n\t\t\tif(DB_num_rows($resultstockmovestaxes) > 0){\n\t\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t if(empty($myrow3['description']) == false){\n\t $impuesto=$myrow3['description'];\n\t }else{\n\t $impuesto=\"IVA\";\n\t }\n\t\t\t\t\t\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,$decimalplaces,'.','');\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t\tif($TipoAgrupacionXTag==1){\n\t\t\t\t\t\t//$taxratetotal=number_format(abs($myrow3['iva']),$decimalplaces,'.','');\n\t\t\t\t\t\t$taxratetotal = abs($myrow3['iva']);\n\t\t\t\t\t\t$taxratetotal = number_format($taxratetotal,$decimalplaces,'.','');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//$taxratetotal=number_format($myrow3['taxrate']*($subtot),$decimalplaces,'.','');\n\t\t\t\t\t\tif($_SESSION['FacturaVersion'] == \"3.3\"){\n\t\t\t\t\t\t\tif($blnFlagAnticipo3_3){\n\t\t\t\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * ($myrow2['subtotal'] - $totalRowAnticipo);\n\t\t\t\t\t\t\t\t//$taxratetotal = $myrow3['taxrate'] * ($myrow2['subtotal'] - (($myrow2['subtotal'] * $dblImporteDescuentoAnticipo) / $subtotalInvoice));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * ($myrow2['subtotal']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * ($myrow2['subtotal']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$taxratetotal = number_format($taxratetotal,$decimalplaces,'.','');\n\t\t\t\t\t}\n\n\t\t\t\t\t$taxratetotal=number_format($taxratetotal,$decimalplaces,'.','');\n\t\t\t\t\t\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$myrow3['c_Impuesto']; //Codigo de impuesto\n\n\t\t\t\t\t//Obtener factor\n\t\t\t\t\t$c_TipoFactor = \"\";\n\t\t\t\t\t$sqlFactor = \"SELECT sat_tasas.c_TipoFactor\n\t\t\t\t\t\t\t\tFROM stockmaster\n\t\t\t\t\t\t\t\tLEFT JOIN taxcategories ON taxcategories.taxcatid = stockmaster.taxcatid\n\t\t\t\t\t\t\t\tLEFT JOIN sat_tasas ON sat_tasas.id = taxcategories.id_Tasa\n\t\t\t\t\t\t\t\tWHERE stockmaster.stockid = '\".$myrow2['stockid'].\"'\";\n\t\t\t\t\tif($_SESSION['UserID'] == 'desarrollo'){\n\t\t\t\t\t\t//echo \"<br><pre>$sqlFactor</pre>\";\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$resultFactor=DB_query($sqlFactor,$db);\n\t\t\t\t\tif(DB_num_rows($resultFactor) > 0){\n\t\t\t\t\t\t$rowFactor = DB_fetch_array($resultFactor);\n\t\t\t\t\t\t$c_TipoFactor = $rowFactor['c_TipoFactor']; //Factor de impuesto\n\t\t\t\t\t}\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$c_TipoFactor; //Factor de impuesto\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\t$sqlImp = \"SELECT \n taxauthorities.c_Impuesto,\n taxauthrates.taxrate,\n sat_tasas.c_TipoFactor, taxauthorities.description\n FROM stockmaster\n LEFT JOIN taxauthrates ON taxauthrates.taxcatid = stockmaster.taxcatid\n LEFT JOIN taxauthorities ON taxauthorities.taxid = taxauthrates.taxauthority\n LEFT JOIN taxcategories ON taxcategories.taxcatid = stockmaster.taxcatid\n LEFT JOIN sat_tasas ON sat_tasas.id = taxcategories.id_Tasa\n WHERE stockmaster.stockid = '\".$myrow2['stockid'].\"'\";\n $ErrMsg = _('El Sql que fallo fue');\n $DbgMsg = _('No se pudo obtener el impuesto del articulo '.trim($datos [2]));\n //echo \"<br>\".$sqlAnt.\"<br>\";\n $resultImp = DB_query($sqlImp, $db, $ErrMsg, $DbgMsg, true);\n //$importe = $importe - trim(number_format(($descuentoRow), $decimalplaces, '.', ''));\n\n if (DB_num_rows($resultImp) == 1) {\n $rowImp = DB_fetch_array($resultImp);\n $Impuesto = $rowImp['c_Impuesto'];\n $TipoFactor = $rowImp['c_TipoFactor'];\n $TasaOCuota = $rowImp['taxrate'];\n $impuesto=$rowImp['description'];\n if($TasaOCuota == 0) {\n $TasaOCuota = '0.000000';\n }\n }\n $taxratetotal = $TasaOCuota * $myrow2['subtotal'];\n\t\t\t\t$taxratetotal = number_format($taxratetotal, $decimalplaces,'.','');\n //$taxrate=number_format($myrow3['taxrate']*100,$decimalplaces,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$TasaOCuota;\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$Impuesto;\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$TipoFactor;\n\t\t\t}\n\n\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.'|'.$nopedimento;\n $charelectronicdetail=$charelectronicdetail.''.\"|\".$descrestante;\n\t\t\t\t$nolinea=$nolinea+1;\n\t /**FIN DE CALCULO DE EMISIONES***/\n\n\t\t\t}// FIN NOTAS CREDITO ANT PROVISIONAL \n\n \n }\n\n //************************************************************************************************\n // Al momento de aplicar el descuento tenemos un sobrante regresarselo a la(s) factura de anticipo\n //************************************************************************************************\n if($dblImporteDescuentoAnticipo >0){\n \t$sqlDevolucionAnticipo=\"SELECT stockmoves.stkmoveno as stkmoveno1, stkmove2.stkmoveno,stkmove2.price,stkmove2.qtyinvoiced\n\t\t\t\t\t\t\t\t\tFROM stockmoves\n\t\t\t\t\t\t\t\t\tINNER JOIN stockmaster on stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\t\tAND stockmoves.type='\". $TypeInvoice .\"'\n\t\t\t\t\t\t\t\t\tAND stockmoves.transno='\". $InvoiceNo .\"'\n\t\t\t\t\t\t\t\t\tAND stockmoves.tagref='\". $tag .\"'\n\t\t\t\t\t\t\t\t\tAND stockmaster.categoryid='\". $categoriaAnticipo .\"'\n\t\t\t\t\t\t\t\t\tAND stockmaster.units ='Actividad'\n\t\t\t\t\t\t\t\t\tAND (stockmoves.show_on_inv_crds=1 or stockmoves.stockid ='facturaremision')\n\t\t\t\t\t\t\t\t\tinner join stockmoves stkmove2 on stkmove2.stkmoveno =stockmoves.stkmovid\n\t\t\t\t\t\t\t\t\tgroup by stkmove2.stkmoveno\n\t\t\t\t\t\t\t\t\torder by stkmove2.stkmoveno desc;\";\n\t\t\t\t\t\t\t\t\t//echo \"<br>sql anrin:<pre>\".$sqlDevolucionAnticipo;\n\t\t\t$rsDevolucionAnticipo=DB_query($sqlDevolucionAnticipo,$db);\n\n\t\t\t$dblPendienteAplicar=$dblImporteDescuentoAnticipo;\n\t\t\twhile ($myrowDevolucionAnticipo = DB_fetch_array($rsDevolucionAnticipo)) {\n\n\t\t\t\t$Aplicado=($myrowDevolucionAnticipo['price'] * $myrowDevolucionAnticipo['qtyinvoiced']);\n\t\t\t\t//echo \"<br>plicado: \".$Aplicado;\n\t\t\t\t//echo \"<br>dblPendienteAplicar: \".$dblPendienteAplicar;\n\t\t\t\tif($dblPendienteAplicar > abs($Aplicado)){\n\t\t\t\t\t$dblPendienteAplicar = $Aplicado;\n\t\t\t\t}\n\n\t\t\t\tif($dblImporteDescuentoAnticipo >0){\n\t\t\t\t\t$sqlAplicarRegresoFactura=\"UPDATE stockmoves SET qtyinvoiced = (qtyinvoiced + \".$dblPendienteAplicar / $myrowDevolucionAnticipo['price'].\") WHERE stkmoveno='\".$myrowDevolucionAnticipo['stkmoveno'].\"'\";\n\t\t\t\t\t//$rs =DB_query($sqlAplicarRegresoFactura,$db);\n\t\t\t\t\t//echo \"<br>SQL<pre>\". $sqlAplicarRegresoFactura;\n\n\t\t\t\t\t$sqlAplicarRegresoAplicacion=\"UPDATE stockmoves SET qty = (qty - \".$dblPendienteAplicar / $myrowDevolucionAnticipo['price'].\") WHERE stkmoveno='\".$myrowDevolucionAnticipo['stkmoveno1'].\"'\";\n\t\t\t\t\t//echo \"<br>SQL<pre>\". $sqlAplicarRegresoAplicacion;\n\t\t\t\t\t//$rs =DB_query($sqlAplicarRegresoAplicacion,$db);\n\n\t\t\t\t}\n\n\t\t\t\t$dblImporteDescuentoAnticipo -= $dblPendienteAplicar;\n\t\t\t\t$dblPendienteAplicar=$dblImporteDescuentoAnticipo;\n\n\t\t\t}\n }\n\n\t}else{//\n\t\t//echo \"<br> XAXX010101000: \".$TipoAgrupacionXTag;\n\t\tif($TipoAgrupacionXTag==1 and $TypeInvoice <> 111){\n\t\t\t$sqldetails = 'SELECT distinct 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\t/*sum((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\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\t\tsum(stockmoves.totaldescuento) as totaldescuento,\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 '. $strFiltroBombeo .'\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 .'\" '. $strSearchAnticipo . '\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 distinct 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\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\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 sum(stockmoves.totaldescuento) as totaldescuento,\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 '. $strFiltroBombeo .'\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 .'\" '. $strSearchAnticipo . '\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\t\tGROUP BY 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) ,\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)))) ,\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 ,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) ,\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,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV,\n\t\t\t\t\t \n\t\t\t\t\t\tstockmaster.longdescription,\n\t\t\t\t\t\tstockmaster.mbflag,\n stockmoves.ref4,\n stockmaster.flagadvance';\n\t\t}\n\t\tif ($_SESSION['UserID'] == \"desarrollo\") {\n\t\t\t//echo \"<pre>sqldetails: 3684 \".$sqldetails;\n\t\t}\n debug_sql($sqldetails, __LINE__,$debug_sql,__FILE__);\n $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\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\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\n if($_SESSION['FacturaVersion'] == \"3.3\" and $blnFlagAnticipo3_3==true){\n \tif($myrow2['subtotal'] >=1.1){\n \t\t//Se omite opcion por el prorrateo\n \t\t//$totalRowAnticipo=(($myrow2['subtotal'] * $dblImporteDescuentoAnticipo) / $subtotalInvoice);\n \t\t$subPartida=$myrow2['subtotal'];\n \t\tif( $subPartida <= $dblImporteDescuentoAnticipo){\n \t\t\t$totalRowAnticipo = $subPartida -1;\n \t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t}elseif ($subPartida > $dblImporteDescuentoAnticipo) {\n \t\t\tif(($subPartida - $dblImporteDescuentoAnticipo) < 0.1){\n \t\t\t\t$totalRowAnticipo = $subPartida -1;\n \t\t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t\t}else{\n \t\t\t\t$totalRowAnticipo = $dblImporteDescuentoAnticipo;\n \t\t\t\t$dblImporteDescuentoAnticipo -= $totalRowAnticipo;\n \t\t\t}\n \t\t}\n \t}else{\n \t\t$totalRowAnticipo='0.00';\n \t}\n\t }\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\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\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\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\t\t\t\t\n }\n\t\t\t\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//para tyqsa \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\n\t\t\t//$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\tif($_SESSION['FacturaVersion'] == \"3.3\"){\n\t\t\t\tif($blnFlagAnticipo3_3){\n\t\t\t\t\t//echo \"<br>((\".$myrow2['subtotal'].\" * \".$dblImporteDescuentoAnticipo.\")/\".$subtotalInvoice.\")\";\n\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'] - $totalRowAnticipo,$decimalplaces,'.','');\n\t\t\t\t}else{\n\t\t\t\t\t$stockneto=number_format($myrow2['subtotal'],$decimalplaces,'.','');\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\t\t\t\n\t\t\t}\n\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, taxauthorities.c_Impuesto\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\tif ($_SESSION['UserID'] == \"desarrollo\") {\n\t\t\t\techo \"<br>sqlstockmovestaxes 2: \".$sqlstockmovestaxes;\n\t\t\t}\n\t\t\t//Agregar datos de CFDI 3.3\n\t\t\tif(DB_num_rows($resultstockmovestaxes)>0){\n\t\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,$decimalplaces,'.','');\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t\t//$subtot = number_format($myrow2['subtotal'], 2); //Siempre se manejo en 2\n\t\t\t\t\t//$taxratetotal=number_format($myrow3['taxrate']*($subtot),$decimalplaces,'.','');\n\t\t\t\t\t\n\t\t\t\t\t$taxratetotal = $myrow3['taxrate'] * $myrow2['subtotal'];\n\t\t\t\t\t$taxratetotal = number_format($taxratetotal, $decimalplaces,'.','');\n\n\t\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$myrow3['c_Impuesto']; //Codigo de impuesto\n\n\t\t\t\t\t//Obtener factor\n\t\t\t\t\t$c_TipoFactor = \"\";\n\t\t\t\t\t$sqlFactor = \"SELECT sat_tasas.c_TipoFactor\n\t\t\t\t\t\t\t\tFROM stockmaster\n\t\t\t\t\t\t\t\tLEFT JOIN taxcategories ON taxcategories.taxcatid = stockmaster.taxcatid\n\t\t\t\t\t\t\t\tLEFT JOIN sat_tasas ON sat_tasas.id = taxcategories.id_Tasa\n\t\t\t\t\t\t\t\tWHERE stockmaster.stockid = '\".$myrow2['stockid'].\"'\";\n\t\t\t\t\tif ($_SESSION['UserID'] == \"desarrollo\") {\n\t\t\t\t\t\techo \"<br>sqlstockmovestaxes 2: \".$sqlFactor;\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\n\t\t\t\t\t$resultFactor=DB_query($sqlFactor,$db);\n\t\t\t\t\tif(DB_num_rows($resultFactor) > 0){\n\t\t\t\t\t\t$rowFactor = DB_fetch_array($resultFactor);\n\t\t\t\t\t\t$c_TipoFactor = $rowFactor['c_TipoFactor']; //Factor de impuesto\n\t\t\t\t\t}\n\t\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$c_TipoFactor; //Factor de impuesto\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\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\n\t\t\t$subtotal=number_format($myrow2['totaldescuento'] + $totalRowAnticipo ,$decimalplaces,'.','');\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal ;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\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\n\t\t\t//Validación de No. pedimento\n\n if($_SESSION['DatabaseName'] == 'erppisumma_DES' || $_SESSION['DatabaseName'] == 'erppisumma' || $_SESSION['DatabaseName'] == 'erppisumma_CAPA'){\n\t\t\t\t$sqladuana=\"SELECT nopedimento\n\t\t\t\t\t\t\tFROM pediment_aduanas \n\t\t\t\t\t\t\tWHERE orderno=\" . $orderno . \"\n\t\t\t\t \t\t\t\tAND stockid='\" . $myrow2['stockid'] . \"'\n\t\t\t\t \t\t\t\tAND orderlineno = '\" . $movorderlineno . \"'\";\n\n\t\t\t\tif ($_SESSION['UserID'] == \"desarrollo\"){\n\t\t\t\t\t//echo '<br/> sql aduanas 2: '.$sqladuana;\n\t\t\t\t}\n\t\t\t\t debug_sql($sqladuana, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$nopedimento=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}else{\n\t\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t\t$nopedimento= $myrowaduana['nopedimento'];\n\t\t\t\t\t\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}else{\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$nopedimento=\"\";\n\t\t\t\t$fechaaduana=\"\";\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\t\t\t\t\t//Validación de No. pedimento\n\t\t\t\t\tif($_SESSION['DatabaseName'] == 'erppisumma_DES' || $_SESSION['DatabaseName'] == 'erppisumma' || $_SESSION['DatabaseName'] == 'erppisumma_CAPA'){\n\t\t\t\t\t\t$sqladuana=\"SELECT nopedimento\n\t\t\t\t\t\t\t\tFROM pediment_aduanas \n\t\t\t\t\t\t\t\tWHERE orderno='\" . $ordernotmp . \"'\n\t\t\t\t\t \t\t\t\tAND stockid='\" . $stockid . \"'\n\t\t\t\t\t \t\t\t\tAND orderlineno = '\" . $movorderlineno . \"'\";\n\t\t\t if ($_SESSION['UserID'] == \"desarrollo\"){\n\t\t\t\t\t\t\techo '<br/> sql aduanas 66-2: '.$sqladuana;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t\t$fechaaduana = '';\n\t\t\t\t\t\t\t$nopedimento = $rowtmp['nopedimento'];\n\t\t\t\t\t\t\t$nameaduana = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\t$SQL = \"\n\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDATE_FORMAT(purchorderdetails.datecustoms,'%Y-%m-%d') AS fechaaduana,\n\t\t\t\t\t\t\tpedimento,\n\t\t\t\t\t\t\tcustoms AS aduana\n\t\t\t\t\t\t\tFROM purchorders\n\t\t\t\t\t\t\tINNER JOIN purchorderdetails\n\t\t\t\t\t\t\tON purchorderdetails.orderno = purchorders.orderno\n\t\t\t\t\t\t\tWHERE purchorders.requisitionno IN ($ordernotmp)\n\t\t\t\t\t\t\tAND purchorderdetails.itemcode = '$stockid'\n\t\t\t\t\t\t\";\n\t\t\t\t\t\tdebug_sql($SQL, __LINE__,$debug_sql,__FILE__);\n\t\t\t\t\t\t$rstmp = DB_query($SQL, $db);\n\n\t\t\t\t\t\tif($rowtmp = DB_fetch_array($rstmp)) {\n\t\t\t\t\t\t\t$fechaaduana = $rowtmp['fechaaduana'];\n\t\t\t\t\t\t\t$nopedimento = $rowtmp['pedimento'];\n\t\t\t\t\t\t\t$nameaduana = $rowtmp['aduana'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \n\t\t\t$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\n\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.'|'.$nopedimento;\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 }elseif($nivelfacturacion==3){\n debug_sql('Productos manufacturacios', __LINE__,$debug_sql,__FILE__);\n }\n\t// \t die(\"END XSA\");\n\n\tif ($rfccliente==\"XEXX010101000\" && $_SESSION['DesgloseIVA']!=1){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronictaxsfederal.$charelectronictaxs.$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 origsinal <br>'.$cadenaenviada, __LINE__,true,__FILE__,'blue');\n \n if ($_SESSION['UserID'] == \"desarrollo\") {\n \techo \"<pre><br> Cadena Original: \".$cadenaenviada.\"<br><pre/>\";\t\n }\n \n return $cadenaenviada;\n}",
"public function createInvoice($projectId = ''){\r\n if($projectId!=''){\r\n \t $this->load->helper('ExactOnline/vendor/autoload');\r\n \t\t$this->load->model('Vtigerexactonline_model');\r\n \t\t$this->load->model('Exactonline_model');\r\n \t\t$this->load->model('Projects_model');\r\n \t\t// get all projects having erp system afas with mailchimp.\r\n $projects = $this->db->get_where('projects', array('id' => $projectId))->result_array();\r\n if(!empty($projects)){\r\n \tforeach ($projects as $p_key => $p_value) {\r\n $projectId = $p_value['id'];\r\n if($this->Projects_model->getValue('cms', $projectId)!='vtiger')\r\n continue;\r\n $lastExecution = $this->Projects_model->getValue('invoice_export_last_execution', $projectId);\r\n $customersInterval = $this->Projects_model->getValue('orders_interval', $projectId);\r\n $enabled = $this->Projects_model->getValue('orders_enabled', $projectId);\r\n $import_option = $this->Projects_model->getValue('vtiger_import_option', $projectId)?$this->Projects_model->getValue('vtiger_import_option', $projectId):'';\r\n // check if the last execution time is satisfy the time checking.\r\n if($import_option == 'invoices' && $enabled == '1' && ($lastExecution == '' || ($lastExecution + ($customersInterval * 60) <= time()))){\r\n //reset last execution time\r\n $this->Projects_model->saveValue('invoice_export_last_execution', time(), $projectId);\r\n // get the offset and amount to import customers. \r\n $currentOrdersOffset = $this->Projects_model->getValue('invoice_export_vtiger_offset', $projectId) ? $this->Projects_model->getValue('invoice_export_vtiger_offset', $projectId) : '';\r\n $ordersAmount= $this->Projects_model->getValue('orders_amount', $projectId) ? $this->Projects_model->getValue('orders_amount', $projectId) : 10;\r\n $invoiceId \t= isset($_GET['invoiceId'])?$_GET['invoiceId']:null; \r\n //--------------- make exact connection ----------------------------------//\r\n \t\t\t\t\t$this->Exactonline_model->setData(\r\n \t\t\t\t\t\tarray(\r\n \t\t\t\t\t\t\t'projectId' => $projectId,\r\n \t\t\t\t\t\t\t'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\r\n \t\t\t\t\t\t\t'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\r\n \t\t\t\t\t\t\t'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\r\n \t\t\t\t\t\t)\r\n \t\t\t\t\t);\r\n \t\t\t\t\t$connection = $this->Exactonline_model->makeConnection($projectId);\r\n \t\t\t\t\t// get invoice from exactonline\r\n \t\t\t\t\t$getVtigerInvoice = $this->Vtigerexactonline_model->getVtigerInvoice($projectId, $currentOrdersOffset , $ordersAmount);\r\n \t\t\t\t\tif(!empty($getVtigerInvoice)){\r\n \t\t\t\t\t\tforeach ($getVtigerInvoice as $inv_key => $inv_value) {\r\n \t\t\t\t\t\t\t$getRequestedInvoice = $this->Vtigerexactonline_model->getRequestedInvoice($projectId, $inv_value['id']);\r\n \t\t\t\t\t\t\tif($getRequestedInvoice){\r\n $currentOrdersOffset = $currentOrdersOffset + count($getVtigerInvoice);\r\n $this->Projects_model->saveValue('invoice_export_vtiger_offset', $currentOrdersOffset, $projectId);\r\n $totalInvoiceImportSuccess = $this->Projects_model->getValue('total_invoice_import_success', $projectId)?$this->Projects_model->getValue('total_invoice_import_success', $projectId):0;\r\n $totalInvoiceImportError = $this->Projects_model->getValue('total_invoice_import_error', $projectId)?$this->Projects_model->getValue('total_invoice_import_error', $projectId):0;\r\n \t\t\t\t\t\t\t\t// import invoice in exactonline\r\n \t\t\t\t\t\t\t\t$sendInvoice = $this->Vtigerexactonline_model->importInvoicesToExact($connection, $projectId, $getRequestedInvoice);\r\n if($sendInvoice['status']==2){\r\n continue;\r\n } else if($sendInvoice['status']==0){\r\n $totalInvoiceImportError++;\r\n } else{\r\n $totalInvoiceImportSuccess++;\r\n }\r\n $this->Projects_model->saveValue('total_invoice_import_success', $totalInvoiceImportSuccess, $projectId);\r\n $this->Projects_model->saveValue('total_invoice_import_error', $totalInvoiceImportError, $projectId);\r\n \t\t\t\t\t\t\t\tproject_error_log($projectId, 'importInvoices',$sendInvoice['message']);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else{\r\n $this->Projects_model->saveValue('invoice_export_vtiger_offset', null, $projectId);\r\n \t\t\t\t\t} \r\n }\r\n }\r\n } \r\n }\r\n $this->updateInvoicesToVtiger();\r\n\t}",
"private function importSales()\n {\n $sales = new Sales();\n $userid = Auth::user()->id;\n\n if (($handle = fopen($_FILES['import_file']['tmp_name'], \"r\")) !== FALSE) {\n $i = 0;\n while (($row = fgets($handle, 4096)) !== FALSE) {\n $i++;\n if ($i == 1) continue;\n\n $csvRow = str_getcsv($row, \"\\n\");\n foreach($csvRow as &$row){\n $row = str_getcsv($row, \";\");\n\n if (count($row) < 7){\n echo \"<span style='color: red'>Záznam nemá správny formát</span><br>\" . count($row);\n continue;\n }\n\n $products = '';\n if (isset($row[7])){\n $products = $row[7];\n }\n\n try{\n $store = $sales->create([\n 'user_id' => $userid,\n 'company_id' => session('selectedCompany'),\n 'products' => $products,\n 'total_price' => $row[0],\n 'fik' => $row[1],\n 'bkp' => $row[2],\n 'receiptNumber' => $row[3],\n 'premiseId' => $row[5],\n 'cash_register' => $row[6],\n 'receipt_time' => $row[4],\n 'not_sent' => 0,\n ]);\n echo \"<span style='color: green'>Záznam \" . implode(\";\",$row) . \" sa úspešne naimportoval.</span><br>\";\n }\n catch (\\Illuminate\\Database\\QueryException $e){\n echo \"<span style='color: red'>Záznam \" . implode(\";\",$row) . \" sa nepodarilo importovať.</span><br>\";\n }\n }\n }\n fclose($handle);\n }\n\n echo 'hotovo';\n }",
"function XSAInvoicingCreditdirect($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t// *********************************************** //\n // ********************************************** //\n // ******** No dejar echo en la funcion *********//\n // ******** Declarar Variables a usar ******** //\n // ******** Afecta al punto de venta ********* //\n // ****************************************** //\n // ***************************************** //\n \n\t//inicializo la variable $imprimepublico\n\t$imprimepublico=0;\t\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie.$folio;\n\t$serieelect=$serie;\n\t$folioelect=$folio;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t$detallerecibos = \"\";\n\t// consulto datos de la factura\n\t$SQLInvoice = \"SELECT\n\t\t\t\treplace(debtortransmovs.origtrandate,'-','/') as origtrandate,\n\t\t\t\tSUM(abs(debtortransmovs.ovamount)) AS ovamount,\n\t\t\t\tSUM(abs(debtortransmovs.ovgst)) AS ovgst,\n\t\t\t\tdebtortransmovs.currcode,\n\t\t\t\tdebtortransmovs.rate as cambio,\n\t\t\t\tdebtortransmovs.order_,\n\t\t\t\treplace(debtortransmovs.trandate,'-','/') as trandate,\n\t\t\t\tdebtortransmovs.debtorno,\n\t\t\t\tIF(relacion_factoraje.iddebtortrans IS NOT NULL, suppliers.taxid,custbranch.taxid) as rfc,\n\t\t\t\tIF(relacion_factoraje.iddebtortrans IS NOT NULL, suppliers.suppname,debtorsmaster.name) as name,\n\t\t\t\tdebtorsmaster.address1,\n\t\t\t\tdebtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,\n\t\t\t\tdebtorsmaster.address4,\n\t\t\t\tdebtorsmaster.address5,\n\t\t\t\tdebtortransmovs.branchcode,\n\t\t\t\tcustbranch.braddress1,\n\t\t\t\tcustbranch.braddress2,\n\t\t\t\tcustbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,\n\t\t\t\tcustbranch.braddress5,\n\t\t\t\tcustbranch.braddress6,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.specialinstructions,\n\t\t\t\tcustbranch.brpostaddr1,\n\t\t\t\tcustbranch.brpostaddr2,\n\t\t\t\tcustbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,\n\t\t\t\tcustbranch.brpostaddr5,\n\t\t\t\tcustbranch.brpostaddr6,\n\t\t\t\tcustpais as brpostaddr7,\n\t\t\t\twww_users.realname,\n\t\t\t\tdebtortransmovs.transno,\n\t\t\t\tdebtortrans.reference,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tdebtortrans.paymentname,\n\t\t\t\tIFNULL(debtortrans.nocuenta,IFNULL(custbranch.nocuenta,'')) as nocuenta,\n\t\t\t\tdebtortrans.observf,\n\t\t\t\tIFNULL(paymentmethods.codesat,'') as codesat,\n\t\t\t\tdebtortrans.id,\n\t\t\t\tdebtortrans.invtext,\n\t\t\t\tcustbranch.custpais\n\t\t\tFROM debtortransmovs\n\t\t\t\tINNER JOIN debtortrans ON debtortrans.type = debtortransmovs.type AND debtortrans.transno = debtortransmovs.transno\n\t\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\t\tLEFT JOIN relacion_factoraje ON relacion_factoraje.iddebtortrans = debtortrans.id\n\t\t\t\tLEFT JOIN suppliers ON suppliers.supplierid = relacion_factoraje.supplierid\n\t\t\t\t,debtorsmaster,custbranch, www_users\n\t\t\tWHERE debtortransmovs.type=$TypeInvoice\n\t\t\t\tAND debtortransmovs.transno=$InvoiceNo\n\t\t\t\tAND debtortransmovs.tagref=$tag\n\t\t\t\tAND debtortransmovs.debtorno=debtorsmaster.debtorno\n\t\t\t\tAND debtortransmovs.debtorno=custbranch.debtorno\n\t\t\t\tAND debtortransmovs.branchcode=custbranch.branchcode\n\t\t\t\tAND www_users.userid = debtortransmovs.userid\n\t\t\tGROUP BY debtortransmovs.transno\";\n\n\n\t\t\t// echo \"<br> <pre>\".$SQLInvoice;\n\n\n\t$Result=DB_query($SQLInvoice,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t{\n\t\t\t$myrow = DB_fetch_array($Result);\n\t\t\t// fecha emision\n\t\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t\t$UserRegister=\"\";//$myrow['UserRegister'];\n\t\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t\n\t\t\t// subtotal\n\t\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t\t$nombre=$myrow['name'];\n\n\t\t\t\n\t\t\t$subtotal= number_format($myrow['ovamount'], 2, '.', '');\n\t\t\tif ((strlen($rfccliente)<12) OR (strlen($rfccliente)>=14)){\n\t\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t\t$nombre=\"Publico en General\";\n\t\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t\t$imprimepublico=1;\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t\t// total factura\n\t\t\t$total=number_format($myrow['ovamount']+$myrow['ovgst'],2,'.','');\n\t\t\t$charelectronic=$charelectronic.'|'.abs($total);\n\t\t\t// total de iva\n\t\t\t$iva=number_format($myrow['ovgst'],2,'.','');\n\t\t\t// transladado\n\t\t\t$charelectronic=$charelectronic.'|'.abs($iva);\n\t\t\t// retenido\n\t\t\t$ivaret=0;\n\t\t\t$charelectronic=$charelectronic.'|'.abs($ivaret);\n\t\t\t//descuento\n\t\t\t//$descuento=number_format(0,2,'.','');\n\t\t\t$descuento='0.00';\n\t\t\t$charelectronic=$charelectronic.'|'.($descuento);\n\t\t\t//motivo descuento\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t\t// tipo de moneda\n\t\t\t$moneda=$myrow['currcode'];\n\t\t\t// CANTIDAD CON LETRAS\n\t\t\t$totaletras=abs($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$separa=explode(\".\",$totaletras);\n\t\t\tif (count($separa) == 1) {\n $separa[1] = 0;\n }\n\t\t\t$montoctvs2 = $separa[1];\n\t\t\t$montoctvs1 = $separa[0];\n\t\t\tif ($montoctvs2>995){\n\t\t\t\t$montoctvs1=$montoctvs1+1;\n\t\t\t}\n\t\t\t$montoletra=Numbers_Words::toWords($montoctvs1,'es');\n\t\t\t$totaletras=number_format($totaletras,2);\n\t\t\t$separa=explode(\".\",$totaletras);\n\t\t\t$montoctvs2 = $separa[1];\n\t\t\tif ($montoctvs2>995){\n\t\t\t\t$montoctvs2=0;\n\t\t\t}\n\t\t\t$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\t\tif ($moneda=='MXN'){\n\t\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t\t// tipo moneda\n\t\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t\t// tipo de cambio\n\t\t\t$rate=number_format($myrow['cambio'],4,'.','');\n\t\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t\t// numero de orden para referencia\n\t\t\t$ordenref=$myrow['order_'];\n\t\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t\t// observaciones 1: vendedores\n\t\t\t$vendedor=$myrow['realname'];\n\t\t\t$observaciones1='Vendedor: '.' '.$vendedor;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t\t\n // observaciones 2\n\t\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t\t FROM legalbusinessunit l, tags t\n\t\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t\t\n $Result= DB_query($SQL,$db);\n \n\t\t\tif (DB_num_rows($Result)==1) {\n\t\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t\t$comments=trim($myrowtags['comments']);\n\t\t\t}\n\t\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\n\t\t\t$metodoPago = trim($myrow['codesat']);\n\t\t\n\t\t\tif($metodoPago == \"\") {\n\t\t\t\t$metodoPago = \"99\";\n\t\t\t}\n\n\t\t\t/*\n\t\t\t$metodopago = $myrow['paymentname'];\n\t\t\tif ($metodopago==\"\") {\n\t\t\t\t$metodopago = \"No Identificado\";\n\t\t\t}\n\t\t\t*/\n\n\t\t\t$nocuenta = $myrow['nocuenta'];\n\t\t\tif ($nocuenta==\"\") {\n\t\t\t\t$nocuenta = \"No Identificado\";\n\t\t\t}\n\n\t\t\t// observaciones 3\n\t\t\t$observaciones3='Id Nota :'.$InvoiceNo;//' '.$comments .' usr:'.$UserRegister;\n\t\t\t$TypeInvoice.\"\n\t\t\tAND debtortransmovs.transno=\" . $InvoiceNo . \"\n\t\t\tAND debtortransmovs.tagref=\" . $tag .\n\n\t\t\t$observaciones3 = $observaciones3 . $detallerecibos . \"; \" ;// \"Este comprobante es complementario a los expedidos en la fecha y folios descritos en cada partida detallada arriba\";\n\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones3 . $detallerecibos;\n\n\t\t\t//SE AGREGA NUEVO CAMPO INFORMACION EXTRA\n\t\t\t$charelectronic=$charelectronic . '|' . '';\n\n\t\t\t// datos de la forma de pago\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\t\n\t\t\t$terminospago=\"Pago en una sola exhibicion\";\n\t\t\tif(strlen($myrow['observf'])>0){\n\t\t\t\t$terminospago=$myrow['observf'];\n\t\t\t}\n\n\t\t\t//echo 'terminos:'.$terminospago.' obs:'.$myrow['observf'].'<br><br>';\n\t\t\t// $Tipopago=$Tipopago.' '.$terminospago;\n\t\t\t$Tipopago=$terminospago;\n\t\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t\t// condiciones de pago\n\t\t\t$charelectronic=$charelectronic.'|---';\n\t\t\t// metodo de pago\n\t\t\t//$metodopago='Varios';\n\t\t\t$charelectronic=$charelectronic.'|'.$metodoPago;\n\t\t\t// fecha vencimiento\n\t\t\t$fechavence=$myrow['trandate'];\n\t\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t\t// observaciones 4\n\t\t\t$observaciones4=$nocuenta;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\n\t\t\t//<CFDI:Relacionados> Se solicita subirlo a MG\n\t\t\t$queryCFDI=\"\"; \n\t\t\t$c_TipoRelacion=\"\";\n\t\t\t$pagare_fact=\"\";\n\t\t\tif($_SESSION['FacturaVersion'] == \"3.3\"){\n\t\t\t\tif($TypeInvoice == 13){\n\t\t\t\t\t$c_TipoRelacion=\"01\";\n\t\t\t\t}\n if($TypeInvoice == 200){\n $c_TipoRelacion=\"08\";\n }\n\n\t\t\t\t$queryCFDI=\"SELECT DISTINCT if (tiporelacion_relacion IS NULL, '\".$c_TipoRelacion.\"',tiporelacion_relacion ) as c_TipoRelacion,debtortrans.uuid,debtortrans.type,debtortrans.id, substring(debtortrans.cadena, 3, 3) as version\n\t\t\t\t\t\t\tFROM notesorders_invoice \n\t\t\t\t\t\t\tLEFT JOIN debtortrans on notesorders_invoice.transid_relacion = debtortrans.id\n\t\t\t\t\t\t\tWHERE notesorders_invoice.transid = '\".$myrow['id'].\"'\";\n\t\t\t\t$resultCFDI=DB_query($queryCFDI,$db);\n\t\t\t\tif($_SESSION['UserID'] == 'desarrollo'){\n echo \"Relacion:\".$queryCFDI;\n }\n\n\t\t\t\tif($TypeInvoice == '200'){\n \t// para sustitucion\n \t/*$sql = \"SELECT '04' as c_TipoRelacion ,UUID AS uuid, id FROM log_cancelacion_sustitucion WHERE id ='\".$myrow['id'].\"'; \";\n\n \t//echo \"<br> SQL Relacion: \".$sql;\n \t$resultadoSus = DB_query($sql,$db);\n \tif(DB_num_rows($resultadoSus)>0){\n \t\t$resultCFDI = $resultadoSus;\n \t}*/\n\n \t$strSQLUUID = \" SELECT '04' as c_TipoRelacion ,UUID AS uuid FROM log_cancelacion_sustitucion WHERE transNo='\".$InvoiceNo.\"' AND type ='\".$TypeInvoice.\"'\";\n\t\t $charelectronicdetuuid= '';\n\t\t //echo \"<br>UUID: \".$strSQLUUID;\n\t\t $resultSQLUUID=DB_query($strSQLUUID,$db);\n\t\t if(DB_num_rows($resultSQLUUID)>0){\n\t\t \t$resultCFDI = $resultSQLUUID;\n\t\t /*while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n\t\t $charelectroniuid = '|' . chr(13) . chr(10) . '012';\n\t\t //$charelectronicdetuuid = \"\";\n\t\t // $charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n\t\t $charelectronicdetuuid = $charelectronicdetuuid . '|' .$charelectroniuid . '|04|' . $myrowUUID['UUID'];\n\t\t \n\t\t }*/\n\n\t\t }else{\n\t\t $strSQLUUID= \"SELECT log_complemento_sustitucion.folio, log_complemento_sustitucion.type, \n\t\t log_complemento_sustitucion.uuid, log_complemento_sustitucion.transno, '04' as c_TipoRelacion\n\t\t FROM log_complemento_sustitucion \n\t\t INNER JOIN debtortrans ON log_complemento_sustitucion.sustitucion_from = debtortrans.id\n\t\t WHERE debtortrans.transno='\".$InvoiceNo.\"' AND debtortrans.type ='\".$TypeInvoice.\"'\";\n\n\t\t $resultSQLUUID=DB_query($strSQLUUID,$db);\n\t\t if(DB_num_rows($resultSQLUUID) >0){\n\t\t \t$resultCFDI = $resultSQLUUID;\n\t\t /*while ($myrowUUID=DB_fetch_array($resultSQLUUID)) {\n\t\t $charelectroniuid = '|' . chr(13) . chr(10) . '012';\n\t\t //$charelectronicdetuuid = \"\";\n\t\t // $charelectronic=$charelectronic.'|04|'.$myrowUUID['UUID'];\n\t\t $charelectronicdetuuid = $charelectronicdetuuid . '|' .$charelectroniuid . '|04|' . $myrowUUID['uuid']; \n\n\n\t\t }*/\n\t\t }\n\n\t\t }\n\n \n }\n\t\t\t\tif($_SESSION['UserID'] == 'desarrollo'){\n //echo \"string1:\".$queryCFDI;\n }\n\t\t\t\twhile ($myrowCFDI = DB_fetch_array($resultCFDI)) {\n\n\t\t\t\t\tif($myrowCFDI['type'] =='70'){\n\t\t\t\t\t\t$pagare_fact.=\"'\".$myrowCFDI['id'] .\"',\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif( $myrowCFDI['c_TipoRelacion'] == '08' AND $myrowCFDI['version'] == '3.3'){\n\t\t\t\t\t\t\t$myrowCFDI['c_TipoRelacion'] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'012';\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowCFDI['c_TipoRelacion'];\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowCFDI['uuid'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n if($TypeInvoice == 200){\n $c_TipoRelacionCP=\"08\";\n }else{\n $c_TipoRelacionCP=\"01\"; \n }\n\n\t\t\t\tif($pagare_fact!=\"\"){\n\t\t\t\t\t$pagare_fact=$pagare_fact . \"'-3'\";\n\n\t\t\t\t\t$queryCFDI=\"SELECT '\".$c_TipoRelacionCP.\"' as c_TipoRelacion,debtortrans.uuid , substring(debtortrans.cadena, 3, 3) as version\n\t\t\t\t\t\t\t\tFROM debtortrans \n\t\t\t\t\t\t\t\tINNER JOIN custallocns ON custallocns.transid_allocto = debtortrans.id\n\t\t\t\t\t\t\t\tWHERE custallocns.transid_allocfrom IN (\".$pagare_fact.\")\n\t\t\t\t\t\t\t\tGROUP BY debtortrans.uuid;\";\n if($_SESSION['UserID'] == 'desarrollo'){\n echo \"stringPAgo: \".$queryCFDI;\n }\n $resultCFDI=DB_query($queryCFDI,$db);\n \n\t\t\t\t\t\n\t\t\t\t\twhile ($myrowCFDI = DB_fetch_array($resultCFDI)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( $myrowCFDI['c_TipoRelacion'] == '08' AND $myrowCFDI['version'] == '3.3'){\n\t\t\t\t\t\t\t$myrowCFDI['c_TipoRelacion'] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'012';\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowCFDI['c_TipoRelacion'];\n\t\t\t\t\t\t$charelectronic=$charelectronic.'|'.$myrowCFDI['uuid'];\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t//</CFDI:Relacionados>\n\n\t\t\t// datos del cliente\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t\t$branch=$myrow['debtorno'];\n\t\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\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}else{\n\t\t\t\t$pais=\"Mexico\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t}\n\t\t{\n\t\t\t$calle=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$calle=$myrow['address1'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t\t$noext=$myrow['brnumext'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t\t$noint=$myrow['brnumint'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\t$colonia=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$colonia=$myrow['address2'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t\t$localidad=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t\t$referenciacalle=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t\t$municipio=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$municipio=$myrow['address3'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t\t$edo=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$edo=$myrow['address4'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t\t$cp=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$cp=$myrow['address5'];\n\t\t\t}\n\t\t}\n\t\t{\n\t\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t\t// datos del custbranch\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t\t$branch=$myrow['branchcode'];\n\t\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t\t//$rfc=$myrow['rfc'];\n\t\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t\t$nombre=$myrow['name'];\n\t\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\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}else{\n\t\t\t\t$pais=\"Mexico\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t\t$calle=$myrow['braddress1'];\n\t\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t\t$noext=$myrow['brnumext'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t\t$noint=$myrow['brnumint'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\t$colonia=$myrow['braddress6'];\n\t\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t\t$localidad=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t\t$referenciacalle=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t\t$municipio=$myrow['braddress2'];\n\t\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t\t$edo=$myrow['braddress3'];\n\t\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t\t$cp=$myrow['braddress4'];\n\t\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t}\n\t}\n\t\n\t$charelectronicEmbarque='|'.chr(13).chr(10).'09';\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['specialinstructions'];\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr1'];//calle\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//noext\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//no int\n\t\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//colonia\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//municipio\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//cp\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr5'];//estado\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['custpais'];//pais\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n\t\n\t$SQLInvoice = \"SELECT\n\treplace(debtortransmovs.origtrandate,'-','/') as origtrandate,\n\tSUM(abs(debtortransmovs.ovamount)) AS ovamount,\n\tSUM(abs(debtortransmovs.ovgst)) AS ovgst,\n\tRound(abs(debtortransmovs.ovgst) / abs(debtortransmovs.ovamount), 2) as porcentaje,\n\tdebtortransmovs.currcode,\n\tdebtortransmovs.rate as cambio,\n\tdebtortransmovs.order_,\n\treplace(debtortransmovs.trandate,'-','/') as trandate,\n\tdebtortransmovs.debtorno,\n\tcustbranch.taxid as rfc,\n\tdebtorsmaster.name,\n\tdebtorsmaster.address1,\n\tdebtorsmaster.address2,\n\tdebtorsmaster.address3,\n\tdebtorsmaster.address4,\n\tdebtorsmaster.address5,\n\tdebtortransmovs.branchcode,\n\tcustbranch.braddress1,\n\tcustbranch.braddress2,\n\tcustbranch.braddress3,\n\tcustbranch.braddress4,\n\tcustbranch.braddress5,\n\tcustbranch.braddress6,\n\tcustbranch.brnumint,\n\tcustbranch.brnumext,\n\tcustbranch.specialinstructions,\n\tcustbranch.brpostaddr1,\n\tcustbranch.brpostaddr2,\n\tcustbranch.brpostaddr3,\n\tcustbranch.brpostaddr4,\n\tcustbranch.brpostaddr5,\n\tcustbranch.brpostaddr6,\n\tcustpais as brpostaddr7,\n\twww_users.realname,\n\tdebtortransmovs.transno,\n\tdebtortrans.reference,\n\tcustbranch.phoneno as telofi,\n\tdebtortrans.paymentname,\n\tIFNULL(debtortrans.nocuenta,IFNULL(custbranch.nocuenta,'')) as nocuenta,\n\tdebtortrans.observf,\n\tIFNULL(paymentmethods.codesat,'') as codesat,\n\tdebtortrans.id,\n\tdebtortrans.invtext,\n\tcustbranch.custpais\n\tFROM debtortransmovs\n\tINNER JOIN debtortrans ON debtortrans.type = debtortransmovs.type AND debtortrans.transno = debtortransmovs.transno\n\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t,debtorsmaster,custbranch, www_users\n\tWHERE debtortransmovs.type=$TypeInvoice\n\tAND debtortransmovs.transno=$InvoiceNo\n\tAND debtortransmovs.tagref=$tag\n\tAND debtortransmovs.debtorno=debtorsmaster.debtorno\n\tAND debtortransmovs.debtorno=custbranch.debtorno\n\tAND debtortransmovs.branchcode=custbranch.branchcode\n\tAND www_users.userid = debtortransmovs.userid\n\tGROUP BY Round(abs(debtortransmovs.ovgst) / abs(debtortransmovs.ovamount), 2)\";\n\t// Consulta agrupada por porcentaje de impuestos\n\t$Result=DB_query($SQLInvoice,$db);\n\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\twhile($myrow = DB_fetch_array($Result)) {\n\t\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t\n\t\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t\t$stockid='Nota '.$myrow['transno'];\n\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$myrow['transno'];\n\t\t$cantidad = 1;\n\t\t$stockcantidad=number_format($cantidad,4,'.','');\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t$stockdescrip=$myrow['reference'] .' '. $myrow['invtext'];\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip;\n\t\t$stockprecio=number_format(abs($myrow['ovamount']),2,'.','');\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t$stockneto=number_format(abs($myrow['ovamount']),2,'.','');\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t$stockunits= '';\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t$stockcat='NC';\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t$ordencompra='';\n\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t//DESCUENTO 1\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t\t//DESCUENTO 2\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t\t//DESCUENTO 3\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t\t//SUBTOTAL\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . number_format(abs($myrow['ovamount']),2,'.','');\n\t\t\n\t\t$taxrate = 0;\n\t\t$taxratetotal = 0;\n\t\tif ($imprimepublico==0){\n\t\t\t$impuesto=\"IVA\";\n\n\t\t\t//Agregar Atributos del 3.3\n\t\t\t//*************************\n\t\t\t$c_Impuestos=\"002\";\n\t\t\t$c_TipoFactor=\"Tasa\";\n\t\t\t//*************************\n\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t$totalcred=(abs($myrow['ovgst'])/abs($myrow['ovamount']));\n\n\t\t\t//$totalcred=$totalcred-1;\n\t\t\t$taxrate=number_format($totalcred*100,6,'.','');\n\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t$taxratetotal=number_format(abs($myrow['ovgst']),6,'.','');\n\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal.'|'.$c_Impuestos.'|'.$c_TipoFactor;\n\t\t}\n\n\t\t//ADUANA\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . $taxrate; // 14 - Se agregan datos para impuestos notas de credito\n\t\t//NUMERO DE ADUANA\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . $taxratetotal; // 15 - Se agregan datos para impuestos notas de credito\n\t\t//FECHA DE INGRESO A ADUANA\n\t\t$charelectronicdetail = $charelectronicdetail . '|' . $myrow['porcentaje']; // 16 - porcentaje de impuestos\n\t}\n\n\t// ivas retenidos\n\t//$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\t$charelectronictaxsret = \"\";\n\tif ($charelectronictaxs != \"\"){\n\t\treturn $charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t}else{\n\t\treturn $charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t}\n\n}",
"function importar_requerimientos_operaciones(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $proy_id = $post['proy_id']; /// proy id\n $pfec_id = $post['pfec_id']; /// pfec id\n $com_id = $post['com_id']; /// com id\n \n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); /// DATOS DEL PROYECTO\n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// DATOS DE LA FASE ACTIVA\n\n $monto_asig=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],1);\n $monto_prog=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],2);\n $saldo=round(($monto_asig[0]['monto']-$monto_prog[0]['monto']),2);\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n\n $lineas = file($archivotmp);\n if($this->suma_monto_total($lineas)<=$saldo){\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n \n if(count($datos)==21){\n $cod_ope = (int)$datos[0]; //// Codigo Operacion\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $verif_com_ope=$this->model_producto->verif_componente_operacion($com_id,$cod_ope);\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[3])); //// descripcion\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $cantidad = (int)$datos[5]; //// Cantidad\n $unitario = (float)$datos[6]; //// Costo Unitario\n $total = (float)$datos[7]; //// Costo Total\n if(!is_numeric($unitario)){\n if($cantidad!=0){\n $unitario=round(($total/$cantidad),2); \n }\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $observacion = utf8_encode(trim($datos[20])); //// Observacion\n\n if(count($verif_com_ope)==1 & count($par_id)!=0 & $cod_partida!=0){\n $nro++;\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_unidad_medida' => strtoupper($unidad), /// Insumo Unidad de Medida\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fecha_creacion' => date(\"d/m/Y H:i:s\"),\n 'fun_id' => $this->session->userdata(\"fun_id\"), /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*----------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_com_ope[0]['prod_id'], /// act_id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n $gestion_fase=$fase[0]['pfec_fecha_inicio'];\n\n /*---------------- Recorriendo Gestiones de la Fase -----------------------*/\n for ($g=$fase[0]['pfec_fecha_inicio']; $g <=$fase[0]['pfec_fecha_fin'] ; $g++){\n $data_to_store = array( \n 'ins_id' => $ins_id, /// Id Insumo\n 'g_id' => $g, /// Gestion\n 'insg_monto_prog' => $total, /// Monto programado\n );\n $this->db->insert('insumo_gestion', $data_to_store); ///// Guardar en Tabla Insumo Gestion\n $insg_id=$this->db->insert_id();\n\n $ptto_fase_gestion = $this->model_faseetapa->fase_gestion($fase[0]['id'],$g); //// DATOS DE LA FASE GESTION\n $fuentes=$this->model_faseetapa->fase_presupuesto_id($ptto_fase_gestion[0]['ptofecg_id']);\n\n if(count($fuentes)==1){\n /*------------------- Guardando Fuente Financiamiento ------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store3 = array( \n 'insg_id' => $insg_id, /// Id Insumo gestion\n 'ifin_monto' => $total, /// Monto programado\n 'ifin_gestion' => $g, /// Gestion\n 'ffofet_id' => $fuentes[0]['ffofet_id'], /// ffotet id\n 'ff_id' => $fuentes[0]['ff_id'], /// ff id\n 'of_id' => $fuentes[0]['of_id'], /// ff id\n 'nro_if' => 1, /// Nro if\n );\n $this->db->insert('insumo_financiamiento', $data_to_store3); ///// Guardar en Tabla Insumo Financiamiento\n $ifin_id=$this->db->insert_id();\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array( \n 'ifin_id' => $ifin_id, /// Id Insumo Financiamiento\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('ifin_prog_mes', $data_to_store4); ///// Guardar en Tabla Insumo Financiamiento Programado Mes\n }\n }\n /*-----------------------------------------------------------*/ \n }\n }\n\n }\n\n }\n\n }\n $i++;\n }\n\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'');\n /*--------------------------------------------*/\n }\n else{\n $this->session->set_flashdata('danger','COSTO PROGRAMADO A SUBIR ES MAYOR AL SALDO POR PROGRAMAR. VERIFIQUE PLANTILLA A MIGRAR');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n } \n elseif (empty($file_basename)) {\n $this->session->set_flashdata('danger','POR FAVOR SELECCIONE ARCHIVO CSV');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n elseif ($filesize > 100000000) {\n $this->session->set_flashdata('danger','TAMAÑO DEL ARCHIVO');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n else {\n $mensaje = \"SOLO SE PERMITEN ESTOS ARCHIVOS : \" . implode(', ', $allowed_file_types);\n $this->session->set_flashdata('danger',$mensaje);\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n\n } else {\n show_404();\n }\n }",
"public function importarDocentes($archivo=$this->archivo){\n //cargamos el archivo\n $lineas = file($archivo); \n //inicializamos variable a 0, esto nos ayudará a indicarle que no lea la primera línea\n $i=0; \n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea)\n { \n //abrimos bucle\n /*si es diferente a 0 significa que no se encuentra en la primera línea \n (con los títulos de las columnas) y por lo tanto puede leerla*/\n if($i != 0) \n { \n //abrimos condición, solo entrará en la condición a partir de la segunda pasada del bucle.\n /* La funcion explode nos ayuda a delimitar los campos, por lo tanto irá \n leyendo hasta que encuentre un ; */\n $docente = explode(\";\",$linea);\n //Almacenamos los docente que vamos leyendo en una variable\n $dni=trim($docente[0]);\n $apellidos=trim($docente[1]);\n $nombre = trim($docente[2]);\n $facultad =trim($docente[3]);\n $telefono = trim($docente[4]);\n $correo = trim($docente[5]);\n $categoria = trim($docente[6]);\n $regimen = trim($docente[7]);\n $cargo= trim($docente[8]); \n //guardamos en base de docente la línea leida\n mysql_query(\"INSERT INTO docente(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$facultad','$telefono','$correo','$categoria','$regimen','$cargo')\"); \n //cerramos condición\n } \n /*Cuando pase la primera pasada se incrementará nuestro valor y a la siguiente pasada ya \n entraremos en la condición, de esta manera conseguimos que no lea la primera línea.*/\n $i++;\n //cerramos bucle\n }\n}",
"public function postImport()\n {\n Excel::load(Input::file('customer'), function($reader) {\n $cmp_id = Session::get('cmp_id');\n foreach ($reader->get() as $book) {\n Product::create([\n 'nombreProducto' => $book->producto,\n 'similarProducto' => $book->similar,\n 'idTipoProducto' => $book->tipo,\n 'idEmpresa' => $cmp_id,\n ]);\n }\n });\n Session::flash('message','Importacion realizada correctamente');\n return Redirect::to('product');\n }",
"public function edit(ImportInvoice $importInvoice)\n {\n //\n }",
"public function createInvoice()\r\n {\r\n }",
"public function impressionTransactionPart()\n {\n $datedebut = $this->paramPOST['datedeb'];\n $datefin = $this->paramPOST['datefin'];\n $partenaire = $this->paramPOST['fk_partenaire'];\n $param = [\n \"condition\"=>[\"rowid =\"=>$partenaire]\n ];\n $data['parte'] = $this->reportingModels->getUnPartenaire($param)[0]->raison_sociale;\n\n $data['transac'] = $this->reportingModels->getTransactionPartenaire([\"condition\" =>[\"t.statut=\"=>1,\"t.fk_partenaire=\" => $partenaire, \"DATE(t.date_transaction)>=\" => $datedebut, \"DATE(t.date_transaction)<=\" => $datefin]]);\n \n $this->views->setData($data);\n $this->views->exportToPdf(\"reporting/printTransactionsPart\");\n\n }",
"public function actionImport(IPPIntuitEntity $IPPBill){\n try {\n $lines = [];\n $customers = [];\n $taxAmount = 0;\n $vendor = $this->vendorEntity->getJpEntity($IPPBill->VendorRef);\n // it's important to cast as in case of one line we don't get array\n $IPPLines = (is_array($IPPBill->Line)) ? $IPPBill->Line : [$IPPBill->Line];\n foreach($IPPLines as $IPPLine){\n $account = $this->accountEntity->getJpEntity($IPPLine->AccountBasedExpenseLineDetail->AccountRef);\n $lines[] = [\n 'rate' => $IPPLine->Amount,\n 'description' => $IPPLine->Description,\n 'quantity'=> 1,\n 'financial_account_id' => $account->id,\n ];\n $taxAmount += $IPPLine->AccountBasedExpenseLineDetail->TaxAmount;\n $customers[] = $IPPLine->AccountBasedExpenseLineDetail->CustomerRef;\n }\n\n if(count(arry_fu($customers)) != 1){\n throw new Exception(\"Multiple or No customer assigned to Line Items\", 1);\n }\n\n $meta = [\n 'due_date' => $IPPBill->DueDate,\n 'note' => $IPPBill->Memo,\n 'tax_amount' => $taxAmount,\n 'bill_number' => $IPPBill->DocNumber,\n ];\n $job = $this->getJpJob($customers[0]);\n if($bill = $this->getJpEntity($IPPBill->Id)){\n $bill = $this->billService->updateVendorBills($bill, $vendor->id, $IPPBill->TxnDate, $lines, $meta);\n }else{\n $meta['origin'] = 1;\n $bill = $this->billService->createVendorBills($job->id, $vendor->id, $IPPBill->TxnDate, $lines, $meta);\n }\n $this->linkEntity($bill, $IPPBill);\n JobFinancialCalculation::updateJobFinancialbillAmount($bill->job);\n return $bill;\n } catch (Exception $e) {\n QuickBooks::quickBookExceptionThrow($e);\n }\n\n }",
"public function show(ImportInvoice $importInvoice)\n {\n //\n }",
"public function import_file(){\n\t\t$this->load->model(\"payment/M_pa_payment\",\"payment\");\n\t\t\n\t\t$this->data[\"rs_year_exam\"] = $this->payment->get_year_exam();\n\t\t\n\t\t$this->output(\"Payment/v_import_excel\",$this->data);\n\t}",
"public function export_company_generate_invoice($id) \n {\n $tenant_id = $this->tenant_id;\n \n if (empty($id)) \n {\n return show_404();\n }\n// $result = $this->classtraineemodel->get_enroll_invoice($id);\n \n $result = $this->classtraineemodel->get_company_enroll_invoice($id);\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($result->invoice_id);\n \n //sk st\n $discount = $this->classtraineemodel->get_discount($result->pymnt_due_id);\n $result->discount_label = $discount->discount_type;\n $result->discount_rate = $discount->discount_rate;\n //sk ed\n \n //\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//skm1\n $result->company_person_name = $company_person[0]->first_name;//skm2\n \n }\n\n $result->total_inv_discnt = round($result->total_inv_discnt, 2);\n $result->total_unit_fees = round($result->total_unit_fees, 2);\n $result->total_inv_subsdy = round($result->total_inv_subsdy, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n\n $feesdue = $result->total_unit_fees - $result->total_inv_discnt;\n $result->payment_due_details = $this->classtraineemodel->get_company_payment_due_details($id);\n \n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach($result->payment_due_details as $key=>$val)\n {\n $received = empty($user_paid[$val->user_id]) ? 0 : $user_paid[$val->user_id];\n $refunded = empty($user_refund[$val->user_id]) ? 0 : $user_refund[$val->user_id];\n $inv_amt+=$val->total_amount_due;\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($val->total_amount_due + $refunded) - $received) <= 0)\n {\n $payment_label = 'PAID';\n }\n else\n { \n \n if($received > 0 && $val->payment_status == 'PARTPAID')\n {\n $payment_label = 'PART PAID';\n \n }else if($refunded > 0)\n { \n $payment_label = 'REFUNDED'; \n } \n else\n { \n if($received == 0)\n {\n $payment_label = 'NOT PAID';\n }\n else if($received > 0)\n {\n $payment_label = 'PART PAID';\n }\n }\n }\n $result->payment_due_details[$key]->payment_label = $payment_label;\n }\n \n $payable_amount=$inv_amt-$received_amt; \n $result->payble_amount=$inv_amt+$refunded_amt-$received_amt;\n\n $this->load->helper('pdf_reports_helper');\n if($tenant_id =='T17'){\n generate_company_pdf_invoice_everest($result);\n }else{\n generate_company_pdf_invoice_all($result);\n }\n \n }",
"function XSAInvoicingCreditdirect($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie.$folio;\n\t$serieelect=$serie;\n\t$folioelect=$folio;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$SQLInvoice = \"SELECT\n\t\t\treplace(debtortransmovs.origtrandate,'-','/') as origtrandate,\n\t\t\tSUM(abs(debtortransmovs.ovamount)) AS ovamount,\n\t\t\tSUM(abs(debtortransmovs.ovgst)) AS ovgst,\n\t\t\tdebtortransmovs.currcode,\n\t\t\tdebtortransmovs.rate as cambio,\n\t\t\tdebtortransmovs.order_,\n\t\t\treplace(debtortransmovs.trandate,'-','/') as trandate,\n\t\t\tdebtortransmovs.debtorno,\n\t\t\tcustbranch.taxid as rfc,\n\t\t\tdebtorsmaster.name,\n\t\t\tdebtorsmaster.address1,\n\t\t\tdebtorsmaster.address2,\n\t\t\tdebtorsmaster.address3,\n\t\t\tdebtorsmaster.address4,\n\t\t\tdebtorsmaster.address5,\n\t\t\tdebtortransmovs.branchcode,\n\t\t\tcustbranch.braddress1,\n\t\t\tcustbranch.braddress2,\n\t\t\tcustbranch.braddress3,\n\t\t\tcustbranch.braddress4,\n\t\t\tcustbranch.braddress5,\n\t\t\tcustbranch.brnumint,\n\t\t\tcustbranch.brnumext,\n\t\t\tcustbranch.specialinstructions,\n\t\t\tcustbranch.brpostaddr1,\n\t\t\tcustbranch.brpostaddr2,\n\t\t\tcustbranch.brpostaddr3,\n\t\t\tcustbranch.brpostaddr4,\n\t\t\tcustbranch.brpostaddr5,\n\t\t\tcustbranch.brpostaddr6,\n\t\t\tcustpais as brpostaddr7,\n\t\t\twww_users.realname,\n\t\t\tdebtortransmovs.transno,\n\t\t\tdebtortransmovs.reference,\n\t\t\tcustbranch.phoneno as telofi,\n\t\t\tdebtortrans.paymentname,\n\t\t\tdebtortrans.nocuenta,\n\t\t\tdebtortrans.observf\n\t\t\tFROM debtortransmovs\n\t\t\tINNER JOIN debtortrans ON debtortrans.type = debtortransmovs.type\n\t\t\tAND debtortrans.transno = debtortransmovs.transno\n\t\t\t,debtorsmaster,custbranch, www_users\n\t\t\tWHERE debtortransmovs.type=$TypeInvoice\n\t\t\tAND debtortransmovs.transno=$InvoiceNo\n\t\t\tAND debtortransmovs.tagref=$tag\n\t\t\tAND debtortransmovs.debtorno=debtorsmaster.debtorno\n\t\t\tAND debtortransmovs.debtorno=custbranch.debtorno\n\t\t\tAND debtortransmovs.branchcode=custbranch.branchcode\n\t\t\tAND www_users.userid = debtortransmovs.userid\n\t\t\tGROUP BY debtortransmovs.transno\";\n\t\n\t$Result=DB_query($SQLInvoice,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t{\n\t\t\t$myrow = DB_fetch_array($Result);\n\t\t\t// fecha emision\n\t\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t\t$UserRegister=\"\";//$myrow['UserRegister'];\n\t\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t\t// subtotal\n\t\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t\t$nombre=$myrow['name'];\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\t\tif ((strlen($rfccliente)<12) OR (strlen($rfccliente)>=14)){\n\t\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t\t$nombre=\"Publico en General\";\n\t\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t\t$imprimepublico=1;\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t\t// total factura\n\t\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$charelectronic=$charelectronic.'|'.abs($total);\n\t\t\t// total de iva\n\t\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t\t// transladado\n\t\t\t$charelectronic=$charelectronic.'|'.abs($iva);\n\t\t\t// retenido\n\t\t\t$ivaret=0;\n\t\t\t$charelectronic=$charelectronic.'|'.abs($ivaret);\n\t\t\t//descuento\n\t\t\t//$descuento=number_format(0,2,'.','');\n\t\t\t$descuento='0.00';\n\t\t\t$charelectronic=$charelectronic.'|'.($descuento);\n\t\t\t//motivo descuento\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t\t// tipo de moneda\n\t\t\t$moneda=$myrow['currcode'];\n\t\t\t// CANTIDAD CON LETRAS\n\t\t\t$totaletras=abs($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$separa=explode(\".\",$totaletras);\n\t\t\t$montoctvs2 = $separa[1];\n\t\t\t$montoctvs1 = $separa[0];\n\t\t\tif ($montoctvs2>995){\n\t\t\t\t$montoctvs1=$montoctvs1+1;\n\t\t\t}\n\t\t\t$montoletra=Numbers_Words::toWords($montoctvs1,'es');\n\t\t\t$totaletras=FormatNumberERP($totaletras);\n\t\t\t$separa=explode(\".\",$totaletras);\n\t\t\t$montoctvs2 = $separa[1];\n\t\t\tif ($montoctvs2>995){\n\t\t\t\t$montoctvs2=0;\n\t\t\t}\n\t\t\t$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\t\t\n\t\t\t$zeroPad = \"\";\n\t\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t\t} else {\n\t\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t\t}\n\t\t\t\n\t\t\tif ($moneda == 'MXN') {\n\t\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t\t} else {\n\t\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t\t// tipo moneda\n\t\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t\t// tipo de cambio\n\t\t\t$rate=FormatRateNumberERP($myrow['cambio']);\n\t\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t\t// numero de orden para referencia\n\t\t\t$ordenref=$myrow['order_'];\n\t\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t\t// observaciones 1: vendedores\n\t\t\t$vendedor=$myrow['realname'];\n\t\t\t$observaciones1='Vendedor: '.' '.$vendedor;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t\t// observaciones 2\n\t\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t\t FROM legalbusinessunit l, tags t\n\t\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t\t$Result= DB_query($SQL,$db);\n\t\t\tif (DB_num_rows($Result)==1) {\n\t\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t\t$comments=trim($myrowtags['comments']);\n\t\t\t}\n\t\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\n\t\t\t$metodopago = $myrow['paymentname'];\n\t\t\tif ($metodopago==\"\") {\n\t\t\t\t$metodopago = \"No Identificado\";\n\t\t\t}\n\n\t\t\t$nocuenta = $myrow['nocuenta'];\n\t\t\tif ($nocuenta==\"\") {\n\t\t\t\t$nocuenta = \"No Identificado\";\n\t\t\t}\n\n\t\t\t// observaciones 3\n\t\t\t$observaciones3='Id Nota :'.$InvoiceNo;//' '.$comments .' usr:'.$UserRegister;\n\t\t\t$TypeInvoice.\"\n\t\t\tAND debtortransmovs.transno=\" . $InvoiceNo . \"\n\t\t\tAND debtortransmovs.tagref=\" . $tag .\n\n\t\t\t$observaciones3 = $observaciones3 . $detallerecibos . \"; \" ;// \"Este comprobante es complementario a los expedidos en la fecha y folios descritos en cada partida detallada arriba\";\n\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones3 . $detallerecibos;\n\n\t\t\t//SE AGREGA NUEVO CAMPO INFORMACION EXTRA\n\t\t\t$charelectronic=$charelectronic . '|' . '';\n\n\t\t\t// datos de la forma de pago\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\tif(strlen($myrow['observf'])>0){\n\t\t\t\t\n\t\t\t\t$terminospago=$myrow['observf'];\n\t\t\t}else{\n\t\t\t\t$terminospago=\"Pago en una sola exhibicion\";\n\t\t\t}\n\t\t\t//echo 'terminos:'.$terminospago.' obs:'.$myrow['observf'].'<br><br>';\n\t\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t\t//$Tipopago=$terminospago;\n\t\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t\t// condiciones de pago\n\t\t\t$charelectronic=$charelectronic.'|---';\n\t\t\t// metodo de pago\n\t\t\t//$metodopago='Varios';\n\t\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t\t// fecha vencimiento\n\t\t\t$fechavence=$myrow['trandate'];\n\t\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t\t// observaciones 4\n\t\t\t$observaciones4=$nocuenta;\n\t\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t\t// datos del cliente\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t\t$branch=$myrow['debtorno'];\n\t\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\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}else{\n\t\t\t\t$pais=\"Mexico\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\n\t\t}\n\t\t{\n\t\t\t$calle=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$calle=$myrow['address1'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t\t$noext=$myrow['brnumext'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t\t$noint=$myrow['brnumint'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\t$colonia=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$colonia=$myrow['address2'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t\t$localidad=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t\t$referenciacalle=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t\t$municipio=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$municipio=$myrow['address3'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t\t$edo=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$edo=$myrow['address4'];\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t\t$cp=\"\";\n\t\t\tif ($imprimepublico==0){\n\t\t\t\t$cp=$myrow['address5'];\n\t\t\t}\n\t\t}\n\t\t{\n\t\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t\t// datos del custbranch\n\t\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t\t$branch=$myrow['branchcode'];\n\t\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t\t//$rfc=$myrow['rfc'];\n\t\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t\t$nombre=$myrow['name'];\n\t\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\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}else{\n\t\t\t\t$pais=\"Mexico\";\n\t\t\t}\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t\t$calle=$myrow['braddress1'];\n\t\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t\t$noext=$myrow['brnumext'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t\t$noint=$myrow['brnumint'];\n\t\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t\t$colonia=$myrow['braddress6'];\n\t\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t\t$localidad=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t\t$referenciacalle=\"\";\n\t\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t\t$municipio=$myrow['braddress2'];;\n\t\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t\t$edo=$myrow['braddress3'];\n\t\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t\t$cp=$myrow['braddress4'];\n\t\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t\t}\n\t}\n\t\n\t$charelectronicEmbarque='|'.chr(13).chr(10).'09';\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['specialinstructions'];\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr1'];//calle\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//noext\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|';//no int\n\t\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr2'];//colonia\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr3'];//municipio\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr4'];//cp\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr5'];//estado\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr6'];//pais\n\t$charelectronicEmbarque=$charelectronicEmbarque.'|'.$myrow['brpostaddr7'];\n\t\n\t// cadena para datos de los productos\n\t// productos vendidos\n\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\t$stockid='Nota '.$myrow['transno'];\n\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t$charelectronicdetail=$charelectronicdetail.'|'.$myrow['transno'];\n\t$cantidad = 1;\n\t$stockcantidad=FormatNumberERP($cantidad);\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t$stockdescrip=$myrow['reference'];\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip;\n\t$stockprecio=FormatNumberERP(abs($myrow['ovamount']));\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t$stockneto=FormatNumberERP(abs($myrow['ovamount']));\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t$stockunits= '';\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t$stockcat='NC';\n\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t$ordencompra='';\n\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t//DESCUENTO 1\n\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t//DESCUENTO 2\n\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t//DESCUENTO 3\n\t$charelectronicdetail = $charelectronicdetail . '|' . '0.00';\n\t//SUBTOTAL\n\t$charelectronicdetail = $charelectronicdetail . '|' . FormatNumberERP(abs($myrow['ovamount']));\n\t//ADUANA\n\t$charelectronicdetail = $charelectronicdetail . '|' . '';\n\t//NUMERO DE ADUANA\n\t$charelectronicdetail = $charelectronicdetail . '|' . '';\n\t//FECHA DE INGRESO A ADUANA\n\t$charelectronicdetail = $charelectronicdetail . '|' . '';\n\tif ($imprimepublico==0){\n\t\t$impuesto=\"IVA\";\n\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t$totalcred=(abs($myrow['ovgst'])/abs($myrow['ovamount']));\n\n\n\t\t//$totalcred=$totalcred-1;\n\t\t$taxrate=FormatNumberERP($totalcred*100);\n\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t$taxratetotal=FormatNumberERP(abs($myrow['ovgst']));\n\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t}\n\n\t// ivas retenidos\n\t//$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\n\tif ($charelectronictaxs != \"\"){\n\t\treturn $charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t}else{\n\t\treturn $charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t}\n\n}",
"function cc_elabora_file_xml($offerte){\n\t\n\tglobal $wpdb; // oggetto interazione DB di WordPress\n\t\n\t// path dove si trova file xml sorgente, config.xml e file di log\n\t$path = ABSPATH . \"import/\";\n\t\n\t$results = $deleted = array(); \n\t\n\t// apro file config (xml) da cui prendere data ultima elaborazione ed in cui memorizzare i risultati di elaborazione\n\t$config = @simplexml_load_file($path.\"configs.xml\");\n\tif(!$config){\n\t\t// file config non trovato notifico e esco \n\t\tcc_import_error(\"File config non trovato!\");\t\t\t\n\t}\n\t\t\n\t// recupero tutti gli id cometa già presenti in tabella postmeta. _id_cometa è un postmeta mio\n\t$record_presenti = cc_get_unique_post_meta_values(\"_id_cometa\"); // restituisce array con chiave post_id\n\t\n\t// recupero da file config data ultimo aggiornamento - NON PIU' UTILIZZATO, uso data all'interno del file xml\n\t//$last_update = new DateTime( (string) $config->lastUpdate );\n\t\n\t// contatore record\n\t$line = 0;\n\t\n\t// loop offerte da xml sorgente\n\tforeach($offerte as $offerta){\n\t\t\n\t\t$line++;\n\t\tcc_import_immobili_error_log($line); // aggiorno log elaborazione con numero progressivo record \n\t\t\n\t\t$idunique = (int) $offerta->Idimmobile; // campo univoco Cometa\n\t\t$rif = (string) $offerta->Riferimento; // Rif / codice immoible\n\t\t$contratto = (string) $offerta->Contratto; // il tipo di contratto (Vendita o Affitto)\n\t\t$hasfoto = (empty((string) $offerta->FOTO1)) ? false : true;\n\t\t\n\t\tcc_import_immobili_error_log($rif); // aggiorno log elaborazione con il rif immobile\n\t\t\n\t\t// non importo gli immobili in affitto e quelli senza foto\n\t\tif($contratto == \"Affitto\" or !$hasfoto){\n\t\t\t\n\t\t\t// aggiorno contatori in file config.xml. L'ultimo param in cc_update_configs indica di incrementare il valore già presente\n\t\t\tif($contratto == \"Affitto\") cc_update_configs(\"affitto\", 1, true); // aggiorno contatore affitti\n\t\t\tif(!$hasfoto) cc_update_configs(\"nofoto\", 1, true); // aggiorno contatore affitti\n\t\t\t\n\t\t\t// registro motivo perché salto importazione in file di log\n\t\t\t$whyskipped = \"Saltato perche contratto \".$contratto;\n\t\t\tif(!$hasfoto) $whyskipped .= \" e non ha foto\";\n\t\t\tcc_import_immobili_error_log($whyskipped);\n\t\t\tcontinue; // passo al prossimo record immobile\n\t\t} \n\t\t\n\t\t// Recupero ultima data modifica dell'immobile su Cometa\n\t\t$DataAggiornamento = (string) $offerta->DataAggiornamento;\n\t\t$DataAggiornamento = substr($DataAggiornamento, 0, -6); // elimino +1:00 da valore data se no non è allineato con tempo server\t\t\n\t\t$data_ultima_modifica_record = new DateTime( $DataAggiornamento );\t// creo oggetto DateTime\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t// controllo se l'id del record è già presente in DB e decido dunque se richiamare funzione di insert o update\n\t\tif(in_array($idunique, $record_presenti)){\n\t\t\t\t\t\t\n\t\t\t// è già presente in db - richiamo funzione che aggiorna record passando id tabella posts e oggetto xml dell'offerta\n\t\t\t$post = array_search($idunique, $record_presenti); // recupero chiave array che è post_id\n\t\t\t\n\t\t\t// recupero data ultimo aggiornamento record in tabella posts\n\t\t\t$md = get_the_modified_time( \"Y-m-d H:i:s\", $post );\n\t\t\t$post_last_modified = new DateTime( $md );\n\t\t\t\n\t\t\t// se la data dell'ultimo aggiornamento record in posts è maggiore della data di modifica in Cometa \n\t\t\t// aumento contatore skipped, tolgo id da elenco record da cancellare e passo al record successivo\n\t\t\tif($post_last_modified >= $data_ultima_modifica_record){\n\t\t\t\t\n\t\t\t\t// rimuovo immobile da elenco già presenti - a fine lavoro quelli rimasti verranno eliminati da DB\n\t\t\t\tunset($record_presenti[$post]); \n\t\t\t\t\n\t\t\t\t// aggiorno log e contatore in config.xml\n\t\t\t\t$msg_skipped = \"Record \".$post.\" DATA RECORD XML: \".$data_ultima_modifica_record->format(\"Y-m-d H:i:s\");\n\t\t\t\t$msg_skipped .= \" DATA RECORD IN POSTS: \".$post_last_modified->format(\"Y-m-d H:i:s\");\n\t\t\t\tcc_import_immobili_error_log(\"skipped\");\n\t\t\t\tcc_update_configs(\"skipped\", 1, true);// incremento valore di skipped di uno\n\t\t\t\tcontinue; // il record non è stato modificato, passo al prossimo record\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t/**\n\t\t\t * Richiamo funzione cc_update_record che aggiorna record in DB\n\t\t\t * \n\t\t\t * @param $post: post_id in tabella postmeta\n\t\t\t * @param $offerta: oggetto xml del singolo immobile\n\t\t\t * @return string con valore \"updated\" o errore rilevato\n\t\t\t */\n\t\t\t$results[$rif] = cc_update_record($post, $offerta); \n\t\t\t\n\t\t\t// elimino da record_presenti questo record. quelli che alla fine rimangono verranno cancellati\n\t\t\tunset($record_presenti[$post]); \n\t\t\t\n\t\t}else{\n\t\t\t/**\n\t\t\t * Record nuovo. Richiamo funzione cc_insert_record che inserisce un nuovo record in DB\n\t\t\t * \n\t\t\t * @param $offerta: oggetto xml del singolo immobile\n\t\t\t * @return string con valore \"inserted\" o errore rilevato\n\t\t\t */\n\t\t\t$results[$rif] = cc_insert_record($offerta);\n\t\t\t// aggiungo dicitura inserted in file log per indicare che il record è stato inserito con successo\n\t\t\tcc_import_immobili_error_log(\"inserted\"); \n\n\t\t}\n\t\t\n\t} // end foreach $offerte - finito elabroazione di tutti i record presenti nel file xml\n\t\n\t/* Procedura di cancellazione immobili non più presenti\n\t * Se l'array record_presenti non è vuoto vuol dire che uno o più immobili attualmente in db non sono più\n\t * presenti su Cometa esportazione ergo sono da cancellare da db\n\t *\n\t * @param $id2delete: id record in wp_posts\n\t * @param $id_cometa: id univoco Cometa, non utilizzato in questo frangente\n\t */\t\n\tif(!empty($record_presenti)){\n\t\t// loop record\n\t\tforeach($record_presenti as $id2delete => $id_cometa){\n\t\t\t// uso funzione di WP per cancellare record da posts\n\t\t\t$deleted = wp_delete_post( $id2delete, false ); // 2° param indica se il record dev'essere spostato in cestino (false) o se dev'essere cancellato (true)\n\t\t\tcc_update_configs(\"deleted\", 1, true); // incremento contatore deleted di 1 in config.xml\n\t\t}\n\t\t// aggiorno log con elenco degli immobili cencellati\n\t\t$msg = implode(\", \", $record_presenti);\n\t\tcc_import_immobili_error_log(\"Deleted: \".$msg);\n\t}\n\t\n\t/* Restituisci a cc_import_xml_file() array con chiave Rif e come valore \"inserted\", \"updated\" \n\t * o errore rilevato (risultato di cc_insert_record() o cc_update_record() )\n\t*/\n\treturn $results; \n\t\n}",
"public function import(\\RealtimeDespatch\\OrderFlow\\Model\\Request $request);",
"function importar_archivo_sigepp(){\n if ($this->input->post()) {\n $post = $this->input->post();\n \n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n \n /*--------------------------------------------------------------*/\n $i=0;\n $nro=0;$nroo=0;\n $lineas = file($archivotmp);\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){ \n\n $datos = explode(\";\",$linea);\n //echo count($datos).\"<br>\";\n if(count($datos)==7){\n\n $da=$datos[0]; /// Da\n $ue=$datos[1]; /// Ue\n $prog=$datos[2]; /// Aper Programa\n $proy=trim($datos[3]);\n if(strlen($proy)==2){\n $proy='00'.$proy; /// Aper Proyecto\n }\n $act=trim($datos[4]); /// Aper Actividad\n if(strlen($act)==2){\n $act='0'.$act;\n }\n $cod_part=trim($datos[5]); /// Partida\n if(strlen($cod_part)==3){\n $cod_part=$cod_part.'00';\n }\n\n $importe=(float)$datos[6]; /// Monto\n\n // echo $this->gestion.\"<br>\";\n echo $prog.'- ('.strlen($prog).') -> '.$proy.' ('.strlen($proy).') -> '.$act.' ('.strlen(trim($act)).') ----'.$importe.'-- CODIGO PARTIDA '.is_numeric($cod_part).'<br>';\n if(strlen($prog)==2 & strlen($proy)==4 & strlen(trim($act))==3 & $importe!=0 & is_numeric($cod_part)){\n // echo \"INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n $nroo++;\n // echo \"string<br>\";\n $aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n if(count($aper)!=0){\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n else{\n echo \"INSERTS : \".$nroo.\" -\".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*-------------------- Guardando Datos ------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => $aper[0]['aper_id'],\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n $nro++;\n }\n else{\n echo \"NO INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n /* $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }*/\n /*-------------------- Guardando Datos ------------------*/\n /* $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => 0,\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n }\n elseif(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe==0){\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES 0->VALOR : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n }\n }\n }\n\n $i++;\n }\n\n /*--------------------------------------------------------------*/\n } \n elseif (empty($file_basename)) {\n echo \"<script>alert('SELECCIONE ARCHIVO .CSV')</script>\";\n } \n elseif ($filesize > 100000000) {\n //redirect('');\n } \n else {\n $mensaje = \"Sólo estos tipos de archivo se permiten para la carga: \" . implode(', ', $allowed_file_types);\n echo '<script>alert(\"' . $mensaje . '\")</script>';\n }\n\n } else {\n show_404();\n }\n }",
"public function atp_import($id = null) {\n $this->layout = 'mtrd';\n\n $this->Product->recursive = -1;\n $options = array('Product.id' => $id);\n $product = $this->Product->find('first', array(\n 'conditions' => $options,\n 'contain' => array(),\n 'callbacks' => false\n ));\n\n $this->loadModel('Forecast');\n \n \n $forecasts = $this->Forecast->getMonthlyForecast($id, intval($product['Product']['sales_forecast']));\n\n $this->loadModel('Inventory');\n $this->Inventory->virtualFields['total'] = 'SUM(Inventory.quantity)';\n $inventory = $this->Inventory->find('first', array(\n 'conditions' => array(\n 'Inventory.product_id' => $id,\n 'Inventory.deleted' => 0,\n 'Warehouse.status' => 'active'\n ),\n 'fields' => array(\n 'Inventory.product_id',\n 'Inventory.total',\n ),\n 'group' => 'Inventory.product_id',\n 'recursive' => 1\n ));\n\n $this->loadModel('OrdersLine');\n\n $today = date('Y-m');\n $from = date('Y-m-d 00:00:00', strtotime($today));\n $before = date('Y-m-01 00:00:00', strtotime($from .' + 12 month'));\n\n $this->OrdersLine->virtualFields['total_received'] = 'SUM(OrdersLine.quantity - OrdersLine.receivedqty)';\n $this->OrdersLine->virtualFields['lines'] = 'CONCAT_WS(\",\", OrdersLine.id)';\n $this->OrdersLine->virtualFields['month'] = 'DATE_FORMAT( (Order.requested_delivery_date), \"%Y-%m\")';\n $lines2 = $this->OrdersLine->find('all', array(\n 'conditions' => [\n 'OrdersLine.product_id' => $id,\n 'Order.ordertype_id' => 2,\n 'Order.status_id IN' => [2,3],\n 'Order.requested_delivery_date >=' => $from,\n 'Order.requested_delivery_date <' => $before,\n 'OrderSchedule.id' => null\n ],\n 'fields' => [\n 'lines',\n 'total_received',\n 'month'\n ],\n 'contain' => ['OrderSchedule', 'Order'],\n 'group' => 'month'\n ));\n\n $lines2 = Set::combine($lines2, '{n}.OrdersLine.month', '{n}');\n\n $this->OrdersLine->virtualFields['total_received'] = 'SUM(OrdersLine.quantity - OrdersLine.receivedqty)';\n $this->OrdersLine->virtualFields['total_value'] = 'SUM((OrdersLine.quantity - OrdersLine.receivedqty) * OrdersLine.unit_price)';\n $this->OrdersLine->virtualFields['month'] = 'DATE_FORMAT( (OrderSchedule.delivery_date), \"%Y-%m\")';\n $lines = $this->OrdersLine->find('all', array(\n 'conditions' => [\n 'OrdersLine.product_id' => $id,\n 'Order.ordertype_id' => 2,\n 'Order.status_id IN' => [2,3],\n 'OrderSchedule.delivery_date >=' => $from,\n 'OrderSchedule.delivery_date <' => $before\n ],\n 'fields' => [\n 'total_received',\n 'total_value',\n 'month'\n ],\n 'contain' => ['OrderSchedule', 'Order'],\n 'group' => 'month'\n ));\n\n $lines = Set::combine($lines, '{n}.OrdersLine.month', '{n}');\n\n foreach($forecasts as $forecast) {\n if(empty($lines[$forecast['month']])) {\n $lines[$forecast['month']] = array(\n 'OrdersLine' => [\n 'total_received' => 0,\n 'total_value' => 0,\n 'month' => $forecast['month'],\n ]\n );\n } else {\n $lines[$forecast['month']]['OrdersLine']['total_received'] = intval($lines[$forecast['month']]['OrdersLine']['total_received']);\n $lines[$forecast['month']]['OrdersLine']['total_value'] = round($lines[$forecast['month']]['OrdersLine']['total_value'], 2);\n $lines[$forecast['month']]['OrdersLine']['month'] = $forecast['month'];\n \n }\n if($forecast['forecast']) {\n $lines[$forecast['month']]['Forecast']['value'] = $forecast['forecast'];\n } else {\n $lines[$forecast['month']]['Forecast']['value'] = 0; //intval($product['Product']['sales_forecast']);\n }\n unset($lines[$forecast['month']]['Order']);\n\n if(isset($lines2[$forecast['month']])) {\n $lines[$forecast['month']]['OrdersLine']['total_received'] = $lines[$forecast['month']]['OrdersLine']['total_received'] + $lines2[$forecast['month']]['OrdersLine']['total_received'];\n }\n }\n\n ksort($lines);\n $csv_lines = [];\n $start = intval($inventory['Inventory']['total']);\n foreach ($lines as $month => $line) {\n $csv_line = [];\n\n if(date('Y-m', strtotime($month)) == date('Y-m')) {\n $cur_month_forecast = round(((date('t') - date('j'))/date('t')) * intval($line['Forecast']['value']));\n } else {\n $cur_month_forecast = intval($line['Forecast']['value']);\n }\n $start = ($start - $cur_month_forecast + $line['OrdersLine']['total_received']);\n\n $csv_line['Month'] = $line['OrdersLine']['month'];\n $csv_line['Receipts'] = $line['OrdersLine']['total_received'];\n $csv_line['TotalValue'] = $line['OrdersLine']['total_value'];\n $csv_line['Demand'] = $cur_month_forecast;\n $csv_line['ATP'] = $start;\n $csv_lines[] = $csv_line;\n }\n\n $_serialize = 'csv_lines';\n $_header = array('Month','Receipts','Demand', 'ATP','TotalValue');\n $_extract = array('Month','Receipts','Demand', 'ATP','TotalValue');\n\n $file_name = \"Delivrd_\".date('Y-m-d-His').\"_atp.csv\";\n $this->response->download($file_name);\n $this->viewClass = 'CsvView.Csv';\n $this->set(compact('csv_lines', '_serialize', '_header', '_extract'));\n }",
"function importar_operaciones_requerimientos(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $com_id = $this->security->xss_clean($post['com_id']); /// com id\n $componente = $this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']);\n $list_oregional=$this->model_objetivoregion->list_proyecto_oregional($fase[0]['proy_id']); /// Lista de Objetivos Regionales\n $tp = $this->security->xss_clean($post['tp']); /// tipo de migracion\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n $guardado=0;\n $no_guardado=0;\n $nro_prod=count($this->model_producto->list_prod($com_id));\n if($nro_prod!=0){\n $ope_ult=$this->model_producto->ult_operacion($com_id);\n $nro_prod=$ope_ult[0]['prod_cod']+1;\n }\n else{\n $nro_prod=1;;\n }\n\n if($tp==1){ /// Actividades\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n if(count($datos)==21){\n\n $cod_or = trim($datos[0]); // Codigo Objetivo Regional\n $cod_ope = $nro_prod; // Codigo Operacion\n $descripcion = utf8_encode(trim($datos[2])); //// descripcion Operacion\n $resultado = utf8_encode(trim($datos[3])); //// descripcion Resultado\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $indicador = utf8_encode(trim($datos[5])); //// descripcion Indicador\n $lbase = utf8_encode(trim($datos[6])); //// Linea Base\n if(trim($datos[6])==''){\n $lbase = 0; //// Linea Base\n }\n\n $meta = utf8_encode(trim($datos[7])); //// Meta\n if(trim($datos[7])==''){\n $meta = 0; //// Meta\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $mverificacion = utf8_encode(trim($datos[20])); //// Medio de verificacion\n\n $ae=0;\n $or_id=0;\n if(count($list_oregional)!=0){\n $get_acc=$this->model_objetivoregion->get_alineacion_proyecto_oregional($fase[0]['proy_id'],$cod_or);\n if(count($get_acc)!=0){\n $ae=$get_acc[0]['ae'];\n $or_id=$get_acc[0]['or_id'];\n }\n }\n\n /*--- INSERTAR DATOS OPERACIONES (ACTIVIDADES 2020) ---*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array(\n 'com_id' => $com_id,\n 'prod_producto' => strtoupper($descripcion),\n 'prod_resultado' => strtoupper($resultado),\n 'indi_id' => 1,\n 'prod_indicador' => strtoupper($indicador),\n 'prod_fuente_verificacion' => strtoupper($mverificacion), \n 'prod_linea_base' => $lbase,\n 'prod_meta' => $meta,\n 'prod_unidades' => $unidad,\n 'acc_id' => $ae,\n 'prod_ppto' => 1,\n 'fecha' => date(\"d/m/Y H:i:s\"),\n 'prod_cod'=>$cod_ope,\n 'or_id'=>$or_id,\n 'fun_id' => $this->fun_id,\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('_productos', $data_to_store);\n $prod_id=$this->db->insert_id(); \n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0){\n $this->model_producto->add_prod_gest($prod_id,$this->gestion,$p,$m[$p]);\n }\n }\n\n $producto=$this->model_producto->get_producto_id($prod_id);\n if(count($producto)!=0){\n $guardado++;\n }\n else{\n $no_guardado++;\n }\n\n $nro_prod++;\n }\n }\n $i++;\n }\n \n }\n else{ /// Requerimientos\n\n foreach ($lineas as $linea_num => $linea){\n if($i != 0){\n $datos = explode(\";\",$linea);\n //echo count($datos).'<br>';\n if(count($datos)==20){\n \n $prod_cod = (int)$datos[0]; //// Codigo Actividad\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[2])); //// descripcion\n $unidad = utf8_encode(trim($datos[3])); //// Unidad\n $cantidad = (int)$datos[4]; //// Cantidad\n $unitario = $datos[5]; //// Costo Unitario\n \n $p_total=($cantidad*$unitario);\n $total = $datos[6]; //// Costo Total\n\n $var=7; $sum_temp=0;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n $sum_temp=$sum_temp+$m[$i];\n }\n\n $observacion = utf8_encode(trim($datos[19])); //// Observacion\n $verif_cod=$this->model_producto->verif_componente_operacion($com_id,$prod_cod);\n \n //echo count($verif_cod).'--'.count($par_id).'--'.$cod_partida.'--'.round($sum_temp,2).'=='.round($total,2);\n\n if(count($verif_cod)!=0 & count($par_id)!=0 & $cod_partida!=0 & round($sum_temp,2)==round($total,2)){ /// Verificando si existe Codigo de Actividad, par id, Codigo producto\n // if($verif_cod[0]['prod_ppto']==1){ /// guardando si tiene programado presupuesto en la operacion\n $guardado++;\n /*-------- INSERTAR DATOS REQUERIMIENTO ---------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_unidad_medida' => $unidad, /// Unidad de Medida\n 'ins_gestion' => $this->gestion, /// Insumo gestion\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fun_id' => $this->fun_id, /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*--------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_cod[0]['prod_id'], /// prod id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array(\n 'ins_id' => $ins_id, /// Id Insumo\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('temporalidad_prog_insumo', $data_to_store4);\n }\n }\n // }\n\n }\n \n\n } /// end dimension (22)\n } /// i!=0\n\n $i++;\n\n }\n\n /// --- ACTUALIZANDO MONEDA PARA CARGAR PRESUPUESTO\n $this->update_ptto_operaciones($com_id);\n } /// end else\n\n $this->session->set_flashdata('success','SE REGISTRARON '.$guardado.' REQUERIMIENTOS');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n else{\n $this->session->set_flashdata('danger','SELECCIONE ARCHIVO ');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n }\n else{\n echo \"Error !!\";\n }\n }",
"public function acceptFromPoAction()\r\n {\r\n $request = $this->getRequest();\r\n if ($request->getHeader('Referer') == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $id = (int) $this->params()->fromQuery('target_id');\r\n $token = $this->params()->fromQuery('token');\r\n\r\n /**@var \\Application\\Repository\\FinVendorInvoiceRepository $res ;*/\r\n $res = $this->doctrineEM->getRepository('Application\\Entity\\FinVendorInvoice');\r\n $rows_tmp = $res->getAPInvoiceTmp($id, $token);\r\n\r\n if ($rows_tmp !== null) {\r\n\r\n /**@var \\Application\\Entity\\FinVendorInvoice $target ;*/\r\n $target = null;\r\n\r\n if (count($rows_tmp) > 0) {\r\n $row_1 = $rows_tmp[0];\r\n if ($row_1 instanceof FinVendorInvoiceRowTmp) {\r\n $target = $row_1->getInvoice();\r\n }\r\n\r\n if ($target == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $n = 0;\r\n foreach ($rows_tmp as $r) {\r\n\r\n /**@var \\Application\\Entity\\FinVendorInvoiceRowTmp $r ;*/\r\n\r\n $n ++;\r\n $ap_row = new FinVendorInvoiceRow();\r\n $ap_row->setIsActive(1);\r\n $ap_row->setRowNumber($n);\r\n $ap_row->setRowIndentifer($target->getSysNumber() . \"-$n\");\r\n\r\n $ap_row->setCurrentState($target->getCurrentState());\r\n $ap_row->setInvoice($target);\r\n $ap_row->setPoRow($r->getPoRow());\r\n $ap_row->setPrRow($r->getPrRow());\r\n $ap_row->setItem($r->getItem());\r\n\r\n $ap_row->setQuantity($r->getQuantity());\r\n $ap_row->setUnit($r->getUnit());\r\n $ap_row->setUnitPrice($r->getUnitPrice());\r\n\r\n $netAmount = $r->getQuantity() * $r->getUnitPrice();\r\n\r\n $taxRate = (int) $r->getTaxRate();\r\n $ap_row->setTaxRate($taxRate);\r\n\r\n $taxAmount = $netAmount * $taxRate;\r\n $grossAmount = $netAmount + $taxAmount;\r\n\r\n $ap_row->setNetAmount($netAmount);\r\n $ap_row->setGrossAmount($grossAmount);\r\n\r\n $u = $this->doctrineEM->getRepository('Application\\Entity\\MlaUsers')->findOneBy(array(\r\n \"email\" => $this->identity()\r\n ));\r\n\r\n $ap_row->setCreatedBy($u);\r\n $ap_row->setCreatedOn(new \\DateTime());\r\n $ap_row->setToken(Rand::getString(10, \\Application\\Model\\Constants::CHAR_LIST, true) . \"_\" . Rand::getString(21, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n $ap_row->setRemarks($r->getRemarks());\r\n\r\n $this->doctrineEM->persist($ap_row);\r\n\r\n $r->setCurrentState(\"ACCEPTED\");\r\n $r->setIsActive(0);\r\n $this->doctrineEM->persist($r);\r\n\r\n $gr_entity = new NmtInventoryTrx();\r\n $gr_entity->setVendor($target->getVendor());\r\n $gr_entity->setFlow('IN');\r\n $gr_entity->setInvoiceRow($ap_row);\r\n $gr_entity->setItem($r->getItem());\r\n $gr_entity->setPrRow($r->getPrRow());\r\n $gr_entity->setQuantity($r->getQuantity());\r\n $gr_entity->setVendorItemCode($r->getVendorItemCode());\r\n $gr_entity->setVendorItemUnit($r->getUnit());\r\n $gr_entity->setVendorUnitPrice($r->getUnitPrice());\r\n $gr_entity->setTrxDate($target->getGrDate());\r\n $gr_entity->setCurrency($target->getCurrency());\r\n $gr_entity->setRemarks(\"GR of Invoice \" . $target->getInvoiceNo());\r\n $gr_entity->setWh($target->getWarehouse());\r\n $gr_entity->setCreatedBy($u);\r\n $gr_entity->setCreatedOn(new \\DateTime());\r\n $gr_entity->setToken(Rand::getString(10, \\Application\\Model\\Constants::CHAR_LIST, true) . \"_\" . Rand::getString(21, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n $gr_entity->setChecksum(Rand::getString(32, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n\r\n $gr_entity->setTaxRate($r->getTaxRate());\r\n\r\n $gr_entity->setCurrentState($target->getCurrentState());\r\n\r\n if ($target->getCurrentState() == \"finalInvoice\") {\r\n $gr_entity->setIsActive(1);\r\n } else {\r\n $gr_entity->setIsActive(0);\r\n }\r\n\r\n $this->doctrineEM->persist($gr_entity);\r\n $this->doctrineEM->flush();\r\n }\r\n }\r\n\r\n $this->doctrineEM->flush();\r\n\r\n /*\r\n * $redirectUrl = \"/finance/v-invoice/copy-from-po1?token=\" . $target>getToken() . \"&entity_id=\" . $entity->getId();\r\n */\r\n $redirectUrl = \"/finance/v-invoice/list\";\r\n return $this->redirect()->toUrl($redirectUrl);\r\n\r\n /*\r\n * return new ViewModel(array(\r\n * 'target' => $target,\r\n * ));\r\n */\r\n }\r\n return $this->redirect()->toRoute('access_denied');\r\n }",
"public function importArticleFromExact($projectId=''){\n //$projectId = 37;\n if($projectId!=''){\n $this->load->helper('ExactOnline/vendor/autoload');\n $this->load->model('Projects_model');\n $this->load->model('Exactonline_model');\n $this->load->model('Shopify_exact_model');\n $this->load->model('Shopify_model');\n // get all projects having erp system exact with webshop woocommerce.\n $projects = $this->db->get_where('projects', array('id' => $projectId))->result_array();\n if(!empty($projects)){\n\n foreach ($projects as $p_key => $p_value) {\n $projectId = $p_value['id'];\n if($this->Projects_model->getValue('cms', $projectId)!='shopify' || $p_value['erp_system']!='exactonline')\n continue;\n $lastExecution = $this->Projects_model->getValue('articles_last_execution', $projectId);\n $customersInterval = $this->Projects_model->getValue('article_interval', $projectId);\n $enabled_con = $this->Projects_model->getValue('enabled', $projectId);\n $enabled = $this->Projects_model->getValue('articles_enabled', $projectId);\n $itemId = isset($_GET['itemId'])?$_GET['itemId']:''; \n $itemCode = isset($_GET['itemCode'])?$_GET['itemCode']:''; \n // check if the last execution time is satisfy the time checking. customers_amount\n if($enabled_con == '1' && $enabled == '1' && ($lastExecution == '' || ($lastExecution + ($customersInterval * 60) <= time()))){\n $time_u = $lastExecution + ($customersInterval * 60);\n //reset last execution time\n $this->Projects_model->saveValue('articles_last_execution', $time_u, $projectId);\n // get the offset and amount to import customers. \n $offset = $this->Projects_model->getValue('article_offset', $projectId) ? $this->Projects_model->getValue('article_offset', $projectId) : NULL;\n $amount = $this->Projects_model->getValue('article_amount', $projectId) ? $this->Projects_model->getValue('article_amount', $projectId) : 10;\n //--------------- make exact connection ----------------------------------//\n $this->Exactonline_model->setData(\n array(\n 'projectId' => $projectId,\n 'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\n 'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\n 'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\n )\n );\n $connection = $this->Exactonline_model->makeConnection($projectId);\n if($connection):\n $publised_scope = $this->Projects_model->getValue('shopify_published_scope', $projectId)?$this->Projects_model->getValue('shopify_published_scope', $projectId):'web';\n $import_exact_image = $this->Projects_model->getValue('import_image_from_exact', $projectId) ? $this->Projects_model->getValue('import_image_from_exact', $projectId) : 0;\n $import_exact_description = $this->Projects_model->getValue('import_exact_description', $projectId) ? $this->Projects_model->getValue('import_exact_description', $projectId) : 0;\n $import_exact_extra_description = $this->Projects_model->getValue('import_exact_extra_description', $projectId) ? $this->Projects_model->getValue('import_exact_extra_description', $projectId) : 0;\n $inventory_management = $this->Projects_model->getValue('shopify_stock_management', $projectId) ? $this->Projects_model->getValue('shopify_stock_management', $projectId) : '';\n\n $import_option_array = [\n 'import_exact_description'=>$import_exact_description, \n 'import_exact_extra_description'=>$import_exact_extra_description, \n 'publised_scope'=>$publised_scope, \n 'inventory_management'=>$inventory_management,\n ];\n // get article from exactonline based on amount and offset //\n $items = $this->Shopify_exact_model->getExactArticle($connection, $itemId, $offset, $amount, true, $itemCode, $import_exact_image, $import_option_array);\n //call Woocommerce_model to create and update article in WooCommerce//\n if(!empty($items))\n $items = $this->Shopify_model->importArticleInShopify($items, $projectId, null, $connection);\n endif;\n }\n }\n }\n }\n }",
"public function additionInvoices()\n {\n\t\t\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `invoice` (`bill`, `idate`, `price`, `discount`, `expenses`, `totalc`, `percent`, `totalm`, `payment`, `note`, `orderid`, `credit`, `creditid`)\n\t\t\t\t\tVALUES('$this->bill', '$this->idate', '$this->price', ' $this->discount', '$this->expenses', '$this->totalc', '$this->percent', '$this->totalm', '$this->payment', '$this->note',\n\t\t\t\t\t'$this->orderid', '$this->credit', '$this->creditd')\");\n $result = $sql->execute();\n $idp = $dbh->lastInsertId();\n return array ($result,$idp);\n }",
"public function getInvoiceModel(){}",
"function erp_process_import_export() {\n if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'erp-import-export-nonce' ) ) {\n return;\n }\n\n $is_crm_activated = erp_is_module_active( 'crm' );\n $is_hrm_activated = erp_is_module_active( 'hrm' );\n\n $departments = $is_hrm_activated ? erp_hr_get_departments_dropdown_raw() : [];\n $designations = $is_hrm_activated ? erp_hr_get_designation_dropdown_raw() : [];\n\n $field_builder_contact_options = get_option( 'erp-contact-fields' );\n $field_builder_contacts_fields = [];\n\n if ( ! empty( $field_builder_contact_options ) ) {\n foreach ( $field_builder_contact_options as $field ) {\n $field_builder_contacts_fields[] = $field['name'];\n }\n }\n\n $field_builder_company_options = get_option( 'erp-company-fields' );\n $field_builder_companies_fields = [];\n\n if ( ! empty( $field_builder_company_options ) ) {\n foreach ( $field_builder_company_options as $field ) {\n $field_builder_companies_fields[] = $field['name'];\n }\n }\n\n $field_builder_employee_options = get_option( 'erp-employee-fields' );\n $field_builder_employees_fields = array();\n\n if ( ! empty( $field_builder_employee_options ) ) {\n foreach ( $field_builder_employee_options as $field ) {\n $field_builder_employees_fields[] = $field['name'];\n }\n }\n\n if ( isset( $_POST['erp_import_csv'] ) ) {\n define( 'ERP_IS_IMPORTING', true );\n\n $fields = ! empty( $_POST['fields'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['fields'] ) ) : [];\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n\n if ( empty( $type ) ) {\n return;\n }\n\n $csv_file = isset( $_FILES['csv_file'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_FILES['csv_file'] ) ) : [];\n\n $data = [ 'type' => $type, 'fields' => $fields, 'file' => $csv_file ];\n\n do_action( 'erp_tool_import_csv_action', $data );\n\n if ( ! in_array( $type, [ 'contact', 'company', 'employee' ] ) ) {\n return;\n }\n\n $employee_fields = [\n 'work' => [\n 'designation',\n 'department',\n 'location',\n 'hiring_source',\n 'hiring_date',\n 'date_of_birth',\n 'reporting_to',\n 'pay_rate',\n 'pay_type',\n 'type',\n 'status',\n ],\n 'personal' => [\n 'photo_id',\n 'user_id',\n 'first_name',\n 'middle_name',\n 'last_name',\n 'other_email',\n 'phone',\n 'work_phone',\n 'mobile',\n 'address',\n 'gender',\n 'marital_status',\n 'nationality',\n 'driving_license',\n 'hobbies',\n 'user_url',\n 'description',\n 'street_1',\n 'street_2',\n 'city',\n 'country',\n 'state',\n 'postal_code',\n ]\n ];\n\n require_once WPERP_INCLUDES . '/lib/parsecsv.lib.php';\n\n $csv = new ParseCsv();\n $csv->encoding( null, 'UTF-8' );\n $csv->parse( $csv_file['tmp_name'] );\n\n if ( empty( $csv->data ) ) {\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=import\" ) );\n exit;\n }\n\n $csv_data = [];\n\n $csv_data[] = array_keys( $csv->data[0] );\n\n foreach ( $csv->data as $data_item ) {\n $csv_data[] = array_values( $data_item );\n }\n\n if ( ! empty( $csv_data ) ) {\n $count = 0;\n\n foreach ( $csv_data as $line ) {\n if ( empty( $line ) ) {\n continue;\n }\n\n $line_data = [];\n\n if ( is_array( $fields ) && ! empty( $fields ) ) {\n foreach ($fields as $key => $value) {\n\n if (!empty($line[$value]) && is_numeric($value)) {\n if ($type == 'employee') {\n if (in_array($key, $employee_fields['work'])) {\n if ($key == 'designation') {\n $line_data['work'][$key] = array_search($line[$value], $designations);\n } else if ($key == 'department') {\n $line_data['work'][$key] = array_search($line[$value], $departments);\n } else {\n $line_data['work'][$key] = $line[$value];\n }\n\n } else if (in_array($key, $employee_fields['personal'])) {\n $line_data['personal'][$key] = $line[$value];\n } else {\n $line_data[$key] = $line[$value];\n }\n } else {\n $line_data[$key] = isset($line[$value]) ? $line[$value] : '';\n $line_data['type'] = $type;\n }\n }\n }\n }\n\n if ( $type == 'employee' && $is_hrm_activated ) {\n if ( ! isset( $line_data['work']['status'] ) ) {\n $line_data['work']['status'] = 'active';\n }\n\n\n $item_insert_id = erp_hr_employee_create( $line_data );\n\n if ( is_wp_error( $item_insert_id ) ) {\n continue;\n }\n }\n\n if ( ( $type == 'contact' || $type == 'company' ) && $is_crm_activated ) {\n $contact_owner = isset( $_POST['contact_owner'] ) ? absint( $_POST['contact_owner'] ) : erp_crm_get_default_contact_owner();\n $line_data['contact_owner'] = $contact_owner;\n $people = erp_insert_people( $line_data, true );\n\n if ( is_wp_error( $people ) ) {\n continue;\n } else {\n $contact = new \\WeDevs\\ERP\\CRM\\Contact( absint( $people->id ), 'contact' );\n $life_stage = isset( $_POST['life_stage'] ) ? sanitize_key( $_POST['life_stage'] ) : '';\n\n if ( ! $people->exists ) {\n $contact->update_life_stage( $life_stage );\n\n } else {\n if ( ! $contact->get_life_stage() ) {\n $contact->update_life_stage( $life_stage );\n }\n }\n\n if ( ! empty( $_POST['contact_group'] ) ) {\n $contact_group = absint( $_POST['contact_group'] );\n\n $existing_data = \\WeDevs\\ERP\\CRM\\Models\\ContactSubscriber::where( [\n 'group_id' => $contact_group,\n 'user_id' => $people->id\n ] )->first();\n\n if ( empty( $existing_data ) ) {\n $hash = sha1( microtime() . 'erp-subscription-form' . $contact_group . $people->id );\n\n erp_crm_create_new_contact_subscriber( [\n 'group_id' => $contact_group,\n 'user_id' => $people->id,\n 'status' => 'subscribe',\n 'subscribe_at' => current_time( 'mysql' ),\n 'unsubscribe_at' => null,\n 'hash' => $hash\n ] );\n }\n }\n\n\n if ( ! empty( $field_builder_contacts_fields ) ) {\n foreach ( $field_builder_contacts_fields as $field ) {\n if ( isset( $line_data[ $field ] ) ) {\n erp_people_update_meta( $people->id, $field, $line_data[ $field ] );\n }\n }\n }\n }\n }\n\n ++ $count;\n }\n\n }\n\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=import&imported=$count\" ) );\n exit;\n }\n\n if ( isset( $_POST['erp_export_csv'] ) ) {\n if ( ! empty( $_POST['type'] ) && ! empty( $_POST['fields'] ) ) {\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n $fields = array_map( 'sanitize_text_field', wp_unslash( $_POST['fields'] ) );\n\n if ( $type == 'employee' && $is_hrm_activated ) {\n $args = [\n 'number' => - 1,\n 'status' => 'all'\n ];\n\n $items = erp_hr_get_employees( $args );\n }\n\n if ( ( $type == 'contact' || $type == 'company' ) && $is_crm_activated ) {\n $args = [\n 'type' => $type,\n 'count' => true,\n ];\n $total_items = erp_get_peoples( $args );\n\n $args = [\n 'type' => $type,\n 'offset' => 0,\n 'number' => - 1,\n ];\n $items = erp_get_peoples( $args );\n }\n\n //@todo do_action()\n $csv_items = [];\n\n $x = 0;\n foreach ( $items as $item ) {\n\n if ( empty( $fields ) ) {\n continue;\n }\n\n foreach ( $fields as $field ) {\n if ( $type == 'employee' ) {\n\n if ( in_array( $field, $field_builder_employees_fields ) ) {\n $csv_items[ $x ][ $field ] = get_user_meta( $item->id, $field, true );\n } else {\n switch ( $field ) {\n case 'department':\n $csv_items[ $x ][ $field ] = $item->get_department_title();\n break;\n\n case 'designation':\n $csv_items[ $x ][ $field ] = $item->get_job_title();\n break;\n\n default:\n $csv_items[ $x ][ $field ] = $item->{$field};\n break;\n }\n }\n\n } else {\n if ( $type == 'contact' ) {\n if ( in_array( $field, $field_builder_contacts_fields ) ) {\n $csv_items[ $x ][ $field ] = erp_people_get_meta( $item->id, $field, true );\n } else {\n $csv_items[ $x ][ $field ] = $item->{$field};\n }\n }\n if ( $type == 'company' ) {\n if ( in_array( $field, $field_builder_companies_fields ) ) {\n $csv_items[ $x ][ $field ] = erp_people_get_meta( $item->id, $field, true );\n } else {\n $csv_items[ $x ][ $field ] = $item->{$field};\n }\n }\n }\n }\n\n $x ++;\n }\n\n $file_name = 'export_' . date( 'd_m_Y' ) . '.csv';\n\n erp_make_csv_file( $csv_items, $file_name );\n\n } else {\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=export\" ) );\n exit();\n }\n }\n}",
"function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it grpo template file?\n\t \tif($excel['cells'][1][1] == 'SFG Item No.' && $excel['cells'][1][2] == 'SFG Quantity') {\n\n\t\t\t$this->db->trans_start();\n\n\t\t\t$j = 0; // grpo_header number, started from 1, 0 assume no data\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\t\t\t\t$x = $i - 1; // to check, is it same grpo header?\n\n\t\t\t\t$kode_sfg = $excel['cells'][$i][1];\n\t\t\t\t$quantity_sfg = $excel['cells'][$i][2];\n \t\t\t$material_no = $excel['cells'][$i][3];\n \t\t\t$quantity = $excel['cells'][$i][4];\n \t$plant = $excel['cells'][$i][5];\n if(empty($plant)) {\n $plant = $this->session->userdata['ADMIN']['plant'];\n }\n\n\n\t\t\t\t// check grpo header\n\t\t\t\tif(($excel['cells'][$i][1] != $excel['cells'][$x][1])||($excel['cells'][$i][5] != $excel['cells'][$x][5])) {\n\n $sfgs_header = $this->m_sfgs->sfgs_header_select_by_kode_sfg($kode_sfg,$plant);\n if ($sfgs_header!=FALSE) {\n $this->m_sfgs->sfgs_header_delete_multiple($sfgs_header);\n }\n $j++;\n\t\t\t\t // \tif($sfgs_detail_temp = $this->m_general->sap_item_groups_select_all_sfgs()) {\n $object['sfgs_headers'][$j]['plant'] = $plant;\n $object['sfgs_headers'][$j]['kode_sfg'] = $excel['cells'][$i][1];\n $item_temp = $this->m_general->sap_item_select_by_item_code($excel['cells'][$i][1]);\n $object['sfgs_headers'][$j]['nama_sfg'] = $item_temp['MAKTX'];\n $object['sfgs_headers'][$j]['quantity_sfg'] = $quantity_sfg;\n $object['sfgs_headers'][$j]['uom_sfg'] = $item_temp['UNIT'];\n\t\t\t\t\t $object['sfgs_headers'][$j]['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n\t\t\t\t\t $object['sfgs_headers'][$j]['filename'] = $this->session->userdata('filename_upload');\n\n\t\t\t\t\t\t$id_sfgs_header = $this->m_sfgs->sfgs_header_insert($object['sfgs_headers'][$j]);\n\n \t$sfgs_header_exist = TRUE;\n\t\t\t\t\t\t$k = 1; // grpo_detail number\n\n\t\t\t //\t\t} else {\n //\t$sfgs_header_exist = FALSE;\n\t\t\t//\t\t}\n\t\t\t\t}\n\n\t\t\t\tif($sfgs_header_exist) {\n\n\t\t\t\t\tif($sfgs_detail_temp = $this->m_general->sap_item_select_by_item_code($material_no)) {\n $object['sfgs_details'][$j][$k]['id_sfgs_header'] = $id_sfgs_header;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['id_sfgs_h_detail'] = $k;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['material_no'] = $material_no;\n\t\t\t\t\t\t$object['sfgs_details'][$j][$k]['material_desc'] = $sfgs_detail_temp['MAKTX'];\n \t\t\t\t\t $object['sfgs_details'][$j][$k]['quantity'] = $quantity;\n\n $uom_import = $sfgs_detail_temp['UNIT'];\n if(strcasecmp($uom_import,'KG')==0) {\n $uom_import = 'G';\n }\n if(strcasecmp($uom_import,'L')==0) {\n $uom_import = 'ML';\n }\n \t\t\t$object['sfgs_details'][$j][$k]['uom'] = $uom_import;\n\n\t\t\t\t\t\t$id_sfgs_detail = $this->m_sfgs->sfgs_detail_insert($object['sfgs_details'][$j][$k]);\n\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 1;\n\t\t\t$object['refresh_text'] = 'Data Master Semi Finished Goods (SFG) BOM berhasil di-upload';\n\t\t\t$object['refresh_url'] = $this->session->userdata['PAGE']['sfgs_browse_result'];\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Master Semi Finished Goods (SFG) BOM atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'sfgs/browse_result/0/0/0/0/10';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '008';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}",
"public function exportAction() {\n\t\tInvoices::Export();\n\t}",
"public function importacionLinea($tipo) {\n //echo \"llego2\";\n $codLin = '02';\n $tipConsult = $tipo;\n $dtActFecha = date(\"Y-m\", strtotime(date()));//'2019-02';//\n //$dtAntFecha = date(\"Y-m\", strtotime(date()));//restarle 1 mes//'2019-01';//\n\t$dtAntFecha = date(\"Y-m\", strtotime('-1 month', strtotime(date())));//Se resta 1 mes.\n //Generar Manualmente\n //$dtActFecha ='2019-04';\n //$dtAntFecha ='2019-03';\n \n \n try {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $con = $obj_con->conexionServidor();\n //$rawDataANT = array();\n $rawDataACT = array();\n \n $sql = \"SELECT A.COD_LIN, A.COD_TIP, A.COD_MAR, D.NOM_LIN, E.NOM_TIP, F.NOM_MAR,\"\n . \"SUM(A.P_PROME*B.EXI_TOT) AS COS_ACT, \";\n $sql .= \"IFNULL((SELECT X.COSTO_T FROM \" . $obj_con->BdServidor . \".IG0007 X \"\n . \" WHERE X.COD_LIN=A.COD_LIN AND X.COD_MAR=A.COD_MAR AND TIP_CON='$tipConsult' \"\n . \" AND ANO_MES='$dtAntFecha'),0) COS_ANT \"; \n $sql .= \" FROM \" . $obj_con->BdServidor . \".IG0020 A \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0022 B ON A.COD_ART=B.COD_ART \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0001 D ON A.COD_LIN=D.COD_LIN \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0002 E ON A.COD_TIP=E.COD_TIP \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0003 F ON A.COD_MAR=F.COD_MAR \";\n $sql .= \" WHERE B.EXI_TOT <> 0 \"; \n $sql .=($codLin!='')?\" AND A.COD_LIN='$codLin' \":\"\";\n $sql .=($tipConsult!='TD')?\" AND A.COD_TIP='$tipConsult' \":\"\";\n $sql .=\" GROUP BY A.COD_LIN,A.COD_MAR ORDER BY COD_LIN,COD_MAR \";\n $sentencia = $con->query($sql);\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawDataACT[] = $fila;\n }\n }\n //cls_Global::putMessageLogFile($sql);\n for ($i = 0; $i < sizeof($rawDataACT); $i++) {\n \n $sql=\"INSERT INTO \" . $obj_con->BdServidor . \".IG0007 \n (COD_LIN,COD_TIP,COD_MAR,NOM_MAR,COST_ANT,COST_ACT,COSTO_T,FEC_SIS,TIP_CON,ANO_MES)VALUES \n ('\" . $rawDataACT[$i]['COD_LIN'] . \"',\n '\" . $rawDataACT[$i]['COD_TIP'] . \"',\n '\" . $rawDataACT[$i]['COD_MAR'] . \"',\n '\" . $rawDataACT[$i]['NOM_MAR'] . \"',\n '\" . $rawDataACT[$i]['COS_ANT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $dtActFecha . \"-01',\n '\" . $tipConsult . \"',\n '\" . $dtActFecha . \"')\";\n //cls_Global::putMessageLogFile($rawDataACT[$i]['COS_ACT']);\n //cls_Global::putMessageLogFile($sql);\n $command = $con->prepare($sql); \n $command->execute();\n \n \n } \n\n $con->commit();\n $con->close();\n return true;\n } catch (Exception $e) { // se arroja una excepción si una consulta falla\n //return VSexception::messageSystem('NO_OK', $e->getMessage(), 41, null, null);\n $con->rollback();\n $con->close();\n throw $e;\n return false;\n }\n }"
] |
[
"0.6160811",
"0.6092921",
"0.6070143",
"0.60537654",
"0.6014876",
"0.5939625",
"0.59354407",
"0.5925229",
"0.590973",
"0.58999026",
"0.5807194",
"0.5807071",
"0.5786248",
"0.5786237",
"0.57845294",
"0.57713085",
"0.57616097",
"0.5738576",
"0.57334757",
"0.5668987",
"0.5653592",
"0.5620145",
"0.5610192",
"0.559603",
"0.55933595",
"0.5582551",
"0.5580042",
"0.5575234",
"0.5574287",
"0.55442035"
] |
0.6314216
|
0
|
$songs = DB::table('songs')>get(); // with empty pram index( ) method
|
public function index(Song $song){
//$songs = Song::get(); // with empty pram index( ) method
$songs = $song->get();
return view('songs.list')->with('songs',$songs);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function getSongs()\n {\n $songs = Song::with('album:id,name')->get();\n return $songs;\n }",
"public function index()\n {\n //\n return response()->json(Song::all());\n\n\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function index()\n {\n $input = MusicMod::orderBy('id','desc')->paginate(20);\n return view('songnew.index')->with('v_song',$input);\n }",
"public function songs()\n {\n return $this\n ->hasMany('App\\PlaylistSong', 'playlist')\n ->selectRaw('songs.id, songs.title as title, albums.title as album, name, duration, cover, artists.slug as artist_slug, albums.slug as album_slug, songs.slug as song_slug')\n ->join('songs', 'playlist_songs.song', '=', 'songs.id')\n ->join('albums', 'songs.album', '=', 'albums.id')\n ->join('artists', 'albums.artist', '=', 'artists.id')\n ->orderBy('songs.title', 'asc');\n }",
"public function index()\n {\n $songs = song::all();\n return view('song.list', compact('songs','songs'));\n }",
"public function index()\n {\n $datos = Song::all();\n return view('songs.index', compact('datos'));\n }",
"public function get_songs()\n\t{\n\t\t// $this->db->order_by('songs.id', 'DESC');\n\t\t//$this->db->limit($limit, $offset);\n\t\t$query = $this->db->get('songs');\n\t\t//$this->lastQuery = $this->db->last_query();\n\n\t\tif($query->num_rows() > 0){\n return $query->result();\n }else{\n return false;\n\t\t}\n\t}",
"public function index()\n {\n \n $model = Song::all();\n \n return view('backend.song.index',compact('model'));\n }",
"public function index()\n {\n return DB::table('Item')->get();\n }",
"public function index()\n {\n $songs=Song::all();\n return view('admin.scoreboard.songs.index', compact('songs'));\n }",
"public function songs(){\n return $this->belongsToMany(Song::class);\n }",
"function getSongs() {\n\t$sql = q(\"SELECT * FROM lib_songs\");\n\treturn getSqlArray($sql);\n}",
"public function songs()\n {\n return $this->hasMany(Song::class);\n }",
"public function songs()\n {\n return $this->hasMany('App\\Song', 'album');\n }",
"public function fetchPlaylist(){\nreturn $this->db->find();\n}",
"public function songs()\n\t{\n\t\treturn $this->hasMany('homemusic\\Song');\n\t}",
"public function index()\n {\n return Faq::whereNull('deleted_at')\n ->with([])\n ->get();\n }",
"public function artistIndex()\n {\n return SongResource::collection(auth()->user()->artist->songs);\n }",
"public function index()\n {\n // get full table with related data\n $songs = Song::with('onsongs')->get();\n return response($songs->jsonSerialize(), Response::HTTP_OK);\n }",
"public function index()\n {\n $songs = Song::filter(request()->all(), SongFilter::class)->latest('published_at');\n\n return view('songs.index', ['songs' => $songs->paginate(10)]);\n }",
"public function index()\n {\n $soupKitchens = DB::select('select * from soupkitchen');\n return $soupKitchens;\n }",
"public function index()\n {\n return Model::all();\n }",
"public function index()\n {\n $songs = DB::table('songs')->get();\n $albums = DB::table('albums')->inRandomOrder()->limit(3)->get();\n foreach ($albums as $album){\n $url = Storage::url($album->imgPath);\n $album->imgPath = $url;\n }\n return view('song.index', compact('songs', 'albums'));\n }",
"public function index()\n {\n //\n return Film::all();\n }",
"public function index()\n {\n // return Car::all();\n\n $skip = request()->input('skip', 0);\n $take = request()->input('take', Car::get()->count());\n\n return Car::skip($skip)->take($take)->get();\n }",
"public function getAllSongs()\n {\n $sql = \"SELECT id, artist, track, link FROM song\";\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 function index()\n {\n return $tracks = Track::with('skills')\n ->with('level')->with('field')->with('status')->with('houses')\n ->select('id','track','description','field_id', 'level_id','status_id')->get(); \n }",
"public function index()\n {\n return DB::table('generos')->get();\n }",
"public function index()\n {\n// $books = \\DB::select('SELECT * from `books`');\n// return $books;\n\n $books = DB::select('SELECT * from `books` limit ? offset ?', [2, 1]);\n return $books;\n return 'Hello world';\n }"
] |
[
"0.6412054",
"0.6310723",
"0.63019145",
"0.6301433",
"0.6258618",
"0.625772",
"0.6243579",
"0.62057394",
"0.61885655",
"0.616153",
"0.6132162",
"0.6121068",
"0.6114343",
"0.6100594",
"0.5989152",
"0.58876556",
"0.5882997",
"0.5882614",
"0.58800256",
"0.58730215",
"0.5801377",
"0.5764674",
"0.57550937",
"0.57472473",
"0.5714721",
"0.5691202",
"0.5681778",
"0.5675669",
"0.56728804",
"0.5641313"
] |
0.6741812
|
0
|
Return the SocialEntryProvider instance.
|
public function getProvider(): SocialEntryProvider
{
return $this->provider;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getSocial(string $provider)\n {\n return $this->socials()\n ->whereProvider($provider)\n ->first();\n }",
"public static function getInstance(Provider $provider = null) {\r\n if (self::$_instance === false) {\r\n self::$_instance = new self($provider);\r\n }\r\n\r\n return self::$_instance;\r\n }",
"public static function getProvider()\n {\n return self::$provider;\n }",
"public function getProvider()\n {\n return $this->provider;\n }",
"public function getProvider()\n {\n return $this->provider;\n }",
"public function getProvider() {\n return $this->provider;\n }",
"public function getProvider()\n {\n return $this->Provider;\n }",
"protected function getShareByMailProvider() {\n\t\tif ($this->shareByMailProvider === null) {\n\t\t\t/*\n\t\t\t * Check if the app is enabled\n\t\t\t */\n\t\t\t$appManager = $this->serverContainer->getAppManager();\n\t\t\tif (!$appManager->isEnabledForUser('sharebymail')) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$settingsManager = new SettingsManager($this->serverContainer->getConfig());\n\n\t\t\t$this->shareByMailProvider = new ShareByMailProvider(\n\t\t\t\t$this->serverContainer->getDatabaseConnection(),\n\t\t\t\t$this->serverContainer->getSecureRandom(),\n\t\t\t\t$this->serverContainer->getUserManager(),\n\t\t\t\t$this->serverContainer->getLazyRootFolder(),\n\t\t\t\t$this->serverContainer->getL10N('sharebymail'),\n\t\t\t\t$this->serverContainer->getLogger(),\n\t\t\t\t$this->serverContainer->getMailer(),\n\t\t\t\t$this->serverContainer->getURLGenerator(),\n\t\t\t\t$this->serverContainer->getActivityManager(),\n\t\t\t\t$settingsManager,\n\t\t\t\t$this->serverContainer->query(Defaults::class),\n\t\t\t\t$this->serverContainer->getHasher(),\n\t\t\t\t$this->serverContainer->get(IEventDispatcher::class)\n\t\t\t);\n\t\t}\n\n\t\treturn $this->shareByMailProvider;\n\t}",
"public function getProvider();",
"public function getProvider();",
"public function getProvider();",
"protected function createProvider()\n {\n $this->provider = new Keycloak(\n [\n 'authServerUrl' => $this->config->get('authServerUrl'),\n 'realm' => $this->config->get('realm'),\n 'clientId' => $this->config->get('clientId'),\n 'clientSecret' => $this->config->get('clientSecret'),\n 'redirectUri' => $this->getRedirectUrl()\n ]\n );\n\n return $this->provider;\n }",
"public static function getInstance()\n {\n if (self::$instance === null) {\n $config = Config::getInstance()->get(\n 'php-censor.security.auth_providers',\n [\n 'internal' => [\n 'type' => 'internal'\n ]\n ]\n );\n\n $providers = [];\n foreach ($config as $key => $providerConfig) {\n $providers[$key] = self::buildProvider($key, $providerConfig);\n }\n self::$instance = new self($providers);\n }\n\n return self::$instance;\n }",
"protected function getShareByCircleProvider() {\n\t\tif ($this->circlesAreNotAvailable) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!$this->serverContainer->getAppManager()->isEnabledForUser('circles') ||\n\t\t\t!class_exists('\\OCA\\Circles\\ShareByCircleProvider')\n\t\t) {\n\t\t\t$this->circlesAreNotAvailable = true;\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($this->shareByCircleProvider === null) {\n\t\t\t$this->shareByCircleProvider = new \\OCA\\Circles\\ShareByCircleProvider(\n\t\t\t\t$this->serverContainer->getDatabaseConnection(),\n\t\t\t\t$this->serverContainer->getSecureRandom(),\n\t\t\t\t$this->serverContainer->getUserManager(),\n\t\t\t\t$this->serverContainer->getLazyRootFolder(),\n\t\t\t\t$this->serverContainer->getL10N('circles'),\n\t\t\t\t$this->serverContainer->getLogger(),\n\t\t\t\t$this->serverContainer->getURLGenerator()\n\t\t\t);\n\t\t}\n\n\t\treturn $this->shareByCircleProvider;\n\t}",
"public function getSocialAuth($provider)\n {\n if (!config(\"services.$provider\")) {\n abort('404');\n }\n\n return Socialite::driver($provider)->redirect();\n }",
"public function getProvider(): UserProviderInterface\n {\n return $this->provider;\n }",
"public function getEntry()\n {\n return ($this->current() !== null ? $this->provideLDAPEntry($this->current()) : null);\n }",
"public function getProvider(): ProviderInterface;",
"protected function defaultShareProvider() {\n\t\tif ($this->defaultProvider === null) {\n\t\t\t$this->defaultProvider = new DefaultShareProvider(\n\t\t\t\t$this->serverContainer->getDatabaseConnection(),\n\t\t\t\t$this->serverContainer->getUserManager(),\n\t\t\t\t$this->serverContainer->getGroupManager(),\n\t\t\t\t$this->serverContainer->getLazyRootFolder(),\n\t\t\t\t$this->serverContainer->getMailer(),\n\t\t\t\t$this->serverContainer->query(Defaults::class),\n\t\t\t\t$this->serverContainer->getL10NFactory(),\n\t\t\t\t$this->serverContainer->getURLGenerator(),\n\t\t\t\t$this->serverContainer->getConfig()\n\t\t\t);\n\t\t}\n\n\t\treturn $this->defaultProvider;\n\t}",
"public static function getInstance()\n {\n\t\tif (self::$instance == null) {\n\t\t\tself::$instance = new ServiceProvider();\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public function getAuthProvider()\n {\n return $this->authProvider;\n }",
"public static function getProvider($provider){\n return \\Illuminate\\Foundation\\Application::getProvider($provider);\n }",
"public static function instance(InputSanitizerBootstrapper $bootstrapper = null)\n {\n if (static::$instance === null) {\n static::$instance = new static($bootstrapper);\n }\n\n return static::$instance;\n }",
"public function getUserProvider()\n {\n return $this->userProvider;\n }",
"public function get_provider() {\n\t\treturn $this->session->get($this->config['session_key'] . '_provider', null);\n\t}",
"protected function getProvider($provider) : Provider\n {\n if (is_string($provider)) {\n $provider = new $provider;\n }\n\n return $provider;\n }",
"public function getAuthProvider() {\n return $this->authProvider;\n }",
"public function get_entry_manager() {\n return \\mod_dataform_entry_manager::instance($this->dataid, $this->id);\n }",
"public function getProviderRepository()\n {\n $manifest = $this['config']->get('server.manifest', rtrim(STORAGE_PATH, DS));\n\n return new ProviderRepository($manifest);\n }",
"public function getSocialShareLinkManager() {\n if (empty($this->socialShareLinkManager)) {\n $this->socialShareLinkManager = \\Drupal::service('social_share.link_manager');\n }\n\n return $this->socialShareLinkManager;\n }"
] |
[
"0.63960457",
"0.6043008",
"0.6007957",
"0.5887487",
"0.5887487",
"0.58579654",
"0.57547295",
"0.5694454",
"0.5660538",
"0.5660538",
"0.5660538",
"0.5556751",
"0.55030274",
"0.5476061",
"0.5447619",
"0.5440498",
"0.53903556",
"0.5349423",
"0.5344297",
"0.5333837",
"0.53220415",
"0.5312583",
"0.52836806",
"0.5280205",
"0.52755845",
"0.52725077",
"0.52709967",
"0.52582914",
"0.5252876",
"0.5249502"
] |
0.8689691
|
0
|
Constructor Build an Warehouse object based on LibertyContent
|
function Warehouse( $pWarehouseId = NULL, $pContentId = NULL ) {
parent::__construct();
$this->registerContentType( WAREHOUSE_CONTENT_TYPE_GUID, array(
'content_type_guid' => WAREHOUSE_CONTENT_TYPE_GUID,
'content_name' => 'Warehosue Location',
'handler_class' => 'Warehouse',
'handler_package' => 'warehouse',
'handler_file' => 'Warehouse.php',
'maintainer_url' => 'http://www.lsces.co.uk'
) );
$this->mWarehouseId = (int)$pWarehouseId;
$this->mContentId = (int)$pContentId;
$this->mContentTypeGuid = WAREHOUSE_CONTENT_TYPE_GUID;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function _construct()\n {\n $this->_init('warehouse/warehouse', 'id');\n\t\t//$this->_isPkAutoIncrement = false;\n }",
"public function _construct()\n {\n parent::_construct();\n $this->_init('wholesale/product');\n }",
"public function __construct()\n {\n $this->connection = Shopware()->Models()->getConnection();\n $this->db = Shopware()->Db();\n $this->writer = new TranslationComponent();\n $this->shops = $this->getShops();\n }",
"public function __construct(){\n $arModuleVersion = [];\n include(__DIR__ . \"/version.php\");\n\n $this->MODULE_ID = 'almaybee.addstorestoorderproducts';\n $this->MODULE_VERSION = $arModuleVersion[\"VERSION\"];\n $this->MODULE_VERSION_DATE = $arModuleVersion[\"VERSION_DATE\"];\n $this->MODULE_NAME = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_NAME\");\n $this->MODULE_DESCRIPTION = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_DESCRIPTION\");\n $this->PARTNER_NAME = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_PARTNER_NAME\");\n// $this->PARTNER_URI = Loc::getMessage(\"CRM_GENESIS_SLOTS_PARTNER_URI\");\n }",
"public function _construct() {\n parent::_construct();\n\n $product = $this->getProduct();\n\n $this->setTemplate('globallink/catalog/product/adaptor.phtml');\n $this->setProduct($product);\n }",
"public function __construct(){\n\t\tparent::__construct();\t\t\n\t\t$this->data_view = parent::setupThemes();\n\t\t$this->destination_path = \"/public/document/library/own/\";\n\t\t$this->data_view['pipeline_index'] \t= $this->data_view['view_path'] . '.pipeline.index';\n\t\t$this->data_view['master_view'] \t= $this->data_view['view_path'] . '.dashboard.index';\n\t\t$this->pipeline_model = new \\CustomerOpportunities\\CustomerOpportunitiesEntity;\n\t}",
"protected function _construct()\n\t{\n\t\t$this->_init('aurednik/cms_home_entity_store');\n\t}",
"public function __construct()\n {\n $CSO = new Api_Resources_CSO();\n $CSO->authenticate('timojong', 'FG4d%!k3hU');\n $this->addResource('CSO', $CSO);\n\n $OpenOnderwijs = new Api_Resources_OpenOnderwijs();\n $this->addResource('OpenOnderwijs', $OpenOnderwijs);\n }",
"public function __construct() {\n\t\t\t$this->getConfig();\n\t\t\t$this->buildShopUrl();\n\n\t\t\treturn $this;\n\t\t}",
"public function __construct() {\n // Call parents constructor\n parent::__construct();\n\n // Set the config settings\n $this->initialize();\n\n // Assign some defaults to dwoo\n $CI = get_instance();\n $this->dwoo_data = new Dwoo_Data();\n $this->dwoo_data->js_files = array();\n $this->dwoo_data->css_files = array();\n $this->dwoo_data->CI = $CI;\n $this->dwoo_data->site_url = $CI->config->site_url(); // so we can get the full path to CI easily\n $this->dwoo_data->uniqid = uniqid();\n $this->dwoo_data->timestamp = mktime();\n\n log_message('debug', \"Dwoo Template Class Initialized\");\n }",
"public function __construct()\n\t{\n\t\t$this->compiler = new Dwoo_Compiler();\n\t\t$this->dwoo = new Dwoo_Core(DWOO_COMPILE_DIR, DWOO_CACHE_DIR);\n\t}",
"public function __construct()\n {\n // $this->storeNumber = RequestFacade::segment(1);\n // $storeInfo = StoreInfo::getStoreInfoByStoreId($this->storeNumber);\n // $this->storeBanner = $storeInfo->banner_id;\n \n // $this->skin = Skin::getSkin($this->storeBanner);\n \n }",
"public function __construct($hailObjectType)\n {\n $this->hailObjectType = $hailObjectType;\n }",
"public function __construct(){\n\t\t$solariumClient = new SolariumClient();\n\t\t$this->_solariumClient = $solariumClient->getSolrClient();\n\t}",
"public function initialize()\n {\n $this->setSchema(\"watches_online\");\n $this->setSource(\"product\");\n }",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->catalogName = func_get_arg(0);\n $this->brands = func_get_arg(1);\n }\n }",
"public function __construct()\n {\n $this->location = new Location();\n $this->location->setName('Test Store');\n $this->location->setAddress(\"St Nicholas Square\\nNewcastle upon Tyne\");\n $this->location->setPostcode(\"NE1 2TT\");\n\n $this->userLocation = new Location();\n $this->userLocation->setName('Head Office');\n $this->userLocation->setAddress(\"12 Waskerley Way\\nConsett\");\n $this->userLocation->setPostcode(\"DH8 5YH\");\n\n $this->products = new ArrayCollection;\n $this->suppliers = new ArrayCollection;\n $this->purchaseOrders = new ArrayCollection;\n\n $this->prophet = new Prophecy\\Prophet();\n }",
"function __CONSTRUCT($product_id=0){\n\t\t$this->db = new Database;\n\t\tif($product_id!=0){\n\t\t\t$this->load($product_id);\n\t\t}\n\t}",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.windowsQualityUpdateCatalogItem');\n }",
"protected function init_whiplash()\n {\n $api_key = Mage::getStoreConfig('whiplash/api/key'); // Whiplash Sandbox on Testing Server\n $api_version = Mage::getStoreConfig('whiplash/api/version'); // OPTIONAL: Leave this blank to use the most recent API\n\t\t$storeId = $this->getStoreId();\n\t\t$test = Mage::getStoreConfig('whiplash/api/test_mode'); // OPTIONAL: If test is true, this will use your sandbox account\n\n\t\t// Include the Whiplash lib and initialize\n $ExternalLibPath=Mage::getBaseDir('code') . DS . 'community' . DS . 'Whiplash' . DS . 'Fulfillment'. DS . 'lib' . DS .'WhiplashApi.php';\n require_once ($ExternalLibPath);\n $api = new WhiplashApi($api_key, $api_version, $storeId, $test);\n return $api;\n }",
"function setwood_woocommerce_init_structured_data() {\n if ( ! is_product_category() ) {\n return;\n }\n global $product;\n $json['@type'] = 'Product';\n $json['@id'] = 'product-' . get_the_ID();\n $json['name'] = get_the_title();\n $json['image'] = wp_get_attachment_url( $product->get_image_id() );\n $json['description'] = get_the_excerpt();\n $json['url'] = get_the_permalink();\n $json['sku'] = $product->get_sku();\n $json['brand'] = array(\n '@type' => 'Thing',\n 'name' => $product->get_attribute( __( 'brand', 'setwood' ) )\n );\n \n if ( $product->get_rating_count() ) {\n $json['aggregateRating'] = array(\n '@type' => 'AggregateRating',\n 'ratingValue' => $product->get_average_rating(),\n 'ratingCount' => $product->get_rating_count(),\n 'reviewCount' => $product->get_review_count()\n );\n }\n \n $json['offers'] = array(\n '@type' => 'Offer',\n 'priceCurrency' => get_woocommerce_currency(),\n 'price' => $product->get_price(),\n 'itemCondition' => 'http://schema.org/NewCondition',\n 'availability' => 'http://schema.org/' . $stock = ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),\n 'seller' => array(\n '@type' => 'Organization',\n 'name' => get_bloginfo( 'name' )\n )\n );\n \n if ( ! isset( $json ) ) {\n return;\n }\n \n Setwood::set_structured_data( apply_filters( 'setwood_woocommerce_structured_data', $json ) );\n }",
"public function initialize()\n {\n $this->setSchema(\"watches_online\");\n $this->setSource(\"purchase_invoices_detail\");\n }",
"public function __construct() {\n\n $this->datastore = new Model\\PluginDatastore();\n try {\n $id = $this->datastore->getType() . '-' . $this->getName();\n $this->datastore->fetchById($id);\n } catch (\\phpillowResponseNotFoundErrorException $e) {\n\n $this->datastore->name = $this->getName();\n $this->datastore->created = date('r');\n\n $this->datastore->save();\n }\n }",
"public function init()\n\t{\n\t\t$this->dictionary = new Dictionary($this->iblockId);\n\t\t$this->storage = new Storage($this->iblockId);\n\t\tif (self::$catalog === null)\n\t\t{\n\t\t\tself::$catalog = \\Bitrix\\Main\\Loader::includeModule(\"catalog\");\n\t\t}\n\n\t\tif (self::$catalog)\n\t\t{\n\t\t\t$catalog = \\CCatalogSKU::getInfoByProductIBlock($this->iblockId);\n\t\t\tif (!empty($catalog) && is_array($catalog))\n\t\t\t{\n\t\t\t\t$this->skuIblockId = $catalog[\"IBLOCK_ID\"];\n\t\t\t\t$this->skuPropertyId = $catalog[\"SKU_PROPERTY_ID\"];\n\t\t\t}\n\t\t}\n\t}",
"function __construct(){\n parent::__construct();\n $this->set_primitive_type('string');\n $this->set_core(true);\n $this->set_related_mapped_prop('title');\n $this->set_component('tainacan-text');\n $this->set_name( __('Core Description', 'tainacan') );\n $this->set_description( __('The \"Core Title\" is a compulsory metadata automatically created for all collections by default. It is the main metadatum of the item and where the basic research tools will do their searches.', 'tainacan') );\n }",
"protected function getCurrentWarehouse()\n {\n }",
"public function __construct() {\n parent::__construct();\n $this->template_factory = new Flexi_TemplateFactory($this->getPluginPath() . '/templates');\n $this->assets = $this->getPluginURL() . '/assets/';\n }",
"public function construct()\n\t\t{\n\t\t}",
"public function __construct()\n {\n $this->mapper = \\Lib\\DataMapper::instance();\n $this->product = new Product();\n }",
"protected function construct() {\n\t\tglobal $byob_ah;;\n\n\t\tif ( ! defined( 'BYOBGPCM_PATH' ) ) {\n\t\t\tdefine( 'BYOBGPCM_PATH', dirname( __FILE__ ) );\n\t\t}\n\t\tif ( ! defined( 'BYOBGPCM_URL' ) ) {\n\t\t\tdefine( 'BYOBGPCM_URL', THESIS_USER_BOXES . '/' . basename( __DIR__ ) );\n\t\t}\n\n\n\t\tif ( is_admin() ) {\n\t\t\tif ( ! class_exists( 'byob_asset_handler' ) ) {\n\t\t\t\tinclude_once( BYOBGPCM_PATH . '/byob_asset_handler.php' );\n\t\t\t}\n\t\t\tif ( ! isset( $my_asset_handler ) ) {\n\t\t\t\t$byob_ah = new byob_asset_handler;\n\t\t\t}\n\t\t}\n\t\tadd_filter( 'the_content', array( $this, 'more_tag_protection' ), 1 );\n\t\tadd_action( 'wp_footer', array( $this, 'JSON_LD_markup' ) );\n\t}"
] |
[
"0.59942144",
"0.56442696",
"0.5523745",
"0.55044776",
"0.5427317",
"0.54257655",
"0.5424025",
"0.5419243",
"0.54066414",
"0.53969103",
"0.53858525",
"0.53659993",
"0.5349045",
"0.5340269",
"0.5326128",
"0.5325336",
"0.5311408",
"0.53066295",
"0.526329",
"0.52552074",
"0.525004",
"0.52458197",
"0.5214149",
"0.5204616",
"0.5200382",
"0.5191868",
"0.51899123",
"0.51761353",
"0.51739055",
"0.5171298"
] |
0.6937814
|
0
|
Returns clients using space in a Warehouse if no warehouse is specified, then a list of all clients is returned
|
function getClientList( $warehouse = NULL ) {
// if ($warehouse) {
// $mid = "WHERE `project_name` STARTING '$project'";
// } else
{ $mid = ''; }
$query = "SELECT ( SELECT COUNT(PARTNO) FROM `warehouse_partlist` pro WHERE pro.`client` = cl.`client` AND pro.`quantity` > 0 ) AS `stock`, cl.*, cu.*
FROM `warehouse_client` cl
LEFT JOIN `warehouse_customer` cu ON cl.`client` = cu.`client`
WHERE (cl.`fullp` + cl.`part`) > 0
$mid ORDER BY cl.`name`";
$result = $this->mDb->query($query);
$ret = array();
while ($res = $result->fetchRow()) {
$res['display_url'] = WAREHOUSE_PKG_URL.'display_client.php?client_id='.trim($res['client']);
$ret[] = $res;
}
$ret["cant"] = count( $ret );
return $ret;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function callWarehouse(){\n\t\t$data = $this->connection->createCommand('select id, name from warehouse where status = 1 and tenant_id = '. $this->tenant)->queryAll();\n\t\treturn $data;\n\t}",
"public function getCreditmemoWarehouseList();",
"protected function listClients() {\n\n\t\ttry {\n\n\t\t\t$clients = ConnectContentClient::where('station_id', '=', \\Auth::User()->station->id);\n\n\t\t\t$search_manager_user_id = Request::input('search_manager_user_id');\n\t\t\t$search_agency_id = Request::input('search_agency_id');\n\t\t\t$search_content_client = Request::input('search_content_client');\n\t\t\t$search_content_product = Request::input('search_content_product');\n\n\t\t\t//For searching client trading name & company name by ad who\n\t\t\t$search_content_ad_who = Request::input('search_content_ad_who');\n\n\t\t\tif (!empty($search_manager_user_id)) {\n\t\t\t\t$clients = $clients->where('content_manager_user_id', '=', $search_manager_user_id);\n\t\t\t}\n\n\t\t\tif (!empty($search_agency_id)) {\n\t\t\t\t$clients = $clients->where('content_agency_id', '=', $search_agency_id);\n\t\t\t}\n\n\t\t\tif (!empty($search_content_client)) {\n\t\t\t\t$clients = $clients->where('client_name', 'LIKE', \"%$search_content_client%\");\n\t\t\t}\n\n\t\t\tif (!empty($search_content_ad_who)) {\n\t\t\t\t$client_words = explode(' ', $search_content_ad_who);\n\n\t\t\t\t//I am doing this query first so that the exact matches come before the fuzzy matches in the results list\n\t\t\t\t$clients_exact_match = \\DB::table('airshr_connect_content_clients')\n\t\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n\t\t\t\t\t->where(function($query) use ($search_content_ad_who) {\n\t\t\t\t\t\t$query->where('client_name', 'LIKE', \"%$search_content_ad_who%\")\n\t\t\t\t\t\t\t->orWhere('who', 'LIKE', \"%$search_content_ad_who%\");\n\t\t\t\t\t})->get();\n\n\t\t\t\t$clients_fuzzy_matches = [];\n\n\t\t\t\t$word_count = 0;\n\t\t\t\tforeach($client_words as $word) {\n\t\t\t\t\t$word_lower = strtolower($word);\n\t\t\t\t\t//If the\n\t\t\t\t\tif(in_array($word_lower, array('the', 'and', 'pty', 'ltd', 'p/l', 'of', 'a', 'in' ))) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$clients_fuzzy_raw = \\DB::table('airshr_connect_content_clients')\n\t\t\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n\t\t\t\t\t\t->where(function ($query) use ($word) {\n\t\t\t\t\t\t\t$query->where('who', 'LIKE', \"% $word\")\n\t\t\t\t\t\t\t\t->orWhere('who', 'LIKE', \"$word %\")\n\t\t\t\t\t\t\t\t->orWhere('who', 'LIKE', \"% $word %\")\n\t\t\t\t\t\t\t\t->orWhere('who', '=', $word)\n\t\t\t\t\t\t\t\t->orWhere('client_name', 'LIKE', \"% $word\")\n\t\t\t\t\t\t\t\t->orWhere('client_name', 'LIKE', \"$word %\")\n\t\t\t\t\t\t\t\t->orWhere('client_name', 'LIKE', \"% $word %\")\n\t\t\t\t\t\t\t\t->orWhere('client_name', '=', $word);\n\t\t\t\t\t\t})->get();\n\n\t\t\t\t\tforeach($clients_fuzzy_raw as $client) {\n\t\t\t\t\t\t$clients_fuzzy_matches[] = $client;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$results = [];\n\t\t\t\t$clientsArray = array_unique(array_merge($clients_exact_match,$clients_fuzzy_matches), SORT_REGULAR);\n\n\t\t\t\tforeach($clientsArray as $client) {\n\t\t\t\t\t$results[] = array(\n\t\t\t\t\t\t'id'\t\t\t\t\t=> $client->id,\n\t\t\t\t\t\t'client_name'\t\t\t=> $client->client_name,\n\t\t\t\t\t\t'trading_name'\t\t\t=> $client->who\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn response()->json(array('data' => $results));\n\t\t\t}\n\n\t\t\tif (!empty($search_content_product)) {\n\t\t\t\t$clients = $clients->whereHas('clientProduct', function($q){\n\t\t\t\t\t$q->where('product_name', '=', Request::input('search_content_product'));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t$clients = $clients->with('clientProduct')->get();\n\n\t\t\treturn response()->json(array('data' => ConnectContentClient::getArrayListForClientsTable($clients)));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('data' => array()));\n\t\t}\n\n\t}",
"public function getShipmentWarehouseList();",
"public function clients() {\n\t\treturn $this->clients_model->getClients($this->compID);\n\t}",
"public function getWarehouses(array $options = []);",
"function return_clients($tri, $sens, $selection, $all = false)\n{\n $tab = getClients($tri, $sens, string2Tab($selection), $all);\n return $tab;\n}",
"public function index()\n {\n // Convert to query\n $warehouse = Warehouse::query();\n\n return WarehouseResource::collection($warehouse->orderBy('name')->get());\n }",
"public function getViewWarehouseList();",
"public function readClients() {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n $traderId = $this->getTraderID($auth);\r\n $sql = \"SELECT * FROM client WHERE traderid = '{$traderId}'\";\r\n $clients = Client::find_by_sql($sql);\r\n if ($clients) {\r\n return $clients;\r\n } else {\r\n throw new RestEception(400, \"no clients found\");\r\n }\r\n }",
"public function get_Clients() \n\t{\n\t\t$query = '';\n\t\t$result = '';\n\t\t$clients = array();\n\n\t\tswitch( $this->db_link->getDriver() )\n\t\t{\n\t\t\tcase 'sqlite':\n\t\t\tcase 'mysql':\n\t\t\tcase 'pgsql':\n\t\t\t\t$query = \"SELECT Client.ClientId, Client.Name FROM Client \";\n\t\t\t\tif( $this->bwcfg->get_Param( 'show_inactive_clients' ) )\n\t\t\t\t\t$query .= \"WHERE FileRetention > '0' AND JobRetention > '0' \"; \n\t\t\t\t$query .= \"ORDER BY Client.Name;\";\n\t\t\tbreak;\n\t\t}\n\n\t\t$result = $this->db_link->runQuery($query);\n\t\t\t\n\t\tforeach( $result->fetchAll() as $client )\n\t\t\t$clients[ $client['clientid'] ] = $client['name'];\n\t\t\t\t\n\t\treturn $clients;\t\t\n\t}",
"public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM clientes';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}",
"public function listClients(){\n $mysql= $this->database->databaseConnect();\n $sql = 'SELECT * FROM client';\n $query = mysqli_query($mysql, $sql) or die(mysqli_connect_error());\n $this->database->databaseClose();\n\n while($row = mysqli_fetch_assoc($query)){\n $this->clients[] = $row;\n }\n\n return $this->clients;\n }",
"protected function getClients(){\n $clients = array();\n\n $user = User::getInstance();\n\n $uid = $user->getId();\n $mac = $user->getMac();\n\n if ($mac){\n RESTClient::$from = $mac;\n }elseif ($uid){\n RESTClient::$from = $uid;\n }else{\n RESTClient::$from = $this->stb->mac;\n }\n\n RESTClient::setAccessToken($this->createAccessToken());\n\n foreach ($this->storages as $name => $storage){\n $clients[$name] = new RESTClient('http://'.$storage['storage_ip'].'/stalker_portal/storage/rest.php?q=');\n }\n return $clients;\n }",
"function return_listClientByMel($mel = null)\n{\n $tabRet = listUnique(\"bav_client\", \"cli_emel\", $mel);\n return $tabRet;\n}",
"public function getAllClient() {\n $qb = $this ->createQueryBuilder('p')\n ->select('p')\n ->where('p.estEmploye = 0')\n ->orderBy('p.nom');\n return $qb->getQuery()->getResult();\n }",
"public static function getListClientBySAP($_filter){\n\n\t\t$listclient = array();\n\t\ttry {\n\t\t\t/*codigo para consumor ws soap*/\n\t\t\t\t$client = new SoapClient(URLWS);\n\t\t\t\t$params = array('_filter' => $_filter);\n\t\t\t\t$result = $client->ListCustomer($params);\n\n\t\t\t\tfor($i=0; $i<count($result->ListCustomerResult->ClientResponse); $i++){\n\t\t\t\t\t $listclient[$i] = $result->ListCustomerResult->ClientResponse[$i]->CardCode.\"|\".htmlentities($result->ListCustomerResult->ClientResponse[$i]->CardName);\n\t\t\t\t}\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\ttrigger_error($e->getMessage(), E_USER_WARNING);\n\t\t\t}\n\t\treturn $listclient;\n\t}",
"public function getAllClients(){\n\t\t$sql = \"SELECT * FROM cliente;\";\n\t\treturn $this->Model->getData($sql);\n\t}",
"public function clientList() {\n return $this->returnCommand(['CLIENT', 'LIST'], null, null, ResponseParser::PARSE_CLIENT_LIST);\n }",
"function get_cyberlux_clientes($co_cli=''){\n\t\t$sQuery=\"SELECT cli_des,co_cli FROM clientes WHERE 1 = 1 \";\n\t\tif($co_cli) {\t$sQuery.=\"AND co_cli = '$co_cli' \";\t}\n\t\t\n\t//\tdie($sQuery);\n\t\t$result=mssql_query($sQuery) or die(mssql_min_error_severity());\n\t\t$i=0;\n\t\twhile($row=mssql_fetch_array($result)){\n\t\t\tforeach($row as $key=>$value){\n\t\t\t\t$res_array[$i][$key]=$value;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn($res_array);\n\t\t\t\n\t}",
"public function warehousesList()\n {\n if(Auth::user()->activities != '')\n {\n $warehouses = Auth::user()->warehouseList;\n\n return ($warehouses);\n }\n }",
"public function get_clients(){\n\t\treturn $this->clients;\n\t}",
"function client_select_all($salesperson_id)\n{\n $conn = db_connect();\n\n // Prepared statement for selecting all clients from the database if user has admin privileges\n if ($salesperson_id == \"all\") {\n $client_select_all_stmt = pg_prepare($conn, \"client_select_all_stmt\", \"SELECT * FROM clients\");\n $result = pg_execute($conn, \"client_select_all_stmt\", array());\n\n // Prepared statement for selecting clients associated with the logged in salespersons account\n } else {\n $client_select_all_stmt = pg_prepare($conn, \"client_select_all_stmt\", \"SELECT * FROM clients WHERE salesperson_id = $1\");\n $result = pg_execute($conn, \"client_select_all_stmt\", array($salesperson_id));\n }\n\n // Fetch all rows from query results\n $rows = pg_fetch_all($result);\n\n // Check for a result after querying database and if one exists, save it as an array to return user data\n if ($rows) {\n return $rows;\n }\n\n return false;\n}",
"public function client_list()\n {\n return ClientList::latest()->paginate(10);\n }",
"abstract protected function getSubClientNames();",
"public function listClient()\n\t {\n\t\t$tab = array();\n\t\t\t$rqt = mysql_query(\"SELECT * FROM clients\");\n\t\t\twhile($data = mysql_fetch_assoc($rqt))\n\t\t\t\t$tab[] = $data;\n\t\t\treturn $tab;\n\t }",
"public function getWarehpuseCombo()\n\t{\n return Warehouse::pluck('NAME', 'PK_NO');\n }",
"function return_listClientByName($nom = null)\n{\n return getClients(\"cli_nom\", \"asc\", ['cli_nom'=>$nom], true);\n}",
"public function getClientsAction()\n {\n $this->throwIfClientNot('backend');\n $clientManager = $this->get(\n 'fos_oauth_server.client_manager.default'\n );\n\n $class = $clientManager->getClass();\n\n return $this->getDoctrine()->getRepository($class)->findAll();\n }",
"public function getActiveClients()\n {\n $clients = array_filter($this->clients, function ($key) {\n return !in_array($key, [0, 'unknown']);\n }, ARRAY_FILTER_USE_KEY);\n\n return $clients;\n }"
] |
[
"0.6129523",
"0.6010987",
"0.59966457",
"0.5894166",
"0.58328325",
"0.5792075",
"0.5786333",
"0.5777385",
"0.57429516",
"0.5730356",
"0.57086724",
"0.569353",
"0.56410366",
"0.5605764",
"0.55739594",
"0.5559629",
"0.55433816",
"0.5536944",
"0.5524524",
"0.5521801",
"0.550472",
"0.5501242",
"0.54997665",
"0.5488089",
"0.5482336",
"0.5437696",
"0.54307985",
"0.5425194",
"0.54240286",
"0.5412132"
] |
0.70121163
|
0
|
Implements this to fetch total count of the main model data
|
protected function fetchTotalCount()
{
//get total if fetching a list
$this->main_model_obj = new $this->main_model();
$total_builder = $this->main_model_obj->getModelsManager()->createBuilder()
->columns(['COUNT(1) AS total'])
->from($this->main_model);
$this->formJoinsUsingFilters($total_builder);
$this->formConditions($total_builder);
$result_obj = $total_builder->getQuery()->getSingleResult();
$this->total_count = (empty($result_obj['total'])) ? 0 : $result_obj['total'];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();",
"public function totalCount();",
"public function totalCount();",
"public function getTotal() {\n\t\treturn $this->find('count', array(\n\t\t\t'contain' => false,\n\t\t\t'recursive' => false,\n\t\t\t'cache' => $this->alias . '::' . __FUNCTION__,\n\t\t\t'cacheExpires' => '+24 hours'\n\t\t));\n\t}",
"protected function calculateTotalItemCount()\n\t{\n\t\t$this->addScopes();\n\t\treturn CActiveRecord::model($this->modelClass)->count($this->getCriteria());\n\t}",
"public function fetchData()\r\n {\r\n $this->objectcount = $this->search_obj->getObjectQueryCount($this->extra);\r\n }",
"public function get_total()\n\t{\n\t\t$query = $this->query;\n\t\tif(isset($query['order']))\n\t\t\t$query['order'] = $this->model->table() . '.id';\n\t\treturn $this->model->count($query);\n\t}",
"public function count()\n {\n return $this->model->paginate(1, $this->select)->total();\n }",
"public function total_data_objects()\n {\n if(isset($this->total_data_objects)) return $this->total_data_objects;\n $this->total_data_objects = 0;\n \n $result = $this->mysqli_slave->query(\"SELECT COUNT(*) count FROM data_objects WHERE published=1 AND visibility_id=\".Visibility::find('visible'));\n if($result && $row=$result->fetch_assoc()) $this->total_data_objects = $row['count'];\n return $this->total_data_objects;\n }",
"public function modelTotal(){\n\t\t\t//---\n\t\t\t$conn = Connection::getInstance();\n\t\t\t$query = $conn->query(\"select id from orders\");\n\t\t\t//lay tong so ban ghi\n\t\t\treturn $query->rowCount();\n\t\t\t//---\n\t\t}",
"public function getTotal()\n\t{\n\t\t\n\t\treturn count($this->findAll());\n\t}",
"public function modelTotalRecord(){\r\n\t\t\t//lay bien ket noi\r\n\t\t\t$conn = Connection::getInstance();\r\n\t\t\t//truy van csdl, tra ket qua ve boen object\r\n\t\t\t$query = $conn->query(\"select category_id from tbl_category\");\r\n\t\t\t// dem so luong ket qua -> dem so luong ban ghi \r\n\t\t\t$total = $query->rowCount();\r\n\t\t\t//----\r\n\t\t\t//tra ve ket qua \r\n\t\t\treturn $total;\r\n\t\t}",
"function getTotal()\r\n{\r\n if (empty($this->_total))\r\n {\r\n $query = $this->_buildQuery();\r\n $this->_total = $this->_getListCount($query);\r\n }\r\n \r\n return $this->_total;\r\n}",
"public function count() \n { \n $query = $this->processInput();\n \n $model = $this->model;\n \n $result['total'] = $model::countAll($query['where']);\n\n $jsend = JSend\\JSendResponse::success($result);\n return $jsend->respond();\n }",
"function displayTotal($model) {\n\n \t/**\n \t * Import a model from a controller\n \t * $instanceModel = $this->$model\n \t * @var string\n \t */\n \t$instanceModel = ClassRegistry::init($model);\n\n\t\t/**\n\t\t * Condition to count the number of occurences about the user\n\t\t * @var array\n\t\t */\n\t\t$conditionCount = array('conditions' => array($model . '.user_id' => $this->Auth->user('id')));\n\n\t\t/**\n\t\t * Query to count the occurences\n\t\t * @var string\n\t\t */\n\t\t$queryCount = $instanceModel->find('count', $conditionCount);\n\n\t\treturn $queryCount;\n\n }",
"public function count()\r\n\t{\r\n\t\t$countModel = clone $this->model;\r\n\t\t$countQuery = $countModel->getQuery();\r\n\t\t$countQuery->orders = null;\r\n\t\t$countModel->setQuery($countQuery);\r\n\r\n\t\treturn $countModel->count();\r\n\t}",
"protected final function fetchTotalRecordCount(): void\n {\n $query = $this->query;\n $query->resetColumns()\n ->count()\n ->resetOrders()\n ->removeLimit();\n\n $this->totalRecords = $this->query->execute()->getOne();\n }",
"public function modelTotalRecord(){\n\t\t\t$total = DB::rowCount(\"select id from products\");\n\t\t\treturn $total;\n\t\t}",
"abstract public function countTotal();",
"public function getCount() {\n \treturn $this->count();\n }",
"public function count() {\n return $this->model->all()->count();\n }",
"public function count()\r\n\t{\r\n//\t\techo json_encode($this->db->query_first($sql));\r\n\t\techo json_encode(array('total'=>30));\r\n\t}",
"abstract public function prepareTotalCount();",
"function getTotal() {\r\n\t\tif (empty ( $this->_total )) {\r\n\t\t\t$query = $this->_buildQuery ();\r\n\t\t\t$this->_total = $this->_getListCount ( $query );\r\n\t\t}\r\n\t\treturn $this->_total;\r\n\t}",
"public static function totalNumber()\n {\n return (int)self::find()->count();\n }",
"function fetchTotalObjectCount()\n {\n $db = eZDB::instance();\n $objectCount = array();\n $objectCount = $db->arrayQuery( \"SELECT COUNT(*) AS count FROM ezcontentobject\" );\n $totalObjectCount = $objectCount[0][\"count\"];\n return $totalObjectCount;\n }",
"abstract protected function prepareTotalCount();",
"public function count() {\r\n if (is_null($this->objectcount)) {\r\n $this->fetchData();\r\n }\r\n return $this->objectcount;\r\n }"
] |
[
"0.77709144",
"0.77709144",
"0.77709144",
"0.77280796",
"0.77280796",
"0.750715",
"0.7473416",
"0.7462102",
"0.7422677",
"0.7352281",
"0.7269595",
"0.72520584",
"0.7246388",
"0.7243094",
"0.7242291",
"0.7206019",
"0.7189302",
"0.71806926",
"0.7172114",
"0.71697116",
"0.71646196",
"0.7161479",
"0.7141395",
"0.71194965",
"0.71099514",
"0.7093367",
"0.7088896",
"0.708746",
"0.705342",
"0.7053215"
] |
0.8656334
|
0
|
Implements this to fetch and attach an embed to the main model data
|
protected function fetchEmbed($embed)
{
//checks if the main model's primary key is set in settings
if (empty($this->settings[self::SETTING_MAIN_MODEL_PRIMARY_KEY])){
throw new \Exception('No primary key detected for main model');
}
//checking if any main model data was fetched
$primary_keys = array_keys($this->result);
if (empty($primary_keys)){
return;
}
$embed_arr = explode('.', $embed);
$primary_key = $this->settings[self::SETTING_MAIN_MODEL_PRIMARY_KEY];
$innermost_embed = $embed_arr[count($embed_arr) - 1];
$columns = ["$this->main_model.$primary_key", "{$innermost_embed}.*"];
$this->main_model_obj = new $this->main_model();
$manager = $this->main_model_obj->getModelsManager();
//checking if $embed is a valid relation of the main model
$relation = $this->getValidRelation($embed_arr);
if (empty($relation)){
return;
}
//forming the builder
$builder = $manager->createBuilder()
->columns($columns)
->from($this->main_model);
$this->join_models = [];
$this->formJoins($builder, $embed_arr);
//using the primary keys of the main model to fetch the relevant related data
$filters[] = [
self::FILTER_PARAM_FIELD => "$this->main_model.$primary_key",
self::FILTER_PARAM_VALUE => $primary_keys,
self::FILTER_PARAM_COMPARATOR => self::CMP_EQUALS,
self::FILTER_PARAM_CONDITION => self::COND_AND,
];
$this->formConditions($builder, $filters);
$result_set = $builder->getQuery()->execute();
$is_array = in_array($relation->getType(), [Relation::HAS_MANY, Relation::HAS_MANY_THROUGH]);
//Add init data for the embeds in the result
foreach ($this->result as $key => $item){
$this->result[$key][$embed] = ($is_array) ? [] : null;
}
//Fill in data
foreach ($result_set as $result_obj){
if ($is_array){
$this->result[$result_obj[$primary_key]][$embed][] = $result_obj[lcfirst($innermost_embed)]->toArray();
} else {
$this->result[$result_obj[$primary_key]][$embed] = $result_obj[lcfirst($innermost_embed)]->toArray();
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function fetch_embed_data() {\n\n\t\t$embed_url = $this->get_embed_url();\n\n\t\t// Bail if the URL is already est\n\t\t$key = 'embed_data_' . md5( $embed_url );\n\t\tif ( ! $embed_url || ( $this->get_meta( $key ) && ! $this->is_embed_data_errored() ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$type = $this->get_embed_type();\n\t\tswitch ( $type ) {\n\n\t\t\tcase 'twitter':\n\t\t\t\t$wp_codebird = new \\WP_Codebird;\n\t\t\t\t$wp_codebird->setConsumerKey( CST_TWITTER_CONSUMER_KEY, CST_TWITTER_CONSUMER_SECRET );\n\n\t\t\t\tpreg_match( '#https?://(www\\.)?twitter\\.com/.+?/status(es)?/([0-9]+)#i', $embed_url, $matches );\n\t\t\t\t$status_id = isset( $matches[3] ) ? $matches[3] : 0;\n\n\t\t\t\t$status = (object) $wp_codebird->statuses_show_ID( 'id=' . $status_id );\n\t\t\t\t$this->set_meta( $key, $status );\n\n\t\t\t\tif ( $this->is_embed_data_errored() ) {\n\t\t\t\t\t// Errored Tweets shouldn't be published\n\t\t\t\t\t$this->set_status( 'pending' );\n\t\t\t\t} else {\n\t\t\t\t\t$short_status = substr( sanitize_text_field( $status->text ), 0, 50 );\n\t\t\t\t\t// Uh oh, fall back\n\t\t\t\t\tif ( empty( $short_status ) ) {\n\t\t\t\t\t\t$short_status = sanitize_text_field( sprintf( __( \"Tweet from %s\", 'chicagosuntimes' ), $status->user->screen_name ) );\n\t\t\t\t\t}\n\t\t\t\t\t$this->set_title( $short_status );\n\t\t\t\t\t$this->set_slug( sanitize_title( $short_status ) );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'instagram':\n\n\t\t\t\t$response = vip_safe_wp_remote_get( 'http://api.instagram.com/oembed?url=' . urlencode( $embed_url ) );\n\n\t\t\t\tif ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$instagram_data = json_decode( wp_remote_retrieve_body( $response ) );\n\n\t\t\t\tif ( ! $instagram_data ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif( preg_match( \"#http://instagr(\\.am|am\\.com)/p/([a-zA-Z0-9-^/]+)#i\", $embed_url, $matches ) ) {\n\t\t\t\t\t$instagram_data->instagram_id = sanitize_text_field( trim( $matches[2], '/' ) );\n\t\t\t\t} else {\n\t\t\t\t\t// Need the instagram ID for the frontend\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$this->set_meta( $key, $instagram_data );\n\t\t\t\t$title = substr( $instagram_data->title, 0, 50 );\n\t\t\t\t$title = sanitize_text_field( $title );\n\n\t\t\t\tif ( empty( $title ) ) {\n\t\t\t\t\t$title = sanitize_text_field( sprintf( __( \"Instagram brought to you by %s\", 'chicagosuntimes' ), $instagram_data->author_name ) );\n\t\t\t\t}\n\n\t\t\t\t$this->set_title( $title );\n\t\t\t\t$this->set_slug( sanitize_title( $title ) );\n\n\t\t\t\tbreak;\n\t\t}\n\n\t}",
"public function embed();",
"protected function getEmbedDataFromProvider()\n {\n $this->providerResolver = $this->objectManager->get(\\Sto\\Mediaoembed\\Request\\ProviderResolver::class);\n $this->initializeRequestBuilder();\n $this->initializeResponseBuilder();\n\n $content = $this->contentRepository->findByUid($this->configurationManager->getContentObject()->data['uid']);\n $this->startRequestLoop($content);\n }",
"public function embedAction() {\n\n //GET SUBJECT (EITHER VIDEO TYPE OR SITEREVIEW_VIDEO TYPE)\n $this->view->video = $video = Engine_Api::_()->core()->getSubject();\n\n //CHECK THAT EMBEDDING IS ALLOWED OR NOT\n if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview_video.embeds', 1)) {\n $this->view->error = 1;\n return;\n } else if (isset($video->allow_embed) && !$video->allow_embed) {\n $this->view->error = 2;\n return;\n }\n\n //GET EMBED CODE\n $this->view->embedCode = $video->getEmbedCode();\n }",
"public function loadModel()\n {\n $data = Contest::find($this->modelId);\n $this->title = $data->title;\n $this->description = $data->description;\n $this->image = $data->image;\n $this->featured_image = $data->featured_image;\n\n }",
"public function oembed() {\n return $this->oembed;\n }",
"public function fetch()\n {\n foreach ($this->getData() as $id => $model_data) {\n if (!isset($model_data->id)) {\n $model_data->id = $id;\n }\n $this->add($model_data);\n }\n return $this;\n }",
"function _wp_oembed_get_object()\n {\n }",
"protected function fetch() {\n\n $content = $this->part->content;\n\n $this->content_type = $this->part->content_type;\n $this->content = $this->oMessage->decodeString($content, $this->part->encoding);\n\n if (($id = $this->part->id) !== null) {\n $this->id = str_replace(['<', '>'], '', $id);\n }else{\n $this->id = hash(\"sha256\", (string)microtime(true));\n }\n\n $this->size = $this->part->bytes;\n $this->disposition = $this->part->disposition;\n\n if (($filename = $this->part->filename) !== null) {\n $this->setName($filename);\n } elseif (($name = $this->part->name) !== null) {\n $this->setName($name);\n }else {\n $this->setName(\"undefined\");\n }\n\n if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) {\n if ($this->part->ifdescription) {\n $this->setName($this->part->description);\n } else {\n $this->setName($this->part->subtype);\n }\n }\n }",
"public function get_embed_data() {\n\n\t\t$embed_url = $this->get_embed_url();\n\n\t\tif ( ! $embed_url ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$key = 'embed_data_' . md5( $embed_url );\n\t\treturn $this->get_meta( $key );\n\t}",
"public function get_embed_url()\n\t\t{\n\t\t\treturn 'http://'.self::URL_HOST.'/'.stprintf(self::URL_EMBED, $this->get_data());\n\t\t}",
"public function seedGetoembed()\n\t{\n\t\t// URL\n\t\treturn array(\n\t\t\tarray('https://twitter.com/twitter/status/99530515043983360'),\n\t\t\tarray(null)\n\t\t\t);\n\t}",
"public function fetch() {}",
"public function loadRelated()\n {\n return;\n }",
"public function fetchMediaInformation()\n {\n $provider_tasks = $this->getProviderTasks();\n if (!empty($provider_tasks)) { //Skip all downloads if no provider task, no adjudication needed\n $journal_entry_photos = $this->getJournalEntryPhotos();\n foreach($provider_tasks as $ind => $task) { //Iterate through provider tasks (max 3)\n if($task['status'] == 'inProgress') { // if the provider task has NOT been completed yet we want to save journalEntryPhoto\n if(!isset($journal_entry_photos[$ind]['measurements'])) {\n $user = $this->patient_json['user']['uuid'];\n $this->getClient()->getEm()->emError(\"No journal entry photos present for provider task (SHOULD NEVER OCCUR) Check pattern. Patient UUID: $user \");\n continue;\n }\n\n foreach($journal_entry_photos[$ind]['measurements'] as $mind => $measurement) { //iterate over all measurements for a corresponding task containing a photo, we have the match via $ind\n if ($measurement['type'] == 'journalEntryPhoto') {\n $journal_entry_photos[$ind]['media'] = new Media($this->getClient(), $measurement['media']['title'], $measurement['media']['href']); //create new key to save media object\n } elseif ($measurement['surveyQuestionId'] == 'test_conf') {\n $journal_entry_photos[$ind]['confidence'] = $measurement['json'];\n } elseif($measurement['surveyQuestionId'] == 'results') {\n $journal_entry_photos[$ind]['results'] = $measurement['json'][0];\n }\n }\n }\n }\n //push updates to journal photos\n $this->setJournalEntryPhotos($journal_entry_photos);\n }\n }",
"private function load() {\n\t\t\t$comments = array();\n\t\t\t\n\t\t\t$this->db->where('itemid', $this->itemid);\n\t\t\t$rows = $this->db->get('comments');\n\t\t\t\n\t\t\tforeach($rows as $row) {\n\t\t\t\t$comments['author'] = $row['author'];\n\t\t\t\t$comments['via'] = $row['via'];\n\t\t\t\t$comments['date'] = $row['date'];\n\t\t\t\t$comments['comment'] = $row['comment'];\n\t\t\t\t$comments['avatar'] = $row['avatar'];\n\t\t\t\t$this->data[] = $comments;\n\t\t\t}\n\t\t}",
"public function embed()\n {\n if (!$this->object->getValue()) {\n return null;\n }\n\n /* @var \\Anomaly\\VideoFieldType\\Matcher\\Contract\\MatcherInterface $matcher */\n $matcher = dispatch_now(new GetMatcher($this->object->getValue()));\n\n return $matcher->embed($this->object->getValue());\n }",
"function rbge_repo_embed_item( $atts ){\n \n\t$post_id = get_the_ID();\n//\t$longitude = get_post_meta($post_id, 'geo_longitude', true);\n//\t$latitude = get_post_meta($post_id, 'geo_latitude', true);\n\n // fetch the data from the repo\n \n // use a cached version of the data\n \n $uri = rbge_repo_get_uri_for_atts($atts);\n if(!$uri) return \"[You must set an id, barcode or accession to embed from the repository]\";\n $data = '';\n \n if(rbge_repo_embed_get_data($uri, $data)){\n \n // OK - we have data (from whereever) now let us render it!\n include_once(plugin_dir_path( __FILE__ ) . 'templates.php');\n return render_repo_item($data); //. '<pre>'. print_r($data, true) . '</pre>';\n \n }else{\n return \"<strong>Error: $data</strong>\";\n }\n \n\n}",
"public function loadDetails($forUpdate = null)\n {\n if ($forUpdate === true)\n {\n $this->authorList = AuthorList::findForUpdate(array('bookId' => $this->bookId));\n $this->bookLanguageList = BookLanguageList::findForUpdate(array('bookId' => $this->bookId));\n }\n else\n {\n $this->authorList = AuthorList::find(array('bookId' => $this->bookId));\n $this->bookLanguageList = BookLanguageList::find(array('bookId' => $this->bookId));\n }\n }",
"public function onSinglePostLoad($event){\n $post = $event->getResult();\n\n //If we are displaying a repository item?\n if (preg_match(\"/^repo:\\/\\/(\\\\d+[a-zA-Z0-9]{9})/\", $post['object_type'], $matches)) {\n\n $repo = $this->application->createInstance(Model\\Data::class);\n\n $post['media_data'] = $repo->getData( $post['object_uri'] );\n\n $post['media_template'] = \"posts/post-single-repo\";\n $post['media_title'] = \"Host\";\n\n }\n\n $event->setResult( $post );\n\n }",
"public function load(){return $this->fetch();}",
"private function load()\r\n {\r\n $this->dbFields = MySQL::fetchRecord(MySQL::executeQuery('SELECT * FROM training_slideshow WHERE ts_id='.(int)$this->id),MySQL::fmAssoc);\r\n }",
"function get_data_from_oembed($_url) {\n\n $data0 = file_get_contents($_url);\n $data = json_decode($data0, true);\n\n return $data;\n}",
"protected function withRelationships()\n {\n if ($this->resource instanceof Model) {\n $this->attachRelations($this->resource);\n }\n }",
"public function extendPostingData()\n\t{\n\t\t// get author nickname\n\t\t$this->posting['author_name'] = $this->getAuthorNickname();\n\t\t// count comments\n\t\t$comments = new PO_Posting_Comments($this->id);\n\t\t$this->posting['count_comments'] = $comments->getCount();\n\t\t// status\n\t\t$this->getStatus();\n\t\t// edit status\n\t\t$this->getEditStatus();\n\t\t// has audio, player type, media type\n\t\t$this->hasAudio();\n\t}",
"private function get_models(stdClass $submission) {\n global $DB;\n\n // Get the items.\n $items = $DB->get_records(\n SKETCHFAB_DB_TABLE,\n array(\n 'assignment' => $this->assignment->get_instance()->id,\n 'submission' => $submission->id\n )\n );\n\n // Create an empty array to populate with models.\n $models = array();\n\n // Create an instance of the Moodle cURL class to use.\n $curl = new curl();\n\n // Iterate over each item then make the three cURL requests\n // that we'll need for full metadata.\n foreach ($items as $item) {\n\n // Create an empty stdClass.\n $thismodel = new stdClass();\n\n // 1. OEMBED\n $oembed = $curl->get(\n SKETCHFAB_OEMBED_ENDPOINT,\n array(\n 'url' => SKETCHFAB_MODELPAGE_URL . '/' . $item->model\n ),\n array(\n 'CURLOPT_RETURNTRANSFER' => 1\n )\n );\n if (!empty($oembed)) {\n $thismodel->oembed = html_writer::tag(\n 'div',\n json_decode($oembed, true)[\"html\"],\n array(\n 'class' => 'sketchfab-oembed'\n )\n );\n }\n\n // 2. METADATA\n $metaurl = get_config('assignsubmission_sketchfab', 'endpointurl') . '/' . $item->model;\n $meta = $curl->get($metaurl);\n if (!empty($meta)) {\n // Parse JSON for the metadata we care about.\n $json = json_decode($meta, true);\n $thismodel->facecount = $json[\"faceCount\"];\n $thismodel->vertexcount = $json[\"vertexCount\"];\n $thismodel->matcount = count($json[\"options\"][\"materials\"]);\n }\n\n // 3. TEXTURE METADATA\n $metaurl .= '/textures';\n $meta = $curl->get($metaurl);\n $texturedata = array();\n if (!empty($meta)) {\n // Parse JSON for texture metadata.\n $json = json_decode($meta, true);\n foreach ($json['results'] as $result) {\n $thistex = array();\n\n // Image name.\n $thistex['name'] = $result['name'];\n\n // Dimensions.\n $h = $result['images'][0]['height'];\n $w = $result['images'][0]['width'];\n $thistex['h'] = $h;\n $thistex['w'] = $w;\n\n // Largest image dimension.\n $largestdimension = intval($h);\n if ($largestdimension < intval($w)) {\n $largestdimension = intval($w);\n }\n $thistex['largestdimension'] = $largestdimension;\n\n // Image aspect ratio.\n $aspectratio = $h / $w;\n $thistex['aspectratio'] = $aspectratio;\n\n // Image POT.\n $isPOT = ($largestdimension & ($largestdimension - 1)) == 0;\n $thistex['poweroftwo'] = $isPOT;\n\n // Image URL.\n $thistex['url'] = $result['images'][0]['url'];\n\n $texturedata[] = $thistex;\n }\n }\n $thismodel->textures = $texturedata;\n $thismodel->texcount = count($texturedata);\n\n // Push the model onto the end of the array.\n $models[] = $thismodel;\n\n }\n\n\n return $models;\n }",
"public function fetchInto(){\n\t\t\t}",
"public function isEmbeddable() {}",
"public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }",
"protected function loadData()\n\t{\n\t\t$delimiter = \"|||---|||---|||\";\n\t\t$command = 'show --pretty=format:\"%an'.$delimiter.'%ae'.$delimiter.'%cd'.$delimiter.'%s'.$delimiter.'%B'.$delimiter.'%N\" ' . $this->hash;\n\n\t\t$response = $this->repository->run($command);\n\n\t\t$parts = explode($delimiter,$response);\n\t\t$this->_authorName = array_shift($parts);\n\t\t$this->_authorEmail = array_shift($parts);\n\t\t$this->_time = array_shift($parts);\n\t\t$this->_subject = array_shift($parts);\n\t\t$this->_message = array_shift($parts);\n\t\t$this->_notes = array_shift($parts);\n\t}"
] |
[
"0.65325564",
"0.5813032",
"0.5696687",
"0.55912584",
"0.55704874",
"0.54963326",
"0.549623",
"0.54375595",
"0.54113704",
"0.53622496",
"0.52818066",
"0.5270425",
"0.52447844",
"0.52083826",
"0.51926994",
"0.5190219",
"0.5186612",
"0.51052713",
"0.50748765",
"0.5060507",
"0.50418586",
"0.5026362",
"0.50209427",
"0.5018902",
"0.5011337",
"0.50108105",
"0.50025904",
"0.4983189",
"0.49791405",
"0.49483055"
] |
0.75898945
|
0
|
Adds joins the query builder using the filters provided as inputs
|
protected function formJoinsUsingFilters(&$builder)
{
$this->join_models = [];
foreach ($this->filters as $filter){
$field_parts = explode('.', $filter[self::FILTER_PARAM_FIELD]);
if (count($field_parts) > 1) {
unset($field_parts[count($field_parts) - 1]);
$this->formJoins($builder, $field_parts);
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }",
"abstract protected function appendJoins(QueryBuilder $queryBuilder);",
"protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }",
"protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'LEFT JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }",
"function joinQuery()\n {\n }",
"public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }",
"private function processFilters(QueryBuilder $sql, $filters)\n {\n if (sizeof($filters)) {\n foreach ($filters as $key => $value) {\n if (!$value) {\n continue;\n }\n switch ($key) {\n case 'author':\n $valueArr = explode(',', $value);\n $sql->andWhere(\"c.author in (:authors)\");\n $sql->setParameter(':authors', $valueArr);\n break;\n case 'type':\n $valueArr = explode(',', $value);\n $sql->join('c.action', 'a');\n $sql->andWhere(\"a.type in (:types)\");\n $sql->setParameter(':types', $valueArr);\n break;\n case 'topic':\n $valueArr = explode(',', $value);\n $sql->join('c.action', 'a2');\n $sql->andWhere(\"a2.topic in (:topics)\");\n $sql->setParameter(':topics', $valueArr);\n break;\n case 'organization':\n $valueArr = explode(',', $value);\n $sql->join('c.action', 'a3');\n $sql->join('a3.department', 'd');\n $sql->andWhere(\"d.organization in (:organizations)\");\n $sql->setParameter(':organizations', $valueArr);\n break;\n case 'city':\n $valueArr = explode(',', $value);\n $sql->join('c.action', 'a4');\n $sql->join('a4.department', 'd2');\n $sql->andWhere(\"d2.city in (:cities)\");\n $sql->setParameter(':cities', $valueArr);\n break;\n case 'members':\n $valueArr = explode(',', $value);\n $sql->join('c.action', 'a5');\n $sql->join('a5.individuals', 'i');\n $sql->andWhere(\"i in (:individuals)\");\n $sql->setParameter(':individuals', $valueArr);\n break;\n case 'department':\n $valueArr = explode(',', $value);\n $sql->join('c.action', 'a6');\n $sql->join('a6.department', 'd3');\n $sql->andWhere(\"d3 in (:departments)\");\n $sql->setParameter(':departments', $valueArr);\n break;\n case 'startedAt':\n $point1 = clone $value;\n $point2 = clone $value;\n $point2->modify('+1 day');\n\n $sql->join('c.action', 'a7');\n $sql->andWhere(\"a7.startedAt BETWEEN :point1 AND :point2\");\n $sql->setParameter(':point1', $point1);\n $sql->setParameter(':point2', $point2);\n break;\n }\n }\n }\n }",
"private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}",
"public function makeSearchJoin($join)\n {\n global $wpdb;\n\n if (is_search()) {\n\n $join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $join .= \" LEFT JOIN $wpdb->postmeta as $values ON $wpdb->posts.ID = $values.post_id\";\n\n }\n }\n\n }\n\n return $join;\n }",
"public function build_join( $joins ) {\n $sql = '';\n\n if ( empty( $joins ) ) {\n return $sql;\n }\n\n foreach ( $joins as $index => $join ) {\n if ( ! is_array( $join ) ) {\n continue;\n }\n\n $table = $join['table'] . '_' . $index;\n\n $sql .= ' ' . strtoupper( $join['type'] ) . ' JOIN ' . $join['table'] . ' AS ' . $table;\n $sql .= $this->build_join_on( $join, $table );\n\n $this->query_args['fields'] = wp_parse_args(\n $this->query_args['fields'],\n $this->build_join_fields( $join, $table )\n );\n }\n\n return $sql;\n }",
"protected abstract function getJoinClause(array $joins);",
"public function getJoins() {\n\t\t$sql = \"\";\n\t\tif (count($this->join) > 0) {\n\t\t\tforeach ($this->join as $j) {\n\t\t\t\t$sj = $j[2];\n\t\t\t\t$sql .= \" \".$j[0].\" JOIN \".$sj->getFrom().\" ON \".$sj->getTable().\".`\".$j[3].\"`=\".$this->getTable().\".`\".$j[1].\"`\";\n\t\t\t\t$sql .= $sj->getJoins();\n\t\t\t}\n\n\n\t\t}\n\t\treturn $sql;\n\t}",
"protected function compileJoins(Builder $builder, $joins): string\n {\n $sql = [];\n\n foreach ((array) $joins as $join) {\n $table = $this->wrapTable($join->table);\n\n $clauses = [];\n\n foreach ($join->clauses as $clause) {\n $clauses[] = $this->compileJoinContraint($clause);\n }\n\n foreach ($join->bindings as $binding) {\n $builder->addBinding($binding, 'join');\n }\n\n $clauses[0] = $this->removeStatementBoolean($clauses[0]);\n\n $clauses = implode(' ', $clauses);\n\n $sql[] = \"{$join->type} join {$table} on {$clauses}\";\n }\n\n return implode(' ', $sql);\n }",
"public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }",
"protected function _getQuery()\n {\n $sArticleTable = $this->_getViewName('oxarticles');\n $sCategoryTable = $this->_getViewName('oxobject2category');\n $sJoinTable = $this->_getViewName('ettm_project2article');\n $oConfig = \\OxidEsales\\Eshop\\Core\\Registry::getConfig();\n $sContainerName = $oConfig->getRequestParameter('cmpid');\n $sProjectId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote($oConfig->getRequestParameter('projectid'));\n\n // Has target langs selected?\n $sJoins = '';\n if ($oConfig->getRequestParameter('targetlangs') && 1 !== intval($oConfig->getRequestParameter('nofilter'))) {\n $aTargetLangIds = explode(',', $oConfig->getRequestParameter('targetlangs'));\n foreach ($aTargetLangIds as $iTargetLangId) {\n // Get view and create join statement\n $sTableName = getViewName('oxarticles', $iTargetLangId);\n $sJoins .= \"JOIN $sTableName ON $sTableName.OXID = $sArticleTable.OXID AND $sTableName.OXTITLE = ''\";\n }\n }\n\n if ('container1' === $sContainerName) {\n $sAddtionalJoint = '';\n if (\\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')) {\n // A category is selected\n $sCatId = \\OxidEsales\\Eshop\\Core\\DatabaseProvider::getDb()->quote(\n \\OxidEsales\\Eshop\\Core\\Registry::getConfig()->getRequestParameter('catid')\n );\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n INNER JOIN $sCategoryTable\n ON $sCategoryTable.OXOBJECTID = $sArticleTable.OXID AND $sCategoryTable.OXCATNID = $sCatId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n } else {\n // No category is selected.\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID AND $sJoinTable.PROJECT_ID = $sProjectId\n $sJoins\n WHERE $sJoinTable.OXID IS NULL\";\n }\n\n\n\n } else {\n $sQAdd = \" from $sArticleTable\n LEFT JOIN $sJoinTable\n ON $sJoinTable.OXARTICLEID = $sArticleTable.OXID\n WHERE $sJoinTable.OXID IS NOT NULL AND $sJoinTable.PROJECT_ID = $sProjectId\";\n }\n\n return $sQAdd;\n }",
"function GetMultipleDataJoin($table1=false,$table2=false,$filter1=false,$filter2=false)\n\t{\t//echo $table1; echo $table2; echo $filter1; echo $filter2;die;\n\t\t$qry=$this->db->query(\"select $table1.*,$table2.* from $table1,$table2 where $table1.$filter1=$table2.$filter1 \");//print_r($qry);die;\n\t\treturn $qry->result();\n\t}",
"protected function _buildJoin(array $filter_data=array())\n {\n return \"\";\n }",
"protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}",
"protected function formJoins(&$builder, $relation_models = null)\n {\n $manager = $this->main_model_obj->getModelsManager();\n $_model = $this->main_model;\n\n foreach ($relation_models as $model) {\n $relation = $manager->getRelationByAlias($_model, $model);\n if (empty($relation)) {\n return null;\n }\n\n if (!in_array($model, $this->join_models)) {\n $join_condition = \"{$_model}.{$relation->getFields()} = {$model}.{$relation->getReferencedFields()}\";\n $builder->innerJoin($model, $join_condition);\n $this->join_models[$model] = $model;\n }\n\n $manager = (new $model())->getModelsManager();\n $_model = $model;\n }\n }",
"protected function _compile_join(array $joins)\n {\n foreach ($joins as $key=>$join) \n {\n $conditions = array();\n\n foreach ($this->_on[$key] as $condition)\n {\n // Split the condition\n list($c1, $op, $c2, $chaining) = $condition;\n\n // Add chain type\n $conditions[] = ' '.$chaining.' ';\n\n if ($op)\n {\n // Make the operator uppercase and spaced\n $op = ' '.strtoupper($op);\n }\n\n // Quote each of the identifiers used for the condition\n $c1 = $this->quote_identifier($c1);\n $c2 = $this->quote_identifier($c2);\n $conditions[] = $c1.$op.' '.(is_null($c2) ? 'NULL' : $c2);\n }\n\n // remove the first chain type\n array_shift($conditions);\n\n // if there are conditions, concat the conditions \"... AND ...\" and glue them on...\n empty($conditions) or $joins[$key] .= ' ON ('.implode('', $conditions).')';\n\n }\n\n $sql = implode(' ', $joins);\n return $sql;\n }",
"public function joinResources()\n {\n $this->builder->join('resources', 'rs_id', '=', 'add_resource');\n }",
"protected function assembleQueries()\n {\n if ($this->getExecutedFilters()) {\n return $this;\n }\n\n $objectType = $this->getObjectType();\n\n $whereConditions = [];\n\n $mainTable = $this->getEntityService()->getTableName($objectType);\n $pre = 'v2';\n $dqlFilters = [];\n $tables = $this->getEntityService()->getVarOptionTables();\n $bindTypes = [];\n $pdoBindTypes = $this->getEntityService()->getPdoBindTypes();\n $filterable = $this->getFilterable();\n\n $x = 0; //count($this->getFilters()); // for tracking bind types\n\n // handle basic filters eg key=value\n // also, special handling of price range\n $filterParams = [];\n if ($this->getFilters()) {\n foreach($this->getFilters() as $field => $value) {\n foreach($filterable as $filterInfo) {\n if ($field == $filterInfo[CartRepositoryInterface::CODE]) {\n\n // handle special case for numerical ranges\n // eg price=100-199 or subtotal=50-100\n // note : the handling of strpos is very intentional, want an index > 0\n if ($filterInfo[CartRepositoryInterface::DATATYPE] == 'number' && strpos($value, '-')) {\n $rangeValues = explode('-', $value);\n $rangeMin = $rangeValues[0];\n $rangeMax = isset($rangeValues[1]) ? $rangeValues[1] : null;\n if (isset($rangeMax)) {\n\n $rangeMin = (float) $rangeMin;\n $rangeMax = (float) $rangeMax;\n\n // minimum\n $this->addAdvFilter([\n 'field' => $field,\n 'op' => 'gte',\n 'value' => $rangeMin,\n ]);\n\n // maximum\n $this->addAdvFilter([\n 'field' => $field,\n 'op' => 'lt',\n 'value' => $rangeMax,\n ]);\n\n break;\n }\n }\n\n if (isset($filterInfo['join'])) {\n $this->joins[] = $filterInfo['join'];\n $field = $filterInfo['join']['table'] . \".{$field}\";\n } elseif (!is_int(strpos($field, '.'))) {\n $field = \"main.{$field}\";\n }\n\n $whereConditions[] = \"{$field} = ?\";\n $filterParams[] = $value;\n\n switch($filterInfo[CartRepositoryInterface::DATATYPE]) {\n case 'boolean':\n $bindTypes[$x] = \\PDO::PARAM_INT;\n break;\n case 'number':\n // todo : make this better\n $bindTypes[$x] = \\PDO::PARAM_INT;\n break;\n case 'string':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n case 'date':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n default:\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n }\n\n $x++;\n break;\n }\n }\n }\n }\n\n // handle fulltext search first\n\n // note : use setFulltextIds() if you search somewhere else first eg SOLR / Elasticsearch\n if ($this->getFulltextIds()) {\n // ensure IDs are sanitized before you set them\n $whereConditions[] = \"main.id in (\" . implode(',', $this->getFulltextIds()) . \")\";\n } else if ($this->getQuery()\n && $this->getSearchField()\n && $this->getSearchMethod()) {\n\n if (is_array($this->getSearchField())) {\n if (count($this->getSearchField()) > 1) {\n\n $cond = '';\n foreach($this->getSearchField() as $searchField) {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n\n $tbl = 'main';\n\n if (is_array($searchField)) {\n if (isset($searchField['table']) && isset($searchField['column'])) {\n $tbl = $searchField['table'];\n $searchField = $searchField['column'];\n } else {\n continue;\n }\n }\n\n // cond is empty, add a leading parentheses\n if (!$cond) {\n $cond .= \"({$tbl}.{$searchField} like ?\";\n } else {\n $cond .= \" OR {$tbl}.{$searchField} like ?\";\n }\n $x++;\n }\n $cond .= ')';\n $whereConditions[] = $cond;\n } else {\n\n $fields = $this->getSearchField();\n $searchField = $fields[0];\n if (is_array($searchField)) {\n if (isset($searchField['table']) && isset($searchField['column'])) {\n $tbl = $searchField['table'];\n $searchField = $searchField['column'];\n\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"{$tbl}.{$searchField} like ?\";\n $x++;\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"main.{$searchField} like ?\";\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"main.{$this->getSearchField()} like ?\";\n $x++;\n }\n }\n\n // handle \"advanced\" filters\n // eg filter_field[x], filter_op[x], filter_val[x]\n // specifies a field, value, and operator ie (id > 100)\n $advFilterParams = [];\n if ($this->getAdvFilters()) {\n foreach($this->getAdvFilters() as $advFilter) {\n\n $field = $advFilter['field'];\n $op = $advFilter['op'];\n $value = $advFilter['value'];\n $table = isset($advFilter['table'])\n ? $advFilter['table']\n : 'main';\n\n $found = false;\n foreach($filterable as $filterInfo) {\n if ($field == $filterInfo[CartRepositoryInterface::CODE]) {\n $found = true;\n\n switch($filterInfo[CartRepositoryInterface::DATATYPE]) {\n case 'boolean':\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n break;\n case 'number':\n if ($op == 'in') {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n if ($value) {\n foreach($value as $dummy) {\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n }\n break;\n case 'string':\n if ($op == 'in') {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n if ($value) {\n foreach($value as $dummy) {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n }\n\n break;\n case 'date':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n break;\n default:\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n break;\n }\n\n\n break;\n }\n }\n\n if (!$found || !in_array($op, ['contains', 'starts', 'ends', 'equals', 'gt', 'gte', 'lt', 'lte', 'in'])) {\n continue;\n }\n\n // example:\n // $and->add($qb->expr()->eq('u.id', 1));\n\n switch($op) {\n case 'contains':\n $advFilterParams[] = '%'. $value . '%';\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'starts':\n $advFilterParams[] = $value . '%';\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'ends':\n $advFilterParams[] = '%'. $value;\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'equals':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} = ?\";\n break;\n case 'notequal':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} != ?\";\n break;\n// todo: this is messing up the counter, but it should be implemented\n// case 'null':\n// $advFilterParams[] = 'NULL';\n// $whereConditions[] = \"{$table}.{$field} IS ?\";\n// break;\n// case 'notnull':\n// $advFilterParams[] = $value;\n// $whereConditions[] = \"{$table}.{$field} IS NOT NULL\";\n// break;\n case 'gt':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} > ?\";\n break;\n case 'gte':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} >= ?\";\n break;\n case 'lt':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} < ?\";\n break;\n case 'lte':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} <= ?\";\n break;\n case 'in':\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n\n if ($value) {\n foreach($value as $val) {\n $advFilterParams[] = $val;\n }\n $paramStr = implode(',', $value);\n $whereConditions[] = \"{$table}.{$field} in ({$paramStr})\";\n }\n\n break;\n default:\n\n break;\n }\n }\n }\n\n // handle category filter with products\n if ($this->getCategoryId()\n && $this->getObjectType() == EntityConstants::PRODUCT) {\n\n $categoryTable = $this->getEntityService()->getTableName(EntityConstants::CATEGORY_PRODUCT);\n $bindTypes[$x] = \\PDO::PARAM_INT;\n // todo : sometime in the future , add a category 'anchor', connecting multiple categories\n $whereConditions[] = \"main.id in (select product_id from {$categoryTable} where category_id = ?)\";\n $x++;\n }\n\n // handle stock, visibility filters with products\n\n\n // handle facet filters\n // ie filters on EAV tables, child tables\n $facetFilterParams = [];\n if ($this->getFacetFilters()) {\n foreach($this->getFacetFilters() as $facetCode => $value) {\n\n $itemVar = $this->getVarByCode($facetCode);\n\n $tblValue = $objectType . '_' . EntityConstants::getVarDatatype($itemVar->getDatatype());\n $values = explode($this->valueSep, $value);\n $joinTbl = $tables[$itemVar->getDatatype()];\n $joinTblPre = 'ivo';\n\n if (count($values) > 1) {\n $conditions = [];\n foreach($values as $itemVarValue) {\n $conditions[] = \"({$pre}.value = ? OR {$joinTblPre}.url_value = ?)\";\n $facetFilterParams[] = $itemVarValue;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n }\n $dqlFilters[] = \"({$pre}.item_var_id={$itemVar->getId()} AND (\".implode(' OR ', $conditions).\"))\";\n } else {\n $dqlFilters[] = \"({$pre}.item_var_id={$itemVar->getId()} AND ({$pre}.value = ? OR {$joinTblPre}.url_value = ?))\";\n $facetFilterParams[] = $value;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n }\n\n $whereConditions[] = \"main.id in (select parent_id from {$tblValue} {$pre} left join {$joinTbl} {$joinTblPre} on {$pre}.item_var_option_id={$joinTblPre}.id where \". implode(' AND ', $dqlFilters).\")\";\n $dqlFilters = [];\n\n }\n }\n\n // assemble where conditions\n $conditionsSql = implode(' AND ', $whereConditions);\n if (!$conditionsSql) {\n $conditionsSql = '1=1';\n }\n\n // assemble group by\n $groupSql = $this->getGroupBy()\n ? 'group by ' . implode(', ', $this->getGroupBy())\n : '';\n\n // assemble select columns\n $colSql = '';\n if ($this->getColumns()) {\n $cols = [];\n foreach($this->getColumns() as $colData) {\n // add select\n $select = $colData['select'];\n $alias = $colData['alias'];\n if ($alias) {\n $select .= \" as {$alias}\";\n }\n\n $cols[] = $select;\n }\n $colSql = ',' . implode(',', $cols);\n }\n\n // assemble joins\n $joinSql = '';\n if ($this->getJoins()) {\n $joins = [];\n foreach($this->getJoins() as $join) {\n $type = $join['type'];\n $table = $join['table'];\n $column = $join['column'];\n $joinAlias = $join['join_alias'];\n $joinColumn = $join['join_column'];\n $joins[] = \"{$type} join {$table} on {$joinAlias}.{$joinColumn}={$table}.{$column}\";\n }\n $joinSql = implode(' ', $joins);\n }\n\n // main data query without sorting and grouping\n $this->filtersSql = \"select distinct(main.id) from {$mainTable} main {$joinSql} where {$conditionsSql}\";\n // main data query\n $this->mainSql = \"select distinct(main.id), main.* {$colSql} from {$mainTable} main {$joinSql} where {$conditionsSql} {$groupSql}\";\n // main count query, for all rows, not just the current page\n $this->countSql = \"select count(distinct(main.id)) as count from {$mainTable} main {$joinSql} where {$conditionsSql} {$groupSql}\";\n $this->bindTypes = $bindTypes;\n $this->filterParams = $filterParams;\n $this->advFilterParams = $advFilterParams;\n $this->facetFilterParams = $facetFilterParams;\n\n $this->setExecutedFilters(true);\n return $this;\n }",
"function joins() {\n //\n //begin with an empty array of joins \n $joins=[];\n //\n //Clean the array to remove any dublicates\n //\n //Sort the array in order of dependency\n $unsorted_entities=[];\n foreach ($this->join_entities as $enames){\n //\n //Get the entities\n $entty= $this->entity->dbase->entities[$enames];\n array_push($unsorted_entities, $entty);\n }\n \n //loop through the sorted array creating a join from each \n foreach ($unsorted_entities as $entity){\n //\n //get the ands columns\n $foreigns= $this->get_foreigners($entity, $joins);\n //\n //Create a new join \n array_push($joins, new join($entity, $foreigns, 'INNER JOIN'));\n }\n //\n //Return the collection of the joins in an array \n return $joins;\n }",
"public function joinBills()\n {\n $this->builder->join('bills', 'bil_id', 'rc_bill');\n }",
"public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }",
"private function _buildQuery($filters = array())\n\t{\n\t\t// var to hold conditions\n\t\t$where = array();\n\t\t$sql = '';\n\n\t\t// gidnumber\n\t\tif (isset($filters['gidNumber']))\n\t\t{\n\t\t\t$where[] = \"gidNumber=\" . $this->_db->quote($filters['gidNumber']);\n\t\t}\n\n\t\t// action\n\t\tif (isset($filters['action']))\n\t\t{\n\t\t\t$where[] = \"action=\" . $this->_db->quote($filters['action']);\n\t\t}\n\n\t\t// if we have and conditions\n\t\tif (count($where) > 0)\n\t\t{\n\t\t\t$sql = \" WHERE \" . implode(\" AND \", $where);\n\t\t}\n\n\t\tif (isset($filters['orderby']))\n\t\t{\n\t\t\t$sql .= \" ORDER BY \" . $filters['orderby'];\n\t\t}\n\n\t\treturn $sql;\n\t}",
"function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }",
"public function innerJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (get_class($this) == $joined || in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_innerJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}",
"public function joinBookings()\n {\n $this->builder->join('bookings', 'book_id', 'bil_booking');\n }",
"private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }"
] |
[
"0.735921",
"0.7072809",
"0.7008494",
"0.6901871",
"0.645943",
"0.62778056",
"0.6237814",
"0.62219",
"0.61812884",
"0.6171721",
"0.6122712",
"0.5990475",
"0.5971004",
"0.595362",
"0.59530985",
"0.5922878",
"0.59156233",
"0.58875453",
"0.5869136",
"0.58406353",
"0.5837045",
"0.5832776",
"0.58199835",
"0.5815003",
"0.5805005",
"0.5795292",
"0.579363",
"0.5793296",
"0.5784882",
"0.57775223"
] |
0.7231658
|
1
|
Adds the `order by` component of the builder
|
protected function formOrderBy(&$builder, $order_by = null)
{
if (is_string($order_by)){
$builder->orderBy($order_by);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function orderBy() {\n $this->_orderBy = \"\";\n foreach ($this->_columns as $tableName => $table) {\n if (array_key_exists('order_bys', $table)) {\n foreach ($table['order_bys'] as $fieldName => $field) {\n $this->_orderBy[] = $field['dbAlias'];\n }\n }\n }\n $this->_orderBy = \"ORDER BY \" . implode(', ', $this->_orderBy) . \" \";\n }",
"private function buildOrderBy() {\n\t\t$hasorderby = false;\n\t\tforeach($this->ordergroup as $key=>$extra) {\n\t\t\tif(strpos(strtoupper($extra), 'ORDER BY') !== false) {\n\t\t\t\t$this->orders[] = str_replace('ORDER BY', \"\", strtoupper($extra));\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t\tif(strpos(strtoupper($extra), 'LIMIT') !== false) {\n\t\t\t\t$this->limit = $extra;\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t\tif(strpos(strtoupper($extra), 'GROUP BY') !== false) { \n\t\t\t\t$this->groups[] = str_replace('GROUP BY', \"\", strtoupper($extra));\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t}\n\t}",
"public function getQueryOrderby() {\n return '`'.$this->name.'`';\n }",
"abstract protected function _buildOrderBy( $order );",
"protected function addOrder(Builder $builder)\n {\n $builder->macro('order', function(Builder $builder, $things = []) {\n if ( count($things) == 0 ) {\n return $builder->applyScopes();\n }\n $builder = $builder->getModel()->newQueryWithoutScopes();\n foreach ( $this->getOrderByRules($builder) as $column => $rule ) {\n if ( is_numeric($column) ) {\n $column = $rule;\n $rule = \"DESC\";\n }\n if ( in_array($column, $things) ) {\n $builder->orderBy($column, $rule);\n }\n }\n\n return $builder;\n });\n }",
"public function orderBy(){\r\n $this->orderBy = \"ORDER BY \";\r\n $args = func_get_args();\r\n foreach($args as $arg){\r\n $this->orderBy.= $this->db->formatTableName($arg);\r\n if(end($args) !== $arg){\r\n $this->orderBy.=\", \";\r\n } \r\n\r\n }\r\n return $this;\r\n }",
"protected function setOrder() {\r\n if( $this->sqlOrderBy ) {\r\n $this->sql .= ' ORDER BY ' . $this->sqlOrderBy;\r\n }\r\n }",
"public function order_by() {\r\n\t\t$fields = func_get_args();\r\n\r\n\t\t// Loop through the columns\r\n\t\tfor ( $i = 0; $i < intval( $_GET['iSortingCols'] ); $i++ ) {\r\n\t\t\t// Add the necessary comman\r\n\t\t\tif ( !empty( $this->order_by ) )\r\n\t\t\t\t$this->order_by .= ',';\r\n\t\t\t\r\n\t\t\t// Compile the fields\r\n\t\t\t$this->order_by .= $fields[$_GET['iSortCol_' . $i]] . ' ' . $_GET['sSortDir_' . $i];\r\n\t\t}\r\n\t\t\r\n\t\t// If it's not empty\r\n\t\tif ( !empty( $this->order_by ) )\r\n\t\t\t$this->order_by = ' ORDER BY ' . $this->order_by;\r\n\t}",
"protected function _compile_order_by()\n\t{\n\t\tif (is_array($this->qb_orderby) && count($this->qb_orderby) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->qb_orderby); $i < $c; $i++)\n\t\t\t{\n\t\t\t\tif ($this->qb_orderby[$i]['escape'] !== FALSE && ! $this->_is_literal($this->qb_orderby[$i]['field']))\n\t\t\t\t{\n\t\t\t\t\t$this->qb_orderby[$i]['field'] = $this->protect_identifiers($this->qb_orderby[$i]['field']);\n\t\t\t\t}\n\n\t\t\t\t$this->qb_orderby[$i] = $this->qb_orderby[$i]['field'].$this->qb_orderby[$i]['direction'];\n\t\t\t}\n\n\t\t\treturn $this->qb_orderby = \"\\nORDER BY \".implode(', ', $this->qb_orderby);\n\t\t}\n\t\telseif (is_string($this->qb_orderby))\n\t\t{\n\t\t\treturn $this->qb_orderby;\n\t\t}\n\n\t\treturn '';\n\t}",
"private function sql_orderBy()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Short var\n $arr_order = null;\n $arr_order = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'order.' ];\n\n // Order field\n switch ( true )\n {\n case( $arr_order[ 'field' ] == 'uid' ):\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n break;\n case( $arr_order[ 'field' ] == 'value' ):\n default:\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n break;\n }\n // Order field\n // Order flag\n switch ( true )\n {\n case( $arr_order[ 'orderFlag' ] == 'DESC' ):\n $orderFlag = 'DESC';\n break;\n case( $arr_order[ 'orderFlag' ] == 'ASC' ):\n default:\n $orderFlag = 'ASC';\n break;\n }\n // Order flag\n // Get ORDER BY statement\n $orderBy = $orderField . ' ' . $orderFlag;\n\n // RETURN ORDER BY statement\n return $orderBy;\n }",
"public function &getOrderBy();",
"public function setOrderBy(array $orderBy);",
"public function orderBy($order = \"\"){\n\t\t\tif(is_string($order) && strlen($order) > 0){\n\t\t\t\t$this->orderBy = \" ORDER BY \" . $order;\n\t\t\t}else{\n\t\t\t\t$this->orderBy = false;\n\t\t\t}\n\t\t\treturn $this;\n\t\t}",
"public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = $this->fields_arr['orderby_field'].' '.$this->fields_arr['orderby'];\n\t\t\t}",
"public function OrderBy($by = null) {\r\n $this->orderBy = $by;\r\n }",
"protected function prepareOrderByStatement() {}",
"public function setOrderBy($var)\n {\n GPBUtil::checkString($var, True);\n $this->order_by = $var;\n\n return $this;\n }",
"public function setOrderBy($var)\n {\n GPBUtil::checkString($var, True);\n $this->order_by = $var;\n\n return $this;\n }",
"public function setOrderBy($var)\n {\n GPBUtil::checkString($var, True);\n $this->order_by = $var;\n\n return $this;\n }",
"function buildOrderParams() \n\t{\n\t\tif ($this->sortByGroup === false && $this->sortField != \"\"){\n\t\t\t$this->strOrderBy = \"Order by \".$this->sortField;\n\t\t\tif ($this->sortOrder == \"A\")\n\t\t\t\t$this->strOrderBy .= \" asc\";\n\t\t\telse \n\t\t\t\t$this->strOrderBy .= \" desc\";\n\t\t}\n\t}",
"public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = '';\n\t\t\t\t$sort = $this->fields_arr['orderby_field'];\n\t\t\t\t$orderBy = $this->fields_arr['orderby'];\n\t\t\t\tif ($sort AND $orderBy)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->sql_sort = ' '.$sort.' '.$orderBy;\n\t\t\t\t\t}\n\t\t\t}",
"public function implicitOrderby() {\n\t\treturn true;\n\t}",
"public function buildSortQuery(): Builder\n {\n return static::query()->where('repository_id', $this->repository_id);\n }",
"public function sort($orderBy): void;",
"public function setOrderBy($orderBy)\r\n\t{\r\n\t\t$this->orderBy = $orderBy;\r\n\t}",
"public function order($orderBy) {\r\n $this->sqlOrderBy = $orderBy;\r\n return $this;\r\n }",
"private function _buildOrderClause()\n {\n $order = array();\n\n switch ( $this->orderby ) {\n case self::ORDERBY_DATE:\n $order[] = 'date_enreg' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_BEGIN_DATE:\n $order[] = 'date_debut_cotis' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_END_DATE:\n $order[] = 'date_fin_cotis' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_MEMBER:\n $order[] = 'nom_adh' . ' ' . $this->ordered;\n $order[] = 'prenom_adh' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_TYPE:\n $order[] = ContributionsTypes::PK;\n break;\n case self::ORDERBY_AMOUNT:\n $order[] = 'montant_cotis' . ' ' . $this->ordered;\n break;\n /*\n Hum... I really do not know how to sort a query with a value that\n is calculated code side :/\n case self::ORDERBY_DURATION:\n break;*/\n default:\n $order[] = $this->orderby . ' ' . $this->ordered;\n break;\n }\n\n return $order;\n }",
"public function setOrderBy($orderBy)\n {\n return $this->setAdditionalParam('orderBy', $orderBy);\n }",
"public function addOrderBy($value) {\n\t\t$this->query['order'] = ArrayHelper::merge($this->query['order'], $value);\n\t\treturn $this;\n\t}",
"function orderByClause( $orderby ) {\n\t global $wpdb;\n\t return \"dm.meta_value+0 {$this->order}, $wpdb->posts.post_title ASC\";\n\t}"
] |
[
"0.7496503",
"0.7355641",
"0.7172415",
"0.70009357",
"0.6997284",
"0.6988222",
"0.69461423",
"0.68898",
"0.6841022",
"0.68391037",
"0.68076575",
"0.68013525",
"0.67385966",
"0.6683881",
"0.66613436",
"0.6641937",
"0.6620022",
"0.6620022",
"0.6620022",
"0.655186",
"0.65236044",
"0.65214",
"0.65094066",
"0.6485952",
"0.6482742",
"0.64805675",
"0.64514387",
"0.6442652",
"0.6440779",
"0.64392114"
] |
0.7402508
|
1
|
initialize elastic query's body
|
public function initQueryBody()
{
$this->queryBody = [
'index' => $this->connection->index(),
'type' => $this->connection->type(),
'body' => [
'query' => [
'bool' => [
'filter' => [
]
]
]
]
];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function composeQuery()\n {\n $this->initQueryBody();\n if ($this->selectedFields) {\n array_set($this->queryBody, 'body._source', $this->selectedFields);\n $this->clearSelect();\n }\n if ($this->range) {\n $filter = array_get($this->queryBody, 'body.query.bool.filter');\n array_push($filter, $this->range);\n array_set($this->queryBody, 'body.query.bool.filter', $filter);\n\n }\n if ($this->terms) {\n foreach($this->terms as $condition => $conditionTerms) {\n $$condition = array_get($this->queryBody, \"body.query.bool.{$condition}\");\n $$condition = $$condition ?: [];\n foreach ($conditionTerms as $key => $value) {\n array_push($$condition, [\"term\" => [$key => $value]]);\n }\n array_set($this->queryBody, \"body.query.bool.{$condition}\", $$condition);\n }\n\n }\n if ($this->from) {\n array_set($this->queryBody, 'body.from', $this->from);\n }\n if ($this->size) {\n array_set($this->queryBody, 'body.size', $this->size);\n }\n if ($this->scrollSize) {\n array_set($this->queryBody, 'size', $this->scrollSize);\n }\n if ($this->scrollKeepTime) {\n array_set($this->queryBody, 'scroll', $this->scrollKeepTime);\n }\n if ($this->orders) {\n $orders = [];\n foreach($this->orders as $field => $value) {\n array_push($orders, [$field => [\"order\" => $value]]);\n }\n array_set($this->queryBody, 'body.sort', $orders);\n }\n }",
"protected function buildSearchQuery(SearchApiQueryInterface $query) {\n // Query options.\n $query_options = $this->getSearchQueryOptions($query);\n\n // Main query.\n $params = $query->getOption('ElasticParams');\n $body = &$params['body'];\n\n // Set the size and from parameters.\n $body['from'] = $query_options['query_offset'];\n $body['size'] = $query_options['query_limit'];\n\n // Sort\n if (!empty($query_options['sort'])) {\n $body['sort'] = $query_options['sort'];\n }\n\n $body['fields'] = array();\n $fields = &$body['fields'];\n\n // Handle spellcheck if enabled\n $this->buildSpellcheckQuery($query, $params);\n\n /**\n * $query_options['spatials']:\n * - field: The Search API field identifier of the location field. Must be indexed\n * as type \"location\".\n * - lat: The latitude of the point on which this location parameter is centered.\n * - lon: The longitude of that point.\n * - radius: (optional) If results should be filtered according to their distance\n * to the point, the maximum distance at which a point should be included (in\n * kilometers).\n * - method: (optional) The method to use for filtering. This is backend-specific\n * and not guaranteed to have an effect. Service classes should ignore values of\n * this option which they don't recognize.\n */\n // Search API Location support.\n if (!empty($query_options['spatials'])) {\n foreach ($query_options['spatials'] as $i => $spatial) {\n if (empty($spatial['field']) || empty($spatial['lat']) || empty($spatial['lon'])) {\n continue;\n }\n\n // Shortcut to easily reuse the field and point.\n $field = $spatial['field'];\n $point = array(\n 'lat' => (float) $spatial['lat'],\n 'lon' => (float) $spatial['lon'],\n );\n\n // Prepare the filter settings.\n if (isset($spatial['radius'])) {\n $radius = (float) $spatial['radius'];\n }\n\n // TODO: Implement the other geo filter types.\n // TODO: Implement the functionality to have multiple filters together\n // with the geo filters.\n\n // // Geo bounding box filter.\n // $query_options['query_search_filter'] = array(\n // 'geo_bounding_box' => array(\n // $spatial['field'] => array(\n // 'top_left' => array(\n // 'lat' => '',\n // 'lon' => '',\n // ),\n // 'bottom_right' => array(\n // 'lat' => '',\n // 'lon' => '',\n // ),\n // ),\n // ),\n // );\n\n // Geo Distance filter.\n $geo_distance_filter = array(\n 'geo_distance' => array(\n 'distance' => $radius . 'km',\n $spatial['field'] => $point,\n ),\n );\n\n if (!empty($query_options['query_search_filter'])) {\n $query_options['query_search_filter'] = array(\n 'and' => array(\n $query_options['query_search_filter'],\n $geo_distance_filter\n ),\n );\n } else {\n $query_options['query_search_filter'] = $geo_distance_filter;\n }\n\n // // Geo distance range filter.\n // $query_options['query_search_filter'] = array(\n // 'geo_distance_range' => array(\n // 'from' => '',\n // 'to' => '',\n // $spatial['field'] => $point,\n // ),\n // );\n\n // // Geo polygon filter.\n // $query_options['query_search_filter'] = array(\n // 'geo_polygon' => array(\n // $spatial['field'] => array(\n // 'points' => array(),\n // ),\n // ),\n // );\n\n // // Geoshape filter.\n // $query_options['query_search_filter'] = array(\n // 'geo_shape' => array(\n // $spatial['field'] => array(\n // 'shape' => array(\n // 'type' => 'envelope',\n // 'coordinates' => array(),\n // ),\n // ),\n // ),\n // );\n\n // // Geohash cell filter.\n // $query_options['query_search_filter'] = array(\n // 'geohash_cell' => array(\n // $spatial['field'] => $point,\n // 'precision' => '',\n // 'neighbors' => '',\n // ),\n // );\n }\n }\n\n // Build the query.\n if (!empty($query_options['query_search']) && !empty($query_options['query_search_filter'])) {\n $body['query']['filtered']['query'] = $query_options['query_search'];\n $body['query']['filtered']['filter'] = $query_options['query_search_filter'];\n }\n elseif (!empty($query_options['query_search'])) {\n if (empty($body['query'])) {\n $body['query'] = array();\n }\n $body['query'] += $query_options['query_search'];\n }\n elseif (!empty($query_options['query_search_filter'])) {\n $body['filter'] = $query_options['query_search_filter'];\n }\n\n // TODO: Handle fields on filter query.\n if (empty($fields)) {\n unset($body['fields']);\n }\n\n if (empty($body['filter'])) {\n unset($body['filter']);\n }\n\n if (empty($query_body)) {\n $query_body['match_all'] = array();\n }\n\n // Preserve the options for futher manipulation if necessary.\n $query->setOption('ElasticParams', $params);\n return $params;\n }",
"abstract protected function initQuery(): void;",
"public function createDefaultSearchQuery()\n {\n $qB = SearchEngine::getElasticaQueryBuilder();\n\n $keyword = Utility::convertArrayToString($this->searchEvent->getKeyword());\n $where = $this->searchEvent->getWhere();\n\n $keywordQuery = null;\n $whereQuery = null;\n $content = 0;\n if ($where) {\n if ($geoDistance = $this->container->get(\"nearby.handler\")->getGeoDistanceInfoByWhere()) {\n $whereQuery = $qB->query()->bool();\n $whereQuery->addShould(\n $qB->query()->match()->setFieldQuery(\"searchInfo.location\",$where)\n ->setFieldType(\"searchInfo.location\", \"phrase\")\n ->setFieldBoost(\"searchInfo.location\", 2)\n ->setFieldParam('searchInfo.location', 'slop', 30)\n );\n $whereQuery->addShould(\n $qB->query()->geo_distance(\n 'geoLocation',\n [\n 'lat' => $geoDistance['latitude'],\n 'lon' => $geoDistance['longitude'],\n ],\n $geoDistance['radius'])\n );\n $content |= 1;\n } else {\n $whereQuery = $qB->query()->match()->setFieldQuery('searchInfo.location',$where)\n ->setFieldType('searchInfo.location', 'phrase')\n ->setFieldParam('searchInfo.location', 'slop', 30);\n $content |= 1;\n }\n }\n\n if ($keyword) {\n $keywordQuery = $qB->query()->multi_match();\n\n $keywordQuery->setQuery($keyword)\n ->setTieBreaker(0.3)\n ->setOperator(\"and\")\n ->setFields([\n 'friendlyUrl^500',\n 'title.raw^200',\n 'title.analyzed^10',\n 'description^5',\n 'searchInfo.keyword^1',\n 'searchInfo.location^1',\n ]);\n\n $content |= 2;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_setup_query\", [\n \"content\" => &$content,\n \"whereQuery\" => &$whereQuery,\n \"keywordQuery\" => &$keywordQuery\n ]);\n\n switch ($content) {\n case 1:\n $query = $whereQuery;\n break;\n case 2:\n $query = $keywordQuery;\n break;\n case 3:\n $query = $qB->query()->bool();\n $query->addMust($keywordQuery);\n $query->addMust($whereQuery);\n break;\n default:\n $query = $qB->query()->match_all();\n break;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_return_query\", [\n \"query\" => &$query,\n ]);\n\n return $query;\n }",
"public function body($body = null) {\n\t\tif (isset($body)) {\n\t\t\treturn parent::body($body) ;\n\t\t}\n\t\t\n\t\t$body = parent::body() ;\n\t\t\n\t\tif (empty($body['query'])) {\n\t\t\t// Force a match_all\n\t\t\t$body['query'] = $this->_query->to('array') ;\n\t\t}\n\t\t\n\t\tif (empty($body['filter']) && $this->_filters->count()) {\n\t\t\t$body['filter'] = $this->_filters->to('array') ;\n\t\t}\n\t\t\n\t\tif (empty($body['facets']) && $this->_facets->count()) {\n\t\t\t$body['facets'] = $this->_facets->to('array') ;\n\t\t}\n\n\t\t// Sort format\n\t\tif (!empty($body['sort'])) {\n\t\t\t$body['sort'] = $this->_prepareSort($body['sort']) ;\t\t\n\t\t}\n\t\t\n\t\t// Highlights format\n\t\tif (!empty($body['highlight']['fields'])) {\n\t\t\t$highlight = array() ;\n\t\t\tforeach($body['highlight']['fields'] as $key => $value) {\n\t\t\t\tif (is_numeric($key)) {\n\t\t\t\t\t$highlight[$value] = new stdClass() ;\n\t\t\t\t} else {\n\t\t\t\t\t$highlight[$key] = $value ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$body['highlight']['fields'] = $highlight ;\n\t\t}\n\t\t\n foreach($body as $key => $value) {\n if (!isset($value)) {\n unset($body[$key]) ;\n }\n }\n\t\t\n\t\treturn $body ;\n\t}",
"public function compile()\n {\n // set every condition in the query array\n $this->query['body']['query'] = [];\n foreach ($this->constraints as $constraint) {\n $this->query['body']['query'] = array_merge($this->query['body']['query'], $this->compileConstraint($constraint));\n }\n\n foreach ($this->bools as $bool) {\n if (array_key_exists('constraint', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $this->compileConstraint($bool['constraint']);\n }\n if (array_key_exists('query_string', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['query_string'];\n }\n if (array_key_exists('script', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['script'];\n }\n if (array_key_exists('bool', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = array('bool' => $bool['bool']);\n }\n }\n if (!empty($this->aggs)) {\n $this->query['body']['aggs'] = $this->aggs;\n }\n if ($this->sort) {\n $this->query['body']['sort'] = $this->sort;\n }\n if ($this->scroll_param) {\n $this->query['scroll'] = $this->scroll_param;\n }\n if ($this->highlight) {\n $this->query['body']['highlight'] = $this->highlight;\n }\n if ($this->filter) {\n $this->query['body']['query']['bool']['filter'] = $this->filter;\n }\n if ($this->query_string) {\n $this->query['body']['query']['query_string'] = $this->query_string;\n }\n if ($this->script) {\n $this->query['body']['query']['script']['script'] = $this->script;\n }\n if ($this->fromType) {\n $this->query['type'] = $this->fromType;\n }\n if ($this->fromIndex) {\n $this->query['index'] = $this->fromIndex;\n } elseif (isset($this->model) && $this->model) {\n $this->query[\"index\"] = $this->model->getIndex();\n }\n return $this->query;\n }",
"function build_table_search_params($index, $type, $query, $from = 0, $size = 1000) {\n $params = [];\n $params['index'] = $index;\n $params['type'] = $type;\n // sort the table by the first field by default\n //$sort_field = array_keys($field_content_pairs)[0];\n $params['body'] = [\n 'query' => $query,\n ];\n\n if (isset($_GET['order'])) {\n $sort_field = $_GET['order'];\n $sort_direction = isset($_GET['sort']) && $_GET['sort'] === 'desc' ? 'desc' : 'asc';\n $params['body']['sort'] = [\n $sort_field . \".raw\" => $sort_direction,\n ];\n }\n\n $params['from'] = $from;\n $params['size'] = $size;\n return $params;\n}",
"public function __construct()\n {\n $this->query = 'poems';\n }",
"public function buildQuery() {\n\t\t\tif (isset($this->postTypes[$this->postType])) {\n\t\t\t\t$this->SetFilter('type', array($this->postTypes[$this->postType] + 1));\n\t\t\t}\n\t\t\t$this->SetFilter('status', array(1));\n\t\t\tswitch ($this->matchMode) {\n\t\t\t\tcase 'any';\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetMatchMode(SPH_MATCH_ALL);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch ($this->sortMode) {\n\t\t\t\tcase 'posted':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, 'posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'relevance':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, '@relevance DESC, posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'top':\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXPR, 'upvotes - downvotes + @weight + LN(posted) * 1000');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->SetLimits((int) $this->currentPage, (int) $this->pageLimit, (int) $this->resultLimit);\n\t\t}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"private function bodyBuilder(){\n\t\t// create empty structures\n\t\t$body = new stdClass();\n\t\t$input = new stdClass();\n\n\n\t\t// add leads array to input\n\t\t$body->input = $this->leads;\n\n\t\t// if tokens exists, add them to body->input\n\t\tif (isset($this->tokens)) {\n\t\t\t$body->input->tokens = $this->tokens;\n\t\t}\n\n\t\t$json = json_encode($body, JSON_PRETTY_PRINT);\n\n\t\treturn $json;\n\t}",
"public function __construct()\n {\n parent::__construct();\n $this->query = new Query();\n }",
"public function __construct($query = NULL) {\n\n $this->query = (array) $query;\n\n if (!empty($this->query) && !$this->get('noquery')) {\n $this->processObject();\n }\n }",
"public function __construct($query)\n\t{\n $this->query = $query;\n }",
"private function initQuery()\n {\n // reset\n $this->result = false;\n \n $this->errorCode = 0;\n $this->errorMessage = '';\n }",
"protected function set_query($query, $q) {\n // Set hightlighting.\n $query->setHighlight(true);\n foreach ($this->highlightfields as $field) {\n $query->addHighlightField($field);\n }\n $query->setHighlightFragsize(static::FRAG_SIZE);\n $query->setHighlightSimplePre(self::HIGHLIGHT_START);\n $query->setHighlightSimplePost(self::HIGHLIGHT_END);\n $query->setHighlightMergeContiguous(true);\n\n $query->setQuery($q);\n\n // A reasonable max.\n $query->setRows(static::QUERY_SIZE);\n }",
"public function __construct($query = '')\n {\n }",
"protected function queryVariableInstancesRequest($body = null)\n {\n\n $resourcePath = '/query/historic-variable-instances';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"abstract protected function initQueryBuilder(): Builder;",
"public function __construct($body) {\n parent::__construct();\n $this->setBody($body);\n }",
"public function getElasticSearchParams() {\n return $this->params;\n }",
"public function initQuery(RequestInterface $request)\n {\n $dimension = current($request->getDimensions());\n $storeId = $this->scopeResolver->getScope($dimension->getValue())->getId();\n $searchQuery = [\n 'index' => $this->searchIndexNameResolver->getIndexName($storeId, $request->getIndex()),\n 'type' => $this->clientConfig->getEntityType(),\n 'body' => [\n 'from' => $request->getFrom(),\n 'size' => $request->getSize(),\n 'fields' => ['_id', '_score'],\n 'query' => [],\n ],\n ];\n return $searchQuery;\n }",
"public function query()\n {\n return new \\Rubberband\\Elastic\\Laravel\\Query\\Builder($this);\n }",
"protected function getAllIndexesRequest()\n {\n\n $resourcePath = '/indexes';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('auth_token');\n if ($apiKey !== null) {\n $queryParams['auth_token'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-RSearch-App-ID');\n if ($apiKey !== null) {\n $headers['X-RSearch-App-ID'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setQuery( $query ){\n \n $this->query = $query;\n \n }",
"public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }",
"private function _buildIndices(): QueryBuilder\n {\n if (count($this->indices) > 0) {\n $indices = implode(',', $this->indices);\n\n $this->query->headers['index'] = $indices;\n }\n\n return $this;\n }"
] |
[
"0.6488196",
"0.5701107",
"0.56761444",
"0.5669867",
"0.5620023",
"0.5612076",
"0.56032425",
"0.5560951",
"0.55461764",
"0.553059",
"0.553059",
"0.553059",
"0.55295944",
"0.55282354",
"0.5468336",
"0.54634506",
"0.5444723",
"0.5402092",
"0.53944594",
"0.5387586",
"0.53637433",
"0.5362845",
"0.5359603",
"0.53562456",
"0.5354432",
"0.5336199",
"0.5317532",
"0.5314181",
"0.52831393",
"0.5264672"
] |
0.8490011
|
0
|
compose query based on all options we set before Query Example: [ 'index' => 'index name ', 'type' => 'type name', 'scroll'=> '30s',// how long between scroll requests. should be small! 'size' => '50', //results size for per shard scroll created 'body' => [ 'query' => [ 'bool' => [ "filter" => [ [ "range" => [
|
public function composeQuery()
{
$this->initQueryBody();
if ($this->selectedFields) {
array_set($this->queryBody, 'body._source', $this->selectedFields);
$this->clearSelect();
}
if ($this->range) {
$filter = array_get($this->queryBody, 'body.query.bool.filter');
array_push($filter, $this->range);
array_set($this->queryBody, 'body.query.bool.filter', $filter);
}
if ($this->terms) {
foreach($this->terms as $condition => $conditionTerms) {
$$condition = array_get($this->queryBody, "body.query.bool.{$condition}");
$$condition = $$condition ?: [];
foreach ($conditionTerms as $key => $value) {
array_push($$condition, ["term" => [$key => $value]]);
}
array_set($this->queryBody, "body.query.bool.{$condition}", $$condition);
}
}
if ($this->from) {
array_set($this->queryBody, 'body.from', $this->from);
}
if ($this->size) {
array_set($this->queryBody, 'body.size', $this->size);
}
if ($this->scrollSize) {
array_set($this->queryBody, 'size', $this->scrollSize);
}
if ($this->scrollKeepTime) {
array_set($this->queryBody, 'scroll', $this->scrollKeepTime);
}
if ($this->orders) {
$orders = [];
foreach($this->orders as $field => $value) {
array_push($orders, [$field => ["order" => $value]]);
}
array_set($this->queryBody, 'body.sort', $orders);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function initQueryBody()\n {\n $this->queryBody = [\n 'index' => $this->connection->index(),\n 'type' => $this->connection->type(),\n 'body' => [\n 'query' => [\n 'bool' => [\n 'filter' => [\n\n ]\n ]\n ]\n ]\n ];\n }",
"public function buildQuery($typeSearch = 'must', $typeQuery, $query = [], $filters = [], $qSort = [], $aggregates = [], $from = 0, $size = 20): array \n {\n if (!in_array($typeSearch, ['must', 'should', 'should_not'])) {\n return null;\n }\n if (!in_array($typeQuery, ['term', 'match', 'match_all', 'prefix'])) {\n return null;\n }\n\n // Add query\n $finalQuery = $queryClauses = $filterClauses = [];\n if (isset($typeQuery) && 'match_all' == $typeQuery) {\n $finalQuery['query'] = [$typeQuery => (object)$query];\n\n } else {\n if (isset($query) && 0 < count($query)) {\n\n // 1 field\n if (1 == count($query)) {\n $queryClauses[$typeQuery] = $query;\n } else {\n /**\n * 2 cases :\n * field: [value1, value 2]\n * => terms: [field: [$value1, $value 2]\n *\n * [field:value1, field2: value 2]\n * => [term :[field:value], term: [field2: value2]...]\n */\n foreach ($query as $field => $value) {\n if (is_array($value)) {\n array_push($queryClauses, ['terms' => [$field=>$value]]);\n } else {\n $queryClauses[][$typeQuery] = [$field=>$value];\n }\n }\n }\n\n if (0 < count($queryClauses)) {\n $queryClauses = [\n 'bool' => [\n $typeSearch => $queryClauses\n ]\n ];\n $finalQuery['query'] = $queryClauses;\n }\n }\n }\n\n // Filters\n if (isset($filters) && 0 < count($filters)) {\n $filtersQuery = [];\n if ('AND' == key($filters)) {\n $filterAnd = [];\n foreach ($filters['AND'] as $type => $filter) {\n foreach ($filter as $field=>$value) {\n $filterAnd[][$type] = [$field=>$value];\n }\n }\n $filtersQuery['bool']['must'] = $filterAnd;\n\n } elseif ('OR' == key($filters)) {\n $filterOr = [];\n// foreach ($filters['OR'] as $type => $filter) {\n// $field = key($filter);\n// $value = $filter[$field];\n// $FilterAndLoop[] = [$field => $value];\n// $filterAnd[$type] = $FilterAndLoop;\n// }\n $filtersQuery['bool']['should'] = $filterOr;\n }\n\n if (0 < count($filtersQuery)) {\n $finalQuery['query']['bool']['filter'] = $filtersQuery;\n }\n }\n\n // Add sort\n if (isset($qSort) && 0 < count($qSort)) {\n foreach ($qSort as $field=>$type) {\n $fieldSort[$field] = [];\n if (in_array($type, self::LIST_ORDER)) {\n array_push($fieldSort[$field], ['order' => $type]);\n }\n }\n $finalQuery['sort'] = $fieldSort;\n }\n\n // Add aggregates\n if (isset($aggregates) && 0 < count($aggregates)) {\n $aggregatesFields = $aggregateFilter = [];\n if (array_key_exists('aggregates', $aggregates)) {\n $aggregatesFields = $aggregates['aggregates'];\n $finalQuery['aggregations'] = [\n 'allfacets' => [\n 'aggregations' => $aggregatesFields\n ]\n ];\n } elseif (array_key_exists('raw', $aggregates)) {\n // Aggregations RAW\n $finalQuery['aggregations'] = $aggregates['raw'];\n }\n\n // Add filter/global\n if (array_key_exists('filter', $aggregates)) {\n $aggFilter = [];\n // TODO : améliorer ?\n foreach ($aggregates['filter'] as $type => $tabFieldValues) {\n $aggFilter[$type] = $tabFieldValues;\n }\n $aggregateFilter['filter'] = $aggFilter;\n // FIN TODO\n } elseif (array_key_exists('global', $aggregates)) {\n $aggregateFilter['global'] = new \\stdClass();\n }\n\n\n\n if (0 < count($aggregateFilter)) {\n $finalQuery['aggregations']['allfacets'] += $aggregateFilter;\n }\n }\n\n $finalQuery['from'] = $from;\n $finalQuery['size'] = $size;\n dump(json_encode($finalQuery));\n return $finalQuery;\n }",
"public function buildQuery() {\n\t\t\tif (isset($this->postTypes[$this->postType])) {\n\t\t\t\t$this->SetFilter('type', array($this->postTypes[$this->postType] + 1));\n\t\t\t}\n\t\t\t$this->SetFilter('status', array(1));\n\t\t\tswitch ($this->matchMode) {\n\t\t\t\tcase 'any';\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetMatchMode(SPH_MATCH_ALL);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch ($this->sortMode) {\n\t\t\t\tcase 'posted':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, 'posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'relevance':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, '@relevance DESC, posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'top':\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXPR, 'upvotes - downvotes + @weight + LN(posted) * 1000');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->SetLimits((int) $this->currentPage, (int) $this->pageLimit, (int) $this->resultLimit);\n\t\t}",
"public function compile()\n {\n // set every condition in the query array\n $this->query['body']['query'] = [];\n foreach ($this->constraints as $constraint) {\n $this->query['body']['query'] = array_merge($this->query['body']['query'], $this->compileConstraint($constraint));\n }\n\n foreach ($this->bools as $bool) {\n if (array_key_exists('constraint', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $this->compileConstraint($bool['constraint']);\n }\n if (array_key_exists('query_string', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['query_string'];\n }\n if (array_key_exists('script', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['script'];\n }\n if (array_key_exists('bool', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = array('bool' => $bool['bool']);\n }\n }\n if (!empty($this->aggs)) {\n $this->query['body']['aggs'] = $this->aggs;\n }\n if ($this->sort) {\n $this->query['body']['sort'] = $this->sort;\n }\n if ($this->scroll_param) {\n $this->query['scroll'] = $this->scroll_param;\n }\n if ($this->highlight) {\n $this->query['body']['highlight'] = $this->highlight;\n }\n if ($this->filter) {\n $this->query['body']['query']['bool']['filter'] = $this->filter;\n }\n if ($this->query_string) {\n $this->query['body']['query']['query_string'] = $this->query_string;\n }\n if ($this->script) {\n $this->query['body']['query']['script']['script'] = $this->script;\n }\n if ($this->fromType) {\n $this->query['type'] = $this->fromType;\n }\n if ($this->fromIndex) {\n $this->query['index'] = $this->fromIndex;\n } elseif (isset($this->model) && $this->model) {\n $this->query[\"index\"] = $this->model->getIndex();\n }\n return $this->query;\n }",
"function main(){\r\n\r\n\r\n /*$index='texas-30001-player';\r\n $type= 'player';\r\n $stime= \"2018-05-01 00:00:00\";\r\n $etime= \"2018-05-08 00:00:00\";\r\n $groupOp = 'AND';\r\n\r\n $querydata = [\r\n [\r\n \"op\"=>\"eq\",\r\n \"field\"=>\"ActionName\",\r\n \"data\"=>\"player.gain\"\r\n ],\r\n [\r\n \"op\"=>\"eq\",\r\n \"field\"=>\"type\",\r\n \"data\"=>\"gold\"\r\n ],\r\n [\r\n \"op\"=>\"ew\",\r\n \"field\"=>\"num\",\r\n \"data\"=>10000\r\n ]\r\n ];\r\n\r\n $ins = \\Pelasticsearch\\Pelasticsearch::Getins();\r\n $ins->init($index,$type,$stime,$etime);\r\n $data = $ins->multipleQuery(0,100,$groupOp,$querydata);\r\n\r\n echo '<pre>';\r\n print_r($data);\r\n echo '</pre>';*/\r\n\r\n\r\n /*$index='texas-30001-player';\r\n $type= 'player';\r\n $body = [\r\n \"fieldname\"=>\"fielddata\"\r\n ];\r\n $ins = \\Pelasticsearch\\Pelasticsearch::Getins();\r\n $ins->init($index,$type);\r\n $data = $ins->Add($body);\r\n\r\n\r\n echo '<pre>';\r\n print_r($data);\r\n echo '</pre>';*/\r\n\r\n /*$index='texas-30001-player';\r\n $type= 'my_type';\r\n $id = 'my_id';\r\n $ins = \\Pelasticsearch\\Pelasticsearch::Getins();\r\n $ins->init($index,$type);\r\n $data = $ins->Delete($id);\r\n\r\n echo '<pre>';\r\n print_r($data);\r\n echo '</pre>';*/\r\n\r\n\r\n\r\n}",
"function build_table_search_params($index, $type, $query, $from = 0, $size = 1000) {\n $params = [];\n $params['index'] = $index;\n $params['type'] = $type;\n // sort the table by the first field by default\n //$sort_field = array_keys($field_content_pairs)[0];\n $params['body'] = [\n 'query' => $query,\n ];\n\n if (isset($_GET['order'])) {\n $sort_field = $_GET['order'];\n $sort_direction = isset($_GET['sort']) && $_GET['sort'] === 'desc' ? 'desc' : 'asc';\n $params['body']['sort'] = [\n $sort_field . \".raw\" => $sort_direction,\n ];\n }\n\n $params['from'] = $from;\n $params['size'] = $size;\n return $params;\n}",
"public function runQuery($query, array $options = array())\n\t{\n\t\t$original_query = $query;\n\t\t\n\t\tif (isset($options['limit']) && isset($options['offset'])) {\n\t\t\t$query['query']['page'] = ($options['offset'] / $options['limit']);\n\t\t\t$query['query']['hitsPerPage'] = $options['limit'];\n\t\t}\n\t\t\n\t\t$query['terms'] = trim($query['terms']);\n\t\tif (isset($query['query']['numericFilters'])) {\n\t\t\t$query['query']['numericFilters'] = implode(',', $query['query']['numericFilters']);\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$response = $this->getIndex()->search(array_get($query, 'terms'), array_get($query, 'query'));\n\t\t\t$this->stored_query_totals[md5(serialize($original_query))] = array_get($response, 'nbHits');\n\t\t} catch (\\Exception $e) {\n\t\t\t$response = array();\n\t\t}\n\t\t\n\t\t$results = array();\n\t\t\n\t\tif (array_get($response, 'hits')) {\n\t\t\tforeach (array_get($response, 'hits') as $hit) {\n\t\t\t\t$hit['id'] = array_get($hit, 'objectID');\n\t\t\t\t$hit['_score'] = 1;\n\t\t\t\t$results[] = $hit;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $results;\n\t}",
"public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }",
"protected function getSearchQueryOptions() {\n // Query options.\n $query_options = $this->query->getOptions();\n\n $parse_mode = $this->query->getParseMode();\n\n // Index fields.\n $index_fields = $this->index->getFields();\n\n // Range.\n $query_offset = empty($query_options['offset']) ? 0 : $query_options['offset'];\n $query_limit = empty($query_options['limit']) ? 10 : $query_options['limit'];\n\n // Query string.\n $query_search_string = NULL;\n\n // Query filter.\n $query_search_filter = NULL;\n\n // Full text search.\n $keys = $this->query->getKeys();\n if (!empty($keys)) {\n if (is_string($keys)) {\n $keys = [$keys];\n }\n\n // Full text fields in which to perform the search.\n $query_full_text_fields = $this->index->getFulltextFields();\n $query_fields = array();\n foreach ($query_full_text_fields as $full_text_field_name) {\n $full_text_field = $index_fields[$full_text_field_name];\n $query_fields[] = $full_text_field->getFieldIdentifier() . '^' . $full_text_field->getBoost();\n }\n\n // Query string.\n $search_string = $this->flattenKeys($keys, $parse_mode);\n\n if (!empty($search_string)) {\n $query_search_string = ['query_string' => []];\n $query_search_string['query_string']['query'] = $search_string;\n $query_search_string['query_string']['fields'] = $query_fields;\n $query_search_string['query_string']['default_operator'] = 'OR';\n }\n }\n\n $sort = NULL;\n // Sort.\n try {\n $sort = $this->getSortSearchQuery();\n }\n catch (ElasticsearchException $e) {\n watchdog_exception('Elasticsearch Search API', $e);\n drupal_set_message($e->getMessage(), 'error');\n }\n\n // Filters.\n try {\n $parsed_query_filters = $this->getQueryFilters(\n $this->query->getConditionGroup(),\n $index_fields\n );\n if (!empty($parsed_query_filters)) {\n $query_search_filter = $parsed_query_filters;\n }\n }\n catch (ElasticsearchException $e) {\n watchdog_exception(\n 'Elasticsearch Search API',\n $e,\n Html::escape($e->getMessage())\n );\n drupal_set_message(Html::escape($e->getMessage()), 'error');\n }\n\n // More Like This.\n $mlt = [];\n if (isset($query_options['search_api_mlt'])) {\n $mlt = $query_options['search_api_mlt'];\n }\n\n return [\n 'query_offset' => $query_offset,\n 'query_limit' => $query_limit,\n 'query_search_string' => $query_search_string,\n 'query_search_filter' => $query_search_filter,\n 'sort' => $sort,\n 'mlt' => $mlt,\n ];\n }",
"public function testApplyOptions()\n {\n $index = new Index();\n $query = new Query($index);\n\n $query->applyOptions([\n 'fields' => ['id', 'name'],\n 'conditions' => [\n 'created >=' => '2013-01-01',\n ],\n 'limit' => 10,\n ]);\n\n $result = [\n '_source' => ['id', 'name'],\n 'size' => 10,\n 'query' => [\n 'bool' => [\n 'filter' => [\n ['bool' => [\n 'must' => [[\n 'range' => [\n 'created' => [\n 'gte' => '2013-01-01',\n ],\n ],\n ]],\n ]],\n ],\n ],\n ],\n ];\n\n $this->assertSame($result, $query->compileQuery()->toArray());\n }",
"public function search()\n {\n $elasticsearch_search = ClientBuilder::create()->build();\n //$client =new ClientBuilder();\n $query = \"data systems\";\n $items = $elasticsearch_search->search([\n 'index' => 'articles',\n 'type' => 'article',\n 'body' => [\n 'query' => [\n 'multi_match' => [\n 'fields' => ['title', 'body'],\n 'query' => $query,\n ],\n ],\n \n ],\n \n 'size' =>100,\n \n ]);\n return $items;\n }",
"function query() {\n // Since attachment views don't validate the exposed input, parse the search\n // expression if required.\n if (!$this->parsed) {\n $this->query_parse_search_expression($this->value);\n }\n $required = FALSE;\n if (!isset($this->search_query)) {\n $required = TRUE;\n }\n else {\n $words = $this->search_query->words();\n if (empty($words)) {\n $required = TRUE;\n }\n }\n if ($required) {\n if ($this->operator == 'required') {\n $this->query->add_where($this->options['group'], 'FALSE');\n }\n }\n else {\n $search_index = $this->ensure_my_table();\n\n $search_condition = db_and();\n\n if (!$this->options['remove_score']) {\n // Create a new join to relate the 'serach_total' table to our current 'search_index' table.\n $join = new views_join;\n $join->construct('search_total', $search_index, 'word', 'word');\n $search_total = $this->query->add_relationship('search_total', $join, $search_index);\n\n $this->search_score = $this->query->add_field('', \"SUM($search_index.score * $search_total.count)\", 'score', array('aggregate' => TRUE));\n }\n\n if (empty($this->query->relationships[$this->relationship])) {\n $base_table = $this->query->base_table;\n }\n else {\n $base_table = $this->query->relationships[$this->relationship]['base'];\n }\n $search_condition->condition(\"$search_index.type\", $base_table);\n if (!$this->search_query->simple()) {\n $search_dataset = $this->query->add_table('search_dataset');\n $conditions = $this->search_query->conditions();\n $condition_conditions =& $conditions->conditions();\n foreach ($condition_conditions as $key => &$condition) {\n // Take sure we just look at real conditions.\n if (is_numeric($key)) {\n // Replace the conditions with the table alias of views.\n $this->search_query->condition_replace_string('d.', \"$search_dataset.\", $condition);\n }\n }\n $search_conditions =& $search_condition->conditions();\n $search_conditions = array_merge($search_conditions, $condition_conditions);\n }\n else {\n // Stores each condition, so and/or on the filter level will still work.\n $or = db_or();\n foreach ($words as $word) {\n $or->condition(\"$search_index.word\", $word);\n }\n\n $search_condition->condition($or);\n }\n\n $this->query->add_where($this->options['group'], $search_condition);\n $this->query->add_groupby(\"$search_index.sid\");\n $matches = $this->search_query->matches();\n $placeholder = $this->placeholder();\n $this->query->add_having_expression($this->options['group'], \"COUNT(*) >= $placeholder\", array($placeholder => $matches));\n }\n // Set to NULL to prevent PDO exception when views object is cached.\n $this->search_query = NULL;\n }",
"public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }",
"public function datagrid($query_debug = FALSE) {\n $page = request('page'); // la página requerida\n $limit = request('rows'); // cuantas filas queremos tener en la grilla\n $sidx = request('sidx'); // obtener la fila indice, es decir la que el usuario clickeó para ordenar\n $sord = request('sord'); // obtener la dirección (asc o desc)\n\n // renombra key búsqueda\n $sidx = !$sidx? $this->get_columns('%s.%s')[0] : $this->get_column_name($sidx); \n \n //filtros para busqueda multiple\n $filters = json_decode(request('filters', ''), true);\n $filters_rules = isset($filters['rules']) ? $filters['rules'] : [];\n $search = request('_search');\n \n //busqueda sin filtros multiples\n if($search == 'true' and empty($filters_rules)) {\n $field = request('searchField');\n $data = call_user_func($this->filter_format, $field, request('searchString'));\n $op = request('searchOper'); \n $this->set_where_rule($field, $op, $data);\n } else if ($search == 'true' and !empty($filters_rules)) { // Busqueda con filtros multiples\n foreach ($filters_rules as $filter_rule) {\n extract($filter_rule);\n $data = call_user_func($this->filter_format, $field, $data);\n $this->set_where_rule($field, $op, $data);\n }\n }\n\n $query_string = $this->get_query_str();\n $count = DB::select(\"SELECT COUNT(*) AS count FROM($query_string) count;\")[0]->count;\n\n if ($count > 0) {\n $total_pages = ceil($count / $limit);\n } else {\n $total_pages = 0;\n }\n if ($page > $total_pages)\n $page = $total_pages;\n $start = $limit * $page - $limit; // no poner $limit*($page - 1)\n \n if($query_debug) DB::enableQueryLog();\n $result = $this->query->orderBy($sidx, $sord)->skip($start)->take($limit)->get();\n\n $response['page'] = $page;\n $response['total'] = $total_pages;\n $response['records'] = $count;\n $response['rows'] = $this->set_response_rows($result);\n\n return $query_debug? $this->get_query_str() : response()->json($response);\n }",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"public function createQuery() {}",
"protected function assembleQueries()\n {\n if ($this->getExecutedFilters()) {\n return $this;\n }\n\n $objectType = $this->getObjectType();\n\n $whereConditions = [];\n\n $mainTable = $this->getEntityService()->getTableName($objectType);\n $pre = 'v2';\n $dqlFilters = [];\n $tables = $this->getEntityService()->getVarOptionTables();\n $bindTypes = [];\n $pdoBindTypes = $this->getEntityService()->getPdoBindTypes();\n $filterable = $this->getFilterable();\n\n $x = 0; //count($this->getFilters()); // for tracking bind types\n\n // handle basic filters eg key=value\n // also, special handling of price range\n $filterParams = [];\n if ($this->getFilters()) {\n foreach($this->getFilters() as $field => $value) {\n foreach($filterable as $filterInfo) {\n if ($field == $filterInfo[CartRepositoryInterface::CODE]) {\n\n // handle special case for numerical ranges\n // eg price=100-199 or subtotal=50-100\n // note : the handling of strpos is very intentional, want an index > 0\n if ($filterInfo[CartRepositoryInterface::DATATYPE] == 'number' && strpos($value, '-')) {\n $rangeValues = explode('-', $value);\n $rangeMin = $rangeValues[0];\n $rangeMax = isset($rangeValues[1]) ? $rangeValues[1] : null;\n if (isset($rangeMax)) {\n\n $rangeMin = (float) $rangeMin;\n $rangeMax = (float) $rangeMax;\n\n // minimum\n $this->addAdvFilter([\n 'field' => $field,\n 'op' => 'gte',\n 'value' => $rangeMin,\n ]);\n\n // maximum\n $this->addAdvFilter([\n 'field' => $field,\n 'op' => 'lt',\n 'value' => $rangeMax,\n ]);\n\n break;\n }\n }\n\n if (isset($filterInfo['join'])) {\n $this->joins[] = $filterInfo['join'];\n $field = $filterInfo['join']['table'] . \".{$field}\";\n } elseif (!is_int(strpos($field, '.'))) {\n $field = \"main.{$field}\";\n }\n\n $whereConditions[] = \"{$field} = ?\";\n $filterParams[] = $value;\n\n switch($filterInfo[CartRepositoryInterface::DATATYPE]) {\n case 'boolean':\n $bindTypes[$x] = \\PDO::PARAM_INT;\n break;\n case 'number':\n // todo : make this better\n $bindTypes[$x] = \\PDO::PARAM_INT;\n break;\n case 'string':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n case 'date':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n default:\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n }\n\n $x++;\n break;\n }\n }\n }\n }\n\n // handle fulltext search first\n\n // note : use setFulltextIds() if you search somewhere else first eg SOLR / Elasticsearch\n if ($this->getFulltextIds()) {\n // ensure IDs are sanitized before you set them\n $whereConditions[] = \"main.id in (\" . implode(',', $this->getFulltextIds()) . \")\";\n } else if ($this->getQuery()\n && $this->getSearchField()\n && $this->getSearchMethod()) {\n\n if (is_array($this->getSearchField())) {\n if (count($this->getSearchField()) > 1) {\n\n $cond = '';\n foreach($this->getSearchField() as $searchField) {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n\n $tbl = 'main';\n\n if (is_array($searchField)) {\n if (isset($searchField['table']) && isset($searchField['column'])) {\n $tbl = $searchField['table'];\n $searchField = $searchField['column'];\n } else {\n continue;\n }\n }\n\n // cond is empty, add a leading parentheses\n if (!$cond) {\n $cond .= \"({$tbl}.{$searchField} like ?\";\n } else {\n $cond .= \" OR {$tbl}.{$searchField} like ?\";\n }\n $x++;\n }\n $cond .= ')';\n $whereConditions[] = $cond;\n } else {\n\n $fields = $this->getSearchField();\n $searchField = $fields[0];\n if (is_array($searchField)) {\n if (isset($searchField['table']) && isset($searchField['column'])) {\n $tbl = $searchField['table'];\n $searchField = $searchField['column'];\n\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"{$tbl}.{$searchField} like ?\";\n $x++;\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"main.{$searchField} like ?\";\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"main.{$this->getSearchField()} like ?\";\n $x++;\n }\n }\n\n // handle \"advanced\" filters\n // eg filter_field[x], filter_op[x], filter_val[x]\n // specifies a field, value, and operator ie (id > 100)\n $advFilterParams = [];\n if ($this->getAdvFilters()) {\n foreach($this->getAdvFilters() as $advFilter) {\n\n $field = $advFilter['field'];\n $op = $advFilter['op'];\n $value = $advFilter['value'];\n $table = isset($advFilter['table'])\n ? $advFilter['table']\n : 'main';\n\n $found = false;\n foreach($filterable as $filterInfo) {\n if ($field == $filterInfo[CartRepositoryInterface::CODE]) {\n $found = true;\n\n switch($filterInfo[CartRepositoryInterface::DATATYPE]) {\n case 'boolean':\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n break;\n case 'number':\n if ($op == 'in') {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n if ($value) {\n foreach($value as $dummy) {\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n }\n break;\n case 'string':\n if ($op == 'in') {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n if ($value) {\n foreach($value as $dummy) {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n }\n\n break;\n case 'date':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n break;\n default:\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n break;\n }\n\n\n break;\n }\n }\n\n if (!$found || !in_array($op, ['contains', 'starts', 'ends', 'equals', 'gt', 'gte', 'lt', 'lte', 'in'])) {\n continue;\n }\n\n // example:\n // $and->add($qb->expr()->eq('u.id', 1));\n\n switch($op) {\n case 'contains':\n $advFilterParams[] = '%'. $value . '%';\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'starts':\n $advFilterParams[] = $value . '%';\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'ends':\n $advFilterParams[] = '%'. $value;\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'equals':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} = ?\";\n break;\n case 'notequal':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} != ?\";\n break;\n// todo: this is messing up the counter, but it should be implemented\n// case 'null':\n// $advFilterParams[] = 'NULL';\n// $whereConditions[] = \"{$table}.{$field} IS ?\";\n// break;\n// case 'notnull':\n// $advFilterParams[] = $value;\n// $whereConditions[] = \"{$table}.{$field} IS NOT NULL\";\n// break;\n case 'gt':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} > ?\";\n break;\n case 'gte':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} >= ?\";\n break;\n case 'lt':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} < ?\";\n break;\n case 'lte':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} <= ?\";\n break;\n case 'in':\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n\n if ($value) {\n foreach($value as $val) {\n $advFilterParams[] = $val;\n }\n $paramStr = implode(',', $value);\n $whereConditions[] = \"{$table}.{$field} in ({$paramStr})\";\n }\n\n break;\n default:\n\n break;\n }\n }\n }\n\n // handle category filter with products\n if ($this->getCategoryId()\n && $this->getObjectType() == EntityConstants::PRODUCT) {\n\n $categoryTable = $this->getEntityService()->getTableName(EntityConstants::CATEGORY_PRODUCT);\n $bindTypes[$x] = \\PDO::PARAM_INT;\n // todo : sometime in the future , add a category 'anchor', connecting multiple categories\n $whereConditions[] = \"main.id in (select product_id from {$categoryTable} where category_id = ?)\";\n $x++;\n }\n\n // handle stock, visibility filters with products\n\n\n // handle facet filters\n // ie filters on EAV tables, child tables\n $facetFilterParams = [];\n if ($this->getFacetFilters()) {\n foreach($this->getFacetFilters() as $facetCode => $value) {\n\n $itemVar = $this->getVarByCode($facetCode);\n\n $tblValue = $objectType . '_' . EntityConstants::getVarDatatype($itemVar->getDatatype());\n $values = explode($this->valueSep, $value);\n $joinTbl = $tables[$itemVar->getDatatype()];\n $joinTblPre = 'ivo';\n\n if (count($values) > 1) {\n $conditions = [];\n foreach($values as $itemVarValue) {\n $conditions[] = \"({$pre}.value = ? OR {$joinTblPre}.url_value = ?)\";\n $facetFilterParams[] = $itemVarValue;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n }\n $dqlFilters[] = \"({$pre}.item_var_id={$itemVar->getId()} AND (\".implode(' OR ', $conditions).\"))\";\n } else {\n $dqlFilters[] = \"({$pre}.item_var_id={$itemVar->getId()} AND ({$pre}.value = ? OR {$joinTblPre}.url_value = ?))\";\n $facetFilterParams[] = $value;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n }\n\n $whereConditions[] = \"main.id in (select parent_id from {$tblValue} {$pre} left join {$joinTbl} {$joinTblPre} on {$pre}.item_var_option_id={$joinTblPre}.id where \". implode(' AND ', $dqlFilters).\")\";\n $dqlFilters = [];\n\n }\n }\n\n // assemble where conditions\n $conditionsSql = implode(' AND ', $whereConditions);\n if (!$conditionsSql) {\n $conditionsSql = '1=1';\n }\n\n // assemble group by\n $groupSql = $this->getGroupBy()\n ? 'group by ' . implode(', ', $this->getGroupBy())\n : '';\n\n // assemble select columns\n $colSql = '';\n if ($this->getColumns()) {\n $cols = [];\n foreach($this->getColumns() as $colData) {\n // add select\n $select = $colData['select'];\n $alias = $colData['alias'];\n if ($alias) {\n $select .= \" as {$alias}\";\n }\n\n $cols[] = $select;\n }\n $colSql = ',' . implode(',', $cols);\n }\n\n // assemble joins\n $joinSql = '';\n if ($this->getJoins()) {\n $joins = [];\n foreach($this->getJoins() as $join) {\n $type = $join['type'];\n $table = $join['table'];\n $column = $join['column'];\n $joinAlias = $join['join_alias'];\n $joinColumn = $join['join_column'];\n $joins[] = \"{$type} join {$table} on {$joinAlias}.{$joinColumn}={$table}.{$column}\";\n }\n $joinSql = implode(' ', $joins);\n }\n\n // main data query without sorting and grouping\n $this->filtersSql = \"select distinct(main.id) from {$mainTable} main {$joinSql} where {$conditionsSql}\";\n // main data query\n $this->mainSql = \"select distinct(main.id), main.* {$colSql} from {$mainTable} main {$joinSql} where {$conditionsSql} {$groupSql}\";\n // main count query, for all rows, not just the current page\n $this->countSql = \"select count(distinct(main.id)) as count from {$mainTable} main {$joinSql} where {$conditionsSql} {$groupSql}\";\n $this->bindTypes = $bindTypes;\n $this->filterParams = $filterParams;\n $this->advFilterParams = $advFilterParams;\n $this->facetFilterParams = $facetFilterParams;\n\n $this->setExecutedFilters(true);\n return $this;\n }",
"private function query() {\n\t\t$indexables_to_create = [];\n\t\tif ( ! $this->indexable_repository->find_for_system_page( '404', false ) ) {\n\t\t\t$indexables_to_create['404'] = true;\n\t\t}\n\n\t\tif ( ! $this->indexable_repository->find_for_system_page( 'search-result', false ) ) {\n\t\t\t$indexables_to_create['search'] = true;\n\t\t}\n\n\t\tif ( ! $this->indexable_repository->find_for_date_archive( false ) ) {\n\t\t\t$indexables_to_create['date_archive'] = true;\n\t\t}\n\n\t\t$need_home_page_indexable = ( (int) \\get_option( 'page_on_front' ) === 0 && \\get_option( 'show_on_front' ) === 'posts' );\n\n\t\tif ( $need_home_page_indexable && ! $this->indexable_repository->find_for_home_page( false ) ) {\n\t\t\t$indexables_to_create['home_page'] = true;\n\t\t}\n\n\t\treturn $indexables_to_create;\n\t}",
"private function set_query_components() {\n\t\n\t\t$start = (($this->page-1) * $this->rp);\n\t\t\n\t\tif($this->query) {\n\t\t\t$this->query_components['where'] = \" WHERE $qtype LIKE '%\".mysql_real_escape_string($query).\"%' \";\n\t\t}\n\t\telse {\n\t\t\t$this->query_componenets['where'] = \"\";\n\t\t}\n\t\t\n\t\t$this->query_components['sort'] = \"ORDER BY {$this->sortname} {$this->sortorder}\";\n\t\t$this->query_components['limit'] = \"LIMIT $start, {$this->rp}\";\n\t}",
"protected function buildSearchQuery(SearchApiQueryInterface $query) {\n // Query options.\n $query_options = $this->getSearchQueryOptions($query);\n\n // Main query.\n $params = $query->getOption('ElasticParams');\n $body = &$params['body'];\n\n // Set the size and from parameters.\n $body['from'] = $query_options['query_offset'];\n $body['size'] = $query_options['query_limit'];\n\n // Sort\n if (!empty($query_options['sort'])) {\n $body['sort'] = $query_options['sort'];\n }\n\n $body['fields'] = array();\n $fields = &$body['fields'];\n\n // Handle spellcheck if enabled\n $this->buildSpellcheckQuery($query, $params);\n\n /**\n * $query_options['spatials']:\n * - field: The Search API field identifier of the location field. Must be indexed\n * as type \"location\".\n * - lat: The latitude of the point on which this location parameter is centered.\n * - lon: The longitude of that point.\n * - radius: (optional) If results should be filtered according to their distance\n * to the point, the maximum distance at which a point should be included (in\n * kilometers).\n * - method: (optional) The method to use for filtering. This is backend-specific\n * and not guaranteed to have an effect. Service classes should ignore values of\n * this option which they don't recognize.\n */\n // Search API Location support.\n if (!empty($query_options['spatials'])) {\n foreach ($query_options['spatials'] as $i => $spatial) {\n if (empty($spatial['field']) || empty($spatial['lat']) || empty($spatial['lon'])) {\n continue;\n }\n\n // Shortcut to easily reuse the field and point.\n $field = $spatial['field'];\n $point = array(\n 'lat' => (float) $spatial['lat'],\n 'lon' => (float) $spatial['lon'],\n );\n\n // Prepare the filter settings.\n if (isset($spatial['radius'])) {\n $radius = (float) $spatial['radius'];\n }\n\n // TODO: Implement the other geo filter types.\n // TODO: Implement the functionality to have multiple filters together\n // with the geo filters.\n\n // // Geo bounding box filter.\n // $query_options['query_search_filter'] = array(\n // 'geo_bounding_box' => array(\n // $spatial['field'] => array(\n // 'top_left' => array(\n // 'lat' => '',\n // 'lon' => '',\n // ),\n // 'bottom_right' => array(\n // 'lat' => '',\n // 'lon' => '',\n // ),\n // ),\n // ),\n // );\n\n // Geo Distance filter.\n $geo_distance_filter = array(\n 'geo_distance' => array(\n 'distance' => $radius . 'km',\n $spatial['field'] => $point,\n ),\n );\n\n if (!empty($query_options['query_search_filter'])) {\n $query_options['query_search_filter'] = array(\n 'and' => array(\n $query_options['query_search_filter'],\n $geo_distance_filter\n ),\n );\n } else {\n $query_options['query_search_filter'] = $geo_distance_filter;\n }\n\n // // Geo distance range filter.\n // $query_options['query_search_filter'] = array(\n // 'geo_distance_range' => array(\n // 'from' => '',\n // 'to' => '',\n // $spatial['field'] => $point,\n // ),\n // );\n\n // // Geo polygon filter.\n // $query_options['query_search_filter'] = array(\n // 'geo_polygon' => array(\n // $spatial['field'] => array(\n // 'points' => array(),\n // ),\n // ),\n // );\n\n // // Geoshape filter.\n // $query_options['query_search_filter'] = array(\n // 'geo_shape' => array(\n // $spatial['field'] => array(\n // 'shape' => array(\n // 'type' => 'envelope',\n // 'coordinates' => array(),\n // ),\n // ),\n // ),\n // );\n\n // // Geohash cell filter.\n // $query_options['query_search_filter'] = array(\n // 'geohash_cell' => array(\n // $spatial['field'] => $point,\n // 'precision' => '',\n // 'neighbors' => '',\n // ),\n // );\n }\n }\n\n // Build the query.\n if (!empty($query_options['query_search']) && !empty($query_options['query_search_filter'])) {\n $body['query']['filtered']['query'] = $query_options['query_search'];\n $body['query']['filtered']['filter'] = $query_options['query_search_filter'];\n }\n elseif (!empty($query_options['query_search'])) {\n if (empty($body['query'])) {\n $body['query'] = array();\n }\n $body['query'] += $query_options['query_search'];\n }\n elseif (!empty($query_options['query_search_filter'])) {\n $body['filter'] = $query_options['query_search_filter'];\n }\n\n // TODO: Handle fields on filter query.\n if (empty($fields)) {\n unset($body['fields']);\n }\n\n if (empty($body['filter'])) {\n unset($body['filter']);\n }\n\n if (empty($query_body)) {\n $query_body['match_all'] = array();\n }\n\n // Preserve the options for futher manipulation if necessary.\n $query->setOption('ElasticParams', $params);\n return $params;\n }",
"public function getQuery()\n {\n // if it's a simple query/filter there is no need to create a bool query\n if ((count($this->must) + count($this->should)) === 1) {\n $a = array_merge($this->must, $this->should);\n return array_shift($a);\n }\n\n // required conditions (AND)\n if (!empty($this->must)) {\n $this->query['bool']['must'] = $this->must;\n }\n\n // optional conditions (OR)\n if (!empty($this->should)) {\n $this->query['bool']['should'] = $this->should;\n $this->query['bool']['minimum_should_match'] = $this->minimumShouldMatch;\n }\n\n return $this->query;\n }",
"function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }",
"function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }",
"function query() {\n }",
"public function createDefaultSearchQuery()\n {\n $qB = SearchEngine::getElasticaQueryBuilder();\n\n $keyword = Utility::convertArrayToString($this->searchEvent->getKeyword());\n $where = $this->searchEvent->getWhere();\n\n $keywordQuery = null;\n $whereQuery = null;\n $content = 0;\n if ($where) {\n if ($geoDistance = $this->container->get(\"nearby.handler\")->getGeoDistanceInfoByWhere()) {\n $whereQuery = $qB->query()->bool();\n $whereQuery->addShould(\n $qB->query()->match()->setFieldQuery(\"searchInfo.location\",$where)\n ->setFieldType(\"searchInfo.location\", \"phrase\")\n ->setFieldBoost(\"searchInfo.location\", 2)\n ->setFieldParam('searchInfo.location', 'slop', 30)\n );\n $whereQuery->addShould(\n $qB->query()->geo_distance(\n 'geoLocation',\n [\n 'lat' => $geoDistance['latitude'],\n 'lon' => $geoDistance['longitude'],\n ],\n $geoDistance['radius'])\n );\n $content |= 1;\n } else {\n $whereQuery = $qB->query()->match()->setFieldQuery('searchInfo.location',$where)\n ->setFieldType('searchInfo.location', 'phrase')\n ->setFieldParam('searchInfo.location', 'slop', 30);\n $content |= 1;\n }\n }\n\n if ($keyword) {\n $keywordQuery = $qB->query()->multi_match();\n\n $keywordQuery->setQuery($keyword)\n ->setTieBreaker(0.3)\n ->setOperator(\"and\")\n ->setFields([\n 'friendlyUrl^500',\n 'title.raw^200',\n 'title.analyzed^10',\n 'description^5',\n 'searchInfo.keyword^1',\n 'searchInfo.location^1',\n ]);\n\n $content |= 2;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_setup_query\", [\n \"content\" => &$content,\n \"whereQuery\" => &$whereQuery,\n \"keywordQuery\" => &$keywordQuery\n ]);\n\n switch ($content) {\n case 1:\n $query = $whereQuery;\n break;\n case 2:\n $query = $keywordQuery;\n break;\n case 3:\n $query = $qB->query()->bool();\n $query->addMust($keywordQuery);\n $query->addMust($whereQuery);\n break;\n default:\n $query = $qB->query()->match_all();\n break;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_return_query\", [\n \"query\" => &$query,\n ]);\n\n return $query;\n }",
"public function queryEntity($options = array())\n {\n $columns = &$this->columns;\n\n $em = $this->_em;\n $qb = $em->getRepository('BookingBundle:Casa')\n ->createQueryBuilder('a')\n ->distinct(true)\n ->select('a');\n\n if (array_key_exists('sSearch',$options)) {\n if ($options['sSearch'] != '') {\n $qb->andWhere(new Orx(\n\n /**\n * @return array\n */\n call_user_func( function() use ($columns,$qb,$options){\n\n $aLike = array();\n\n foreach ($columns as $col) {\n\n $aLike[] = $qb->expr()->like('a.'.$col, '\\'%' . $options['sSearch'] . '%\\'');\n }\n\n return $aLike;\n })\n \n ));\n }\n }\n\n if ( isset( $options['iDisplayStart'] ) && $options['iDisplayLength'] != '-1' ){\n $qb->setFirstResult( (int)$options['iDisplayStart'] )\n ->setMaxResults( (int)$options['iDisplayLength'] );\n }\n\n\n if (array_key_exists('iDisplayLength',$options)) {\n if ($options['iDisplayLength']!='') {\n $qb->setMaxResults($options['iDisplayLength']);\n }\n }\n\n $result = $qb->getQuery()->getResult();\n $dataExport = array();\n\n foreach ($result as $r) {\n /**\n * @var Casa $r\n * */\n\n $dataHouse = $r->toArray();\n $dataHouse[4]=$this->isAvailable($r);\n array_push($dataExport, $dataHouse);\n }\n\n\n\n\n\n return $dataExport;\n\n }",
"function display_elastic_search ($q, $filter=null, $from = 0, $size = 20, $callback = '')\n{\n\tglobal $elastic;\n\t\n\t$status = 404;\n\t\t\t\t\n\tif ($q == '')\n\t{\n\t\t$obj = new stdclass;\n\t\t$obj->hits = new stdclass;\n\t\t$obj->hits->total = 0;\n\t\t$obj->hits->hits = array();\n\t\t\n\t\t$status = 200;\n\t}\n\telse\n\t{\t\t\n\t\t// query type\t\t\n\t\t$query_json = '';\n\t\t\n\t\tif ($filter)\n\t\t{\n\t\t\tif (isset($filter->author))\n\t\t\t{\n\t\t\t\t// author search is different( but not working yet)\t\n\t\t\t\t$query_json = \t\t\n\t'{\n\t\"size\":50,\n \"query\": {\n \"bool\": {\n \"must\": [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.author\"] \n\t\t\t\t}\n\t\t\t\t}]\n }\n }\n\t}';\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t\t\n\t\t\t// echo $query_json;\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// default is search on fulltext fields\n\t\tif ($query_json == '')\n\t\t{\n\t\t\t$query_json = '{\n\t\t\t\"size\":50,\n\t\t\t\t\"query\": {\n\t\t\t\t\t\"bool\" : {\n\t\t\t\t\t\t\"must\" : [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.fulltext\", \"search_data.fulltext_boosted^4\"] \n\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\"filter\": <FILTER>\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"aggs\": {\n\t\t\t\"type\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.type.keyword\" }\n\t\t\t },\n\t\t\t \"year\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.year\" }\n\t\t\t },\n\t\t\t \"container\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.container.keyword\" }\n\t\t\t },\n\t\t\t \"author\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.author.keyword\" }\n\t\t\t },\n\t\t\t \"classification\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.classification.keyword\" }\n\t\t\t } \n\n\t\t\t}\n\n\t\n\t\t\t}';\n\t\t\t\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t}\n\t\n\t$filter_string = '[]';\n\t\n\tif ($filter)\n\t{\n\t\t$f = array();\n\t\t\n\t\tif (isset($filter->year))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.year'} = $filter->year;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\n\t\t// this doesn't work\n\t\tif (isset($filter->author))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.author'} = $filter->author;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\t\t\n\t\t$filter_string = json_encode($f);\n\t}\n\t\n\t$query_json = str_replace('<FILTER>', $filter_string, $query_json);\n\t\n\t\n\t$resp = $elastic->send('POST', '_search?pretty', $post_data = $query_json);\n\t\n\n\t\t$obj = json_decode($resp);\n\n\t\t$status = 200;\n\t}\n\t\n\tapi_output($obj, $callback, 200);\n}",
"public function simpleQuery($command,$collection,$query=NULL,$data=NULL,$param=NULL){\n $jdata=array();\n switch (strtolower($command)) {\n case 'by-example-skiplist':{\n $jdata['collection']=$collection;\n if($query!=NULL) $jdata['example']=$query; else return (array(\"error\"=>\"Example Query is required\"));\n if(isset($param['index'])) $jdata['index']=$param['index']; else return (array(\"error\"=>\"Index must be exist of SkipList type\"));\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n break;\n }\n case 'by-condition-skiplist':{\n $jdata['collection']=$collection;\n if($query!=NULL) $jdata['condition']=$query; else return (array(\"error\"=>\"Condition Query is required\"));\n if(isset($param['index'])) $jdata['index']=$param['index']; else return (array(\"error\"=>\"Index must be exist of SkipList type\"));\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n break;\n }\n case 'all':{\n $jdata['collection']=$collection;\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n break;\n }\n case 'any':{\n $jdata['collection']=$collection;\n break;\n }\n case 'near':{\n $jdata['collection']=$collection;\n if(isset($param['latitude'])) $jdata['latitude']=$para['latitude']; else return (array(\"error\"=>\"Latitude is required\"));\n if(isset($param['longitude'])) $jdata['longitude']=$param['longitude']; else return (array(\"error\"=>\"Longitude is required\"));\n if(isset($param['distance'])) $jada['distance']=$param['distance'];\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n if(isset($param['geo'])) $jada['geo']=$param['geo'];\n break;\n }\n case 'within':{\n $jdata['collection']=$collection;\n if(isset($param['latitude'])) $jdata['latitude']=$para['latitude']; else return (array(\"error\"=>\"Latitude is required\"));\n if(isset($param['longitude'])) $jdata['longitude']=$param['longitude']; else return (array(\"error\"=>\"Longitude is required\"));\n if(isset($param['radius'])) $jdata['radius']=$param['radius']; else return (array(\"error\"=>\"Radius is required\"));\n if(isset($param['distance'])) $jada['distance']=$param['distance'];\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n if(isset($param['geo'])) $jada['geo']=$param['geo'];\n break;\n }\n case 'within-rectangle':{\n $jdata['collection']=$collection;\n if(isset($param['latitude1'])) $jdata['latitude1']=$para['latitude1']; else return (array(\"error\"=>\"Latitude is required\"));\n if(isset($param['longitude1'])) $jdata['longitude1']=$param['longitude1']; else return (array(\"error\"=>\"Longitude is required\"));\n if(isset($param['latitude2'])) $jdata['latitude2']=$para['latitude2']; else return (array(\"error\"=>\"Latitude is required\"));\n if(isset($param['longitude2'])) $jdata['longitude2']=$param['longitude2']; else return (array(\"error\"=>\"Longitude is required\"));\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n if(isset($param['geo'])) $jada['geo']=$param['geo'];\n break;\n }\n case 'fulltext':{\n $jdata['collection']=$collection;\n if($query!=NULL) $jdata['query']=$query; else return (array(\"error\"=>\"Query is required\"));\n if(isset($param['attribute'])) $jdata['attribute']=$para['attribute']; else return (array(\"error\"=>\"Attribute is required\"));\n if(isset($param['index'])) $jdata['index']=$param['index']; else return (array(\"error\"=>\"Index is required\"));\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n break;\n }\n case 'by-example':{\n $jdata['collection']=$collection;\n if($query!=NULL) $jdata['example']=$query; else return (array(\"error\"=>\"Example Query is required\"));\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n break;\n }\n case 'first-example':{\n $jdata['collection']=$collection;\n if($query!=NULL) $jdata['example']=$query; else return (array(\"error\"=>\"Example Query is required\"));\n break;\n }\n case 'first':{\n $jdata['collection']=$collection;\n if(isset($param['count'])) $jdata['count']=$param['count']; else $jdata['count']=1;\n break;\n }\n case 'last':{\n $jdata['collection']=$collection;\n if(isset($param['count'])) $jdata['count']=$param['count'];\n break;\n }\n case 'range':{\n $jdata['collection']=$collection;\n if(isset($param['attribute'])) $jdata['attribute']=$para['attribute']; else return (array(\"error\"=>\"Attribute is required\"));\n if(isset($param['left'])) $jdata['left']=$param['left']; else return (array(\"error\"=>\"Left is required\"));\n if(isset($param['right'])) $jdata['rigt']=$para['right']; else return (array(\"error\"=>\"Right is required\"));\n if(isset($param['closed'])) $jdata['closed']=$param['closed']; else return (array(\"error\"=>\"Closed is required\"));\n if(isset($param['skip'])) $jada['skip']=$param['skip'];\n if(isset($param['limit']) and isset($param['skip'])) $jada['limit']=$param['limit'];\n if(isset($param['geo'])) $jada['geo']=$param['geo'];\n break;\n }\n case 'remove-by-example':{\n $jdata['collection']=$collection;\n $option=array();\n if($query!=NULL) $jdata['example']=$query; else return (array(\"error\"=>\"Example Query is required\"));\n if(isset($param['waitForSync'])) $option['waitForSync']=$param['waitForSync'];\n if(isset($param['limit'])) $option['limit']=$param['limit'];\n $jdata['options']=$option;\n break;\n }\n case 'replace-by-example':{\n $jdata['collection']=$collection;\n $option=array();\n if($query!=NULL) $jdata['example']=$query; else return (array(\"error\"=>\"Example Query is required\"));\n if($data!=NULL) $jdata['newValue']=$data; else return (array(\"error\"=>\"NewValue is required\"));\n if(isset($param['waitForSync'])) $option['waitForSync']=$param['waitForSync'];\n if(isset($param['limit'])) $option['limit']=$param['limit'];\n $jdata['options']=$option;\n break;\n }\n case 'update-by-example':{\n $jdata['collection']=$collection;\n $option=array();\n if($query!=NULL) $jdata['example']=$query; else return (array(\"error\"=>\"Example Query is required\"));\n if($data!=NULL) $jdata['newValue']=$data; else return (array(\"error\"=>\"NewValue is required\"));\n if(isset($param['keepNull'])) $option['keepNull']=$param['keepNull'];\n if(isset($param['waitForSync'])) $option['waitForSync']=$param['waitForSync'];\n if(isset($param['limit'])) $option['limit']=$param['limit'];\n $jdata['options']=$option;\n break;\n }\n case 'remove-by-keys': case 'lookup-by-keys':{\n if($query!=NULL) $jdata['keys']=$query; else return (array(\"error\"=>\"Example Query is required\"));\n $jdata['collection']=$collection;\n break;\n }\n }\n $response=$this->put('simple/'.strtolower($command),$jdata,'json');\n $cursor=$response->json;\n if(isset($cursor['count'])) $this->count=$cursor['count'];\n if(isset($cursor['count'])) if($cursor['hasMore']==true){ $this->cursor_id=$cursor['id']; $this->hasMore=$cursor['hasMore']; }\n return $response;\n }"
] |
[
"0.69548965",
"0.6303724",
"0.62315387",
"0.6170522",
"0.6113031",
"0.60928065",
"0.60184187",
"0.59803873",
"0.59728473",
"0.59689045",
"0.58549064",
"0.5819524",
"0.5791809",
"0.5708326",
"0.56649166",
"0.56649166",
"0.56649166",
"0.56638473",
"0.5636405",
"0.5580414",
"0.5575529",
"0.5572927",
"0.55114144",
"0.5509439",
"0.5505729",
"0.5504715",
"0.5492794",
"0.5462212",
"0.54599696",
"0.5453291"
] |
0.74622375
|
0
|
Dump the raw elastic search result and end the script
|
public function dump()
{
$this->composeQuery();
$result = $this->connection->client()->search($this->queryBody);
dd($result);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function execute() {\n\t\t$result = [\n\t\t\t'success' => false,\n\t\t\t'errorMessage' => '',\n\t\t];\n\t\t$options = $this->getRequest()->getParams();\n\t\ttry {\n\t\t\t$response = $this->clientResolver->create(\"elasticsearch7\", $options)->testConnection();\n\t\t\tif ($response) {\n\t\t\t\t$result['success'] = true;\n\t\t\t\t$url = \"{$options['hostname']}:{$options['port']}\";\n\t\t\t\t$this->curl->get($url);\n\t\t\t\t$result['html'] = $this->curl->getBody();\n\t\t\t}\n\t\t} catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n\t\t\t$result['errorMessage'] = $e->getMessage();\n\t\t} catch (\\Exception $e) {\n\t\t\t$message = __($e->getMessage());\n\t\t\t$result['errorMessage'] = $this->tagFilter->filter($message);\n\t\t}\n\n\t\t/** @var \\Magento\\Framework\\Controller\\Result\\Json $resultJson */\n\t\t$resultJson = $this->resultJsonFactory->create();\n\t\treturn $resultJson->setData($result);\n\t}",
"public function execute() {\n\t\t$data = $this->getResultData();\n\t\t$this->printText($data[0]);\n\t}",
"function main(){\r\n\r\n\r\n /*$index='texas-30001-player';\r\n $type= 'player';\r\n $stime= \"2018-05-01 00:00:00\";\r\n $etime= \"2018-05-08 00:00:00\";\r\n $groupOp = 'AND';\r\n\r\n $querydata = [\r\n [\r\n \"op\"=>\"eq\",\r\n \"field\"=>\"ActionName\",\r\n \"data\"=>\"player.gain\"\r\n ],\r\n [\r\n \"op\"=>\"eq\",\r\n \"field\"=>\"type\",\r\n \"data\"=>\"gold\"\r\n ],\r\n [\r\n \"op\"=>\"ew\",\r\n \"field\"=>\"num\",\r\n \"data\"=>10000\r\n ]\r\n ];\r\n\r\n $ins = \\Pelasticsearch\\Pelasticsearch::Getins();\r\n $ins->init($index,$type,$stime,$etime);\r\n $data = $ins->multipleQuery(0,100,$groupOp,$querydata);\r\n\r\n echo '<pre>';\r\n print_r($data);\r\n echo '</pre>';*/\r\n\r\n\r\n /*$index='texas-30001-player';\r\n $type= 'player';\r\n $body = [\r\n \"fieldname\"=>\"fielddata\"\r\n ];\r\n $ins = \\Pelasticsearch\\Pelasticsearch::Getins();\r\n $ins->init($index,$type);\r\n $data = $ins->Add($body);\r\n\r\n\r\n echo '<pre>';\r\n print_r($data);\r\n echo '</pre>';*/\r\n\r\n /*$index='texas-30001-player';\r\n $type= 'my_type';\r\n $id = 'my_id';\r\n $ins = \\Pelasticsearch\\Pelasticsearch::Getins();\r\n $ins->init($index,$type);\r\n $data = $ins->Delete($id);\r\n\r\n echo '<pre>';\r\n print_r($data);\r\n echo '</pre>';*/\r\n\r\n\r\n\r\n}",
"public function execute()\n\t{\n\t\t$searchQuery = $this->searchPhrase ? '\"' . $this->searchPhrase . '\"' : '';\n\t\t$queryParams['attributesToRetrieve']\t= '*';\n\t\t$queryParams['maxValuesPerFacet']\t\t= '100';\n\t\t$queryParams['attributesToHighlight']\t= array();\n\t\t$queryParams['filters']\t\t\t\t\t= $this->filters;\n\t\t$queryParams['facetFilters']\t\t\t= $this->facetFilters;\n\t\t$queryParams['offset']\t\t\t\t\t= $this->start;\n\t\t$queryParams['length']\t\t\t\t\t= $this->limit;\n\n\t\t$queryParams['facets']\t\t\t\t\t= array($this->facetField);\n\n\t\t// We need to pass this query by setRawQueryParams for advsearch frontent.\n\t\t$queryParams['advancedSyntax']\t\t\t= 'true';\n\n\t\tif (count($this->rawQueryParams))\n\t\t{\n\t\t\t$queryParams = array_merge($queryParams, $this->rawQueryParams);\n\t\t}\n\n\t\t// This is something Juggad related to Osianama requirement.\n\t\tif (isset($queryParams['restrictSearchableAttributes']))\n\t\t{\n\t\t\t$searchQuery = $this->searchPhrase ? $this->searchPhrase : '';\n\t\t}\n\n\t\t$Data = $this->algoliaIndex->search($searchQuery, $queryParams);\n\n\t\tif (count($Data['hits']) > 0)\n\t\t{\n\t\t\t$this->total\t= $Data['nbHits'];\n\t\t\t$this->count\t= $Data['hitsPerPage'];\n\t\t\t$this->records\t= '';\n\n\t\t\tforeach ($Data['hits'] as $key => $row)\n\t\t\t{\n\t\t\t\tunset($row['_highlightResult']);\n\n\t\t\t\t$row['id']\t\t\t\t\t\t= $row['objectID'];\n\t\t\t\t$this->records['data'][$key]\t= (object) $row;\n\t\t\t}\n\n\t\t\tif ($this->facetField)\n\t\t\t{\n\t\t\t\t$this->records['facets'] = $Data['facets'];\n\t\t\t}\n\t\t}\n\t}",
"function display_elastic_search ($q, $filter=null, $from = 0, $size = 20, $callback = '')\n{\n\tglobal $elastic;\n\t\n\t$status = 404;\n\t\t\t\t\n\tif ($q == '')\n\t{\n\t\t$obj = new stdclass;\n\t\t$obj->hits = new stdclass;\n\t\t$obj->hits->total = 0;\n\t\t$obj->hits->hits = array();\n\t\t\n\t\t$status = 200;\n\t}\n\telse\n\t{\t\t\n\t\t// query type\t\t\n\t\t$query_json = '';\n\t\t\n\t\tif ($filter)\n\t\t{\n\t\t\tif (isset($filter->author))\n\t\t\t{\n\t\t\t\t// author search is different( but not working yet)\t\n\t\t\t\t$query_json = \t\t\n\t'{\n\t\"size\":50,\n \"query\": {\n \"bool\": {\n \"must\": [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.author\"] \n\t\t\t\t}\n\t\t\t\t}]\n }\n }\n\t}';\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t\t\n\t\t\t// echo $query_json;\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t// default is search on fulltext fields\n\t\tif ($query_json == '')\n\t\t{\n\t\t\t$query_json = '{\n\t\t\t\"size\":50,\n\t\t\t\t\"query\": {\n\t\t\t\t\t\"bool\" : {\n\t\t\t\t\t\t\"must\" : [ {\n\t\t\t\t \"multi_match\" : {\n\t\t\t\t \"query\": \"<QUERY>\",\n\t\t\t\t \"fields\":[\"search_data.fulltext\", \"search_data.fulltext_boosted^4\"] \n\t\t\t\t}\n\t\t\t\t}],\n\t\t\t\"filter\": <FILTER>\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"aggs\": {\n\t\t\t\"type\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.type.keyword\" }\n\t\t\t },\n\t\t\t \"year\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.year\" }\n\t\t\t },\n\t\t\t \"container\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.container.keyword\" }\n\t\t\t },\n\t\t\t \"author\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.author.keyword\" }\n\t\t\t },\n\t\t\t \"classification\" :{\n\t\t\t\t\"terms\": { \"field\" : \"search_data.classification.keyword\" }\n\t\t\t } \n\n\t\t\t}\n\n\t\n\t\t\t}';\n\t\t\t\n\t\t\t$query_json = str_replace('<QUERY>', $q, $query_json);\n\t\t}\n\t\n\t$filter_string = '[]';\n\t\n\tif ($filter)\n\t{\n\t\t$f = array();\n\t\t\n\t\tif (isset($filter->year))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.year'} = $filter->year;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\n\t\t// this doesn't work\n\t\tif (isset($filter->author))\n\t\t{\n\t\t\t$one_filter = new stdclass;\n\t\t\t$one_filter->match = new stdclass;\n\t\t\t$one_filter->match->{'search_data.author'} = $filter->author;\n\t\t\t\n\t\t\t$f[] = $one_filter;\t\t\t\n\t\t}\n\t\t\n\t\t$filter_string = json_encode($f);\n\t}\n\t\n\t$query_json = str_replace('<FILTER>', $filter_string, $query_json);\n\t\n\t\n\t$resp = $elastic->send('POST', '_search?pretty', $post_data = $query_json);\n\t\n\n\t\t$obj = json_decode($resp);\n\n\t\t$status = 200;\n\t}\n\t\n\tapi_output($obj, $callback, 200);\n}",
"public function outputRaw(){\n\t\techo $this->getFormItBuilderOutput();\n\t\texit();\n\t}",
"function index()\n {\n $config = new \\EasySwoole\\ElasticSearch\\Config([\n 'host' => 'localhost',\n 'port' => 9200\n ]);\n\n $elasticsearch = new \\EasySwoole\\ElasticSearch\\ElasticSearch($config);\n $bean = new \\EasySwoole\\ElasticSearch\\RequestBean\\Search();\n $bean->setIndex('test');\n $bean->setType('my_type');\n $bean->setBody(['query' => ['matchAll' => []]]);\n $response = $elasticsearch->client()->search($bean)->getBody();\n $client = $elasticsearch->client();\n var_dump($client);\n\n /*go(function()use($elasticsearch){\n $bean = new \\EasySwoole\\ElasticSearch\\RequestBean\\Search();\n $bean->setIndex('my_index');\n $bean->setType('my_type');\n $bean->setBody(['query' => ['matchAll' => []]]);\n $response = $elasticsearch->client()->search($bean)->getBody();\n return $this->writeJson(200,$response);\n var_dump(json_decode($response, true));\n });*/\n }",
"function dumpData(Elasticsearch\\Client $client, $path, $indexName) {\n $file = fopen($path, 'r') or exit(\"Impossible to open file: ($path)\");\n\n while (($line = fgetcsv($file, 0, \"\\t\")) !== FALSE) {\n $document = parseLine($line);\n\n $params = array();\n $params['body'] = $document;\n $params['index'] = $indexName;\n $params['type'] = 'geonames';\n $params['id'] = (int) $document['geonameId'];\n\n $returnValue = $client->index($params);\n echo \"Added \" . $params['id'] . \" \" . $document['name'] . \"\\n\";\n }\n}",
"public function run()\n {\n $client = ES::create()\n ->setHosts(\\Config::get('elasticsearch.host'))\n ->build();\n\n $test = TestCommunity::all();\n if(count($test) > 0){\n foreach($test as $v){\n $community = $v->getOriginal();\n $community += $v->test->getOriginal();\n $community =(Object)$community;\n\n $params = [\n 'index' => 'default',\n 'type' => 'test',\n 'id' => $community->id,\n 'body' => $community\n ];\n $client->index($params);\n }\n }\n }",
"public function execute()\n\t{\n\t\t$filterstr = implode(\".\\n\", $this->getFilters());\n\t\t$sparqlQuery = $this->constructQuery( $filterstr );\n\t\t\n\t\t@header('Content-type: text/plain');\n\t\t\n\t\t$engine = new SPARQL_Engine;\n\t\t$engine->useSparql($sparqlQuery);\n\t\t$engine->setResultHandler(new Single_Value_Extractor);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$engine->runQuery();\n\t\t} catch(Single_Value_Extractor $e)\n\t\t{\n\t\t\techo array_shift($e->getFoundValue());\n\t\t\techo \"\\n\".preg_replace('/\\t\\t\\t/', '', $sparqlQuery).\"\\n\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthrow new Exception('There was no result from the given SPARQL');\n\t}",
"public function index()\n\t{\n//$trends=\"thankyou1dfor\";\n\t\t$trends= $name = Input::get('trending');\n $phpArray = '{\n \"aggs\": {\n \"tweets\": {\n \"filter\": {\n \"term\": {\n \"tweet.entities.hashtags.text\": \"'.$trends.'\"\n }\n },\n \"aggs\": {\n \"histotweets\": {\n \"histogram\": {\n \"field\": \"tweet.created_at\",\n \"interval\": 360000\n }\n }\n }\n }\n },\n \"size\": 0\n}';\n $searchParams['index'] = 'tweetindex';\n $searchParams['size'] = 0;\n $searchParams['body']= $phpArray;\n $es=new ES();\n $result = $es->search($searchParams);\n // Storage::disk('local')->put('graphic.json',json_encode($result[\"aggregations\"]['tweets']['histotweets']['buckets']));\nreturn response()->json( $result[\"aggregations\"]['tweets']['histotweets']['buckets']);\n\n\n\n\n\n\n\t}",
"public function execute() {\n $this->check();\n $this->buildQuery();\n $response = json_decode($this->getContents());\n $this->response = !empty($response) ? $response : NULL;\n }",
"public function execute()\n {\n $data = [];\n foreach ($this->getRequest()->getParams() as $key => $post) {\n $data[$key] = filter_var($post, FILTER_SANITIZE_STRING);\n }\n\n $originZip = isset($data['origin_zip']) ? $data['origin_zip'] : '';\n\n if ($originZip) {\n $mapResult = $this->googleApiCurl($originZip, EnConstants::GOOGLE_URL);\n $error = $this->errorChecking($mapResult);\n\n if (empty($error)) {\n $addressArray = $this->addressArray($mapResult);\n } else {\n $addressArray = $error;\n }\n } else {\n $addressArray = $this->dataHelper->generateResponse();\n }\n\n $this->getResponse()->setHeader('Content-type', 'application/json');\n /** @var array $addressArray */\n $this->getResponse()->setBody(json_encode($addressArray));\n }",
"public function mysqlToElastic()\n {\n ini_set('memory_limit', '-1');\n ini_set('max_execution_time', 0);\n\n SearchIndex::registerIndex();\n\n sleep(8);\n\n $singers = Singer::all(['id', 'slug', 'name', 'status']);\n\n foreach ($singers as $singer) {\n SearchQuery::saveItem($singer->id, 'singer', $singer);\n }\n\n sleep(8);\n\n $songs = Song::with('singer')->select(['id', 'slug', 'singer_id', 'title', 'lyrics', 'status'])->get();\n\n foreach ($songs as $song) {\n SearchQuery::saveItem($song->id, 'song', $song);\n }\n\n sleep(8);\n\n return redirect(route('admin.home'))->with('success', 'Mysql tables are copied to Elastic');\n }",
"public function index()\n {\n $params=array();\n if(Session::has('esparams'))\n {\n //Session::flush();\n $params=Session::get('esparams');\n }\n\n $ESClient = new LaravelElasticSearch($params);\n\n\n //make sure we found the elastic search host\n if($found = $ESClient->ping())\n {\n $result = $ESClient->status();\n }\n else\n {\n $result = false;\n }\n //return result is an array\n\n //result is array, we need convert into tree view data\n $treeData = $ESClient->arrayToJavaTree($result,'Info');\n $treeData=substr($treeData, 0, -1); //get rid of the extra comma at the end\n $ArrayToJson = new \\Elasticsearch\\Serializers\\ArrayToJSONSerializer;\n $result = $ArrayToJson->serialize($result); //convert into Jason\n $result = $ESClient->JsonToHtml($result);\n return View::make('elastics.index', compact('treeData','result','ESClient'));\n }",
"public function processOutput() {}",
"public function logResult() : void\n {\n $log = implode(' ', $this->logArray);\n $logger = new Logger('Results');\n $logger->pushHandler(new StreamHandler('file.log', Logger::DEBUG));\n $logger->addInfo($log);\n }",
"public function print_result(){\n $parsed_result = (array) $this->get_result()->parse_result();\n foreach($parsed_result['items'] as $repository_detail){\n $out .= $repository_detail->full_name.': '.$repository_detail->description.'<br />';\n }\n echo $out;\n }",
"public function post_data(Request $r)\n {\n $elasticsearch_search = ClientBuilder::create()->build();\n //$client =new ClientBuilder();\n $query = $r->input('search');\n $items = $elasticsearch_search->search([\n 'index' => 'articles',\n 'type' => 'article',\n 'body' => [\n 'query' => [\n 'multi_match' => [\n 'fields' => ['title', 'body'],\n 'query' => $query,\n ],\n ],\n \n ],\n \n 'size' =>10,\n \n ]);\n\n //return $items;\n for ($i = 0; $i < 10; $i++) {\n $response[] = array(\"value\"=>$items['hits']['hits'][$i]['_source']['title'],\"label\"=>$items['hits']['hits'][$i]['_source']['title']);\n }\n\n echo json_encode($response);\n \n \n }",
"protected function processIndex()\n {\n //convert the request to sql\n $processedRequest = $this->processRequest($this->request);\n $records = $this->getRecords($processedRequest);\n\n //get the results and append its relationships\n $results = $this->appendRelationshipsToResult($this->request, $records['results']);\n\n //return the kanvas pagination format\n if ($this->request->hasQuery('format')) {\n $limit = (int) $this->request->getQuery('limit', 'int', 25);\n\n $results = [\n 'data' => $results,\n 'limit' => $limit,\n 'page' => $this->request->getQuery('page', 'int', 1),\n 'total_pages' => ceil($records['total'] / $limit),\n ];\n }\n\n return $this->processOutput($results);\n }",
"public function ViewResults() {\n echo \"<pre>\" . print_r($this->rs, TRUE) . \"</pre>\";\n }",
"public function printResult() {\n $this->result->path = $this->getType() . 's/' . $this->getName() . '#tmp';\n\n // text/plain is used to support IE\n header('Cache-Control: no-cache');\n header('Content-Type: text/plain; charset=utf-8');\n\n print $this->getResult();\n }",
"public function index()\n { \n echo \"Ejecute in BASH (Custom for bash)\\n\";\n echo \"\\n\";\n sleep(3);\n echo \"=======================================\\n\";\n echo \"Search Data in www.subingles.com\\n\";\n echo \"=======================================\\n\";\n // paginador init \n $offset = 0;\n $limit = 100;\n $this->db->from($this->tb_video);\n $count = $this->db->count_all_results();\n\n $total_pages = ($count > 0) ? ceil($count/$limit) : 1; //echo $total_pages; exit;\n\n for ($page = 1; $page <= $total_pages; $page++) {\n $offset = ($limit * $page) - $limit;\n $queryLimit = \" LIMIT $offset,$limit \";\n $query = \"SELECT id, title FROM {$this->tb_video} \" . $queryLimit;\n $stm = $this->db->query($query);\n $result = $stm->result_array();\n\n foreach ($result as $key => $value) {\n $part = explode('-', $result[$key]['title']);\n $song = $part[0];\n $artist = $part[1]; \n \n $id = $result[$key]['id']; \n $this->searchAndUpdate($id, $artist .' '. $song);\n echo \" [{$id}] = \" . $artist . ' ' . $song .\"\\n\"; \n }\n echo \"break (stop request for 5'')\\n\";\n sleep(5); // sleep for heavy load in server\n }\n // paginador end\n\n \n \n }",
"protected function processIndex()\n {\n //convert the request to sql\n $processedRequest = $this->processRequest($this->request);\n $records = $this->getRecords($processedRequest);\n $results = $records['results'];\n\n //return the kanvas pagination format\n if ($this->request->hasQuery('format')) {\n $limit = (int) $this->request->getQuery('limit', 'int', 25);\n\n $results = [\n 'data' => $results,\n 'limit' => $limit,\n 'page' => $this->request->getQuery('page', 'int', 1),\n 'total_pages' => ceil($records['total'] / $limit),\n ];\n }\n\n return $this->processOutput($results);\n }",
"public function execute()\n\t{\n\t\t$queryUrl = $this->buildQueryUrl();\n\t\t$storeId = $this->getParam('storeid');\n\t\t$arguments = array(\n\t\t\t\t'json.nl' => 'map',\n\t\t\t\t'rows' => $this->rows,\n\t\t\t\t'start' => $this->start,\n\t\t\t\t'fl' => @implode(',', $this->fieldList),\n\t\t\t\t'qf' => $this->queryFields,\n\t\t\t\t'spellcheck' => 'true',\n\t\t\t\t'spellcheck.collate' => 'true',\n\t\t\t\t'facet' => 'true',\n\t\t\t\t'facet.mincount' => 1,\n\t\t\t\t'facet.limit' => $this->facetLimit,\n\t\t\t\t'timestamp' => time(),\n\t\t\t\t'mm' => $this->mm,\n\t\t\t\t'defType'=> 'edismax',\n\t\t\t\t'wt'=> 'json',\n\t\t);\n\n\t\t$resultSet = $this->doRequest($queryUrl, $arguments, 'array');\n\n\t\tif (isset($resultSet['response']['numFound']) && intval($resultSet['response']['numFound']) > 0)\n\t\t{\n\t\t\treturn $resultSet;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$queryText = $this->getQueryText();\n\t\t\tif (isset($resultSet['spellcheck']['suggestions']['collation']))\n\t\t\t{\n\t\t\t\t$queryText = strtolower($resultSet['spellcheck']['suggestions']['collation']);\n\t\t\t}\n\n\t\t\tif (!empty($queryText))\n\t\t\t{\n\t\t\t\t$this->queryText = $queryText;\n\t\t\t\t$queryUrl = $this->buildQueryUrl();\n\t\t\t\t$arguments['mm'] = '0%';\n\n\t\t\t\t$resultSet = $this->doRequest($queryUrl, $arguments, 'array');\n\t\t\t}\n\t\t}\n\t\treturn $resultSet;\n\t}",
"public function execute() {\r\n $url = $this->getUrl() . $this->actions['execute'];\r\n\r\n Utils::log(sprintf(\"Reindexing all on '%s'...\", $url));\r\n $res = $this->curl($url);\r\n \r\n if ($res == 404) {\r\n Utils::log(\\Logger\\ILogger::ERROR, sprintf(\"REINDEX: Cannot 'reindex all'. Remote script '%s' does not exists.\", $url));\r\n } else {\r\n Utils::log(\"REINDEX: Reindexed all.\");\r\n }\r\n \r\n return $res;\r\n }",
"public function content() {\n $config = \\Drupal::config('webspark_isearch.settings');\n $solr = $config->get('solr');\n $client = \\Drupal::httpClient();\n $query= \\Drupal::request()->getQueryString();\n\n $url = $solr . '?' . urldecode($query);\n\n $request = $client->get($url);\n $status = $request->getStatusCode();\n $content = $request->getBody()->getContents();\n $file_contents = json_decode($content);\n\n return new JsonResponse($file_contents);\n }",
"public function perform()\n {\n $services = $this->getServiceLocator();\n $api = $services->get('Omeka\\ApiManager');\n $em = $services->get('Omeka\\EntityManager');\n $fulltext = $services->get('Omeka\\FulltextSearch');\n $adapters = $services->get('Omeka\\ApiAdapterManager');\n foreach ($adapters->getRegisteredNames() as $adapterName) {\n $adapter = $adapters->get($adapterName);\n if ($adapter instanceof FulltextSearchableInterface) {\n $page = 1;\n do {\n if ($this->shouldStop()) {\n return;\n }\n $response = $api->search(\n $adapter->getResourceName(),\n ['page' => $page, 'per_page' => 100],\n ['responseContent' => 'resource']\n );\n foreach ($response->getContent() as $resource) {\n $fulltext->save($resource, $adapter);\n }\n $em->clear(); // avoid a memory leak\n $page++;\n } while ($response->getContent());\n }\n }\n }",
"public function getRawResult();",
"private function getResult(): void\n {\n $matches = $this->getNeedlesResult();\n foreach ($matches as $n_key => $match) {\n if (isset($match['matching_filters'])) {\n $match_count = count($match['matching_filters']);\n if ($match_count === 1) { // Save Matches\n $match = $this->getReturnValues($match);\n $match = $this->getLayerData($match);\n unset($match['matching_filters']);\n $this->SearchResult->matches[$n_key] = $match;\n continue;\n } elseif ($match_count > 1) { // Save Indecisive\n $result = [];\n $matching_filters = $match['matching_filters'];\n unset($match['matching_filters']);\n foreach ($matching_filters as $filter) {\n $result[] = $this->getReturnValues($match, $filter['filter_id']);\n }\n $match[$this->config->prefix . 'matching_filters'] = $result;\n $this->SearchResult->indecisive_matches[$n_key] = $match;\n continue;\n }\n }\n // Save no matches\n $this->SearchResult->no_matches[$n_key] = $match;\n }\n }"
] |
[
"0.6255106",
"0.57790077",
"0.55282617",
"0.54906845",
"0.54606426",
"0.53962576",
"0.53578985",
"0.53196275",
"0.53062725",
"0.5285586",
"0.518518",
"0.51725453",
"0.51361257",
"0.5133688",
"0.51203007",
"0.511188",
"0.5101683",
"0.50789005",
"0.50534815",
"0.50501096",
"0.5033859",
"0.5030366",
"0.5004594",
"0.49881455",
"0.4988012",
"0.49784043",
"0.49780583",
"0.49381432",
"0.4936353",
"0.49295384"
] |
0.7193547
|
0
|
Private helper methods Checks whether a given description complies with a given metadata schema class name.
|
function _complies(&$metadataDescription, $schemaClassName) {
if (!is_a($metadataDescription, 'MetadataDescription')) return false;
$descriptionSchema =& $metadataDescription->getMetadataSchema();
return (is_a($descriptionSchema, $schemaClassName));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private static function is_valid($schema)\n {\n return class_exists($schema) && new $schema() instanceof SchemaBuilder;\n }",
"public function hasClass($name);",
"private function _checkClass()\n {\n if ($this->_useWithoutTypeCheck === true) {\n return true;\n }\n\n $resource = $this->_owApp->selectedResource;\n $rModel = $resource->getMemoryModel();\n\n // search with each expression using the preg matchtype\n foreach ($this->_types as $type) {\n if (isset($type['classUri'])) {\n $classUri = $type['classUri'];\n } else {\n continue;\n }\n if (\n $rModel->hasSPvalue(\n (string) $resource,\n EF_RDF_TYPE,\n $classUri\n )\n ) {\n return true;\n }\n }\n\n // type does not match to one of the expressions\n return false;\n }",
"public function testGetMetadata()\n {\n $connection = $this->createMysqlConnection();\n $metadata = $connection->getClassMetadata();\n\n $classes = [\n \"Quizzes\\Quiz\",\n \"Quizzes\\Question\",\n \"Quizzes\\Answer\"\n ];\n\n $names = [];\n\n foreach ($metadata as $k => $v) {\n $names[] = $v->getName();\n\n foreach ($classes as $key => $value) {\n if ($value == $v->getName()) {\n unset($classes[$key]);\n }\n }\n }\n\n $this->assertCount(0, $classes, print_r($names, true));\n\n }",
"public function check_validity($_classname);",
"function validateMetaData($data){\r\n\t$schema = $data['schema'].'_schema_'.$data['version'].'.json';\r\n\t\r\n\t// Validate if the MetaData exists.\r\n\t// It's up to the software engineer to decide if the non existence of a Metadata Schema file results into a true or false validation\r\n\tif(file_exists('testschemas/'.$schema)){\r\n\t\t// Read the Schema file and decode into an associative array\r\n\t\t// NOTE: this part does not yet support nested arrays or objects!!!\r\n\t\t$schema = file_get_contents('testschemas/'.$schema);\r\n\t\t$schema = json_decode($schema,true); // Instructing PHP to turn the JSON Object into a associative array!\r\n\t\t\r\n\t\t// Start the validation process\r\n\t\t$ret = validate($data,$schema);\r\n\t\tif(!$ret)\r\n\t\t\treturn false;\r\n\t}elseif(isset($data[\"external_resource\"])){\r\n\t\t$ret = loadExternalResource($data);\r\n\t\tif($ret){\r\n\t\t\techo $data[\"external_resource\"].\" is VALID\\r\\n\";\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\techo $data[\"external_resource\"].\" is INVALID\\r\\n\";\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t}else{\r\n\t\t// The software engineer will have to decide how its program will behave when there is no Schema file found\r\n\t\techo \"Schema file not found.\\r\\n\";\r\n\t\techo \"Assume \";\r\n\t}\r\n\t\r\n\t// All is good. Metadata is valid\r\n\treturn true;\r\n}",
"function validateMetaData($data){\n\t$schema = $data['schema'].'_'.$data['version'].'.json';\n\t\n\t// Validate if the Meta Data exists.\n\t// It's up to the software engineer to decide if the non existence of a Meta Data Schema file results into a true or false validation\n\tif(file_exists('schemas/'.$schema)){\n\t\t// Read the Schema file and decode into associative arrays\n\t\t$schema = file_get_contents('schemas/'.$schema);\n\t\t$schema = json_decode($schema,true);\n\t\t\n\t\t// Get the fieldnames from the Schema by abstracting the array keys\n\t\t$ret = validate($data,$schema);\n\t\tif(!$ret)\n\t\t\treturn false;\n\t}else{\n\t\t// The software engineer will have to decide how it's program will behave when there is nog Schema file found\n\t\techo \"Schema file not found.\\r\\n\";\n\t\techo \"Assume \";\n\t}\n\t\n\t// All is good. Meta Data is valid\n\treturn true;\n}",
"function exists(string $class_name): bool\n{\n /** @var bool */\n return class_exists($class_name, true);\n}",
"public function isValid()\r\n {\r\n if (!retGet('class'))\r\n return false;\r\n\r\n if (!in_array(retGet('class'), $this->_available))\r\n return false;\r\n\r\n return true;\r\n }",
"public function hasClass($class);",
"protected static function isRegisteredClass($name, $class)\n {\n self::name($name);\n return in_array($class, self::$schemas[$name]->classes);\n }",
"public function hasTagClass($name);",
"function checkIfSubclassIsInFile($pathToXML, $name){\n $name = basename($name);\n $name = preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $name);\n $found=false;\n $title=\"\";\n $titleLang=\"\";\n $handle = fopen($pathToXML, 'r');\n if($handle){\n while (!feof($handle)){\n $buffer = fgets($handle);\n $type=$this->checkType($buffer);\n $uri=\"\";\n if($type=='nClass'){\n $uri=$this->get_string_between($buffer, '=\"', '\"]');\n $uri=basename($uri);\n $uri = preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $uri);\n if(strcmp($uri, $name)==0){\n $found=true;\n }\n }\n if($type==\"title\" && $found==true){\n if($titleLang==\"en\" || $titleLang==\"\"){\n if(strpos($buffer, '\"fr\"')){\n $titleLang=\"fr\";\n }else{\n $titleLang=\"en\";\n }\n $title=$this->get_string_between($buffer, ']', '[/');\n }\n }\n\n if($type==\"eoc\" && $found==true && $title==\"\"){\n return \"fail\";\n }\n\n if($type=='eoc' && $found==true && $title!==\"\"){\n return $title;\n }\n }\n }\n fclose($handle);\n return \"fail\";\n }",
"function olc_class_exists($class_name) {\n\tif (function_exists('class_exists')) {\n\t\treturn class_exists($class_name);\n\t} else {\n\t\treturn true;\n\t}\n}",
"public function testIsVendorClassReturnsFalseIfNameOfInternalClassIsPassed()\n {\n $this->assertFalse(VendorResources::isVendorClass('\\stdClass'));\n }",
"function macro_check_class(&$class)\n{\n $class = ltrim($class, '\\\\');\n\n return \\XLite\\Core\\Operator::isClassExists($class);\n}",
"public function isCreated(string $className): bool;",
"public function hasField(string $name, string $class=null): bool;",
"protected function isPartOfSchema($kind, $name) {\n static $previous_calls;\n\n $state_key = 'search_api_solr.' . $this->getServer()->id() . '.schema_parts';\n $state = \\Drupal::state();\n // @todo Reset that drupal state from time to time.\n $schema_parts = $state->get($state_key);\n\n if (\n !is_array($schema_parts) || empty($schema_parts[$kind]) ||\n (!in_array($name, $schema_parts[$kind]) && !isset($previous_calls[$kind]))\n ) {\n $response = $this->getSolrConnector()\n ->coreRestGet('schema/' . strtolower($kind));\n if (empty($response[$kind])) {\n throw new SearchApiSolrException('Missing information about ' . $kind . ' in response to REST request.');\n }\n // Delete the old state.\n $schema_parts[$kind] = [];\n foreach ($response[$kind] as $row) {\n $schema_parts[$kind][] = $row['name'];\n }\n $state->set($state_key, $schema_parts);\n $previous_calls[$kind] = TRUE;\n }\n\n return in_array($name, $schema_parts[$kind]);\n }",
"public function supports(string $class): bool;",
"function _class_check($str){\n }",
"public function isClassKeyword() : bool\n {\n return $this->simple && Validators::isClassKeyword($this->types[0]);\n }",
"function parseTypeName($typeName) {\n\t\t$splitName = $this->splitClassName($typeName);\n\t\tif ($splitName === false) return false;\n\t\tlist($this->_packageName, $this->_className) = $splitName;\n\n\t\t// FIXME: Validate package and class to reduce the risk of\n\t\t// code injection, e.g. check that the package is within given limits/folders,\n\t\t// don't allow empty package parts, etc.\n\n\t\treturn true;\n\t}",
"public function hasType(string $name): bool;",
"public function canBuildFromSchemaFile() {\n\t}",
"public function hasType($name);",
"function classExistsInNamespaces($class);",
"public static function isValidDataObject($class)\n {\n $class = strtolower(str_replace('-', '\\\\', $class));\n $list = self::getValidDataObjects();\n return isset($list[$class]);\n }",
"public function hasSubClass(string $name): bool;",
"function hasClass($DOMElement, $classname){\n\t\tif (!$DOMElement->getAttribute(\"class\")) return false;\n\t\tif (preg_match(\"~(^| )\".$classname.\"( |$)~\", $DOMElement->getAttribute(\"class\"))) return true;\n\t\treturn false;\n\t}"
] |
[
"0.6009475",
"0.59640753",
"0.58750415",
"0.58559376",
"0.5710562",
"0.55624115",
"0.552243",
"0.5398714",
"0.5383959",
"0.53812397",
"0.53768843",
"0.5371742",
"0.52839214",
"0.5282183",
"0.5273172",
"0.5249025",
"0.523703",
"0.5229246",
"0.5222672",
"0.52188474",
"0.5213561",
"0.5211323",
"0.51857245",
"0.51430416",
"0.51402235",
"0.51311797",
"0.5125585",
"0.512252",
"0.51109546",
"0.51090366"
] |
0.8266973
|
0
|
index function. Returns all the content types
|
public function index() {
$this->data["content"] = $this->mongo_db->order_by(array("_id"))->get("content_types");
$this->returndata();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function index()\n {\n $types = Type::all();\n return $this->showAll($types);\n }",
"public function index()\n {\n $types = Type::all();\n\n return $this->showAll($types);\n }",
"private function getContentTypes() {\n return NodeType::loadMultiple();\n }",
"public static function getContentTypes()\n {\n return self::$_contentTypes;\n }",
"function &ListContentTypes()\n\t{\n\t\tglobal $gCms;\n\t\t$contenttypes =& $gCms->contenttypes;\n\t\t\n\t\tif (isset($gCms->variables['contenttypes']))\n\t\t{\n\t\t\t$variables =& $gCms->variables;\n\t\t\treturn $variables['contenttypes'];\n\t\t}\n\t\t\n\t\t$result = array();\n\t\t\n\t\treset($contenttypes);\n\t\twhile (list($key) = each($contenttypes))\n\t\t{\n\t\t\t$value =& $contenttypes[$key];\n\t\t\t$result[] = $value->type;\n\t\t}\n\t\t\n\t\t$variables =& $gCms->variables;\n\t\t$variables['contenttypes'] =& $result;\n\n\t\treturn $result;\n\t}",
"public static function getContentTypes() {\n $contentTypes = Content::$contentTypes;\n return $contentTypes;\n }",
"public function getContentTypes()\n {\n return $this->contentTypes;\n }",
"public function index()\n {\n $types = $this->allResources($this->typeRepository);\n\n return TypeResource::collection($types);\n }",
"public function getIndex()\n {\n // Title\n $title = Lang::get('admin/types/title.type_management');\n\n // Grab all the type posts\n $types = $this->type;\n\n // Show the page\n return View::make('admin/types/index', compact('types', 'title'));\n }",
"public function index()\n {\n // get all the types\n $types = Type::orderBy('type')->get();\n\n // load the view and pass the types\n return view('types.index')->with('types', $types);\n }",
"public function index()\n {\n $types = $this->typeRepository->all();\n return view('types.index', compact('types'));\n }",
"public function index()\n {\n // $types = Type::get();\n $types = Type::select('id', 'name', 'sort')->get();\n\n // return response([\n // 'data' => $types,\n // ], Response::HTTP_OK);\n return new TypeCollection($types);\n }",
"function jgantt_dashboard_get_content_types() {\n $types = array();\n $result = db_query('SELECT d.node_type, d.configuration\n FROM {jgantt_dashboard} d WHERE d.status = :status', array(':status' => 1));\n\n foreach ($result as $record) {\n $types[$record->node_type] = $record;\n }\n return $types;\n}",
"public function index()\n {\n $types = Type::all();\n\n return view('admin.type.index', [\n 'types' => $types\n ]);\n }",
"public static function getContentType()\n {\n return ['core', 'page'];\n }",
"public function index()\n {\n return view('types.index');\n }",
"public function index()\n {\n $title = 'Our Types';\n $types = Type::withCount('items')->get();\n\n return view('admin.types.index', compact('title','types'));\n }",
"public function index()\n {\n return view('modules.type.index');\n }",
"public function getListeTypeContent () \n {\n $db = $this->getModel('db');\n $sql = \"SHOW TABLES LIKE '\" . $this->table_cms_contenu . \"_%'\";\n $stmt = $db->query($sql);\n for (true; $res = $db->fetch_assoc($stmt); true) {\n $liste_type_content[] = $res['Tables_in_' . Clementine::$config['clementine_db']['name'] . ' (' . $this->table_cms_contenu . '_%)']; \n }\n return $liste_type_content;\n }",
"public function testContentTypesLists()\n {\n $this->contentTypeItemTest('products');\n $this->contentTypeItemTest('blogs');\n $this->contentTypeItemTest('app_flows');\n $this->contentTypeItemTest('lists');\n $this->contentTypeItemTest('user_reviews');\n $this->contentTypeItemTest('boards');\n }",
"public function index()\n\t{\n\t\t$cardTypes = $this->cardTypeRepository->all();\n\n\t\treturn $this->sendResponse($cardTypes->toArray(), \"CardTypes retrieved successfully\");\n\t}",
"public function index()\n {\n return view('admin::appraisal.types.index');\n }",
"private function loadContentTypes()\n\t\t{\n\t\t\t$query = $this->contentTypeQuery;\n\t\t\t$list = $this->bridge->packData($query);\n\t\t\t$this->contentTypes = $list;\n\t\t\t\n\t\t\t/*\n\t\t\t*\tgenerate new contentTypes [Folder, File]\n\n\t\t\t*/\n\n\t\t\tif (count($this->contentTypes) == 0)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tINSERT INTO contentType VALUES (null, 'Folder', null)\n\t\t\t\t*\tINSERT INTO contentType VALUES (null, 'File', null)\n\t\t\t\t*/\n\n\t\t\t\t$qrs = array();\n\t\t\t\tarray_push($qrs, [\"'Folder'\", \"'_'\"]);\n\t\t\t\tarray_push($qrs, [\"'File'\", \"'_'\"]);\n\n\t\t\t\t$ts = $this->logContentType($qrs);\n\t\t\t\t#var_dump($ts);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$r= 1;\n\t\t\t\t#var_dump($this->contentTypes);\n\t\t\t\t#$arrayName = array(0 => [\"'Folderr'\", \"null\"], );\n\t\t\t\t#$this->logContentType($arrayName);\n\t\t\t}\t\t\t\n\t\t}",
"public function index() {\n \t$types = TipoTransparencia::all();\n \treturn $types;\n }",
"public function indexContentCategories()\n {\n return $this->contentCategoryRepo->all();\n }",
"function contentTypes()\n {\n return new ContentTypes($this->accessToken, $this->spaceId, $this->cacher);\n }",
"public function index()\n {\n //$rs_posttypes = DB::select('call ListCategoryByTypeProcedure()');\n //$posttypes = json_decode(json_encode($rs_posttypes), true);\n $posttypes = PostType::all()->toArray();\n return view('admin.posttype.index',compact('posttypes'));\n }",
"public function getSearchContentTypes()\n\t{\n\t\treturn array('quote');\n\t}",
"public function getIndex(){\n $itemtypegets=RItemType::get_allItemtype();\n return View::make('item_type.listitemtype',array('itemtypegets'=>$itemtypegets,)); \n }",
"public function item_types()\n {\n $itemTypes = ItemTypes::where('status', 'active')->orderBy('idx')->get();\n return view('setup.item_types.index', compact('itemTypes'));\n }"
] |
[
"0.71098053",
"0.70391136",
"0.6954703",
"0.69469166",
"0.690027",
"0.68272644",
"0.6810678",
"0.6800812",
"0.6696595",
"0.6651644",
"0.6628819",
"0.6595833",
"0.6536104",
"0.6510139",
"0.64945745",
"0.6493904",
"0.6468829",
"0.6451863",
"0.64416206",
"0.6404756",
"0.6383315",
"0.63709676",
"0.63582647",
"0.63428193",
"0.63231325",
"0.6320465",
"0.6308158",
"0.6302103",
"0.6299211",
"0.6285729"
] |
0.8176327
|
0
|
Handler the main forum functions
|
function forumHandler() {}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function forum_autoriser(){}",
"function process()\n\t{\n\t\tswitch(getPOST('action',''))\n\t\t{\n\t\t\tcase 'forum_send':\n\t\t\t\tif(isInPOST(array(\"body\")))\n\t\t\t\t{\n\t\t\t\t\tif($this->sendMessage($_POST['body'],getGET($this->reply_to_get,0)))\n\t\t\t\t\t\t$this->message(FORUM_MESSAGE_SEND_MESSAGE_OK);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'cat_operation':\n\t\t\t\tif(isset($_POST['cat_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubCat($_POST['cat_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_CAT_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubCat($_POST['cat_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_CAT_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt'])) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delCat($_POST['cat_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_CAT_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'topic_operation':\n\t\t\t\tif(isset($_POST['topic_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubTopic($_POST['topic_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_TOPIC_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubTopic($_POST['topic_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_TOPIC_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delTopic($_POST['topic_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_TOPIC_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'post_operation':\n\t\t\t\tif(isset($_POST['post_id']))\n\t\t\t\t{\n\t\t\t\t\tif(isset($_POST['pub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubMessage($_POST['post_id'],true))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_PUB_POST_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['unpub']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this->pubMessage($_POST['post_id'],false))\n\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_UNPUB_POST_OK);\n\t\t\t\t\t}\n\t\t\t\t\telse if (isset($_POST['del']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(isset($_POST['del_bizt']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($this->delMessage($_POST['post_id']))\n\t\t\t\t\t\t\t\t$this->message(FORUM_MESSAGE_DEL_POST_OK);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->message(FORUM_MESSAGE_DEL_BIZT);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'new_topic':\n\t\t\t\tif(isset($_POST['topic_name']))\n\t\t\t\t{\n\t\t\t\t\t$this->createTopic($_POST['topic_name']);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'new_cat':\n\t\t\t\tif(isset($_POST['cat_name']))\n\t\t\t\t{\n\t\t\t\t\t$this->createCat($_POST['cat_name']);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function actionIndex()\n\t{\n\t\t$forumId = $this->_input->filterSingle('node_id', XenForo_Input::UINT);\n\t\tif (empty($forumId))\n\t\t{\n\t\t\treturn parent::actionIndex();\n\t\t}\n\t\t\n\t\t\n\t\t$options = XenForo_Application::get('options');\n\t\tif (($forumId && $forumId != $options->cmfUserBlogsNode) || $this->_routeMatch->getResponseType() == 'rss' || $this->_input->filterSingle('user_id', XenForo_Input::UINT))\n\t\t{\n\t\t\treturn parent::actionIndex();\n\t\t}\n\t\t\n\t\t/** @var $ftpHelper XenForo_ControllerHelper_ForumThreadPost */\n\t\t$ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$forum = $ftpHelper->assertForumValidAndViewable(\n\t\t\t$forumId,\n\t\t\t$this->_getForumFetchOptions()\n\t\t);\n\t\t$forumId = $forum['node_id'];\n\n\t\t$visitor = XenForo_Visitor::getInstance();\n\t\t$userBlogModel = $this->_getUserBlogModel();\n\t\t$forumModel = $this->_getForumModel();\n\n\t\t$page = max(1, $this->_input->filterSingle('page', XenForo_Input::UINT));\n\t\t$usersPerPage = $options->cmfUserBlogsPerPage;\n\n\t\t$this->canonicalizeRequestUrl(\n\t\t\tXenForo_Link::buildPublicLink('forums', $forum, array('page' => $page))\n\t\t);\n\n\t\tlist($defaultOrder, $defaultOrderDirection) = $this->_getDefaultThreadSort($forum);\n\n\t\t// only default sort by last_post_date desc\n\t\t$order = $defaultOrder;\n\t\t$orderDirection = $defaultOrderDirection;\n\n\t\t//all threads and fake value for disabling \"mark read\"\n\t\t$displayConditions = array();\n\n\t\t$fetchElements = $this->_getThreadFetchElements(\n\t\t\t$forum, $displayConditions,\n\t\t\t$usersPerPage, $page, $order, $orderDirection\n\t\t);\n\t\t$threadFetchConditions = $fetchElements['conditions'];\n\t\t$threadFetchOptions = $fetchElements['options'] + array(\n\t\t\t'perPage' => $usersPerPage,\n\t\t\t'page' => $page,\n\t\t\t'order' => $order,\n\t\t\t'orderDirection' => $orderDirection\n\t\t);\n\t\tunset($fetchElements);\n\n\n\t\t$totalUserBlogs = $userBlogModel->countUserBlogs($threadFetchConditions);\n\t\t$this->canonicalizePageNumber($page, $usersPerPage, $totalUserBlogs, 'forums', $forum);\n\n\t\t$permissions = $visitor->getNodePermissions($forumId);\n\n\t\t// get the ordering params set for the header links\n\t\t$orderParams = array();\n\t\t$pageNavParams = $displayConditions;\n//\t\t$pageNavParams['order'] = ($order != $defaultOrder ? $order : false);\n//\t\t$pageNavParams['direction'] = ($orderDirection != $defaultOrderDirection ? $orderDirection : false);\n\t\t$pageNavParams['order'] = false;\n\t\t$pageNavParams['direction'] = false;\n\n\t\t$userBlogs = $userBlogModel->getNodeUserDataForListDisplay($forum, $threadFetchConditions, $threadFetchOptions, $permissions);\n\t\t$viewParams = array(\n\t\t\t'nodeList' => $userBlogs,\n\t\t\t'forum' => $forum,\n\t\t\t'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum, false),\n\n\t\t\t'canPostThread' => $forumModel->canPostThreadInForum($forum),\n\t\t\t'canSearch' => $visitor->canSearch(),\n\n\t\t\t//TODO Ignore List\n\t\t\t'ignoredNames' => array(), //$this->_getIgnoredContentUserNames($threads) + $this->_getIgnoredContentUserNames($stickyThreads),\n\n\t\t\t'order' => $order,\n\t\t\t'orderDirection' => $orderDirection,\n\t\t\t'orderParams' => $orderParams,\n\t\t\t'displayConditions' => $displayConditions,\n\n\t\t\t'pageNavParams' => $pageNavParams,\n\t\t\t'page' => $page,\n\t\t\t'blogsStartOffset' => ($page - 1) * $usersPerPage + 1,\n\t\t\t'blogsEndOffset' => ($page - 1) * $usersPerPage + count($userBlogs['nodesGrouped'][$forumId]),\n\t\t\t'blogsPerPage' => $usersPerPage,\n\t\t\t'totalBlogs' => $totalUserBlogs,\n\n\t\t\t'showPostedNotice' => $this->_input->filterSingle('posted', XenForo_Input::UINT)\n\t\t);\n\n\t\treturn $this->responseView('XenForo_ViewPublic_Forum_View', 'cmf_user_blog_view', $viewParams);\n\t}",
"protected function openForum(){\n \t\t$dbug = $this->isDebug();\n \t\t\n \t\tif ($dbug) fb('Opening Forum','line '.__LINE__);\n \t\t\n \t\tif ($dbug) fb('Validating Id','line '.__LINE__);\n \t\t$this->validateForumId();\n \t\t\n \t\tif ($this->isError()) return;\n \t\t\n \t\t$id = $this->getId();\n\t\t$start = $this->getOption('start');\n\t\t\tif (!$start || !is_numeric($start)) $start = 0;\n\t\t\n\t\tif ($dbug) fb('Fetching Forum Info','line '.__LINE__);\n\t\t$this->retrieveForumInfo($id,$this->isDebug());\n\n\t\t$limit = $this->getOption('limit');\n\t\t\tif (!$limit || !is_numeric($limit)) $limit = $this->_default_limit;\n\t\t \t\n\t\tif ($dbug) fb('Fetching Forum Messages','line '.__LINE__);\n\t\t$this->retrieveMessages($id,$start,$limit,$this->isDebug());\n \t}",
"function sportal_main()\n{\n\tglobal $smcFunc, $context, $sourcedir;\n\n\tif (WIRELESS)\n\t\tredirectexit('action=forum');\n\n\t$context['page_title'] = $context['forum_name'];\n\n\tif (isset($context['page_title_html_safe']))\n\t\t$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title']));\n\n\tif (!empty($context['standalone']))\n\t\tsetupMenuContext();\n\n\t$actions = array(\n\t\t'articles' => array('PortalArticles.php', 'sportal_articles'),\n\t\t'categories' => array('PortalCategories.php', 'sportal_categories'),\n\t\t'credits' => array('', 'sportal_credits'),\n\t\t'index' => array('', 'sportal_index'),\n\t\t'pages' => array('PortalPages.php', 'sportal_pages'),\n\t\t'shoutbox' => array('PortalShoutbox.php', 'sportal_shoutbox'),\n\t);\n\n\tif (!isset($_REQUEST['sa']) || !isset($actions[$_REQUEST['sa']]))\n\t\t$_REQUEST['sa'] = 'index';\n\n\tif (!empty($actions[$_REQUEST['sa']][0]))\n\t\trequire_once($sourcedir . '/' . $actions[$_REQUEST['sa']][0]);\n\n\t$actions[$_REQUEST['sa']][1]();\n}",
"function target_add_forum($forum)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $forum['name']);\n\n\tif (!isset($GLOBALS['cat_map'][ $forum['cat_id'] ])) {\n\t\tpf('WARNING: Create category for uncategorized forum.');\n\t\t$cat_id = q_singleval('SELECT MAX(id)+1 from '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat');\n\t\tif (!$cat_id) $cat_id = 1;\n\t\ttarget_add_cat(array('id'=>$cat_id, 'name'=>'Uncategorized Forums', 'description'=>'', 'view_order'=>$cat_id));\n\t\t$GLOBALS['cat_map'][ $forum['cat_id'] ] = $cat_id;\n\t}\n\n\t$forum_opt = 16;\t// Set tag_style to BBCode.\n\tif (!empty($forum['post_passwd'])) {\n\t\t$forum_opt |= 4;\t// Enable passwd_posting.\n\t}\n\n\t$frm = new fud_forum();\n\t$frm->cat_id = $GLOBALS['cat_map'][ $forum['cat_id'] ];\n\t$frm->name = $forum['name'];\n\t$frm->descr = $forum['description'];\n\t$frm->view_order = $forum['view_order'];\n\t$frm->post_passwd = $forum['post_passwd'];\n\t$frm->url_redirect = $forum['url_redirect'];\n\t$frm->forum_opt = $forum_opt;\n\t$frm->max_attach_size = 0;\t// No limit.\n\t$frm->max_file_attachments = 5;\t// Sensible default.\n\t$id = $frm->add('LAST');\n\t$GLOBALS['forum_map'][ (int)$forum['id'] ] = $id;\n/*\nfud_use('forum_adm.inc', true);\nfud_use('groups_adm.inc', true);\nfud_use('groups.inc');\n$nf = new fud_forum;\n// $cat_id, $name, $descr, $parent, $url_redirect, $post_passwd, $forum_icon,\n// $forum_opt, $date_created, $message_threshold, $max_attach_size,\n// $max_file_attachments\n$nf->cat_id = $GLOBALS['cat_map'][$c->pid];\n$nf->name = $c->name;\n$nf->description = $c->description;\n$nf->view_order = $c->disporder;\n$nf->post_passwd = $c->password;\n// $nf->cat_opt = 1|2;\n$GLOBALS['forum_map'][$c->fid] = $nf->add('LAST');\n*/\n}",
"public function displayForumImp()\r\n {\r\n $servername = \"localhost\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n $db = \"forumdb\";\r\n\r\n $table = \"forum\";\r\n\r\n $count=1;\r\n $frname=array();\r\n $frdesc=array();\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $db);\r\n\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n else\r\n {\r\n $sql = \"SELECT * FROM $table WHERE sticky='1'\";\r\n $result = $conn->query($sql);\r\n\r\n if ($result->num_rows > 0)\r\n {\r\n // get data of each row\r\n while ($row = $result->fetch_assoc())\r\n {\r\n $frname[$count] = $row['forum_name'];\r\n $frdesc[$count] = $row['forum_desc'];\r\n\r\n $count++;\r\n }\r\n\r\n $CallClassBack = new forumCall();\r\n $CallClassBack->previewForum($frname, $frdesc);\r\n\r\n }\r\n else\r\n {\r\n //echo \"0 results\";\r\n echo \"Be the first the post!\";\r\n }\r\n $conn->close();\r\n }\r\n }",
"public function run()\n {\n cns_require_all_forum_stuff();\n\n // Topics and posts\n $start = 0;\n do {\n $topics = $GLOBALS['FORUM_DB']->query_select('f_topics', array('id', 't_forum_id'), null, '', 500, $start);\n foreach ($topics as $topic) {\n require_code('cns_posts_action2');\n cns_force_update_topic_caching($topic['id'], null, true, true);\n\n // NB: p_cache_forum_id must not be intval'd as may be null\n if (is_null($topic['t_forum_id'])) {\n $topic['t_forum_id'] = null;\n }\n $GLOBALS['FORUM_DB']->query_update('f_posts', array('p_cache_forum_id' => is_null($topic['t_forum_id']) ? null : $topic['t_forum_id']), array('p_topic_id' => is_null($topic['id']) ? null : $topic['id']));\n }\n\n $start += 500;\n } while (array_key_exists(0, $topics));\n\n // Polls\n $start = 0;\n do {\n $polls = $GLOBALS['FORUM_DB']->query_select('f_polls', array('id'), null, '', 500, $start);\n foreach ($polls as $poll) {\n $total_votes = $GLOBALS['FORUM_DB']->query_select_value('f_poll_votes', 'COUNT(*)', array('pv_poll_id' => $poll['id']));\n $GLOBALS['FORUM_DB']->query_update('f_polls', array('po_cache_total_votes' => $total_votes), array('id' => $poll['id']), '', 1);\n\n $answers = $GLOBALS['FORUM_DB']->query_select('f_poll_answers', array('id'), array('pa_poll_id' => $poll['id']));\n foreach ($answers as $answer) {\n $votes = $GLOBALS['FORUM_DB']->query_select_value('f_poll_votes', 'COUNT(*)', array('pv_answer_id' => $answer['id'], 'pv_poll_id' => $poll['id']));\n $GLOBALS['FORUM_DB']->query_update('f_poll_answers', array('pa_cache_num_votes' => $votes), array('id' => $answer['id']), '', 1);\n }\n }\n\n $start += 500;\n } while (array_key_exists(0, $polls));\n\n return null;\n }",
"public function _index()\n\t{\t\t\t\n\t\t# allowed actions and their methods.\n\t\t$action_mapper = array(\n\t\t\t'category'\t=> 'posts_wrapper',\n\t\t\t'view'\t\t\t=> 'comments_wrapper',\n\t\t\t'submit'\t\t=> 'add_post',\n\t\t\t'vote'\t\t\t=> 'vote',\n\t\t\t'edit'\t\t\t=> 'edit',\n\t\t\t'my'\t\t\t\t=> 'my',\n\t\t);\n\n\t\tif(!array_key_exists($this->action, $action_mapper))\n\t\t\tEvent::run('system.404');\n\t\t\n\t\t$wrapper = new View('public_forum/index');\n\t\t$method = $action_mapper[$this->action];\n\t\t$wrapper->content = $this->$method(); \n\t\t$wrapper->categories\t= $this->categories();\n\t\t\n\t\t/*\n\t\t# define your logged in user.\n\t\t# Note: this just makes it easier to change here.\n\t\t$wrapper->user = ($this->owner->logged_in())\n\t\t\t? $this->owner->get_user()\n\t\t\t: FALSE;\n\t\t*/\n\t\t\n\t\t$wrapper->user = FALSE;\n\t\t\n\t\t$this->template->content = $wrapper;\n\t\tdie($this->template);\n\t}",
"function forum_action()\n{\n $pageTitle = \"forum page\";\n require_once __DIR__ . '/../public/forum/index.php';\n}",
"function run()\n\t{\n\t\t// Find review, if there is one\n\t\t$individual_review_ratings=array();\n\t\t$review_rating=post_param('review_rating','');\n\t\tif ($review_rating!='')\n\t\t{\n\t\t\t$individual_review_ratings['']=array(\n\t\t\t\t'REVIEW_TITLE'=>'',\n\t\t\t\t'REVIEW_RATING'=>$review_rating,\n\t\t\t);\n\t\t}\n\n\t\t$poster_name=$GLOBALS['FORUM_DRIVER']->get_username(get_member());\n\t\t$post=comcode_to_tempcode(post_param('post'));\n\n\t\t// OCF renderings of poster\n\t\tstatic $hooks=NULL;\n\t\tif (is_null($hooks)) $hooks=find_all_hooks('modules','topicview');\n\t\tstatic $hook_objects=NULL;\n\t\tif (is_null($hook_objects))\n\t\t{\n\t\t\t$hook_objects=array();\n\t\t\tforeach (array_keys($hooks) as $hook)\n\t\t\t{\n\t\t\t\trequire_code('hooks/modules/topicview/'.filter_naughty_harsh($hook));\n\t\t\t\t$object=object_factory('Hook_'.filter_naughty_harsh($hook),true);\n\t\t\t\tif (is_null($object)) continue;\n\t\t\t\t$hook_objects[$hook]=$object;\n\t\t\t}\n\t\t}\n\t\tif (!is_guest())\n\t\t{\n\t\t\trequire_code('ocf_members2');\n\t\t\t$poster_details=ocf_show_member_box(get_member(),false,$hooks,$hook_objects,false);\n\t\t} else\n\t\t{\n\t\t\t$custom_fields=new ocp_tempcode();\n\t\t\t$poster_details=new ocp_tempcode();\n\t\t}\n\t\tif (addon_installed('ocf_forum'))\n\t\t{\n\t\t\tif (!is_guest())\n\t\t\t{\n\t\t\t\t$poster=do_template('OCF_POSTER_MEMBER',array('ONLINE'=>true,'ID'=>strval(get_member()),'POSTER_DETAILS'=>$poster_details,'PROFILE_URL'=>$GLOBALS['FORUM_DRIVER']->member_profile_url(get_member(),false,true),'POSTER_USERNAME'=>$poster_name));\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$poster=do_template('OCF_POSTER_GUEST',array('IP_LINK'=>'','POSTER_DETAILS'=>$poster_details,'POSTER_USERNAME'=>$poster_name));\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\t$poster=make_string_tempcode(escape_html($poster_name)); // Should never happen actually, as applies discounts hook from even running\n\t\t}\n\n\t\t$highlight=false;\n\t\t$datetime_raw=time();\n\t\t$datetime=get_timezoned_date(time());\n\t\t$poster_url=$GLOBALS['FORUM_DRIVER']->member_profile_url(get_member());\n\t\t$title=post_param('title','');\n\t\t$tpl=do_template('POST',array(\n\t\t\t'INDIVIDUAL_REVIEW_RATINGS'=>$individual_review_ratings,\n\t\t\t'HIGHLIGHT'=>$highlight,\n\t\t\t'TITLE'=>$title,\n\t\t\t'TIME_RAW'=>strval($datetime_raw),\n\t\t\t'TIME'=>$datetime,\n\t\t\t'POSTER_URL'=>$poster_url,\n\t\t\t'POSTER_NAME'=>$poster_name,\n\t\t\t'POST'=>$post,\n\t\t\t'POSTER_ID'=>strval(get_member()),\n\t\t\t'POSTER'=>$poster,\n\t\t\t'POSTER_DETAILS'=>$poster_details,\n\t\t\t'ID'=>'',\n\t\t\t'CHILDREN'=>'',\n\t\t\t'RATING'=>'',\n\t\t\t'EMPHASIS'=>'',\n\t\t\t'BUTTONS'=>'',\n\t\t\t'TOPIC_ID'=>'',\n\t\t\t'UNVALIDATED'=>'',\n\t\t\t'IS_SPACER_POST'=>false,\n\t\t\t'NUM_TO_SHOW_LIMIT'=>'0',\n\t\t));\n\t\treturn array($tpl,NULL);\n\t}",
"function process_board($card)\r\r\n{\r\r\n if($card['var']['themecolor']){\r\r\n $color = 'style=\"color:'.$card['var']['themecolor'].'\"';\r\r\n $bordercolor = 'style=\"border-top-color:'.$card['var']['themecolor'].'\"';\r\r\n }\r\r\n\r\r\n $title_link = $card['var']['title_link'] ? $card['var']['title_link'] : 'javascript:void(0);';\r\r\n $header = '<div class=\"news-t\" '.$bordercolor.'><h3>'.\r\r\n '<a '.$color.' href=\"'.$title_link.'\">'.$card['var']['title'].'</a></h3>';\r\r\n if($card['var']['subtitle']){\r\r\n $header .= '<nav class=\"tmore\">';\r\r\n foreach ($card['var']['subtitle'] as $i => $subtitle) {\r\r\n $header .= '<a '.$color.' href=\"'.$card['var']['subtitle_link'][$i].'\">'.$subtitle.'</a>';\r\r\n }\r\r\n $header .= '</nav>';\r\r\n }\r\r\n $header .= '</div>';\r\r\n\r\r\n include_once libfile('function/forumlist');\r\r\n $fids = dintval($card['var']['fids'], TRUE);\r\r\n $forums = C::t('forum_forum')->fetch_all_by_fid($fids);\r\r\n $forum_fields = C::t('forum_forumfield')->fetch_all($fids);\r\r\n foreach($forums as $forum) {\r\r\n\r\r\n if($forum_fields[$forum['fid']]['fid']) {\r\r\n $forum = array_merge($forum, $forum_fields[$forum['fid']]);\r\r\n }\r\r\n $forum['extra'] = empty($forum['extra']) ? array() : dunserialize($forum['extra']);\r\r\n if(!is_array($forum['extra'])) {\r\r\n $forum['extra'] = array();\r\r\n }\r\r\n\r\r\n if($forum['icon']) {\r\r\n $forum['icon'] = get_forumimg($forum['icon']);\r\r\n }\r\r\n $forumlist[ $forum['fid'] ] = $forum;\r\r\n }\r\r\n\r\r\n $list = '<ul class=\"b-l cl\">';\r\r\n foreach ($forumlist as $f) {\r\r\n\r\r\n $link = forum_link($f['fid']);\r\r\n\r\r\n $list .= ' <li><a href=\"'.$link.'\"><img src=\"'.$f['icon'].'\" onerror=\"this.error=null;this.src=\\'source/plugin/xigua_portal/template/cards/board/images/bg.png\\'\"><span class=\"b-tit\">'.$f['name'].'</span></a></li>';\r\r\n }\r\r\n $list .= '</ul>';\r\r\n\r\r\n $card['var']['html'] = $header . $list;\r\r\n\r\r\n return $card;\r\r\n}",
"public function run()\n {\n $this->selected_forum_post_id = Request::get(self::PARAM_SELECTED_FORUM_POST);\n \n $quote_lo = DataManager::retrieve_by_id(ForumPost::class_name(), $this->selected_forum_post_id);\n \n $this->forumpost = new ForumPost();\n \n if (substr($quote_lo->get_title(), 0, 3) == 'RE:')\n {\n $reply = $quote_lo->get_title();\n }\n else\n {\n $reply = 'RE: ' . $quote_lo->get_title();\n }\n \n $this->forumpost->set_title($reply);\n \n $quoteUser = \\Chamilo\\Core\\User\\Storage\\DataManager::retrieve_by_id(\n \\Chamilo\\Core\\User\\Storage\\DataClass\\User::class_name(), \n (int) $quote_lo->get_user_id());\n \n $quoteContent = array();\n \n $quoteContent[] = '<blockquote>';\n $quoteContent[] = $quote_lo->get_content();\n $quoteContent[] = '<footer>' . $quoteUser->get_fullname() . '</footer>';\n $quoteContent[] = '</blockquote>';\n $quoteContent[] = '<p></p>';\n \n $this->forumpost->set_content(implode(PHP_EOL, $quoteContent));\n \n $this->form = new ForumPostForm(\n ForumPostForm::TYPE_QUOTE, \n $this->get_url(\n array(\n self::PARAM_ACTION => self::ACTION_QUOTE_FORUM_POST, \n self::PARAM_COMPLEX_CONTENT_OBJECT_ITEM_ID => $this->get_complex_content_object_item_id(), \n self::PARAM_SELECTED_FORUM_POST => $this->selected_forum_post_id)), \n $this->forumpost, \n $this->selected_forum_post_id);\n \n if ($this->form->validate())\n {\n $success = parent::create_forum_post(ForumPostForm::TYPE_QUOTE);\n \n $this->my_redirect($success);\n }\n else\n {\n $this->add_common_breadcrumbtrails();\n \n $html = array();\n \n $html[] = $this->render_header();\n $html[] = $this->form->toHtml();\n $html[] = $this->render_footer();\n \n return implode(PHP_EOL, $html);\n }\n }",
"function activite_forum_site($nbr_post_jour) {\r\n\r\n\t$pluged = unserialize($GLOBALS['meta']['plugin']);\r\n\r\n\tif (is_array($pluged['GAF'])) {\r\n\t\t$icone = \"<img src='\" . _DIR_PLUGINS . $pluged['GAF']['dir'] . \"/img_pack/gaf_ico-24.gif' border='0'>\";\r\n\t\t$url = generer_url_ecrire(\"gaf_admin\");\r\n\t\t$plugin = 'GAFoSPIP';\r\n\t} elseif (is_array($pluged['SPIPBB'])) {\r\n\t\t$icone = \"<img src='\" . _DIR_PLUGINS . $pluged['SPIPBB']['dir'] . \"/img_pack/spipbb-24.png' border='0'>\";\r\n\t\t$url = generer_url_ecrire(\"spipbb_admin\");\r\n\t\t$plugin = 'SpipBB';\r\n\t} else {\r\n\t\t$icone = http_img_pack('suivi-forum-24.gif', 'ico', '', '');\r\n\t\t$url = generer_url_ecrire(\"controle_forum\");\r\n\t}\r\n\r\n\t$aff = debut_cadre_relief('', true);\r\n\t$aff .= \"<div class='bouton_droite icone36'>\\n\"\r\n\t\t. \"<a href='\" . $url . \"' title='\"\r\n\t\t. ($plugin ? _T('actijour:voir_plugin') . $plugin : _T('actijour:voir_suivi_forums')) . \"'>\\n\"\r\n\t\t. $icone . \"</a>\\n\"\r\n\t\t. \"</div>\\n\"\r\n\t\t. \"<span class='bold'>\" . _T('actijour:forums') . \"</span><br />\";\r\n\r\n\t// nbr posts du jour sur vos forum\r\n\tif ($nbr_post_jour) {\r\n\t\t$aff .= $nbr_post_jour . \" \";\r\n\t} else {\r\n\t\t$aff .= _T('actijour:aucun');\r\n\t}\r\n\r\n\tif ($nbr_post_jour > 1) {\r\n\t\t$aff .= _T('actijour:messages');\r\n\t} else {\r\n\t\t$aff .= _T('actijour:message');\r\n\t}\r\n\r\n\t$aff .= \"<div class='nettoyeur'></div>\";\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}",
"function Forum_showForum(&$PAGEDATA, &$id) {\n\tWW_addCSS('/ww.plugins/forum/frontend/forum.css');\n\t// { forum data\n\t$forum=dbRow('select * from forums where id='.$id);\n\tif (!$forum || !count($forum)) {\n\t\treturn '<em class=\"error\">Error: this forum does not exist!</em>';\n\t}\n\t$c='<h2 class=\"forum-name\">'.htmlspecialchars($forum['name']).'</h2>';\n\t// }\n\t// { subforums\n\t$subforums=dbAll('select * from forums where parent_id='.$id);\n\tif ($subforums && count($subforums)) {\n\t\treturn 'TODO: subforums';\n\t}\n\t// }\n\t// { threads\n\t$threads=dbAll(\n\t\t'select * from forums_threads '\n\t\t.'where forum_id='.$id.' order by last_post_date desc'\n\t);\n\tif ($threads && count($threads)) {\n\t\t$c.='<table id=\"forum-threads\">'\n\t\t\t.'<tr><th>Topics</th><th>Replies</th>'\n\t\t\t.'<th>Author</th><th>Last Post</th></tr>';\n\t\tforeach ($threads as $thread) {\n\t\t\t$user=User::getInstance($thread['creator_id']);\n\t\t\t$last_user=User::getInstance($thread['last_post_by']);\n\t\t\t$user_name=$user?$user->get('name'):'';\n\t\t\t$last_user_name=$last_user?$last_user->get('name'):'';\n\t\t\t$c.='<tr><td><a href=\"'.$PAGEDATA->getRelativeUrl()\n\t\t\t\t.'?forum-f='.$id.'&forum-t='.$thread['id'].'\">'\n\t\t\t\t.htmlspecialchars($thread['name']).'</td><td>'\n\t\t\t\t.($thread['num_posts']-1).'</td>'\n\t\t\t\t.'<td>'.htmlspecialchars($user_name).'</td><td>'\n\t\t\t\t.Core_dateM2H($thread['last_post_date'], 'datetime').', by '\n\t\t\t\t.htmlspecialchars($last_user_name).'</td></tr>';\n\t\t}\n\t\t$c.='</table>';\n\t}\n\telse {\n\t\t$c.='<div class=\"forum-no-threads\"><p>This forum has no threads in it.'\n\t\t\t.' Be the first to post to it!</p></div>';\n\t}\n\t// }\n\t// { post form\n\tif (isset($_SESSION['userdata']) && $_SESSION['userdata']['id']) {\n\t\t$c.='<div id=\"forum-post-submission-form\"><script defer=\"defer\">var forum_id='\n\t\t\t.$id.';</script></div>';\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/ckeditor.js');\n\t\tWW_addScript('//cdn.ckeditor.com/4.4.3/standard/adapters/jquery.js');\n\t\tWW_addScript('forum/frontend/forum.js');\n\t}\n\telse {\n\t\t$c.='<div class=\"forum-not-logged-in\">In order to post to this forum,'\n\t\t\t.' you must <a href=\"/_r?type=loginpage\">login'\n\t\t\t.'</a> first.</div>';\n\t}\n\t// }\n\treturn $c;\n}",
"function thread( $args )\n\t{\n\t $thread_id = (int)$args['id'];\n\t \n\t // check for existance, use threads model\n\t $threads_model = $this->app->\n\t model('forum_threads','forum/models');\n\t \n\t\t// boards model\n\t\t$boards_model = $this->app->\n\t\t model('forum_boards', 'forum/models'); \n\t \n\t // posts model\n\t $posts_model = $this->app->\n\t model('forum_posts','forum/models');\n\t \n\t // get item\n\t $thread = $threads_model->get_item( $thread_id );\n\t $thread = ( count($thread) > 0 ) ? $thread[0] : null;\n\t \n\t \n\t // imprtant stuffs\n\t if( $thread == null ){\n\t \n\t \t// redirect\n\t \t$this->app->redirect('forum');\n\t }\n\t \n\t \n // get board\n $board = $boards_model->get_item((int)$thread['board_id']);\n $board = $board[0];\n \n // set page title\n $this->view->add('page_title',\n 'Viewing thread: ' . $thread['name'] );\n \n // set index action\n $this->view->add('index_action',\n $this->app->form_path('forum'));\n \n // set board action\n $this->view->add('board_action',\n $this->app->form_path('forum/board/'.$board['id']));\n \n // good\n $this->view->add('board_name', $board['name'] );\n\t \n\t // need an action message\n\t $action_message = null;\n\t \n\t // init text area values\n\t $name_value = '';\n\t $post_value = '';\n\t \n\t \n\t // check for post\n\t if( $_SERVER['REQUEST_METHOD'] == 'POST' &&\n\t \tisset($_POST['name']) &&\n\t \t$_POST['name'] != null &&\n\t \tisset($_POST['post']) &&\n\t \t$_POST['name'] != null \n\t ){\n\t \t\n\t \t// add success\n\t \t$success = $posts_model->new_item( \n\t \t\t$this->app->user->get_user_id(), $thread_id, $_POST );\n\t \t\n\t \t// test for success\n\t \tif( $success ){\n\t \t\n\t \t\t// increment reply count\n\t \t\t$threads_model->increment_reply( $thread_id );\n\t \t\t\t \t\n\t \t\t$action_message = 'Post successfully added.';\n\t \t} else {\n\t \t\t$action_message = 'There was an error adding your post';\n\t \t}\n\t \t\n\t } elseif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t \t\n\t \t$action_message = 'One or more required fields was not\n\t \t\tprovided';\n\t \t\t\n\t \t// update values\n\t\t\t$name_value = 'value=\"'.$_POST['name'].'\"';\n\t\t\t$post_value = $_POST['post'];\n\t }\n\t \n\t \n\t // add them\n\t $this->view->add('name_value',$name_value);\n\t $this->view->add('post_value',$post_value);\n\t \n\t // add actio message\n\t $this->view->add('action_message',$action_message);\n\t \n\t // get limits\n\t $limit = 10;\n\t \n\t // get page\n\t $page = 0;\n\t if( isset($_GET['p']) ){\n\t $page = (int)$_GET['p'];\n\t }\n\t \n\t // get replies\n\t $posts_result = $posts_model->limit($limit)->page($page)->\n\t get_all($thread_id);\n\t \n\t //\n\t $this->view->add('posts_result',$posts_result);\n\t \n\t $reply_count = ($thread==null) ? 0 :(int)$thread['reply_count'];\n\t \n\t // add paging\n\t $this->view->add('page_info',array(\n\t // posts count\n\t 'page_count' => (int)(($reply_count) / $limit)+1,\n\t 'this_page' => $page\n\t ));\n\t \n\t \n\t // add actions\n\t $this->view->add('page_action',\n\t $this->app->form_path('forum/thread/'.$thread_id.'?p='));\n\t \n\t $this->view->add('reply_action',$this->app->\n\t form_path('forum/thread/'.$thread_id.'?p='.$page));\n\t \n\t \n\t // add to the view\n\t $this->view->add('thread_result',$thread);\n\t \n\t \n\t // get wysiwyg extension\n\t $wysiwyg = $this->app->extension('wysiwyg');\n\t \n\t}",
"function board_main(){\n\t\tglobal $x7c, $x7s, $db, $prefix, $x7p, $print;\n\n\n\t\tif($x7c->settings['panic']) {\n\t\t\t$print->board_window(\"\",\"\",\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tudpate_unread();\n\t\t\n\t\tif(isset($_GET['newboard'])){\n\t\t\tcreate_board();\n\t\t}\n\t\telse if(isset($_GET['board'])){\n\t\t\tshow_board($_GET['board']);\n\t\t}\n\t\telse if(isset($_GET['send'])){\n\t\t\tnew_communication($_GET['send']);\n\t\t}\n\t\telse if(isset($_GET['delete'])){\n\t\t\tdelete_message($_GET['delete']);\n\t\t}\n\t\telse if(isset($_GET['delboard'])){\n\t\t\tdelete_board($_GET['delboard']);\n\t\t}\n\t\telse if(isset($_GET['readall'])){\n\t\t\tread_all();\n\t\t}\n\t\telse if(isset($_GET['move'])){\n move_msg();\n\t\t}\n\t\telse \n\t\t\tboard_list();\n\t}",
"public function show_forums()\n\t{\n\t\t// Navigation de la page\n\t\tif ($this->cat)\n\t\t{\n\t\t\t$this->nav = Forum::nav($this->cat, array(), $this);\n\t\t\tFsb::$tpl->set_vars(array(\n\t\t\t\t'U_LOW_FORUM' =>\t\tsid(ROOT . 'index.' . PHPEXT . '?p=low&id=' . $this->cat),\n\t\t\t));\n\t\t}\n\n\t\t// Derniere visite sur l'index ?\n\t\tif (Fsb::$mods->is_active('update_last_visit') && Fsb::$mods->is_active('last_visit_index') && Fsb::$session->id() <> VISITOR_ID && $last_visit = Http::getcookie('last_visit'))\n\t\t{\n\t\t\tFsb::$tpl->set_vars(array(\n\t\t\t\t'L_LAST_VISIT_INDEX' =>\t\tsprintf(Fsb::$session->lang('last_visit_index'), Fsb::$session->print_date($last_visit)),\n\t\t\t));\n\t\t}\n\n\t\t// Balise META pour la syndications RSS\n\t\tHttp::add_meta('link', array(\n\t\t\t'rel' =>\t\t'alternate',\n\t\t\t'type' =>\t\t'application/rss+xml',\n\t\t\t'title' =>\t\tFsb::$session->lang('rss'),\n\t\t\t'href' =>\t\tsid(ROOT . 'index.' . PHPEXT . '?p=rss&mode=index&cat=' . $this->cat),\n\t\t));\n\n\t\tFsb::$tpl->set_file('forum/forum_index.html');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'IS_CAT' =>\t\t\t\t\t($this->cat) ? true : false,\n\n\t\t\t'U_MARKREAD_FORUMS' =>\t\tsid(ROOT . 'index.' . PHPEXT . '?markread=true' . (($this->cat) ? '&cat=' . $this->cat : '')),\n\t\t));\n\n\t\t// Sujets lus\n\t\t$forum_topic_read = (!Fsb::$session->is_logged()) ? array() : Forum::get_topics_read(1);\n\n\t\t// On recupere les forums, avec une jointure sur les messages lus pour voir si\n\t\t// le dernier message a ete lu ou non\n\t\t$result = Forum::query(($this->cat == null) ? '' : 'WHERE f.f_cat_id = ' . $this->cat);\n\n\t\t$can_display_subforum = false;\n\t\twhile ($forum = Fsb::$db->row($result))\n\t\t{\n\t\t\tif ($forum['f_parent'] == 0)\n\t\t\t{\n\t\t\t\t$parent_id = $forum['f_id'];\n\t\t\t\t$last_cat = $forum;\n\t\t\t\t$can_display_subforum = false;\n\t\t\t}\n\t\t\telse if (Fsb::$session->is_authorized($forum['f_id'], 'ga_view') && (Fsb::$cfg->get('display_subforums') || $forum['f_parent'] == $parent_id))\n\t\t\t{\n\t\t\t\t// On affiche la categorie\n\t\t\t\tif ($last_cat)\n\t\t\t\t{\n\t\t\t\t\tFsb::$tpl->set_blocks('cat', array(\n\t\t\t\t\t\t'CAT_ID' =>\t\t$forum['f_id'],\n\t\t\t\t\t\t'NAME' =>\t\thtmlspecialchars($last_cat['f_name']),\n\t\t\t\t\t\t'U_CAT' =>\t\tsid(ROOT . 'index.' . PHPEXT . '?cat=' . $last_cat['f_id']),\n\t\t\t\t\t));\n\t\t\t\t\t$last_cat = null;\n\t\t\t\t}\n\n\t\t\t\t// Forum lu ou non lu ?\n\t\t\t\t$is_read = (Fsb::$session->is_logged() && isset($forum_topic_read[$forum['f_id']]) && $forum_topic_read[$forum['f_id']] > 0) ? false : true;\n\n\t\t\t\t// On affiche le forum\n\t\t\t\tForum::display($forum, 'forum', 0, $is_read);\n\t\t\t\t\n\t\t\t\t$can_display_subforum = true;\n\t\t\t\t$sub_parent_id = $forum['f_id'];\n\t\t\t}\n\t\t\telse if ($can_display_subforum && Fsb::$session->is_authorized($forum['f_id'], 'ga_view') && !Fsb::$cfg->get('display_subforums') && $forum['f_parent'] == $sub_parent_id)\n\t\t\t{\n\t\t\t\t// Forum lu ou non lu ?\n\t\t\t\t$is_read = (Fsb::$session->is_logged() && isset($forum_topic_read[$forum['f_id']]) && $forum_topic_read[$forum['f_id']] > 0) ? false : true;\n\n\t\t\t\t// On affiche le sous forum\n\t\t\t\tForum::display($forum, 'subforum', 0, $is_read);\n\t\t\t}\n\t\t}\n\t\tFsb::$db->free($result);\n\t}",
"public function submit()\n {\n // @todo remove $_REQUEST['do']\n $what = in('do');\n if ( empty($what) ) $what = in('forum');\n\n $forum_do_list = [\n 'ping',\n 'api',\n 'forum_create',\n 'forum_edit',\n 'forum_delete',\n 'setting_submit',\n 'edit_submit',\n 'post_edit_submit',\n 'post_delete_submit', // @todo implement ajax call.\n 'post_like',\n 'comment_like',\n 'comment_edit_submit', // @todo implement ajax call.\n 'comment_delete_submit', // @todo implement ajax call.\n 'file_upload', // @todo implement ajax call.\n 'file_delete', // @todo implement ajax call.\n 'blogger_getUsersBlogs',\n 'user_register',\n 'user_update',\n 'user_delete',\n 'user_check_session_id',\n 'user_login_check',\n 'login',\n 'logout',\n 'export',\n 'import_submit',\n 'ajax_search',\n ];\n\n if ( in_array( $what, $forum_do_list ) ) {\n $this->$what(); /// @Attention all the function here must end with wp_send_json_success/error()\n exit; // no effect...\n }\n /**\n else {\n $error = \"You cannot call the method - '$what' because the method is not listed on 'forum(do) list'.\";\n ferror( -4444, $error );\n }\n */\n\n\n }",
"public function action_messageindex_fp()\n\t{\n\t\tglobal $modSettings, $board;\n\n\t\t$board = $modSettings['message_index_frontpage'];\n\t\tloadBoard();\n\n\t\t$this->action_messageindex();\n\t}",
"function asForumPosts($data) {\r\n$IPBHTML = \"\";\r\n//--starthtml--//\r\n$IPBHTML .= <<<EOF\r\n<!--Begin Msg Number {$data['pid']}-->\n<div class='post_block hentry clear no_sidebar ipsBox_container' id='post_id_{$data['pid']}'>\n\t<div class='post_wrap'>\n\t\t<if test=\"postMid:|:$data['member_id']\">\n\t\t\t<h3 class='row2'>\n\t\t<else />\n\t\t\t<h3 class='guest row2'>\n\t\t</if>\n\t\t<if test=\"postModCheckbox:|:$this->memberData['g_is_supmod']\">\n\t\t\t<span class='right'>\n\t\t\t\t<label for='checkbox_{$data['pid']}' class='post_mod hide'>{$this->lang->words['mod_select_post']}</label><input type='checkbox' id='checkbox_{$data['pid']}' name='selectedpids[]' value='{$data['pid']}' class='post_mod right'<if test=\"postModSelected:|:!empty( $data['_pid_selected'] )\"> checked='checked'</if> />\n\t\t\t</span>\n\t\t</if>\n\t\t\t<span class='post_id right ipsType_small desc blend_links'><a href='{parse url=\"showtopic={$data['topic_id']}&view=findpost&p={$data['pid']}\" template=\"showtopic\" seotitle=\"{$data['title_seo']}\" base=\"public\"}' rel='bookmark' title='{$this->lang->words['link_to_post']} #{$data['pid']}'>#{$data['pid']}</a></span>\n\t\t\t<a href=\"{parse url=\"showtopic={$data['tid']}\" seotitle=\"{$data['title_seo']}\" template=\"showtopic\" base=\"public\"}\">{IPSText::truncate( $data['topic_title'], 80)}</a>\n\t\t</h3>\n\t\t<div class='post_body'>\n\t\t\t<p class='posted_info desc lighter ipsType_small'>\n\t\t\t\t<img src='{$data['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_tiny' /> {$this->lang->words['posted']} {$this->lang->words['search_by']}\n\t\t\t\t<if test=\"postMember:|:$data['member_id']\"><span class=\"author vcard\">{parse template=\"userHoverCard\" group=\"global\" params=\"$data\"}</span><else />{$data['members_display_name']}</if>\n\t\t\t\t{$this->lang->words['on']} <abbr class=\"published\" title=\"{parse expression=\"date( 'c', $data['_post_date'] )\"}\">{parse date=\"$data['_post_date']\" format=\"long\"}</abbr>\n\t\t\t\t<if test=\"hasForumTrail:|:$data['_forum_trail']\">\n\t\t\t\t\t{$this->lang->words['in']}\n\t\t\t\t\t<foreach loop=\"topicsForumTrail:$data['_forum_trail'] as $i => $f\">\n\t\t\t\t\t\t<if test=\"notLastFtAsForum:|:$i+1 == count( $data['_forum_trail'] )\"><a href='{parse url=\"{$f[1]}\" template=\"showforum\" seotitle=\"{$f[2]}\" base=\"public\"}'>{$f[0]}</a></if>\n\t\t\t\t\t</foreach>\n\t\t\t\t</if>\n\t\t\t</p>\n\t\t\t<div class='post entry-content'>\n\t\t\t\t{$data['post']}\n\t\t\t\t{$data['attachmentHtml']}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<br />\n</div>\n<hr />\n<br />\r\nEOF;\r\n//--endhtml--//\r\nreturn $IPBHTML;\r\n}",
"function preview_forums()\n\t{\n\t\t//-----------------------------------------\n\t\t// Check for a valid ID\n\t\t//-----------------------------------------\n\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя произвести изменения в масках доступа этому ID, пожалуйста, попытайтесь еще раз\");\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $perms = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя произвести изменения в масках доступа этому ID, пожалуйста, попытайтесь еще раз\");\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// What we doin'?\n\t\t//-----------------------------------------\n\n\t\tswitch( $this->ipsclass->input['t'] )\n\t\t{\n\t\t\tcase 'start':\n\t\t\t\t$human_type = '<b>Создание тем</b> в этом форуме';\n\t\t\t\t$code_word = 'start_perms';\n\t\t\t\tbreak;\n\n\t\t\tcase 'reply':\n\t\t\t\t$human_type = '<b>Публикация ответов</b> в этом форуме';\n\t\t\t\t$code_word = 'reply_perms';\n\t\t\t\tbreak;\n\n\t\t\tcase 'show':\n\t\t\t\t$human_type = '<b>Просмотр форума</b> в этом форуме';\n\t\t\t\t$code_word = 'show_perms';\n\t\t\t\tbreak;\n\n\t\t\tcase 'upload':\n\t\t\t\t$human_type = '<b>Загрузка файлов</b> в этом форуме';\n\t\t\t\t$code_word = 'upload_perms';\n\t\t\t\tbreak;\n\n\t\t\tcase 'download':\n\t\t\t\t$human_type = '<b>Скачивание файлов</b> в этом форуме';\n\t\t\t\t$code_word = 'download_perms';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$human_type = '<b>Просмотр</b> этого форума';\n\t\t\t\t$code_word = 'read_perms';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Get all members using that ID then!\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"$human_type\" , \"100%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Просмотр: \" . $perms['perm_name'] );\n\n\t\t$the_html = \"\";\n\n\t\t$perm_id = intval($this->ipsclass->input['id']);\n\n\t\t$theforums = $this->forumfunc->ad_forums_forum_list(1);\n\n\t\tforeach( $theforums as $v )\n\t\t{\n\t\t\t$id = $v[0];\n\t\t\t$name = $v[1];\n\n\t\t\t$this->ipsclass->forums->forum_by_id[$id][ $code_word ] = isset($this->ipsclass->forums->forum_by_id[$id][ $code_word ]) ? $this->ipsclass->forums->forum_by_id[$id][ $code_word ] : '';\n\n\t\t\tif ($this->ipsclass->forums->forum_by_id[$id][ $code_word ] == '*')\n\t\t\t{\n\t\t\t\t$the_html[] = \"<span style='color:green;font-weight:bold''>\".$name.\"</span>\";\n\t\t\t}\n\t\t\telse if (preg_match( \"/(^|,)\".$perm_id.\"(,|$)/\", $this->ipsclass->forums->forum_by_id[$id][ $code_word ]) )\n\t\t\t{\n\t\t\t\t$the_html[] = \"<span style='color:green;font-weight:bold''>\".$name.\"</span>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( $code_word != 'show_perms' AND $this->ipsclass->forums->forum_by_id[$id]['parent_id'] == 'root' )\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// CATEGORY\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$the_html[] = \"<span style='color:grey;'>\".$name.\"</span>\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t// CAN'T ACCESS\n\t\t\t\t\t//-----------------------------------------\n\n\t\t\t\t\t$the_html[] = \"<span style='color:red;font-weight:bold''>\".$name.\"</span>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$html = implode( \"<br />\", $the_html );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( $html ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'preview_forums' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $this->ipsclass->input['id'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \" \" , \"60%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \" \" , \"40%\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Информация\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"$human_type: возможно\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"<input type='text' readonly='readonly' style='border:1px solid black;background-color:green;size=30px' name='blah'>\"\n\t\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"$human_type: невозможно\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"<input type='text' readonly='readonly' style='border:1px solid gray;background-color:red;size=30px' name='blah'>\"\n\t\t\t\t\t\t\t\t\t\t ) );\n\n\t\tif( $code_word != \"show_perms\" )\n\t\t{\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\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\"<input type='text' readonly='readonly' style='border:1px solid gray;background-color:grey;size=30px' name='blah'>\"\n\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array(\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$this->ipsclass->adskin->form_dropdown( 't',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( 0 => array( 'start', 'Создание тем' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 1 => array( 'reply', 'Публикацию ответов' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'read' , 'Чтение тем' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'show' , 'Просмотр форума' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'upload', 'Загрузку файлов' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 5 => array( 'download', 'Скачивание файлов' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ), $this->ipsclass->input['t'] )\n\t\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form( \"Просмотреть\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->print_popup();\n\n\t}",
"function phpBB_init()\n\t{\n\t}",
"function dream_post_forum_action($db, $dreamid, $content) {\n global $pwpdo;\n $forum = \"Policy Forum\";\n $topic_match = \"Policy #$dreamid\";\n\t$query = \"SELECT name, private FROM pw_dyn_dreammp WHERE dream_id = ?\";\n\tlist ($name, $private) =$pwpdo->get_single_row($query,array($dreamid)); # allows no rows\n $topic = $topic_match . \" - \" . $name;\n if ($private != 1)\n forummagic_post($db, $forum, $topic_match, $topic, $content);\n}",
"public function action_home()\n\t{\n\t\tglobal $txt, $context, $settings;\n\n\t\t// We need a little help\n\t\trequire_once(SUBSDIR . '/Membergroups.subs.php');\n\n\t\t// You have to be able to do at least one of the below to see this page.\n\t\tisAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'));\n\n\t\t// Find all of this forum's administrators...\n\t\tif (listMembergroupMembers_Href($context['administrators'], 1, 32) && allowedTo('manage_membergroups'))\n\t\t{\n\t\t\t// Add a 'more'-link if there are more than 32.\n\t\t\t$context['more_admins_link'] = '<a href=\"' . getUrl('moderate', ['action' => 'moderate', 'area' => 'viewgroups', 'sa' => 'members', 'group' => 1]) . '\">' . $txt['more'] . '</a>';\n\t\t}\n\n\t\t// This makes it easier to get the latest news with your time format.\n\t\t$context['time_format'] = urlencode($this->user->time_format);\n\t\t$context['forum_version'] = FORUM_VERSION;\n\n\t\t// Get a list of current server versions.\n\t\t$context['current_versions'] = getServerVersions($this->_checkFor);\n\t\t$context['can_admin'] = allowedTo('admin_forum');\n\t\t$context['sub_template'] = 'admin';\n\t\t$context['page_title'] = $txt['admin_center'];\n\t\t$context[$context['admin_menu_name']]['tab_data'] = array(\n\t\t\t'title' => $txt['admin_center'],\n\t\t\t'help' => '',\n\t\t\t'description' => '\n\t\t\t\t<span class=\"bbc_strong\">' . $txt['hello_guest'] . ' ' . $context['user']['name'] . '!</span>\n\t\t\t\t' . sprintf($txt['admin_main_welcome'], $txt['admin_control_panel']),\n\t\t);\n\n\t\t// Load in the admin quick tasks\n\t\t$context['quick_admin_tasks'] = getQuickAdminTasks();\n\t}",
"private function action_forumSettings()\n\t{\n\t\tglobal $txt, $incontext, $databases, $db_type, $db_connection;\n\n\t\t$incontext['sub_template'] = 'forum_settings';\n\t\t$incontext['page_title'] = $txt['install_settings'];\n\n\t\t// Let's see if we got the database type correct.\n\t\tif (isset($_POST['db_type'], $databases[$_POST['db_type']]))\n\t\t{\n\t\t\t$db_type = $_POST['db_type'];\n\t\t}\n\n\t\t// Else we'd better be able to get the connection.\n\t\telse\n\t\t{\n\t\t\tload_database();\n\t\t}\n\n\t\t$db_type = $_POST['db_type'] ?? $db_type;\n\n\t\t// What host and port are we on?\n\t\t$host = empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] . (empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT']) : $_SERVER['HTTP_HOST'];\n\n\t\t// Now, to put what we've learned together... and add a path.\n\t\t$incontext['detected_url'] = 'http' . (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 's' : '') . '://' . $host . strtr(substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')), array('/install' => ''));\n\n\t\t// Check if the database sessions will even work.\n\t\t$incontext['test_dbsession'] = ini_get('session.auto_start') != 1;\n\t\t$incontext['continue'] = 1;\n\n\t\t// Submitting?\n\t\tif (isset($_POST['boardurl']))\n\t\t{\n\t\t\tif (substr($_POST['boardurl'], -10) == '/index.php')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = substr($_POST['boardurl'], 0, -10);\n\t\t\t}\n\t\t\telseif (substr($_POST['boardurl'], -1) == '/')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = substr($_POST['boardurl'], 0, -1);\n\t\t\t}\n\n\t\t\tif (substr($_POST['boardurl'], 0, 7) != 'http://' && substr($_POST['boardurl'], 0, 7) != 'file://' && substr($_POST['boardurl'], 0, 8) != 'https://')\n\t\t\t{\n\t\t\t\t$_POST['boardurl'] = 'http://' . $_POST['boardurl'];\n\t\t\t}\n\n\t\t\t// Save these variables.\n\t\t\t$vars = array(\n\t\t\t\t'boardurl' => $_POST['boardurl'],\n\t\t\t\t'boarddir' => addslashes(TMP_BOARDDIR),\n\t\t\t\t'sourcedir' => addslashes(TMP_BOARDDIR) . '/sources',\n\t\t\t\t'cachedir' => addslashes(TMP_BOARDDIR) . '/cache',\n\t\t\t\t'mbname' => strtr($_POST['mbname'], array('\\\"' => '\"')),\n\t\t\t\t'language' => substr($_SESSION['installer_temp_lang'], 8, -4),\n\t\t\t\t'extdir' => addslashes(TMP_BOARDDIR) . '/sources/ext',\n\t\t\t);\n\n\t\t\t// Must save!\n\t\t\tif (!updateSettingsFile($vars))\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['settings_error'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Make sure it works.\n\t\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\n\t\t\t// Set our db character_set to utf8\n\t\t\tupdateSettingsFile(array('db_character_set' => 'utf8'));\n\n\t\t\t// Good, skip on.\n\t\t\treturn true;\n\t\t}\n\n\t\tdefinePaths();\n\n\t\treturn false;\n\t}",
"function main()\t{\n\t\t\t\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t\t\t\t// Access check!\n\t\t\t\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t\t\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t\t\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t\tif (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))\t{\n\n\t\t\t\t\t\t\t// Draw the header.\n\t\t\t\t\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t\t\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t\t\t\t$this->doc->form='<form action=\"\" method=\"post\" enctype=\"multipart/form-data\">';\n\n\t\t\t\t\t\t\t// JavaScript\n\t\t\t\t\t\t$this->doc->JScode = '\n\t\t\t\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfunction confirmURL(text,URL){\n\t\t\t\t\t\t\t\t\tvar agree=confirm(text);\n\t\t\t\t\t\t\t\t\tif (agree) {\n\t\t\t\t\t\t\t\t\t\tjumpToUrl(URL);\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</script>\n\t\t\t\t\t\t';\n\t\t\t\t\t\t$this->doc->postCode='\n\t\t\t\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t';\n\n\t\t\t\t\t\t$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />'\n\t\t\t\t\t\t\t. $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);\n\n\t\t\t\t\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t\t\t\t$this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));\n\t\t\t\t\t\t$this->content.=$this->doc->divider(5);\n\n\n\t\t\t\t\t\t// Render content:\n\t\t\t\t\t\t$this->moduleContent();\n\n\n\t\t\t\t\t\t// ShortCut\n\t\t\t\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// If no access or if ID == zero\n\n\t\t\t\t\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t\t\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t\t\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}",
"function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\n\t\n\t\t\t// Draw the header.\n\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t$this->doc->backPath = $BACK_PATH;\n\t\t$this->doc->form='<form action=\"\" method=\"POST\">';\n\n\t\t\t// JavaScript\n\t\t$this->doc->JScode = '\n\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\tscript_ended = 0;\n\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\tdocument.location = URL;\n\t\t\t\t}\n\t\t\t</script>\n\t\t';\n\t\t$this->doc->postCode='\n\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\tscript_ended = 1;\n\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t</script>\n\t\t';\n\n\t\t$headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.$LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path').': '.t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50);\n\n\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t$this->content.=$this->doc->divider(5);\n\n\t\t// Render content:\n\t\t$this->moduleContent();\n\n\t\t// ShortCut\n\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));\n\t\t}\n\n\t\t$this->content.=$this->doc->spacer(10);\n\n\t}",
"function caldol_hook_bbp_theme_before_forum_sub_forums(){\n\n\n\t\t\n\n\t\t//echo \"count: \" . bbp_get_forum_subforum_count() . \" --\";\n\n\t\t\n\n\t\t\n\n\t\t$subForumList = bbp_forum_get_subforums();\n\n\t\t\n\n\t\tif(sizeof($subForumList) > 1){\n\n\t\t\techo \"<ul style='margin-left: 20px;'>\";\n\n\t\tforeach($subForumList as $currForum){\n\n\t\t\t//print_r($currForum);\n\n\t\t\t// No link\n\n\t\t\t$retval = false;\n\n\t\t\t\t\n\n\t\t\t// Parse the arguments\n\n\t\t\t$r = bbp_parse_args( $args, array(\n\n\t\t\t\t\t'forum_id' => $currForum->ID,\n\n\t\t\t\t\t'user_id' => 0,\n\n\t\t\t\t\t'before' => '',\n\n\t\t\t\t\t'after' => '',\n\n\t\t\t\t\t'subscribe' => __( 'Subscribe', 'bbpress' ),\n\n\t\t\t\t\t'unsubscribe' => __( 'x', 'bbpress' )\n\n\t\t\t), 'get_forum_subscribe_link' );\n\n\t\t\t\t\n\n\t\t\t\n\n\t\t\t$isSubscribed = bbp_get_forum_subscription_link( $r);\n\n\t\t\t\n\n\t\t\t\t\n\n\t\t\tif(strpos($isSubscribed, 'is-subscribed') != 0){\n\n\t\t\t\n\n\t\t\techo \"<li class='bbp-topic-title'><a href='\" . bbp_get_forum_permalink($currForum->ID) . \"'>\" . $currForum->post_title . \"</a><span class='bbp-topic-action'> \" . $isSubscribed . \" </span></li>\";\n\n\t\t\t}\n\n\t\t\t//print_r($currForum);\n\n\t\t}\n\n\t\t\techo \"</ul>\";\n\n\t\t} // end > 1\n\n\t\t\n\n\t\t\n\n}",
"function sMain ()\n\t{\n\t\tglobal $ttH;\n\t\t\n\t\t$ttH->func->load_language_admin($this->modules);\n\t\t$ttH->temp_act = new XTemplate($ttH->path_html.$this->modules.DS.$this->action.\".tpl\");\n\t\t$ttH->temp_act->assign('LANG', $ttH->lang);\n\t\t$ttH->temp_act->assign('DIR_IMAGE', $ttH->dir_images);\n\t\t\n\t\t$fun = (isset($ttH->post['f'])) ? $ttH->post['f'] : '';\n\n\t\tflush();\n\t\tswitch ($fun) {\n\t\t\tcase \"list_widget\":\n\t\t\t\techo $this->do_list_widget();\n\t\t\t\texit;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\techo '';\n\t\t\t\texit;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\texit;\n\t}"
] |
[
"0.754264",
"0.68944496",
"0.67088366",
"0.65868694",
"0.6571004",
"0.65694106",
"0.6556852",
"0.65398574",
"0.6417785",
"0.6386574",
"0.63636935",
"0.6362771",
"0.6346904",
"0.6334447",
"0.63334674",
"0.6305061",
"0.6299117",
"0.6253327",
"0.62343556",
"0.61920244",
"0.6173596",
"0.6171349",
"0.6158304",
"0.6157795",
"0.615241",
"0.61495143",
"0.6149247",
"0.61336654",
"0.613237",
"0.61311364"
] |
0.8874333
|
0
|
Class profits_header_widget ends here Register and load the widget
|
function profit_header_load_widget()
{
register_widget('profits_header_widget');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}",
"function generate_construct_header_widget() {\n\t\tif ( is_active_sidebar( 'header' ) ) : ?>\n\t\t\t<div class=\"header-widget\">\n\t\t\t\t<?php dynamic_sidebar( 'header' ); ?>\n\t\t\t</div>\n\t\t<?php endif;\n\t}",
"function header_widgets_init() {\r\n\r\n\tregister_sidebar( array(\r\n\t\t'name' => 'Header Widget',\r\n\t\t'id' => 'header_widget',\r\n\t\t'before_widget' => '<div class=\"header-widget\">',\r\n\t\t'after_widget' => '</div>',\r\n\t\t'before_title' => '',\r\n\t\t'after_title' => '',\r\n\t) );\r\n\r\n}",
"function cwcg_load_widget() {\n register_widget( 'cwcg_test_grid_widget' );\n}",
"public function widget($args, $instance)\n {\n $profit_header_title = apply_filters('widget_header', $instance['profit_header_title']);\n $profit_header_desc = apply_filters('widget_header', $instance['profit_header_desc']);\n $profit_header_img = apply_filters('widget_header', $instance['profit_header_img']);\n \n \n\n // This is where you run the code and display the output\n \n echo '<header style=\"background-image: url( ' . $profit_header_img . ' ); background-repeat: no-repeat; background-attachment: fixed; background-position: center; background-size: cover; height: 400px; \">';\n echo ' <div class=\"valign-wrapper\" style=\"background-color: rgba(0,0,0,.15) !important; height: inherit;\">';\n echo ' <div class=\"valign center-block\">';\n echo ' <h1 class=\"center-align lsm-header-title white-text display-1\"> ' . $profit_header_title . ' </h1>';\n echo ' <h4 class=\"center lsm-header-title white-text display-4\" style=\"font-family: Great Vibes, cursive !important;\"> ' . $profit_header_desc . ' </h4> ';\n echo ' </div>';\n echo ' </div>';\n echo '</header>';\n \n }",
"function ois_load_widgets() {\r\n register_widget( 'OptinSkin_Widget' );\r\n}",
"function abc_load_widget()\n{\n register_widget('awesome_bmi_widget');\n}",
"function hw_load_widget() {\n\tregister_widget( 'hw_cal_widget' );\n\tregister_widget( 'hw_custom_post_list_widget' );\n}",
"function studio_before_header_widget_area() {\n\n\tgenesis_widget_area( 'before-header', array(\n\t 'before' => '<div class=\"before-header\"><div class=\"wrap\">',\n\t 'after'\t => '</div></div>',\n\t) );\n}",
"function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}",
"function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }",
"function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}",
"function wpb_widgets_init()\n{\n\n register_sidebar(array(\n 'name' => 'Custom Header Widget Area',\n 'id' => 'custom-header-widget',\n 'before_widget' => '<div class=\"chw-widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"chw-title\">',\n 'after_title' => '</h2>',\n ));\n}",
"function d7_schema_info_widget_load_widget() {\n\tregister_widget( 'd7_schema_info_widget' );\n}",
"function copyright_load_widget() {\n register_widget( 'copyright_widget' );\n}",
"public function initPageHeaderToolbar()\n {\n if (empty($this->display)){\n $this->page_header_toolbar_btn = array(\n 'new' => array(\n 'href' => self::$currentIndex.'&addwpproductcarousels&token='.$this->token,\n 'desc' => $this->l('Add New Carousel', null, null, false),\n 'icon' => 'process-icon-new'\n ),\n 'options' => array(\n 'href' => $this->context->link->getAdminLink('AdminModules') . '&configure=wpproductcarousels',\n 'desc' => $this->l('Options'),\n 'icon' => 'process-icon-cogs'\n )\n );\n }\n\n parent::initPageHeaderToolbar();\n }",
"function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}",
"function whichet_load_widget() {\n\tregister_widget( 'WHICHet_widget' );\n\tadd_action( 'wp_enqueue_script', 'WHICHet_scripts' );\n}",
"public function init_header() {\r\n\t\t\twp_enqueue_script( 'jquery' );\r\n\t\t\twp_enqueue_script( 'thickbox' );\r\n\t\t\twp_enqueue_style( 'thickbox' );\r\n\t\t\twp_enqueue_script( 'media-upload' );\r\n\t\t\twp_enqueue_style( 'wp-color-picker' );\r\n\t\t\twp_enqueue_script( 'wp-color-picker' );\r\n\t\t\twp_enqueue_script( 'jquery-ui-sortable' );\r\n\t\t\twp_enqueue_script( 'jquery-ui-progressbar' );\r\n\t\t\twp_enqueue_media();\r\n\r\n\t\t\tif ( ! wp_style_is( 'netivo-jq-ui', 'enqueued' ) ) {\r\n\t\t\t\twp_enqueue_style( 'netivo-jq-ui', NT_CORE_PLUGIN_URL . \"/assets/admin/css/jquery-ui.min.css\" );\r\n\t\t\t}\r\n\r\n\t\t\tif ( ! wp_style_is( 'netivo-admin', 'enqueued' ) ) {\r\n\t\t\t\twp_enqueue_style( 'netivo-admin', NT_CORE_PLUGIN_URL . \"/assets/admin/css/admin.min.css\" );\r\n\t\t\t}\r\n\t\t\tif ( ! wp_script_is( 'netivo-admin', 'enqueued' ) ) {\r\n\t\t\t\twp_enqueue_script( 'netivo-admin', NT_CORE_PLUGIN_URL . \"/assets/admin/js/admin.min.js\" );\r\n\t\t\t}\r\n\t\t\t$this->custom_header();\r\n\t\t}",
"public static function widget() {\n //require_once( 'widget.php' );\n require_once get_stylesheet_directory() . '/inc/templates/statistics_widget.php';\n }",
"function honeycomb_above_header_widget_region() {\n\t\tif ( is_active_sidebar( 'header-1' ) ) {\n\t\t?>\n\t\t<div class=\"header-above-widget-region\" role=\"complementary\">\n\t\t\t<div class=\"col-full\">\n\t\t\t\t<?php dynamic_sidebar( 'header-1' ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t\t}\n\t}",
"function klippe_mikado_register_top_header_areas() {\n\t\tregister_sidebar(\n\t\t\tarray(\n\t\t\t\t'id' => 'mkdf-top-bar-left',\n\t\t\t\t'name' => esc_html__( 'Header Top Bar Left Column', 'klippe' ),\n\t\t\t\t'description' => esc_html__( 'Widgets added here will appear on the left side in top bar header', 'klippe' ),\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s mkdf-top-bar-widget\">',\n\t\t\t\t'after_widget' => '</div>'\n\t\t\t)\n\t\t);\n\t\t\n\t\tregister_sidebar(\n\t\t\tarray(\n\t\t\t\t'id' => 'mkdf-top-bar-right',\n\t\t\t\t'name' => esc_html__( 'Header Top Bar Right Column', 'klippe' ),\n\t\t\t\t'description' => esc_html__( 'Widgets added here will appear on the right side in top bar header', 'klippe' ),\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s mkdf-top-bar-widget\">',\n\t\t\t\t'after_widget' => '</div>'\n\t\t\t)\n\t\t);\n\t}",
"function duende_load_widget() {\n\tregister_widget( 'duende_widget' );\n}",
"function register_header( $wp_customize ) {\n\t$wp_customize->add_panel( 'header', array(\n\t\t'title' => esc_html__( 'Đầu trang', 'phoenixdigi' ),\n\t\t'priority' => 10,\n\t) );\n\n\t$wp_customize->add_section( 'header_template', array(\n\t\t'title' => esc_html__( 'Mẫu giao diện', 'phoenixdigi' ),\n\t\t'panel' => 'header',\n\t) );\n\n\t$wp_customize->add_setting( 'header_template' , array(\n\t\t'default' => 0,\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$library_ids = get_posts( array(\n\t\t'post_type' => 'elementor_library',\n\t\t'fields' => 'ids',\n\t\t// 'meta_key' => 'elementor_library_type',\n\t\t// 'meta_value' => 'header',\n\t\t'posts_per_page' => -1\n\t));\n\n\t$templates = array(\n\t\t'0' => esc_html__( 'Không chọn', 'phoenixdigi' ),\n\t);\n\n\tif ( $library_ids ) {\n\t\tforeach ( $library_ids as $id ) {\n\t\t\t$templates[ $id ] = get_the_title( $id );\n\t\t}\n\t}\n\n\t$wp_customize->add_control( 'header_template', array(\n\t\t'type' => 'select',\n\t\t'label' => esc_html__( 'Mẫu giao diện', 'phoenixdigi' ),\n\t\t'description' => esc_html__( 'Chọn mẫu giao diện cho Header.', 'phoenixdigi' ),\n\t\t'choices' => $templates,\n\t\t'section' => 'header_template',\n\t) );\n\n\t$wp_customize->add_section( 'header_script', array(\n\t\t'title' => esc_html__( 'Nhúng mã Script', 'phoenixdigi' ),\n\t\t'panel' => 'header',\n\t) );\n\n\t// Header script.\n\t$wp_customize->add_setting( 'header_script' , array(\n\t\t'default' => pdvn_get_option_default( 'banner_right' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'header_script', array(\n\t\t'type' => 'textarea',\n\t\t'label' => esc_html__( 'Header script', 'phoenixdigi' ),\n\t\t'description' => esc_html__( 'Nhúng mã Script xuống sau thẻ <head> ví dụ mã Google Analytics.', 'phoenixdigi' ),\n\t\t'section' => 'header_script',\n\t) );\n\n\t// Allow print header script.\n\t$wp_customize->add_setting( 'header_script_on_off' , array(\n\t\t'default' => pdvn_get_option_default( 'header_script_on_off' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'header_script_on_off', array(\n\t\t'type' => 'checkbox',\n\t\t'label' => esc_html__( 'Cho phép nhúng Header script', 'phoenixdigi' ),\n\t\t'section' => 'header_script',\n\t) );\n}",
"public function register_widget() {\n register_widget( 'WPP_Widget' );\n }",
"function holistic_nav_widget() {\n\tregister_widget( 'Holistic_Nav_Widget' );\n}",
"public static function widget() {\n require_once( 'includes/widget.php' );\n }",
"function esh_load_footer_widget() {\n\tregister_widget( 'esh_footer_widget' );\n}",
"function gardenia_load_widget() {\n\tregister_widget( 'gardenia_widget' );\n}",
"function ftagementor_description_Widget() {\r\r\n register_widget( 'ftagementor_description_Widget' );\r\r\n}"
] |
[
"0.6875719",
"0.6601905",
"0.657223",
"0.65186024",
"0.64580643",
"0.64568704",
"0.63545555",
"0.63382465",
"0.63365275",
"0.63359994",
"0.62689584",
"0.625474",
"0.6245398",
"0.61643374",
"0.6104757",
"0.6060996",
"0.6060578",
"0.5997197",
"0.59774274",
"0.59322804",
"0.5917615",
"0.5915093",
"0.5912393",
"0.59103066",
"0.59001505",
"0.58966273",
"0.58962363",
"0.5890717",
"0.5882692",
"0.58774567"
] |
0.8666772
|
0
|
Convert RGB Color to Hexadecimal color Example: Scaffold_rgbtohex(array(255,255,255)) => FFFFFF
|
function Scaffold_rgbtohex($rgb) {
$hex = "";
for($i=0; $i < 3; $i++) {
// Convert the decimal digit to hex
$hexDigit = dechex($rgb[$i]);
// Add a leading zero if necessary
if(strlen($hexDigit) == 1) {
$hexDigit = "0" . $hexDigit;
}
// Append to the hex string
$hex .= $hexDigit;
}
// Return the complete hex string
return '#'.$hex;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"static function rgb2hex($rgb) {\n $rgb = Util::eliminarEspacios($rgb);\n if (is_string($rgb)) {\n if (strpos($rgb, \"rgb\") !== false) {\n $rgb = str_replace(\"rgb(\", \"\", str_replace(\")\", \"\", $rgb));\n }\n $rgb = explode(\",\", $rgb);\n }\n\n $hex = \"#\";\n $hex .= str_pad(dechex($rgb[0]), 2, \"0\", STR_PAD_LEFT);\n $hex .= str_pad(dechex($rgb[1]), 2, \"0\", STR_PAD_LEFT);\n $hex .= str_pad(dechex($rgb[2]), 2, \"0\", STR_PAD_LEFT);\n\n return $hex; // returns the hex value including the number sign (#)\n }",
"public static function HexMe(array $rgb)\n {\n if(count($rgb) > 3)\n $rgb = array_slice($rgb,0,3);\n return implode('',array_map('ColorName::ColorDechex',$rgb));\n }",
"protected static function _convertRgbToHex($rgb)\n {\n $r = dechex($rgb['r']);\n If (strlen($r)<2)\n $r='0'.$r;\n\n $g = dechex($rgb['g']);\n If (strlen($g)<2)\n $g='0'.$g;\n\n $b = dechex($rgb['b']);\n If (strlen($b)<2)\n $b='0'.$b;\n\n return '#' . $r . $g . $b;\n }",
"private function rgb_dec_to_hex($rgb)\n {\n return strtoupper(\n str_pad(dechex($rgb['red']), 2, '0', STR_PAD_LEFT).\n str_pad(dechex($rgb['green']), 2, '0', STR_PAD_LEFT).\n str_pad(dechex($rgb['blue']), 2, '0', STR_PAD_LEFT)\n );\n }",
"public static function rgb_array_to_hex_string( array $rgb ) : string {\n\t\treturn self::integer_to_two_character_hex( $rgb['r'] ) . self::integer_to_two_character_hex( $rgb['g'] ) . self::integer_to_two_character_hex( $rgb['b'] );\n\t}",
"function rgbhex($r, $g, $b){\n $r = intval($r);\n $g = intval($g);\n $b = intval($b);\n $r = dechex($r < 0 ? 0 : ($r > 255 ? 255 : $r));\n $g = dechex($g < 0 ? 0 : ($g > 255 ? 255 : $g));\n $b = dechex($b < 0 ? 0 : ($b > 255 ? 255 : $b));\n \n $hex = (strlen($r) < 2 ? '0' : '') . $r;\n $hex .= (strlen($g) < 2 ? '0' : '') . $g;\n $hex .= (strlen($b) < 2 ? '0' : '') . $b;\n\n return $hex;\n}",
"function RGBToHex($r, $g, $b) {\n $hex = \"#\";\n $hex.= str_pad(dechex($r), 2, \"0\", STR_PAD_LEFT);\n $hex.= str_pad(dechex($g), 2, \"0\", STR_PAD_LEFT);\n $hex.= str_pad(dechex($b), 2, \"0\", STR_PAD_LEFT);\n \n return $hex;\n }",
"public static function rgb2hex($r, $g = NULL, $b = NULL) {\n\t\t$rgb = array();\n\t\t\n\t\tif (! is_array($r)) {\n\t\t\t$rgb['r'] = $r;\n\t\t\t$rgb['g'] = $g;\n\t\t\t$rgb['b'] = $b;\n\t\t} else {\n\t\t\t$rgb = $r;\n\t\t}\n\t\t\n\t\t$hex = '#';\n\t\t$hex.= str_pad(dechex($rgb['r']), 2, '0', STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($rgb['g']), 2, '0', STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($rgb['b']), 2, '0', STR_PAD_LEFT);\n\t\t\n\t\treturn $hex;\n\t}",
"private function RGBToHex($r, $g, $b) {\n\t\t$hex = \"#\";\n\t\t$hex.= str_pad(dechex($r), 2, \"0\", STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($g), 2, \"0\", STR_PAD_LEFT);\n\t\t$hex.= str_pad(dechex($b), 2, \"0\", STR_PAD_LEFT);\n \n\t\treturn $hex;\n\t}",
"function hex2rgb($hex) {\n\t\t $hex = str_replace('#', '', $hex);\n\t\t if (strlen($hex) === 3) {\n\t\t\t$r = substr($hex, 0, 1);\n\t\t\t$g = substr($hex, 1, 1);\n\t\t\t$b = substr($hex, 2, 1);\n\t\t\t$r = hexdec($r . $r);\n\t\t\t$g = hexdec($g . $g);\n\t\t\t$b = hexdec($b. $b);\n\t\t } else {\n\t\t\t$r = hexdec(substr($hex, 0, 2));\n\t\t\t$g = hexdec(substr($hex, 2, 2));\n\t\t\t$b = hexdec(substr($hex, 4, 2));\n\t\t }\n\t\t return implode(',', array($r, $g, $b));\n\t\t}",
"public function toHex()\n {\n return $this->toRGB()->toHex();\n }",
"public function convertRgbToHex($r, $g, $b)\n {\n $r = dechex($r<0?0:($r>255?255:$r));\n $g = dechex($g<0?0:($g>255?255:$g));\n $b = dechex($b<0?0:($b>255?255:$b));\n\n $color = (strlen($r) < 2?'0':'').$r;\n $color .= (strlen($g) < 2?'0':'').$g;\n $color .= (strlen($b) < 2?'0':'').$b;\n\n return $color;\n }",
"public function rgb_hex($color = null)\n {\n if ($color !== null) {\n $this->set_color($color, self::TYPE_RGB_HEX);\n }\n return $this->_rgb_hex;\n }",
"function hex2rgb($hex){\r\n //$hex = strtoupper($str_enc_hex);\r\n //echo $hex;\r\n $hex = str_replace('#', '', $hex);\r\n $red=-1;\r\n $green=-1;\r\n $blue=-1;\r\n if(strlen($hex)==3){\r\n $red=hexdec($hex[0].$hex[0]);\r\n $green=hexdec($hex[1].$hex[1]);\r\n $blue=hexdec($hex[2].$hex[2]);\r\n } else if(strlen($hex)==6){\r\n $red=hexdec($hex[0].$hex[1]);\r\n $green=hexdec($hex[2].$hex[3]);\r\n $blue=hexdec($hex[4].$hex[5]);\r\n }\r\n //print_r(array($red, $green, $blue));\r\n return array($red, $green, $blue);\r\n}",
"function stringrgb($arr){\r\n\treturn \"RGB(\".$arr[0].\",\".$arr[1].\",\".$arr[2].\")\";\r\n}",
"function hex_to_rgb($hex)\n{\n $hex = str_replace('#', '', $hex);\n if (strlen($hex) !== 6) {\n return;\n }\n $rgb = [];\n $rgb[] = hexdec(substr($hex, 0, 2));\n $rgb[] = hexdec(substr($hex, 2, 2));\n $rgb[] = hexdec(substr($hex, 4, 2));\n return implode(',', $rgb);\n}",
"function uabb_parse_color_to_hex( $code = '' ) {\n\t$color = '';\n\t$hex = '';\n\tif( $code != '' ) {\n\t\tif ( strpos( $code, 'rgba' ) !== false ) {\n\t\t\t$code = ltrim( $code, 'rgba(' );\n\t\t\t$code = rtrim( $code, ')' );\n\t\t\t$rgb = explode( ',', $code );\n\t\t\t$hex .= str_pad(dechex($rgb[0]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$hex .= str_pad(dechex($rgb[1]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$hex .= str_pad(dechex($rgb[2]), 2, \"0\", STR_PAD_LEFT);\n\t\t\t$color = $hex;\n\t\t} else {\n\t\t\t$color = ltrim( $code, '#' );\n\t\t}\n\t}\n\t//var_dump($hex); die;\n\treturn $color;\n}",
"function skudo_hex2rgb($hex = \"000000\") {\n\t\tif (is_array($hex)) $hex = \"000000\";\n\t\t$hex = str_replace(\"#\", \"\", $hex);\n\t\t\n\t\tif(strlen($hex) == 3) {\n\t\t\t$r = hexdec(substr($hex,0,1).substr($hex,0,1));\n\t\t\t$g = hexdec(substr($hex,1,1).substr($hex,1,1));\n\t\t\t$b = hexdec(substr($hex,2,1).substr($hex,2,1));\n\t\t} else {\n\t\t\t$r = hexdec(substr($hex,0,2));\n\t\t\t$g = hexdec(substr($hex,2,2));\n\t\t\t$b = hexdec(substr($hex,4,2));\n\t\t}\n\t\t$rgb = array($r, $g, $b);\n\t\t//return implode(\",\", $rgb); // returns the rgb values separated by commas\n\t\treturn $rgb; // returns an array with the rgb values\n\t}",
"public function toHex()\n\t{\n\t\treturn sprintf('#%s%s%s', Strings::padLeft(dechex($this->r), 2, '0'), Strings::padLeft(dechex($this->g), 2, '0'), Strings::padLeft(dechex($this->b), 2, '0'));\n\t}",
"function hex2rgb($hex) {\n $hex = str_replace('#', '', $hex);\n\n if (strlen($hex) == 3) {\n $r = hexdec(substr($hex, 0, 1) . substr($hex, 0, 1));\n $g = hexdec(substr($hex, 1, 1) . substr($hex, 1, 1));\n $b = hexdec(substr($hex, 2, 1) . substr($hex, 2, 1));\n } else {\n $r = hexdec(substr($hex, 0, 2));\n $g = hexdec(substr($hex, 2, 2));\n $b = hexdec(substr($hex, 4, 2));\n }\n $rgb = array($r, $g, $b);\n \n return implode(', ', $rgb); // returns a string of the rgb values separated by commas\n // return $rgb; // returns an array with the rgb values\n}",
"function hex2rgb( $colour ) {\n if ( $colour[0] == '#' ) {\n $colour = substr( $colour, 1 );\n }\n if ( strlen( $colour ) == 6 ) {\n list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );\n } elseif ( strlen( $colour ) == 3 ) {\n list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );\n } else {\n return false;\n }\n $r = hexdec( $r );\n $g = hexdec( $g );\n $b = hexdec( $b );\n //return array( 'red' => $r, 'green' => $g, 'blue' => $b );\n return \"rgb($r,$g,$b)\";\n}",
"function hex2rgb($hex) {\n $hex = str_replace(\"#\", \"\", $hex);\n\n if(strlen($hex) == 3) {\n $r = hexdec(substr($hex,0,1).substr($hex,0,1));\n $g = hexdec(substr($hex,1,1).substr($hex,1,1));\n $b = hexdec(substr($hex,2,1).substr($hex,2,1));\n } else {\n $r = hexdec(substr($hex,0,2));\n $g = hexdec(substr($hex,2,2));\n $b = hexdec(substr($hex,4,2));\n }\n $rgb = array($r, $g, $b);\n return implode(\",\", $rgb); // returns the rgb values separated by commas\n // return $rgb; // returns an array with the rgb values\n}",
"public function toHex()\n {\n return new Hex($this->getRed() << 16 | $this->getGreen() << 8 | $this->getBlue());\n }",
"public static function hexToRgb($hex) {}",
"function ts_hex_to_rgb($hex,$transparency = '') {\r\n $hex = str_replace(\"#\", \"\", $hex);\r\n\r\n if(strlen($hex) == 3) {\r\n $r = hexdec(substr($hex,0,1).substr($hex,0,1));\r\n $g = hexdec(substr($hex,1,1).substr($hex,1,1));\r\n $b = hexdec(substr($hex,2,1).substr($hex,2,1));\r\n } else {\r\n $r = hexdec(substr($hex,0,2));\r\n $g = hexdec(substr($hex,2,2));\r\n $b = hexdec(substr($hex,4,2));\r\n }\r\n $rgb = array($r, $g, $b);\r\n return 'rgba('.implode(\",\", $rgb).(!empty($transparency) ? ', '.$transparency : '').')'; \r\n}",
"function hexrgb($hex){\n $hex = ($hex[0] == '#') ? substr($hex, 1) : $hex;\n\n if (strlen($hex) == 3){\n list($r, $g, $b) = array($hex[0].$hex[0], $hex[1].$hex[1], $hex[2].$hex[2]);\n } else if (strlen($hex) == 6){\n list($r, $g, $b) = array($hex[0].$hex[1], $hex[2].$hex[3], $hex[4].$hex[5]);\n }\n\n if (isset($r) && isset($g) && isset($b)){\n return array(hexdec($r), hexdec($g), hexdec($b));\n } else {\n return array(0, 0, 0);\n }\n}",
"function generar_color($rgb){\n $vermell= substr($rgb,1,2); \n $verd = substr($rgb,3,2); \n $blau = substr($rgb,5,2); \n \n //Converteixo de hexadecimal a decimal \n $enter_vermell= hexdec($vermell); \n $enter_verd= hexdec($verd); \n $enter_blau= hexdec($blau); \n \n //Valor que li sumarem o restarem a cada component rgb: \n $valor = hexdec(22); \n \n //Calculo l'umbral del color. \n $umbral = 255/2; //7F en hexadecimal. \n \n //Calculo la foscor del color entrat: \n $foscor= ($enter_vermell + $enter_verd + $enter_blau) /3; \n \n //El color és clar. Per tant tenim que enfosquirlo restant-li el $valor en cada component rgb. \n if($foscor >= $umbral){ \n $enter_vermell = ($enter_vermell-$valor<00) ? 00 : $enter_vermell-$valor; \n $enter_verd = ($enter_verd-$valor<00) ? 00 : $enter_verd-$valor; \n $enter_blau = ($enter_blau-$valor<00) ? 00 : $enter_blau-$valor; \n //if($enter_vermell-$valor<00){ $nou_enter_vermell = 00; } else { $enter_vermell=$enter_vermell-$valor; } \n //if($enter_vermell-$valor<00){ $nou_enter_vermell = 00; } else { $enter_vermell=$enter_vermell-$valor; } \n } \n \n //El color és fosc. Per tant tenim que aclararlo sumant-li el $valor en cada component rgb. \n else{ \n $enter_vermell = ($enter_vermell+$valor>255) ? 255 : $enter_vermell+$valor; \n $enter_verd = ($enter_verd+$valor>255) ? 255 : $enter_verd+$valor; \n $enter_blau = ($enter_blau+$valor>255) ? 255 : $enter_blau+$valor; \n } \n $vermell=dechex($enter_vermell); \n $verd=dechex($enter_verd); \n $blau=dechex($enter_blau); \n \n $rgb=\"#\".$vermell.$verd.$blau; \n return $rgb; \n}",
"protected function hex2rgb()\n {\n $hex = str_replace('#', '', $this->fontColor);\n\n if (strlen($hex) == 3) {\n $r = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));\n $g = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));\n $b = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));\n } else {\n $r = hexdec(substr($hex, 0, 2));\n $g = hexdec(substr($hex, 2, 2));\n $b = hexdec(substr($hex, 4, 2));\n }\n $rgb = [$r, $g, $b];\n //return implode(\",\", $rgb); // returns the rgb values separated by commas\n return $rgb; // returns an array with the rgb values\n }",
"public function convert(string $hex) : string\n {\n list($r, $g, $b) = sscanf(ltrim($hex, '#'), \"%02x%02x%02x\");\n return \"rgb($r, $g, $b)\";\n }",
"function hex2rgb($hex) {\n\n if(strlen($hex) == 3) {\n $r = hexdec(substr($hex,0,1).substr($hex,0,1));\n $g = hexdec(substr($hex,1,1).substr($hex,1,1));\n $b = hexdec(substr($hex,2,1).substr($hex,2,1));\n } else {\n $r = hexdec(substr($hex,0,2));\n $g = hexdec(substr($hex,2,2));\n $b = hexdec(substr($hex,4,2));\n }\n $rgb = array($r, $g, $b);\n //return implode(\",\", $rgb); // returns the rgb values separated by commas\n return $rgb; // returns an array with the rgb values\n}"
] |
[
"0.8495073",
"0.80945987",
"0.7744209",
"0.7718092",
"0.7377211",
"0.734296",
"0.72700983",
"0.71354944",
"0.7053817",
"0.7001189",
"0.6924923",
"0.6903224",
"0.6883056",
"0.6836512",
"0.68276757",
"0.6803947",
"0.67793596",
"0.6721955",
"0.67114466",
"0.669272",
"0.6670706",
"0.66599303",
"0.66179",
"0.6614526",
"0.6596389",
"0.657708",
"0.65717596",
"0.6564405",
"0.65454066",
"0.6541091"
] |
0.8777558
|
0
|
create two taxonomies, genres and tags for the post type "tag"
|
function create_tag_taxonomies()
{
// Add new taxonomy, NOT hierarchical (like tags)
$labels = array(
'name' => _x( 'Tags', 'taxonomy general name' ),
'singular_name' => _x( 'Tag', 'taxonomy singular name' ),
'search_items' => __( 'Search Tags' ),
'popular_items' => __( 'Popular Tags' ),
'all_items' => __( 'All Tags' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit Tag' ),
'update_item' => __( 'Update Tag' ),
'add_new_item' => __( 'Add New Tag' ),
'new_item_name' => __( 'New Tag Name' ),
'separate_items_with_commas' => __( 'Separate tags with commas' ),
'add_or_remove_items' => __( 'Add or remove tags' ),
'choose_from_most_used' => __( 'Choose from the most used tags' ),
'menu_name' => __( 'Tags' ),
);
register_taxonomy('tag','edicoesAnteriores',array(
'hierarchical' => false,
'labels' => $labels,
'show_ui' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'tag' ),
));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function create_taxonomies($tax,$val) {\n \n\n // register_taxonomy( 'genre', $taxonomies, $args );\n\n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x( $tax, 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( $tax, 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search '.$tax, 'textdomain' ),\n 'popular_items' => __( 'Popular '.$tax, 'textdomain' ),\n 'all_items' => __( 'All '.$tax, 'textdomain' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit '.$tax, 'textdomain' ),\n 'update_item' => __( 'Update '.$tax, 'textdomain' ),\n 'add_new_item' => __( 'Add New '.$tax, 'textdomain' ),\n 'new_item_name' => __( 'New '.$tax.' Name', 'textdomain' ),\n 'separate_items_with_commas' => __( 'Separate '.$tax.' with commas', 'textdomain' ),\n 'add_or_remove_items' => __( 'Add or remove '.$tax, 'textdomain' ),\n 'choose_from_most_used' => __( 'Choose from the most used '.$tax, 'textdomain' ),\n 'not_found' => __( 'No '.$tax.' found', 'textdomain' ),\n 'menu_name' => __( $tax, 'textdomain' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => $tax ),\n );\n\n register_taxonomy( $tax, $val, $args );\n}",
"function ms_add_custom_taxonomies() {\n // Add new \"Placement Tag\" taxonomy to Articles\n register_taxonomy('placement_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'placement-tags' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Placement Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Placement Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Placement Tags' ),\n 'popular_items' => __( 'Popular Placement Tags' ),\n 'all_items' => __( 'All Placement Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Placement Tag' ),\n 'update_item' => __( 'Update Placement Tag' ),\n 'add_new_item' => __( 'Add New Placement Tag' ),\n 'new_item_name' => __( 'New Origin Tag Name' ),\n 'add_or_remove_items' => __( 'Add or remove placement tags' ),\n 'separate_items_with_commas' => __( 'Separate placement tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used placement tags' ),\n 'not_found' => __( 'No placement tags found.' ),\n 'menu_name' => __( 'Placement Tags' ),\n ),\n ));\n\n // Add new \"Location Tag\" taxonomy to Articles\n register_taxonomy('location_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'location-tags' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Location Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Location Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Location Tags' ),\n 'popular_items' => __( 'Popular Location Tags' ),\n 'all_items' => __( 'All Location Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Location Tag' ),\n 'update_item' => __( 'Update Location Tag' ),\n 'add_new_item' => __( 'Add New Location Tag' ),\n 'new_item_name' => __( 'New Location Tag Name' ),\n 'add_or_remove_items' => __( 'Add or remove location tags' ),\n 'separate_items_with_commas' => __( 'Separate location tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used location tags' ),\n 'not_found' => __( 'No location tags found.' ),\n 'menu_name' => __( 'Location Tags' ),\n ),\n ));\n\n // Add new \"Lifestyle Tag\" taxonomy to Articles\n register_taxonomy('lifestyle_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'lifestyle-tag' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Lifestyle Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Lifestyle Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Lifestyle Tags' ),\n 'popular_items' => __( 'Popular Lifestyle Tags' ),\n 'all_items' => __( 'All Lifestyle Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Lifestyle Tag' ),\n 'update_item' => __( 'Update Lifestyle Tag' ),\n 'add_new_item' => __( 'Add New Lifestyle Tag' ),\n 'new_item_name' => __( 'New Lifestyle Name' ),\n 'add_or_remove_items' => __( 'Add or remove lifestyle tags' ),\n 'separate_items_with_commas' => __( 'Separate lifestyle tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used lifestyle tags' ),\n 'not_found' => __( 'No lifestyle tags found.' ),\n 'menu_name' => __( 'Lifestyle Tags' ),\n ),\n ));\n\n // Add new \"Featured Tag\" taxonomy to Articles\n register_taxonomy('featured_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'featured-tag' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Featured Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Featured Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Featured Tags' ),\n 'popular_items' => __( 'Popular Featured Tags' ),\n 'all_items' => __( 'All Featured Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Featured Tag' ),\n 'update_item' => __( 'Update Featured Tag' ),\n 'add_new_item' => __( 'Add New Featured Tag' ),\n 'new_item_name' => __( 'New Featured Tag Name' ),\n 'add_or_remove_items' => __( 'Add or remove featured tags' ),\n 'separate_items_with_commas' => __( 'Separate featured tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used featured tags' ),\n 'not_found' => __( 'No locations found.' ),\n 'menu_name' => __( 'Featured Tags' ),\n ),\n ));\n // Add new \"Origin Tag\" taxonomy to Articles\n register_taxonomy('origin_tag', 'article', array(\n 'hierarchical' => false,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'origin-tags' ),\n // This array of options controls the labels displayed in the WordPress Admin UI\n 'labels' => array(\n 'name' => _x( 'Origin Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Origin Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Origin Tags' ),\n 'popular_items' => __( 'Popular Origin Tags' ),\n 'all_items' => __( 'All Origin Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Origin Tag' ),\n 'update_item' => __( 'Update Origin Tag' ),\n 'add_new_item' => __( 'Add New Origin Tag' ),\n 'new_item_name' => __( 'New Origin Tag Name' ),\n 'add_or_remove_items' => __( 'Add or remove origin tags' ),\n 'separate_items_with_commas' => __( 'Separate origin tags with commas' ),\n 'choose_from_most_used' => __( 'Choose from the most used origin tags' ),\n 'not_found' => __( 'No origin tags found.' ),\n 'menu_name' => __( 'Origin Tags' ),\n ),\n ));\n}",
"public function create_taxonomies() {\n \n }",
"function create_taxonomies() {\n\t// taxonomy_init(\n\t// \t$settings = array(\n\t// \t\t'slug' \t=> 'sample',\t\t\t// Required\n\t// \t\t'singular' \t=> 'Sample',\t\t\t// Required\n\t// \t\t'plural' \t=> 'Samples',\t\t\t// Required\n\t// \t\t'post_types'\t=> 'your_CPT',\t\t\t// Required\n\t// \t)\n\t// );\n}",
"function setupTaxonomy()\n\t{\n\t\t$labels = array(\n\t\t\t\t'name' => 'Skills',\n\t\t\t\t'add_new_item' => 'Add New Skill',\n\t\t\t\t'new_item_name' => \"New Skill\"\n\t\t);\n\t\t\n\t\t$args = array(\n\t\t\t'hierarchical' => false,\n\t\t\t'labels' \t=> $labels,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'update_count_callback' => '_update_post_term_count',\n\t\t\t'query_var' => true,\n\t\t\t//'rewrite' => array( 'slug' => 'writer' ),\n\t\t\t'show_tagcloud' \t\t=> true\n\t\t);\n\n\t\tregister_taxonomy( 'skills', 'iru_positions', $args );\n\t\tregister_taxonomy_for_object_type( 'skills', 'iru_positions' );\n\t}",
"function register_taxonomy() {\n/*\n\t\t$labels = mediatags_get_taxonomy_labels();\n\t\t $labels = array(\n\t\t 'name' \t\t\t\t=> _x( 'Media-Tags', \t\t\t'taxonomy general name', \t\tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t 'singular_name' \t=> _x( 'Media-Tag', \t\t\t'taxonomy singular name', \t\tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t 'search_items' \t\t=> _x( 'Search Media-Tags', \t'taxonomy search items', \t\tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t\t'popular_items' \t=> _x( 'Popular Media-Tags', \t'taxonomy popular item', \t\tMEDIA_TAGS_I18N_DOMAIN),\t\t\n\t\t 'all_items' \t\t=> _x( 'All Media-Tags', \t\t'taxonomy all items', \t\t\tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t 'parent_item' \t\t=> _x( 'Parent Media-Tag', \t\t'taxonomy parent item', \t\tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t 'parent_item_colon' => _x( 'Parent Media-Tag:', \t'taxonomy parent item colon', \tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t 'edit_item' \t\t=> _x( 'Edit Media-Tag', \t\t'taxonomy edit item', \t\t\tMEDIA_TAGS_I18N_DOMAIN ), \n\t\t 'update_item' \t\t=> _x( 'Update Media-Tag', \t\t'taxonomy update item', \t\tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t 'add_new_item' \t\t=> _x( 'Add New Media-Tag', \t'taxonomy add new item', \t\tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t 'new_item_name' \t=> _x( 'New Media-Tag Name', \t'taxonomy new item name', \t\tMEDIA_TAGS_I18N_DOMAIN ),\n\t\t );\n*/\n\t\t$labels = mediatags_get_taxonomy_labels();\n\t\n\n\t\tregister_taxonomy(MEDIA_TAGS_TAXONOMY, MEDIA_TAGS_TAXONOMY, array(\n\t\t 'hierarchical' \t\t=> false,\n\t\t 'labels' \t\t\t=> $labels,\n\t\t\t'show_ui' \t\t\t=> false,\n\t\t\t'show_in_nav_menus'\t=> true,\n\t\t\t'show_tagcloud'\t\t=> true,\n\t\t 'query_var' \t\t=> true,\n\t\t 'rewrite' \t\t\t=> array( 'slug' => MEDIA_TAGS_URL, 'with_front' => true ),\n\t\t\t'capabilities' \t\t=> $this->default_caps\n\t\t ));\n\t}",
"function my_taxonomies_genre() {\n\t $labels = array(\n\t 'name' => _x( 'Genres', 'taxanomy general name' ),\n\t 'singular_name' => _x( 'Genre', 'taxanomy singular name' ),\n\t 'search_items' => __( 'Search Genres' ),\n\t 'all_items' => __( 'All Genres' ),\n\t 'parent_item' => __( 'Parent Genre' ),\n\t 'parent_item_colon' => __( 'Parent Genre' ),\n\t 'edit_item' => __( 'Edit Genre' ), \n\t 'update_item' => __( 'Update Genre' ),\n\t 'add_new_item' => __( 'Add New Genre' ),\n\t 'new_item_name' => __( 'New Genre' ),\n\t 'menu_name' => __( 'Genres' ),\n\t );\n\t $args = array(\n\t 'labels' => $labels,\n\t 'hierarchical' => true,\n\t );\n\t register_taxonomy( 'movie_genres', 'movies', $args );\n\t}",
"function my_register_taxonomies() {\r\n\t}",
"function build_taxonomies() {\n// custom tax\n register_taxonomy( 'from', array('menu'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'menu-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'cpt-tag',array('menu','recipe','sources-resources','tips-quips','style-points'), \n array( \n 'hierarchical' => false, // true = acts like categories false = acts like tags\n 'label' => 'Tags',\n 'query_var' => true,\n 'show_admin_column' => true,\n 'public' => true,\n 'rewrite' => true,\n '_builtin' => true\n ) );\n register_taxonomy( 'from-5', array('recipe'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'recipe-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-2', array('sources-resources'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'sources-resources-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-3', array('tips-quips'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'tips-quips-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-4', array('style-points'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'style-points-from' ),\n\t\t\t'_builtin' => true\n ) );\n register_taxonomy( 'sub', array('menu'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'menu-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-5', array('recipe'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'recipe-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-2', array('sources-resources'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'sources-resources-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-3', array('tips-quips'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'tips-quips-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-4', array('style-points'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'style-points-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n}",
"function create_taxonomies() {\r\n\t\t$labels = array(\r\n\t\t\t'name' => 'Ad Categories',\r\n\t\t\t'singular_name' => 'Ad Category',\r\n\t\t\t'search_items' => 'Search Ad Categories',\r\n\t\t\t'all_items' => 'All Ad Categories',\r\n\t\t\t'parent_item' => 'Parent Ad Category',\r\n\t\t\t'parent_item_colon' => 'Parent Ad Category:',\r\n\t\t\t'edit_item' => 'Edit Ad Category',\r\n\t\t\t'update_item' => 'Update Ad Category',\r\n\t\t\t'add_new_item' => 'Add New Ad Category',\r\n\t\t\t'new_item_name' => 'New Ad Category Name',\r\n\t\t\t'menu_name' => 'Ad Categories',\r\n\t\t\t);\r\n\r\n\t\t$args = array(\r\n\t\t\t'hierarchical' => true,\r\n\t\t\t'labels' => $labels,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'show_admin_column' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'rewrite' => false,\r\n\t\t\t);\r\n\r\n\t\tregister_taxonomy('mar_adverts_cats',array('mar_adverts'),$args);\r\n\r\n\t\t// Add new taxonomy, make it non-hierarchical (like tags)\r\n\t\t$labels = array(\r\n\t\t\t'name' => 'Ad Tags',\r\n\t\t\t'singular_name' => 'Ad Tag',\r\n\t\t\t'search_items' => 'Search Ad Tags',\r\n\t\t\t'all_items' => 'All Ad Tags',\r\n\t\t\t'parent_item' => 'Parent Ad Tag',\r\n\t\t\t'parent_item_colon' => 'Parent Ad Tag:',\r\n\t\t\t'edit_item' => 'Edit Ad Tag',\r\n\t\t\t'update_item' => 'Update Ad Tag',\r\n\t\t\t'add_new_item' => 'Add New Ad Tag',\r\n\t\t\t'new_item_name' => 'New Ad Tag Name',\r\n\t\t\t'menu_name' => 'Ad Tags',\r\n\t\t\t);\r\n\r\n\t\t$args = array(\r\n\t\t\t'hierarchical' => false,\r\n\t\t\t'labels' => $labels,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'show_admin_column' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'rewrite' => false,\r\n\t\t\t);\r\n\r\n\t\tregister_taxonomy('mar_adverts_tags',array('mar_adverts'),$args);\r\n\t}",
"function create_my_taxonomies()\n{\n register_taxonomy('utilities', 'post', array('hierarchical' => true, 'label' => 'Utilities'));\n}",
"function create_ticket_tax() {\n $labels = array(\n 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( 'Genre', 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search Genres', 'textdomain' ),\n 'all_items' => __( 'All Genres', 'textdomain' ),\n 'parent_item' => __( 'Parent Genre', 'textdomain' ),\n 'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),\n 'edit_item' => __( 'Edit Genre', 'textdomain' ),\n 'update_item' => __( 'Update Genre', 'textdomain' ),\n 'add_new_item' => __( 'Add New Genre', 'textdomain' ),\n 'new_item_name' => __( 'New Genre Name', 'textdomain' ),\n 'menu_name' => __( 'Genre', 'textdomain' ),\n );\n\n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'genre', 'with_front' => false ),\n 'description' => 'Genre for shows and cast. Parent categories are Sports, Theater, Concerts or Other.',\n );\n\n //register_taxonomy( 'genre', array( 'show', 'cast' ), $args );\n register_taxonomy( 'genre', array( 'show' ), $args );\n\n register_taxonomy_for_object_type( 'genre', 'show' );\n //register_taxonomy_for_object_type( 'genre', 'cast' );\n\n}",
"public function register_taxonomies() {\n\n\t\t$options = $this->options;\n\t\t$this->remove_mb = array();\n\n\t\tforeach ( $options as $option ) {\n\n\t\t\tif ( 'taxonomy' == $option['args']['field_type'] ) {\n\n\t\t\t\t$name = ! empty( $option['args']['label'] ) ? sanitize_text_field( $option['args']['label'] ) : ucwords( str_replace( array( '_', '-' ), ' ', $option['name'] ) );\n\t\t\t\t$plural = ! empty( $option['args']['label_plural'] ) ? sanitize_text_field( $option['args']['label_plural'] ) : $name . 's';\n\t\t\t\t$column = true === $option['args']['taxo_std'] ? true : false;\n\t\t\t\t$hierarchical = $option['args']['taxo_hierarchical'];\n\n\t\t\t\t$labels = array(\n\t\t\t\t\t'name' => $plural,\n\t\t\t\t\t'singular_name' => $name,\n\t\t\t\t\t'search_items' => sprintf( __( 'Search %s', TEXTDOMAIN ), $plural ),\n\t\t\t\t\t'all_items' => sprintf( __( 'All %s', TEXTDOMAIN ), $plural ),\n\t\t\t\t\t'parent_item' => sprintf( __( 'Parent %s', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'parent_item_colon' => sprintf( _x( 'Parent %s:', 'Parent term in a taxonomy where %s is dynamically replaced by the taxonomy (eg. \"book\")', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'edit_item' => sprintf( __( 'Edit %s', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'update_item' => sprintf( __( 'Update %s', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'add_new_item' => sprintf( __( 'Add New %s', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'new_item_name' => sprintf( _x( 'New %s Name', 'A new taxonomy term name where %s is dynamically replaced by the taxonomy (eg. \"book\")', TEXTDOMAIN ), $name ),\n\t\t\t\t\t'menu_name' => $plural,\n\t\t\t\t);\n\n\t\t\t\t$args = array(\n\t\t\t\t\t'hierarchical' => $hierarchical,\n\t\t\t\t\t'labels' => $labels,\n\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t'show_admin_column' => $column,\n\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t'rewrite' => array( 'slug' => $option['name'] ),\n\t\t\t\t\t'capabilities' => array(\n\t\t\t\t\t\t'manage_terms' => 'create_ticket',\n\t\t\t\t\t\t'edit_terms' => 'settings_tickets',\n\t\t\t\t\t\t'delete_terms' => 'settings_tickets',\n\t\t\t\t\t\t'assign_terms' => 'create_ticket'\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif ( false !== $option['args']['update_count_callback'] && function_exists( $option['args']['update_count_callback'] ) ) {\n\t\t\t\t\t$args['update_count_callback'] = $option['args']['update_count_callback'];\n\t\t\t\t}\n\n\t\t\t\tregister_taxonomy( $option['name'], array( 'ticket' ), $args );\n\n\t\t\t\tif ( false === $option['args']['taxo_std'] ) {\n\t\t\t\t\tarray_push( $this->remove_mb, $option['name'] );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t/* Remove metaboxes that won't be used */\n\t\tif ( ! empty( $this->remove_mb ) ) {\n\t\t\tadd_action( 'admin_menu', array( $this, 'remove_taxonomy_metabox' ) );\n\t\t}\n\n\t}",
"function register_taxonomies() {\n\t}",
"function register_taxonomies() {\n\t}",
"function register_taxonomies() {\n\t}",
"function create_taxonomies() \n{\n register_taxonomy(\n 'location',\n 'projects',\n array(\n 'labels' => array(\n 'name' => 'Location',\n 'add_new_item' => 'Add New Location',\n 'new_item_name' => \"New Location\"\n ),\n 'show_ui' => true,\n 'show_tagcloud' => false,\n 'hierarchical' => true\n )\n );\n \n register_taxonomy(\n 'category',\n 'projects',\n array(\n 'labels' => array(\n 'name' => 'Category',\n 'add_new_item' => 'Add New Category',\n 'new_item_name' => \"New Category\"\n ),\n 'show_ui' => true,\n 'show_tagcloud' => false,\n 'hierarchical' => true\n )\n );\n}",
"function wpfolio_create_taxonomies() {\nregister_taxonomy('medium', 'post', array( \n\t'label' => 'Medium',\n\t'hierarchical' => false, \n\t'query_var' => true, \n\t'rewrite' => true,\n\t'public' => true,\n\t'show_ui' => true,\n\t'show_tagcloud' => true,\n\t'show_in_nav_menus' => true,));\n}",
"function create_gallerie_taxonomies() {\r\n\t// Add new taxonomy, make it hierarchical (like categories)\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),\r\n\t\t'singular_name' => _x( 'Genre', 'taxonomy singular name', 'textdomain' ),\r\n\t\t'search_items' => __( 'Search Genres', 'textdomain' ),\r\n\t\t'all_items' => __( 'All Genres', 'textdomain' ),\r\n\t\t'parent_item' => __( 'Parent Genre', 'textdomain' ),\r\n\t\t'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),\r\n\t\t'edit_item' => __( 'Edit Genre', 'textdomain' ),\r\n\t\t'update_item' => __( 'Update Genre', 'textdomain' ),\r\n\t\t'add_new_item' => __( 'Add New Genre', 'textdomain' ),\r\n\t\t'new_item_name' => __( 'New Genre Name', 'textdomain' ),\r\n\t\t'menu_name' => __( 'Genre', 'textdomain' ),\r\n\t);\r\n\r\n\t$args = array(\r\n\t\t'hierarchical' => true,\r\n\t\t'labels' => $labels,\r\n\t\t'show_ui' => true,\r\n\t\t'show_admin_column' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'genre' ),\r\n\t);\r\n\r\n\tregister_taxonomy( 'genre', array( 'gallerie' ), $args );\r\n}",
"function register_taxonomies(){\n }",
"function create_my_taxonomies() {\n\t$labels_producto_productor = array(\n\t\t'name' => _x( 'Productores', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Productor', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar productores' ),\n\t\t'all_items' => __( 'Todos los productores' ),\n\t\t'parent_item' => __( 'Productor Padre' ),\n\t\t'parent_item_colon' => __( 'Productor Padre:' ),\n\t\t'edit_item' => __( 'Editar productor' ),\n\t\t'update_item' => __( 'Actualizar productor' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo productor' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo productor' ),\n\t\t'menu_name' => __( 'Productores' )\n\t);\n\n\t$args_producto_productor = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels_producto_productor,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_productor',\n\t\t\t'edit_terms' => 'edit_productor',\n\t\t\t'delete_terms' => 'delete_productor',\n\t\t\t'assign_terms' => 'assign_productor'\n\t\t)\n\t);\n\n\t$labels_producto_marca = array(\n\t\t'name' => _x( 'Marcas', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Marca', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Marcas' ),\n\t\t'all_items' => __( 'Todos las Marcas' ),\n\t\t'parent_item' => __( 'Marca Padre' ),\n\t\t'parent_item_colon' => __( 'Marca Padre:' ),\n\t\t'edit_item' => __( 'Editar Marca' ),\n\t\t'update_item' => __( 'Actualizar Marca' ),\n\t\t'add_new_item' => __( 'Agregar Nueva Marca' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva Marca' ),\n\t\t'menu_name' => __( 'Marcas' )\n\t);\n\n\t$args_producto_marca = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels_producto_marca,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_marca',\n\t\t\t'edit_terms' => 'edit_marca',\n\t\t\t'delete_terms' => 'delete_marca',\n\t\t\t'assign_terms' => 'assign_marca'\n\t\t)\n\t);\n\n\t$labels_producto_lugar = array(\n\t\t'name' => _x( 'Lugares', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Lugar', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Lugares' ),\n\t\t'all_items' => __( 'Todos los Lugares' ),\n\t\t'parent_item' => __( 'Lugar Padre' ),\n\t\t'parent_item_colon' => __( 'Lugar Padre:' ),\n\t\t'edit_item' => __( 'Editar Lugar' ),\n\t\t'update_item' => __( 'Actualizar Lugar' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Lugar' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo Lugar' ),\n\t\t'menu_name' => __( 'Lugares' )\n\t);\n\n\t$args_producto_lugar = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_producto_lugar,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_lugar',\n\t\t\t'edit_terms' => 'edit_lugar',\n\t\t\t'delete_terms' => 'delete_lugar',\n\t\t\t'assign_terms' => 'assign_lugar'\n\t\t)\n\t);\n\n\t$labels_producto_clasificacion = array(\n\t\t'name' => _x( 'Clasificaciones', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Clasificación', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Clasificaciones' ),\n\t\t'all_items' => __( 'Todos las Clasificaciones' ),\n\t\t'parent_item' => __( 'Clasificación Padre' ),\n\t\t'parent_item_colon' => __( 'Clasificación Padre:' ),\n\t\t'edit_item' => __( 'Editar Clasificación' ),\n\t\t'update_item' => __( 'Actualizar Clasificación' ),\n\t\t'add_new_item' => __( 'Agregar Nueva Clasificación' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva Clasificación' ),\n\t\t'menu_name' => __( 'Clasificaciones' )\n\t);\n\n\t$args_producto_clasificacion = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_producto_clasificacion,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_clasificacion',\n\t\t\t'edit_terms' => 'edit_clasificacion',\n\t\t\t'delete_terms' => 'delete_clasificacion',\n\t\t\t'assign_terms' => 'assign_clasificacion'\n\t\t)\n\t);\n\n\t$labels_banner_posicion = array(\n\t\t'name' => _x( 'Posiciones', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Posición', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Posiciones' ),\n\t\t'all_items' => __( 'Todas las Posiciones' ),\n\t\t'parent_item' => __( 'Posición Padre' ),\n\t\t'parent_item_colon' => __( 'Posición Padre:' ),\n\t\t'edit_item' => __( 'Editar posición' ),\n\t\t'update_item' => __( 'Actualizar posición' ),\n\t\t'add_new_item' => __( 'Agregar Nueva posición' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva posición' ),\n\t\t'menu_name' => __( 'Posiciones' )\n\t);\n\n\t$args_banner_posicion = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_banner_posicion,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_posicion',\n\t\t\t'edit_terms' => 'edit_posicion',\n\t\t\t'delete_terms' => 'delete_posicion',\n\t\t\t'assign_terms' => 'assign_posicion'\n\t\t)\n\t);\n\n\t$labels_documentos_tipos = array(\n\t\t'name' => _x( 'Tipos', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Tipo', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Tipos' ),\n\t\t'all_items' => __( 'Todos los Tipos' ),\n\t\t'parent_item' => __( 'Tipo Padre' ),\n\t\t'parent_item_colon' => __( 'Tipo Padre:' ),\n\t\t'edit_item' => __( 'Editar Tipo' ),\n\t\t'update_item' => __( 'Actualizar Tipo' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Tipo' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo Tipo' ),\n\t\t'menu_name' => __( 'Tipos' )\n\t);\n\n\t$args_documentos_tipos = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_documentos_tipos,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_tipo',\n\t\t\t'edit_terms' => 'edit_tipo',\n\t\t\t'delete_terms' => 'delete_tipo',\n\t\t\t'assign_terms' => 'assign_tipo'\n\t\t)\n\t);\n\n\t$labels_convocatorias_categorias = array(\n\t\t'name' => _x( 'Categorías', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Categoría', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Categorías' ),\n\t\t'all_items' => __( 'Todas las Categorías' ),\n\t\t'parent_item' => __( 'Categoría Padre' ),\n\t\t'parent_item_colon' => __( 'Categoría Padre:' ),\n\t\t'edit_item' => __( 'Editar Categoría' ),\n\t\t'update_item' => __( 'Actualizar Categoría' ),\n\t\t'add_new_item' => __( 'Agregar Nueva Categoría' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva Categoría' ),\n\t\t'menu_name' => __( 'Categorías' )\n\t);\n\n\t$args_convocatorias_categorias = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_convocatorias_categorias,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_cat-convocatorias',\n\t\t\t'edit_terms' => 'edit_cat-convocatorias',\n\t\t\t'delete_terms' => 'delete_cat-convocatorias',\n\t\t\t'assign_terms' => 'assign_cat-convocatorias'\n\t\t)\n\t);\n\n\t$labels_convocatorias_estados = array(\n\t\t'name' => _x( 'Estados', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Estado', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Estados' ),\n\t\t'all_items' => __( 'Todas los Estados' ),\n\t\t'parent_item' => __( 'Estado Padre' ),\n\t\t'parent_item_colon' => __( 'Estado Padre:' ),\n\t\t'edit_item' => __( 'Editar Estado' ),\n\t\t'update_item' => __( 'Actualizar Estado' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Estado' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo Estado' ),\n\t\t'menu_name' => __( 'Estados' )\n\t);\n\n\t$args_convocatorias_estados = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_convocatorias_estados,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_est-convocatorias',\n\t\t\t'edit_terms' => 'edit_est-convocatorias',\n\t\t\t'delete_terms' => 'delete_est-convocatorias',\n\t\t\t'assign_terms' => 'assign_est-convocatorias'\n\t\t)\n\t);\n\n\t$labels_servicios_condiciones = array(\n\t\t'name' => _x( 'Condiciones', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Condición', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Condiciones' ),\n\t\t'all_items' => __( 'Todas las Condiciones' ),\n\t\t'parent_item' => __( 'Condición Padre' ),\n\t\t'parent_item_colon' => __( 'Condición Padre:' ),\n\t\t'edit_item' => __( 'Editar Condición' ),\n\t\t'update_item' => __( 'Actualizar Condición' ),\n\t\t'add_new_item' => __( 'Agregar Nueva Condición' ),\n\t\t'new_item_name' => __( 'Nombre de Nueva Condición' ),\n\t\t'menu_name' => __( 'Condiciones' )\n\t);\n\n\t$args_servicios_condiciones = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_servicios_condiciones,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_condiciones',\n\t\t\t'edit_terms' => 'edit_condiciones',\n\t\t\t'delete_terms' => 'delete_condiciones',\n\t\t\t'assign_terms' => 'assign_condiciones'\n\t\t)\n\t);\n\n\t$labels_directorios_grupos = array(\n\t\t'name' => _x( 'Grupos', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Grupo', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Buscar Grupos' ),\n\t\t'all_items' => __( 'Todos los Grupos' ),\n\t\t'parent_item' => __( 'Grupo Padre' ),\n\t\t'parent_item_colon' => __( 'Grupo Padre:' ),\n\t\t'edit_item' => __( 'Editar Grupo' ),\n\t\t'update_item' => __( 'Actualizar Grupo' ),\n\t\t'add_new_item' => __( 'Agregar Nuevo Grupo' ),\n\t\t'new_item_name' => __( 'Nombre de Nuevo Grupo' ),\n\t\t'menu_name' => __( 'Grupos' )\n\t);\n\n\t$args_directorios_grupos = array(\n\t\t'public' \t\t\t=> true,\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels_directorios_grupos,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'capabilities'\t\t=> array(\n\t\t\t'manage_terms' => 'manage_grupos',\n\t\t\t'edit_terms' => 'edit_grupos',\n\t\t\t'delete_terms' => 'delete_grupos',\n\t\t\t'assign_terms' => 'assign_grupos'\n\t\t)\n\t);\n\n\tregister_taxonomy( 'productor', 'producto', $args_producto_productor );\n\tregister_taxonomy( 'marca', 'producto', $args_producto_marca );\n\tregister_taxonomy( 'lugar', 'producto', $args_producto_lugar );\n\tregister_taxonomy( 'clasificacion', 'producto', $args_producto_clasificacion );\n\tregister_taxonomy( 'posiciones', 'banners', $args_banner_posicion );\n\tregister_taxonomy( 'tipos', 'documentos', $args_documentos_tipos );\n\tregister_taxonomy( 'cat-convocatorias', 'convocatorias', $args_convocatorias_categorias );\n\tregister_taxonomy( 'est-convocatorias', 'convocatorias', $args_convocatorias_estados );\n\tregister_taxonomy( 'condiciones', 'servicios', $args_convocatorias_estados );\n\tregister_taxonomy( 'grupos', 'directorios', $args_directorios_grupos );\n}",
"function register_taxonomies(){\n }",
"function create_ha_taxonomies() {\n\n $labels = array(\n 'name' => _x( 'Habilidad artistica', 'taxonomy general name' ),\n 'singular_name' => _x( 'Habilidad artistica', 'taxonomy singular name' ),\n 'search_items' => __( 'Buscar Habilidad' ),\n 'all_items' => __( 'Habilidades artisticas' ),\n 'parent_item' => __( 'Parent Genre' ),\n 'parent_item_colon' => __( 'Parent Genre:' ),\n 'edit_item' => __( 'Editar habilidad' ), \n 'update_item' => __( 'Actualizar habilidad' ),\n 'add_new_item' => __( 'Nueva habilidad artistica' ),\n 'new_item_name' => __( 'Nueva habilidad artistica' ),\n 'menu_name' => __( 'Habilidades artisticas' ),\n ); \t\n\n register_taxonomy('habilidad-artistica',array('ofertas'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'habilidad-artistica' ),\n ));\n\n}",
"function tag_agenda() {\n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x('Tag', 'taxonomy general name'),\n 'singular_name' => _x('Tag', 'taxonomy singular name'),\n 'search_items' => __('Cari Tag'),\n 'popular_items' => __('Tag Populer'),\n 'all_items' => __('Semua Tag'),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __('Edit Tag'),\n 'update_item' => __('Update Tag'),\n 'add_new_item' => __('Tambah Tag Baru'),\n 'new_item_name' => __('New Tag Name'),\n 'separate_items_with_commas' => __('Pisahkan tag dengan koma.'),\n 'add_or_remove_items' => __('Tambah atau hapus tag'),\n 'choose_from_most_used' => __('Pilih dari tag populer'),\n 'menu_name' => __('Tags'),\n );\n\n register_taxonomy('tag_agenda', 'agenda', array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array('slug' => 'tag-agenda'),\n ));\n}",
"function create_resource_taxonomies() {\n\t// Add new taxonomy, make it hierarchical (like categories)\n\t$labels = array(\n\t\t'name' => _x( 'Resource Categories', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Resource Category', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Resource Categories' ),\n\t\t'all_items' => __( 'All Resource Categories' ),\n\t\t'parent_item' => __( 'Parent Resource Category' ),\n\t\t'parent_item_colon' => __( 'Parent Resource Category:' ),\n\t\t'edit_item' => __( 'Edit Resource Category' ),\n\t\t'update_item' => __( 'Update Resource Category' ),\n\t\t'add_new_item' => __( 'Add New Resource Category' ),\n\t\t'new_item_name' => __( 'New Genre Resource Category' ),\n\t\t'menu_name' => __( 'Resource Categories' ),\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => true,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'resources' ),\n\t);\n\tregister_taxonomy( 'resource_categories', array( 'resources' ), $args );\n\t\n\t// Add new taxonomy, NOT hierarchical (like tags)\n\t$labels = array(\n\t\t'name' => _x( 'Resource Tags', 'taxonomy general name' ),\n\t\t'singular_name' => _x( 'Resource Tag', 'taxonomy singular name' ),\n\t\t'search_items' => __( 'Search Resource Tags' ),\n\t\t'popular_items' => __( 'Popular Resource Tags' ),\n\t\t'all_items' => __( 'All Resource Tags' ),\n\t\t'parent_item' => null,\n\t\t'parent_item_colon' => null,\n\t\t'edit_item' => __( 'Edit resource tag' ),\n\t\t'update_item' => __( 'Update resource tag' ),\n\t\t'add_new_item' => __( 'Add New Resource Tag' ),\n\t\t'new_item_name' => __( 'New Writer Resource Tag' ),\n\t\t'separate_items_with_commas' => __( 'Separate tags with commas' ),\n\t\t'add_or_remove_items' => __( 'Add or remove resource tags' ),\n\t\t'choose_from_most_used' => __( 'Choose from the most used resource tags' ),\n\t\t'not_found' => __( 'No resource tags found.' ),\n\t\t'menu_name' => __( 'Resource Tags' ),\n\t);\n\n\t$args = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'update_count_callback' => '_update_post_term_count',\n\t\t'query_var' => true,\n\t\t'rewrite' => array( 'slug' => 'resource-tags' ),\n\t);\n\n\tregister_taxonomy( 'resource_tags', 'resources', $args );\n\t}",
"function create_ht_taxonomies() {\n\n $labels = array(\n 'name' => _x( 'Habilidad tecnica', 'taxonomy general name' ),\n 'singular_name' => _x( 'Habilidad tecnica', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Genres' ),\n 'all_items' => __( 'Habilidades tecnicas' ),\n 'parent_item' => __( 'Parent Genre' ),\n 'parent_item_colon' => __( 'Parent Genre:' ),\n 'edit_item' => __( 'Editar habilidad' ), \n 'update_item' => __( 'Actualizar habilidad' ),\n 'add_new_item' => __( 'Nueva habilidad tecnica' ),\n 'new_item_name' => __( 'Nueva habilidad tecnica' ),\n 'menu_name' => __( 'Habilidades tecnicas' ),\n ); \t\n\n register_taxonomy('habilidad-tecnica',array('ofertas'), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'habilidad-tecnica' ),\n ));\n\n}",
"function five_register_my_taxonomies()\n{\n //five_register_taxonomy('custom-taxonomy', 'Custom Taxonomy', 'Custom Taxonomies', ['custom-post-type']);\n}",
"function create_author_taxonomies() {\n\n\n\t$labels = array(\n\t\t'name' => _x( 'Autore', 'taxonomy general name', 'italiattivo' ),\n\n\t);\n\n\n\t$args = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\n\t);\n\n\tregister_taxonomy( 'autore', array('frasi', 'quadri', 'esercizi'), $args );\n\n}",
"public function registerTaxonomyToObjects()\n {\n // register Taxonomy to each of the PostTypes assigned\n if (!empty($this->posttypes)) {\n foreach ($this->posttypes as $posttype) {\n register_taxonomy_for_object_type($this->name, $posttype);\n }\n }\n }",
"function wpdocs_create_book_taxonomies() {\n // Add new taxonomy, make it hierarchical (like categories)\n $labels = array(\n 'name' => _x( 'Genres', 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( 'Genre', 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search Genres', 'textdomain' ),\n 'all_items' => __( 'All Genres', 'textdomain' ),\n 'parent_item' => __( 'Parent Genre', 'textdomain' ),\n 'parent_item_colon' => __( 'Parent Genre:', 'textdomain' ),\n 'edit_item' => __( 'Edit Genre', 'textdomain' ),\n 'update_item' => __( 'Update Genre', 'textdomain' ),\n 'add_new_item' => __( 'Add New Genre', 'textdomain' ),\n 'new_item_name' => __( 'New Genre Name', 'textdomain' ),\n 'menu_name' => __( 'Genre', 'textdomain' ),\n );\n \n $args = array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'genre' ),\n );\n \n register_taxonomy( 'genre', array( 'book' ), $args );\n \n unset( $args );\n unset( $labels );\n \n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x( 'Writers', 'taxonomy general name', 'textdomain' ),\n 'singular_name' => _x( 'Writer', 'taxonomy singular name', 'textdomain' ),\n 'search_items' => __( 'Search Writers', 'textdomain' ),\n 'popular_items' => __( 'Popular Writers', 'textdomain' ),\n 'all_items' => __( 'All Writers', 'textdomain' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Writer', 'textdomain' ),\n 'update_item' => __( 'Update Writer', 'textdomain' ),\n 'add_new_item' => __( 'Add New Writer', 'textdomain' ),\n 'new_item_name' => __( 'New Writer Name', 'textdomain' ),\n 'separate_items_with_commas' => __( 'Separate writers with commas', 'textdomain' ),\n 'add_or_remove_items' => __( 'Add or remove writers', 'textdomain' ),\n 'choose_from_most_used' => __( 'Choose from the most used writers', 'textdomain' ),\n 'not_found' => __( 'No writers found.', 'textdomain' ),\n 'menu_name' => __( 'Writers', 'textdomain' ),\n );\n \n $args = array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'writer' ),\n );\n \n register_taxonomy( 'writer', 'book', $args );\n}"
] |
[
"0.7217996",
"0.7068023",
"0.70214385",
"0.6942771",
"0.6910526",
"0.688963",
"0.6871671",
"0.6839763",
"0.6837624",
"0.68300444",
"0.67965204",
"0.6752528",
"0.6731873",
"0.6729583",
"0.6729583",
"0.6729583",
"0.6715729",
"0.6712638",
"0.67042303",
"0.66906714",
"0.66896445",
"0.66562957",
"0.6655231",
"0.66272575",
"0.66252613",
"0.6572977",
"0.65693796",
"0.65520966",
"0.6550633",
"0.6547185"
] |
0.7785577
|
0
|
Checks whether there are cached data records.
|
public function hasCachedData(): bool
{
return !empty(static::$cachedData);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function isCachedDataAvailable(){\n\t\treturn $this->_dataAvailable;\n\t}",
"public static function hasCache() {\n\t\treturn false;\n\t}",
"public function hasCache(): bool\n {\n return isset($this->contents);\n }",
"public function hasCache()\n {\n return (null !== $this->getCacheAdapter());\n }",
"private function hasCache()\n {\n if (!$this->isActive()) {\n return false;\n }\n\n return !empty($this->getCache(false));\n }",
"public function cacheExists()\n {\n $cacheFile = $this->getCacheFile();\n if (file_exists($cacheFile) && filemtime($cacheFile) > (time()-$this->cachePeriod)) {\n return(true);\n } else {\n return(false);\n }\n }",
"private function isCached()\n {\n return Cache::has($this->cacheKey());\n }",
"protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }",
"function exists() {\n \n return !empty($this->cache);\n \n }",
"public function hasCacheStore(): bool;",
"private function check_cache() {\n if (!file_exists($this->cache_file)) {\n return false;\n }\n if (filemtime($this->cache_file) >= strtotime(\"-\" . CACHE_EXPIRATION . \" seconds\")) {\n return true;\n } else {\n return false;\n }\n }",
"public function isCached() {}",
"public function isCacheExists()\n {\n if(file_exists($this->cachedPath))\n return true;\n else\n return false;\n }",
"public function isCached(): bool;",
"public function checkCache() {\n \tif (file_exists(dirname($this->cache_file)) || !is_writable(dirname($this->cache_file))) {\n \t\t$this->createCacheDirectory();\n \t}\n \tif (file_exists($this->cache_file)) {\n \t\t$this->mod_time = filemtime($this->cache_file) + $this->cache_time;\n \t\tif ($this->mod_time > time()) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn false;\n \t}\n \n }",
"function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }",
"protected function isMemcachedUsed() {}",
"protected function isMemcachedUsed() {}",
"public function memCached() { return true; }",
"function MustStoreToCache()\n {\n return $this->cacheLifetime > 0;\n }",
"public function canBeCached(): bool\n {\n foreach ($this->getValidators() as $validator) {\n if (!$validator->canBeCached()) {\n return false;\n }\n }\n\n return true;\n }",
"public function cacheUpToDate()\n\t{\n\t\t$expiredSites = $this->getExpiredCacheSites();\n\n\t\treturn empty($expiredSites);\n\t}",
"public function isCached()\n\t{\n\t\treturn is_file($this->getCacheFile());\n\t}",
"public static function hasDefaultCache();",
"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 }",
"static function is_cache()\n\t{\n\t\tif (file_exists(Cache::$path))\n\t\t{\n\t\t\tif(Cache::$time>0)\n\t\t\t{\n\t\t\t\t$info_file=stat(Cache::$path);\n\t\t\t\tif(time() > $info_file[9]+Cache::$time)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tCache::delete();\n\t\t\t\t\tCache::$time=0;\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function MustUseCache()\n {\n if ($this->cacheLifetime == 0)\n {\n return false;\n }\n if (!File::Exists($this->file))\n {\n return false;\n }\n $now = Date::Now();\n $lastMod = File::GetLastModified($this->file);\n if ($now->TimeStamp() - $lastMod->TimeStamp() < $this->cacheLifetime)\n {\n return true;\n }\n return false;\n }",
"function pmxc_checkCacheStatus()\n\t{\n\t\tglobal $pmxCacheFunc;\n\n\t\t$result = true;\n\t\tif($this->cfg['cache'] > 0 && !empty($this->cache_trigger))\n\t\t{\n\t\t\tif(($data = $pmxCacheFunc['get']($this->cache_key, $this->cache_mode)) !== null)\n\t\t\t{\n\t\t\t\t$res = eval($this->cache_trigger);\n\t\t\t\tif(!empty($res))\n\t\t\t\t\t$pmxCacheFunc['drop']($this->cache_key, $this->cache_mode);\n\n\t\t\t\tunset($data);\n\t\t\t\t$result = ($res === null);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"final protected function getCacheNeed()\n\t{\n\t\treturn\tintval($this->arParams['CACHE_TIME']) > 0 &&\n\t\t\t\t$this->arParams['CACHE_TYPE'] != 'N' &&\n\t\t\t\tConfig\\Option::get(\"main\", \"component_cache_on\", \"Y\") == \"Y\";\n\t}",
"public function valid ()\n {\n return isset($this->offset) && isset($this->cache[ $this->offset ]);\n }"
] |
[
"0.7413823",
"0.7311962",
"0.72608185",
"0.7184609",
"0.7097664",
"0.704938",
"0.70341855",
"0.7027135",
"0.7024026",
"0.6941496",
"0.69309884",
"0.69237196",
"0.6904145",
"0.6839759",
"0.6826429",
"0.67567647",
"0.67321396",
"0.67321396",
"0.66928834",
"0.66677",
"0.6665447",
"0.66439915",
"0.66129667",
"0.658947",
"0.6569779",
"0.6567223",
"0.6492085",
"0.6485173",
"0.6483545",
"0.64735883"
] |
0.78665626
|
0
|
Adds an array of objectives. Will overwrite any previous objectives.
|
public function addObjectives(array $objectives)
{
if ($this->properties->has('level[objectives]')) {
$currentObjectives = $this->getObjectives();
$objectives = array_merge($currentObjectives, $objectives);
}
$this->setProperty('objectives', $objectives);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function add($object){if(is_array($this->arrayObj))\n \n {$tmp = count($this->arrayObj);$this->arrayObj[$tmp]=$object;\n\n }else{$this->arrayObj[0]=$object;}\n }",
"function add($object){if(is_array($this->arrayObj))\n \n {$tmp = count($this->arrayObj);$this->arrayObj[$tmp]=$object;\n\n }else{$this->arrayObj[0]=$object;}\n }",
"public function add(array $elements);",
"function Add($aObject) {\n\tif( is_array($aObject) ) {\n\t for($i=0; $i<count($aObject); ++$i)\n\t\t$this->iObj[] = $aObject[$i];\n\t}\n\telse\n\t $this->iObj[] = $aObject;\n }",
"public function set_objectives($objectives)\n\t{\n\t\tif (is_null($objectives)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Objectives Invalid!\");\n\t\t}\n\t\t$this->objectives = $objectives;\n\t}",
"function add_meta_objs($meta_objs) {\n array_merge($this->meta_objs, $meta_objs);\n }",
"public function add()\n {\n for ($i = 0 ; $i < func_num_args(); $i++) {\n $this->addSingle(func_get_arg($i));\n }\n }",
"public function testAppending()\n {\n $data = new ArrayObject(\n array(\n 'foo' => 'bar'\n )\n );\n\n $data->append('baz');\n }",
"public function addAllFromArray(array $items)\n {\n foreach ($items as $object) {\n $this->attach($object);\n }\n }",
"public function addAll(array $elements): void;",
"public function addItems(array $items)\n {\n // array += array save key ordering instead of array_merge func\n $this->items += $items;\n }",
"public function add_all_tentative($tentative_items)\n\t\t{\n\t\t\tparent::add_all_items($tentative_items,'tentative_items');\n\t\t}",
"public function get_objectives()\n\t{\n\t\treturn $this->objectives;\n\t}",
"public function addMetaboxes() {}",
"public function Add(array $input)\n {\n $this->insertAll($input);\n $this->resetProperties();\n }",
"public function add(...$items);",
"public function add($obj) {\n\t}",
"protected function addArtefacts(array $artefacts)\n {\n $this->getSubject()->addArtefacts(ProductVariantObserver::ARTEFACT_TYPE, $artefacts);\n }",
"public function mass_add()\n {\n }",
"public function add(array $data)\n {\n $this->data = array_merge($this->data, $data);\n }",
"protected function addArguments(array $newArguments){\n foreach ($newArguments as $newArgument) {\n $this->add($newArgument);\n }\n }",
"public function add($object): void;",
"public function addToActions($actionArray)\n {\n $this->_actions[] = $actionArray;\n }",
"public function setObjectives($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\AIPlatform\\V1\\SearchModelDeploymentMonitoringStatsAnomaliesRequest\\StatsAnomaliesObjective::class);\n $this->objectives = $arr;\n\n return $this;\n }",
"public function addAdjustments(array $adjustments)\n {\n foreach ($adjustments as $adjustment) {\n $this->applyAdjustment($adjustment);\n }\n\n $this->refresh();\n }",
"public function limpaArrayIdsObjetosManipulados()\n {\n \t// limpando o array de ids de objetos manipulados\n \t$this->_arrayObjetosManipulados = array();\n }",
"public function addItems(array $items);",
"function add_file_objs($file_objs) {\n array_merge($this->file_objs, $file_objs);\n $this->update_files = 1;\n }",
"public function addActiveQuestions(array $activeQuestions) {\n foreach ($activeQuestions AS $question) {\n $this->activeQuestions[] = $question;\n }\n }",
"public function add($items) {\n\t\tforeach(func_get_args() as $item) {\n\t\t\t$this->list[$this->count++] = $item;\n\t\t}\n\t}"
] |
[
"0.6042673",
"0.6042673",
"0.58658975",
"0.5730784",
"0.56379074",
"0.56050575",
"0.55601454",
"0.5391322",
"0.532768",
"0.5229312",
"0.52095497",
"0.5186191",
"0.5175255",
"0.5137915",
"0.5083235",
"0.508078",
"0.50536096",
"0.5049491",
"0.5038629",
"0.50233966",
"0.5021615",
"0.5010378",
"0.5004852",
"0.5003394",
"0.4998905",
"0.4977301",
"0.49703035",
"0.49605095",
"0.4928557",
"0.49239537"
] |
0.78542835
|
0
|
Returns all ratings of FAQ records.
|
public function getAllRatings()
{
$ratings = [];
switch (PMF_Db::getType()) {
case 'mssql':
case 'sqlsrv':
// In order to remove this MS SQL 2000/2005 "limit" below:
// The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or
// LIKE operator.
// we'll cast faqdata.thema datatype from text to char(2000)
// Note: the char length is simply an heuristic value
// Doing so we'll also need to trim $row->thema to remove blank chars when it is shorter than 2000 chars
$query = sprintf('
SELECT
fd.id AS id,
fd.lang AS lang,
fcr.category_id AS category_id,
CAST(fd.thema as char(2000)) AS question,
(fv.vote / fv.usr) AS num,
fv.usr AS usr
FROM
%sfaqvoting fv,
%sfaqdata fd
LEFT JOIN
%sfaqcategoryrelations fcr
ON
fd.id = fcr.record_id
AND
fd.lang = fcr.record_lang
WHERE
fd.id = fv.artikel
GROUP BY
fd.id,
fd.lang,
fd.active,
fcr.category_id,
CAST(fd.thema as char(2000)),
fv.vote,
fv.usr
ORDER BY
fcr.category_id',
PMF_Db::getTablePrefix(),
PMF_Db::getTablePrefix(),
PMF_Db::getTablePrefix()
);
break;
default:
$query = sprintf('
SELECT
fd.id AS id,
fd.lang AS lang,
fcr.category_id AS category_id,
fd.thema AS question,
(fv.vote / fv.usr) AS num,
fv.usr AS usr
FROM
%sfaqvoting fv,
%sfaqdata fd
LEFT JOIN
%sfaqcategoryrelations fcr
ON
fd.id = fcr.record_id
AND
fd.lang = fcr.record_lang
WHERE
fd.id = fv.artikel
GROUP BY
fd.id,
fd.lang,
fd.active,
fcr.category_id,
fd.thema,
fv.vote,
fv.usr
ORDER BY
fcr.category_id',
PMF_Db::getTablePrefix(),
PMF_Db::getTablePrefix(),
PMF_Db::getTablePrefix()
);
break;
}
$result = $this->_config->getDb()->query($query);
while ($row = $this->_config->getDb()->fetchObject($result)) {
$ratings[] = array(
'id' => $row->id,
'lang' => $row->lang,
'category_id' => $row->category_id,
'question' => $row->question,
'num' => $row->num,
'usr' => $row->usr,
);
}
return $ratings;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getAllRatings(){\n return self::all();\n }",
"function GetRatings()\n\t{\n\t\t$result = $this->sendRequest(\"GetRatings\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function getRatings(): Collection\n {\n\n return $this->ratings;\n\n }",
"public static function getAllFAQFromDB(){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n $query = \"SELECT *\r\n FROM \t FAQ;\";\r\n $resQuery = $db->executeQuery($query);\r\n\r\n $i=0;\r\n $allFAQ= array();\r\n foreach($resQuery[\"response\"] as $row ){\r\n $FAQ = FAQ($row[0],$row[1],$row[2],$row[3],$row[4]);\r\n $allFAQ[$i] = $FAQ;\r\n $i++;\r\n }\r\n return $allFAQ;\r\n }",
"public function getRatings() : array\n\t{\n\t\treturn $this->ratings;\n\t}",
"public function all()\n\t{\n\t\t$r = Array();\n\t\tif($db = $this->module->db())\n\t\t{\n\t\t\tif($result = $db->query(\"SELECT\n\t\t\t\tid\n\t\t\t\tFROM\n\t\t\t\t\".$db->getPrefix().\"faq;\"))\n\t\t\t{\n\t\t\t\twhile( $line = mysql_fetch_array( $result ) )\n\t\t\t\t{\n\t\t\t\t\t$r[] = new FAQ($this->module, $line[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $r;\n\t}",
"public function ratings()\n {\n return $this->hasMany(\\App\\Rating::class);\n }",
"public function getAll() {\n\t\t$sql = <<<SQL\nselect * from $this->tableName\norder by rating desc, title asc\nSQL;\n\n\t\t$stmt = $this->pdo()->prepare($sql);\n\t\t$stmt->execute();\n\n\t\t$movies = array();\n\t\tforeach($stmt as $row) {\n\t\t\t$movies[] = new Movie($row);\n\t\t}\n\n\t\treturn $movies;\n\t}",
"public function getRatings(Request $request)\n {\n return Rating::filter($request->all())\n ->paginate($request->get('per_page', 20));\n }",
"public function ratings()\n {\n \treturn $this->hasMany(Rating::class);\n }",
"public function ratings(){\n\t$comment_id = ee()->TMPL->fetch_param('comment_id');\t\n\tee()->db->select('knowledge,communication,attention,patience,fees,amount,session,anonymous');\n\tee()->db->where('comment_id',$comment_id);\n\t//ee()->db->where('parent_id',0);\n\t\n\t$query = ee()->db->get('mtt_ratings');\n\t\n\tif ($query->num_rows() > 0){\n\t\n\t$row = $query->row();\n\t\n\t$variables[] = array(\n\t\t'knowledge' => $row->knowledge,\n\t\t'communication' => $row->communication,\n\t\t'attention' => $row->attention,\n\t\t'patience' => $row->patience,\n\t\t'fees' => $row->fees,\n\t\t'amount' => $row->amount,\n\t\t'session' => $row->session,\n\t\t'anonymous' => $row->anonymous,\n\t\t'response'\t=> 'n'\n\t);\n\t\n\treturn ee()->TMPL->parse_variables(ee()->TMPL->tagdata, $variables);\n\t}\n\t\n\t}",
"public function myRatings($params = array()) {\n\n $myRatings = $this->select()\n ->from($this->info('name'), array('rating'))\n ->where(\"event_id = ?\", $params['event_id'])\n ->where(\"user_id = ?\", $params['user_id'])\n ->where(\"viewer_id = ?\", $params['viewer_id'])\n ->query()\n ->fetchColumn();\n return $myRatings;\n }",
"function getUserRatings($db, $context_pk, $user_pk) {\r\n\r\n $prefix = DB_TABLENAME_PREFIX;\r\n $resource_link_table_name = DataConnector\\DataConnector::RESOURCE_LINK_TABLE_NAME;\r\n $sql = <<< EOD\r\nSELECT rl.resource_link_pk, i.max_rating, r.rating\r\nFROM {$prefix}{$resource_link_table_name} rl INNER JOIN {$prefix}item i ON rl.resource_link_pk = i.resource_link_pk\r\n INNER JOIN {$prefix}rating r ON i.item_pk = r.item_pk\r\nWHERE rl.context_pk = :context_pk AND r.user_pk = :user_pk\r\nEOD;\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('context_pk', $context_pk, PDO::PARAM_INT);\r\n $query->bindValue('user_pk', $user_pk, PDO::PARAM_INT);\r\n $query->execute();\r\n\r\n $rows = $query->fetchAll(PDO::FETCH_OBJ);\r\n if ($rows === FALSE) {\r\n $rows = array();\r\n }\r\n\r\n return $rows;\r\n\r\n }",
"public function ratings()\n {\n return $this->hasMany('App\\Models\\Rating');\n }",
"public function getFAQs()\n {\n $faqsList = Faq::selectRaw('id,question,title,answer')->where('isActive',1)->get();\n \n if($faqsList->isNotEmpty())\n {\n return $this->toJson(['faqsList' => $faqsList], trans('api.faq.faq_found'), 1);\n }\n\n return $this->toJson([], trans('api.faq.faq_not_found'), 0);\n }",
"public function getRating();",
"public function getRating();",
"function getContextRatings($db, $context_pk) {\r\n\r\n $prefix = DB_TABLENAME_PREFIX;\r\n $resource_link_table_name = DataConnector\\DataConnector::RESOURCE_LINK_TABLE_NAME;\r\n $sql = <<< EOD\r\nSELECT rl.resource_link_pk title, i.max_rating, r.rating\r\nFROM {$prefix}{$resource_link_table_name} rl INNER JOIN {$prefix}item i ON rl.resource_link_pk = i.resource_link_pk\r\n INNER JOIN {$prefix}rating r ON i.item_pk = r.item_pk\r\nWHERE rl.context_pk = :context_pk\r\nEOD;\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('context_pk', $context_pk, PDO::PARAM_INT);\r\n $query->execute();\r\n\r\n $rows = $query->fetchAll(PDO::FETCH_OBJ);\r\n if ($rows === FALSE) {\r\n $rows = array();\r\n }\r\n\r\n return $rows;\r\n\r\n }",
"public function getAllRates()\n {\n return $this->getRatesQuery()->execute();\n }",
"public function findAll()\n {\n return $this->faqRepository->findAll();\n }",
"public function getAllReviews(){\n\t\t$sql = \"SELECT * FROM reviews\";\n\n\t\t// with PDO prepare for sql statment executing\n\t\t$pdo_statement = $this->dbh->prepare($sql);\n\n\t\t// sql execution\n\t\t$pdo_statement->execute();\n\t\t\n\t\t// return results\n\t\treturn $pdo_statement->fetchAll();\n\t}",
"public function FAQs()\n {\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n $cat_field = 'categories_instructor';\n \n $this->Default_Category_Id = 0;\n \n } else {\n $type = \" AND `type_customer`=1\";\n $cat_field = 'categories_customer';\n }\n \n # DECRYPT THE ENCRYPTED QUERY\n # ====================================================\n $eq = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $cid = (isset($eq['cid'])) ? $eq['cid'] : $this->Default_Category_Id;\n $cat = (isset($eq['cat'])) ? $eq['cat'] : '';\n \n $special = (isset($eq['special'])) ? $eq['special'] : '';\n $special = ($eq == null) ? 'force_common' : $special;\n \n $category = ($cid != 0) ? \" AND CONCAT(',', `{$cat_field}`, ',') LIKE '%,{$cid},%' \" : '';\n $cat_title = ($cat) ? $cat : \"frequently asked questions\";\n \n $cat_special = '';\n if ($this->Use_Common_Category) {\n switch ($special) {\n case 'common':\n case 'force_common':\n $cat_special = \" AND `most_common`=1 \";\n break;\n }\n }\n \n if ($this->Use_Display_All_Category) {\n $category = ($cid == $this->All_Category_Id) ? '' : $category;\n }\n \n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_faqs'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type $category $cat_special\",\n 'order' => 'sort_order ASC',\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n $tab_content_faqs = \"<ul class='faqs'>\";\n foreach ($records as $record) {\n $tab_content_faqs .= \"\n <li>\n <a class='faq_q'>{$record['question']}</a>\n <div class='faq_a' style='display: none;'>{$record['answer']}</div>\n </li>\";\n }\n $tab_content_faqs .= \"</ul>\";\n \n $output = \"\n <div class='faq_title'>{$cat_title}</div>\n <div id='helpcenter_faq'>$tab_content_faqs</div>\";\n \n return $output;\n }",
"public function getFaqs() {\r\n $result = $this -> db -> query (\r\n \"SELECT\r\n *\r\n FROM\r\n faqs\r\n \"\r\n );\r\n\r\n $return = array();\r\n \r\n if ($result ) {\r\n /* fetch associative array */\r\n while ($row = $result->fetch_assoc()) {\r\n $return['faq'][]['nodes'] = array (\"question\" => $row['question'],\r\n \"answer\" => $row['answer']\r\n );\r\n }\r\n\r\n /* free result set */\r\n $result->free();\r\n }\r\n \r\n return $return;\r\n }",
"public function ratings()\n {\n return $this->morphMany(\\App\\Models\\Rating::class, 'rateable');\n }",
"public function getAllQuiz(){\n\t\treturn $this->db->getAllQuiz();\n\t}",
"public function getAllArticlesWithReviews()\n {\n return Db::queryAll('SELECT `article`.`id`, `article`.`title`, `user`.`username`, `review`.`id` AS `review`, `review`.`user_id`,\n `reviewer`.`username` AS `reviewer`, `review`.`article_id`, \n `review`.`rating_originality`, `review`.`rating_theme`, `review`.`rating_language`, \n `review`.`rating_awesomeness`, `review`.`rating_style`, `article`.`state`,\n FORMAT(`review`.`rating_originality` + `review`.`rating_theme` + `review`.`rating_language` + `review`.`rating_awesomeness` +`review`.`rating_style`, \"N2\") / 5 AS `rating`,\n (SELECT COUNT(*) FROM `review` WHERE `article`.`id` = `review`.`article_id`) AS `count`\n FROM `article` LEFT JOIN `review` ON `article`.`id` = `review`.`article_id` \n INNER JOIN `user` ON `user`.`id` = `article`.`author`\n LEFT JOIN `user` `reviewer` ON `reviewer`.`id` = `review`.`user_id`');\n }",
"public function getQuizzesAll ()\n {\n \t// haven't included \"order by priority desc\" as we sort in the Quizzes class\n \treturn ($this->db_object->getRowsAll (\"Select * from \".$this->table_prefix.$this->quiz_tables['quizzes'] ));\n }",
"public function averageRate()\n {\n $movie = $this->getKey();\n return DB::table('movies_reviews')\n ->where('movies_id', '=', $movie)\n ->average('rate');\n }",
"public function rating()\n {\n return $this->hasOne('App\\Review')\n ->selectRaw('user_id, count(*) as count, avg(would_recommend) as avg, avg(communication) as communication, avg(as_described) as as_described')\n ->groupBy('user_id');\n }",
"public function ratings()\n {\n return $this->morphMany('willvincent\\Rateable\\Rating', 'rateablein');\n }"
] |
[
"0.7133772",
"0.65020007",
"0.6182907",
"0.61799127",
"0.61701113",
"0.60548866",
"0.6019849",
"0.5945178",
"0.59121394",
"0.58365935",
"0.57926375",
"0.5786831",
"0.5783891",
"0.5758096",
"0.5726103",
"0.5722584",
"0.5722584",
"0.5696382",
"0.56629765",
"0.56628805",
"0.56471014",
"0.563917",
"0.56165314",
"0.559022",
"0.5571744",
"0.5564372",
"0.55586666",
"0.5515098",
"0.5514994",
"0.5507571"
] |
0.77991015
|
0
|
Set cookie validation key in .env file.
|
public static function setCookieValidationKey(array $paths = ['.env' => '<cookie_validation_key>'])
{
if (!extension_loaded('openssl')) {
throw new Exception('The OpenSSL PHP extension is required.');
}
foreach ($paths as $file => $pattern) {
if (is_file($file)) {
Console::stdout("Generating cookie validation key in $file", Console::FG_GREY);
$content = file_get_contents($file);
$content = preg_replace_callback("/$pattern/m", function () {
$length = 32;
$bytes = openssl_random_pseudo_bytes(32, $crypto_strong);
return strtr(substr(base64_encode($bytes), 0, $length), '+/', '_-');
}, $content);
file_put_contents($file, $content);
} else {
Console::stderr("$file not found", Console::FG_RED);
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected static function _set_cookie()\n\t{\n\t\t/** @var Cookie::$salt string */\n\t\tCookie::$salt = Config::get('cookie.salt');\n\n\t\t/** @var Cookie::$expiration string */\n\t\tCookie::$expiration = Config::get('cookie.lifetime');\n\t}",
"protected static function key()\n {\n return env('APP_KEY');\n }",
"private function define_jwt_secret_key() {\n\t\tdefine( 'JWT_AUTH_SECRET_KEY', get_option( $this->option_name_jwt_secret_key ) );\n\t}",
"protected function __setCookie()\n\t{\n\t\t$this->Cookie->type('cipher');\n\t\t$this->Cookie->name = 'Stats';\n\t\t$this->Cookie->time = '90 days';\n\t\t$this->Cookie->path = '/';\n\n\t\t# Dev or production server\n\t\tif (empty($_SERVER['APPLICATION_ENV'])) {\n\t\t\t$domain = get_domain(env('HTTP_HOST'));\n\t\t\t$domain = \"cms.muoriginfree.com\";\n\t\t\t#$domain = '45.117.77.125';\n\t\t} else {\n\t\t\t$domain = env('HTTP_HOST');\n\t\t}\n\t\t$this->Cookie->domain = $domain;\n\t\t\n\t\t$this->Cookie->key = 'quanvh_qSdd%ddId2121232xdddddxqADYhG93b0qyJfIxfs1232guVoUubWwvaniR2G0FgaC9mis*&saX6Owsd121!';\n\t}",
"public function set_cookie()\n {\n }",
"public function actionCookie($replace = true)\n {\n $params = $this->getConfig($this->config);\n $found = !empty($params['cookieValidationKey']);\n\n if (!$found || $replace) {\n if ($this->confirm($found ? 'Override existing cookie validation key?' : 'Generate cookie validation key?', !$found)) {\n $params['cookieValidationKey'] = static::generateCookieValidationKey();\n $this->setConfig($this->config, $params);\n }\n }\n }",
"public function env($key = null);",
"function set_cookie($name, $value, $days = 30) {\n $expiretime = time() + (86400 * $days);\n setcookie(APP_ID . $name, $value, $expiretime, \"/\");\n}",
"protected function key()\n {\n return \"CLIENT_SECRET\";\n }",
"private function setSessionKey()\n {\n $this->sessionKey = 'formfactory.captcha.' . $this->formRequestClass;\n }",
"public static function setCookieJar($cookie){\n \\Illuminate\\Auth\\Guard::setCookieJar($cookie);\n }",
"public function setCookieKey($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->cookie_key !== $v) {\n\t\t\t$this->cookie_key = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::COOKIE_KEY;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function wp_validate_auth_cookie($cookie = '', $scheme = '')\n {\n }",
"public function storeSessionKey( $cookie ) {\n\t\t$cookie = wp_parse_auth_cookie( $cookie, 'logged_in' );\n\t\t$this->sessionToken = ! empty( $cookie['token'] ) ? $cookie['token'] : '';\n\t}",
"public static function getCookie($key = null)\n {\n $config['cookie_prefix'] = '';\n $config['cookie_domain'] = '';\n $config['cookie_path'] = '/';\n $config['cookie_secure'] = FALSE;\n $config['cookie_httponly'] = FALSE;\n\n return !empty($key) && isset($config[$key]) ? $config[$key] : $config;\n }",
"function wp_set_auth_cookie($user_id, $remember = \\false, $secure = '', $token = '')\n {\n }",
"private function setMerchantKey()\n {\n $this->key = config('gladepay.key');\n }",
"public static function CDN_KEY() {\n return Config::get_env(\"CDN_KEY\", \"CLXDZS24AL6KDVDGCG33\");\n }",
"public function normalize_cookie($cookie, $key = '')\n {\n }",
"public static function authenticateByCookie(): void\n {\n $request = RequestFactory::create();\n $token = $request->getCookieParam('jwToken');\n if ($token === null\n || !self::validate($token)\n ) {\n header('Not authorized', true, 403);\n exit;\n }\n }",
"private static function secureEnvConfig() {\n //check session config\n //check db, plugin, encryption\n //make sure default apps are all registered\n $titleCheck = (!isset(DSettings::$globalName[2]) || isset(DSettings::$globalName[29]));\n $routerCheck = empty(DSettings::$router['apps']) || empty(DSettings::$router['apps']);\n if ($titleCheck)\n trigger_error(DMainLang::$errorConsts['websiteTitleError']);\n elseif ($routerCheck)\n trigger_error(DMainLang::$errorConsts['routerInitError']);\n }",
"public static function authCookie(string $token) : void\n {\n setcookie('NameYourGoat_User_Token', $token, time() + 3600*24*30, '/');\n }",
"function setacookiet($value, $expire)\r\n{\r\n\tglobal $cookie_name, $cookie_path, $cookie_domain;\r\n\t$cookie_namet=$cookie_name.\"_terms\";\r\n\tif (version_compare(PHP_VERSION, '5.2.0', '>='))\r\n\t\tsetcookie($cookie_name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);\r\n\telse\r\n\t\tsetcookie($cookie_name, $value, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);\r\n}",
"public function get_key() {\n\t\treturn self::$csrf_cookie;\n\t}",
"public function setOnCheckCookieRequest()\n {\n $origin = $this->getOrigin();\n if ($this->originIsValid($origin)) {\n header('Access-Control-Allow-Origin: ' . $this->request->server->get('HTTP_ORIGIN'));\n header('Access-Control-Allow-Credentials: true');\n header('Content-Type: application/json');\n if($user = $this->getUserFromCookie()) {\n $token = (new JWT($this->getDomain()))->generate(array('uid' => $user['id']));\n echo '{\"status\":\"ok\",\"' . \\ModuleSSO::TOKEN_KEY . '\":\"' . $token . '\",\"email\":\"' . $user['email'] . '\"}';\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"bad_cookie\"))->send();\n }\n } else {\n //probably won't reach this because of Same origin policy\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"http_origin_not_set\"))->send();\n }\n }",
"public function testPostSessionCsrfFailureWithSetCookieName(): void\n {\n $this->builder->scope('/custom-cookie-csrf/', ['csrf' => 'cookie'], function (RouteBuilder $routes): void {\n $routes->registerMiddleware('cookieCsrf', new CsrfProtectionMiddleware(\n [\n 'cookieName' => 'customCsrfToken',\n ]\n ));\n $routes->applyMiddleware('cookieCsrf');\n $routes->connect('/posts/{action}', ['controller' => 'Posts']);\n });\n $this->enableCsrfToken('customCsrfToken');\n $data = [\n 'title' => 'Some title',\n 'body' => 'Some text',\n '_csrfToken' => 'failure',\n ];\n $this->post('/custom-cookie-csrf/posts/header', $data);\n $this->assertResponseCode(403);\n }",
"public function setCookiePolicy()\n {\n if ($this->checkSameSiteNoneCompatible()) {\n config([\n 'session.secure' => true,\n 'session.same_site' => 'none',\n ]);\n }\n }",
"public function getCookieKey()\n\t{\n\t\treturn $this->cookie_key;\n\t}",
"public function enableCookies() {}",
"function config_set($name,$value=false) {\n setcookie('backoff_' . $name,$value,time()+60*60*24*365,url_base()); // exp. 365 days\n }"
] |
[
"0.5721893",
"0.5669725",
"0.56534886",
"0.55886143",
"0.55058336",
"0.5470233",
"0.5425496",
"0.5326322",
"0.5286384",
"0.5261054",
"0.52551824",
"0.5228061",
"0.52162695",
"0.5191473",
"0.51884305",
"0.5181954",
"0.51784873",
"0.5161809",
"0.5137633",
"0.51368374",
"0.5132805",
"0.512709",
"0.5117889",
"0.51141936",
"0.50640434",
"0.5056907",
"0.50533825",
"0.50470495",
"0.501438",
"0.50138813"
] |
0.6673888
|
0
|
Overloading this method to show the Amazon id of the order instead of the name of the Magento store
|
public function getOrderStoreName()
{
if ($this->getOrder()) {
$name = array();
if($this->getOrder()->getAmazonOrderId()){
$name = array(
Mage::helper('amazonOrders')->__('Imported from Amazon'),
"#" . $this->getOrder()->getAmazonOrderId()
);
}
if (count($name)) {
return implode('<br/>', $name);
} else {
return parent::getOrderStoreName();
}
}
return null;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getAmazonOrderId()\n {\n return $this->_fields['AmazonOrderId']['FieldValue'];\n }",
"public function getAmazonOrderId()\n {\n if (isset($this->data['AmazonOrderId'])) {\n return $this->data['AmazonOrderId'];\n } else {\n return false;\n }\n }",
"protected function OrderID() {\n\treturn $this->Value('ID_Order');\n }",
"public function getAmazonOrderReferenceId()\n {\n $paymentHandler = $this->GetPaymentHandler();\n if (false === ($paymentHandler instanceof AmazonPaymentHandler)) {\n throw new \\InvalidArgumentException('order was not paid with amazon payment');\n }\n\n /** @var $paymentHandler AmazonPaymentHandler */\n\n return $paymentHandler->getAmazonOrderReferenceId();\n }",
"public function orderInfo($increment_id){\n $result = $this->data['client']->salesOrderInfo($this->data['session'], $increment_id);\n \n return $result;\n}",
"public function getOrder()\n {\n echo json_encode($this->Inventory_model->getProductById($_POST['idJson']));\n }",
"public function getOrderId(): string\n {\n return $this->orderId;\n }",
"protected function GetOrderID() {\n\treturn $this->Value('ID_Order');\n }",
"public function getId()\n {\n return $this->source['order_item_id'];\n }",
"public function ajaxgenerateamazonorderAction(){\r\n global $user;\r\n if(!$user->uid){\r\n \t\tgotoUrl('');\r\n \t}\r\n \t$amazon_orders = $this->_orderInstance->getAmazonOrders();\r\n \t$amazonStockInstance = Amazonstock_Model::getInstance();\r\n \t$siteInstance = Site_Model::getInstance();\r\n \t$areaInstance = Area_Model::getInstance();\r\n \t$orderRecords = array();\r\n \t$orderRecords[] = array('MerchantFulfillmentOrderID','DisplayableOrderID','DisplayableOrderDate','MerchantSKU','Quantity',\r\n \t\t\t\t\t\t\t'MerchantFulfillmentOrderItemID','GiftMessage','DisplayableComment','PerUnitDeclaredValue',\r\n \t\t\t\t\t\t\t'DisplayableOrderComment','DeliverySLA','AddressName','AddressFieldOne','AddressFieldTwo','AddressFieldThree',\r\n \t\t\t\t\t\t\t'AddressCity','AddressCountryCode','AddressStateOrRegion','AddressPostalCode','AddressPhoneNumber','NotificationEmail');\r\n \tforeach ($amazon_orders as $oid=>$amazon_order){\r\n \t\tforeach($amazon_order->items as $orderItem){\r\n\t \t\t$orderRecord = array();\r\n\t \t\t$orderRecord[] = $amazon_order->number;\r\n\t \t\t$orderRecord[] = $amazon_order->number;\r\n\t \t\t$orderRecord[] = date('Y-m-d\\Th:i:s', TIMESTAMP);\r\n\t \t\t$amazon_sku = $amazonStockInstance->composeSKU($orderItem->p_sn, $orderItem->data);\r\n\t \t\t$orderRecord[] = $amazon_sku;\r\n\t \t\t$orderRecord[] = $orderItem->qty;\r\n\t \t\t$orderRecord[] = $amazon_sku . '-'.strval($orderItem->oiid);\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$siteInfo = $siteInstance->getSite($orderItem->sid);\r\n\t \t\tif($siteInfo == false){\r\n\t \t\t\t$siteInfo = new stdClass();\r\n\t \t\t\t$siteInfo->name = 'Lingeriemore.com';\r\n\t \t\t}\r\n\t \t\t$orderRecord[] = 'Thank you for ordering from '.$siteInfo->name .'!';\r\n\t \t\t$orderRecord[] = 'Standard';\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_first_name . ' '.$amazon_order->delivery_last_name;\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_address;\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_city;\r\n\t \t\t$orderRecord[] = $areaInstance->getAreaCode($amazon_order->delivery_country);\r\n\t \t\t$orderRecord[] = $areaInstance->getAreaCode($amazon_order->delivery_province);\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_postcode;\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_mobile;\r\n\t \t\t$orderRecord[] = '[email protected]';\r\n\t \t\t\r\n\t \t\t$orderRecords[] = $orderRecord;\r\n \t\t}\r\n \t}\r\n \t//generate csv file.\r\n $filename = 'amazon_order-'.strval(TIMESTAMP).'.txt';\r\n download_send_headers($filename);\r\n $outputBuffer = fopen(\"php://output\", 'w');\r\n foreach($orderRecords as $orderRecord) {\r\n \tfwrite($outputBuffer, implode(\"\\t\", $orderRecord) .\"\\r\\n\");\r\n }\r\n fclose($outputBuffer);\r\n }",
"public function getQuoteId();",
"public function getOrderId(): string\n {\n return $this->getData(self::ORDER_ID);\n }",
"public function getOrderid() {\n\t\treturn $this->orderid;\n\t}",
"public function getOrderId();",
"public function getProductID()\n {\n }",
"public function __toString()\n {\n return \"{$this->getOrder()}/{$this->getUniqueName()}\";\n }",
"public function getOrderNumber();",
"public function getOrderNumber();",
"public function getIdentifier()\n {\n $sellerId = ($this->getSeller()) ? $this->getSeller()->getId() : '';\n\n return $sellerId.$this->getAmount().$this->getCurrency();\n }",
"public function getCurrentCartIdentifier();",
"public function getPrefixedIdAttribute()\n {\n return 'product-' . $this->id;\n }",
"public function getStoreId(){\n $this->getStore()->getId();\n }",
"public function getProductListing($order,$orderItems,$ref)\n {\n //echo \"<pre>\"; print_r($orderItems->getData());\n $html_content.='\n <tr>\n <td width=\"100%\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n <tr>\n <td width=\"50%\">\n <h4>Ship To:</h4>';\n $html_content.=$order->getShippingAddress()->getCompany().'<br/>'.$order->getShippingAddress()->getStreet(1).',<br/>'.$order->getShippingAddress()->getStreet(2).'<br/>'.$order->getShippingAddress()->getRegion(). $order->getShippingAddress()->getPostcode().',<br/> '.$order->getShippingAddress()->getCountryId().',<br/> '.$order->getShippingAddress()->getFirstname().' '.$order->getShippingAddress()->getLastname().'\n </td>\n <td width=\"50%\">\n <h4>Req by:</h4>'.\n $customerAddressId = Mage::getModel('customer/customer')->load($order->getCustomerId())->getDefaultBilling();\n \n if ($customerAddressId) {\n $address = Mage::getModel('customer/address')->load($customerAddressId);\n }\n $html_content.=$address->getCompany().' <br/>'.$address->getStreet(1).',<br/>'.$address->getStreet(2).' <br/>'.$address->getRegion(). $address->getPostcode().', '.$address->getCountryId().'\n </td>\n </tr> \n </table>\n </td> \n </tr>\n <tr><td height=\"20\"> </td></tr>\n <tr>\n <td width=\"100%\">\n <table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"box-table\">\n <tr>\n <td><b>Sales Rep:</b><br/>'.$customer = Mage::getModel('customer/customer')->load($order->getCustomerId())->getIpsalesrep().'</td>\n <td><b>Customer ID: </b><br/>'.$order->getCustomerId().'</td>\n <td><b>Shipped Date: </b><br/>'.date(\"d-M-y\").' </td>\n </tr>\n </table>\n </td>\n </tr> \n <tr><td height=\"20\"> </td></tr>\n <tr>\n <td width=\"100%\">\n <table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"100%\">';\n if($ref==2){\n $html_content.='\n <tr>\n <th width=\"10%\" align=\"left\"> </th>\n <th width=\"10%\" align=\"left\">Quantity</th>\n <th width=\"35%\" align=\"left\">Product Name</th>\n <th width=\"15%\" align=\"left\">Color</th>\n <th width=\"15%\" align=\"left\">Basis Weight</th>\n <th width=\"15%\" align=\"left\">Sheet Size</th>\n </tr>'; \n }\n else{\n $html_content.='\n <tr>\n <th width=\"10%\" align=\"left\">PL</th>\n <th width=\"10%\" align=\"left\">Quantity</th>\n <th width=\"35%\" align=\"left\">Product Name</th>\n <th width=\"15%\" align=\"left\">Color</th>\n <th width=\"15%\" align=\"left\">Basis Weight</th>\n <th width=\"15%\" align=\"left\">Sheet Size</th>\n </tr>'; \n } \n foreach ($orderItems as $item){\n \n if($item->getProductType() != \"configurable\"){\n $product = Mage::getModel('catalog/product')->load($item->getProductId());\n \n $optionsArr = $item->getProductOptions();\n if(count($optionsArr['options']) > 0)\n {\n foreach ($optionsArr['options'] as $option)\n {\n //$optionTitle = $option['label'];\n //$optionId = $option['option_id'];\n //$optionType = $option['type'];\n $optionValue = '<br> Custom Order: '.$option['value'];\n }\n }\n \n $attributePrefix = $this->getAttributeSet($product);\n if($attributePrefix == \"fs\"){\n if(!$product->getAttributeText($attributePrefix.'_size')){\n $promo = true;\n }\n }\n else{ \n if(!$product->getAttributeText($attributePrefix.'_basis_weight') && !$product->getAttributeText($attributePrefix.'_size')){\n $promo = true;\n } \n } \n if($ref==2){\n if($attributePrefix == \"fs\"){\n $html_content.='\n <tr>\n <td width=\"10%\" align=\"left\"> </td>\n <td width=\"10%\" align=\"left\">'.(int)$item->getQtyOrdered().'</td>\n <td width=\"35%\" align=\"left\">'.$item->getName(). $optionValue.'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_color').'</td>\n <td width=\"15%\" align=\"left\"> </td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_size').'</td>\n </tr>';\n \n }\n else{\n $html_content.='\n <tr>\n <td width=\"10%\" align=\"left\"> </td>\n <td width=\"10%\" align=\"left\">'.(int)$item->getQtyOrdered().'</td>\n <td width=\"35%\" align=\"left\">'.$item->getName(). $optionValue.'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_color').'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_basis_weight').'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_size').'</td>\n </tr>'; \n } \n }\n else{\n if($attributePrefix == \"fs\"){\n $html_content.='\n <tr>\n <td width=\"10%\" align=\"left\">'.$product->getPullLocation().'</td>\n <td width=\"10%\" align=\"left\">'.(int)$item->getQtyOrdered().'</td>\n <td width=\"35%\" align=\"left\">'.$item->getName(). $optionValue.'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_color').'</td>\n <td width=\"15%\" align=\"left\"> </td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_size').'</td>\n </tr>'; \n }\n else {\n $html_content.='\n <tr>\n <td width=\"10%\" align=\"left\">'.$product->getPullLocation().'</td>\n <td width=\"10%\" align=\"left\">'.(int)$item->getQtyOrdered().'</td>\n <td width=\"35%\" align=\"left\">'.$item->getName(). $optionValue.'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_color').'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_basis_weight').'</td>\n <td width=\"15%\" align=\"left\">'.$product->getAttributeText($attributePrefix.'_size').'</td>\n </tr>'; \n } \n } \n \n }\n \n unset($optionValue);\n //unset($basisWeight);\n //unset($sheetSize);\n //unset($proColor);\n }\n $html_content.='\n </table>\n </td>\n </tr>\n <tr><td height=\"20\"> </td></tr>\n <tr>\n <td width=\"100%\" align=\"left\">\n <p>Requested By: '.$address->getFirstname().' '.$address->getLastname().'</p>\n <p>Remarks:</p>';\n if($promo){\n $html_content.='<h1>Promotional Material Needed*</h1>';\n } \n $html_content.='\n </td> \n </tr>\n <tr><td height=\"20\"> </td></tr>\n <tr>\n <td width=\"100%\" align=\"left\">\n <h1>'.preg_replace(\"/Customer Order Comment:/\", \"\", $order->getCustomerNote()).'</h1>\n </td> \n </tr>\n ';\n return $html_content; \n }",
"public function show(Order $order)\n { \n //\n }",
"public function getOrderID()\n {\n return $this->orderID;\n }",
"public function getOrderID()\n {\n return $this->orderID;\n }",
"public function getOrderID()\n {\n return $this->orderID;\n }",
"public function getOrderID()\n {\n return $this->orderID;\n }",
"private function alterOrderInformation()\n {\n if (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '<')) {\n $sql = \"UPDATE `s_core_snippets`\n SET `value` = CASE\n WHEN `value` = 'Free text 4' THEN 'Transaction ID'\n WHEN `value` = 'Freitextfeld 4' THEN 'Transaktions-ID'\n ELSE `value`\n END\n WHERE `namespace` = 'backend/order/main'\n AND `value` IN ('Freitextfeld 4', 'Free text 4')\";\n } elseif (version_compare(Shopware()->Config()->get( 'Version' ), '5.2.0', '>=')) {\n $sql = \"INSERT INTO `s_attribute_configuration` (table_name, column_name, \"\n . \"column_type, position, translatable, display_in_backend, custom, \"\n . \"help_text, support_text, label, entity, array_store) \"\n . \"VALUES ('s_order_attributes','attribute4','string',1,0,1,0,'','','Transaction ID','NULL',NULL)\";\n }\n Shopware()->Db()->query($sql);\n }",
"function getOrderDetails($id)\n {\n }"
] |
[
"0.6447388",
"0.62352896",
"0.6193489",
"0.6155817",
"0.6108584",
"0.60926235",
"0.60804284",
"0.605017",
"0.6049936",
"0.6001951",
"0.59453756",
"0.59066594",
"0.5880674",
"0.5861086",
"0.58481914",
"0.58465976",
"0.5844659",
"0.5844659",
"0.58427066",
"0.58232826",
"0.5812481",
"0.5810498",
"0.58043057",
"0.5795321",
"0.57803494",
"0.57803494",
"0.57803494",
"0.57803494",
"0.5780096",
"0.57647663"
] |
0.74730736
|
0
|
Handle the siswa "creating" event
|
public function creating(Siswa $siswa)
{
$siswa->created_by = \Auth::user()->id;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function creating()\n {\n # code...\n }",
"public function created(Siswa $siswa)\n {\n //\n }",
"public function create()\n {\n // Not needed cause this is coming from the item listing\n }",
"function before_create() {}",
"function after_create() {}",
"public function create() {\n\t\t\t//\n\t\t}",
"protected function _precreate() {\n }",
"public function create()\n {\n // handled by client\n }",
"public function create(){\n\t\t//\n\t}",
"public function create(){\n\t\t//\n\t}",
"public function create(){\n\t\t//\n\t}",
"public function create(){\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create()\n\t{\n \n \n\t}",
"public function create()\n\t{\n\t\t\n\t\t//\n\t}",
"public function create()\n\t{\n\n\n\t\t//\n\t}",
"public function create()\n\t{ \n \n\t}",
"function on_creation() {\n $this->init();\n }",
"public function create()\n\t\t{\n\t\t\t//\n\t\t}"
] |
[
"0.6347628",
"0.63198996",
"0.6239977",
"0.6226245",
"0.614674",
"0.6115579",
"0.6107299",
"0.6102929",
"0.6101699",
"0.6101699",
"0.6101699",
"0.6101699",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.60911894",
"0.6072383",
"0.6059818",
"0.6042803",
"0.6038497",
"0.60328597",
"0.602349"
] |
0.63451636
|
1
|
Handle the siswa "created" event.
|
public function created(Siswa $siswa)
{
//
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function onCreated()\n {\n parent::onCreated();\n\n }",
"public function onCreated()\n {\n parent::onCreated();\n\n }",
"function on_creation() {\n $this->init();\n }",
"public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }",
"function after_create() {}",
"public function handle(StreamWasCreated $event)\n {\n $this->dispatch(new CreateStreamsEntryTable($event->getStream()));\n }",
"public function instance_created() {\n if ($this->isready && !$this->prescan) {\n // It is supposed the store instance to expect an empty folder.\n $this->purge_all_definitions();\n }\n }",
"public function created(EntryInterface $entry)\n {\n $this->commands->dispatch(new CreateStream($entry));\n\n parent::created($entry);\n }",
"protected function created()\n {\n $this->response = $this->response->withStatus(201);\n $this->jsonBody($this->payload->getOutput());\n }",
"protected function onCreated()\n {\n return true;\n }",
"protected function MetaAfterCreate() {\n\t\t}",
"public function created()\n\t{\n\t\tif (!$this->ismilestone) {\n\t\t\t$this->createDefaultMilestone();\n\t\t}\n\n\t\t$this->versioningService->createVersion($this);\n\t}",
"function before_create() {}",
"public function onCreated(Created $event)\n {\n $buildersRisk = $event->buildersRisk;\n if (!$buildersRisk->user_id) {\n $user = User::where('email', $buildersRisk->email)->first();\n if (!$user) {\n //create User\n $user = User::create([\n 'name' => explode('@', $buildersRisk->email)[0],\n 'email' => $buildersRisk->email,\n ]);\n }\n $user->buildersRisks()->save($buildersRisk);\n }\n \\Mail::to(env('NEW_SUBMISSION_CREATED_EMAIL_RECEIVER'))->send(\n new NewSubmissionCreatedEmail($buildersRisk)\n );\n }",
"public function create()\n {\n // Not needed cause this is coming from the item listing\n }",
"public function created(EntryInterface $entry)\n {\n $this->dispatch(new CreateStream($entry));\n $this->dispatch(new CreateDirectory($entry));\n\n parent::created($entry);\n }",
"public function creating(Siswa $siswa)\n {\n\n $siswa->created_by = \\Auth::user()->id;\n\n }",
"function created()\n {\n /**\n * [signal]\n *\n * IDF_Project::created\n *\n * [sender]\n *\n * IDF_Project\n *\n * [description]\n *\n * This signal allows an application to perform special\n * operations at the creation of a project.\n *\n * [parameters]\n *\n * array('project' => $project)\n *\n */\n $params = array('project' => $this);\n Pluf_Signal::send('IDF_Project::created',\n 'IDF_Project', $params);\n }",
"public function testHandleCreate(): void\n {\n $query = 'SELECT * FROM [nt:unstructured]';\n $locale = 'fr';\n $primarySelector = 'p';\n\n $this->queryCreateEvent->getInnerQuery()->willReturn($query);\n $this->queryCreateEvent->getLocale()->willReturn($locale);\n $this->queryCreateEvent->getOptions()->willReturn([]);\n $this->queryCreateEvent->getPrimarySelector()->willReturn($primarySelector);\n $this->queryManager->createQuery($query, 'JCR-SQL2')->willReturn($this->phpcrQuery->reveal());\n $this->queryCreateEvent->setQuery(new Query(\n $this->phpcrQuery->reveal(),\n $this->dispatcher->reveal(),\n $locale,\n [],\n $primarySelector\n ))->shouldBeCalled();\n\n $this->subscriber->handleCreate($this->queryCreateEvent->reveal());\n }",
"public function beforeCreate()\n {\n\t\t// Asignar la fecha y hora de creacion del registro\n $this->createdon = time();\n $this->updatedon = time();\n\t\tif ($this->subscribedon == 0) {\n\t\t\t$this->subscribedon = $this->createdon;\n\t\t}\n }",
"protected function created(WebhookPayload $payload): void\n {\n //\n }",
"protected function _precreate() {\n }",
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }",
"public function created(EntryInterface $entry)\n {\n event(new UserWasCreated($entry));\n\n parent::created($entry);\n }",
"public function onCreated(Step $step): void\n {\n }",
"public function created(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('created'));\n }",
"public function creating()\n {\n # code...\n }",
"public function onCreating(Step $step): void\n {\n }",
"public function postCreate() {\n\t\t// Check permission\n //\n if (!Sentry::getUser()->hasAccess($this->permission_prefix . '.create')) {\n return App::abort('403');\n }\n\t}",
"public function created(Exchange $exchange)\n {\n //\n }"
] |
[
"0.63365626",
"0.63365626",
"0.62559927",
"0.621555",
"0.6120893",
"0.60867286",
"0.60132766",
"0.59991765",
"0.58860135",
"0.5875622",
"0.5826207",
"0.58103174",
"0.57954335",
"0.57892567",
"0.57759446",
"0.57604593",
"0.5742576",
"0.5720109",
"0.57143223",
"0.57087874",
"0.5667919",
"0.56578404",
"0.5623485",
"0.5609761",
"0.5578146",
"0.5575415",
"0.55618584",
"0.555892",
"0.5551459",
"0.5526246"
] |
0.63654673
|
0
|
Handle the siswa "updated" event.
|
public function updated(Siswa $siswa)
{
//
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function _update()\n\t{\n\t}",
"protected function _update()\n {\n \n }",
"protected function _update()\n {\n \n }",
"public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"protected function update() {}",
"public function _get_update_callback()\n {\n }",
"public function after_update() {}",
"public function update() {\r\n }",
"public function onUpdate();",
"public function onUpdate();",
"public function onUpdate();",
"public function updating()\n {\n # code...\n }",
"public function update()\r\n {\r\n //\r\n }",
"public static function updated($callback)\n {\n self::listenEvent('updated', $callback);\n }",
"function after_update() {}",
"public function update()\r\n {\r\n \r\n }",
"public function update()\n {\n }",
"public function update()\n {\n //\n }",
"public function update()\n {\n //\n }",
"public function update() {\r\n\r\n\t}",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }",
"public function update()\n {\n }"
] |
[
"0.6396151",
"0.6324422",
"0.6324422",
"0.62933636",
"0.6276517",
"0.6250298",
"0.62498474",
"0.62430656",
"0.62379736",
"0.62379736",
"0.62379736",
"0.6237925",
"0.6227872",
"0.62019205",
"0.61712265",
"0.61686015",
"0.61662227",
"0.6148908",
"0.6148908",
"0.61054856",
"0.60910875",
"0.60910875",
"0.60910875",
"0.60910875",
"0.60910875",
"0.60910875",
"0.60910875",
"0.60910875",
"0.60910875",
"0.60910875"
] |
0.683233
|
0
|
Handle the siswa "restored" event.
|
public function restored(Siswa $siswa)
{
//
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function onRestored()\n {\n return true;\n }",
"public function onrestoreCallback($intID, $strTable, $arrData, $intVersion);",
"function restore()\n {\n }",
"public function restored(Saida $saida)\n {\n //\n }",
"public function restored(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('restored'));\n\n // Once the model is restored, we need to put everything back\n // as before, in case a legitimate update event is fired\n static::$restoring = false;\n }",
"public function updraft_ajaxrestore() {\n\t\t$this->prepare_restore();\n\t\tdie();\n\t}",
"public function restore()\n {\n //\n }",
"public function restored(Stock $stock)\n {\n //\n }",
"public function restore()\n {\n }",
"public function restore() {}",
"public function restored(Subscription $subscription)\n {\n //\n }",
"public function restored(TradeCancel $tradeCancel)\n {\n //\n }",
"public function restore();",
"public function restored(SaleService $saleService)\n {\n //\n }",
"protected static function restore() {}",
"public function restored(Exchange $exchange)\n {\n //\n }",
"public function restored(PurchaseReceipt $purchaseReceipt)\n {\n //\n }",
"public function afterRestoreResponse($data)\n {\n }",
"public function restore(User $user, Event $event)\n {\n //\n }",
"public function restore(User $user, Event $event)\n {\n //\n }",
"public function restored(Asistencia $asistencia)\n {\n //\n }",
"public function restored(Installment $installment)\n {\n //\n }",
"public function restoring($model)\n\t{\n\t}",
"public function restored(Document $document)\n {\n //\n }",
"public function restoring(Auditable $model)\n {\n // When restoring a model, an updated event is also fired.\n // By keeping track of the main event that took place,\n // we avoid creating a second audit with wrong values\n static::$restoring = true;\n }",
"public function restored(TraHangNhaCungCap $traHangNhaCungCap)\n {\n //\n }",
"public function restored(Job $job)\n {\n //\n }",
"public function restored(Remission $remission)\n {\n //\n }",
"public function restored(RideShareTransaction $rideShareTransaction)\n {\n //\n }",
"public function restore() {\n self::restoreAll($this->chapterID);\n }"
] |
[
"0.6531672",
"0.64712733",
"0.6371121",
"0.628266",
"0.62664557",
"0.62628514",
"0.62525785",
"0.62460655",
"0.6203198",
"0.6157903",
"0.61466146",
"0.60695845",
"0.6057739",
"0.6037211",
"0.5982705",
"0.5956325",
"0.5951222",
"0.594925",
"0.5936987",
"0.5936987",
"0.59311247",
"0.5927601",
"0.5857543",
"0.5855454",
"0.58541685",
"0.583581",
"0.58346623",
"0.5832881",
"0.5826354",
"0.5819417"
] |
0.6505373
|
1
|
Check if options displayed.
|
public function isOptionsVisible() {
return WebElementsService::isWebElementVisible($this->getOptionsXpath());
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function hasOptions();",
"public function has_options() {\n\t\treturn count( $this->get_options() ) > 0;\n\t}",
"public function isOptions(): bool {}",
"public function hasOption(){\n return $this->_has(35);\n }",
"public function has_option() {\n return false;\n }",
"public function hasOptions() {\n\t\treturn count( $this->options ) > 0 ? true : false;\n\t}",
"public function hasOptions()\n {\n return $this->get(self::OPTIONS) !== null;\n }",
"public function hasOpts(): bool\n {\n return !empty($this->opts);\n }",
"public function hasOptionCollection(){\n\n\t\t\t$options = get_option( $this->optionsKey, array() );\n\n\t\t\treturn !empty( $options );\n\t\t}",
"private function showOptions() : void\n {\n $selectedOption = $this->console->choice(__('Please cheoose your option:'), $this->getAllOptions() );\n $this->setSelectedOption($selectedOption);\n $this->handleOption();\n }",
"function wcnc2015_options_check() {\n\tif ( ! get_option( 'my-options-data' ) ) {\n\t\t$options_defaults['extra_tagline'] \t= '';\n\t\t$options_defaults['footer_text']\t= '';\n\n\t\tupdate_option( 'my-options-data', $options_defaults );\n\t}\n}",
"public function hasOptions(): bool\n {\n return isset($this->options);\n }",
"public function showing_excerpts() {\n\n\t\tif ( null === $this->showing_excerpts ) {\n\n\t\t\t$this->showing_excerpts = 'yes' === get_option( $this->show_excerpts_option );\n\t\t}\n\n\t\treturn $this->showing_excerpts;\n\t}",
"public function hasOptionGroup()\n {\n return false;\n }",
"public function hasOptItem(){\n return $this->_has(2);\n }",
"function showspace_terms_accepted() {\n $options = get_option('showspace_options');\n return array_key_exists('showspace_terms_accepted', $options);\n}",
"public function hasOption($name);",
"public function view_option()\n{\n\t//option included, excluded\n\treturn \"excluded\";\n}",
"public function view_option()\n{\n\t//option included, excluded\n\treturn \"excluded\";\n}",
"public function showInMenu()\n {\n $ctrs = PageCom::ctrs();\n return $ctrs && (count($ctrs) > 1);\n }",
"public function optIn() {\n return !empty($this->args['send_optin']);\n }",
"public function has( $option );",
"public function hiding_excerpts() {\n\t\treturn ! $this->showing_excerpts();\n\t}",
"public function hasOption(string $name);",
"protected function validate_options() {\n\t\tif ( empty( $this->field['fields']['options'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( count( $this->field['fields']['options']['value'] ) === 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ( $this->field['fields']['options']['value'] as $key => $option_value ) {\n\t\t\tif ( empty( $key ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( empty( $option_value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function showOptions()\n {\n\treturn $this->getConfigData('checkout/delivery_options');\n }",
"public function getHasOptions()\n {\n return $this->getProduct()->getHasOptions();\n }",
"public function isInformationVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_DISPLAY_INFORMATION);\n }",
"function hasDropDown() ;",
"static function has_customizer_options() {\n\t\tif ( ! empty( self::$customizer_options ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}"
] |
[
"0.7838073",
"0.75924677",
"0.7544481",
"0.72648746",
"0.72237414",
"0.7106029",
"0.71001667",
"0.70991594",
"0.7090712",
"0.6930247",
"0.6878223",
"0.6875187",
"0.6804817",
"0.67028713",
"0.668676",
"0.6662604",
"0.6578547",
"0.6533249",
"0.6533249",
"0.6502611",
"0.6476748",
"0.645004",
"0.644518",
"0.64390403",
"0.64387655",
"0.6437974",
"0.64294636",
"0.6423407",
"0.6396956",
"0.6382617"
] |
0.7604418
|
1
|
Click on $xpath menu element.
|
public function clickOnMenuElement($xpath) {
WebElementsService::clickOn($xpath);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function iClickOnTheElementWithXPath($xpath)\n {\n $session = $this->getSession(); // get the mink session\n $element = $session->getPage()->find(\n 'xpath',\n $session->getSelectorsHandler()->selectorToXpath('xpath', $xpath)\n ); // runs the actual query and returns the element\n\n // errors must not pass silently\n if (null === $element) {\n throw new \\InvalidArgumentException(sprintf('Could not evaluate XPath: \"%s\"', $xpath));\n }\n\n // ok, let's click on it\n $element->click();\n\n }",
"public function iClickOnTheElementWithXPath($xpath) {\n $session = $this->getSession();\n $element = $session->getPage()->find('xpath', $session->getSelectorsHandler()->selectorToXpath('xpath', $xpath));\n\n if (null === $element) {\n throw new \\InvalidArgumentException(sprintf('Could not evaluate XPath: \"%s\"', $xpath));\n }\n $element->click();\n }",
"function jClick($item)\n\t{\n\t\tswitch ($item)\n\t\t{\n\t\t\tcase 'Access Levels':\n\t\t\t\t$screen=\"User Manager: Viewing Access Levels\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class,'icon-16-levels')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Article Manager':\n\t\t\t\t$screen=\"Article Manager: Articles\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class,'icon-16-article')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Contacts':\n\t\t\t\t$screen='Contact Manager: Contacts';\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class,'icon-16-contact')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Delete':\n\t\t\t\techo \"Testng Delete capability.\\n\";\n\t\t\t\t$this->click(\"//li[@id='toolbar-delete']/a\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue(($this->isTextPresent(\"deleted\") OR $this->isTextPresent(\"removed\") OR $this->isTextPresent(\"trashed\")), 'Deletion failed or confirm text wrong, SeleniumJoomlaTestCase line 310');\n\t\t\t\t\techo \"Deletion of item(s) succeeded.\\n\";\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Edit':\n\t\t\t\techo \"Testng Edit capability.\\n\";\n\t\t\t\t$this->click(\"//li[@id='toolbar-edit']/a/span\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\t$this->assertTrue($this->isTextPresent(\": Edit\", $this->getText(\"//div[contains(@class,'pagetitle')]/h2\")));\n\t\t\t\tbreak;\n\t\t\tcase 'Global Configuration':\n\t\t\t\t$screen='Global Configuration';\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class,'icon-16-config')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen,$this->getText(\"//div[contains(@class,'pagetitle')]/h2\")),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Global Configuration: Permissions':\n\t\t\t\t$this->jClick('Global Configuration');\n\t\t\t\t$this->click(\"permissions\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isElementPresent(\"//a[contains(@id,'permissions')][contains(@class,'active')]\"));\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Groups':\n\t\t\t\t$screen=\"User Manager: User Groups\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class,'icon-16-groups')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Menu Manager':\n\t\t\t\t$screen=\"Menu Manager: Menus\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class,'icon-16-menumgr')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Menu Items':\n\t\t\t\t$screen=\"Menu Manager: Menu Items\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class,'icon-16-menumgr')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\t$this->click(\"link=Menu Items\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen,$this->getText(\"//div[contains(@class,'pagetitle')]/h2\")),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Module Manager':\n\t\t\t\t$screen=\"Module Manager: Modules\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class,'icon-16-module')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen,$this->getText(\"//div[contains(@class,'pagetitle')]/h2\")),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'New':\n\t\t\t\techo \"Clicking New toolbar button.\\n\";\n\t\t\t\t$this->click(\"//li[@id='toolbar-new']/a\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\tbreak;\n\t\t\tcase 'Options':\n\t\t\t\techo \"Opening options modal.\\n\";\n\t\t\t\t$this->click(\"//li[@id='toolbar-popup-options']/a/span\");\n\t\t\t\tfor ($second = 0; ; $second++) {\n\t\t\t\t\tif ($second >= 15) $this->fail(\"timeout\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif ($this->isElementPresent(\"//dl[contains(@id, 'configuration')]\")) break;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t\t}\n\t\t\t\t\tsleep(1);\n\t\t\t\t}\n\t\t\t\t$this->assertTrue($this->isTextPresent(\"Options\"));\n\t\t\t\tbreak;\n\t\t\tcase 'Redirect Manager':\n\t\t\t\t$screen=\"Redirect Manager: Links\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class, 'icon-16-redirect')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen,$this->getText(\"//div[contains(@class,'pagetitle')]/h2\")),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Save & Close':\n\t\t\t\techo \"Clicking Save & Close toolbar button.\\n\";\n\t\t\t\t$this->click(\"//li[@id='toolbar-save']/a\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isElementPresent(\"//dl[@id='system-message'][contains(., 'success')]\"), \"Save success text not present, SeleniumTestCase line 327\");\n\t\t\t\t\t$this->assertFalse($this->isElementPresent(\"//dl[@id='system-message'][contains(., 'error')]\"), \"Error message present, SeleniumTestCase line 328\");\n\t\t\t\t\techo \"Item successfully saved.\\n\";\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Trash':\n\t\t\t\techo \"Clicking Trash toolbar button.\\n\";\n\t\t\t\t$this->click(\"//li[@id='toolbar-trash']/a/span\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isElementPresent(\"//dl[@id='system-message'][contains(., 'success')]\"),'Error trashing item, SeleniumTestCase line 491.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Unpublish':\n\t\t\t\techo \"Clicking Unpublish toolbar button.\\n\";\n\t\t\t\t$this->click(\"//li[@id='toolbar-unpublish']/a/span\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isElementPresent(\"//dl[@id='system-message'][contains(., 'success')]\"),'Error unpublishing item, SeleniumTestCase line 505.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertFalse($this->isTextPresent(\"Edit state is not permitted\"),\"Access issues with unpublishing item, SeleniumTestCase line 515.\");\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'User Manager':\n\t\t\t\t$screen=\"User Manager: Users\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class, 'icon-16-user')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Weblinks':\n\t\t\t\t$screen=\"Web Links Manager: Web Links\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class, 'icon-16-weblinks')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Weblink Categories':\n\t\t\t\t$screen=\"Category Manager: Weblinks\";\n\t\t\t\techo \"Navigating to \".$screen.\".\\n\";\n\t\t\t\t$this->click(\"//a[contains(@class, 'icon-16-weblinks-cat')]\");\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\ttry {\n\t\t\t\t\t$this->assertTrue($this->isTextPresent($screen,$this->getText(\"//div[contains(@class,'pagetitle')]/h2\")),'Error navigating to '.$screen.' or page title changed.');\n\t\t\t\t}\n\t\t\t\tcatch (PHPUnit_Framework_AssertionFailedError $e) {\n\t\t\t\t\tarray_push($this->verificationErrors, $this->getTraceFiles($e));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->click(\"//li[@id='toolbar-new']/a\");\n\t\t\t\techo \"Clicking New toolbar button.\\n\";\n\t\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function click()\n {\n $currentControl = $this->getBounds();\n $this->eyesDriver->getEyes()->addMouseTriggerElement(MouseAction::Click, $this);\n $this->logger->verbose(\"click($currentControl)\");\n\n $this->webElement->click();\n }",
"public function testClickElement(): void\n {\n $element = $this->createMock(NodeElement::class);\n $element->expects($this->once())->method('click');\n\n $page = $this->createMock(DocumentElement::class);\n $page->expects($this->once())->method('find')->with($this->equalTo('css'), $this->equalTo('.sonata-ba-list a.sonata-link-identifier'))->willReturn($element);\n\n $session = $this->createMock(Session::class);\n $session->expects($this->once())->method('getPage')->willReturn($page);\n\n $trait = $this->getExtraWebAssertMock();\n $trait->expects($this->once())->method('getSession')->willReturn($session);\n\n $trait->clickElement('.sonata-ba-list a.sonata-link-identifier'); // @phpstan-ignore-line\n }",
"public function clickMenuItem(array $items)\n {\n $element = null;\n $i=0;\n foreach ($items as $item) {\n $element = $this->getMenuItemElement($item, $element);\n $i++;\n if ($i<count($items)) {\n $this->getHelperCommon()->moveTo($element);\n } else {\n $this->getHelperCommon()->click($element);\n }\n }\n }",
"public function click(): void\n {\n $this->itemsList->backToSidebar()->handleLink($this->itemsList->getName(), $this->getName());\n }",
"public function testmenuAction()\n {\n parent::login();\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Menus\");\n $this->waitForPageToLoad(\"30000\");\n $this->isElementPresent(\"id=sortable1\");\n $this->isElementPresent(\"id=sortable2\");\n parent::logout();\n }",
"public function clickElementByXPath($xPath)\n {\n $this->getMainContext()->getSubContext('SpinCommandContext')->spin(function () use ($xPath) {\n $element = $this->findElementByXpath($xPath);\n\n if ( ! $element) {\n $message = 'Could not find the element by the given XPath: ' . $xPath;\n\n throw new \\Exception($message);\n }\n\n $element->click();\n });\n }",
"public function click() {\r\n\t\tswitch($this->current) {\r\n\t\t\tdefault:\r\n\t\t\t\t$this->current = self::SEA;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase self::ISLAND:\r\n\t\t\t\t$this->current = self::NONE;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase self::SEA:\r\n\t\t\t\t$this->current = self::ISLAND;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"public function click($id)\n\t{\n\t\t$this->connection()->post(\"element/$id/click\", array());\n\t}",
"public function iClickTheElement($arg)\n {\n $node = $this->getSession()->getPage()->find('css', $arg);\n if($node) {\n $this->getSession()->getPage()->find('css', $arg)->click();\n } else {\n throw new Exception('Element not found');\n }\n }",
"public function clickSubNavigationItem($parentBy, $textBy)\n {\n // But until we get the rendered code fixed, we will just click\n // the dashboard view each time first.\n $this->clickNavigationItem(\n WebDriverBy::cssSelector(\".fa.fa-home\")\n );\n\n // $element = $this->_driver->findElement($el);\n // if ($element->isDisplayed()) {\n $this->clickNavigationItem(\n // $parentBy\n WebDriverBy::cssSelector($parentBy)\n );\n // }\n\n // This is one area where we need to change how\n // we do the interfaces for the panel\n $this->_driver\n ->findElement(\n // $textBy\n WebDriverBy::linkText($textBy)\n )\n ->click();\n }",
"public function click()\n {\n }",
"public function iClickOnElementWhichHasOnclickHandlerLocatedAt($item)\n {\n $node = $this->getSession()->getPage()->find('css', $item);\n if($node) {\n $this->getSession()->wait(3000,\n \"jQuery('{$item}').trigger('click')\"\n );\n } else {\n throw new Exception('Element not found');\n }\n }",
"function testMenuLink()\n\t{\n\t\t$this->open(JOOMLA_LOCATION.'index.php');\n\t\t$this->waitPageLoad();\n\t\t$this->click(\"//div[@id='leftcolumn']/div[2]/div/div/div/ul/li[10]/a/span\");\n\t\t$this->waitPageLoad();\n\t\t\n\t\t/*\n\t\t$option = JRequest::getCmd('option');\n\t\t$view\t= JRequest::getCmd('view');\n\t\t$this->assertTrue($option == 'com_xius');\n\t\t$this->assertTrue($view == 'users');\n\t\t*/\n\t\t\n\t\t$this->select(\"field2\", \"label=Female\");\n\t\t$this->click(\"xiussearch\");\n\t\t$this->waitPageLoad();\n\t\t$this->assertTrue($this->isElementPresent(\"//span[@id='total_29']\"));\n\t\t$this->assertTrue($this->isTextPresent(\"Refined By\"));\t\n\n\t\t// test for display all list\n\t\t$this->open(JOOMLA_LOCATION.'index.php');\n\t\t$this->waitPageLoad();\n\t\t$this->click(\"//div[@id='leftcolumn']/div[2]/div/div/div/ul/li[11]/a/span\");\n\t\t$this->waitPageLoad();\n\t\t$this->assertTrue($this->isTextPresent(\"All male from 09/05/2009 to 19/05/2009\"));\n\t\t$this->assertTrue($this->isTextPresent(\"All female\"));\n\t\t\n\t\t// test for display Particular list\n\t\t$this->open(JOOMLA_LOCATION.'index.php');\n\t\t$this->waitPageLoad();\n\t\t$this->click(\"//div[@id='leftcolumn']/div[2]/div/div/div/ul/li[12]/a/span\");\n\t\t$this->waitPageLoad();\n\t\t$this->assertTrue($this->isTextPresent(\"All male from 09/05/2009 to 19/05/2009\"));\n\t\t$this->assertTrue($this->isElementPresent(\"//img[@class='xius_test_remove_Male']\"));\n\t\t$this->assertTrue($this->isElementPresent(\"//img[@class='xius_test_remove_From 09-05-2009 To 19-05-2009']\"));\n\t\t$this->assertTrue($this->isElementPresent(\"//span[@id='total_0']\"));\n\t\t\n\t\t// test clear all\n\t\t$this->click(\"//img[@title='Clear All']\");\n\t\t$this->waitPageLoad();\n\t\t$this->assertFalse($this->isElementPresent(\"//img[@class='xius_test_remove_Male']\"));\n\t\t$this->assertFalse($this->isElementPresent(\"//img[@class='xius_test_remove_From 09-05-2009 To 19-05-2009']\"));\n\t\t$this->assertTrue($this->isElementPresent(\"//span[@id='total_59']\"));\n\t}",
"public function iClickOn($element) {\n $this->assertSession()->elementExists('css', $element)->click();\n }",
"public function click()\n {\n $this->_rootElement->find($this->advancedReportingButton)->click();\n }",
"public function testAddMenuAction()\n {\n parent::login();\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Páginas\");\n $this->waitForPageToLoad(\"30000\");\n $this->click(\"link=Criar uma nova página\");\n $this->waitForPageToLoad(\"30000\");\n $this->type(\"id=xvolutions_adminbundle_page_title\", \"Test Menu Selenium 1\");\n $this->type(\"id=xvolutions_adminbundle_page_idalias\", \"test-menu-selenium-1\");\n $this->runScript(\"tinyMCE.activeEditor.setContent('Test Menu Selenium 1')\");\n $this->select(\"id=xvolutions_adminbundle_page_id_language\", \"label=Português\");\n $this->select(\"id=xvolutions_adminbundle_page_id_section\", \"label=Pública\");\n $this->select(\"id=xvolutions_adminbundle_page_id_status\", \"label=Publicado\");\n $this->click(\"id=xvolutions_adminbundle_page_Criar\");\n $this->waitForPageToLoad(\"30000\");\n $this->click(\"link=Criar uma nova página\");\n $this->waitForPageToLoad(\"30000\");\n $this->type(\"id=xvolutions_adminbundle_page_title\", \"Test Menu Selenium 2\");\n $this->type(\"id=xvolutions_adminbundle_page_idalias\", \"test-menu-selenium-2\");\n $this->runScript(\"tinyMCE.activeEditor.setContent('Test Menu Selenium 2')\");\n $this->select(\"id=xvolutions_adminbundle_page_id_language\", \"label=Português\");\n $this->select(\"id=xvolutions_adminbundle_page_id_section\", \"label=Pública\");\n $this->select(\"id=xvolutions_adminbundle_page_id_status\", \"label=Publicado\");\n $this->click(\"id=xvolutions_adminbundle_page_Criar\");\n $this->waitForPageToLoad(\"30000\");\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Menus\");\n $this->waitForPageToLoad(\"30000\");\n $this->isElementPresent(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-1.ui-state-default.ui-sortable-handle\");\n $this->assertElementContainsText(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-1.ui-state-default.ui-sortable-handle\", \"Test Menu Selenium 1\");\n $this->isElementPresent(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-2.ui-state-default.ui-sortable-handle\");\n $this->assertElementContainsText(\"css=ul#sortable1.connectedSortable.ui-sortable li#id-2.ui-state-default.ui-sortable-handle\", \"Test Menu Selenium 2\");\n parent::logout();\n }",
"function clickGo()\n\t{\n\t\tif ($this->isElementPresent(\"filter-go\"))\n\t\t{\n\t\t\t$this->click(\"filter-go\");\n\t\t}\n\t}",
"public function iClickOnTheElement($locator)\n {\n $session = $this->getSession(); // get the mink session\n $element = $session->getPage()->find('css', $locator); // runs the actual query and returns the element\n\n // errors must not pass silently\n if (null === $element) {\n throw new \\InvalidArgumentException(sprintf('Could not evaluate CSS selector: \"%s\"', $locator));\n }\n\n $element->click();\n }",
"public function clickLaunchAdmin()\n {\n $this->_rootElement->find($this->launchAdmin, Locator::SELECTOR_XPATH)->click();\n }",
"protected function clickSelectButton()\n {\n $this->find($this->selectButton, Locator::SELECTOR_XPATH)->click();\n $this->waitLoader();\n }",
"public function iClickOnTheText($text)\n {\n $session = $this->getSession();\n $element = $session->getPage()->find(\n 'xpath',\n $session->getSelectorsHandler()->selectorToXpath('xpath', '*//*[text()=\"'. $text .'\"]')\n );\n if (null === $element) {\n throw new \\InvalidArgumentException(sprintf('Cannot find text: \"%s\"', $text));\n }\n \n $element->click();\n }",
"function click_link($url)\n\t{\n\t\treturn Backend_Html::click_link($url);\n\t}",
"public function testMenuRouteTest()\n {\n $user = $this->_getAdminUser();\n $response = $this->actingAs($user, 'admin')->get(route('admin.menu.index'));\n $response->assertStatus(200);\n $response->assertSee('Menu');\n\n //\n $data['name'] = 'test menu';\n $data['identifier'] = 'test-menu';\n $data['menu_json'] = '[[{\n \"name\": \"Kitchen\",\n \"params\": \"kitchen\",\n \"route\": \"category.view\",\n \"children\": [\n []\n ]\n }]]';\n $response = $this->post(route('admin.menu.store'), $data);\n\n $response->assertRedirect(route('admin.menu.index'));\n }",
"function ou_df_menu_link(&$variables) {\n $element = $variables['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n\n $title = $element['#title'];\n if (empty($element['#localized_options']['html'])) {\n $title = check_plain($title);\n }\n $element['#localized_options']['html'] = TRUE;\n $output = l('<span>' . $title . '</span>', $element['#href'], $element['#localized_options']);\n\n if (in_array('active', $element['#attributes']['class']) || in_array('active-trail', $element['#attributes']['class'])) {\n $element['#attributes']['class'][] = 'int-nav-active';\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}",
"function reussitepersonnelle_commander() {\n\t?>\n\t<li class=\"genesis-nav-menu menu-item commander\"><a onclick=\"javascript:__gaTracker('send', 'event', 'top-nav', 'commander');\" href=\"https://www.reussitepersonnelle.com/commande/?add-to-cart=7782\">Commander Maintenant</a></li>';\n\t<?php\n}",
"protected function assertActionButton($path) {\n $button_element = $this->xpath(\n '//a[contains(@class, \"button-action\") and contains(@data-drupal-link-system-path, :path)]',\n [':path' => $path]\n );\n $this->assertEqual(count($button_element), 1, 'Found action button for path: ' . $path);\n }",
"public function assertClickFieldset(string $field): void {\n $this->getSession()->getPage()->find('named', ['link_or_button', $field])->click();\n }"
] |
[
"0.6765386",
"0.6695456",
"0.6344531",
"0.6196224",
"0.6052544",
"0.604653",
"0.6039562",
"0.5977126",
"0.5935852",
"0.5888265",
"0.5739686",
"0.57009214",
"0.56733596",
"0.5665997",
"0.5654855",
"0.56209785",
"0.55796826",
"0.54122984",
"0.53878057",
"0.5314528",
"0.5289651",
"0.52443814",
"0.52287966",
"0.5186057",
"0.5077144",
"0.50631595",
"0.49992457",
"0.49803266",
"0.49443963",
"0.49427438"
] |
0.8655718
|
0
|
Return xpath of $label option.
|
protected function getOptionXpath($label) {
return sprintf(Dropdown::OPTION_XPATH,$this::$keyWord,$label);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function getSelectFieldXPath(string $label): string\n {\n $labelXPath = $this->getFormFieldLabelXPath($label);\n $inputContainerXPath = \"div[contains(@class, 'sonata-ba-field')]\";\n $inputXPath = \"select[contains(@class, 'form-control')]\";\n\n return \"$labelXPath/following-sibling::$inputContainerXPath//$inputXPath\";\n }",
"private function getSelectFormFieldWithAutocompleteXPath(\n string $label\n ): string {\n $labelXPath = $this->getFormFieldLabelXPath($label);\n $inputContainerXPath = \"div[contains(@class, 'sonata-ba-field')]\";\n $inputXPath = 'select';\n\n // Look for this way, because the sonata does not explicitly mark\n // select with autocomplete.\n return \"$labelXPath/following-sibling::$inputContainerXPath//$inputXPath\";\n }",
"private function getFormFieldLabelXPath(string $label): string\n {\n $formGroupXPath = 'form//div[contains(@class, \"form-group\")]';\n $labelXPath = \"label[contains(@class, 'control-label') and normalize-space()='$label']\";\n\n return \"$formGroupXPath/$labelXPath\";\n }",
"private function getOptionsXpath() {\n return sprintf(Dropdown::OPTIONS_XPATH,$this::$keyWord);\n }",
"private function getSelectOptionXPath(\n string $selectLabel,\n string $optionTitle\n ): string {\n return \"//{$this->getSelectFieldXPath($selectLabel)}\".\n \"/option[text() = '$optionTitle']\";\n }",
"private function getFormCheckboxFieldXPath(string $label): string\n {\n $fieldXPath = \"form//div[contains(@class, 'sonata-ba-field')]\";\n $labelXPath = \"label/span[contains(@class, 'control-label__text') and normalize-space()='$label']\";\n $checkboxXPath = \"input[@type='checkbox']\";\n\n return \"$fieldXPath//$labelXPath/preceding-sibling::$checkboxXPath\";\n }",
"private function getOptionsListXpath() {\n return sprintf(Dropdown::OPTIONS_LIST_XPATH,$this::$keyWord);\n }",
"private function getFormTextFieldXPath(string $label): string\n {\n $labelXPath = $this->getFormFieldLabelXPath($label);\n $inputContainerXPath = \"div[contains(@class, 'sonata-ba-field')]\";\n $inputXPath = \"input[@type='text' and contains(@class, 'form-control')]\";\n\n return \"$labelXPath/following-sibling::$inputContainerXPath//$inputXPath\";\n }",
"private function getFileFieldXPath(string $label): string\n {\n $labelXPath = $this->getFormFieldLabelXPath($label);\n $fileFieldContainerXPath = \"div[contains(@class, 'sonata-ba-field')]\";\n $fileFieldXPath = \"input[@type='file']\";\n\n return \"$labelXPath/following-sibling::$fileFieldContainerXPath//$fileFieldXPath\";\n }",
"private function getFormTextareaFieldXPath(string $label): string\n {\n $labelXPath = $this->getFormFieldLabelXPath($label);\n $textareaContainerXPath = \"div[contains(@class, 'sonata-ba-field')]\";\n $textareaXPath = \"textarea[contains(@class, 'form-control')]\";\n\n return \"$labelXPath/following-sibling::$textareaContainerXPath//$textareaXPath\";\n }",
"private function getButtonXpath() {\n return sprintf(Dropdown::BUTTON_XPATH,$this::$keyWord);\n }",
"private function getFormNumberFieldXPath(string $label): string\n {\n $labelXPath = $this->getFormFieldLabelXPath($label);\n $inputContainerXPath = \"div[contains(@class, 'sonata-ba-field')]\";\n $inputXPath = \"input[@type='number' and contains(@class, 'form-control')]\";\n\n return \"$labelXPath/following-sibling::$inputContainerXPath//$inputXPath\";\n }",
"public function get_option_label_html(){\n\t\t$html = \"\";\n\t\t$classes = $this->get_label_html_classes();\n\t\t$required = $this->required ? \"*\" : \"\";\n\t\t$html .= \"<{$this->element} class='$classes' for='{$this->id}'>{$this->label}{$required}</{$this->element}>\";\n\t\treturn $html;\n\t}",
"public function setLabel($label) {\r\n\t\t$node = new Larc_Html_Element($this->labelTag, $label, array('class' => $this->labelClass), $this);\r\n\t\tif(!$this->labelNode) {\r\n\t\t\t$this->labelNode = $this->insertFirst($node);\r\n\t\t} else {\r\n\t\t\t$this->labelNode->nodeValue = $label;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this->labelNode;\r\n\t}",
"public function setLabel($label) {\n return $this->setAttribute('label', $label);\n }",
"public function set_label($label)\n\t{\n\t\tif (is_string($label))\n\t\t{\n\t\t\t$this->_label = $label;\n\t\t}\n\t\t\n\t\treturn $this->get_label();\n\t}",
"public function get_label();",
"public function get_label();",
"protected function get_option_xpath($option, $selectxpath) {\n $valueliteral = behat_context_helper::escape(trim($option));\n return $selectxpath . \"/descendant::option[(./@value=$valueliteral or normalize-space(.)=$valueliteral)]\";\n }",
"function get_wpcli_label() {\n\tglobal $argv;\n\n\t$label = '';\n\n\tforeach ($argv as $arg) {\n\t\t$arg = explode('=', $arg, 2);\n\t\tif (count($arg) === 2 && $arg[0] === '--label') {\n\t\t\t$label = $arg[1];\n\t\t}\n\t}\n\n\treturn $label;\n}",
"public function get_label(){ return $this->label; }",
"function testInputUseOptionAsLabel() {\n\t\t$result = $this->helper->input('Test.foo', 'Label');\n\t\t$expected = array(\n\t\t\t'div' => array('class' => 'input'),\n\t\t\t\t'label' => array('for' => 'TestFoo'),\n\t\t\t\t\t'Label',\n\t\t\t\t'/label',\n\t\t\t\t'input' => array(\n\t\t\t\t\t'name' => 'data[Test][foo]',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'tabindex' => 1,\n\t\t\t\t\t'id' => 'TestFoo'\n\t\t\t\t),\n\t\t\t'/div'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}",
"public function setLabel($label);",
"public function setLabel($label);",
"public function setLabel($label);",
"public function setLabel($label);",
"protected function get_taxonomy_name($label) {\n\t\t\tif(!$options = $this->options) {\n\t\t\t\t$options = $this->pro_class->options;\n\t\t\t}\n\n\t\t\tforeach($options['taxonomies'] as $taxonomy => $value) {\n\t\t\t\tif($value['label'] == $label) {\n\t\t\t\t\treturn $taxonomy;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $label; // if no match found, try to use the label\n\t\t}",
"public function get_label(): ?String {\n return $this->label;\n }",
"protected function getLabelSelectorQuery()\n\t{\n\t\t$parts = [];\n\t\tforeach ($this->labelSelector as $key => $value) {\n\t\t\t$parts[] = $key . '=' . $value;\n\t\t}\n\t\treturn implode(',', $parts);\n\t}",
"public function getMenuItemElement($label, $parent=null)\n {\n return $this->getHelperCommon()->getElement(\"//li/a/span[text()='$label']\", $parent);\n }"
] |
[
"0.7594032",
"0.72179735",
"0.719341",
"0.67987067",
"0.67749023",
"0.6738231",
"0.63846177",
"0.6360508",
"0.62922454",
"0.59659964",
"0.59478563",
"0.58663386",
"0.5849812",
"0.5804292",
"0.56850326",
"0.56734186",
"0.5664236",
"0.5664236",
"0.5630488",
"0.5574971",
"0.55649763",
"0.5563824",
"0.553228",
"0.553228",
"0.553228",
"0.553228",
"0.55001545",
"0.5444067",
"0.54332507",
"0.5420735"
] |
0.86246485
|
0
|
Return xpath of dropdown button.
|
private function getButtonXpath() {
return sprintf(Dropdown::BUTTON_XPATH,$this::$keyWord);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function getOptionsXpath() {\n return sprintf(Dropdown::OPTIONS_XPATH,$this::$keyWord);\n }",
"private function getOptionsListXpath() {\n return sprintf(Dropdown::OPTIONS_LIST_XPATH,$this::$keyWord);\n }",
"protected function getOptionXpath($label) {\n return sprintf(Dropdown::OPTION_XPATH,$this::$keyWord,$label);\n }",
"public function getTagsDropDownResultsXpath() {\n\t\t$resultXpath = $this->tagsSuggestDropDown .\n\t\t\t\"//ul[@class='select2-results']\" .\n\t\t\t\"//span\";\n\t\treturn $resultXpath;\n\t}",
"public function render()\n {\n return view('adminhub::components.dropdown.button');\n }",
"public function getDropDown() {}",
"public function getDropDown() {}",
"private function getFormActionButtonXPath(string $buttonText): string\n {\n $containerXPath = \"div[contains(@class, 'sonata-ba-form-actions')]\";\n $buttonXpath = \"button[@type='submit' and normalize-space()='$buttonText']\";\n $linkTypeButtonXpath = \"a[normalize-space()='$buttonText']\";\n\n return \"(//$containerXPath/$buttonXpath | //$containerXPath/$linkTypeButtonXpath)\";\n }",
"public function getButton() {}",
"private function getSelectFieldXPath(string $label): string\n {\n $labelXPath = $this->getFormFieldLabelXPath($label);\n $inputContainerXPath = \"div[contains(@class, 'sonata-ba-field')]\";\n $inputXPath = \"select[contains(@class, 'form-control')]\";\n\n return \"$labelXPath/following-sibling::$inputContainerXPath//$inputXPath\";\n }",
"function getDropDown() ;",
"public function getType()\n {\n return 'xpath';\n }",
"private function getSelectFormFieldWithAutocompleteXPath(\n string $label\n ): string {\n $labelXPath = $this->getFormFieldLabelXPath($label);\n $inputContainerXPath = \"div[contains(@class, 'sonata-ba-field')]\";\n $inputXPath = 'select';\n\n // Look for this way, because the sonata does not explicitly mark\n // select with autocomplete.\n return \"$labelXPath/following-sibling::$inputContainerXPath//$inputXPath\";\n }",
"protected function getShortcutButton() {}",
"public function getSelectorHolder()\n {\n return \"$(\\\".step-button-wrapper[data-for='{$this->Name}']\\\")\";\n }",
"public function getDeleteButtonHtml()\n {\n return $this->getChildHtml('delete_button');\n }",
"public function getSaveAsButtonHtml()\n {\n return $this->getChildHtml('save_as_button');\n }",
"public function getSelectAction()\n {\n return $this->selectAction;\n }",
"public function get_selector()\n {\n }",
"public function dropdown() {\n $this->getSubmit()\n ->getControlPrototype()\n ->data('dropdown', 'toolbar[' . $this->name . ']');\n return $this;\n }",
"private function getSelectOptionXPath(\n string $selectLabel,\n string $optionTitle\n ): string {\n return \"//{$this->getSelectFieldXPath($selectLabel)}\".\n \"/option[text() = '$optionTitle']\";\n }",
"protected function clickSelectButton()\n {\n $this->find($this->selectButton, Locator::SELECTOR_XPATH)->click();\n $this->waitLoader();\n }",
"public function getXpath()\n {\n if (null === $this->xpath) {\n $this->setXpath(new DOMXPath($this->getDomDocument()));\n }\n\n return $this->xpath;\n }",
"public function getElementPath()\n {\n if ($controller = $this->getElementController()) {\n $element = $controller->getElement();\n } else {\n $element = $this->element;\n }\n\n return DIRNAME_ELEMENTS . '/' . $element . '.php';\n }",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}",
"public function hasDropDown() {}"
] |
[
"0.71818894",
"0.6904282",
"0.60336816",
"0.59394264",
"0.57732785",
"0.56107324",
"0.56107324",
"0.55930716",
"0.53312916",
"0.5308436",
"0.52388215",
"0.51753443",
"0.51694804",
"0.5154607",
"0.49968383",
"0.49125722",
"0.48961273",
"0.48672625",
"0.48405758",
"0.4825265",
"0.4816683",
"0.47874066",
"0.47506002",
"0.47219145",
"0.47197694",
"0.47197694",
"0.47181806",
"0.47181806",
"0.47181806",
"0.47181806"
] |
0.838076
|
0
|
Return xpath of options.
|
private function getOptionsXpath() {
return sprintf(Dropdown::OPTIONS_XPATH,$this::$keyWord);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function getOptionsListXpath() {\n return sprintf(Dropdown::OPTIONS_LIST_XPATH,$this::$keyWord);\n }",
"protected function getOptionXpath($label) {\n return sprintf(Dropdown::OPTION_XPATH,$this::$keyWord,$label);\n }",
"public function getOptions(){\n //$this->xpath = new DOMXPath($this->document);\n $cssname = \"options-list\";\n $tag = \"ul\";\n $consulta = \"//\".$tag.\"[@class='\".$cssname.\"']\";\n $elements = $this->xpath->query($consulta);\n if ($elements->length > 0){\n foreach($elements as $element){\n $consultaSpan = \"li/span[@class='label']\";\n $spans = $this->xpath->query($consultaSpan, $element);\n if ($spans->length > 0){\n foreach($spans as $span){\n //echo \"La caracteristica es: \".$span->nodeValue.\"<br>\";\n }\n }\n }\n }\n echo \"<br><br>\";\n }",
"private function getButtonXpath() {\n return sprintf(Dropdown::BUTTON_XPATH,$this::$keyWord);\n }",
"protected function get_option_xpath($option, $selectxpath) {\n $valueliteral = behat_context_helper::escape(trim($option));\n return $selectxpath . \"/descendant::option[(./@value=$valueliteral or normalize-space(.)=$valueliteral)]\";\n }",
"public function getTagsDropDownResultsXpath() {\n\t\t$resultXpath = $this->tagsSuggestDropDown .\n\t\t\t\"//ul[@class='select2-results']\" .\n\t\t\t\"//span\";\n\t\treturn $resultXpath;\n\t}",
"private function getSelectOptionXPath(\n string $selectLabel,\n string $optionTitle\n ): string {\n return \"//{$this->getSelectFieldXPath($selectLabel)}\".\n \"/option[text() = '$optionTitle']\";\n }",
"protected function getAllOptions(NodeElement $element) {\n @trigger_error('AssertLegacyTrait::getAllOptions() is deprecated in drupal:8.5.0 and is removed from drupal:10.0.0. Use $element->findAll(\\'xpath\\', \\'option\\') instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);\n return $element->findAll('xpath', '//option');\n }",
"public function getFormElementOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"public function getOptions();",
"abstract public function getOptions();",
"function getOptions() ;",
"protected static abstract function getOptions();",
"public function getOptions() {}",
"public function getOptions() {}"
] |
[
"0.812845",
"0.6874215",
"0.63501984",
"0.634123",
"0.6310724",
"0.59520835",
"0.5749788",
"0.56838983",
"0.5643021",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5632443",
"0.5618763",
"0.5615251",
"0.55996",
"0.5584904",
"0.5584904"
] |
0.8569137
|
0
|
Return xpath of options list.
|
private function getOptionsListXpath() {
return sprintf(Dropdown::OPTIONS_LIST_XPATH,$this::$keyWord);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function getOptionsXpath() {\n return sprintf(Dropdown::OPTIONS_XPATH,$this::$keyWord);\n }",
"public function getOptions(){\n //$this->xpath = new DOMXPath($this->document);\n $cssname = \"options-list\";\n $tag = \"ul\";\n $consulta = \"//\".$tag.\"[@class='\".$cssname.\"']\";\n $elements = $this->xpath->query($consulta);\n if ($elements->length > 0){\n foreach($elements as $element){\n $consultaSpan = \"li/span[@class='label']\";\n $spans = $this->xpath->query($consultaSpan, $element);\n if ($spans->length > 0){\n foreach($spans as $span){\n //echo \"La caracteristica es: \".$span->nodeValue.\"<br>\";\n }\n }\n }\n }\n echo \"<br><br>\";\n }",
"protected function getOptionXpath($label) {\n return sprintf(Dropdown::OPTION_XPATH,$this::$keyWord,$label);\n }",
"public function getTagsDropDownResultsXpath() {\n\t\t$resultXpath = $this->tagsSuggestDropDown .\n\t\t\t\"//ul[@class='select2-results']\" .\n\t\t\t\"//span\";\n\t\treturn $resultXpath;\n\t}",
"private function getButtonXpath() {\n return sprintf(Dropdown::BUTTON_XPATH,$this::$keyWord);\n }",
"protected function get_option_xpath($option, $selectxpath) {\n $valueliteral = behat_context_helper::escape(trim($option));\n return $selectxpath . \"/descendant::option[(./@value=$valueliteral or normalize-space(.)=$valueliteral)]\";\n }",
"public function getSettlements(array $options = []);",
"public function getOptionsList(): array\n {\n return [\n new SelectConfigOption(\n self::INPUT_KEY_SEARCH_ENGINE,\n SelectConfigOption::FRONTEND_WIZARD_SELECT,\n array_keys($this->getAvailableSearchEngineList()),\n '',\n 'Search engine. Values: ' . implode(', ', array_keys($this->getAvailableSearchEngineList()))\n ),\n new TextConfigOption(\n self::INPUT_KEY_ELASTICSEARCH_HOST,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'Elasticsearch server host.'\n ),\n new TextConfigOption(\n self::INPUT_KEY_ELASTICSEARCH_PORT,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'Elasticsearch server port.'\n ),\n new TextConfigOption(\n self::INPUT_KEY_ELASTICSEARCH_ENABLE_AUTH,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'Set to 1 to enable authentication. (default is 0, disabled)'\n ),\n new TextConfigOption(\n self::INPUT_KEY_ELASTICSEARCH_USERNAME,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'Elasticsearch username. Only applicable if HTTP auth is enabled'\n ),\n new TextConfigOption(\n self::INPUT_KEY_ELASTICSEARCH_PASSWORD,\n TextConfigOption::FRONTEND_WIZARD_PASSWORD,\n '',\n 'Elasticsearch password. Only applicable if HTTP auth is enabled'\n ),\n new TextConfigOption(\n self::INPUT_KEY_ELASTICSEARCH_INDEX_PREFIX,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'Elasticsearch index prefix.'\n ),\n new TextConfigOption(\n self::INPUT_KEY_ELASTICSEARCH_TIMEOUT,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'Elasticsearch server timeout.'\n ),\n new TextConfigOption(\n self::INPUT_KEY_OPENSEARCH_HOST,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'OpenSearch server host.'\n ),\n new TextConfigOption(\n self::INPUT_KEY_OPENSEARCH_PORT,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'OpenSearch server port.'\n ),\n new TextConfigOption(\n self::INPUT_KEY_OPENSEARCH_ENABLE_AUTH,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'Set to 1 to enable authentication. (default is 0, disabled)'\n ),\n new TextConfigOption(\n self::INPUT_KEY_OPENSEARCH_USERNAME,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'OpenSearch username. Only applicable if HTTP auth is enabled'\n ),\n new TextConfigOption(\n self::INPUT_KEY_OPENSEARCH_PASSWORD,\n TextConfigOption::FRONTEND_WIZARD_PASSWORD,\n '',\n 'OpenSearch password. Only applicable if HTTP auth is enabled'\n ),\n new TextConfigOption(\n self::INPUT_KEY_OPENSEARCH_INDEX_PREFIX,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'OpenSearch index prefix.'\n ),\n new TextConfigOption(\n self::INPUT_KEY_OPENSEARCH_TIMEOUT,\n TextConfigOption::FRONTEND_WIZARD_TEXT,\n '',\n 'OpenSearch server timeout.'\n )\n ];\n }",
"protected function getListOptions()\n {\n $customOptions = [];\n $context = $this->getOptionsContext();\n $count = 1;\n $optionElementTitle = $context->find(sprintf($this->optionElementTitle, $count), Locator::SELECTOR_XPATH);\n $optionElement = $context->find(sprintf($this->optionElement, $count), Locator::SELECTOR_XPATH);\n while ($optionElementTitle->isVisible()) {\n $title = $optionElementTitle->find($this->title)->getText();\n $customOptions[$title]['title'] = $optionElementTitle;\n $customOptions[$title]['content'] = $optionElement;\n ++$count;\n $optionElementTitle = $context->find(sprintf($this->optionElementTitle, $count), Locator::SELECTOR_XPATH);\n $optionElement = $context->find(sprintf($this->optionElement, $count), Locator::SELECTOR_XPATH);\n }\n return $customOptions;\n }",
"protected function getAllOptions(NodeElement $element) {\n @trigger_error('AssertLegacyTrait::getAllOptions() is deprecated in drupal:8.5.0 and is removed from drupal:10.0.0. Use $element->findAll(\\'xpath\\', \\'option\\') instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);\n return $element->findAll('xpath', '//option');\n }",
"public function xpath() {\n return new DOMXPath($this);\n }",
"public function getOptionsList()\n {\n return [\n new InputOption(\n StoreConfigurationDataMapper::KEY_BASE_URL,\n null,\n InputOption::VALUE_REQUIRED,\n 'URL the store is supposed to be available at. '\n . 'Deprecated, use config:set with path web/unsecure/base_url'\n ),\n new InputOption(\n StoreConfigurationDataMapper::KEY_LANGUAGE,\n null,\n InputOption::VALUE_REQUIRED,\n 'Default language code. '\n . 'Deprecated, use config:set with path general/locale/code'\n ),\n new InputOption(\n StoreConfigurationDataMapper::KEY_TIMEZONE,\n null,\n InputOption::VALUE_REQUIRED,\n 'Default time zone code. '\n . 'Deprecated, use config:set with path general/locale/timezone'\n ),\n new InputOption(\n StoreConfigurationDataMapper::KEY_CURRENCY,\n null,\n InputOption::VALUE_REQUIRED,\n 'Default currency code. '\n . 'Deprecated, use config:set with path currency/options/base, currency/options/default'\n . ' and currency/options/allow'\n ),\n new InputOption(\n StoreConfigurationDataMapper::KEY_USE_SEF_URL,\n null,\n InputOption::VALUE_REQUIRED,\n 'Use rewrites. '\n . 'Deprecated, use config:set with path web/seo/use_rewrites'\n ),\n new InputOption(\n StoreConfigurationDataMapper::KEY_IS_SECURE,\n null,\n InputOption::VALUE_REQUIRED,\n 'Use secure URLs. Enable this option only if SSL is available. '\n . 'Deprecated, use config:set with path web/secure/use_in_frontend'\n ),\n new InputOption(\n StoreConfigurationDataMapper::KEY_BASE_URL_SECURE,\n null,\n InputOption::VALUE_REQUIRED,\n 'Base URL for SSL connection. '\n . 'Deprecated, use config:set with path web/secure/base_url'\n ),\n new InputOption(\n StoreConfigurationDataMapper::KEY_IS_SECURE_ADMIN,\n null,\n InputOption::VALUE_REQUIRED,\n 'Run admin interface with SSL. '\n . 'Deprecated, use config:set with path web/secure/use_in_adminhtml'\n ),\n new InputOption(\n StoreConfigurationDataMapper::KEY_ADMIN_USE_SECURITY_KEY,\n null,\n InputOption::VALUE_REQUIRED,\n 'Whether to use a \"security key\" feature in Magento Admin URLs and forms. '\n . 'Deprecated, use config:set with path admin/security/use_form_key'\n ),\n ];\n }",
"public function getXpath()\n {\n if (null === $this->xpath) {\n $this->setXpath(new DOMXPath($this->getDomDocument()));\n }\n\n return $this->xpath;\n }",
"public function getOptions()\n\t{\n\t\t// Initialize variables.\n\t\t$options = array();\n\n\t\t// Initialize some field attributes.\n\t\t$filter = (string)$this->element['filter'];\n\t\t$exclude = (string)$this->element['exclude'];\n\t\t$stripExt = (string)$this->element['stripext'];\n\t\t$hideNone = (string)$this->element['hide_none'];\n\t\t$hideDefault = (string)$this->element['hide_default'];\n\n\t\t// Get the path in which to search for file options.\n\t\t$path = (string)$this->element['directory'];\n\t\tif (!is_dir($path)) {\n\t\t\t$path = ABSPATH . $path;\n\t\t}\n\n\t\t// Prepend some default options based on field attributes.\n\t\tif (!$hideNone) {\n\t\t\t$options[] = GantryHtmlSelect::option('-1', _g(trim((string)'NONE_SELECTED')));\n\t\t}\n\t\tif (!$hideDefault) {\n\t\t\t$options[] = GantryHtmlSelect::option('', _g(trim((string)'USE_DEFAULT')));\n\t\t}\n\n\t\t// Get a list of files in the search path with the given filter.\n\t\t$files = GantryFolder::files($path, $filter);\n\n\t\t// Build the options list from the list of files.\n\t\tif (is_array($files)) {\n\t\t\tforeach ($files as $file) {\n\n\t\t\t\t// Check to see if the file is in the exclude mask.\n\t\t\t\tif ($exclude) {\n\t\t\t\t\tif (preg_match(chr(1) . $exclude . chr(1), $file)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the extension is to be stripped, do it.\n\t\t\t\tif ($stripExt) {\n\t\t\t\t\t$file = GantryFile::stripExt($file);\n\t\t\t\t}\n\n\t\t\t\t$options[] = GantryHtmlSelect::option($file, $file);\n\t\t\t}\n\t\t}\n\n\t\t// Merge any additional options in the XML definition.\n\t\t$options = array_merge(parent::getOptions(), $options);\n\n\t\treturn $options;\n\t}",
"public function getType()\n {\n return 'xpath';\n }",
"public function getFormElementOptions();",
"public function getOptionList()\n {\n return Mage::helper('bundle/catalog_product_configuration')->getOptions($this->getItem());\n }",
"private function getListOptions(){\n return $this->listOptions;\n }",
"protected function getXPath()\n {\n $xpath = parent::getXPath();\n $xpath->registerNamespace('m', OData::META);\n $xpath->registerNamespace('d', OData::DATA);\n\n return $xpath;\n }",
"function my_xpath($cmd,$xml)\n{\n if(($cmd===NULL) ||(!strcmp($cmd,$xml->getName())))\n {\n return $xml;\n }\n $keywords=preg_split(\"/\\./\", $cmd);\n if($keywords[0]!=NULL)\n {\n $tmp_array=array();\n $tmp_array=find_path($keywords[0],$xml,$tmp_array);\n }\n else\n {\n $tmp_array=$xml;\n if(isset($keywords[1]))\n {\n $tmp_array=find_attribute($keywords[1],$tmp_array,0);\n }\n return $tmp_array;\n }\n if(isset($keywords[1]))\n {\n $tmp_array=find_attribute($keywords[1],$tmp_array,1);\n }\n return $tmp_array;\n}",
"function ju_explode_xpath($p):array {return jua_flatten(array_map(function($s) {return explode('/', $s);}, ju_array($p)));}",
"private function getSelectOptionXPath(\n string $selectLabel,\n string $optionTitle\n ): string {\n return \"//{$this->getSelectFieldXPath($selectLabel)}\".\n \"/option[text() = '$optionTitle']\";\n }",
"public function option()\n\t{\n\t\treturn [];\n\t}",
"public function findAllOptions();",
"protected function CatalogOptionsList() {\n\treturn $this->GetFieldValue('ItOptions');\n }",
"protected function getOptions()\n\t{\n\t\tjimport('joomla.filesystem.folder');\n\n\t\t// Initialise variables.\n\t\t$options = array();\n\t\t$name = (string) $this->element['name'];\n\t\t$files = JFolder::files(__DIR__ . '/../assets/js/highlight/styles');\n\n\t\tforeach ($files as $file)\n\t\t{\n\t\t\tif (strpos($file, '.css') !== false)\n\t\t\t{\n\t\t\t\t$file = str_replace('.css', '', $file);\n\t\t\t\t$options[] = JHtml::_(\n\t\t\t\t\t'select.option', $file,\n\t\t\t\t\t$file, 'value', 'text'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Merge any additional options in the XML definition.\n\t\t$options = array_merge(parent::getOptions(), $options);\n\n\t\treturn $options;\n\t}",
"public function getOptions(): array;",
"public function getOptions(): array;",
"public function getOptions(): array;",
"public function getOptions(): array;"
] |
[
"0.80503523",
"0.6696989",
"0.6402757",
"0.63894534",
"0.5956354",
"0.5885428",
"0.54793024",
"0.5389568",
"0.5363487",
"0.53440225",
"0.5264848",
"0.5243704",
"0.52327865",
"0.5216436",
"0.52068317",
"0.5167201",
"0.51613945",
"0.5120374",
"0.51189774",
"0.51075315",
"0.5081374",
"0.5080685",
"0.5054676",
"0.5049858",
"0.5049758",
"0.50300336",
"0.5007009",
"0.5007009",
"0.5007009",
"0.5007009"
] |
0.85064095
|
0
|
Renders a page with a button to clear server cache
|
public function clearServerCache()
{
return view('pilot::admin.clear.cache');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function clearPageCacheContent() {}",
"function clear_cache() {\n $this->output->set_header(\"cache-control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0\");\n $this->output->set_header(\"Pragma:no-cache\");\n }",
"public function ajaxClearCache() {\n $this->clearCache();\n $this->_sThisTemplate = \"suaboclearcache_popup.tpl\";\n }",
"public function removeCache() {\r\n $this->output->set_header('Last-Modified:' . gmdate('D, d M Y H:i:s') . 'GMT');\r\n $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');\r\n $this->output->set_header('Cache-Control: post-check=0, pre-check=0', false);\r\n $this->output->set_header('Pragma: no-cache');\r\n }",
"public function clear_cache(): void;",
"public function clearCache(): void;",
"function eve_api_clear_page_cache($name) {\n ctools_include('object-cache');\n ctools_object_cache_clear('eve_api', $name);\n}",
"public function clearCache()\n {\n if ($this->clear_cache && !empty($this->pageinfo)) {\n $dataHandler = GeneralUtility::makeInstance(DataHandler::class);\n $dataHandler->start([], []);\n $dataHandler->clear_cacheCmd($this->id);\n }\n }",
"public function clearCache() {}",
"public function clearCache() {}",
"public function recacheAction()\n {\n $kernel = $this->get('kernel');\n $application = new Application($kernel);\n $application->setAutoExit(false);\n\n $input = new ArrayInput([\n 'command' => 'cache:clear',\n '--env' => $kernel->getEnvironment(),\n '--no-warmup' => true,\n ]);\n $output = new NullOutput();\n $application->run($input, $output);\n\n // Remove flash message.\n $session = $this->get('session');\n $flashBag = $session->getFlashBag();\n $flashBag->get('warning_cache');\n\n return new RedirectResponse($this->admin->generateUrl('list'));\n }",
"public function cleancacheAction() {\n if (Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_CONTENT)) {\n try {\n $this->_helper->cache->clean();\n $this->_helper->response->success(\n $this->_helper->language->translate('The entire cache has been cleaned.')\n );\n }\n catch (Exceptions_SeotoasterException $ste) {\n $this->_helper->response->fail($ste->getMessage());\n }\n }\n }",
"private function refreshCache()\n {\n\n\t\t// any valid date in the past\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\t\t// always modified right now\n\t\theader(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n\t\t// HTTP/1.1\n\t\theader(\"Cache-Control: private, no-store, max-age=0, no-cache, must-revalidate, post-check=0, pre-check=0\");\n\t\t// HTTP/1.0\n\t\theader(\"Pragma: no-cache\");\n\t}",
"function ClearCache()\n\t{\n\t\tglobal $gCms;\n\t\t$smarty =& $gCms->GetSmarty();\n\n\t\t$smarty->clear_all_cache();\n\t\t$smarty->clear_compiled_tpl();\n\n\t\tif (is_file(TMP_CACHE_LOCATION . '/contentcache.php'))\n\t\t{\n\t\t\tunlink(TMP_CACHE_LOCATION . '/contentcache.php');\n\t\t}\n\n\t\t@touch(cms_join_path(TMP_CACHE_LOCATION,'index.html'));\n\t\t@touch(cms_join_path(TMP_TEMPLATES_C_LOCATION,'index.html'));\n\t}",
"public static function clear() \n\t\t{\n\t\t\tSite_CacheManager::flush('page');\n\t\t}",
"public function clearCache()\n {\n }",
"public function handleClearCache()\n {\n if ($dir = $this->getContext()->getParameters()['tempDir'] . '/cache') {\n opcache_reset();\n \\Devrun\\Utils\\FileTrait::purge($dir = dirname(__DIR__) . \"/temp/cache\");\n $this->redirect('this');\n }\n\n }",
"private function clearCache() {\n\t\t\n\t\tCore\\Cache::clear();\n\t\t\n\t}",
"public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}",
"function _cache_actions_clear_panels_cache($display) {\n panels_load_include('simple', 'plugins/cache/');\n panels_simple_cache_clear_cache($display);\n\n}",
"public function index()\n\t{\n\t\t$this->cache = Cache::instance();\n\t\t$this->cache->delete_all();\n\t}",
"public function clearAllExceptPageCacheCommand() {\n\t\t$clearedCaches = $this->cacheApiService->clearAllExceptPageCache();\n\t\t$message = 'Cleared caches: ' . implode(', ', $clearedCaches);\n\t\t$this->logger->info($message);\n\t\t$this->outputLine($message);\n\t}",
"public static function noCache() {\r\n header(\"Pragma: no-cache\");\r\n header('Cache-Control: no-store, no-cache');\r\n }",
"abstract protected function clearCache();",
"public function noCache() {\n\t\t$this->header( \"Pragma: no-cache\" );\n\t\t$this->header( 'Cache-Control: no-store, no-cache' );\n\t}",
"public function cache()\r\n {\r\n dispatch(new PageCacheJob());\r\n return redirect()->back()->with(config('seo.flash_message'), 'Your request to refresh cache are in queue now.');\r\n }",
"public function render()\n\t{\n\t\tparent::render();\n\t\treturn \"werde_deletecache_admin.tpl\";\n\t}",
"public function onClearCache(Enlight_Event_EventArgs $arguments)\n {\n $arguments->getSubject()->Front()->Plugins()->ViewRenderer()->setNoRender();\n\n if (!empty($_SERVER[\"REMOTE_ADDR\"])\n && !empty($this->Config()->ipLimitation)\n && strpos($this->Config()->ipLimitation, $_SERVER[\"REMOTE_ADDR\"]) === false\n ) {\n return;\n }\n\n Shopware()->Cache()->clean();\n Shopware()->Template()->clearAllCache();\n Shopware()->Template()->clearCompiledTemplate();\n $this->clearSearchCache();\n $this->clearRewriteCache();\n $this->clearFrontendCache($arguments->getSubject()->Request());\n $this->clearProxyCache();\n $this->clearConfigCache();\n exit();\n }",
"function tilemmetry_clear_cache()\n{\n theme_reset_all_caches();\n}",
"protected function no_cache(){\nheader('Cache-Control: no-store, no-cache, must-revalidate');\nheader('Cache-Control: post-check=0, pre-check=0',false);\nheader('Pragma: no-cache'); \n}"
] |
[
"0.71834224",
"0.70975137",
"0.6814297",
"0.6720733",
"0.67001003",
"0.66333723",
"0.654564",
"0.6539392",
"0.6495994",
"0.6495994",
"0.64833444",
"0.6453783",
"0.6375003",
"0.6357458",
"0.6316888",
"0.6309644",
"0.6258505",
"0.61937976",
"0.61905414",
"0.61432415",
"0.61318344",
"0.6127643",
"0.6117116",
"0.6094013",
"0.60855263",
"0.60852635",
"0.60648245",
"0.6019897",
"0.60092884",
"0.6007916"
] |
0.72104263
|
0
|
Check if infoblock's scope.visibility allows the current user to see this block
|
public function isAvailableForUser()
{
$c_user = fx::user();
$ib_visibility = isset($this['scope']['visibility']) ? $this['scope']['visibility'] : null;
if (!$ib_visibility || $ib_visibility === 'all') {
return true;
}
if ($ib_visibility === 'nobody') {
return false;
}
if ($ib_visibility === 'admin' && !$c_user->isAdmin()) {
return false;
}
if ($ib_visibility === 'user' && $c_user->isGuest()) {
return false;
}
if ($ib_visibility === 'guest' && !$c_user->isGuest()) {
return false;
}
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function is_block_visible_for_user($user_id)\n {\n \t$user_info = api_get_user_info($user_id);\n\t\t$user_status = $user_info['status'];\n\t\t$is_block_visible_for_user = false;\n \tif (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) {\n \t\t$is_block_visible_for_user = true;\n \t}\n \treturn $is_block_visible_for_user;\n }",
"public function isVisible()\n {\n return $this->attribute('state') != self::STATUS_MODERATED;\n }",
"function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\n }",
"function is_visible() {\n\t\tif ($this->visibility=='hidden') return false;\n\t\tif ($this->visibility=='visible') return true;\n\t\tif ($this->visibility=='search' && is_search()) return true;\n\t\tif ($this->visibility=='search' && !is_search()) return false;\n\t\tif ($this->visibility=='catalog' && is_search()) return false;\n\t\tif ($this->visibility=='catalog' && !is_search()) return true;\n\t}",
"public function isVisibleInSiteVisibility()\n {\n return in_array($this->getVisibility(), $this->getVisibleInSiteVisibilities());\n }",
"function visible () {\n\t\treturn isadmin();\n\t}",
"public function is_visible() {\n\t\treturn true;\n\t}",
"public function hasVisibility()\n {\n return $this->visibility !== null;\n }",
"public function isBlockable()\n {\n if ($this->_hasVar('user_blockable')) {\n return (boolean) $this->_getVar('user_blockable');\n } else {\n return true;\n }\n }",
"function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && !parent::isEnabled();\n }",
"public function isVisible(): bool\n {\n return $this->scopeConfig->getValue('helloworld/general/enable');\n }",
"public function is_visible() {\n\t\treturn isset( $this->data['visible'] ) && $this->data['visible'];\n\t}",
"function is_visible()\n\t{\n\t\treturn $this->visible;\n\t}",
"public function get_visibility()\n {\n }",
"function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && $this->isEnabled();\n }",
"function getVisibility() {\n if($this->visibility === false) {\n $this->visibility = $this->canSeePrivate() ? VISIBILITY_PRIVATE : VISIBILITY_NORMAL;\n } // if\n return $this->visibility;\n }",
"function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }",
"function check_user($visibility)\n\t\t{\n\t \t\tglobal $_SESSION;\n\n\t\t\tif ($visibility == -1) { return true; }\n\t\t\telse if ($visibility <= $_SESSION['gmlevel']) { return true; }\n\t\t\telse { return false; }\n\t\t\t\t\n\t\t\t\n\t\t}",
"public function isVisible() {\n return ($this->visible && $this->state != \"unavailable\");\n }",
"function check_module_visibilityANDavailability($DB, $module_infos, $visibility_allowhiddenmodules, $availability_ignoreavailabilityrestrictions){\n\n //Controlled in Moodle Gui: under 'availability (under \"Common module settings\")'\n $module_restrictions= new stdClass();\n try {\n\n $module_section_infos= $DB->get_record('course_sections', array('id' =>$module_infos->section));\n $module_section_availability = $module_section_infos->availability;\n\n //Get all module/section availability restrictions in array format: including those on complexe set of restrictions.\n $module_section_access_restrictions= get_availability_restelements_fromavfield( $module_section_availability);\n $module_access_restrictions= get_availability_restelements_fromavfield( $module_infos->availability );\n\n //Module visisbility: \"module visibility\" AND \"section visibility\"\n $module_restrictions->mod_visibility = $module_infos->visible;\n $module_restrictions->mod_accrestrictions = $module_access_restrictions;\n $module_restrictions->mod_section_accrestrictions = $module_section_access_restrictions;\n\n\n } catch (\\Exception $e) {\n //$module_infos->course_gen_infos = 'Resource not existant. Verify your request or contact Univ-Nantes Admin.';\n return $e;\n echo \"Exception occurred\";\n }\n\n return array($module_restrictions,decide_about_modVisibilityANDAvailability( $module_restrictions, $visibility_allowhiddenmodules, $availability_ignoreavailabilityrestrictions ));\n\n }",
"private function canHideLists() {\n\t\treturn $this->getUser()->isAllowed( 'gather-hidelist' );\n\t}",
"protected function isVisible()\n {\n $result = parent::isVisible()\n && static::getWidgetTarget() != \\XLite\\Core\\Request::getInstance()->target\n && 0 < $this->getData(new \\XLite\\Core\\CommonCell, true);\n\n if ($result) {\n\n if (!\\XLite\\Core\\CMSConnector::isCMSStarted()) {\n\n if (self::WIDGET_TYPE_SIDEBAR == $this->getParam(self::PARAM_WIDGET_TYPE)) {\n $result = in_array($this->viewListName, array('sidebar.second', 'sidebar.single'));\n\n } elseif (self::WIDGET_TYPE_CENTER == $this->getParam(self::PARAM_WIDGET_TYPE)) {\n $result = ('center.bottom' == $this->viewListName);\n }\n }\n }\n\n return $result;\n }",
"function validate_course_visibility($courseid, $DB, $allowhidden_courses){\n\n $allow_fetch_courseinfos=0;\n $course_infos= $DB->get_record('course', array(\"id\"=>$courseid));\n\n if($allowhidden_courses == 1){\n\n $allow_fetch_courseinfos=1;\n\n }else {\n\n if( $course_infos->visible == 1 ){\n\n $allow_fetch_courseinfos=1;\n\n }\n\n }\n return $allow_fetch_courseinfos;\n\n }",
"abstract public function isVisibleToUser(User $user);",
"protected function _isAllowed()\n {\n $aclResource = 'admin/system/salesblock';\n\n return $this->getAdminSession()->isAllowed($aclResource);\n }",
"function check_permission()\n {\n // Make sure the user is logged-in\n require_course_login($this->course, true, $this->cm);\n\n add_to_log($this->course->id, 'sloodle', 'view sloodle module', \"view.php?id={$this->cm->id}\", \"{$this->sloodle->id}\", $this->cm->id);\n \n // Check for permissions\n $this->module_context = get_context_instance(CONTEXT_MODULE, $this->cm->id);\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\n if (has_capability('moodle/course:manageactivities', $this->module_context)) $this->canedit = true;\n\n // If the module is hidden, then can the user still view it?\n if (empty($this->cm->visible) && !has_capability('moodle/course:viewhiddenactivities', $this->module_context)) notice(get_string('activityiscurrentlyhidden'));\n }",
"public function isBlocked() {\n return $this->user !== null && $this->user->blocked;\n }",
"public function is_content_visible( WP_User $user ): bool {\n\t\t// TODO: It was moved to the product.\n\t\treturn true;\n\t}",
"static public function isVisible(): bool\n {\n return static::$visible;\n }",
"public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}"
] |
[
"0.7278635",
"0.68712354",
"0.6816247",
"0.6769581",
"0.6768395",
"0.6626255",
"0.66131496",
"0.65867007",
"0.6578796",
"0.6442035",
"0.6431867",
"0.6426075",
"0.64065665",
"0.63986635",
"0.6391879",
"0.6389823",
"0.63557214",
"0.6343013",
"0.63066715",
"0.62898046",
"0.626598",
"0.62515473",
"0.6243853",
"0.6240831",
"0.62404335",
"0.62179816",
"0.6153779",
"0.61421376",
"0.6141866",
"0.6139215"
] |
0.7116243
|
1
|
get result (plain data) from infoblock's controller
|
public function getResult()
{
if ($this->result_is_cached) {
return $this->result_cache;
}
if ($this->isFake()) {
$this->data['params']['is_fake'] = true;
}
$controller = $this->getIbController();
if (!$controller) {
$res = false;
} else {
try {
$res = $controller->process();
} catch (\Exception $e) {
fx::log('controller exception', $controller, $e->getMessage());
$res = '';
}
}
$this->result_is_cached = true;
$this->result_cache = $res;
return $res;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function resultAction() {\n $arrResult = array();\n\n $mobileTrafficModel = new mobileTrafficModel();\n\n //Total real time of calls\n $msc=microtime(true);\n $arrResult['total_call'] = $mobileTrafficModel->getRealTimeCalls();\n $arrResult['execution_time']['total_call'] = microtime(true)-$msc;\n\n //Top 10 of best data\n $msc=microtime(true); \n $arrResult['top_data'] = $mobileTrafficModel->getTopData();\n $arrResult['execution_time']['top_data'] = microtime(true)-$msc;\n\n //Total of sms\n $msc=microtime(true);\n $arrResult['total_sms'] = $mobileTrafficModel->getTotalSms();\n $arrResult['execution_time']['total_sms'] = microtime(true)-$msc;\n\n return $arrResult;\n }",
"public function getFrontendResult()\n\t{\t\t\n\t\t// not implement yet.\n\t}",
"function getData() {\n return $this->body->getResponse();\n }",
"protected function resultAction()\n {\n $fullUrl = s('post')->getSafeArray('short')->getString('url');\n $shortId = s('shorter')->getShortId($fullUrl);\n $shortUrl = $this->urlPrefix.$shortId;\n //\n return s('result')->show(template('layout', [\n 'title'=>$this->lang->title,\n 'content'=>template('index/result', [\n 'header'=>$this->lang->header,\n 'text'=>$this->lang->text,\n 'url'=>$fullUrl,\n 'shortUrl'=>$shortUrl\n ])\n ]));\n }",
"public function getResponse()\n {\n return \\Cloud::app()->getFrontController()->getResponse();\n }",
"public function execute() {\n\t\t$data = $this->getResultData();\n\t\t$this->printText($data[0]);\n\t}",
"public function mainAction()\n {\n return $this->setResponse();\n }",
"public function execute()\n {\n $nbpapi = \"http://api.nbp.pl/api/exchangerates/rates/a/rub/?format=json\";\n\n // get posdata from request\n $postdata = $this->getRequest()->getPostValue();\n\n // make sure that interessing data is float\n if (!isset($postdata[\"amount\"]) || empty($postdata[\"amount\"])) {\n $postdata[\"amount\"] = 0;\n }\n $postamount=floatval($postdata[\"amount\"]);\n\n // request to nbp api \n $this->_curl->get($nbpapi);\n \n // response will contain the output in form of JSON string\n // then change to assoc array\n $exchangerate = $this->_jsonHelper->jsonDecode($this->_curl->getBody());\n \n // how many pln we have\n $amount = $postamount * $exchangerate[\"rates\"][0][\"mid\"];\n \n // create JSON, which will be used to show resposne\n $result = $this->_resultJsonFactory->create();\n\n // set data to json\n $result->setData([\"success\"=>true,\"exchange_rate\"=>$exchangerate[\"rates\"][0][\"mid\"],\"amount\"=>$amount]);\n \n // return result to show json\n return $result;\n }",
"public function getDataAction () {\n\t\t$this->getAnswer();\n\t}",
"public function getDataAction () {\n\t\t$this->getAnswer();\n\t}",
"public function getResult()\n {\n return $this->information[ self::INFORMATION_RESULT ];\n }",
"private function execute()\n {\n // executes a cURL session for the request, and sets the result variable\n $result = Request::get($this->getRequestURL())->send();\n // return the json result\n return $result->raw_body;\n }",
"function execute()\r\n {\r\n\t\t$cardName = urldecode($this->getRequest()->cardName);\r\n\t\t$cardInfo = TextHelper::getCardText($cardName);\r\n\r\n switch($this->getFormat())\r\n {\r\n case \"json\":\r\n $this->getResponse()->cardInfo = json_encode($cardInfo);\r\n $this->getResponse()->render(ROOT_DIRECTORY . \"/views/textData.json.tpl.php\");\r\n break;\r\n case \"html\":\r\n $this->getResponse()->cardInfo = $cardInfo;\r\n $this->getResponse()->render(ROOT_DIRECTORY . \"/views/textData.html.tpl.php\");\r\n break;\r\n default:\r\n $this->getResponse()->redirect(BASE_URL);\r\n break;\r\n }\r\n }",
"public function getResponse() {}",
"public function getResponse() {}",
"public function getRawResult();",
"public function perform()\n {\n // template var with charset used for the html pages\n $this->viewVar['charset'] = $this->config->getModuleVar('common', 'charset');\n $this->viewVar['cssFolder'] = JAPA_PUBLIC_DIR . 'styles/'.$this->config->getModuleVar('common', 'styles_folder');\n $this->viewVar['urlBase'] = $this->router->getBase(); \n $this->viewVar['loggedUserRole'] = $this->controllerVar['loggedUserRole'];\n $this->viewVar['isUserLogged'] = $this->controllerVar['isUserLogged'];\n $this->viewVar['adminWebController'] = $this->config->getVar('default_module_application_controller'); \n \n $this->viewVar['text'] = array();\n\n // get text for the front page\n $this->model->action('misc','getText', \n array('id_text' => 1,\n 'result' => & $this->viewVar['text'],\n 'fields' => array('body'))); \n \n // get result of the header and footer controller\n // \n $this->viewVar['header'] = $this->controllerLoader->header(); \n $this->viewVar['footer'] = $this->controllerLoader->footer(); \n $this->viewVar['rightBorder'] = $this->controllerLoader->rightBorder(); \n }",
"public function getResponse() {\n\t}",
"public function getInfo() {}",
"public function getInfo() {}",
"public function index()\n {\n return $this->getData();\n }",
"public function getBackendResult()\n\t{\t\t\n\t\t// not implement yet.\n\t\t//$crumbs = md5(self::HASHSUM.$this->_invoice);\n\t}",
"public function info(): \\iota\\schemas\\response\\info {\n return $this->fetch([\n 'route' => \"info\",\n 'return' => \\iota\\schemas\\response\\Info::class,\n ]);\n }",
"public function getResponseData();",
"public function result();",
"public function result();",
"public function execute(){\n return $this->general(); \n }",
"function info_for(){\n \n $this->layout = 'ajax'; \n //http://127.0.0.1/c2/yfi_cake/cc_transactions/info_for?callback=callback&id=503d0df1-2c20-4633-95f3-03dea509ff00\n\n $json_return = array(); //Fail it by default\n $json_return['success'] = false;\n $json_return['transaction'] = array();\n/*\n //----Dummy Data---------\n $json_return['transaction'] = array(\n 'x_auth_code' => 'QCM5NU',\n 'x_trans_id' => '2175459845',\n 'x_amount' => '10.99',\n 'x_card_type' => 'Discover',\n 'x_response_code' => 1,\n 'x_response_reason_code' => 1,\n 'x_response_reason_text' => 'This transaction has been approved.',\n );\n\n //--- End Dummy Data ----\n*/\n\n if(array_key_exists('id',$this->params['url'])){\n $id = $this->params['url']['id'];\n $q_r = $this->CcTransaction->findById($id);\n\n //Required fields to feedback\n $rf = array('x_auth_code',\n 'x_trans_id',\n 'x_card_type',\n 'x_amount',\n 'x_response_code',\n 'x_response_reason_code',\n 'x_response_reason_text',\n );\n if($q_r ==''){\n $this->set('json_return',$json_return);\n return;\n }\n foreach($q_r['TransactionDetail'] as $item){\n $name = $item['name'];\n if(in_array($name,$rf)){\n $json_return['transaction'][$name] = $item['value'];\n }\n }\n\n $json_return['success'] = true;\n }\n\n $json_return['success'] = true;\n\n $this->set('json_return',$json_return);\n $callback = $this->params['url']['callback'];\n $this->set('json_pad_with',$callback);\n }",
"public function index()\n {\n $data = pembimbing::get();\n return [\"result\"=>$data];\n }",
"private function getResult() {\n return $this->result;\n }"
] |
[
"0.61172324",
"0.6115714",
"0.60239625",
"0.59591067",
"0.59153795",
"0.5897066",
"0.58877087",
"0.58673096",
"0.58567363",
"0.58567363",
"0.5828909",
"0.579532",
"0.5788834",
"0.5756842",
"0.5756842",
"0.5742412",
"0.57413423",
"0.5708611",
"0.5698121",
"0.5698121",
"0.56912696",
"0.5686638",
"0.56842524",
"0.5668102",
"0.5640704",
"0.5640704",
"0.5639096",
"0.5629967",
"0.56277865",
"0.5625918"
] |
0.6411276
|
0
|
Constructor. Set up the regex and name caches.
|
public function __construct()
{
$this->regex = '/(' . implode(')|(', array_values($this->tokens)) . ')/u';
$this->name_cache = array_keys($this->tokens);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function init()\n {\n if ($this->regex) {\n return;\n }\n\n $this->regex = $this->path;\n $matches = [];\n\n if ($count = preg_match_all('@{([^A-Za-z]*([A-Za-z]+))([?]?)(?::([^}]+))?}@', $this->regex, $matches)) {\n $this->tokens = new \\SplFixedArray($count);\n\n foreach ($matches[1] as $index => $token) {\n $fullString = $matches[1][$index];\n $name = $matches[2][$index];\n $optional = !empty($matches[3][$index]);\n $constraint = empty($matches[4][$index]) ? '.*' : $matches[4][$index];\n\n if ($optional) {\n $replace = sprintf('(?:%s(?<%s>%s))?', str_replace($name, '', $fullString), $name, $constraint);\n } else {\n $replace = sprintf('(?<%s>%s)', $name, $constraint);\n }\n\n $this->regex = str_replace($matches[0][$index], $replace, $this->regex);\n\n $this->tokens[$index] = [$name, $optional];\n }\n }\n }",
"protected static function initialize()\n {\n if (!static::$isInitialized) {\n static::$regexSelector = '(?<selector>'\n . '(' . static::$regexUnreserved . '|' . static::$regexPctEncoding . ')+)';\n static::$regexCompareOp = '(?<comp_op>(=[A-Za-z]*|' . static::$regexFiqlDelim . ')=)';\n\n static::$regexArgChar = '(' . static::$regexUnreserved . '|'\n . static::$regexPctEncoding . '|' . static::$regexFiqlDelim . '|'\n . '=)';\n static::$regexArgument = '(?<arg>' . static::$regexArgChar . '+)';\n\n static::$regexConstraint = '/' . static::$regexSelector\n . '(' . static::$regexCompareOp . static::$regexArgument . ')?/';\n\n static::$isInitialized = true;\n }\n }",
"public function __construct( $regex )\n\t{\n\t\t$this->regex = $regex;\n\t}",
"public function setupRegex()\n {\n if ($this->regexSetup) {\n return;\n }\n\n $glue = preg_quote($this->scopeGlue, '/');\n\n // Modified by Ivan Tcholakov, 21-JAN-2016.\n //$this->variableRegex = $glue === '\\\\.' ? '[a-zA-Z0-9_'.$glue.']+' : '[a-zA-Z0-9_\\.'.$glue.']+';\n $this->variableRegex = $glue === '\\\\.' ? '[a-zA-Z0-9_]+(?:['.$glue.']+[a-zA-Z0-9_]+)*' : '[a-zA-Z0-9_]+(?:[\\.'.$glue.']+[a-zA-Z0-9_]+)*';\n //\n $this->callbackNameRegex = $this->variableRegex.$glue.$this->variableRegex;\n $this->variableLoopRegex = '/\\{\\{\\s*('.$this->variableRegex.')\\s*\\}\\}(.*?)\\{\\{\\s*\\/\\1\\s*\\}\\}/ms';\n $this->variableTagRegex = '/\\{\\{\\s*('.$this->variableRegex.')\\s*\\}\\}/m';\n\n $this->callbackBlockRegex = '/\\{\\{\\s*('.$this->variableRegex.')(\\s.*?)\\}\\}(.*?)\\{\\{\\s*\\/\\1\\s*\\}\\}/ms';\n\n $this->recursiveRegex = '/\\{\\{\\s*\\*recursive\\s*('.$this->variableRegex.')\\*\\s*\\}\\}/ms';\n\n $this->noparseRegex = '/\\{\\{\\s*noparse\\s*\\}\\}(.*?)\\{\\{\\s*\\/noparse\\s*\\}\\}/ms';\n\n $this->conditionalRegex = '/\\{\\{\\s*(if|unless|elseif|elseunless)\\s*((?:\\()?(.*?)(?:\\))?)\\s*\\}\\}/ms';\n $this->conditionalElseRegex = '/\\{\\{\\s*else\\s*\\}\\}/ms';\n $this->conditionalEndRegex = '/\\{\\{\\s*endif\\s*\\}\\}/ms';\n $this->conditionalExistsRegex = '/(\\s+|^)exists\\s+('.$this->variableRegex.')(\\s+|$)/ms';\n $this->conditionalNotRegex = '/(\\s+|^)not(\\s+|$)/ms';\n\n $this->callbackBlockStartRegex = '/\\{\\{\\s*('.$this->variableRegex.')(\\s.*?)\\}\\}/ms';\n $this->callbackBlockStartRegex1 = '/\\{\\{\\s*(\\1)(\\s.*?)\\}\\}/ms';\n $this->callbackBlockEndRegex = '/\\{\\{\\s*\\/\\1\\s*\\}\\}/ms';\n\n $this->regexSetup = true;\n\n // This is important, it's pretty unclear by the documentation\n // what the default value is on <= 5.3.6\n // Disabled by Ivan Tcholakov, 21-JAN-2016, This is set within a global configuration file.\n //ini_set('pcre.backtrack_limit', 1000000);\n //\n }",
"public function __construct() {\n $question = new qtype_preg();\n $this->engines = $question->available_engines();\n unset($this->engines['preg_php_matcher']);\n $this->engines = array_keys($this->engines);\n }",
"public function regex() {\r\n // split uri\r\n $arr = preg_split('@/@', $this->uri, NULL, PREG_SPLIT_NO_EMPTY);\r\n\r\n $regex = null;\r\n foreach ($arr as $ar) {\r\n // Replace dynamic with regex\r\n $regex = $regex.'\\/'.preg_replace('/\\{(.*?)\\}/', '[0-9A-Za-z]++', $ar);\r\n }\r\n\r\n $this->regex = '/^'.$regex.'$/';\r\n }",
"public function __construct($name, $ttl, $order, $pref, $flags, $service, $regex, $replacement) {\n parent::__construct($name, $ttl);\n $this->order= $order;\n $this->pref= $pref;\n $this->flags= $flags;\n $this->service= $service;\n $this->regex= $regex;\n $this->replacement= $replacement;\n }",
"public function __construct($regex, $identifier)\n {\n $this->regex = $regex;\n $this->id = $identifier;\n }",
"public function __construct() {\n $this->regex = '/^';\n foreach (CreditCardValidator::$card_patterns as $card => $regex)\n $this->regex .= '(' . $regex . ')|';\n $this->regex .= '$/';\n // remove final pipe\n $this->regex = str_replace(')|$/', ')$/', $this->regex);\n $this->invalid_msg = 'is not a valid CreditCard number';\n }",
"public function __construct()\n {\n if ($this->_name == null) {\n $name = array();\n preg_match('/^(Doctrine_Record_Generator_Pollable_)?(.*)$/', get_class($this), $name);\n $this->_name = $name[2];\n }\n }",
"public function init() {\n\t\t$this->addRegex('/0[0-9]{10}/');\n\t}",
"public function __construct()\n {\n $this->initContrexxCaching();\n $this->initOPCaching();\n $this->initUserCaching();\n $this->getActivatedCacheEngines();\n }",
"public function __construct()\n {\n $this->pluralRules = Pluralize::all();\n $this->singularRules = Singularize::all();\n $this->aplicator = new Rules();\n \n foreach (Irregularize::all() as $rule) {\n $this->irregularSingles[$rule[0]] = $rule[1];\n $this->irregularPlurals[$rule[1]] = $rule[0];\n }\n \n foreach (Uncountable::all() as $rule) {\n $this->addUncountableRule($rule);\n }\n }",
"public function __construct()\n {\n $this->rulesets = [\n // Exact values\n function ($value) {\n return is_string($value) && isset($this->exactReplacements[$value])\n ? [$this, 'replaceExactValue']\n : null;\n },\n\n // Router (MVC applications)\n // We do not want to rewrite these.\n function ($value, array $keys) {\n $key = array_pop($keys);\n // Only worried about a top-level \"router\" key.\n return $key === 'router' && $keys === [] && is_array($value)\n ? [$this, 'noopReplacement']\n : null;\n },\n\n // service- and pluginmanager handling\n function ($value) {\n return is_array($value) && array_intersect_key(self::SERVICE_MANAGER_KEYS_OF_INTEREST, $value) !== []\n ? [$this, 'replaceDependencyConfiguration']\n : null;\n },\n\n // Array values\n function ($value, array $keys) {\n return $keys !== [] && is_array($value)\n ? [$this, 'processConfig']\n : null;\n },\n ];\n }",
"function __construct()\n {\n if ( function_exists('apc_fetch') )\n $this->hostname = apc_fetch('hostname');\n\n // If we didn't have a valid name in the store\n if ( !strlen($this->hostname) )\n {\n // Shell out and get the hostname\n list($this->hostname) = explode('.', shell_exec('hostname'));\n\n // Store it in cache if we have it\n if ( function_exists('apc_store') )\n apc_store('hostname', $this->hostname, 86400);\n }\n }",
"protected function _getRegex ($name, array $vars = array(), $cacheVars = false)\r\n {\r\n if (!isset($this->_regex[$name])) {\r\n //$file = dirname(__FILE__).'/preg/'.$name.'.preg';\r\n $file = $this->getRegexDirectory().'/'.$name.'.preg';\r\n if(!file_exists($file)) {\r\n throw new Exception(\"preg file '$file' doesn't exists. regexDirectory incorrect ?\");\r\n }\r\n \r\n $this->_regex[$name] = PregFile::getFile($file);\r\n }\r\n \r\n if ($cacheVars) {\r\n $id = $name.serialize($vars);\r\n if (!isset($this->_regexCache[$id])) {\r\n $this->_regexCache[$id] = $this->_regex[$name]->setVars($vars)->getRegex();\r\n }\r\n $s = $this->_regexCache[$id];\r\n } else {\r\n $s = $this->_regex[$name]->setVars($vars);\r\n }\r\n \r\n return $s;\r\n }",
"public function __construct()\r\n {\r\n if(!ctype_alnum($this->cache_name))\r\n {\r\n throw new \\RuntimeException(\"You need to set the cache name properly, it can only be alphnum!\");\r\n }\r\n \r\n $this->cache_file = DIR_SECURE_CACHE.'/'.$this->cache_name.'.cache';\r\n \r\n if( !is_readable( $this->cache_file ) )\r\n { \r\n $this->makeCache();\r\n $this->saveCache();\r\n }\r\n }",
"public function __construct($patterns = [\"Proxy\\\\{ns}\\\\{ln}\"])\n {\n $this->patterns = $patterns;\n }",
"public function __construct() {\n\t\t$this->set_format( '/.*/', 'replace' );\n\t}",
"private function __construct() {\n\t\trequire_once \"Scripts/HTMLCleaner.php\";\n\t\trequire_once \"Scripts/ProcessProperties.php\";\n\t}",
"public function __construct($regex = null, $modifiers = null) {\n $this->errors = array();\n if ($regex === null) {\n return;\n }\n\n //Are passed modifiers supported?\n if (is_string($modifiers)) {\n $supportedmodifiers = $this->get_supported_modifiers();\n for ($i=0; $i < strlen($modifiers); $i++) {\n if (strpos($supportedmodifiers,$modifiers[$i]) === false) {\n $this->errors[] = new preg_error_unsupported_modifier($this->name(), $modifiers[$i]);\n }\n }\n }\n\n $this->regex = $regex;\n $this->modifiers = $modifiers;\n //do parsing\n if ($this->is_parsing_needed()) {\n $this->build_tree($regex);\n } else {\n $this->ast_root = null;\n //In case with no parsing we should stick to accepting whole regex, not nodes\n $this->accept_regex();\n }\n }",
"function __construct() {\n $this->_cache = [];\n }",
"private function _load_rewriter_class()\n\t{\n\t\trequire_once dirname(__FILE__) . '/rewriter/rewriter.php';\n\t\trequire_once dirname(__FILE__) . '/rewriter/nginx.php';\n\t\trequire_once dirname(__FILE__) . '/rewriter/apache.php';\n\n\t\t// @since 1.3.2 we initiate both rewriter classes to support special\n\t\t// setups such as nginx is used as a reverse proxy for apache\n\t\t$this->rewriter_apache = new BWP_Minify_Rewriter_Apache($this);\n\t\t$this->rewriter_nginx = new BWP_Minify_Rewriter_Nginx($this);\n\n\t\t// assume apache if not nginx\n\t\t$this->rewriter = self::is_nginx() ? $this->rewriter_nginx : $this->rewriter_apache;\n\t}",
"protected function setRegexAttributes()\n {\n $find = '#{([a-z][a-zA-Z0-9_]*)}#';\n $attributes = $this->route->attributes;\n $newAttributes = [];\n preg_match_all($find, $this->regex, $matches, PREG_SET_ORDER);\n foreach ($matches as $match) {\n $name = $match[1];\n $subpattern = $this->getSubpattern($name);\n $this->regex = str_replace(\"{{$name}}\", $subpattern, $this->regex);\n if (! isset($attributes[$name])) {\n $newAttributes[$name] = null;\n }\n }\n $this->route->attributes($newAttributes);\n }",
"public function __construct()\n {\n $this->entity = $this->entity();\n $this->map = $this->map();\n $this->regex = $this->regex();\n }",
"public function __construct() {\n include Config::create()->load('cache');\n $this->config = $cache;\n $this->mc = new Memcached();\n foreach ($this->config['server'] as $s) {\n $this->mc->addServer($s['host'], $s['port']);\n }\n }",
"private function __construct()\n\t{\n\t\t$this->_loadCacheObj();\n\t\treturn;\n\t}",
"function __construct()\n\t\t{\n\t\t\t$this->db = new Database();\n\t\t\t$this->fm = new Format();\n\t\t}",
"function __construct() {\n\t\t$this->init();\n\t\t$this->register_globals();\n\t}",
"function __construct()\n\t{\n\t\t$this->name = uniqid();\n\t}"
] |
[
"0.7170215",
"0.68078196",
"0.6755858",
"0.62901884",
"0.604596",
"0.5919106",
"0.5917276",
"0.58848035",
"0.5875426",
"0.5833157",
"0.58292943",
"0.57990074",
"0.5768347",
"0.57482266",
"0.57431364",
"0.5741567",
"0.5738516",
"0.57066953",
"0.5640682",
"0.56279314",
"0.5625629",
"0.5619259",
"0.5618776",
"0.55966127",
"0.5595887",
"0.5589815",
"0.5583978",
"0.5582574",
"0.5536293",
"0.5500827"
] |
0.7938754
|
0
|
Add an url to a different size of this attachment.
|
public function addSize($size, UrlContract $url)
{
$size = is_array($size) ? new Size($size[0], $size[1]) : $size;
if ($size->equals($this->getSize())) {
return $this;
}
$key = "$size";
$this->sizes[$key] = $size;
$this->sizeUrls[$key] = $url;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setAttachmentURL($value)\n {\n return $this->set('AttachmentURL', $value);\n }",
"public function url($domain, $size, $format);",
"public function thumbUrl($url, $size)\n {\n $rootUrl = Settings::getInstance()->URLS['URL'];\n $pattern = '#^http(s)?://(www\\.)?#i';\n if (preg_match($pattern, $url)) {\n return preg_replace_callback($pattern, function ($matches) use ($rootUrl, $size) {\n $ssl = ($matches[1] ? 'ssl/' : '');\n return sprintf('%sthumbs/%s/%s', $rootUrl, $size, $ssl);\n }, $url);\n } else {\n return sprintf('%sthumbs/%s%s', $rootUrl, $size, $url);\n }\n }",
"public function getImageURL($size = 'original') {\n\t\treturn $this->_config['images']['base_url'] . $size;\n\t}",
"function imageUrl($property, $size = null);",
"public function getImageUrl2($size = '50x50', $options = array())\n {\n $attrname = $this->name;\n $params = array();\n $params['id'] = $this->id;\n if (!empty($attrname)) {\n if ($size !== false) {\n $params['size'] = $size;\n //if (isset($options['mod'])) {\n // $params['mod'] = $options['mod'];\n //}\n return Yii::app()->createUrl('/core/attachment', $params);\n\n //return CMS::assetImage($size, $attrname, 'attachments.' . $dir, 'attachments/' . $redir, $options);\n }\n } else {\n return false;\n }\n }",
"public function addSize($size)\n {\n $this->sizeList[] = $size;\n return $this;\n }",
"public function getPhotoLargeAttribute()\n {\n return Storage::url('large' . $this->photo_path);\n }",
"private function originalSizeImageUrl(String $url) : String\n {\n return preg_replace(\"/https?:\\/\\/(.+?)_normal.(jpg|jpeg|png|gif)/\", \"https://$1.$2\", $url);\n }",
"public function addSize(Size $size)\n {\n $this->sizeList[] = $size;\n }",
"public function setImgUrlAttribute($img_url)\n {\n /*\n * protección al actualizar un record\n * si no se quiere actualizar la imagen, no se requiere subir una imagen y guardarla en la carpeta images\n *\n * si creamos un nuevo record,\n * AdvertisemetRequest validará que se quiere subir una imagen para crear dicho record\n */\n if(!empty($img_url)) {\n /* concatena los segundos con el nombre del archivo que se subío para evitar overides */\n $name = Carbon::now()->second . $img_url->getClientOriginalName();\n /* renombra el archivo */\n $this->attributes['img_url'] = $name;\n /* almacena la imagen en nuestra caperta images */\n /* \\Storage::disk('local') = ruta de la carpeta images */\n \\Storage::disk('local')->put($name, \\File::get($img_url));\n }\n }",
"public function addUrl(Url $url)\n {\n if (strlen($url->loc) > self::URL_LENGTH_LIMIT) {\n throw new UrlTooLongException();\n }\n $writer = $this->getWriter();\n\n if (!$this->domain) {\n throw new DomainNotSetException();\n }\n\n $writer->add($this->domain . $url->loc, $url->priority, $url->lastmod, $url->changefreq);\n\n $this->urlsCount++;\n if ($this->urlsCount % $this->limit === 0) {\n $this->close();\n }\n }",
"public function ezbs_add_image_size(){\n \n $obj_ezc_add_image_size = Class_WP_ezClasses_Theme_Add_Image_Size_1::ez_new();\n\t \n\t // $obj_ezc_add_image_size->set_remove_width_height(false);\n\t \n\t // $obj_ezc_add_image_size->set_jpeg_quality(80);\t\n\t \n\t $arr_args['arr_args'] = $this->ezbs_add_image_size_args();\n\t \n\t // ais = add image size\n\t $obj_ezc_add_image_size->ez_ais($arr_args);\n\t \n\t //$obj_ezc_add_image_size->set_image_size_names_choose_defaults(false);\n\t \n\t // isnc = image_size_names_choose (with is a stock WP filter) \n\t $obj_ezc_add_image_size->ez_isnc($arr_args);\t \n\t \n }",
"public static function image_size( $img_url, $img_size )\r\n\t{\r\n\t\t$img = explode( '/', $img_url );\r\n\t\t$img[4] = $img_size;\r\n\t\treturn implode( '/', $img );\r\n\t}",
"public function getThumbUrl($size = null)\n\t{\n\t\treturn false;\n\t}",
"public function addImage($url){\n //todo add images in xml simetamp\n $f=Francis::get($url);\n if ( $f->exists() && $f->isImage()) {\n $this->images[]=GiveMe::urlFile(Robert::fromImage($f->path)->jpg(80),true);\n }\n }",
"public function setUrl($url) {}",
"public function setSize($size);",
"public function setThumbsize($value)\n {\n if ($value !== null) {\n $this->_params['thumbsize'] = $value;\n } else {\n unset($this->_params['thumbsize']);\n }\n }",
"function AddButtonURL( $ATitle, $AURL, $Size = \"full\"){\n $item['text'] = $ATitle;\n $item['url'] = $AURL;\n $item['size'] = $Size;\n return $item; \n}",
"function createNavigationURLSize($galleryPID, $galleryCID, $imgID, $size) {\n $typolink_conf = array(\n 'no_cache' => $this->conf['showHits'],\n 'parameter' => $GLOBALS['TSFE']->id,\n 'additionalParams' => '&tx_hldamgallery_pi1[galleryPID]=' . $galleryPID .\n '&tx_hldamgallery_pi1[galleryCID]=' . $galleryCID . '&tx_hldamgallery_pi1[imgID]=' . $imgID .\n '&tx_hldamgallery_pi1[size]=' . $size,\n 'useCacheHash' => true\n );\n\n return $this->cObj->typolink_URL($typolink_conf);\n }",
"public function getRelativeLinkToThumbnailImg($size)\n {\n return ImgUpload::getRelativeLinkToThumbnailImg($this, $size);\n }",
"function setSize($size)\n {\n $this->size = $size;\n }",
"public function additional_sizes($sizes = array())\n {\n }",
"protected function imageUrl($attribute, $size = null)\n {\n if (in_array($attribute, $this->owner->attributes()) && is_array($this->attributes[$attribute]))\n {\n if (empty($this->owner->$attribute)) {\n return null;\n }\n\n $size = $this->sizeIndex($attribute, $size);\n\n if (strpos($this->domain, '@') === 0) {\n $host = Yii::getAlias($this->domain);\n } else {\n if (preg_match('~^((?:https?\\:)?//)~', $this->domain, $m)) {\n $protocol = $m[1];\n } else {\n $protocol = preg_replace('~^((?:https?\\:)?//)(.*)$~', '\\\\1', Yii::$app->urlManager->hostInfo);\n }\n $host = $protocol. preg_replace('~^(?:https?\\:)?//(.*)$~',\n str_replace('{$domain}', '\\\\1', $this->domain), Yii::$app->urlManager->hostInfo);\n }\n\n $format = array_merge($this->defaultImagesSettings, $this->attributes[$attribute],\n $this->attributes[$attribute]['sizes'][$size])['format'];\n\n return $this->schemaTo($host, $attribute, \"$size/{$this->owner->$attribute}.$format\");\n }\n\n throw new UnknownMethodException(\n sprintf('Calling unknown method: %s::get%sUrl()', get_class($this), ucfirst($attribute)));\n }",
"function setSize($size) {\n\t\t$this->size = $size;\n\t}",
"public function setUrl( $url );",
"public function addLink($intModelId,$intPackageId,$strUrl,$strFilename='',$intFilesize=0) {\r\n\t\t\tif (!isset($this->arrModel[$intModelId]['packages'][$intPackageId]['links'])) {\r\n\t\t\t\treturn $this->addError('(addLink) Package with Id '.$intPackageId.' not exists');\r\n\t\t\t}\r\n\t\t\t$arrLink = array('url' => trim($strUrl),\r\n\t\t\t\t\t\t\t 'filename' => trim($strFilename),\r\n\t\t\t\t\t\t\t 'size' => trim($intFilesize));\r\n\t\t\tarray_push($this->arrModel[$intModelId]['packages'][$intPackageId]['links'],$arrLink);\r\n\t\t\treturn true;\r\n\t\t}",
"public function setUrlAttribute($value)\n {\n \tif ( empty($value) ) {\n \t\t$this->attributes['url'] = NULL;\n \t} else {\n \t$this->attributes['url'] = $value;\n \t}\n }",
"public function addImage($url, $attributes = []);"
] |
[
"0.5839911",
"0.5839437",
"0.58352065",
"0.56738544",
"0.5667434",
"0.55923975",
"0.5578073",
"0.5493114",
"0.54507405",
"0.5433082",
"0.54159427",
"0.5407728",
"0.53717315",
"0.5369325",
"0.53655624",
"0.53377163",
"0.53208864",
"0.5306326",
"0.52919596",
"0.5276868",
"0.5267354",
"0.5265492",
"0.5259117",
"0.5252555",
"0.5252206",
"0.52418953",
"0.523924",
"0.5235605",
"0.5235321",
"0.5222425"
] |
0.6688278
|
0
|
Remove a previously added size.
|
public function removeSize($size)
{
$size = is_array($size) ? new Size($size[0], $size[1]) : $size;
$key = "$size";
if (isset($this->sizes[$key])) {
unset($this->sizes[$key]);
}
if (isset($this->sizeUrls[$key])) {
unset($this->sizeUrls[$key]);
}
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function resize(int $size, $value = 0): void {}",
"function setSize($size)\n\t{\n\t\t$this->size = 0+$size;\n\t}",
"public function size(int $size): void;",
"public function setSize($size);",
"public function addSize() { return $this->_m_addSize; }",
"function photo_cache_cleanup_size()\n{\n\t$cache_size=read_config('cache_size');\n\tif($cache_size <= 0) {\n\t\treturn;\n\t}\n\n\t$result=$GLOBALS['db']->Execute(\"SELECT SUM(size) FROM \".PREFIX.\"photo_cache\");\n\t$row=$result->FetchRow();\n\n\tif($row[0] < $cache_size || $row[0] <= 0) {\n\t\treturn;\n\t}\n\t\n\t$cleanup=$row[0] - $cache_size; // size to remove\n\t\n\t$result=$GLOBALS['db']->Execute(\"SELECT filename,size FROM \".PREFIX.\"photo_cache\" .\n\t\t\t\t\t\t\t\t\t\" ORDER by used\");\n\t\n\twhile($cleanup > 0 && $row=$result->FetchRow())\n\t{\n\t\t$cleanup = $cleanup - $row[1];\n\t\tif(!unlink(\"$row[0]\")) {\n\t\t\tif(file_exists(\"$row[0]\")) {\n\t\t\t\terror_log(\"photo_cache_cleanup_size unable to delete file $row[0]\");\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['db']->Execute(\"DELETE FROM \".PREFIX.\"photo_cache WHERE filename='\".linpha_addslashes($row[0]).\"'\");\n\t}\n}",
"protected function __rm_font_size__(){\n\t\t$this->font_size(10.5);\n\t}",
"public function destroysize($id) {\n $delete = ProductsSize::find($id);\n \n $delete->delete();\n session()->flash('success',trans('admin.deleted'));\n return back();\n }",
"function _set_new_x($size)\r\n {\r\n $this->new_x = $size;\r\n }",
"public function removeQuantity()\n\t{\n\t\tif(isset($this->searchFilters[$this->ref_quantity]))\n\t\t{\n\t\t\tunset($this->searchFilters[$this->ref_quantity]);\n\t\t}\n\t}",
"public function setSize($size)\n {\n if ($size > $this->size) {\n $actualInts = (int)ceil($this->size / $this->intSize);\n $newInts = (int)ceil($size / $this->intSize) - $actualInts;\n for ($i = 0; $i < $newInts; $i++) {\n $this->data[] = (int)0;\n }\n } else {\n $newInts = (int)ceil($size / $this->intSize);\n $this->data = array_slice($this->data, 0, $newInts);\n }\n\n $this->size = $size;\n }",
"public function getLastSize()\n {\n $count = count($this->sizeList);\n if ($count === 0) {\n return;\n }\n \n return $this->sizeList[$count - 1];\n }",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"public function truncate(int $size);",
"public function delSizeById($id){\n $query = \"DELETE FROM tbl_size WHERE sizeId = '$id' \";\n $delSize = $this->db->delete($query);\n if ($delSize) {\n $msg = \"<span class='success'>Size Deleted.</span>\";\n return $msg;\n } else {\n $msg = \"<span class='error'>Size Not Deleted !</span>\";\n return $msg;\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function addSize(Size $size)\n {\n $this->sizeList[] = $size;\n }",
"function medula_remove_image_size( $sizes ) {\n\tunset( $sizes['thumbnail'] );\n\tunset( $sizes['medium'] );\n\tunset( $sizes['large'] );\n\n\treturn $sizes;\n}",
"public function remove()\n {\n $root = $this->heap_Array[0];\n // put last element into root\n $this->heap_Array[0] = $this->heap_Array[--$this->_current_Size];\n $this->bubbleDown(0);\n return $root;\n }",
"public function setSize($size): self;",
"function delete() {\t\t$nop = str_repeat(\" \", $this -> size);\n\t\t//10 caratteri per diecimila\n\t\tshmop_write($this -> id, $nop, 0);\n\n\t}",
"public function remove($key) {\r\n\t\tif(in_array($key, array_keys($key))) {\r\n\t\t\tunset($this->arg[$key]);\r\n\t\t\t--$this->size;\r\n\t\t}\r\n\t}",
"function remove_image_size($name)\n {\n }",
"public function delete($size)\n {\n if($size){\n $size = Size::find($size);\n $size->delete();\n Session::flash('success','Size has been delete successfully!');\n return redirect()->route('size.index');\n }\n }",
"function setSize($size) {\n\t\t$this->size = $size;\n\t}",
"public function setSize( $aInputSize )\n\t{ return $this->setAttr('size', $aInputSize); }"
] |
[
"0.61343366",
"0.5926666",
"0.572879",
"0.56483924",
"0.5584998",
"0.55364543",
"0.55125904",
"0.55049276",
"0.5496704",
"0.54848504",
"0.5473969",
"0.5471248",
"0.54467785",
"0.54467785",
"0.54467785",
"0.54467785",
"0.5406066",
"0.5382048",
"0.5376508",
"0.5376176",
"0.53597367",
"0.53156894",
"0.52963877",
"0.5273568",
"0.52735525",
"0.52645516",
"0.5256774",
"0.5248532",
"0.52153933",
"0.52150506"
] |
0.65284944
|
0
|
Get a random word from the database
|
public function getRandomWord() {
$repo = $this->entityManager->getRepository('AppBundle:Word');
$totalWordsCount = $repo->createQueryBuilder('w')
->select('count(w.id)')
->getQuery()
->getSingleScalarResult();
$word = $repo->createQueryBuilder('word')
->setFirstResult(rand(0, $totalWordsCount - 1))
->setMaxResults(1)
->getQuery()
->getSingleResult();
return $word;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract public function lookupWordRandomly();",
"public function getRandomWord() {\n return $this->_index[array_rand($this->_index)];\n }",
"private function getRandomWord($len) {\n // OUT (String) : Una palabra de longitud aleatoria $len\n $rqtxt='SELECT word FROM words WHERE LENGTH(word)='.$len.' ORDER BY RANDOM() LIMIT 1';\n return $this->_db->querySingle($rqtxt);\n }",
"public function getOneSyl() {\n $table = \"eng-1-syl\";\n $sql = \"SELECT * FROM `$table`\";\n $stmt = $this->pdo->prepare($sql);\n $stmt->execute();\n $response = $stmt->fetchAll(PDO::FETCH_ASSOC);\n if ($response) {\n $numberRows = count($response);\n $random = $this->random($numberRows);\n $word = $response[$random][\"word\"];\n return $word;\n }\n else {\n echo \"something is broken\";\n }\n\n // select a random number from 0 to the highest numbered row\n // take that word and return it\n }",
"abstract public function getRandomKeyword();",
"public function pickOne()\n{\n\t$random = rand(0,$this->lengthOne);\n\t$word = $this->oneArray[$random];\n\treturn $word;\n}",
"function random_word($id = 20){\n\t\t$pool = '1234567890abcdefghijkmnpqrstuvwxyz';\n\t\t\n\t\t$word = '';\n\t\tfor ($i = 0; $i < $id; $i++){\n\t\t\t$word .= substr($pool, mt_rand(0, strlen($pool) -1), 1);\n\t\t}\n\t\treturn $word; \n\t}",
"function random_word($id = 20){\r\n\t\t$pool = '1234567890abcdefghijkmnpqrstuvwxyz';\r\n\r\n\t\t$word = '';\r\n\t\tfor ($i = 0; $i < $id; $i++){\r\n\t\t\t$word .= substr($pool, mt_rand(0, strlen($pool) -1), 1);\r\n\t\t}\r\n\t\treturn $word;\r\n\t}",
"private function retrieveRandomWord($url) {\n\t\t\t$response = Unirest\\Request::get($url,\n\t\t\tarray(\n\t\t\t\t\"X-Mashape-Key\" => \"xJkqXGguDTmshoNIaGVnrMZlFPmUp1WrnZLjsn8DDx3DFQhNq5\",\n\t\t\t\t\"Accept\" => \"application/json\"\n\t\t\t)\n\t\t);\n\t\t$wordJSON = json_decode($response->raw_body);\n\t\t$word = $wordJSON->{\"word\"};\n\n\t\t/*\n\t\t* The API provides some weird words (if you can even call them that) like \"dr. j\" which I don't think should be included.\n\t\t* If such a word is provided, the function instead calls itself recursively to get a new word.\n\t\t*/\n\n\t\tif (strpos($word,'.') !== false || strpos($word,' ') !== false) {\n\t\t\treturn retrieveRandomWord($url);\n\t\t} else {\n\t\t\treturn strtoupper($word);\n\t\t}\n\n\t\t/*Loose idea for discarding words with too low frequency. API seems to be broken however,\n\t\t* sometimes the frequency parameter doesn't exist, unsure of the cause (nothing stated in docs).\n\t\t*\n\t\t*\n\t\t* $freq = $wordJSON->{\"frequency\"};\n\t\t* if ($freq > 3.5) return $wordJSON->{\"word\"};\n\t\t* else return retrieveRandomWord($url);\n\t\t*/\n\t}",
"public function get_randomword( $list = null ) {\n\t\t$words = array_map( 'trim', explode( '|', $list ) );\n\t\t$max = count( $words );\n\t\tif ( ! $max ) {\n\t\t\treturn '';\n\t\t} elseif ( 1 === $max ) {\n\t\t\treturn $words[0];\n\t\t}\n\n\t\t$queried_id = (int) get_queried_object_id();\n\t\t$hash = (int) crc32( serialize( $words ) . $queried_id );\n\t\tmt_srand( $hash );\n\t\t$rand = mt_rand( 0, $max - 1 );\n\n\t\treturn $words[ $rand ];\n\t}",
"function get_random_word($min_length, $max_length)\n// grab a random word from dictionary between the two lengths// and return it\n{\n $word = \"\";\n // remember to change this path to suit your system\n $dictionary = '/usr/dict/words';\n // the ispell dictionary\n $fp = @fopen($dictionary, 'r');\n if (!$fp)\n return false;\n $size = filesize($dictionary);\n // go to a random location in dictionary\n srand((float) microtime() * 1000000);\n $rand_location = rand(0, $size);\n fseek($fp, $rand_location);\n // get the next whole word of the right length in the file\n while (strlen($word) < $min_length || strlen($word) > $max_length || strstr($word, \"'\")) {\n if (feof($fp))\n fseek($fp, 0);\n // if at end, go to start\n $word = fgets($fp, 80);\n // skip first word as it could be partial\n $word = fgets($fp, 80);\n // the potential password\n };\n $word = trim($word);\n // trim the trailing \\n from fgets\n return $word;\n}",
"function DictionaryWhatMeans(){\n\t\n\tglobal $db_dictionary;\n\tglobal $eden_cfg;\n\t\n\t$res = mysql_query(\"SELECT dictionary_id FROM $db_dictionary WHERE dictionary_parent_id=0 AND dictionary_allow=1\") or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$words = Array();\n\twhile ($ar = mysql_fetch_array($res)){\n\t\t$words[] .= $ar['dictionary_id'];\n\t}\n\t$num = count($words) - 1; // -1 je prevence proti zobrazeni cisla minus rozsah pole\n\t$random_num = rand (0,$num);\n\t$random_word = $words[$random_num];\n\t$res_word = mysql_query(\"SELECT dictionary_word, dictionary_word_description FROM $db_dictionary WHERE dictionary_id=\".(integer)$random_word) or die (\"<strong>File:</strong> \".__FILE__.\"<br /><strong>Line:</strong>\".__LINE__.\"<br />\".mysql_error());\n\t$ar_word = mysql_fetch_array($res_word);\n\techo \"<span class=\\\"h2\\\">\".$ar_word['dictionary_word'].\"</span><br>\".$ar_word['dictionary_word_description'];\n}",
"function generateRandomWords($WordCounter = 3)\n{\n\tglobal $words;\n\t$string = \"\";\n\t$total_adj_num = count($words[\"adjectives\"]) - 1;\n\t$total_noun_num = count($words[\"nouns\"]) - 1;\n\tfor($i = 1; $i < $WordCounter; $i++)\n\t\t$string .= ucfirst( $words[\"adjectives\"][rand(0, $total_adj_num)] );\n\t$string .= ucfirst( $words[\"nouns\"][rand(0, $total_noun_num)] );\n\treturn $string;\n}",
"public static function random_positive_word(){\n $temp_text_options = array('Awesome!', 'Nice!', 'Fantastic!', 'Yeah!', 'Yay!', 'Yes!', 'Great!', 'Super!', 'Rock on!', 'Amazing!', 'Fabulous!', 'Wild!', 'Sweet!', 'Wow!', 'Oh my!', 'Excellent!', 'Wonderful!');\n $temp_text = $temp_text_options[array_rand($temp_text_options)];\n return $temp_text;\n }",
"function random_text()\n{\n\tstatic $words=array('fish','cheese','soup','tomato','alphabet','whatever','cannot','be','bothered','to','type','many','more','will','be','here','all','day');\n\tstatic $word_count=NULL;\n\tif (is_null($word_count)) $word_count=count($words);\n\n\t$out='';\n\tfor ($i=0;$i<30;$i++)\n\t{\n\t\tif ($i!=0) $out.=' ';\n\t\t$out.=$words[mt_rand(0,$word_count-1)];\n\t}\n\treturn $out;\n}",
"private function getRandomSayText()\n {\n $texts = [\n 'They see me rollin\\'',\n '*whistle*',\n 'I\\'m walking on sunshine',\n ];\n $rand = mt_rand(0, count($texts) - 1);\n\n return $texts[$rand];\n }",
"function get_random_word($min_length, $max_length) {\n// and return it\n\n // generate a random word\n $word = '';\n // remember to change this path to suit your system\n $dictionary = '/usr/dict/words'; // the ispell dictionary\n $fp = @fopen($dictionary, 'r');\n if(!$fp) {\n return false;\n }\n $size = filesize($dictionary);\n\n // go to a random location in dictionary\n $rand_location = rand(0, $size);\n fseek($fp, $rand_location);\n\n // get the next whole word of the right length in the file\n while ((strlen($word) < $min_length) || (strlen($word)>$max_length) || (strstr($word, \"'\"))) {\n if (feof($fp)) {\n fseek($fp, 0); // if at end, go to start\n }\n $word = fgets($fp, 80); // skip first word as it could be partial\n $word = fgets($fp, 80); // the potential password\n }\n $word = trim($word); // trim the trailing \\n from fgets\n return $word;\n}",
"function GenerateWord()\n{\n $nb=rand(3,10);\n $w='';\n for($i=1;$i<=$nb;$i++)\n $w.=chr(rand(ord('a'),ord('z')));\n return $w;\n}",
"public function getRandom() {\n\t\t$quote = $this->get('random', array('limit'=>1));\n\t\treturn $quote[0];\n\t}",
"function GenerateWord() {\n $nb = rand(3, 10);\n $w = '';\n for ($i = 1; $i <= $nb; $i++)\n $w .= chr(rand(ord('a'), ord('z')));\n return $w;\n }",
"function ozh_wbsu_get_random_word_from_file($file_to_read) {\n static $num_of_lines = array();\n\n $file = new \\SplFileObject($file_to_read, 'r');\n\n // if we haven't already counted the number of lines, count them\n if (!isset($num_of_lines[$file_to_read])) {\n $num_of_lines[$file_to_read] = ozh_wbsu_get_number_of_lines($file_to_read);\n }\n $file->seek( mt_rand(0,$num_of_lines[$file_to_read]) );\n\n return (trim($file->fgets()));\n}",
"protected function nextWord() {\n\t\t$this->word = strtolower($this->puzzleList[array_rand($this->puzzleList)]);\n\t\t$this->guesses = [];\n\t\t$this->roundNum ++;\n\n\t\techo(\"New word: {$this->word}\\n\");\n\t\t$this->sendResults();\n\t}",
"function randomWord() {\n $wordsArrShort = ['Black', 'white', 'green', 'blue'];\n $wordsArrLong = ['alliance', 'accident', 'building', 'calendar'];\n $wordOne = ucwords($wordsArrShort[rand ( 0 , count($wordsArrShort)-1 )]);\n $wordTwo = ucwords($wordsArrLong[rand ( 0 , count($wordsArrLong)-1 )]);\n\n echo('<form method=\"get\" action=\"exercises.php\">' \n . '<input type=\"submit\" name=\"submit\" value=\"generate\"/>' \n . '</form>'\n . '<p>' . $wordOne . ' ' . $wordTwo . '</p>');\n }",
"function randomWord( $minLength = 5, $maxLength = 10) {\n\t\treturn ucfirst( random_pronounceable_word( rand( $minLength, $maxLength ) ) );\n\t}",
"function random_big_word($phrase)\n{\n $phrase = preg_replace(\"/[()\\[\\]0-9.,]/\", \"\", $phrase);\n $words = explode(\" \", $phrase);\n# print \"<p>words: \"; foreach ($words as $word) { print \"'$word';\"; }\n $lesswords = array_filter($words, \"interesting_word\");\n# print \"<p>lesswords: \"; foreach ($lesswords as $word) { print \"'$word';\"; }\n if (count($lesswords)<1) {\n return '';\n }\n return $lesswords[array_rand($lesswords)];\n}",
"public static function random_negative_word(){\n $temp_text_options = array('Yikes!', 'Oh no!', 'Ouch...', 'Awwwww...', 'Bummer...', 'Boooo...', 'Harsh!', 'Sorry...');\n $temp_text = $temp_text_options[array_rand($temp_text_options)];\n return $temp_text;\n }",
"public function generate_challenge() {\n\t\t// Load words from the current language and randomize them\n\t\t$words = Eight::lang('captcha.words');\n\t\tshuffle($words);\n\n\t\t// Loop over each word...\n\t\tforeach($words as $word) {\n\t\t\t// ...until we find one of the desired length\n\t\t\tif(abs(Captcha::$config['complexity'] - strlen($word)) < 2)\n\t\t\t\treturn strtoupper($word);\n\t\t}\n\n\t\t// Return any random word as final fallback\n\t\treturn strtoupper($words[array_rand($words)]);\n\t}",
"public function testWordFlipRandomWord()\n {\n $service = new WordService();\n\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $string = $stringFlipped = '';\n for ($i = 0; $i < 10; $i++) {\n $char = $characters[rand(0, strlen($characters)-1)];\n $string = $string.$char;\n $stringFlipped = $char.$stringFlipped;\n }\n\n $this->assertEquals($stringFlipped, $service->wordFlip($string));\n }",
"function do_test_get_word($testsql)\n{\n $pass = 0;\n while ($pass < 2) {\n $pass++;\n $sql = \"SELECT DISTINCT WoID, WoText, WoTextLC, WoTranslation, \n WoRomanization, WoSentence, WoLgID, \n (IFNULL(WoSentence, '') NOT LIKE CONCAT('%{', WoText, '}%')) AS notvalid, \n WoStatus, \n DATEDIFF( NOW( ), WoStatusChanged ) AS Days, WoTodayScore AS Score \n FROM $testsql AND WoStatus BETWEEN 1 AND 5 \n AND WoTranslation != '' AND WoTranslation != '*' AND WoTodayScore < 0 \" . \n ($pass == 1 ? 'AND WoRandom > RAND()' : '') . ' \n ORDER BY WoTodayScore, WoRandom \n LIMIT 1';\n $res = do_mysqli_query($sql);\n $record = mysqli_fetch_assoc($res);\n if ($record) {\n return $record;\n }\n mysqli_free_result($res);\n }\n return array();\n}",
"function rand_blade(){\n\t\t$list = array ('blade', 'broadsword', 'claymore', 'dao', 'gladius', 'katana', 'longsword', 'odachi', 'rapier', 'sabre', 'shortsword', 'sword', 'wakazashi');\n\t\t$i = count($list);\n\t\treturn $list[mt_rand(0,$i-1)];\n\t}"
] |
[
"0.8060048",
"0.79971105",
"0.7235489",
"0.72351134",
"0.71338564",
"0.7077444",
"0.70064247",
"0.69411427",
"0.6922362",
"0.6857586",
"0.6733013",
"0.6629746",
"0.6612883",
"0.65922606",
"0.6581309",
"0.6580472",
"0.65511256",
"0.65346134",
"0.65279925",
"0.65213895",
"0.650462",
"0.6471006",
"0.64325935",
"0.6384754",
"0.6374681",
"0.6366945",
"0.6363005",
"0.6359742",
"0.63347036",
"0.6254674"
] |
0.81763005
|
0
|
Create word context from a word
|
public function getWordContext() {
$word = $this->getRandomWord();
return new WordContext($word);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function build($word, $content);",
"public function makeWord()\n {\n return $this->setDocumentPropertiesWithMetas(new PhpWord());\n }",
"public function wordEngine(){\n $getSomeWords = $this->getSomeWords();\n if(!$getSomeWords['status']){\n return $getSomeWords;\n }\n $words = $getSomeWords['body'];\n $result = $this->matrixMaker($words);\n $matrix = $result['matrix'];\n $info = $result['info'];\n return ['status'=>1, 'words'=>$words, 'matrix'=>$matrix, 'info'=>$info];\n }",
"public function createWithAttrsOf(string $name) {\r\n return $this->word->createWithAttrsOf($name);\r\n }",
"public static function factory(string $role, string $text): Word\n {\n $instance = new static();\n $instance->role = $role;\n $instance->text = $text;\n\n return $instance;\n }",
"public function create(array $data) {\r\n return $this->word->create($data);\r\n }",
"function ctools_plugin_example_context_create_simplecontext($empty, $data = NULL, $conf = FALSE) {\n $context = new ctools_context('simplecontext');\n $context->plugin = 'simplecontext';\n\n if ($empty) {\n return $context;\n }\n\n if ($conf) {\n if (!empty($data)) {\n $context->data = new stdClass();\n // For this simple item we'll just create our data by stripping non-alpha and\n // adding '_from_configuration_item_1' to it.\n $context->data->item1 = t(\"Item1\");\n $context->data->item2 = t(\"Item2\");\n $context->data->description = preg_replace('/[^a-z]/i', '', $data['sample_simplecontext_setting']);\n $context->data->description .= '_from_configuration_sample_simplecontext_setting';\n $context->title = t(\"Simplecontext context from config\");\n return $context;\n }\n }\n else {\n // $data is coming from an arg - it's just a string.\n // This is used for keyword.\n $context->title = $data;\n $context->argument = $data;\n // Make up a bogus context\n $context->data = new stdClass();\n $context->data->item1 = t(\"Item1\");\n $context->data->item2 = t(\"Item2\");\n\n // For this simple item we'll just create our data by stripping non-alpha and\n // adding '_from_simplecontext_argument' to it.\n $context->data->description = preg_replace('/[^a-z]/i', '', $data);\n $context->data->description .= '_from_simplecontext_argument';\n $context->arg_length = strlen($context->argument);\n return $context;\n }\n}",
"public function createWordsForExam()\n {\n $words = $this->words()->get()->toArray();\n return $this->rearrangeWords($words);\n }",
"public function executeNewWord(sfWebRequest $request) {\n \t$word = new sfWordnikWord();\n \t// NOTE -- changed this from `getGetParameter` to `getParameter.` (andyinabox - 2010-05-20)\n \t$word->populate(Wordnik::getWordObject($request->getParameter(\"word\")));\n// \t$word->name = $request->getGetParameter(\"word\");\n// \t$word->Definitions[]->text = \"To see if something works.\";\n// \t$word->Examples[]->text = \"Let's test this motor, see if it works.'\";\n// \t$word->RelatedWords[]->text = \"try\";\n\t$word->save();\n $this->success = \"Awesome.\";\n }",
"public function words()\n {\n return self::create('',$this->provider->words()); \n }",
"public function getContextDefinition();",
"private function MakeContext(&$mod, $context, &$db, $pref)\n\t{\n\t\t$cid = $db->GenID($pref.'module_auth_contexts_seq');\n\t\tif (is_numeric($context)) {\n\t\t\t$name = 'Import_data('.$context.')'; //no translation\n\t\t} else {\n\t\t\t$name = $context;\n\t\t}\n\t\t$t = preg_replace(['/\\s+/', '/__+/'], ['_', '_'], $name);\n\t\tif (extension_loaded('mbstring')) {\n\t\t\t$t = mb_convert_case($t, MB_CASE_LOWER, 'UTF-8');\n\t\t} else {\n\t\t\t$t = strtolower($t);\n\t\t}\n\t\t$alias = substr($t, 0, 16);\n\n\t\t$cfuncs = new Crypter($mod);\n\t\t$t = $cfuncs->decrypt_preference('default_password');\n\t\t$hash = $cfuncs->encrypt_value($t);\n\n\t\t$sql = 'INSERT INTO '.$pref.'module_auth_contexts (id,name,alias,default_password) VALUES (?,?,?,?)';\n\t\t$db->Execute($sql, [$cid, $name, $alias, $hash]);\n\t\treturn $cid;\n\t}",
"function parse_content($words, $dom) //n words //m 4 letter words\n {\n $fourLetterArray = preg_grep(\"/\\b\\w{4}\\b/\", $words);\n \n foreach($words as $word)\n {\n if (array_search($word, $fourLetterArray))\n {\n $node = $dom->createElement(\"example\", \"**** \");\n }\n else \n {\n $node = $dom->createElement(\"example\", $word . ' ');\n }\n\n $sentence[] = $node;\n }\n return $sentence;\n }",
"public function extract($word)\n {\n // TODO: Implement extract() method.\n }",
"protected function _generateWord()\n {\n $word = '';\n $wordLen = $this->getWordlen();\n $vowels = $this->_useNumbers ? self::$VN : self::$V;\n $consonants = $this->_useNumbers ? self::$CN : self::$C;\n\n $totIndexCon = count($consonants) - 1;\n $totIndexVow = count($vowels) - 1;\n for ($i=0; $i < $wordLen; $i = $i + 2) {\n // generate word with mix of vowels and consonants\n $consonant = $consonants[Zend_Crypt_Math::randInteger(0, $totIndexCon, true)];\n $vowel = $vowels[Zend_Crypt_Math::randInteger(0, $totIndexVow, true)];\n $word .= $consonant . $vowel;\n }\n\n if (strlen($word) > $wordLen) {\n $word = substr($word, 0, $wordLen);\n }\n\n return $word;\n }",
"protected function manageWord($word, $index) {\n // normalize\n $word = mb_strtolower($word, $this->encoding);\n \n $termObj = new Term($word);\n\n // save the term\n if(!$this->uniqueMatchesStatus[$word]) {\n $termObj->save();\n $this->uniqueMatchesStatus[$word] = TRUE;\n }\n \n // add to term list\n if ($this->termsList->contains($termObj)) {\n // just add new occurrence\n $this->invertedIndex->addOccurrence($this->invertedIndex->getInvertedIndex($termObj, $this), $index);\n } else {\n $this->termsList->push($termObj);\n\n // save term-doc relation (inverted index) and position of occurrance\n $this->invertedIndex->addRelation($termObj, $this, $index);\n }\n }",
"public function WordCollection()\n {\n $myWords = parent::WordCollection();\n\n if(!$myWords->loadedFromFile())\n {\n // English Words\n $myWords->addText(\"en-us\", \"TITLE\", \"Module Login\");\n\n // Portuguese Words\n $myWords->addText(\"pt-br\", \"TITLE\", \"Módulo de Login\");\n }\n\n return $myWords;\n }",
"public function of($word)\n\t{\n\t\t$this->word = $word;\n\n\t\treturn $this;\n\t}",
"public function createAction(Request $request)\n {\n $entity = new Word();\n $form = $this->createForm(new WordType($this->get('security.context')), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n if (strlen($this->container->parameters['startupdict_from_email']) && \n strlen($this->container->parameters['startupdict_to_email'])) {\n $message = \\Swift_Message::newInstance()\n ->setSubject('Startup Dict. - New word to validate')\n ->setFrom($this->container->parameters['startupdict_from_email'])\n ->setTo($this->container->parameters['startupdict_to_email'])\n ->setBody(\n $this->renderView(\n 'InfuseDictionaryBundle:Emails:new.txt.twig',\n array('entity' => $entity)\n )\n )\n ;\n $this->get('mailer')->send($message);\n }\n\n $this->get('session')->getFlashBag()->add('success', 'Your word has been saved. We will review it soon as posisble. Thanks.');\n\n return $this->redirect($this->generateUrl('word_show', array('slug' => $entity->getSlug())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function generate()\r\n {\r\n if(is_null($this->dictionary_file)){\r\n throw new Exception('DictionaryFileAlgorithm: dictionary not configured');\r\n }\r\n if(!$this->dictionary_size){\r\n throw new Exception('DictionaryFileAlgorithm: dictionary is empty');\r\n }\r\n // get a random word from the dictionary\r\n $dictionary_entry=$this->keygen->getRandomNumber(0,$this->dictionary_size-1);\r\n $dictionary_word=self::findDictionaryEntry($this->dictionary_file,$dictionary_entry);\r\n // possibly apply casing to the selected word\r\n if($this->casing_options_count>1){\r\n $casing_method_index=$this->keygen->getRandomNumber(1,$this->casing_options_count);\r\n }else{\r\n $casing_method_index=1;\r\n }\r\n // set option_mask to the highest available option bit\r\n $option_mask=(self::CASING_ALL+1)/2;\r\n $i=1;\r\n $casing_method=0;\r\n // for each casing option (starting from the highest number)\r\n do{\r\n // check if the option is set\r\n if($option_mask & $this->casing_options){\r\n // and if it is set, check if it matches our random method\r\n if($i==$casing_method_index){\r\n // this is the one\r\n $casing_method=$option_mask;\r\n break;\r\n }else{\r\n // not this one, but we continue checking for the next\r\n $i++;\r\n }\r\n }\r\n }while($option_mask = $option_mask >> 1);\r\n // apply casing\r\n switch($casing_method){\r\n case self::CASING_LOWER:\r\n $dictionary_word=strtolower($dictionary_word);\r\n break;\r\n case self::CASING_UPPER:\r\n $dictionary_word=strtoupper($dictionary_word);\r\n break;\r\n case self::CASING_FIRST:\r\n $dictionary_word=ucfirst($dictionary_word);\r\n break;\r\n default:\r\n // should not be possible\r\n trigger_error('DictionaryFileAlgorithm: unknown casing method: '.$casing_method, E_USER_NOTICE);\r\n break;\r\n }\r\n // done, return the word with casing applied\r\n return $dictionary_word;\r\n }",
"private function lookup($word) {\n\n $query = $this->dm->getRepository('\\FYP\\Database\\Documents\\Lexicon');\n $result = $query->findOneBy(array('phrase' => $word));\n if (empty($result)) {\n $result = $query->findOneBy(array('phrase' => strtolower($word)));\n }\n\n if (empty($result)) {\n return self::DEFAULT_TAG;\n } else {\n return $result->getTags()[0];\n }\n\n }",
"function clade_context_create_clade($empty, $data = NULL, $conf = FALSE) {\n $context = new ctools_context('clade');\n $context->plugin = 'clade';\n if ($empty) {\n return $context;\n }\n \n if ($conf) {\n \t$tid = is_array($data) && isset($data['tid']) ? $data['tid'] : (is_object($data) ? $data->tid : 0);\n \t$data = clade_load($tid);\n\t}\n\t\n\tif (! empty($data)) {\n\t\t$context->data = $data;\n\t\t$context->title = $data->name;\n\t\t$context->argument = $data->tid;\n\t\t\n\t\treturn $context;\n\t}\n}",
"function yourls_translate_with_context( $text, $context, $domain = 'default' ) {\n\t$translations = yourls_get_translations_for_domain( $domain );\n\treturn yourls_apply_filter( 'translate_with_context', $translations->translate( $text, $context ), $text, $context, $domain );\n}",
"abstract public function lookupWord($word);",
"public function __construct($text) {\n\t\t$this->map = $this->returnWords($text);\n\t}",
"public function addWord(Word $word)\n\t{\n\t\tif(!isset($this->words[$word->getText()])){\n\t\t\t$this->words[$word->getText()] = $word;\n\t\t}else{\n\t\t\tforeach($word->getOccurrences() as $file => $lines){\n\t\t\t\tforeach($lines as $line){\n\t\t\t\t\t$this->words[$word->getText()]->addOccurrence($file, $line);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"public function newAction()\n {\n $entity = new Word();\n $form = $this->createForm(new WordType($this->get('security.context')), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"function createVector(&$docVector, &$word){\r\n if(isset($docVector[$word]) == false){\r\n $docVector[$word] = 1;\r\n }\r\n $docVector[$word] = $docVector[$word]+1;\r\n}",
"public function getContextString() {}",
"public static function getWord($name, $default = '', $hash = 'default')\n {\n return static::getVar($name, $default, $hash, 'word');\n }"
] |
[
"0.65369385",
"0.6024026",
"0.5694382",
"0.5626091",
"0.56071997",
"0.5542339",
"0.54244864",
"0.5405416",
"0.5341798",
"0.53271765",
"0.53068537",
"0.524932",
"0.51935124",
"0.51429945",
"0.50112563",
"0.5004709",
"0.49719578",
"0.49671337",
"0.49575907",
"0.4946808",
"0.489357",
"0.4893397",
"0.48928803",
"0.48855478",
"0.4884427",
"0.48583984",
"0.4851023",
"0.48306337",
"0.481744",
"0.48025912"
] |
0.7225079
|
0
|
Getter function for barcode
|
public function getBarcode()
{
return $this->barcode;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract protected function getTCPDFBarcode();",
"abstract public function barcode($data, $format);",
"public function getCode() {}",
"public function getAvecCodeBarre() {\n return $this->avecCodeBarre;\n }",
"public function getCode()\n {\n }",
"public function getBarCode()\n {\n return $this->bar_code;\n }",
"public function getCode();",
"public function getCode();",
"public function getCode();",
"public function getCode();",
"public function getCode();",
"public function getCode();",
"public function getCode(): string;",
"public function getCode(): string;",
"public function getCode(): string;",
"final function getCode();",
"public function getBarcode($code)\n\t{\n\t\tswitch ($this->format) {\n\t\t\tcase self::FORMAT_JPG:\n\t\t\tcase self::FORMAT_PNG:\n\t\t\t\treturn 'data:image/' . $this->format . ';base64,' . base64_encode($this->getContent($code));\n\t\t\tcase self::FORMAT_SVG:\n\t\t\t\treturn 'data:image/svg+xml;base64,' . base64_encode($this->getContent($code));\n\t\t\tcase self::FORMAT_HTML:\n\t\t\t\treturn $this->getContent($code);\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Unknown barcode format!');\n\t\t}\n\t}",
"public function getCode():string;",
"public function qrCode(){\n }",
"public function getCode() {\n return @$this->attributes['code'];\n }",
"function read_barcode( $package_dir )\n{\n\tglobal $build_crc;\n\n\t//echo \"<b>package dir: $package_dir</b><br>\";\n\n\t$package_name = strrchr( $package_dir, '/' );\n\t//echo \"<b>package name: $package_name</b><br>\";\n\n\t//echo \"<b>build crc: $build_crc</b><br>\";\n\n\t$str_from_build_crc = strstr( $package_name, $build_crc);\n\t//echo \"<b>str from build CRC: $str_from_build_crc</b><br>\";\n\n\t// get length of build crc to get the position of the barcode\n\t$len_build_crc = strlen($build_crc);\n\n\t// string form the barcode\n\t$barcode_str = substr( $str_from_build_crc, $len_build_crc + 1);\n\t//echo \"<b>str from barcode: $barcode_str</b><br>\";\n\n\t// get the dash position between barcode and date_time\n\t$dash_pos = strpos( $barcode_str, '-' );\n\n\t// get barcode string\n\t$barcode = substr( $barcode_str, 0, $dash_pos);\n\n\treturn $barcode;\n}",
"public function GetCodBarra()\n\t{\n\t\treturn $this->codBarra;\n\t}",
"final public function getImage() {\n\t\t\tif(strlen($this->text) === 0)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t$data = $this->getTCPDFBarcode()->getBarcodeArray();\n\t\t\tif($data === false)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\t$image = new Image($data['maxw'], $data['maxh']);\n\t\t\t\n\t\t\t$x = 0;\n\t\t\tforeach($data['bcode'] as $bar) {\n\t\t\t\tfor($i = 0; $i < $bar['w']; ++$i) {\n\t\t\t\t\tfor($y = 0; $y < $bar['h']; ++$y)\n\t\t\t\t\t\t$image->setPixel($x + $i, $bar['p'] + $y, (int)$bar['t']);\n\t\t\t\t}\n\t\t\t\t$x += $bar['w'];\n\t\t\t}\n\t\t\t\n\t\t\treturn $image;\n\t\t}",
"public function getCode() : int;",
"public function getCode() {return $this->code;}",
"function getCode()\n {\n return $this->code;\n }",
"function getCode()\r\n {\r\n return $this->code;\r\n }",
"public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}",
"function validate(){\n\t\treturn true; //use this to bypass barcode validation\n\n\t\t$value = preg_match($this->REGEX, $this->code);\n\t\tif($value != 1)\n\t\t{\n\t\t\t$this->error = 'The barcode <strong>'.$this->code.'</strong> is not valid';\n\t\t}\n\n\t\treturn $value;\n\t}",
"public function getCode(): int;"
] |
[
"0.7933652",
"0.6651591",
"0.6592039",
"0.6567145",
"0.6550147",
"0.65116465",
"0.6495421",
"0.6495421",
"0.6495421",
"0.6495421",
"0.6495421",
"0.6495421",
"0.6428926",
"0.6428926",
"0.6428926",
"0.63946706",
"0.6373898",
"0.63335544",
"0.62849385",
"0.62428",
"0.62296486",
"0.6192464",
"0.61804575",
"0.61571455",
"0.6096534",
"0.608553",
"0.6084909",
"0.60838264",
"0.607602",
"0.6045067"
] |
0.79311895
|
1
|
Setter function for barcode
|
public function setBarcode($barcode)
{
$this->barcode = $barcode;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract protected function getTCPDFBarcode();",
"protected function addBarcode()\n\t{\n\t\t$posX = 92;\n\t\t$posY = 43;\n\t\t$image = Zend_Pdf_Image::imageWithPath($this->barcode->getBarcodeImage());\n\t\t\t\n\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t$this->_getPdf()->pages[$i]->drawImage($image, $posX, $posY, $image->getPixelWidth() + $posX, $image->getPixelHeight() + $posY);\n\t\t}\n\t\t$this->setNumbersFont(7);\n\t\t\n\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t$this->_getPdf()->pages[$i]->drawText(str_pad($this->barcode->getBarcodeValue(), 39, \"*\", STR_PAD_LEFT), $posX, $posY, 'UTF-8');\n\t\t}\n\t}",
"abstract public function barcode($data, $format);",
"public function getBarcode()\n\t{\n\t\treturn $this->barcode;\n\t}",
"function EAN13($x, $y, $barcode, $h=16, $w=.35)\n{\n $this->Barcode($x,$y,$barcode,$h,$w,13);\n}",
"function Code39($x, $y, $code, $ext = true, $cks = false, $w = 0.4, $h = 20, $wide = true) {\n\n //Display code\n $this->SetFont('Arial', '', 10);\n $this->Text($x, $y+$h+4, $code);\n\n if($ext) {\n //Extended encoding\n $code = $this->encode_code39_ext($code);\n }\n else {\n //Convert to upper case\n $code = strtoupper($code);\n //Check validity\n if(!preg_match('|^[0-9A-Z. $/+%-]*$|', $code))\n $this->Error('Invalid barcode value: '.$code);\n }\n\n //Compute checksum\n if ($cks)\n $code .= $this->checksum_code39($code);\n\n //Add start and stop characters\n $code = '*'.$code.'*';\n\n //Conversion tables\n $narrow_encoding = array (\n '0' => '101001101101', '1' => '110100101011', '2' => '101100101011', \n '3' => '110110010101', '4' => '101001101011', '5' => '110100110101', \n '6' => '101100110101', '7' => '101001011011', '8' => '110100101101', \n '9' => '101100101101', 'A' => '110101001011', 'B' => '101101001011', \n 'C' => '110110100101', 'D' => '101011001011', 'E' => '110101100101', \n 'F' => '101101100101', 'G' => '101010011011', 'H' => '110101001101', \n 'I' => '101101001101', 'J' => '101011001101', 'K' => '110101010011', \n 'L' => '101101010011', 'M' => '110110101001', 'N' => '101011010011', \n 'O' => '110101101001', 'P' => '101101101001', 'Q' => '101010110011', \n 'R' => '110101011001', 'S' => '101101011001', 'T' => '101011011001', \n 'U' => '110010101011', 'V' => '100110101011', 'W' => '110011010101', \n 'X' => '100101101011', 'Y' => '110010110101', 'Z' => '100110110101', \n '-' => '100101011011', '.' => '110010101101', ' ' => '100110101101', \n '*' => '100101101101', '$' => '100100100101', '/' => '100100101001', \n '+' => '100101001001', '%' => '101001001001' );\n\n $wide_encoding = array (\n '0' => '101000111011101', '1' => '111010001010111', '2' => '101110001010111', \n '3' => '111011100010101', '4' => '101000111010111', '5' => '111010001110101', \n '6' => '101110001110101', '7' => '101000101110111', '8' => '111010001011101', \n '9' => '101110001011101', 'A' => '111010100010111', 'B' => '101110100010111', \n 'C' => '111011101000101', 'D' => '101011100010111', 'E' => '111010111000101', \n 'F' => '101110111000101', 'G' => '101010001110111', 'H' => '111010100011101', \n 'I' => '101110100011101', 'J' => '101011100011101', 'K' => '111010101000111', \n 'L' => '101110101000111', 'M' => '111011101010001', 'N' => '101011101000111', \n 'O' => '111010111010001', 'P' => '101110111010001', 'Q' => '101010111000111', \n 'R' => '111010101110001', 'S' => '101110101110001', 'T' => '101011101110001', \n 'U' => '111000101010111', 'V' => '100011101010111', 'W' => '111000111010101', \n 'X' => '100010111010111', 'Y' => '111000101110101', 'Z' => '100011101110101', \n '-' => '100010101110111', '.' => '111000101011101', ' ' => '100011101011101', \n '*' => '100010111011101', '$' => '100010001000101', '/' => '100010001010001', \n '+' => '100010100010001', '%' => '101000100010001');\n\n $encoding = $wide ? $wide_encoding : $narrow_encoding;\n\n //Inter-character spacing\n $gap = ($w > 0.29) ? '00' : '0';\n\n //Convert to bars\n $encode = '';\n for ($i = 0; $i< strlen($code); $i++)\n $encode .= $encoding[$code[$i]].$gap;\n\n //Draw bars\n $this->draw_code39($encode, $x, $y, $w, $h);\n}",
"private function createBarcode()\n {\n $barcodeOptions = [\n 'text' => $this->barcodeValue,\n 'factor' => '1',\n 'drawText' => $this->barcodeSettings->includeNumber($this->storeId),\n 'backgroundColor' => $this->barcodeSettings->getBackgroundColor($this->storeId),\n 'foreColor' => $this->barcodeSettings->getFontColor($this->storeId),\n ];\n\n $type = $this->barcodeSettings->getType($this->storeId);\n // @codingStandardsIgnoreLine\n $imageResource = ZendBarcode::draw($type, 'image', $barcodeOptions, []);\n // @codingStandardsIgnoreLine\n imagejpeg($imageResource, $this->fileName, 100);\n // @codingStandardsIgnoreLine\n imagedestroy($imageResource);\n }",
"function bikin_barcode2($kode)\n\t{\n\t\t$this->zend->load('Zend/Barcode');\t\t\t\n\t\t//generate barcodenya\t\t\n\t\t$option = array('text'=>$kode,\n\t\t\t\t'barHeight'=>17,\n\t\t\t\t'factor'=>1.50,\n\t\t\t\t'fontSize'=>7,\n\t\t\t\t'withQuietZones' => true,\n\t\t\t\t'drawText'=>false,//show code\n\t\t\t\t'stretchText'=>false//memisahkan kode perbaris\t\n\t\n\t\t);\n\t\tZend_Barcode::render('code128', 'image', $option, array());\n\t}",
"function bikin_barcode1($kode)\n\t{\n\t\t$this->zend->load('Zend/Barcode');\t\t\t\n\t\t//generate barcodenya\t\t\n\t\t$option = array('text'=>$kode,\n\t\t\t\t'barHeight'=>20,\n\t\t\t\t'factor'=>2.35,\n\t\t\t\t'fontSize'=>8,\n\t\t\t\t'withQuietZones' => true,\n\t\t\t\t'drawText'=>false,//show code\n\t\t\t\t'stretchText'=>false//memisahkan kode perbaris\n\t\t\t\t\n\t\n\t\t);\n\t\tZend_Barcode::render('code128', 'image', $option, array());\n\t}",
"public function testSetBarcodeWidthDefault()\n {\n $this -> printer -> setBarcodeWidth();\n $this -> checkOutput(\"\\x1b@\\x1dw\\x03\");\n }",
"function Barcode39 ($barcode, $width, $height, $quality, $format, $text)\n{\n switch ($format)\n {\n default:\n $format = \"JPEG\";\n case \"JPEG\": \n header (\"Content-type: image/jpeg\");\n break;\n case \"PNG\":\n header (\"Content-type: image/png\");\n break;\n case \"GIF\":\n header (\"Content-type: image/gif\");\n break;\n }\n\n\n $im = ImageCreate ($width, $height)\n or die (\"Cannot Initialize new GD image stream\");\n $White = ImageColorAllocate ($im, 255, 255, 255);\n $Black = ImageColorAllocate ($im, 0, 0, 0);\n //ImageColorTransparent ($im, $White);\n ImageInterLace ($im, 1);\n\n\n\n $NarrowRatio = 20;\n $WideRatio = 55;\n $QuietRatio = 35;\n\n\n $nChars = (strlen($barcode)+2) * ((6 * $NarrowRatio) + (3 * $WideRatio) + ($QuietRatio));\n $Pixels = $width / $nChars;\n $NarrowBar = (int)(20 * $Pixels);\n $WideBar = (int)(55 * $Pixels);\n $QuietBar = (int)(35 * $Pixels);\n\n\n $ActualWidth = (($NarrowBar * 6) + ($WideBar*3) + $QuietBar) * (strlen ($barcode)+2);\n \n if (($NarrowBar == 0) || ($NarrowBar == $WideBar) || ($NarrowBar == $QuietBar) || ($WideBar == 0) || ($WideBar == $QuietBar) || ($QuietBar == 0))\n {\n ImageString ($im, 1, 0, 0, \"Image is too small!\", $Black);\n OutputImage ($im, $format, $quality);\n exit;\n }\n \n $CurrentBarX = (int)(($width - $ActualWidth) / 2);\n $Color = $White;\n $BarcodeFull = \"*\".strtoupper ($barcode).\"*\";\n settype ($BarcodeFull, \"string\");\n \n $FontNum = 3;\n $FontHeight = ImageFontHeight ($FontNum);\n $FontWidth = ImageFontWidth ($FontNum);\n if ($text != 0)\n {\n $CenterLoc = (int)(($width-1) / 2) - (int)(($FontWidth * strlen($BarcodeFull)) / 2);\n ImageString ($im, $FontNum, $CenterLoc, $height-$FontHeight, \"$BarcodeFull\", $Black);\n }\n\t\telse\n\t\t{\n\t\t\t$FontHeight=-2;\n\t\t}\n\n\n for ($i=0; $i<strlen($BarcodeFull); $i++)\n {\n $StripeCode = Code39 ($BarcodeFull[$i]);\n\n\n for ($n=0; $n < 9; $n++)\n {\n if ($Color == $White) $Color = $Black;\n else $Color = $White;\n\n\n switch ($StripeCode[$n])\n {\n case '0':\n ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$NarrowBar, $height-1-$FontHeight-2, $Color);\n $CurrentBarX += $NarrowBar;\n break;\n\n\n case '1':\n ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$WideBar, $height-1-$FontHeight-2, $Color);\n $CurrentBarX += $WideBar;\n break;\n }\n }\n\n\n $Color = $White;\n ImageFilledRectangle ($im, $CurrentBarX, 0, $CurrentBarX+$QuietBar, $height-1-$FontHeight-2, $Color);\n $CurrentBarX += $QuietBar;\n }\n\n\n OutputImage ($im, $format, $quality);\n}",
"function setAmocrmCode(string $code): void {\n\t}",
"public function setCode($code);",
"public function setCode($code);",
"function Codabar($xpos, $ypos, $code, $start='A', $end='A', $basewidth=0.12, $height=6) {\n\t$barChar = array (\n\t\t'0' => array (6.5, 4.4, 6.5, 3.4, 6.5, 7.3, 2.9),\n\t\t'1' => array (6.5, 4.4, 6.5, 8.4, 4.9, 4.3, 6.5),\n\t\t'2' => array (6.5, 4.0, 6.5, 9.4, 6.5, 3.0, 8.6),\n\t\t'3' => array (17.9, 24.3, 6.5, 6.4, 6.5, 3.4, 6.5),\n\t\t'4' => array (6.5, 2.4, 8.9, 6.4, 6.5, 4.3, 6.5),\n\t\t'5' => array (5.9,\t2.4, 6.5, 6.4, 6.5, 4.3, 6.5),\n\t\t'6' => array (6.5, 8.3, 6.5, 6.4, 6.5, 6.4, 7.9),\n\t\t'7' => array (6.5, 8.3, 6.5, 2.4, 7.9, 6.4, 6.5),\n\t\t'8' => array (6.5, 8.3, 5.9, 10.4, 6.5, 6.4, 6.5),\n\t\t'9' => array (7.6, 5.0, 6.5, 8.4, 6.5, 3.0, 6.5),\n\t\t'$' => array (6.5, 5.0, 18.6, 24.4, 6.5, 10.0, 6.5),\n\t\t'-' => array (6.5, 5.0, 6.5, 4.4, 8.6, 10.0, 6.5),\n\t\t':' => array (16.7, 9.3, 6.5, 9.3, 16.7, 9.3, 14.7),\n\t\t'/' => array (14.7, 9.3, 16.7, 9.3, 6.5, 9.3, 16.7),\n\t\t'.' => array (13.6, 10.1, 14.9, 10.1, 17.2, 10.1, 6.5),\n\t\t'+' => array (6.5, 10.1, 17.2, 10.1, 14.9, 10.1, 13.6),\n\t\t'A' => array (6.5, 8.0, 19.6, 19.4, 6.5, 16.1, 6.5),\n\t\t'T' => array (6.5, 8.0, 19.6, 19.4, 6.5, 16.1, 6.5),\n\t\t'B' => array (6.5, 16.1, 6.5, 19.4, 6.5, 8.0, 19.6),\n\t\t'N' => array (6.5, 16.1, 6.5, 19.4, 6.5, 8.0, 19.6),\n\t\t'C' => array (6.5, 8.0, 6.5, 19.4, 6.5, 16.1, 19.6),\n\t\t'*' => array (6.5, 8.0, 6.5, 19.4, 6.5, 16.1, 19.6),\n\t\t'D' => array (6.5, 8.0, 6.5, 19.4, 19.6, 16.1, 6.5),\n\t\t'E' => array (6.5, 8.0, 6.5, 19.4, 19.6, 16.1, 6.5),\n\t);\n\t$this->SetFont('Arial','',1);\n\t$this->SetTextColor(259); // Establece el color del texto (en este caso es blanco)\n\t$this->Text($xpos, $ypos + $height + 2, $code);\n\t$this->SetFillColor(0);\n\t$code = strtoupper($start.$code.$end);\n\tfor($i=0; $i<strlen($code); $i++){\n\t\t$char = $code[$i];\n\t\tif(!isset($barChar[$char])){\n\t\t\t$this->Error('Invalid character in barcode: '.$char);\n\t\t}\n\t\t$seq = $barChar[$char];\n\t\tfor($bar=0; $bar<7; $bar++){\n\t\t\t$lineWidth = $basewidth*$seq[$bar]/6.5;\n\t\t\tif($bar % 2 == 0){\n\t\t\t\t$this->Rect($xpos, $ypos, $lineWidth, $height, 'F');\n\t\t\t}\n\t\t\t$xpos += $lineWidth;\n\t\t}\n\t\t$xpos += $basewidth*10.4/6.5;\n\t}\n}",
"public function setCodeAttribute($value)\n {\n $this->attributes['code']=mb_strtoupper($value);\n }",
"function setXCode($x_code) {\r\r\n\t\t$this->x_code = $x_code;\r\r\n\t}",
"function Barcode39 ($barcode, $width, $height, $quality, $format, $text)\n{\n\tswitch ($format)\n\t{\n\t\tdefault:\n\t\t\t$format = \"JPEG\";\n\t\t\tbreak;\n\t\tcase \"JPEG\":\n\t\t\theader (\"Content-type: image/jpeg\");\n\t\t\tbreak; \n\t\tcase \"PNG\":\n\t\t\theader (\"Content-type: image/png\");\n\t\t\tbreak; \n\t\tcase \"GIF\": \n\t\t\theader (\"Content-type: image/gif\"); \n\t\t\tbreak; \n\t}\n\n\t$im = ImageCreate ($width, $height) \n\t\tor die (\"Cannot Initialize new GD image stream\");\n\n\t$White = ImageColorAllocate ($im, 255, 255, 255); \n\t$Black = ImageColorAllocate ($im, 0, 0, 0); \n\t$Red = ImageColorAllocate ($im, 255, 0, 0);\n\t//ImageColorTransparent ($im, $White); \n\tImageInterLace ($im, 1);\n\n\t$NarrowBar = 1;\n\t$WideBar = 3;\n\t$QuietBar = 1;\n\n\t$font_id = 1;\n\t$font_height = imagefontheight($font_id); \n\n\tif (($NarrowBar == 0) || ($NarrowBar == $WideBar) || ($WideBar == 0) || ($QuietBar == 0))\n\t{\n\t\tImageString ($im, $font_id, 0, 0, \"Image is\", $Black);\n\t\tImageString ($im, $font_id, 0, $font_height, \"too small!\", $Black);\n\t\tOutputImage ($im, $format, $quality); \n\t\texit;\n\t}\n\n\t$CurrentBarX = 10;\n\t$BarcodeFull = \"*\".strtoupper ($barcode).\"*\"; \n\tsettype ($BarcodeFull, \"string\");\n\n//\tImageString($im, $font_id, 0,$height-$font_height, $barcode, $Black);\n\n\tfor ($i=0; $i<strlen($BarcodeFull); $i++) \n\t{\n\t\t$StripeCode = Code39 ($BarcodeFull[$i]); \n\n\t\tfor ($n=0; $n < 10; $n++) \n\t\t{\n\t\t\tswitch ($StripeCode[$n])\n\t\t\t{ \n\t\t\t\tcase 'w':\n\t\t\t\t\tImageFilledRectangle($im, 0, $CurrentBarX, $width, $CurrentBarX+$NarrowBar, $White);\n\t\t\t\t\t$CurrentBarX += $NarrowBar;\n\t\t\t\t\tbreak; \n\n\t\t\t\tcase 'W':\n\t\t\t\t\tImageFilledRectangle($im, 0, $CurrentBarX, $width, $CurrentBarX+$WideBar, $White);\n\t\t\t\t\t$CurrentBarX += $WideBar;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'b':\n\t\t\t\t\tImageFilledRectangle($im, 0, $CurrentBarX, $width, $CurrentBarX+$NarrowBar, $Black);\n\t\t\t\t\t$CurrentBarX += $NarrowBar;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'B':\n\t\t\t\t\tImageFilledRectangle($im, 0, $CurrentBarX, $width, $CurrentBarX+$WideBar, $Black);\n\t\t\t\t\t$CurrentBarX += $WideBar;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tOutputImage ($im, $format, $quality); \n}",
"public function getAvecCodeBarre() {\n return $this->avecCodeBarre;\n }",
"function setCodeStat($encode){\n\t\t$this->encodestat=$encode;\n\t}",
"public function actionGenerateBarcode() \n {\n\t\t$inputCode = Yii::app()->request->getParam(\"code\", \"\");\n\t\t$bc = new BarcodeGenerator;\n\t\t$bc->init('png');\n\t\t$bc->build($inputCode);\n }",
"public function qrCode(){\n }",
"public function testSetBarcodeHeightDefault()\n {\n $this -> printer -> setBarcodeHeight();\n $this -> checkOutput(\"\\x1b@\\x1dh\\x08\");\n }",
"function product_barcode($param1 = '', $serial_number = '')\n\t{\n\t\tif ($this->session->userdata('admin_login') != 1)\n\t\t\tredirect(base_url() . 'index.php?login');\n\t\tif ($param1 == 'create_barcode') {\n\t\t\t$this->barcode_model->create_barcode($serial_number);\n\t\t}\n\t\t$page_data['page_name'] = 'product_barcode';\n\t\t$page_data['page_title'] = translate('product_barcodes');\n\t\t$page_data['products'] = $this->db->get('product')->result_array();\n\t\t$this->load->view('backend/index', $page_data);\n\t}",
"public function testSetBarcodeTextPositionDefault()\n {\n $this -> printer -> setBarcodeTextPosition();\n $this -> checkOutput(\"\\x1b@\\x1dH\\x00\");\n }",
"public function testPdf417CodeChangeOption()\n {\n $this -> printer -> pdf417Code(\"1234\", 3, 3, 0, 0.1, Printer::PDF417_TRUNCATED);\n $this -> checkOutput(\"\\x1b@\\x1d(k\\x03\\x000F\\x01\\x1d(k\\x03\\x000A\\x00\\x1d(k\\x03\\x000C\\x03\\x1d(k\\x03\\x000D\\x03\\x1d(k\\x04\\x000E1\\x01\\x1d(k\\x07\\x000P01234\\x1d(k\\x03\\x000Q0\");\n }",
"protected function _encode()\n {\n $barcode[] = self::$GUARD['start'];\n for($i=1;$i<=strlen($this->number)-1;$i++)\n {\n if($i < 7)\n $barcode[] = self::$LEFT_PARITY[$this->_key[$i-1]][substr($this->number, $i, 1)];\n else\n $barcode[] = self::$RIGHT_PARITY[substr($this->number, $i, 1)];\n if($i == 6)\n $barcode[] = self::$GUARD['middle'];\n }\n $barcode[] = self::$GUARD['end'];\n return $barcode;\n }",
"public function create_tomatogo_barcode_field($post)\n {\n $id = $post->ID;\n $barcode = sanitize_text_field(get_post_meta($id, 'barcode', true));\n\n echo '<p>' . $barcode . '</p>';\n }",
"public function setBarcodeService(BarcodeService $service)\n {\n $this->barcodeService = $service;\n }",
"public function setCode(?string $value): void {\n $this->getBackingStore()->set('code', $value);\n }"
] |
[
"0.6518903",
"0.63294643",
"0.62926227",
"0.60489076",
"0.59704196",
"0.5956213",
"0.59114665",
"0.59040517",
"0.5879915",
"0.5856405",
"0.57406163",
"0.5715936",
"0.570486",
"0.570486",
"0.56923527",
"0.56637937",
"0.5643512",
"0.56120914",
"0.5609994",
"0.55224234",
"0.5516484",
"0.5515588",
"0.5476633",
"0.5431876",
"0.54148793",
"0.5403646",
"0.53980213",
"0.5358131",
"0.5323373",
"0.5305709"
] |
0.65314126
|
0
|
Getter function for used_by_variance
|
public function getUsedByVariance()
{
return $this->usedByVariance;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function variance() {\n $n = count($this->value);\n $accumulator = 0.0;\n for ($i=0; $i < $n; $i++) {\n $accumulator += $this->value[$i]* $this->value[$i];\n }\n\n return $accumulator / ($n-1) - ($n/($n-1)) * $this->mean() * $this->mean();\n }",
"public function setUsedByVariance($variance)\n\t{\n\t\t$this->usedByVariance = $variance;\n\t\treturn $this;\n\t}",
"public function getVariation()\r\n {\r\n return array();\r\n }",
"public function dataProviderForSampleVariance(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], 250 ],\n [ [ 8, 9, 10, 11, 12 ], 2.5 ],\n [ [ 600, 470, 170, 430, 300 ], 27130 ],\n [ [ -5, 1, 8, 7, 2 ], 27.3 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], 7481522.21429 ],\n [ [ 4, 6, 2, 2, 2, 2, 3, 4, 1, 3 ], 2.1 ],\n [ [ -3432, 5, 23, 9948, -74 ], 25593794.5 ],\n [ [ 3, 21, 98, 203, 17, 9 ], 6219.9 ],\n [ [ 170, 300, 430, 470, 600 ], 27130 ],\n [ [ 1550, 1700, 900, 850, 1000, 950 ], 135416.66668 ],\n [ [ 1245, 1255, 1654, 1547, 1787, 1989, 1878, 2011, 2145, 2545, 2656 ], 210804.29090909063 ],\n ];\n }",
"private function _variance(array $values) {\n\t\t$mean = array_sum($values) / count($values);\n\t\t$sumOfSquares = 0;\n\t\tforeach($values as $value)\n\t\t\t$sumOfSquares += pow($value - $mean, 2);\n\t\n\t\treturn $sumOfSquares / count($values);\n\t}",
"public function dataProviderForPopulationVariance(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], 200 ],\n [ [ 8, 9, 10, 11, 12 ], 2 ],\n [ [ 600, 470, 170, 430, 300 ], 21704 ],\n [ [ -5, 1, 8, 7, 2], 21.84 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], 6546331.937 ],\n [ [ 4, 6, 2, 2, 2, 2, 3, 4, 1, 3 ], 1.89 ],\n [ [ -3432, 5, 23, 9948, -74 ], 20475035.6 ],\n ];\n }",
"public static function variance(array $data, int $type = self::SAMPLE): float\n\t{\n\t\t$deviations = self::deviations($data);\n\n\t\t// Must sum and count, etc. rather than simply calculate mean\n\t\t// to accommodate for sample/variance option\n\t\t$sum = array_sum($deviations);\n\t\t$count = count($deviations);\n\t\t$divide = ($type === self::SAMPLE) ? $count - 1 : $count;\n\t\t$variance = $sum / $divide;\n\n\t\treturn $variance;\n\t}",
"public function dataProviderForStandardDeviationUsingSampleVariance(): array\n {\n return [\n [ [ 3, 21, 98, 203, 17, 9 ], 78.86634 ],\n [ [ 170, 300, 430, 470, 600 ], 164.7118696390761 ],\n [ [ 1550, 1700, 900, 850, 1000, 950 ], 367.99 ],\n [ [ 1245, 1255, 1654, 1547, 1787, 1989, 1878, 2011, 2145, 2545, 2656 ], 459.13 ],\n ];\n }",
"public function standardDeviation() {\n return sqrt($this->variance());\n }",
"public function dataProviderForStandardDeviationUsingPopulationVariance(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], 10 * \\sqrt(2) ],\n [ [ 8, 9, 10, 11, 12 ], \\sqrt(2) ],\n [ [ 600, 470, 170, 430, 300], 147.32 ],\n [ [ -5, 1, 8, 7, 2], 4.67 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], 2558.580063 ],\n [ [ 4, 6, 2, 2, 2, 2, 3, 4, 1, 3 ], 1.374772708 ],\n [ [ -3432, 5, 23, 9948, -74 ], 4524.934872 ],\n ];\n }",
"function isVariation() : bool;",
"public function getVariationValue()\n {\n return $this->variationValue;\n }",
"public function getVarGrade();",
"public function getVariations() {\n return $this->variations;\n }",
"private function variance($aValues, $bSample = false)\n {\n $fMean = array_sum($aValues) / count($aValues);\n $fVariance = 0.0;\n \n foreach($aValues as $i)\n {\n $fVariance += pow($i - $fMean, 2);\n }\n \n $fVariance /= ( $bSample ? count($aValues) - 1 : count($aValues) );\n \n return $fVariance;\n }",
"public static function variance($elements, $population = FALSE) {\n $variance = 0.0;\n $n = count($elements);\n $mean = Math::mean($elements);\n\n for ($i = 0; $i < $n; $i++) {\n $variance = $variance + ($elements[$i] - $mean) * ($elements[$i] - $mean);\n }\n\n if (! $population) {\n $n = ($n - 1.0);\n }\n\n return $variance / ($n);\n }",
"public function getVariation()\n {\n return $this->db->get($this->product_variant);\n }",
"public function getMetrics(): array;",
"public function getMeasures() {\n return $this->measures;\n }",
"public function dataProviderForWeightedSampleVarianceBiased(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], [1, 1, 1, 1, 1], 200 ],\n [ [ 8, 9, 10, 11, 12 ], [1, 1, 1, 1, 1], 2 ],\n [ [ 8, 9, 10, 11, 12 ], [0.3, 0.3, 0.2, 0.2, 0.1], 1.702479 ],\n [ [ 600, 470, 170, 430, 300 ], [1, 1, 1, 1, 1], 21704 ],\n [ [ -5, 1, 8, 7, 2 ], [1, 1, 1, 1, 1], 21.84 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], [1, 1, 1, 1, 1, 1, 1, 1], 6546332 ],\n ];\n }",
"function BuyableCalculatedAdditionalTax(){\n\t\tif($this->owner InstanceOf ProductVariation) {\n\t\t\tif($product = $this->owner->Product()) {\n\t\t\t\treturn $product->AdditionalTax();\n\t\t\t}\n\t\t}\n\t\treturn $this->owner->AdditionalTax();\n\t}",
"public function getStandardValue()\n {\n }",
"public function getVariationSpecifics()\n {\n return $this->variationSpecifics;\n }",
"public function dataProviderForWeightedSampleVarianceUnbiased(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], [1, 1, 1, 1, 1], 250 ],\n [ [ 8, 9, 10, 11, 12 ], [1, 1, 1, 1, 1], 2.5 ],\n [ [ 600, 470, 170, 430, 300 ], [1, 1, 1, 1, 1], 27130 ],\n [ [ -5, 1, 8, 7, 2 ], [1, 1, 1, 1, 1], 27.3 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], [1, 1, 1, 1, 1, 1, 1, 1], 7481522.21429 ],\n ];\n }",
"public function getVatility()\n {\n return $this->get(self::_VATILITY);\n }",
"function HasVariations() {\r\n\t\treturn $this->NumberOfVariations() ? true : false;\r\n\t}",
"public function hasDatasetVariableSummaries() {\n return $this->_has(2);\n }",
"public function getSuplier()\n {\n return $this->suplier;\n }",
"function BuyableCalculatedExcludedFrom(){\n\t\tif($this->owner InstanceOf ProductVariation) {\n\t\t\tif($product = $this->owner->Product()) {\n\t\t\t\treturn $product->ExcludedFrom();\n\t\t\t}\n\t\t}\n\t\treturn $this->owner->ExcludedFrom();\n\t}",
"public function getStdDevGrade();"
] |
[
"0.71009535",
"0.6640906",
"0.6270013",
"0.6158003",
"0.59401315",
"0.5935611",
"0.5874162",
"0.58360636",
"0.5832237",
"0.5694048",
"0.5617709",
"0.55650604",
"0.5439941",
"0.54365367",
"0.543245",
"0.5425852",
"0.53898233",
"0.5349244",
"0.5269186",
"0.5179338",
"0.5177259",
"0.517564",
"0.51731294",
"0.51427686",
"0.5070962",
"0.50219053",
"0.4991669",
"0.49788293",
"0.49728477",
"0.49469194"
] |
0.75712216
|
0
|
Setter function for used_by_variance
|
public function setUsedByVariance($variance)
{
$this->usedByVariance = $variance;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function variance() {\n $n = count($this->value);\n $accumulator = 0.0;\n for ($i=0; $i < $n; $i++) {\n $accumulator += $this->value[$i]* $this->value[$i];\n }\n\n return $accumulator / ($n-1) - ($n/($n-1)) * $this->mean() * $this->mean();\n }",
"public function getUsedByVariance()\n\t{\n\t\treturn $this->usedByVariance;\n\t}",
"public function dataProviderForSampleVariance(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], 250 ],\n [ [ 8, 9, 10, 11, 12 ], 2.5 ],\n [ [ 600, 470, 170, 430, 300 ], 27130 ],\n [ [ -5, 1, 8, 7, 2 ], 27.3 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], 7481522.21429 ],\n [ [ 4, 6, 2, 2, 2, 2, 3, 4, 1, 3 ], 2.1 ],\n [ [ -3432, 5, 23, 9948, -74 ], 25593794.5 ],\n [ [ 3, 21, 98, 203, 17, 9 ], 6219.9 ],\n [ [ 170, 300, 430, 470, 600 ], 27130 ],\n [ [ 1550, 1700, 900, 850, 1000, 950 ], 135416.66668 ],\n [ [ 1245, 1255, 1654, 1547, 1787, 1989, 1878, 2011, 2145, 2545, 2656 ], 210804.29090909063 ],\n ];\n }",
"public static function variance(array $data, int $type = self::SAMPLE): float\n\t{\n\t\t$deviations = self::deviations($data);\n\n\t\t// Must sum and count, etc. rather than simply calculate mean\n\t\t// to accommodate for sample/variance option\n\t\t$sum = array_sum($deviations);\n\t\t$count = count($deviations);\n\t\t$divide = ($type === self::SAMPLE) ? $count - 1 : $count;\n\t\t$variance = $sum / $divide;\n\n\t\treturn $variance;\n\t}",
"private function _variance(array $values) {\n\t\t$mean = array_sum($values) / count($values);\n\t\t$sumOfSquares = 0;\n\t\tforeach($values as $value)\n\t\t\t$sumOfSquares += pow($value - $mean, 2);\n\t\n\t\treturn $sumOfSquares / count($values);\n\t}",
"public function getVariation()\r\n {\r\n return array();\r\n }",
"function isVariation() : bool;",
"public function dataProviderForStandardDeviationUsingSampleVariance(): array\n {\n return [\n [ [ 3, 21, 98, 203, 17, 9 ], 78.86634 ],\n [ [ 170, 300, 430, 470, 600 ], 164.7118696390761 ],\n [ [ 1550, 1700, 900, 850, 1000, 950 ], 367.99 ],\n [ [ 1245, 1255, 1654, 1547, 1787, 1989, 1878, 2011, 2145, 2545, 2656 ], 459.13 ],\n ];\n }",
"private function variance($aValues, $bSample = false)\n {\n $fMean = array_sum($aValues) / count($aValues);\n $fVariance = 0.0;\n \n foreach($aValues as $i)\n {\n $fVariance += pow($i - $fMean, 2);\n }\n \n $fVariance /= ( $bSample ? count($aValues) - 1 : count($aValues) );\n \n return $fVariance;\n }",
"public function dataProviderForPopulationVariance(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], 200 ],\n [ [ 8, 9, 10, 11, 12 ], 2 ],\n [ [ 600, 470, 170, 430, 300 ], 21704 ],\n [ [ -5, 1, 8, 7, 2], 21.84 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], 6546331.937 ],\n [ [ 4, 6, 2, 2, 2, 2, 3, 4, 1, 3 ], 1.89 ],\n [ [ -3432, 5, 23, 9948, -74 ], 20475035.6 ],\n ];\n }",
"public function dataProviderForStandardDeviationUsingPopulationVariance(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], 10 * \\sqrt(2) ],\n [ [ 8, 9, 10, 11, 12 ], \\sqrt(2) ],\n [ [ 600, 470, 170, 430, 300], 147.32 ],\n [ [ -5, 1, 8, 7, 2], 4.67 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], 2558.580063 ],\n [ [ 4, 6, 2, 2, 2, 2, 3, 4, 1, 3 ], 1.374772708 ],\n [ [ -3432, 5, 23, 9948, -74 ], 4524.934872 ],\n ];\n }",
"public static function variance($elements, $population = FALSE) {\n $variance = 0.0;\n $n = count($elements);\n $mean = Math::mean($elements);\n\n for ($i = 0; $i < $n; $i++) {\n $variance = $variance + ($elements[$i] - $mean) * ($elements[$i] - $mean);\n }\n\n if (! $population) {\n $n = ($n - 1.0);\n }\n\n return $variance / ($n);\n }",
"public function standardDeviation() {\n return sqrt($this->variance());\n }",
"function _acf_apply_hook_variations()\n{\n}",
"public function getVariationValue()\n {\n return $this->variationValue;\n }",
"public function fakeAdvancedVarianceData($advanced_variances_arr = [], $factory_name = Seeder::PHPUNIT_FACTORY_NAME)\n {\n /** @var $factory Factory */\n $factory = app(Factory::class);\n $factory->setProvidedValuesArr($advanced_variances_arr);\n return $factory->raw(AdvancedVariance::class, $advanced_variances_arr, $factory_name);\n }",
"public static function VARIANCE()\n {\n return new Av1AdaptiveQuantMode(self::VARIANCE);\n }",
"public function dataProviderForWeightedSampleVarianceBiased(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], [1, 1, 1, 1, 1], 200 ],\n [ [ 8, 9, 10, 11, 12 ], [1, 1, 1, 1, 1], 2 ],\n [ [ 8, 9, 10, 11, 12 ], [0.3, 0.3, 0.2, 0.2, 0.1], 1.702479 ],\n [ [ 600, 470, 170, 430, 300 ], [1, 1, 1, 1, 1], 21704 ],\n [ [ -5, 1, 8, 7, 2 ], [1, 1, 1, 1, 1], 21.84 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], [1, 1, 1, 1, 1, 1, 1, 1], 6546332 ],\n ];\n }",
"public function onVariationAlter(ProductVariationEvent $event) {\n /** @var \\Drupal\\commerce_product\\Entity\\ProductVariationInterface $variation */\n $variation = $event->getProductVariation();\n\n\n }",
"public function dataProviderForWeightedSampleVarianceUnbiased(): array\n {\n return [\n [ [ -10, 0, 10, 20, 30 ], [1, 1, 1, 1, 1], 250 ],\n [ [ 8, 9, 10, 11, 12 ], [1, 1, 1, 1, 1], 2.5 ],\n [ [ 600, 470, 170, 430, 300 ], [1, 1, 1, 1, 1], 27130 ],\n [ [ -5, 1, 8, 7, 2 ], [1, 1, 1, 1, 1], 27.3 ],\n [ [ 3, 7, 34, 25, 46, 7754, 3, 6 ], [1, 1, 1, 1, 1, 1, 1, 1], 7481522.21429 ],\n ];\n }",
"public function fakeAdvancedVariance($advanced_variances_arr = [])\n {\n return new AdvancedVariance($this->fakeAdvancedVarianceData($advanced_variances_arr));\n }",
"public function getVarGrade();",
"public function variance(array $array, $mean)\n {\n $array = array_map(function ($value) use ($mean) {\n return pow($value - $mean, 2);\n }, $array);\n\n return self::mean($array);\n }",
"function HasVariations() {\r\n\t\treturn $this->NumberOfVariations() ? true : false;\r\n\t}",
"function __set($var,$val){\n\t\t\t\tif($var=='width' || ($var=='height' && $val>0)){\n\t\t\t\t\t$this->$var=$val;\n\t\t\t\t\t$this->ratio=(intval($this->height)>0 ? floatval($this->width)/$this->height : 0);\n\t\t\t\t}else if($var=='height'){\n\t\t\t\t\t$this->$var=0;\n\t\t\t\t\t$this->ratio=0;\n\t\t\t\t}else if($var == 'data'){\n\t\t\t\t\t$this->$var($val);\n\t\t\t\t}else{\n\t\t\t\t\t$this->$var=$val;\n\t\t\t\t}\n\t\t\t}",
"public function hasDatasetVariableSummaries() {\n return $this->_has(2);\n }",
"public function overrideUC() {}",
"public static function stdv($elements, $population = FALSE) {\n\n $stdv = 0.0;\n $variance = 0.0;\n $n = count($elements);\n $mean = Math::mean($elements);\n $variance = Math::variance($elements, $population);\n\n $stdv = pow($variance, 0.5);\n // $stdv = sqrt($variance);\n\n return $stdv;\n }",
"public function getVariations() {\n return $this->variations;\n }",
"function BuyableCalculatedAdditionalTax(){\n\t\tif($this->owner InstanceOf ProductVariation) {\n\t\t\tif($product = $this->owner->Product()) {\n\t\t\t\treturn $product->AdditionalTax();\n\t\t\t}\n\t\t}\n\t\treturn $this->owner->AdditionalTax();\n\t}"
] |
[
"0.6502564",
"0.6399841",
"0.56857085",
"0.5549815",
"0.55402",
"0.5517895",
"0.54805976",
"0.54729027",
"0.54470336",
"0.5402577",
"0.5282139",
"0.51645875",
"0.5163817",
"0.51532286",
"0.4899396",
"0.48467457",
"0.4830945",
"0.48230758",
"0.47833076",
"0.47265142",
"0.46720695",
"0.4661129",
"0.4655225",
"0.46207714",
"0.4616326",
"0.4601414",
"0.45995858",
"0.4567386",
"0.4564544",
"0.4510419"
] |
0.7298196
|
0
|
Getter function for label version no
|
public function getLabelVersionNo()
{
return $this->labelVersionNo;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function GetLabel();",
"public function get_label();",
"public function get_label();",
"function getLabel(): string;",
"public function getLabel(): string;",
"public function getLabel(): string;",
"public function getLabel() {}",
"public function getLabel() {}",
"public function label() { }",
"public function get_label(){ return $this->label; }",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"public function getLabel();",
"abstract protected function label(): string;",
"public function label();",
"public function label();",
"public function label();",
"public function label();"
] |
[
"0.7084322",
"0.69787914",
"0.69787914",
"0.6966163",
"0.68483615",
"0.68483615",
"0.66021276",
"0.66021276",
"0.6579292",
"0.6551029",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6432717",
"0.6431995",
"0.642237",
"0.642237",
"0.642237",
"0.642237"
] |
0.7917782
|
0
|
Remove all Material(s) for a product THis actually removes all the ProductInfo(s) for a product and type ProductInfoType::ID_MATERIAL
|
public function clearMaterial()
{
ProductInfo::updateByCriteria('active = ?', 'productId = ? and typeId = ? and entityName = ?', array(0, $this->getId(), ProductInfoType::ID_MATERIAL, ProductInfoType::ENTITY_NAME_MATERIAL));
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function clearProducts()\n\t{\n\t\t$sql=\"SET FOREIGN_KEY_CHECKS = 0\";\n\t\t$this->exec_stmt($sql);\n\t\t$tables=array(\"catalog_product_bundle_option\",\n\t\t\t\t\t \"catalog_product_bundle_option_value\",\n\t\t\t\t\t \"catalog_product_bundle_selection\",\n\t\t\t\t\t \"catalog_product_entity_datetime\",\n\t\t\t\t\t \"catalog_product_entity_decimal\",\n\t\t\t\t\t \"catalog_product_entity_gallery\",\n\t\t\t\t\t \"catalog_product_entity_int\",\n\t\t\t\t\t \"catalog_product_entity_media_gallery\",\n\t\t\t\t\t \"catalog_product_entity_media_gallery_value\",\n\t\t\t\t\t \"catalog_product_entity_text\",\n\t\t\t\t\t \"catalog_product_entity_tier_price\",\n\t\t\t\t\t \"catalog_product_entity_varchar\",\n\t\t\t\t\t \"catalog_product_entity\",\n\t\t\t\t\t \"catalog_product_option\",\n\t\t\t\t\t \"catalog_product_option_price\",\n\t\t\t\t\t \"catalog_product_option_title\",\n\t\t\t\t\t \"catalog_product_option_type_price\",\n\t\t\t\t\t \"catalog_product_option_type_title\",\n\t\t\t\t\t \"catalog_product_option_type_value\",\t\t\n\t\t\t\t\t \"catalog_product_super_attribute_label\",\n\t\t\t\t\t \"catalog_product_super_attribute_pricing\",\n\t\t\t\t\t \"catalog_product_super_attribute\",\n\t\t\t\t\t \"catalog_product_super_link\",\n\t\t\t\t\t \"catalog_product_relation\",\n\t\t\t\t\t \"catalog_product_enabled_index\",\n\t\t\t\t\t \"catalog_product_website\",\n\t\t\t\t\t \"catalog_category_product_index\",\n\t\t\t\t\t \"catalog_category_product\",\n\t\t\t\t\t \"cataloginventory_stock_item\",\n\t\t\t\t\t \"cataloginventory_stock_status\");\n\n\n\t\tforeach($tables as $table)\n\t\t{\n\t\t\t$this->exec_stmt(\"TRUNCATE TABLE `\".$this->tablename($table).\"`\");\n\t\t}\n\n\t\t$sql=\"SET FOREIGN_KEY_CHECKS = 1\";\n\n\t\t$this->exec_stmt($sql);\n\t}",
"public function removeAll()\n {\n echo $this->_em->createQueryBuilder()->delete('Tdms\\Entity\\Product', 'p')->getQuery()->execute();\n }",
"function clearProduct($id = null) {\n $keys = array(\n \"PRODUCT_BASE_{$id}\",\n \"PRODUCT_IS_FEATURED_{$id}\",\n \"PRODUCT_PRICE_{$id}\",\n \"PRODUCT_RATING_COUNTSUM_{$id}\",\n \"PRODUCT_CP_ID_{$id}\",\n \"PRODUCT_AVG_RATING_{$id}\",\n \"PRODUCT_TOTAL_RATING_{$id}\",\n \"EAV_FULL_Model_ProductMeta_{$id}\"\n );\n $this->clear($keys);\n $this->clearType('device'); //because device types are stored by hash. need to clear all\n $this->clearType('category'); //ditto for category\n }",
"function uc_order_edit_products_remove($form, &$form_state) {\n $form_state['refresh_products'] = TRUE;\n\n $order_product_id = intval($form_state['triggering_element']['#return_value']);\n\n if (module_exists('uc_stock')) {\n // Replace stock immediately.\n $product = uc_order_product_load($order_product_id);\n uc_stock_adjust($product->model, $product->qty);\n }\n\n uc_order_product_delete($order_product_id);\n\n $order = $form_state['build_info']['args'][0];\n $matches = array();\n preg_match('/products\\[(\\d+)\\]/', $form_state['triggering_element']['#name'], $matches);\n $key = $matches[1];\n\n unset($order->products[$key]);\n $order->products = array_values($order->products);\n}",
"public function remove_material()\n {\n if (Authenticate::is_player()) {\n if (isset($_POST['token']) && Authenticate::is_valid_token($_POST['token'])) {\n $this->model_material = Material::getInstance();\n\n $material = $_POST[\"material_id\"];\n $result = $this->model_material->remove_material($material);\n\n $binding = array(\n \"result_var\" => \"session_ready\",\n \"status_var\" => $result\n );\n\n binding_data($binding);\n } else {\n transport(\"error404\");\n }\n } else {\n $binding = array(\"result_var\" => \"no_session\");\n binding_data($binding);\n }\n }",
"public function productMaterials()\n {\n return $this->hasMany('App\\ProductMaterial');\n }",
"public function clear()\n {\n if (null !== $this->aTblEra) {\n $this->aTblEra->removeTblProdInfo($this);\n }\n if (null !== $this->aTblGeneral) {\n $this->aTblGeneral->removeTblProdInfo($this);\n }\n if (null !== $this->aTblMenus) {\n $this->aTblMenus->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPhotos) {\n $this->aTblProdPhotos->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPrices) {\n $this->aTblProdPrices->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPricing) {\n $this->aTblProdPricing->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdSmaller) {\n $this->aTblProdSmaller->removeTblProdInfo($this);\n }\n if (null !== $this->aTblShippingCategories) {\n $this->aTblShippingCategories->removeTblProdInfo($this);\n }\n $this->prod_id = null;\n $this->prod_price_id = null;\n $this->prod_name = null;\n $this->prod_alt1 = null;\n $this->prod_alt2 = null;\n $this->prod_alt3 = null;\n $this->prod_alt4 = null;\n $this->prod_code = null;\n $this->prod_category = null;\n $this->prod_category_shipping = null;\n $this->prod_writeup = null;\n $this->prod_length = null;\n $this->prod_wingspan = null;\n $this->prod_height = null;\n $this->prod_scale = null;\n $this->prod_links = null;\n $this->prod_linkdescription = null;\n $this->prod_front = null;\n $this->prod_keywords = null;\n $this->prod_keywords_writeup = null;\n $this->prod_title = null;\n $this->prod_description = null;\n $this->prod_general = null;\n $this->prod_era = null;\n $this->prod_company = null;\n $this->prod_related = null;\n $this->prod_related_pa = null;\n $this->prod_related_m3 = null;\n $this->prod_related2 = null;\n $this->prod_saveas = null;\n $this->prod_aircraftreg = null;\n $this->mb = null;\n $this->pa = null;\n $this->m3 = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }",
"public function removeItems($products)\n {\n }",
"public static function getMaterials()\n\t\t{\n\t\t\t$supplier_id = $_POST['supplierID'];\n\t\t\t\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id','supplier_id','unit_price','name'];\n\t\t\t$stageDBO->SetJoin(['[><]item' => 'item_id']);\n\t\t\t$materials = $stageDBO->getRecords($arr, ['supplier_id' => $supplier_id]);\n\n\t\t\t$stageDBO = DatabaseObjectFactory::build('supplier_discount');\n\t\t\t$arr = ['material_id','supplier_id','min_qty','discount_percent'];\n\t\t\t$discounts = $stageDBO->getRecords($arr, ['supplier_id' => $supplier_id]);\n\n\n\t\t\trequire_once('views/pages/orderMaterials2.php');\n\t\t}",
"function AJAX_removeMaterial() {\r\n\t\t$this->load->model('inventory/material_model');\r\n\t\t$item_material_id = $this->input->post('item_material_id');\r\n\t\t\t\r\n\t\t$this->material_model->removeMaterial($item_material_id);\r\n\t}",
"function deleteProductMediasById($id) {\r\n //On supprime physiquement les medias avant de les retirer de la base\r\n $medias = getProductMediasById($id);\r\n foreach ($medias as $media) {\r\n unlink($media->mediaSource);\r\n }\r\n\r\n $dbc = connection();\r\n $table = 'medias';\r\n $dbc->quote($table);\r\n\r\n $req = \"DELETE FROM $table \"\r\n . \"WHERE id IN (\"\r\n . \"SELECT pm.id_medias \"\r\n . \"FROM products_has_medias \"\r\n . \"AS pm \"\r\n . \"WHERE pm.id_products = $id)\";\r\n\r\n $requPrep = $dbc->prepare($req); // on prépare notre requête\r\n $requPrep->execute();\r\n $data = $requPrep->fetchAll(PDO::FETCH_OBJ);\r\n $requPrep->closeCursor();\r\n}",
"public function deleting($event)\n {\n if ($event instanceof MaterialRelease) {\n if ($event->result) {\n $event->result->delete();\n }\n }\n\n $event->products()->sync([]);\n }",
"public function destroy(Material $material)\n {\n $this->authorize('isSuperAdmin');\n $item = findOrFail($material->id);\n $item->delete();\n }",
"public function delete() {\n\t\t$sql = 'delete from cart_orders_products_attributes where orders_products_attributes_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t}",
"private function deleteOldProducts(): void\n {\n DB::table('products')\n ->whereIn('id', array_keys($this->databaseProducts))\n ->delete();\n }",
"public function actionProductDelete()\n\t{\n\t\t$data=$_POST;\n\t\t\n\t\tif(isset($data['id'])){\n\t\t\ttry{\n\t\t\t\t$id = $data['id'];\n\t\t\t\t$logFIle = 'product/delete/'.$id;\n\t\t\t\tData::createLog('Requested Data: '.json_encode($data),$logFIle,'a');\n\t\t\t\t\n\t\t $product = Data::sqlRecords('SELECT sku,type FROM `jet_product` WHERE id=\"' . $id . '\" ', 'one');\n\t\t if(!$product)\n\t\t \treturn;\n\n\t\t $walmartConfig = Data::sqlRecords(\"SELECT `consumer_id`,`secret_key`,`consumer_channel_type_id` FROM `walmart_configuration` WHERE merchant_id='\".$data['merchant_id'].\"'\",'one','select');\n\t\t if (isset($product) && !empty($product)) {\n\t\t if ($product['type'] == 'variants') {\n\t\t $skus = Data::sqlRecords('SELECT option_sku FROM `jet_product_variants` WHERE product_id=\"' . $id .'\" ', null, 'all');\n\t\t if (!is_array($skus) || (is_array($skus) && !count($skus)))\n\t\t $skus = [];\n\n\t\t } else {\n\t\t $skus[0]['option_sku'] = $product['sku'];\n\t\t }\n\n\t\t \n\t\t $result = [];\n\t\t foreach ($skus as $sku) {\n\n\t\t $walmartApi = new Walmartapi($walmartConfig['consumer_id'],$walmartConfig['secret_key']);\n\t\t $feed_data = $walmartApi->retireProduct($sku['option_sku']);\n\t\t \n\t\t if(isset($feed_data['ItemRetireResponse']))\n\t\t {\n\t\t $result['success'][] = '<b>'.$feed_data['ItemRetireResponse']['sku'].' : </b>'.$feed_data['ItemRetireResponse']['message'];\n\t\t }\n\t\t elseif (isset($feed_data['errors']['error']))\n\t\t {\n\t\t if(isset($feed_data['errors']['error']['code']) && $feed_data['errors']['error']['code'] == \"CONTENT_NOT_FOUND.GMP_ITEM_INGESTOR_API\" && $feed_data['errors']['error']['field'] == \"sku\")\n\t\t {\n\t\t $result['error'][] = $sku['option_sku'].' : Product not Uploaded on Walmart.';\n\t\t }\n\t\t else\n\t\t {\n\t\t $result['error'][] = $sku['option_sku'].' : '.$feed_data['errors']['error']['description'];\n\t\t }\n\t\t } \n\t\t }\n\t\t \n\t\t }\n\t\t Data::createLog('Result : '.json_encode($result),$logFIle,'a');\n\t\t }\n\t\t catch(Exception $e){\n\t\t \tData::createLog('Exception : '.$e->getMessage(),$logFIle,'a');\n\t\t }\n\t }\n\t\tdie;\n\t}",
"private function getCleanTables() {\n\t\tunset($this->_vm_product);\n\t\tunset($this->product_id);\n\t\tunset($this->product_sku);\n\t\tunset($this->product_in_stock);\n\t}",
"public function product_delete()\n\t\t\t\t{\n\t\t\t\t}",
"public function destroy(Product $product)\n {\n $product->categories()->detach();\n foreach (explode(';',$product->media) as $media){\n Storage::disk('public')->delete(str_replace('/storage', '', $media));\n }\n\n $product->delete();\n DB::table('attributeables')->where('product_id', '=', $product->id)->delete();\n return redirect()->route('admin.products.index');\n }",
"public function delete($material_id){\r\n\t\t$sql = 'DELETE FROM material WHERE material_id = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($material_id);\r\n\t\treturn $this->executeUpdate($sqlQuery);\r\n\t}",
"public function order_remove_products($products)\n {\n foreach($products as $product)\n {\n $product_id = $product->id;\n\n $order_id = $this->id;\n\n $quantity = $product->pivot->quantity;\n\n $in_cart_product = $this->product()->where('product_id',$product_id)->wherePivot('deleted_at',null)->first();\n\n if(is_null($in_cart_product))\n\n continue;\n\n if ($quantity >= $in_cart_product->pivot->quantity )\n {\n $this->removeProduct($product);\n }\n else\n {\n $update_quantity = $quantity - $in_cart_product->pivot->quantity;\n\n $in_cart_product->pivot->update(compact('update_quantity'));\n }\n \n }\n\n }",
"public function actionDelete($id)\n {\n\n $model = $this->findModel($id);\n //\n //\n if ($model->productsTypeColorVariation <> null) {\n\n foreach ($model->productsTypeColorVariation as $item) {\n\n\n if (isset($item->productsTypeColorDescs))\n try {\n $item->productsTypeColorDescs->delete();\n } catch (\\Exception $e) {\n print_r($e);\n }\n\n if (isset($item->productsTypeColorImage))\n try {\n $item->productsTypeColorImage->delete();\n } catch (\\Exception $e) {\n print_r($e);\n }\n\n\n $sql = \"DELETE FROM `my_products_type_color_multimedia` WHERE `product_type_color_id` = \" . $item->id;\n Yii::$app->db->createCommand($sql)->execute();\n // под капотом огромная тучп шейпов камней и они сходу не удаляются\n // по гасим их запрсом напрямую\n /*if (isset($item->productsTypeColorMultimedia)) {\n try {\n $item->productsTypeColorMultimedia->delete();\n } catch (\\Exception $e) {\n print_r($e);\n }\n }*/\n\n\n $item->delete();\n }\n }\n\n if ($model->productsTypeMultimedia <> null) {\n foreach ($model->productsTypeMultimedia as $item) {\n $item->delete();\n }\n }\n\n if ($model->productsTypeDescs <> null) {\n foreach ($model->productsTypeDescs as $item) {\n $item->delete();\n }\n }\n\n if ($model->productGemsPrices <> null) {\n foreach ($model->productGemsPrices as $item) {\n foreach ($item->productsMultimedia as $item2) {\n $item2->delete();\n }\n $item->delete();\n }\n }\n\n\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }",
"public function getMaterials($returnJson = false)\n\t{\n\t\t$result = array();\n\t\t$piArray = ProductInfo::getAllByCriteria('productId = ? and typeId = ? and entityName = ?', array($this->getId(), ProductInfoType::ID_MATERIAL, ProductInfoType::ENTITY_NAME_MATERIAL));\n\t\tforeach($piArray as $pi)\n\t\t{\n\t\t\tif(($material = Material::get(intval($pi->getEntityId()))) instanceof Material)\n\t\t\t{\n\t\t\t\tif($returnJson === false)\n\t\t\t\t\t$result[] = array('material' => $material, 'qty' => $pi->getValue() );\n\t\t\t\telse\n\t\t\t\t\t$result[] = $pi->getJson(array('material' => $material->getJson(), 'qty' => $pi->getValue()));\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}",
"function remove_product_types( $types ){\n unset( $types['grouped'] );\n unset( $types['external'] );\n\n return $types;\n}",
"public function removeProduct($product)\n {\n\n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if (! is_null($cart))\n\n $cart->pivot->delete();\n }",
"public function destroy($productType_id, $id)\n {\n $product = Product::findOrFail($id);\n $productAttributeValues = $product->attributeValues;\n $product->delete();\n foreach($productAttributeValues as $productAttributeValue){\n if(count($productAttributeValue->products) == 0){\n $productAttributeValue->delete();\n }\n }\n return $this->index($productType_id);\n }",
"function eliminar_insumos($objeto){\n\t\t$sql=\"\tDELETE FROM\n\t\t\t\t\t app_producto_material\n\t\t\t\tWHERE\n\t\t\t\t\tid_producto =\".$objeto['id'];\n\t\t// return $sql;\n\t\t$result = $this->query($sql);\n\n\t\treturn $result;\n\t}",
"public function removeProduct(Product $product){\n $product->allergieëns()->detach();\n $product->delete();\n return redirect()->back();\n }",
"public function deleteTypeSpecificData(\\Magento\\Catalog\\Model\\Product $product)\n {\n }",
"public static function editMaterial()\n\t\t{\n\t\t\t$materialID = $_POST['material_id'];\n\n\n\t\t\t//GRAB MATERIAL INFO BASED ON MATERIAL ID LISTED ABOVE\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$arr = ['material_id', 'name','unit_price','current_price','min_price'];\n\t\t\t$stageDBO->SetJoin([\"[><]item\" => \"item_id\"]);\n\t\t\t$materials = $stageDBO->getRecords($arr, ['material_id' => $materialID] );\n\t\t\trequire_once('views/pages/editMaterial.php');\n\n\n\t\t}"
] |
[
"0.59546155",
"0.5919347",
"0.5855349",
"0.5737247",
"0.57142603",
"0.57061076",
"0.5689881",
"0.5652096",
"0.56187934",
"0.5547577",
"0.5531972",
"0.5512781",
"0.5499218",
"0.544107",
"0.54141814",
"0.5403322",
"0.53727037",
"0.53572106",
"0.535456",
"0.5333671",
"0.53122663",
"0.5294084",
"0.52867985",
"0.5281659",
"0.5249675",
"0.52473485",
"0.5198614",
"0.51920635",
"0.51703894",
"0.5163755"
] |
0.70194894
|
0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.