query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Converts a region row object to an array. | public static function toArray($region) {
return array(
'id' => $region->id,
'name' => isset($region->name) ? $region->name : null,
'lat' => isset($region->lat) && $region->lat !== null ? (float) $region->lat : null,
'long' => isset($region->long) && $region->long !== null ? (float) $region->long : null
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getRowAsArray();",
"public function toArray(){\n\t\treturn json_decode(json_encode($this->rows), true);\n\t}",
"public function getRowDataAsArray( $iRow )\r\n {\r\n return $this->data[$iRow];\r\n }",
"public function toArray() {\n\t\tforeach($this->_rows as $i => $row) {\n\t\t\t$this->_data[$i] = $row->toArray();\n\t\t}\t\n\t\treturn $this->_data;\n\t}",
"public function getRowsAsArray(){\n $fieldNames=$this->getFieldNames();\n $result=[];\n if (!empty($this->valuesRows)){\n foreach($this->valuesRows as $valuesRow){\n $rowArr=[];\n foreach($fieldNames as $i=>$fieldName){\n if (isset($valuesRow[$i])){\n $rowArr[$fieldName]=$valuesRow[$i];\n }\n }\n $result[]=$rowArr;\n }\n }\n return $result;\n }",
"public static function getRowsArray(): array {\n return range('A', 'J');\n }",
"public function toArray(): array\n {\n $this->initialize();\n return $this->rows;\n }",
"public function getArray()\n\t{\n\t\treturn $this->row;\n\t}",
"public function toEntityArray()\n {\n $return = [];\n foreach ($this as $row) {\n $return[] = $row;\n }\n return $return;\n }",
"public function toArray()\n {\n return ['rows' => $this->rows] + parent::toArray();\n }",
"public function toArray()\n {\n return [\n 'id' => $this->getRowId(),\n 'data' => $this->item\n ];\n }",
"public function getArrayRows()\n {\n $result = [];\n /** @var \\Magento\\Framework\\Data\\Form\\Element\\AbstractElement */\n $element = $this->getElement();\n $aValue = $element->getValue(); // get values\n if (is_array($aValue) === false) { // no array given? -> value from config.xml\n $aValue = json_decode($aValue, true); // convert string to array\n }\n if ($aValue && is_array($aValue)) {\n foreach ($aValue as $rowId => $row) {\n $rowColumnValues = [];\n foreach ($row as $key => $value) {\n $row[$key] = $value;\n $rowColumnValues[$this->_getCellInputElementId($rowId, $key)] = $row[$key]; // add value the row\n }\n $row['_id'] = $rowId;\n $row['column_values'] = $rowColumnValues;\n $result[$rowId] = new \\Magento\\Framework\\DataObject($row);\n $this->_prepareArrayRow($result[$rowId]);\n }\n }\n return $result;\n }",
"public function toArray($decodePrivileges = false) {\n foreach ($this->_rows as $i => $row) {\n $this->_data[$i] = $row->toArray($decodePrivileges);\n }\n return $this->_data;\n }",
"public function getValues($row){\n $data = array();\n while( ($obj = oci_fetch_assoc($this->result)) != false ){\n $data[] = $obj[$row];\n }\n return $data;\n }",
"function getRowAsArray($query) {\n\t\topenDatabaseConnection();\n\t\t$result = mysql_query($query) or die(\"Invalid query: \" . mysql_error());\n\t\t# turn the result into an array\n\t\treturn mysql_fetch_assoc($result);\n\t}",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();"
] | [
"0.74998134",
"0.67951405",
"0.6701318",
"0.64403456",
"0.63062185",
"0.62881124",
"0.6234305",
"0.6158783",
"0.61094934",
"0.6091654",
"0.6083686",
"0.60407126",
"0.60230803",
"0.59716725",
"0.5964659",
"0.59583354",
"0.59583354",
"0.59583354",
"0.59583354",
"0.59583354",
"0.59583354",
"0.59515023",
"0.59515023",
"0.59515023",
"0.59515023",
"0.59515023",
"0.59515023",
"0.59515023",
"0.59515023",
"0.59515023"
] | 0.6808456 | 1 |
Import end of day options data. | private function _import_eod_options_data()
{
// Clear database.
DB::statement('TRUNCATE TABLE OptionsEod');
// Setup our models.
$symbols_model = App::make('App\Models\Symbols');
$optionseod_model = App::make('App\Models\OptionsEod');
// Lets get an index of all the underlying symbols.
$symbol_index = $symbols_model->get_index();
// Loop through the different files and import
foreach($this->_get_option_eod_summary_files() AS $file)
{
$this->info('Importing ' . $file);
// Batch var
$batch = [];
// Do the CSV magic.
$reader = Reader::createFromFileObject(new SplFileObject($file));
foreach($reader->query() AS $key => $row)
{
// Skip of the row is empty.
if((! isset($row[0])) || (! isset($row[1])))
{
continue;
}
// Skip the first row.
if($row[0] == 'underlying')
{
continue;
}
// See if we have an entry in the Symbols table for this symbol
if(! isset($symbol_index[strtoupper($row[0])]))
{
$sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]);
$symbol_index = $symbols_model->get_index();
} else
{
$sym_id = $symbol_index[strtoupper($row[0])];
}
// We insert in batches.
$batch[] = [
'OptionsEodSymbolId' => $sym_id,
'OptionsEodSymbolLast' => $row[1],
'OptionsEodType' => $row[5],
'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])),
'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])),
'OptionsEodStrike' => $row[8],
'OptionsEodLast' => $row[9],
'OptionsEodBid' => $row[10],
'OptionsEodAsk' => $row[11],
'OptionsEodVolume' => $row[12],
'OptionsEodOpenInterest' => $row[13],
'OptionsEodImpliedVol' => $row[14],
'OptionsEodDelta' => $row[15],
'OptionsEodGamma' => $row[16],
'OptionsEodTheta' => $row[17],
'OptionsEodVega' => $row[18],
'OptionsEodCreatedAt' => date('Y-m-d H:i:s')
];
// Insert the data into the OptionsEod table. We insert 1000 at a time.
if(count($batch) >= 1000)
{
DB::table('OptionsEod')->insert($batch);
$batch = [];
}
}
// Catch any left over.
if(count($batch) > 0)
{
DB::table('OptionsEod')->insert($batch);
}
}
// Now import all the data we collected daily.
$this->_import_daily_eod_options_data($symbol_index);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function set_end_options(): void {\n Simply_Static\\Options::instance()\n ->set('additional_files', Utils::array_to_option_string($this->files))\n ->set('additional_urls', Utils::array_to_option_string($this->urls))\n ->set('archive_end_time', Simply_Static\\Util::formatted_datetime())\n ->save();\n }",
"private function _import_daily_eod_options_data($symbol_index)\n\t{\n // Query dropbox and list files.\n $client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY'));\n $adapter = new DropboxAdapter($client);\n $db_filesystem = new Filesystem($adapter); \t\n \t$files = $db_filesystem->listContents('/', true);\n \t\n foreach($files AS $key => $row)\n {\n $toast = false;\n \n // Only want files.\n if($row['type'] != 'file')\n {\n continue;\n }\n \n // Only want zipfiles with daily\n if($row['extension'] != 'zip')\n {\n continue;\n }\n \n // Only want a certain type of file.\n if(! strpos($row['path'], 'alloptions/Daily/options_'))\n {\n continue;\n }\n \n // See if we need to download it or not.\n if(is_file('/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path']))\n {\n $file = '/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path'];\n } else\n {\n $toast = true;\n $file = '/tmp/' . basename($row['path']);\n $this->info('Dropbox: Downloading ' . $row['path']);\n file_put_contents($file, $db_filesystem->read($row['path']));\n }\n \t\n // Unzip the file.\n $filesystem = new Filesystem(new ZipArchiveAdapter($file));\n $list = $filesystem->listContents('/'); \n \n // File the file we want to import.\n foreach($list AS $key => $row)\n {\n // Just want the file with the options data.\n if(strpos($row['path'], 'ptions_'))\n {\n // Write the CSV file to the tmp dir.\n $this->info('Importing: ' . $row['path']);\n file_put_contents('/tmp/' . $row['path'], $filesystem->read($row['path']));\n \n // Now that we have the CSV lets start the import.\n $this->_import_from_daily_csv_file('/tmp/' . $row['path'], $symbol_index);\n }\n }\n \n // Toast temp file\n if($toast)\n {\n unlink($file);\n }\n }\n\t}",
"public function setEndDate( KCommandContext $context )\n {\n $data = $context->data;\n \n if( $data->day || $data->month || $data->year )\n { \n $date = new KDate();\n \n $date->day( (int) $data->day );\n \n $date->month( (int) $data->month );\n \n $date->year( (int) $data->year );\n \n $data->endDate = $date;\n }\n }",
"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}",
"public function hideEndDateWhenEmpty(DataContainer $dc)\r\n {\r\n $date = $this->Database->prepare(\"SELECT id, start_date FROM tl_ausschreibung WHERE start_date!='' AND end_date=''\")->execute();\r\n while ($row = $date->next())\r\n {\r\n $end_date = $this->Database->prepare(\"UPDATE tl_ausschreibung SET end_date = ? WHERE id = ?\");\r\n $end_date->execute($row->start_date, $row->id);\r\n }\r\n //Wenn end-datum leer ist, wird es ausgeblendet, das ist der Fall beim Erstellen neuer Anlaesse\r\n if ($dc->id != \"\" && $this->Input->get('mode') != 'csv_import')\r\n {\r\n\r\n $date = $this->Database->prepare(\"SELECT start_date FROM tl_ausschreibung WHERE id = ?\")->execute($dc->id);\r\n $date->fetchAssoc();\r\n if ($date->start_date == \"\")\r\n {\r\n $GLOBALS['TL_DCA']['tl_ausschreibung']['palettes']['default'] = 'start_date, art, ort, wettkampfform; zeit, trainer; kommentar; phase, trainingsstunden';\r\n }\r\n }\r\n\r\n }",
"protected function importData()\n\t{\n\t\tinclude_once \"./Services/ADN/ED/classes/class.adnSubobjective.php\";\n\t\t$subobjectives = adnSubobjective::getAllSubobjectives($this->objective_id);\n\n\t\t$this->setData($subobjectives);\n\t\t$this->setMaxCount(sizeof($subobjectives));\n\t}",
"protected function importData()\n\t{\n\t\t// get events\n\t\tinclude_once \"Services/ADN/EP/classes/class.adnExaminationEvent.php\";\n\t\t$events = adnExaminationEvent::getAllEvents($this->filter, $this->archived);\n\t\t\n\t\t// value mapping (to have correct sorting)\n\t\tif(sizeof($events))\n\t\t{\n\t\t\tinclude_once \"Services/ADN/EP/classes/class.adnAssignment.php\";\n\t\t\tinclude_once \"Services/ADN/ED/classes/class.adnSubjectArea.php\";\n\t\t\tforeach($events as $idx => $item)\n\t\t\t{\n\t\t\t\t$date = new ilDate($item[\"date_from\"]->get(IL_CAL_DATE), IL_CAL_DATE);\n\t\t\t\t$events[$idx][\"date_display\"] = ilDatePresentation::formatDate($date);\n\t\t\t\t$events[$idx][\"date\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'Y-m-d');\n\t\t\t\t$events[$idx][\"time_from\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"time_to\"] = $item[\"date_to\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"type\"] = $this->filter_options[\"type\"][$item[\"subject_area\"]];\n\t\t\t\t$events[$idx][\"type_color\"] = adnSubjectArea::getColorForArea($item[\"subject_area\"]);\n\n\t\t\t\t// we cannot use filter options because of archived values\n\t\t\t\t$events[$idx][\"facility\"] = adnExamFacility::lookupCity($item[\"md_exam_facility_id\"]);\n\n\t\t\t\tswitch($this->mode)\n\t\t\t\t{\n\t\t\t\t\tcase self::MODE_ASSIGNMENT:\n\t\t\t\t\t\t$users = adnAssignment::getAllAssignments(array(\"event_id\"=>$item[\"id\"]));\n\t\t\t\t\t\t$events[$idx][\"assigned\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase self::MODE_INVITATION:\n\t\t\t\t\t\t$users = adnAssignment::getAllInvitations($item[\"id\"]);\n\t\t\t\t\t\t$events[$idx][\"invitations\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase self::MODE_ATTENDANCE:\n\t\t\t\t\t\tinclude_once './Services/ADN/Report/classes/class.adnReportAttendanceList.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$events[$idx]['attendance'] = '';\n\t\t\t\t\t\tif(adnReportAttendanceList::lookupLastFile($item['id']) instanceof ilDateTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$events[$idx][\"attendance\"] = \n\t\t\t\t\t\t\t\tilDatePresentation::formatDate(\n\t\t\t\t\t\t\t\t\tadnReportAttendanceList::lookupLastFile($item['id']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->setData($events);\n\t\t$this->setMaxCount(sizeof($events));\n\t}",
"private function _retrieveEndDate()\n {\n global $preferences;\n\n $bdate = new \\DateTime($this->_begin_date);\n if ( $preferences->pref_beg_membership != '' ) {\n //case beginning of membership\n list($j, $m) = explode('/', $preferences->pref_beg_membership);\n $edate = new \\DateTime($bdate->format('Y') . '-' . $m . '-' . $j);\n while ( $edate <= $bdate ) {\n $edate->modify('+1 year');\n }\n $this->_end_date = $edate->format('Y-m-d');\n } else if ( $preferences->pref_membership_ext != '' ) {\n //case membership extension\n $dext = new \\DateInterval('P' . $this->_extension . 'M');\n $edate = $bdate->add($dext);\n $this->_end_date = $edate->format('Y-m-d');\n }\n }",
"public function saveData()\n {\n $newSku = $this->_entityModel->getNewSku();\n while ($bunch = $this->_entityModel->getNextBunch()) {\n foreach ($bunch as $rowNum => $rowData) {\n if (!$this->_entityModel->isRowAllowedToImport($rowData, $rowNum)) {\n continue;\n }\n\n if (version_compare($this->_entityModel->getProductMetadata()->getVersion(), '2.2.0', '>=')) {\n $rowSku = strtolower($rowData[ImportProduct::COL_SKU]);\n } else {\n $rowSku = $rowData[ImportProduct::COL_SKU];\n }\n $productData = $newSku[$rowSku];\n $this->parseOptions($rowData, $productData[$this->getProductEntityLinkField()]);\n }\n if (!empty($this->cachedOptions['sample']) || !empty($this->cachedOptions['link'])) {\n $this->saveOptions();\n $this->clear();\n }\n }\n return $this;\n }",
"function cs_theme_option_import_export() {\n\t$a = unserialize(base64_decode($_POST['theme_option_data']));\n\tupdate_option( \"cs_theme_option\", $a );\n\techo \"Otions Imported\";\n\tdie();\n}",
"private function get_options($post){\n\t\t//Build array of user import fields\n\t\t$importFields = array();\n\t\t\n\t\t$fileType = $post['file_type'];\n\t\t$fileFeed = $post['feed'];\n\t\t$filePath = $post['xpath'];\n\t\t\n\t\tif($fileType=='xml'):\n\t\t\t$fileData = file_get_contents($fileFeed);\n\t\t\t\n\t\t\t$dom = new DomDocument();\n\t\t\t$dom->loadXML($fileData);\n\t\t\t$xmlArray = $this->xml_to_array($dom);\n\t\t\t\n\t\t\t$importFields = $this->get_xpath($xmlArray, $filePath);\n\t\t\t$importFields = $this->get_keys($importFields);\n\t\t\t\n\t\telseif($fileType=='csv'):\n\t\t\t$row = 1;\n\t\t\tif (($handle = fopen($fileFeed, 'r')) !== FALSE):\n\t\t\t\twhile (($data = fgetcsv($handle, 1000, ',')) !== FALSE):\n\t\t\t\t\t//get first line column names and break\n\t\t\t\t\t$importFields = $data;\n\t\t\t\t\tbreak;\n\t\t\t\tendwhile;\n\t\t\t\t\n\t\t\t\tfclose($handle);\n\t\t\tendif;\n\t\tendif;\n\t\t\n\t\t//create import fields drop down\n\t\t$options = array();\n\t\tforeach($importFields as $field):\n\t\t\t//$options .= '<option vlaue=\"'.$field.'\">'.$field.'</option>';\n\t\t\t$options[$field] = $field;\n\t\tendforeach;\n\t\t\n\t\treturn $options;\n\t}",
"public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }",
"public function finish_database_export() {\n $this->importer->finish_database_import();\n }",
"public function getEndDate()\n {\n if ( ! $this->getData('end_date'))\n {\n return \"-\";\n }\n\n return $this->getData('end_date');\n }",
"public function away_mode_end_time() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 6:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Hour Field\n\t\t$content = '<select name=\"itsec_away_mode[away_end][hour]\" id=\"itsec_away_mode_away_mod_end_time\">';\n\n\t\tfor ( $i = 1; $i <= 12; $i ++ ) {\n\t\t\t$content .= '<option value=\"' . sprintf( '%02d', $i ) . '\" ' . selected( date( 'g', $end ), $i, false ) . '>' . $i . '</option>';\n\t\t}\n\n\t\t$content .= '</select>';\n\n\t\t//Minute Field\n\t\t$content .= '<select name=\"itsec_away_mode[away_end][minute]\" id=\"itsec_away_mode_away_mod_end_time\">';\n\n\t\tfor ( $i = 0; $i <= 59; $i ++ ) {\n\n\t\t\t$content .= '<option value=\"' . sprintf( '%02d', $i ) . '\" ' . selected( date( 'i', $end ), sprintf( '%02d', $i ), false ) . '>' . sprintf( '%02d', $i ) . '</option>';\n\t\t}\n\n\t\t$content .= '</select>';\n\n\t\t//AM/PM Field\n\t\t$content .= '<select name=\"itsec_away_mode[away_end][sel]\" id=\"itsec_away_mode\">';\n\t\t$content .= '<option value=\"am\" ' . selected( date( 'a', $end ), 'am', false ) . '>' . __( 'am', 'it-l10n-ithemes-security-pro' ) . '</option>';\n\t\t$content .= '<option value=\"pm\" ' . selected( date( 'a', $end ), 'pm', false ) . '>' . __( 'pm', 'it-l10n-ithemes-security-pro' ) . '</option>';\n\t\t$content .= '</select><br>';\n\t\t$content .= '<label for=\"itsec_away_mode_away_mod_end_time\"> ' . __( 'Set the time at which the admin dashboard should become available again.', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}",
"private function _get_data_from_dropbox()\n {\n $tmp = '/tmp/market_data/';\n \n // tmp/market_data/\n if(! is_dir($tmp))\n {\n mkdir($tmp);\n }\n\n // data/optionsendofday/IWM\n if(! is_dir($tmp . '/data/OptionsEndOfDay/IWM'))\n {\n mkdir($tmp . '/data/OptionsEndOfDay/IWM', 0777, true);\n }\n\n // data/optionsendofday/SPY\n if(! is_dir($tmp . '/data/OptionsEndOfDay/SPY'))\n {\n mkdir($tmp . '/data/OptionsEndOfDay/SPY', 0777, true);\n }\n \n // Query dropbox and list files.\n $client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY'));\n $adapter = new DropboxAdapter($client);\n $filesystem = new Filesystem($adapter); \n\n // Loop through and download the data\n foreach($this->eod_option_summary_files AS $key => $row)\n {\n if(is_file($tmp . $row))\n {\n $this->info('Dropbox Already Stored: ' . $row . ' ' . ($key+1) . ' of ' . count($this->eod_option_summary_files));\n continue;\n }\n \n // Download and store.\n file_put_contents($tmp . $row, $filesystem->read($row));\n $this->info('Dropbox Stored: ' . $row . ' ' . ($key+1) . ' of ' . count($this->eod_option_summary_files)); \n }\n }",
"public function testExportWithMultipleOptions(): void\n {\n $expectedCount = 1;\n $resultsFilename = 'export_results.csv';\n $this->model->setWriter(\n $this->objectManager->create(\n \\Magento\\ImportExport\\Model\\Export\\Adapter\\Csv::class\n )\n );\n $exportData = $this->model->export();\n\n $varDirectory = $this->objectManager->get(\\Magento\\Framework\\Filesystem::class)\n ->getDirectoryWrite(\\Magento\\Framework\\App\\Filesystem\\DirectoryList::VAR_DIR);\n $varDirectory->writeFile($resultsFilename, $exportData);\n /** @var \\Magento\\Framework\\File\\Csv $csv */\n $csv = $this->objectManager->get(\\Magento\\Framework\\File\\Csv::class);\n $data = $csv->getData($varDirectory->getAbsolutePath($resultsFilename));\n $actualCount = count($data) - 1;\n\n $this->assertSame($expectedCount, $actualCount);\n }",
"private function _import_from_daily_csv_file($file, $symbol_index)\n {\n $batch = [];\n \n // Do the CSV magic.\n $reader = Reader::createFromFileObject(new SplFileObject($file));\n \n // symbols model\n $symbols_model = App::make('App\\Models\\Symbols');\n \n // Loop through the option data.\n foreach($reader->query() AS $key => $row) \n {\t\n // Only care about some symbols\n if(! in_array(strtolower($row[0]), $this->eod_option_daily_symbols))\n {\n continue;\n }\n \n // See if we have an entry in the Symbols table for this symbol\n if(! isset($symbol_index[strtoupper($row[0])]))\n {\n $sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]);\n $symbol_index = $symbols_model->get_index();\n } else\n {\n $sym_id = $symbol_index[strtoupper($row[0])];\n } \n \n // We insert in batches.\n DB::table('OptionsEod')->insert([\n 'OptionsEodSymbolId' => $sym_id,\n 'OptionsEodSymbolLast' => $row[1],\n 'OptionsEodType' => $row[5],\n 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])),\n 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])),\n 'OptionsEodStrike' => $row[8],\n 'OptionsEodLast' => $row[9],\n 'OptionsEodBid' => $row[10],\n 'OptionsEodAsk' => $row[11],\n 'OptionsEodVolume' => $row[12],\n 'OptionsEodOpenInterest' => $row[13],\n 'OptionsEodImpliedVol' => $row[14],\n 'OptionsEodDelta' => $row[15],\n 'OptionsEodGamma' => $row[16],\n 'OptionsEodTheta' => $row[17],\n 'OptionsEodVega' => $row[18],\n 'OptionsEodCreatedAt' => date('Y-m-d H:i:s')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n ]);\n }\n \n // Delete tmp file.\n unlink($file); \n }",
"public function set_location_trading_hour_days(){}",
"static function add_bod_voting_end(): void {\r\n\t\tself::add_acf_inner_field(self::bods, self::bod_voting_end, [\r\n\t\t\t'label' => 'Voting period end',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 29 @ 6 p.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::bod_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}",
"public function setEndDate($date)\n\t\t{\n\t\t\t$this->end_date = $date;\n\t\t}",
"public function finish_database_export() {\n }",
"function setEndDate($end_date = \"\") \n\t{\n\t\t$this->end_date = $end_date;\n\t}",
"function &getEndorsments() {\n $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');\n return $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->getArticleId(), SUPP_FILE_ENDORSMENT, $this->getId());\n\t}",
"protected function importDatabaseData() {}",
"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 exportTiendasToCsv(){\n $Fecha = date('d-m-Y');\n #$Hora = date('H:i:s');\n #$fechahora = \"(\".$Fecha.\"-\".$Hora.\")\";\n\n $consulta = $this->db->prepare(\"\n SELECT\n 'COD_TIENDA'\n ,'COD_BTK'\n ,'TIENDA_NAME'\n ,'DIRECCION'\n ,'COD_CLIENTE'\n ,'CLIENTE_NAME'\n ,'COD_REGION'\n ,'REGION_NAME'\n ,'COD_CIUDAD'\n ,'CIUDAD_NAME'\n ,'COD_COMUNA'\n ,'COMUNA_NAME'\n ,'COD_ZONA'\n ,'ZONA_NAME'\n ,'COD_TIPO'\n ,'TIPO_NAME'\n ,'COD_AGRUPACION'\n ,'AGRUPACION_NAME'\n ,'COD_ESTADO'\n ,'ESTADO_NAME'\n UNION ALL\n SELECT \n TI.COD_TIENDA,\n TI.COD_BTK,\n TI.NOM_TIENDA,\n IFNULL(TI.DIREC_TIENDA,'') AS DIRECCION,\n CL.COD_CLIENTE,\n CL.NOM_CLIENTE,\n IFNULL(RG.COD_REGION, '') AS COD_REGION,\n IFNULL(RG.NOM_REGION, '') AS NOM_REGION,\n IFNULL(CT.COD_CIUDAD, '') AS COD_CIUDAD,\n IFNULL(CT.NOM_CIUDAD, '') AS NOM_CIUDAD,\n IFNULL(CM.COD_COMUNA, '') AS COD_COMUNA,\n IFNULL(CM.NOM_COMUNA, '') AS NOM_COMUNA,\n IFNULL(ZN.COD_ZONA, '') AS COD_ZONA,\n IFNULL(ZN.NOM_ZONA, '') AS NOM_ZONA,\n IFNULL(TT.COD_TIPO, '') AS COD_TIPO,\n IFNULL(TT.NOM_TIPO, '') AS NOM_TIPO,\n IFNULL(AG.COD_AGRUPACION, '') AS COD_AGRUPACION,\n IFNULL(AG.NOM_AGRUPACION, '') AS NOM_AGRUPACION,\n IFNULL(ET.COD_ESTADO, '') AS COD_ESTADO,\n IFNULL(ET.NOM_ESTADO, '') AS NOM_ESTADO\n FROM T_TIENDA TI\n LEFT OUTER JOIN T_CLIENTE CL ON CL.COD_CLIENTE = TI.CLIENTE_COD_CLIENTE\n LEFT OUTER JOIN T_TIENDA_ESTADO ET ON ET.COD_ESTADO = TI.ESTADO_COD_ESTADO\n LEFT OUTER JOIN T_COMUNA CM ON (CM.COD_COMUNA = TI.COMUNA_COD_COMUNA)\n AND (CM.CIUDAD_COD_CIUDAD = TI.COMUNA_CIUDAD_COD_CIUDAD)\n AND (CM.CIUDAD_REGION_COD_REGION = TI.COMUNA_CIUDAD_REGION_COD_REGION)\n LEFT OUTER JOIN T_CIUDAD CT ON CT.COD_CIUDAD = CM.CIUDAD_COD_CIUDAD\n LEFT OUTER JOIN T_REGION RG ON RG.COD_REGION = CM.CIUDAD_REGION_COD_REGION\n LEFT OUTER JOIN T_TIENDA_ZONA ZN ON ZN.COD_ZONA = TI.ZONA_COD_ZONA\n LEFT OUTER JOIN T_TIPO_TIENDA TT ON TT.COD_TIPO = TI.TIPO_TIENDA_COD_TIPO\n LEFT OUTER JOIN T_AGRUPACION AG ON AG.COD_AGRUPACION = TI.AGRUPACION_COD_AGRUPACION \n WHERE TI.COD_TIENDA NOT LIKE '%N/A%'\n AND TI.COD_BTK NOT LIKE '%N/A%'\n INTO OUTFILE '\".$this->apache.$this->root.\"views/tmp/SOM_TIENDAS_\".$Fecha.\".csv'\n CHARACTER SET latin1\n FIELDS TERMINATED BY ';'\n LINES TERMINATED BY '\\n'\");\n \n //OPTIONALLY ENCLOSED BY '\\\"'\n \n $consulta->execute();\n\n // hold & go to be sure\n sleep(2);\n \n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"SOM_TIENDAS_'.$Fecha.'.csv\"');\n header('Cache-Control: max-age=0');\n \n readfile(''.$this->apache.$this->root.'views/tmp/SOM_TIENDAS_'.$Fecha.'.csv');\n unlink(''.$this->apache.$this->root.'views/tmp/SOM_TIENDAS_'.$Fecha.'.csv');\n \n// $error = $consulta->errorInfo();\n// echo $error[2];\n }",
"function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}",
"function ExportData() {\n\t\tglobal $archv_finished;\n\t\t$utf8 = FALSE;\n\t\t$bSelectLimit = FALSE;\n\n\t\t// Load recordset\n\t\tif ($bSelectLimit) {\n\t\t\t$this->lTotalRecs = $archv_finished->SelectRecordCount();\n\t\t} else {\n\t\t\tif ($rs = $this->LoadRecordset())\n\t\t\t\t$this->lTotalRecs = $rs->RecordCount();\n\t\t}\n\t\t$this->lStartRec = 1;\n\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t// Set the last record to display\n\t\tif ($this->lDisplayRecs < 0) {\n\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t} else {\n\t\t\t$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n\t\t}\n\t\tif (!$rs) {\n\t\t\theader(\"Content-Type:\"); // Remove header\n\t\t\theader(\"Content-Disposition:\");\n\t\t\t$this->ShowMessage();\n\t\t\treturn;\n\t\t}\n\t\tif ($archv_finished->Export == \"xml\") {\n\t\t\t$XmlDoc = new cXMLDocument(EW_XML_ENCODING);\n\t\t\t$XmlDoc->AddRoot();\n\t\t} else {\n\t\t\t$ExportDoc = new cExportDocument($archv_finished, \"v\");\n\t\t\t$ExportDoc->ExportHeader();\n\t\t\tif ($ExportDoc->Horizontal) { // Horizontal format, write header\n\t\t\t\t$ExportDoc->BeginExportRow();\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->ID);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strjrfnum);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strquarter);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strmon);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->stryear);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strdate);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strtime);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strusername);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strusereadd);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strcompany);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strdepartment);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strloc);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strposition);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strtelephone);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strcostcent);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strsubject);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strnature);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strdescript);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strarea);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strattach);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strpriority);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strduedate);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strstatus);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strlastedit);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strcategory);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strassigned);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strdatecomplete);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strwithpr);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strremarks);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->sap_num);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->work_days);\n\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t}\n\t\t}\n\n\t\t// Move to first record\n\t\t$this->lRecCnt = $this->lStartRec - 1;\n\t\tif (!$rs->EOF) {\n\t\t\t$rs->MoveFirst();\n\t\t\tif (!$bSelectLimit && $this->lStartRec > 1)\n\t\t\t\t$rs->Move($this->lStartRec - 1);\n\t\t}\n\t\twhile (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n\t\t\t$this->lRecCnt++;\n\t\t\tif (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n\t\t\t\t$this->LoadRowValues($rs);\n\n\t\t\t\t// Render row\n\t\t\t\t$archv_finished->CssClass = \"\";\n\t\t\t\t$archv_finished->CssStyle = \"\";\n\t\t\t\t$archv_finished->RowType = EW_ROWTYPE_VIEW; // Render view\n\t\t\t\t$this->RenderRow();\n\t\t\t\tif ($archv_finished->Export == \"xml\") {\n\t\t\t\t\t$XmlDoc->AddRow();\n\t\t\t\t\t$XmlDoc->AddField('ID', $archv_finished->ID->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strjrfnum', $archv_finished->strjrfnum->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strquarter', $archv_finished->strquarter->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strmon', $archv_finished->strmon->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('stryear', $archv_finished->stryear->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strdate', $archv_finished->strdate->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strtime', $archv_finished->strtime->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strusername', $archv_finished->strusername->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strusereadd', $archv_finished->strusereadd->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strcompany', $archv_finished->strcompany->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strdepartment', $archv_finished->strdepartment->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strloc', $archv_finished->strloc->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strposition', $archv_finished->strposition->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strtelephone', $archv_finished->strtelephone->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strcostcent', $archv_finished->strcostcent->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strsubject', $archv_finished->strsubject->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strnature', $archv_finished->strnature->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strdescript', $archv_finished->strdescript->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strarea', $archv_finished->strarea->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strattach', $archv_finished->strattach->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strpriority', $archv_finished->strpriority->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strduedate', $archv_finished->strduedate->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strstatus', $archv_finished->strstatus->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strlastedit', $archv_finished->strlastedit->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strcategory', $archv_finished->strcategory->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strassigned', $archv_finished->strassigned->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strdatecomplete', $archv_finished->strdatecomplete->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strwithpr', $archv_finished->strwithpr->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strremarks', $archv_finished->strremarks->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('sap_num', $archv_finished->sap_num->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('work_days', $archv_finished->work_days->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t} else {\n\t\t\t\t\t$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->ID);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strjrfnum);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strquarter);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strmon);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->stryear);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strdate);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strtime);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strusername);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strusereadd);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strcompany);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strdepartment);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strloc);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strposition);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strtelephone);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strcostcent);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strsubject);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strnature);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strdescript);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strarea);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strattach);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strpriority);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strduedate);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strstatus);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strlastedit);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strcategory);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strassigned);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strdatecomplete);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strwithpr);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strremarks);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->sap_num);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->work_days);\n\t\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\tif ($archv_finished->Export <> \"xml\")\n\t\t\t$ExportDoc->ExportFooter();\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\n\t\t// Clean output buffer\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\n\t\t\tob_end_clean();\n\n\t\t// Write BOM if utf-8\n\t\tif ($utf8 && !in_array($archv_finished->Export, array(\"email\", \"xml\")))\n\t\t\techo \"\\xEF\\xBB\\xBF\";\n\n\t\t// Write debug message if enabled\n\t\tif (EW_DEBUG_ENABLED)\n\t\t\techo ew_DebugMsg();\n\n\t\t// Output data\n\t\tif ($archv_finished->Export == \"xml\") {\n\t\t\theader(\"Content-Type: text/xml\");\n\t\t\techo $XmlDoc->XML();\n\t\t} elseif ($archv_finished->Export == \"email\") {\n\t\t\t$this->ExportEmail($ExportDoc->Text);\n\t\t\t$this->Page_Terminate($archv_finished->ExportReturnUrl());\n\t\t} else {\n\t\t\techo $ExportDoc->Text;\n\t\t}\n\t}",
"private function export_options ( $export ) {\n\t\t\t\n\t\t\t$properties = $export->addChild( 'extended-properties' );\n\t\t\t\n\t\t\t$options = DB::get_results( 'select name, value, type from {options}' );\n\t\t\tforeach ( $options as $option ) {\n\t\t\t\t\n\t\t\t\t$property = $properties->addChild( 'property' );\n\t\t\t\t$property->addAttribute( 'name', $option->name );\n\t\t\t\t$property->addAttribute( 'value', $option->value );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}"
] | [
"0.6324207",
"0.5772403",
"0.53170556",
"0.51526564",
"0.5148073",
"0.5027425",
"0.50140834",
"0.5002238",
"0.496932",
"0.4896738",
"0.48954314",
"0.4885654",
"0.47373962",
"0.47163844",
"0.47014284",
"0.4681895",
"0.4670022",
"0.46614787",
"0.46241546",
"0.46133116",
"0.4609446",
"0.46060383",
"0.45794213",
"0.45744455",
"0.456016",
"0.45571342",
"0.4553179",
"0.45414788",
"0.4538277",
"0.45328146"
] | 0.6520106 | 0 |
Import data we have gotten on a daily baises from EOD Options. | private function _import_daily_eod_options_data($symbol_index)
{
// Query dropbox and list files.
$client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY'));
$adapter = new DropboxAdapter($client);
$db_filesystem = new Filesystem($adapter);
$files = $db_filesystem->listContents('/', true);
foreach($files AS $key => $row)
{
$toast = false;
// Only want files.
if($row['type'] != 'file')
{
continue;
}
// Only want zipfiles with daily
if($row['extension'] != 'zip')
{
continue;
}
// Only want a certain type of file.
if(! strpos($row['path'], 'alloptions/Daily/options_'))
{
continue;
}
// See if we need to download it or not.
if(is_file('/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path']))
{
$file = '/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path'];
} else
{
$toast = true;
$file = '/tmp/' . basename($row['path']);
$this->info('Dropbox: Downloading ' . $row['path']);
file_put_contents($file, $db_filesystem->read($row['path']));
}
// Unzip the file.
$filesystem = new Filesystem(new ZipArchiveAdapter($file));
$list = $filesystem->listContents('/');
// File the file we want to import.
foreach($list AS $key => $row)
{
// Just want the file with the options data.
if(strpos($row['path'], 'ptions_'))
{
// Write the CSV file to the tmp dir.
$this->info('Importing: ' . $row['path']);
file_put_contents('/tmp/' . $row['path'], $filesystem->read($row['path']));
// Now that we have the CSV lets start the import.
$this->_import_from_daily_csv_file('/tmp/' . $row['path'], $symbol_index);
}
}
// Toast temp file
if($toast)
{
unlink($file);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _import_eod_options_data()\n\t{\n // Clear database.\n DB::statement('TRUNCATE TABLE OptionsEod'); \t\n \t\n\t\t// Setup our models.\n\t\t$symbols_model = App::make('App\\Models\\Symbols');\n\t\t$optionseod_model = App::make('App\\Models\\OptionsEod');\n\t\t\n\t\t// Lets get an index of all the underlying symbols.\n\t\t$symbol_index = $symbols_model->get_index(); \t\n \t \t\n // Loop through the different files and import\n foreach($this->_get_option_eod_summary_files() AS $file)\n {\n $this->info('Importing ' . $file);\n \n // Batch var\n $batch = []; \n \n // Do the CSV magic.\n\t\t\t$reader = Reader::createFromFileObject(new SplFileObject($file));\n\t\t\t\n\t\t\tforeach($reader->query() AS $key => $row) \n\t\t\t{\t\n\t\t\t\t// Skip of the row is empty.\n\t\t\t\tif((! isset($row[0])) || (! isset($row[1])))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t// Skip the first row.\n\t\t\t\tif($row[0] == 'underlying')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// See if we have an entry in the Symbols table for this symbol\n\t\t\t\tif(! isset($symbol_index[strtoupper($row[0])]))\n\t\t\t\t{\n\t\t\t\t\t$sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]);\n\t\t\t\t\t$symbol_index = $symbols_model->get_index();\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$sym_id = $symbol_index[strtoupper($row[0])];\n\t\t\t\t}\n\t\t\t\t\n // We insert in batches.\n $batch[] = [\n \t\t\t 'OptionsEodSymbolId' => $sym_id,\n \t\t\t 'OptionsEodSymbolLast' => $row[1],\n \t\t\t 'OptionsEodType' => $row[5],\n \t\t\t 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])),\n \t\t\t 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])),\n \t\t\t 'OptionsEodStrike' => $row[8],\n \t\t\t 'OptionsEodLast' => $row[9],\n \t\t\t 'OptionsEodBid' => $row[10],\n \t\t\t 'OptionsEodAsk' => $row[11],\n \t\t\t 'OptionsEodVolume' => $row[12],\n \t\t\t 'OptionsEodOpenInterest' => $row[13],\n \t\t\t 'OptionsEodImpliedVol' => $row[14],\n \t\t\t 'OptionsEodDelta' => $row[15],\n \t\t\t 'OptionsEodGamma' => $row[16],\n \t\t\t 'OptionsEodTheta' => $row[17],\n \t\t\t 'OptionsEodVega' => $row[18],\n \t\t\t 'OptionsEodCreatedAt' => date('Y-m-d H:i:s')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t];\n\t\t\t\n\t\t\t\t// Insert the data into the OptionsEod table. We insert 1000 at a time.\n\t\t\t\tif(count($batch) >= 1000)\n\t\t\t\t{\n\t\t\t\t DB::table('OptionsEod')->insert($batch);\n\t\t\t\t $batch = [];\t\n }\n \t\t}\n \t\t\n // Catch any left over.\n if(count($batch) > 0)\n {\n DB::table('OptionsEod')->insert($batch);\n }\t\n }\n \n // Now import all the data we collected daily.\n $this->_import_daily_eod_options_data($symbol_index);\n\t}",
"protected function importData()\n\t{\n\t\t// get events\n\t\tinclude_once \"Services/ADN/EP/classes/class.adnExaminationEvent.php\";\n\t\t$events = adnExaminationEvent::getAllEvents($this->filter, $this->archived);\n\t\t\n\t\t// value mapping (to have correct sorting)\n\t\tif(sizeof($events))\n\t\t{\n\t\t\tinclude_once \"Services/ADN/EP/classes/class.adnAssignment.php\";\n\t\t\tinclude_once \"Services/ADN/ED/classes/class.adnSubjectArea.php\";\n\t\t\tforeach($events as $idx => $item)\n\t\t\t{\n\t\t\t\t$date = new ilDate($item[\"date_from\"]->get(IL_CAL_DATE), IL_CAL_DATE);\n\t\t\t\t$events[$idx][\"date_display\"] = ilDatePresentation::formatDate($date);\n\t\t\t\t$events[$idx][\"date\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'Y-m-d');\n\t\t\t\t$events[$idx][\"time_from\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"time_to\"] = $item[\"date_to\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"type\"] = $this->filter_options[\"type\"][$item[\"subject_area\"]];\n\t\t\t\t$events[$idx][\"type_color\"] = adnSubjectArea::getColorForArea($item[\"subject_area\"]);\n\n\t\t\t\t// we cannot use filter options because of archived values\n\t\t\t\t$events[$idx][\"facility\"] = adnExamFacility::lookupCity($item[\"md_exam_facility_id\"]);\n\n\t\t\t\tswitch($this->mode)\n\t\t\t\t{\n\t\t\t\t\tcase self::MODE_ASSIGNMENT:\n\t\t\t\t\t\t$users = adnAssignment::getAllAssignments(array(\"event_id\"=>$item[\"id\"]));\n\t\t\t\t\t\t$events[$idx][\"assigned\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase self::MODE_INVITATION:\n\t\t\t\t\t\t$users = adnAssignment::getAllInvitations($item[\"id\"]);\n\t\t\t\t\t\t$events[$idx][\"invitations\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase self::MODE_ATTENDANCE:\n\t\t\t\t\t\tinclude_once './Services/ADN/Report/classes/class.adnReportAttendanceList.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$events[$idx]['attendance'] = '';\n\t\t\t\t\t\tif(adnReportAttendanceList::lookupLastFile($item['id']) instanceof ilDateTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$events[$idx][\"attendance\"] = \n\t\t\t\t\t\t\t\tilDatePresentation::formatDate(\n\t\t\t\t\t\t\t\t\tadnReportAttendanceList::lookupLastFile($item['id']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->setData($events);\n\t\t$this->setMaxCount(sizeof($events));\n\t}",
"public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }",
"protected function importDatabaseData() {}",
"public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }",
"function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}",
"private function _import_from_daily_csv_file($file, $symbol_index)\n {\n $batch = [];\n \n // Do the CSV magic.\n $reader = Reader::createFromFileObject(new SplFileObject($file));\n \n // symbols model\n $symbols_model = App::make('App\\Models\\Symbols');\n \n // Loop through the option data.\n foreach($reader->query() AS $key => $row) \n {\t\n // Only care about some symbols\n if(! in_array(strtolower($row[0]), $this->eod_option_daily_symbols))\n {\n continue;\n }\n \n // See if we have an entry in the Symbols table for this symbol\n if(! isset($symbol_index[strtoupper($row[0])]))\n {\n $sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]);\n $symbol_index = $symbols_model->get_index();\n } else\n {\n $sym_id = $symbol_index[strtoupper($row[0])];\n } \n \n // We insert in batches.\n DB::table('OptionsEod')->insert([\n 'OptionsEodSymbolId' => $sym_id,\n 'OptionsEodSymbolLast' => $row[1],\n 'OptionsEodType' => $row[5],\n 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])),\n 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])),\n 'OptionsEodStrike' => $row[8],\n 'OptionsEodLast' => $row[9],\n 'OptionsEodBid' => $row[10],\n 'OptionsEodAsk' => $row[11],\n 'OptionsEodVolume' => $row[12],\n 'OptionsEodOpenInterest' => $row[13],\n 'OptionsEodImpliedVol' => $row[14],\n 'OptionsEodDelta' => $row[15],\n 'OptionsEodGamma' => $row[16],\n 'OptionsEodTheta' => $row[17],\n 'OptionsEodVega' => $row[18],\n 'OptionsEodCreatedAt' => date('Y-m-d H:i:s')\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n ]);\n }\n \n // Delete tmp file.\n unlink($file); \n }",
"public function importAction()\n {\n \n $directory = 'data/officialstations/es/json/latest';\n $country = 'ES';\n \n $request = $this->getRequest();\n $filename = $request->getParam('filename', false);\n $verbose = $request->getParam('verbose', false) || $request->getParam('v', false);\n\n $fueltypes = array(\n 'BIE.json'=>9,\n 'BIO.json'=>7,\n 'G95.json'=>8,\n 'G98.json'=>2,\n 'GLP.json'=>10,\n 'GNC.json'=>11,\n 'GOA.json'=>3,\n 'GOB.json'=>5,\n 'GOC.json'=>6,\n 'GPR.json'=>1,\n 'NGO.json'=>4\n );\n \n // purge cache for every configuration\n if ($filename)\n {\n// $result = $this->priceMapper->truncate();\n $this->priceMapper->countChanges = 0;\n $this->priceMapper->cycleFailsFilename();\n \n // echo $iterator->getFilename() . \"\\n\";\n echo $filename . \"\\n\";\n if($filename == 'All')\n {\n foreach($fueltypes as $file => $id)\n {\n echo $file.\"\\n\";\n $content = file_get_contents($directory.'/'.$file);\n $content = json_decode($content);\n foreach($content as $key => $value)\n {\n// $value['created'] = '2014-06-14';\n $result = $this->stationMapper->save($value); \n $price = array('idoffstation'=>$result,\n 'price'=>$value->price,\n 'idfueltype'=>$fueltypes[$file]\n );\n $result = $this->priceMapper->save($price);\n }\n }\n }\n else \n {\n // $content = file_get_contents($directory.'/'.$iterator->getFilename());\n $content = file_get_contents($directory.'/'.$filename);\n $content = json_decode($content);\n foreach($content as $key => $value)\n {\n $result = $this->stationMapper->save($value);\n $price = array('idoffstation'=>$result,\n 'price'=>$value->price,\n 'idfueltype'=>$fueltypes[$filename]\n );\n $result = $this->priceMapper->save($price);\n }\n }\n echo $this->priceMapper->countChanges;\n }\n\n $this->output('Collecting all assets...', $verbose);\n $this->output(sprintf('Importing finished...', $verbose));\n }",
"protected function importData()\n\t{\n\t\tinclude_once \"./Services/ADN/ED/classes/class.adnSubobjective.php\";\n\t\t$subobjectives = adnSubobjective::getAllSubobjectives($this->objective_id);\n\n\t\t$this->setData($subobjectives);\n\t\t$this->setMaxCount(sizeof($subobjectives));\n\t}",
"public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }",
"public function importdinst()\n {\n\n // $start_week = DB::select(\"SELECT startweek FROM pmanagers WHERE name = 'inst'\");\n\n // $start_week = $start_week[0]->startweek; // Semana de inicio de la curva, viene de Pmanager\n\n // $hinsts_total = DB::select(\"SELECT CURDATE() AS date, 'TOTAL' AS area, SUM(total_progress) AS progress FROM pinsts_view\");\n // $progress_inst = DB::select(\"SELECT DISTINCT total_pinsthours FROM total_pinsts_view\"); \n\n // $current_date = date('Y-m-d'); // Para echar una semana atrás\n\n // if (!is_null($progress_inst[0]->total_pinsthours)){ // valido existencia de progreso, si no hay es que pertenece a la carga inicial por lo que no inserta en historia\n\n\n // $sweek_validate = DB::select(\"SELECT * FROM hinsts WHERE area='TOTAL'\"); \n\n\n // if(count($sweek_validate)==0){ // Este proceso solo se realiza la primera vez y es para cargar campos dummy en la curva\n\n\n // for ($i = 1; $i <= ($start_week-1); $i++) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>'TOTAL',\n // 'progress' =>0,\n\n // ]);\n // }\n\n // } // fin proceso\n\n\n \n\n\n // foreach ($hinsts_total as $hinsts_totals) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>$hinsts_totals->area,\n // 'progress' =>$hinsts_totals->progress,\n\n // ]);\n // }\n\n\n // // HISTORIAL PROGRESO instPOS POR AREA \n\n // $units=DB::select(\"SELECT DISTINCT units_id FROM pinsts_view\");\n // foreach ($units as $unitss) {\n\n // DB::statement(DB::raw(\"SET @area_id=\".$unitss->units_id));\n\n // $hinsts_area = DB::select(\"SELECT DISTINCT CURDATE() AS date, (SELECT units.name FROM units WHERE units.id=@area_id) as area, ((SELECT SUM(total_progress_area) FROM pinsts_view WHERE units_id=@area_id)*100) as progress FROM pinsts_view;\");\n\n\n // foreach ($hinsts_area as $hinsts_areas) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>$hinsts_areas->area,\n // 'progress' =>$hinsts_areas->progress,\n\n // ]);\n // }\n // }\n\n // }\n\n // //}\n\n\n \n \n DB::table('dinstsnews')->truncate();\n\n Excel::load('e3dreports\\StatusReport-Inst.csv', function($reader) {\n \n\n \n\n \n foreach ($reader->get() as $dinst) {\n\n if($dinst->progress){\n \n $progress = DB::select(\"SELECT * FROM pinsts WHERE percentage=\".$dinst->progress);\n $progress= $progress[0]->percentage; \n $progress_id= $progress[0]->id; \n\n }else{\n\n $progress=0;\n\n }\n\n if($dinst->unit){\n \n $units_id = DB::select(\"SELECT id FROM units WHERE name=\".\"'\".$dinst->unit.\"'\");\n $units_id = $units_id[0]->id;\n\n }else{\n\n\n $units_id=0; \n\n }\n\n // CUSTOM PARA IQOXE\n // $areas_id = DB::select(\"SELECT id FROM areas WHERE name=\".\"'\".$dinst->area.\"'\");\n // $areas_id = $areas_id[0]->id; \n\n if ((strlen(strstr($dinst->area,'30'))>0) OR (strlen(strstr($dinst->area,'63'))>0)) { \n\n $areas_id=0; \n\n }else{\n\n $areas_id=1;\n\n }\n\n // FIN CUSTOM \n\n $tinsts_id = DB::select(\"SELECT id FROM tinsts WHERE code=\".\"'\".$dinst->type.\"'\");\n \n\n if(count($tinsts_id)==0) {\n\n $tinsts_id=999;\n\n }else{\n\n $tinsts_id = $tinsts_id[0]->id;\n\n }\n\n $pinsts_id = DB::select(\"SELECT id FROM pinsts WHERE percentage=\".$dinst->progress);\n $pinsts_id = $pinsts_id[0]->id;\n\n echo $dinst->area.\"-\";\n\n \n Dinstsnew::create([\n 'units_id' =>$units_id,\n 'areas_id' =>$areas_id,\n 'tinsts_id' =>$tinsts_id,\n 'tag' =>$dinst->tag,\n 'pinsts_id' =>$pinsts_id,\n ]);\n \n \n \n\n }\n\n\n // Gráfica de progreso\n\n // Se comprueba el peso deseado (BUDGET/AREAS)\n $weight_total= DB::select(\"SELECT weight_total FROM pmanagers WHERE name='inst'\");\n\n if ($weight_total[0]->weight_total==0){\n\n $total_weight= DB::select(\"SELECT SUM(weight*qty) AS weight FROM einstsfullview;\");\n\n }else{\n\n $total_weight= DB::select(\"SELECT weight FROM pmanagers WHERE name='inst'\");\n\n }\n // FIN DE LA COMPROBACIÓN (BUDGET/AREAS) \n\n if ($total_weight[0]->weight!=0) {\n\n $total_progress = DB::select(\"SELECT SUM((weight*progress)/\".$total_weight[0]->weight.\") as total_progress FROM dinstsfullview;\");\n $total_progress=$total_progress[0]->total_progress;\n\n }else{\n\n $total_progress = 0;\n\n }\n\n $week = DB::select(\"SELECT COUNT(*)+1 AS week FROM hinsts\");\n $week = $week[0]->week; \n\n Hinst::create([\n \n 'week' =>$week,\n 'date' =>date('Y-m-d'),\n 'area' => 'TOTAL', \n 'progress' =>$total_progress,\n\n ]);\n\n });\n \n return Dinstsnew::all();\n }",
"public function startImport()\n {\n if (get_field('xcap_daily_cron', 'option') === true || empty(get_field('xcap_daily_cron', 'option'))) {\n $xcapUrl = 'http://kulturkortet.se/calendar/listEvents.action' .\n '?month=&date=&categoryPermaLink=&q=&p=&feedType=ICAL_XML';\n new \\HbgEventImporter\\Parser\\Xcap($xcapUrl);\n }\n }",
"protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnPersonalData.php\";\n\t\t$data = adnPersonalData::getData($this->filter, $this->mode);\n\t\t$this->setData($data);\n\t\t//$this->setMaxCount(sizeof($users));\n\t}",
"public function import(): void\n\t{\n\t\t$this->lastScan = $this->config->getLastScan('import' . $this->name);\n\t\tif (\n\t\t\t!$this->lastScan['start_date']\n\t\t\t|| (0 === $this->lastScan['id'] && $this->lastScan['start_date'] === $this->lastScan['end_date'])\n\t\t) {\n\t\t\t$this->config->setScan('import' . $this->name);\n\t\t\t$this->lastScan = $this->config->getLastScan('import' . $this->name);\n\t\t}\n\t\tif ($this->config->get('log_all')) {\n\t\t\t$this->controller->log('Start import ' . $this->name, [\n\t\t\t\t'lastScan' => $this->lastScan,\n\t\t\t]);\n\t\t}\n\t\t$i = 0;\n\t\ttry {\n\t\t\t$page = $this->lastScan['page'] ?? 1;\n\t\t\t$load = true;\n\t\t\t$finish = false;\n\t\t\t$limit = $this->config->get(self::LIMIT_NAME);\n\t\t\twhile ($load) {\n\t\t\t\tif ($rows = $this->getFromApi('Customer/GetAll?&page=' . $page . '&' . $this->getFromApiCond())) {\n\t\t\t\t\tforeach ($rows as $id => $row) {\n\t\t\t\t\t\tif ('JEDNORAZOWY' === $row['knt_Akronim']) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->importItem($row);\n\t\t\t\t\t\t$this->config->setScan('import' . $this->name, 'id', $id);\n\t\t\t\t\t\t++$i;\n\t\t\t\t\t}\n\t\t\t\t\t++$page;\n\t\t\t\t\tif (\\is_callable($this->controller->bathCallback)) {\n\t\t\t\t\t\t$load = \\call_user_func($this->controller->bathCallback, 'import' . $this->name);\n\t\t\t\t\t}\n\t\t\t\t\tif ($limit !== \\count($rows)) {\n\t\t\t\t\t\t$finish = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$finish = true;\n\t\t\t\t}\n\t\t\t\tif ($finish || !$load) {\n\t\t\t\t\t$load = false;\n\t\t\t\t\tif ($finish) {\n\t\t\t\t\t\t$this->config->setEndScan('import' . $this->name, $this->lastScan['start_date']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->config->setScan('import' . $this->name, 'page', $page);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (\\Throwable $ex) {\n\t\t\t$this->logError('import ' . $this->name, null, $ex);\n\t\t}\n\t\tif ($this->config->get('log_all')) {\n\t\t\t$this->controller->log('End import ' . $this->name, ['imported' => $i]);\n\t\t}\n\t}",
"public function importFrom(array $data);",
"public function run()\n {\n $items = $this->getPaysFromCsv();\n foreach($items as $item){\n DB::table('countries')->insert([\n 'code_2' => $item[0],\n 'code_3' => $item[1],\n 'title' => utf8_encode($item[2]),\n 'content' => utf8_encode($item[3]),\n 'prefixPhone' => $item[4],\n 'created_at' => date(\"Y-m-d H:i:s\"),\n ]);\n }\n }",
"public function importSanepar(){\n if(Input::hasFile('import_file')){\n $path = Input::file('import_file')->getRealPath();\n //array para valores a ser gravado no banco de dados\n $dataCad = array();\n //cadastro com sucesso\n $dataStore = array();\n //registra linhas sem doador (nao foi encontrado)\n $dataError = array();\n $dataReturn = array();\n \n //ver a competencia\n $dataCom = Excel::selectSheetsByIndex(0)->load($path, function($reader){\n $reader->takeColumns(19); //limita a quantidade de colunas \n // $reader->skipRows(3); //pula a linha\n // $reader->ignoreEmpty(); //ignora os campos null\n // $reader->takeRows(6); //limita a quantidade de linha\n // $reader->noHeading(); //ignora os cabecalhos \n })->get();\n\n //cria dados para salvar na base de retorno sanepar\n if(!empty($dataCom) && $dataCom->count()){\n foreach($dataCom as $data){\n //pesquisa doadores\n $data['matricula'] = intval($data['matricula']);\n\n //verifica se linha nao esta vazia\n if($data['matricula'] != '' && $data['nome'] != ''){\n\n $ddr = $this->doador->findWhere('ddr_matricula',$data['matricula'])->get();\n //pesquisa doacao\n if(count($ddr) > 0){\n\n //verifica se tem doacao\n if(!$ddr[0]->doacao){\n $doa_id = '';\n } else {\n $doa_id = $ddr[0]->doacao->doa_id;\n }\n\n $ddr[0]->doacao;\n $dataCad[] = [\n 'rto_ddr_id' => $ddr[0]->ddr_id,\n 'rto_doa_id' => $doa_id,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr\n ];\n } else {\n $dataError[] = [\n 'error' => 'Matricula/Doador não encontrado!',\n 'rto_ddr_id' => 0,\n 'rto_doa_id' => 0,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr,\n 'msg_erro' => 'Não foi encontrado o doador no sistema, verifique a matricula!'\n ];\n }\n }\n }\n }\n\n if($dataCad || $dataError){\n $dataReturn = [\n 'sucesso' => $dataCad,\n 'error' => $dataError\n ];\n return $dataReturn;\n } else {\n return 'Error';\n }\n }\n // return back();\n }",
"public function run()\n {\n $filename = storage_path('imports/car_serie.csv');\n Excel::import(new CarSerieImport, $filename);\n }",
"public function dailyInsert()\n {\n $request = new Request;\n $doc = $this->doc;\n foreach ($this->insertSupplierList as $supplierlist) {\n $file_path = storage_path(\"app/{$supplierlist}/*.txt\");\n foreach (glob($file_path) as $file) {\n //特定文件\n if ($doc != 'DefaultAllDoc') {\n $value = !str_contains($file, $doc);\n if ($value) {\n continue;\n }\n }\n $Unit = new SupplierFileImportControlUnit;\n \n $Unit->insertFromArray(\n [\n $Unit::INPUT_FILE_FULL_NAME => $file,\n $Unit::INPUT_INSERT_OR_NOT => true,\n ]\n );\n $Unit->run();\n }\n }\n }",
"public function importOldDatabase(DataContainer $dc)\n\t{\n\t\t$link = mysql_connect(\"localhost\", \"hschottm\", \".haibin.\") or die(\"Keine Verbindung möglich: \" . mysql_error());\n\t\tmysql_select_db(\"Pop\") or die(\"Auswahl der Datenbank fehlgeschlagen\");\n\n\t\t$result = mysql_query('SET NAMES utf8') or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\n\t\t$query = \"SELECT * FROM tkeyabenteuer ORDER BY idAbenteuer\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\t$q2 = sprintf(\"SELECT dtDatum FROM tkeysendung WHERE dtAbenteuer = %s ORDER BY dtDatum\",\n\t\t\t\t$line['idAbenteuer']\n\t\t\t);\n\t\t\t$q2result = mysql_query($q2) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t\t$first = \"\";\n\t\t\t$last = \"\";\n\t\t\twhile ($l = mysql_fetch_array($q2result, MYSQL_ASSOC)) \n\t\t\t{\n\t\t\t\tif (!strlen($first)) $first = $l['dtDatum'];\n\t\t\t\t$last = $l['dtDatum'];\n\t\t\t}\n\t\t\t$d1 = 0; $d2 = 0;\n\t\t\tpreg_match(\"/(\\\\d{4})-(\\\\d{2})-(\\\\d{2})/\", $first, $matches);\n\t\t\t$d1 = mktime(0, 0, 0, $matches[2], $matches[3], $matches[1]);\n\t\t\tpreg_match(\"/(\\\\d{4})-(\\\\d{2})-(\\\\d{2})/\", $last, $matches);\n\t\t\t$d2 = mktime(0, 0, 0, $matches[2], $matches[3], $matches[1]);\n\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_adventure (tstamp, title, description, numbering, alias, firstbroadcast, lastbroadcast) VALUES (?, ?, ?, ?, ?, ?, ?)\")\n\t\t\t\t->executeUncached(\n\t\t\t\t\ttime(),\n\t\t\t\t\t$line['dtTitel'],\n\t\t\t\t\t$line['dtBeschreibung'],\n\t\t\t\t\t$line['idAbenteuer'],\n\t\t\t\t\t'abenteuer'.$line['idAbenteuer'],\n\t\t\t\t\t$d1,\n\t\t\t\t\t$d2\n\t\t\t\t);\n\t\t}\n\t\tmysql_free_result($result);\n\n\t\t$adventures = array();\n\t\t$objAdv = $this->Database->prepare('SELECT * FROM tl_adventure')->executeUncached();\n\t\twhile ($objAdv->next())\n\t\t{\n\t\t\t$row = $objAdv->row();\n\t\t\t$adventures[$row['numbering']] = $row['id'];\n\t\t}\n\n\t\t$query = \"SELECT * FROM tkeyprovider\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_broadcast_provider (tstamp, initials, name, email, homepage) VALUES (?, ?, ?, ?, ?)\")\n\t\t\t\t->executeUncached(\n\t\t\t\t\ttime(),\n\t\t\t\t\t$line['dtShortcut'],\n\t\t\t\t\t$line['dtName'],\n\t\t\t\t\t$line['dtMail'],\n\t\t\t\t\t($line['dtHome']) ? $line['dtHome'] : ''\n\t\t\t\t);\n\t\t}\n\t\tmysql_free_result($result);\n\n\t\t$query = \"SELECT * FROM tkeysendung ORDER BY dtAbenteuer, dtKapitel, dtDatum, dtStunde\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t$lastadv = -1;\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\tif ($lastadv != $line['dtAbenteuer'])\n\t\t\t{\n\t\t\t\t$sort = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sort = $sort+10;\n\t\t\t}\n\t\t\t$lastadv = $line['dtAbenteuer'];\n\t\t\t$providers = array();\n\t\t\t\n\t\t\t$filequery = \"SELECT * FROM broadcastptwfiles WHERE fiBroadcast = \" . $line['idSendung'];\n\t\t\t$fileresult = mysql_query($filequery) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t\t$filedata = mysql_fetch_array($fileresult, MYSQL_ASSOC);\n\t\t\t$files = null;\n\t\t\tif (is_array($filedata) && strlen($filedata['filename']))\n\t\t\t{\n\t\t\t\t$filename = 'files/auriga/recordings/ptw/' . sprintf(\"%03d\", $line['dtAbenteuer']) . '/' . $filedata['filename'];\n\t\t\t\t$files ='a:1:{i:0;s:' . (strlen($filename)) . ':\"' . $filename . '\";}';\n\t\t\t}\n\n\t\t\t$proid = $this->getProviderId($line['dtProvider']); if ($proid) array_push($providers, $proid);\n\t\t\t$proid = $this->getProviderId($line['dtProvider2']); if ($proid) array_push($providers, $proid);\n\t\t\t$proid = $this->getProviderId($line['dtProvider3']); if ($proid) array_push($providers, $proid);\n\t\t\t$date = preg_match(\"/(\\\\d{4})-(\\\\d{2})-(\\\\d{2})/\", $line['dtDatum'], $matches);\n\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_broadcast (tstamp, sorting, title, `date`, hour, pid, chapter, \" .\n\t\t\t\t\"story, special, length, complete, providers, files, frequency, samplerate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\")\n\t\t\t\t->executeUncached(\n\t\t\t\t\t\ttime(),\n\t\t\t\t\t\t$sort,\n\t\t\t\t\t\t($line['dtInhalt']) ? $line['dtInhalt'] : '', \n\t\t\t\t\t\tmktime(0, 0, 0, $matches[2], $matches[3], $matches[1]), \n\t\t\t\t\t\t($line['dtStunde']) ? $line['dtStunde'] : '',\n\t\t\t\t\t\t($adventures[$line['dtAbenteuer']] > 0) ? $adventures[$line['dtAbenteuer']] : 0,\n\t\t\t\t\t\t($line['dtKapitel']) ? $line['dtKapitel'] : '',\n\t\t\t\t\t\t($line['dtStory']) ? '1' : '0',\n\t\t\t\t\t\t($line['dtSondersendung']) ? '1' : '0',\n\t\t\t\t\t\t($line['dtDauer']) ? $line['dtDauer'] : '',\n\t\t\t\t\t\t($line['dtComplete']) ? '1' : '0',\n\t\t\t\t\t\t(count($providers)) ? serialize($providers) : null,\n\t\t\t\t\t\t$files,\n\t\t\t\t\t\t($line['dtFrequency']) ? $line['dtFrequency'] : '',\n\t\t\t\t\t\t($line['dtSamplerate']) ? $line['dtSamplerate'] : ''\n\t\t\t\t\t);\n\t\t\t$insertid = $objResult->insertId;\n\t\t\t/*\n\t\t\tif ($insertid > 0)\n\t\t\t{\n\t\t\t\t$queryfiles = sprintf(\"SELECT * FROM broadcastPTWfiles WHERE fiBroadcast = %s\", $line['idSendung']);\n\t\t\t\t$resultfiles = mysql_query($queryfiles) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t\t\twhile ($linefile = mysql_fetch_array($resultfiles, MYSQL_ASSOC)) \n\t\t\t\t{\n\t\t\t\t\tif (strlen($linefile['filename']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_broadcast_file (pid, tstamp, filename) VALUES (?, ?, ?)\")\n\t\t\t\t\t\t\t->executeUncached(\n\t\t\t\t\t\t\t\t\t$insertid,\n\t\t\t\t\t\t\t\t\ttime(),\n\t\t\t\t\t\t\t\t\t$linefile['filename']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\t\t}\n\n\t\t$query = \"SELECT * FROM tkeytitelliste\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t$genres = array();\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\t$genres[$line['dtMusiktyp1']]++;\n\t\t\t$genres[$line['dtMusiktyp2']]++;\n\t\t}\n\t\tmysql_free_result($result);\n\n\t\tforeach (array_keys($genres) as $genre)\n\t\t{\n\t\t\tif (strlen(trim($genre)))\n\t\t\t{\n\t\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_genre (tstamp, name) VALUES (?, ?)\")\n\t\t\t\t\t->executeUncached(\n\t\t\t\t\t\ttime(),\n\t\t\t\t\t\ttrim($genre)\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$genres = array();\n\t\t$objResult = $this->Database->prepare(\"SELECT * FROM tl_genre\")\n\t\t\t->executeUncached();\n\t\twhile ($objResult->next())\n\t\t{\n\t\t\t$row = $objResult->row();\n\t\t\t$genres[$row['name']] = $row['id'];\n\t\t}\n\n\t\t$query = \"SELECT * FROM tkeytitelliste\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\tpreg_match(\"/(\\\\d{4})-(\\\\d{2})-(\\\\d{2})/\", $line['dtDatum'], $matches);\n\t\t\t$date = mktime(0, 0, 0, $matches[2], $matches[3], $matches[1]);\n\t\t\t$bid = $this->getBroadcastId($date, ($adventures[$line['dtAbenteuer']] > 0) ? $adventures[$line['dtAbenteuer']] : 0, ($line['dtKapitel']) ? $line['dtKapitel'] : '', ($line['dtStunde']) ? $line['dtStunde'] : '');\n\t\t\tif ($bid && $line['fiMusiktypPTW'] != 3)\n\t\t\t{\n\t\t\t\t$foundgenres = array();\n\t\t\t\tif ($genres[$line['dtMusiktyp1']]) array_push($foundgenres, $genres[$line['dtMusiktyp1']]);\n\t\t\t\tif ($genres[$line['dtMusiktyp2']]) array_push($foundgenres, $genres[$line['dtMusiktyp2']]);\n\t\t\t\t$proid = $this->getProviderId($line['dtProvider']); if ($proid) array_push($providers, $proid);\n\t\t\t\t$proid = $this->getProviderId($line['dtProvider2']); if ($proid) array_push($providers, $proid);\n\t\t\t\t$proid = $this->getProviderId($line['dtProvider3']); if ($proid) array_push($providers, $proid);\n\t\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_broadcast_song (tstamp, pid, sorting, title, artist, album, year, \" .\n\t\t\t\t\t\"labelcode, genres, songtype, length, composer, sequence) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\")\n\t\t\t\t\t->executeUncached(\n\t\t\t\t\t\t\ttime(),\n\t\t\t\t\t\t\t($bid) ? $bid : 0,\n\t\t\t\t\t\t\t($line['dtSong']) ? $line['dtSong'] : 0,\n\t\t\t\t\t\t\t($line['dtSongtitel']) ? $line['dtSongtitel'] : '', \n\t\t\t\t\t\t\t($line['dtInterpret']) ? $line['dtInterpret'] : '', \n\t\t\t\t\t\t\t($line['dtAlbumtitel']) ? $line['dtAlbumtitel'] : '', \n\t\t\t\t\t\t\t($line['dtJahr']) ? $line['dtJahr'] : '', \n\t\t\t\t\t\t\t($line['dtLCN']) ? $line['dtLCN'] : '', \n\t\t\t\t\t\t\t(count($foundgenres)) ? serialize($foundgenres) : null,\n\t\t\t\t\t\t\t($line['fiMusiktypPTW']) ? $line['fiMusiktypPTW'] : '',\n\t\t\t\t\t\t\t($line['dtZeit']) ? $line['dtZeit'] : '',\n\t\t\t\t\t\t\t($line['dtKomponist']) ? $line['dtKomponist'] : '',\n\t\t\t\t\t\t\t($line['dtSong']) ? $line['dtSong'] : 0\n\t\t\t\t\t\t);\n\t\t\t} else if ($line['fiSendungTitel'] == 1) {\n\t\t\t\t$this->log('Import: No broadcast found for ' . print_r($line, true), 'importOldDatabase', 5);\n\t\t\t}\n\n\t\t}\n\t\tmysql_free_result($result);\n\n\t\tmysql_close($link);\n\t}",
"public function run()\n {\n \t$datas = Excel::import(new CargoImport, 'database/seeds/cargos.xlsx', null, \\Maatwebsite\\Excel\\Excel::XLSX);\n }",
"public function acfedu_import_preset_countries() {\n\t\t\t\tif ( isset( $_POST[\"import_actions_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_actions_nonce\"], 'import-actions-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) || isset( $_POST['import_be'] ) || isset( $_POST['import_lux'] ) ) {\n\t\t\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\tif ( isset( $_POST['import_be'] ) && 1 == $_POST[\"import_be\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_be.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_be' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_lux'] ) && 1 == $_POST[\"import_lux\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_lux.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_lu' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) && 1 == $_POST[\"import_nl\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_nl.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_nl' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = ob_get_clean();\n\t\t\t\t\t\t\tdbDelta( $sql );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public function run() {\n\t\t//php artisan db:seed --class=CitiesTablesSeed\n\t\tset_time_limit( 3600 );\n\t\t$start = microtime( true );\n\t\t$filename = 'cities.csv';\n\t\t$this->command->info( \"*** Iniciando o Upload (\" . $filename . \") ***\" );\n\n\t\t$file = storage_path( 'import' . DIRECTORY_SEPARATOR . $filename );\n\t\t$this->command->info( \"*** Upload completo em \" . round( ( microtime( true ) - $start ), 3 ) . \"s ***\" );\n\n\t\t$rows = Excel::load( $file, function ( $reader ) {\n\t\t\t$reader->toArray();\n\t\t\t$reader->noHeading();\n\t\t} )->get();\n\t\tforeach ( $rows as $row ) {\n\t\t\t$data = [\n\t\t\t\t'id' => $row[0],\n\t\t\t\t'name' => $row[1],\n\t\t\t\t'idstate' => $row[2],\n\t\t\t];\n\t\t\t\\App\\Models\\Configs\\CepCities::create( $data );\n\t\t\techo( '(' . $data['id'] . ') - ' );\n\t\t}\n\t\t$this->command->info( \"*** Importacao IMPORTSEEDER realizada com sucesso em \" . round( ( microtime( true ) - $start ), 3 ) . \"s ***\" );\n\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 }",
"protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}",
"public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}",
"public function run()\n {\n $rows = DB::table('enderecos_copy')->get();\n\n foreach ($rows as $row){\n DB::table('enderecos')->insert([\n 'logradouro' => $row->logradouro,\n 'bairro' => $row->bairro,\n 'regional' => $row->regional,\n ]);\n }\n }",
"public function importcccost(){\n// dd();\n $data = Excel::load('../couriers/clubcourierprices.xlsx', function($reader) {\n })->get();\n if(!empty($data) && $data->count()){\n foreach ($data as $key => $value) {\n if(!empty($value->from)){\n\n $fromId = 0;\n $toId = 0;\n $existingRegion = $this->checkCCregionexist($value->from);\n if(count($existingRegion)>0){\n $fromId = $existingRegion[0]->id;\n }else{\n $fromId = DB::table($this->DBTables['CCRegion'])->insertGetId(\n ['region' => $value->from]\n );\n }\n $existingRegion = $this->checkCCregionexist($value->to);\n if(count($existingRegion)>0){\n $toId = $existingRegion[0]->id;\n }else{\n $toId = DB::table($this->DBTables['CCRegion'])->insertGetId(\n ['region' => $value->to]\n );\n }\n $CostInsertId = DB::table($this->DBTables['CCCost'])->insertGetId(\n ['from_region_id' => $fromId, 'to_region_id'=>$toId, 'small_bag_cost'=>$value->small_bag_rrp,'standard_bag_cost'=>$value->standard_bag_rrp,'large_bag_cost'=>$value->large_bag_rrp,'transit_days'=>$value->transit_time_days]\n );\n }\n }\n }\n }",
"public function import() {\n\t\t$exchangeRateImporter = new EcbExchangeRateImporter();\n\t\t$exchangeRateImporter->import();\n\n\t\t$event = new CakeEvent('ExchangeRateImport.completed', $this);\n\t\tCakeEventManager::instance()->dispatch($event);\n\t}",
"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 }"
] | [
"0.7269885",
"0.6336099",
"0.6263408",
"0.6158965",
"0.6039248",
"0.60306394",
"0.60063887",
"0.5749182",
"0.57326597",
"0.5624004",
"0.54702735",
"0.54525226",
"0.5452295",
"0.5443806",
"0.53924406",
"0.5351593",
"0.53510046",
"0.5343794",
"0.533978",
"0.5308475",
"0.52679145",
"0.5244547",
"0.5241718",
"0.5193319",
"0.5191118",
"0.5179463",
"0.51788074",
"0.5177701",
"0.5176329",
"0.5176089"
] | 0.6765243 | 1 |
Return a list of files with eod data. | private function _get_option_eod_summary_files()
{
$files = [];
if(is_dir('/Users/spicer/Dropbox/Apps/Stockpeer'))
{
$base = '/Users/spicer/Dropbox/Apps/Stockpeer/';
} else
{
$base = '/tmp/market_data/';
$this->_get_data_from_dropbox();
}
foreach($this->eod_option_summary_files AS $key => $row)
{
$files[] = $base . $row;
}
return $files;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDatafiles()\n {\n return $this->game->getDatafiles();\n }",
"public function getFiles();",
"public function getFiles();",
"public function getFiles();",
"public function getFiles ();",
"public static function getFiles()\n\t{\n\t\t$result = Array();\n\t\t$files = sfCore::$db->query(\"SELECT * FROM `swoosh_file_storage`\")->asObjects();\n\t\tforeach($files as $file){\n\t\t\t$sfFileStorageItem = sfCore::make('sfFileStorageItem');\n\t\t\t$sfFileStorageItem->loadFromObject($file);\n\t\t\t$result[] = $sfFileStorageItem;\n\t\t}\n\t\treturn $result;\n\t}",
"function get_file_objs() {\n return $this->file_objs;\n }",
"function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}",
"public function getFiles()\n {\n return FileInfo::findBy( Condition::EQ(FileInfo::TABLE, 'module_id', $this->getId()),\n new ArrayObject(array('sort'=>$this->getSortBy(), 'ord'=>'asc')) );\n }",
"public function getFiles() {}",
"private function getFileList()\n {\n\n $count = $this->getFileCount();\n $size = $this->getSize() + 4;\n\n $this->seek(\n $this->offset\n + 18\n + $this->getAliasSize()\n + 4\n + $this->getMetadataSize()\n );\n\n return $this->readFileList($count, $size);\n }",
"public function getFiles() {\n return $this->getPartFiles(0);\n }",
"public function getFilesList() : array {\n $sqlQuery = 'SELECT * FROM files';\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute();\n\n $dataSet = [];\n while ($row = $statement->fetch()) {\n $dataSet[] = new File($row);\n }\n return $dataSet;\n }",
"public function getAllFilesRobot() {\n $sql = \"SELECT * FROM archivo_organizado\";\n $result = $this->_db->prepare($sql);\n $result->execute();\n\n if(!is_null($result->errorInfo()[2]))\n return array('error' => $result->errorInfo()[2]);\n else\n return $result->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function getDataFilesList(){\r\n $data_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Data';\r\n $files = scandir($data_dir);\r\n\r\n $files_list = array();\r\n $index = 0;\r\n foreach ($files as $file) {\r\n if($file != '.' && $file != '..'){\r\n $files_list[$index]['name'] = $file;\r\n $files_list[$index]['update_time'] = filemtime($data_dir . DIRECTORY_SEPARATOR . $file);\r\n $files_list[$index]['type'] = $this->getFileType($file);\r\n $index++;\r\n }\r\n }\r\n\r\n $update_times = array();\r\n foreach($files_list as $data){\r\n $update_times[] = $data['update_time'];\r\n }\r\n array_multisort($update_times, SORT_DESC, $files_list);\r\n return $files_list;\r\n }",
"function get_list_of_files() {\n $result = $this->pdo->query('SELECT * FROM files ORDER BY filename ASC');\n return $result;\n }",
"function _generateFilesList() {\n return array();\n }",
"public function readFilesInFileadmin() {\n $fileArr = $newArr = array();\n\n // direktes auslesen des Ordners, da evtl. nicht alle Dateien in Tabellen indexiert sind\n $path = GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT') . GeneralUtility::getIndpEnv('TYPO3_SITE_PATH') . 'fileadmin/';\n $fileList = GeneralUtility::getAllFilesAndFoldersInPath($fileArr, $path);\n\n $pathCount = strlen($path);\n // deployment-Ordner exkludieren\n foreach ($fileList as $filekey => $filevalue) {\n if (strstr($filevalue, '/fileadmin/deployment') == FALSE) {\n $newArr[$filekey] = substr($filevalue, $pathCount);\n }\n }\n\n return $newArr;\n }",
"public function all()\n {\n $dir = public_path() . '/uploads/temp/' . Session::getId() . '/';\n $data = [];\n $mimetypes = new Mimetype;\n if(file_exists($dir)) {\n foreach(scandir($dir) as $file) {\n if(in_array($file, ['.', '..'])) continue;\n $filedata = [];\n $filedata['name'] = $file;\n $filedata['url'] = url('/uploads/temp/' .Session::getId() . '/' .$file);\n $filedata['size'] = File::size($dir . $file);\n $filedata['type'] = $mimetypes->detectByFileExtension(File::extension($file));\n $data[] = $filedata;\n }\n return $data;\n }\n }",
"private function searchFiles()\n {\n $query = File::whereNull('deleted_at');\n $data = $query->get();\n\n return $data;\n }",
"public function getFiles(): array;",
"protected function getAllFiles() {\n $sql = \"SELECT * FROM satdatameta\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $results = $stmt->fetchAll();\n return $results;\n }",
"private function get_files(): array {\n\t\t$files = [];\n\n\t\tif ( $this->directory->is_readable() ) {\n\t\t\tforeach ( $this->directory->get_files() as $file ) {\n\t\t\t\tif ( ! $file->isFile() || ! $file->isReadable() || $file->getSize() === 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->extension !== null && $this->extension !== $file->getExtension() ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$files[] = $file->getFileInfo();\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}",
"public function getEmbeddedFiles() {}",
"public function getFiles()\n\t{\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}",
"public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/jestr.php',\n 'sources_custom/forum/cns.php',\n 'lang_custom/EN/jestr.ini',\n 'themes/default/templates_custom/EMOTICON_IMG_CODE_THEMED.tpl',\n 'forum/pages/modules_custom/topicview.php',\n 'sources_custom/hooks/systems/config/jestr_avatar_switch_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_emoticon_magnet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_leet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_piglatin_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes_shown_for.php',\n );\n }",
"private function item_files()\r\n\t{\r\n\t\t$items = array();\r\n\t\t$items = glob(ITEMDATA.'*.xml');\r\n\t\tsort($items);\r\n\t\treturn array_reverse($items);\r\n\t}",
"public function getOtherFiles(): array;",
"public function getFiles() : Array\n\t{\n\t\t$files = [];\n\n\t\tif ($this->exists() && $this->isReadable()) {\n\n\t\t\t$directory = opendir($this->directory);\n\t\t\twhile($opened = readdir($directory)) {\n\t\t\t\n\t\t\t\tif (is_file($this->directory . DIRECTORY_SEPARATOR . $opened) && !Directory::isBlockListed($opened)) {\n\t\t\t\t\t$files[] = $opened;\n\t\t\t\t}\n\t\t\n\t\t\t}\n\n\t\t\tclosedir($directory);\n\t\t}\n\n\t\treturn $files;\n\t}",
"public function get_files()\n {\n }"
] | [
"0.6756202",
"0.6754651",
"0.6754651",
"0.6754651",
"0.6681217",
"0.6674859",
"0.665485",
"0.6650601",
"0.66485107",
"0.6637627",
"0.6613034",
"0.65925366",
"0.65880877",
"0.65870667",
"0.6546304",
"0.65412086",
"0.6536871",
"0.6536775",
"0.6522086",
"0.6520818",
"0.6515558",
"0.6504113",
"0.6501648",
"0.6493762",
"0.64851004",
"0.64478105",
"0.64312387",
"0.6426829",
"0.63426095",
"0.632056"
] | 0.73023045 | 0 |
Get the facade class. | protected static function getFacadeClass(): string
{
return Facade::class;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getFacadeClass()\n {\n return TravelPerk::class;\n }",
"protected function getFacadeClass()\n {\n return PusherBeams::class;\n }",
"public function retornaFacade ()\n {\n try {\n // Retorna o nome da classe facade\n return $this->_classeFacade;\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }",
"protected static function getFacadeAccessor(): string\n {\n return Factory::class;\n }",
"protected function getFacadeClass()\n {\n return Git::class;\n }",
"protected function getFacadeClass()\n {\n return Httplug::class;\n }",
"protected static function getFacadeAccessor(): string\n {\n return NotifyFactory::class;\n }",
"public final static function getFacadeAccessor() {\n\n\t\t/**\n\t\t * Facade is very simple to use but it can provide a real troubles\n\t\t * if we want have a new instance of related object every time instead a singleton.\n\t\t */\n\t\tunset(static::$resolvedInstance['DelegapiClient']);\n\t\treturn 'DelegapiClient';\n\t}",
"public static function get_class(){\n return self::class;}",
"protected static function getFacadeAccessor(): string {\n return JsonMarshallerObject::class;\n }",
"protected static function getFacadeAccessor()\n {\n return Base::class;\n }",
"public function get_class()\n {\n return $this->class;\n }",
"protected static function getFacadeAccessor()\n {\n return Concret::class;\n }",
"protected static function getFacadeAccessor()\n {\n return Factory::class;\n }",
"protected static function getFacadeAccessor()\n {\n return Factory::class;\n }",
"public static function getFacadeClass()\n {\n return 'PHPMailChimp\\Core\\Modules\\Lists\\Lists';\n }",
"public static function getClass()\n {\n $type = explode('\\\\', get_called_class());\n\n return $type[count($type) - 1];\n }",
"protected static function getFacadeAccessor()\n {\n return ResponseFactoryContract::class;\n }",
"protected static function getFacadeAccessor()\n {\n return GateContract::class;\n }",
"public static function getClass()\n {\n return get_class(new static);\n }",
"protected function derive_class() {\n\t\t$class = null;\n\t\t$callable_reference = $this->get_callable_reference();\n\n\t\t// Validate the potential class name.\n\t\tif ( is_string( $callable_reference ) && class_exists( $callable_reference ) ) { // Just the class name.\n\t\t\t$class = $callable_reference;\n\t\t} elseif ( is_array( $callable_reference ) && isset( $callable_reference[0] ) && class_exists( $callable_reference[0] ) ) { // A class and method.\n\t\t\t$class = $callable_reference[0];\n\t\t}\n\t\treturn $class;\n\t}",
"public static function getClass() {\n return Singleton::$_class;\n }",
"protected function getFacadeRoot()\n {\n return GitWrapperManager::class;\n }",
"protected function getFacadeRoot()\n {\n return PusherBeamsManager::class;\n }",
"protected static function getFacadeAccessor()\n {\n return \\MonthlyCloud\\Sdk\\Builder::class;\n }",
"public function getReflectionClass()\n {\n if (!$this->reflClass) {\n $this->reflClass = new \\ReflectionClass($this->getClassName());\n }\n\n return $this->reflClass;\n }",
"protected static function getFacadeAccessor()\n {\n return Decorator::class; // the IoC binding.\n }",
"protected static function getFacadeAccessor()\n {\n return Client::class;\n }",
"protected static function getFacadeAccessor()\n {\n return Client::class;\n }",
"public function getClass()\n {\n if (is_null($this->_class)) {\n $this->_class = $this->_getClassName();\n }\n return $this->_class;\n }"
] | [
"0.76561874",
"0.76208615",
"0.7610145",
"0.74600923",
"0.72164166",
"0.7214597",
"0.71838",
"0.70774853",
"0.7060769",
"0.7029519",
"0.7000669",
"0.6887118",
"0.68383116",
"0.6817372",
"0.6817372",
"0.67685515",
"0.6760814",
"0.6748346",
"0.6720909",
"0.66768444",
"0.66576254",
"0.6652125",
"0.66443473",
"0.663175",
"0.6612343",
"0.6595773",
"0.6594913",
"0.65792096",
"0.65792096",
"0.6575993"
] | 0.8359229 | 0 |
register signal & tickts | public function registerTicks()
{
if (!$this->_isSubProcess) {
// register signal,send signal to parent process
// 使用ticks需要PHP 4.3.0以上版本
echo "i am registering signal for main process!\n";
// 安装信号处理器
pcntl_signal(SIGINT, array($this, "sigHandler"));
pcntl_signal(SIGTERM, array($this, "sigHandler"));
pcntl_signal(SIGUSR1, array($this, "sigHandler"));
if (version_compare(PHP_VERSION, "5.3.0") >= 0) {
pcntl_signal_dispatch();
}
} else {
echo "i am registering signal for subprecesses!\n";
pcntl_signal(SIGCHLD, array($this, "sigHandler"));
if (version_compare(PHP_VERSION, "5.3.0") >= 0) {
pcntl_signal_dispatch();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register()\n {\n register_tick_function([&$this, 'tick']);\n }",
"public function onTick($currentTick){ \n }",
"function tick_handler()\n{\n echo \"called\\n\";\n}",
"public function onTick() {\r\n\r\n }",
"function tick();",
"public function tick();",
"private function _registerSigHandlers ()\n {\n if (! function_exists('pcntl_signal')) {\n return;\n }\n \n declare(ticks = 1);\n pcntl_signal(SIGTERM, array(\n $this,\n 'shutdown'\n ));\n pcntl_signal(SIGINT, array(\n $this,\n 'shutdown'\n ));\n pcntl_signal(SIGQUIT, array(\n $this,\n 'shutdown'\n ));\n \n $this->_logger->info('Registered signals');\n }",
"public function tick()\n {\n //\n }",
"protected function tick() {\n // per second, but possibly more often.\n }",
"public function set_signal($signal)\n {\n $this->_signal = $signal;\n }",
"private function registerSigHandlers()\n\t{\n\t\tif (!function_exists('pcntl_signal')) {\n\t\t\treturn;\n\t\t}\n\n\t\tpcntl_signal(SIGTERM, array($this, 'shutDownNow'));\n\t\tpcntl_signal(SIGINT, array($this, 'shutDownNow'));\n\t\tpcntl_signal(SIGQUIT, array($this, 'shutdown'));\n\t\tpcntl_signal(SIGUSR1, array($this, 'killChild'));\n\t\tpcntl_signal(SIGUSR2, array($this, 'pauseProcessing'));\n\t\tpcntl_signal(SIGCONT, array($this, 'unPauseProcessing'));\n\t\t$this->logger->log(LogLevel::DEBUG, 'Registered signals');\n\t}",
"private function dispatchSig()\n\t{\n\t\tswitch ( $this->signal ) {\n\t\t\t// reload\n\t\t\tcase 'reload':\n\t\t\t\t$this->workerExitFlag = true;\n\t\t\t\tbreak;\n\n\t\t\t// stop\n\t\t\tcase 'stop':\n\t\t\t\t$this->workerExitFlag = true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tbreak;\n\t\t}\n\t}",
"protected function tick() \n\t{\n\t\t// Override this for any process that should happen periodically.Will happen at least once\n\t\t// per second, but possibly more often.\n\t}",
"public function register()\n {\n // maybe something, one day\n }",
"function __construct($tick) {\n global $stperiod;\n global $mtperiod;\n global $ltperiod;\n\n $this->tick = $tick;\n $this->st = new Trend('ST', $stperiod);\n $this->mt = new Trend('MT', $mtperiod);\n $this->lt = new Trend('LT', $ltperiod);\n }",
"protected function registerTickHandler(?callable $callback): void\n {\n }",
"public function tick()\n {\n $this->poloniexWatcher->updateAssetPrices();\n\n $this->binanceWatcher->updateAssetPrices();\n\n $this->bitfinexWatcher->updateAssetPrices();\n\n $this->bittrexWatcher->updateAssetPrices();\n\n $this->coinMarketWatcher->sync();\n }",
"function eis_device_signal($calldata) {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status;\n\t$callparam=$calldata[\"param\"];\n\tswitch ($calldata[\"cmd\"]) {\n\n\t\tdefault:\n\t\t\t// manage unknown command\n\t\t\teis_log(1,\"system:unknownSignal --> \".$calldata[\"cmd\"]);\n\t}\n}",
"public function register() {\n\t\treturn array(T_BACKTICK);\n\t}",
"function set_signal_history($flag)\n{\n return XPSPL::instance()->set_signal_history($flag);\n}",
"public function init()\n\t{ \n\t\t# Return if no countoff is needed\n\t\tif ($this->countoff<1) return;\n\t\t\n\t\t# initialize event array\n\t\t$this->events = array();\n\t\t\n\t\tif ($this->initRestTicks) {\n\t\t\t# Add a brief rest and then all notes off and all sound off to relevant channels here\n\t\t\tfor($ix=0; $ix<$this->track_total; $ix++) {\n\t\t\t\t$this->track_ix = $ix;\n\t\t\t\t\n\t\t\t\t# for all channels in this track\n\t\t\t\tforeach($this->channels[$this->track_ix] as $chan) {\n\t\t\t\t\t$this->addEvent(0,176+$chan,123,0);\n\t\t\t\t\t$this->addEvent(0,176+$chan,7,0);\n\t\t\t\t}\n\t\t\t\t$this->addEvent($this->initRestTicks,176+$this->channels[$this->track_ix][0],7,0);\n\t\t\t\t$this->addEvent($this->initRestTicks,176+$this->channels[$this->track_ix][0],7,$this->mVol);\n\t\t\t}\n\t\t}\n\t\t\n\t\t# Put in the initial countoff\n\t\tfor($i=0; $i<$this->timeSig; $i++) { \n\t\t\t$vol = ($i==0) ? 127 : 70;\n\t\t\t$this->addEvent(0,153,37,$vol);\n\t\t\t$this->addEvent($this->ticksPerBeat,153,37,0);\n\t\t}\n\t\t\n\t\t# record where this track starts for looping purposes\n\t\t$this->loopStart[$this->track_ix] = count($this->events[$this->track_ix]);\n\t}",
"public function _register()\n {\n }",
"public function addSignal(float $timeout = -1): bool {}",
"public static function connectSignal( $signal1, $signal2 )\n\t{\n\t\tif( is_array( $signal ) )\n\t\t{\n\t\t\t$emitent = $signal[0];\n\t\t\t$signal = $signal[1];\n\t\t\t\n\t\t\tif( is_object( $emitent ) )\n\t\t\t{\n\t\t\t\t$emitent = get_class( $emitent );\n\t\t\t}\n\t\t\t\n\t\t\t$signal = $emitent . '_' . $signal;\n\t\t}\n\t\t\n\t\t$GLOBALS['_RPC_']['signals'][$signal][] = array( 'type' => 'signal', 'slot' => $slot );\n\t}",
"public function add_signal($signal = null, $vars = null, $event = null) \n {\n $this->_signals = [$signal, $vars, $event];\n }",
"public function checkSignal()\n {\n if($this->current_signal){\n $this->fire($this->current_signal); \n }\n }",
"private function updateDetectRegisters()\n {\n\n //Initialise the banks with nothing set\n //Is this a problem? Could something else be depending on them being set in another process?\n $banks_watching = [0, 0];\n\n foreach ($this->pins as $bank => $bank_pins) {\n foreach ($bank_pins as $bit_position => $pin) {\n $banks_watching[$bank] |= 1 << $bit_position;\n }\n }\n\n ///Set rising and falling - irrelevant events will be ignored.\n foreach ($banks_watching as $index => $bank) {\n $this->gpio_register[Register\\GPIO::$GPREN[$index]] = $bank;\n $this->gpio_register[Register\\GPIO::$GPFEN[$index]] = $bank;\n }\n\n //Stop or start the timer if necessary.\n //array sum checking if any bits in either bank are set\n if (array_sum($banks_watching) === 0) {\n $this->stop();\n } elseif (!$this->isActive()) {\n $this->start();\n }\n\n }",
"public function register()\n {\n $this->registerSwither();\n }",
"public function register()\n {\n parent::register();\n\n $this->configureQueue();\n\n $this->registerWorkCommand();\n }",
"public function register()\n {\n register_shutdown_function([$this, 'onShutdown']);\n }"
] | [
"0.7177069",
"0.62790525",
"0.60348064",
"0.6032207",
"0.5911731",
"0.5812185",
"0.5709681",
"0.5654872",
"0.55474186",
"0.5463986",
"0.54326826",
"0.53226155",
"0.53038853",
"0.52809507",
"0.5277291",
"0.51221144",
"0.50967526",
"0.509577",
"0.5088748",
"0.508826",
"0.5019128",
"0.5011437",
"0.4983165",
"0.4955445",
"0.4943131",
"0.49295527",
"0.4901926",
"0.48502135",
"0.48376876",
"0.48098865"
] | 0.6851136 | 1 |
this function is used for ensuring running gearman worker not to be interrupted | public function gearmanRunOnceBeforeExit()
{
echo "i am handling signal!\n";
if (!isset($this->_app)) {
$this->_app = CApp::getApp();
}
// var_dump($this->sub_process_keys);
foreach ($this->sub_process_keys as $_k => $_subProcessKey) {
$workeName = $this->_gearmanFuncNamePre."_".$_subProcessKey;
$this->_app->logger->log("i am worker {$workeName},i am tring to run last worker before exit", "NOTICE");
$dataDir = $this->_app->systemDataDir;
$workingJobsDir = $dataDir.DIRECTORY_SEPARATOR.self::WORKING_JOBS_DIRNANE;
if (!file_exists($workingJobsDir)) {
mkdir($workingJobsDir);
}
$registerFuncName = $this->_gearmanFuncNamePre."_".$_subProcessKey;
$workingJobFile = $workingJobsDir.DIRECTORY_SEPARATOR.$registerFuncName;
var_dump($workingJobFile);
if (!file_exists($workingJobFile)) {
$this->_app->logger->log("i am worker {$workeName},i am not working when i am nicely killed", "NOTICE");
// when job isn't running kill the working process
posix_kill($this->_forkedPids[$_k], SIGKILL);
}
else {
echo "the worker $workeName is running\n";
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function gracefulStop(){\n $this->handleWorkerOutput('warn', \"Work done, exiting now.\");\n $this->stop();\n }",
"public function gearmanWorkerStop()\n {\n for($i = 0; $i < $this->_gearmanForkCount; $i++){\n $this->sub_process_keys[] = $i+1;\n }\n foreach ($this->sub_process_keys as $_sub_key) {\n $shell_cmd = \"ps aux | grep \".$this->_workerFileName. \" |\";\n $shell_cmd .= \"grep -v 'grep' | awk '{print $2}' |\";\n $sub_process_name = $this->_workerFileName.\"_\".$_sub_key;\n $pid_file = $this->_lockDir.$this->_workerFileName.\"_\".$_sub_key.\".pid\";\n $pid_cmd = \"cat $pid_file\";\n $pid = exec($pid_cmd);\n $shell_cmd .= \" grep $pid\";\n echo $shell_cmd.\"\\n\";\n //查看进程是不是存在\n $ps_res = exec($shell_cmd);\n if (empty($ps_res)) {\n echo \"process $sub_process_name is not running!\\n\";\n } else {\n $kill_cmd = \"kill $pid\";\n exec($kill_cmd);\n $this->killed_sub_process_keys[] = $_sub_key;\n echo \"process $sub_process_name is stopped\\n\";\n }\n }\n }",
"public function run()\n {\n $this->_fnameFlagStop = dirname(__FILE__) . '/' . $this->getIndividualFilenameAsFlag();\n $this->checkIfShouldStopWork();\n\n $worker = Mage::getModel('myproject_gearman/worker'); // just a wrapper around PHP Gearman class\n\n $worker->addFunction($this->getJobName(), function (GearmanJob $job) {\n $this->_curJobObject = $job;\n $data = unserialize($job->workload());\n $this->processDataWrapper($data, $job);\n });\n\n $worker->addFunction($this->getIndividualFilenameAsFlag(), function (GearmanJob $job) {\n $this->log('Got job to exit. Job name: ' . $this->getIndividualFilenameAsFlag());\n $job->sendComplete('ok'); // without this line queue not cleans and task stay in this queue\n exit;\n });\n\n $worker->work();\n }",
"public function haltJobLoop()\n\t{\n\t\t$this->halt_job_loop = true;\n\t}",
"public function handle()\n {\n while (1) {\n $this->worker->work();\n if ($this->worker->returnCode() != GEARMAN_SUCCESS) break;\n sleep(2);\n }\n }",
"abstract protected function _restart();",
"public function trylock() {}",
"private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }",
"private function checkWorkers() {\n global $workers;\n $living = array();\n\n // Find any dead workers\n foreach ($workers as $workerID => $pid) {\n gosUtility_parallel::$logger->debug(\"Checking worker $workerID (pid $pid)\");\n\n // Check if this worker still exists as a process\n if (pcntl_waitpid($pid, $status, WNOHANG|WUNTRACED) === $pid) {\n // If the worker exited normally, stop tracking it\n if (pcntl_wifexited($status) && pcntl_wexitstatus($status) === 0) {\n gosUtility_parallel::$logger->info(\"Worker $workerID (pid $pid) exited normally\");\n unset($workers[$workerID]);\n }\n }\n\n // If it has a session ID, then it's still living\n if (posix_getsid($pid))\n $living[] = $pid;\n }\n\n // Start new workers to replace dead ones\n $dead = array_diff($workers, $living);\n foreach ($dead as $workerID => $deadPID) {\n gosUtility_parallel::$logger->warn(\"Worker $workerID (pid $deadPID) died. Conscripting replacement...\");\n\n unset($workers[$workerID]);\n $this->startWorker($workerID);\n }\n }",
"private function main()\n {\n $this->initDataSource();\n while ($this->running) {\n try {\n $this->eventDispatcher->dispatch(new QueueStatus($this));\n } catch (\\Throwable $e) {\n $this->stdOutLogger->error('Watch coroutine exception, msg:' . $e->getMessage());\n $this->fileLogger->alert('Watch coroutine exception', [\n 'file' => $e->getFile(),\n 'line' => $e->getLine(),\n 'msg' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n }\n\n Coroutine::sleep(self::WATCH_COMMAND_TIME);\n }\n $this->stdOutLogger->info('消费进程(' . $this->process->pid . ')退出');\n $this->fileLogger->info('消费进程(' . $this->process->pid . ')退出');\n }",
"public function wakeUp() {}",
"private function hangup()\n\t{\n\t\twhile ( true ) {\n\t\t\t// dispatch signal for the handlers\n\t\t\tpcntl_signal_dispatch();\n\n\t\t\t// daemon process\n\t\t\t$this->daemon->check( $this );\n\n\t\t\t// prevent the child process become a zombie process\n\t\t\t// pcntl_wait($status);\n\t\t\tforeach ( $this->workers as $k => $v ) {\n\t\t\t\t$res = pcntl_waitpid( $v->pid, $status, WNOHANG );\n\t\t\t\t// if ($res == -1 || $res = 0) {\n\t\t\t\t// \t// exception\n\t\t\t\t// \tcontinue;\n\t\t\t\t// }\n\t\t\t\tif ( $res > 0 ) {\n\t\t\t\t\tunset( $this->workers[ $res ] );\n\n\t\t\t\t\tif ( $this->waitSignalProcessPool[ 'signal' ] === 'reload' ) {\n\t\t\t\t\t\tif ( array_key_exists( $res, $this->waitSignalProcessPool[ 'pool' ] ) ) {\n\t\t\t\t\t\t\tunset( $this->waitSignalProcessPool[ 'pool' ][ $res ] );\n\t\t\t\t\t\t\t// fork a new worker\n\t\t\t\t\t\t\t$this->fork();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this->waitSignalProcessPool[ 'signal' ] === 'stop' ) {\n\t\t\t\t\t\tif ( array_key_exists( $res, $this->waitSignalProcessPool[ 'pool' ] ) ) {\n\t\t\t\t\t\t\tunset( $this->waitSignalProcessPool[ 'pool' ][ $res ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $this->waitSignalProcessPool[ 'signal' ] === 'stop' ) {\n\t\t\t\t// all worker stop then stop the master process\n\t\t\t\tif ( empty( $this->waitSignalProcessPool[ 'pool' ] ) ) {\n\t\t\t\t\t$this->master->stop();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// read signal from worker\n\t\t\t// $this->master->pipeRead();\n\n\t\t\t// precent cpu usage rate reach 100%\n\t\t\tusleep( self::$hangupLoopMicrotime );\n\t\t}\n\t}",
"private function doWorkParent() {\n Log5PHP_MDC::put('Generation', 'parent');\n\n global $run;\n global $reload;\n global $workers;\n\n $this->parentSetup();\n\n while ($run && count($workers) > 0) {\n if ($reload) {\n gosUtility_parallel::$logger->info(\"Parent saw reload, restarting workers\");\n\n $reload = false;\n $this->killAllWorkers();\n $this->startAllWorkers();\n } else {\n $this->checkWorkers();\n }\n\n // Sleep 4 seconds\n usleep(4000000);\n }\n\n $this->parentCleanup();\n $this->killAllWorkers();\n pcntl_wait($status);\n }",
"public function stop()\n {\n // Update worker state and set it as finished\n $this->update(['resume_token' => 0, 'has_finished' => true]);\n }",
"public function _wake_up() {\n\t\tdo_action( 'searchwp\\debug\\log', 'Waking up', 'indexer' );\n\t\t$this->_destroy_queue();\n\t\t$this->unlock_process();\n\t\tsleep( 1 );\n\t\t$this->trigger();\n\t}",
"public function recoverFromCorruption()\n {\n }",
"protected function checkStartConditions(): void\n {\n if (!$this->exists) {\n throw new WorkerException('Worker must be properly created before start.');\n }\n\n if ($this->getAttribute('pid') !== null) {\n throw new WorkerException('Worker is running already.');\n }\n }",
"function CIR_waitForNextJob()\n{\n\t$lang = getClientLanguage();\n\n\t$quiet = ($_SESSION['debug'] ? \"\": \"-qq\");\n\n\tinclude(\"/m23/inc/i18n/\".I18N_m23instLanguage($lang).\"/m23inst.php\");\n\n\n\techo(\"\n#mv work.php `date +%s`.old\n\nSEC=0\nTIME=0\nloopRun=`true`\n\nwhile \\$loopRun\n\tdo\n\t\");\n\n\tif (RMV_get(\"debug\")!=1)\n\techo(\"dialog --backtitle \\\"$I18N_client_installation\\\" --title \\\"$I18N_client_status\\\" --infobox \\\"\\n$I18N_waiting_for_jobs\\\" 6 70\");\n\n\techo(\"\n\t\t#Add the client ID if it is available\n\t\tid=`cat /m23clientID 2> /dev/null`\n\t\tif test \\$id\n\t\tthen\n\t\t\tidvar=\\\"?m23clientID=\\$id\\\"\n\t\tfi\n\n\t\twget $quiet -Owork.php \\\"https://\".getServerIP().\"/work.php\\$idvar\\\" --no-check-certificate\n\t\t\n\t\tif test `find work.php -printf \\\"%s\\\"` -gt 0\n\t\tthen\n\t\t\tchmod +x work.php\n\t\t\tloopRun=`false`\n\t\t\tbreak\n\t\tfi\n\t\tsleep 20\n\t\tTIME=`expr \\$SEC / 60`\n\t\tSEC=`expr \\$SEC + 20`\n\tdone\n\t./work.php\n\t\\n\");\n}",
"public function run() {\n\t\tif ($this->schedule->isRun()) {\n\t\t\t$this->excuteHandle->excute();\n\t\t}\n\t}",
"public function halt();",
"public function wasWorked();",
"public function __invoke()\n {\n pcntl_signal_dispatch();\n }",
"protected function shouldRemoveBackgroundJob(): bool {\n\t\treturn $this->config->getSystemValueBool('has_internet_connection', true) === false ||\n\t\t\t$this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') === '' ||\n\t\t\t$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') !== 'yes' ||\n\t\t\t$this->retries >= 5;\n\t}",
"public function prepareForRestart() {\n\t\tparent::prepareForRestart();\n\t}",
"public function start($exit_when_running = true, $stuck_threshold = 20)\n\t{\n\t\techo $this->_nl, \"checking lock on $this->_dbtype $this->_object. at \" . date('Y/m/d H:i:s', time()), $this->_nl;\n\n\t\ttry\n\t\t{\n\t\t\t$q = $this->_conn->prepare(\"select in_process, case when start_time > finish_time and datediff(minute, start_time, getdate()) > {$stuck_threshold} then 1 else 0 end as is_stuck from sandbox.dbo.daemon where object = :object and dbtype = :dbtype\");\n\t\t\t$q->bindParam(':object', $this->_object);\n\t\t\t$q->bindParam(':dbtype', $this->_dbtype);\n\n\t\t\t$q->execute();\n\t\t\t$rs = $q->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\techo 'ERROR: ' , $e->getMessage(), $this->_nl;\n\t\t\t\n\t\t\tif ($exit_when_running)\n\t\t\t\tdie();\n\t\t\telse return false;\n\t\t}\n\n\t\t// if no daemon entry for this queue, create one\n\t\t$currently_running = $is_stuck = false;\n\t\tif (empty($rs))\n\t\t\t$this->create();\n\t\telse $currently_running = (bool) $rs[0]['in_process'];\n\t\t\n\t\t$is_stuck = $rs[0]['is_stuck'];\n\t\tif ($is_stuck)\n\t\t{\n\t\t\techo \"$this->_dbtype $this->_object is stuck.\", $this->_nl, $this->_nl;\n\t\t\t@mail('chris@annieselke.com', \"$this->_dbtype $this->_object is stuck\", '');\n\t\t}\n\n\t\tif ($currently_running)\n\t\t{\n\t\t\t// do I want to just exit here? or is there something a script would have to do regardless of whether the queue is locked\n\t\t\techo \"$this->_dbtype $this->_object is currently running: locked.\", $this->_nl, $this->_nl;\n\t\t\t\n\t\t\tif ($exit_when_running)\n\t\t\t\tdie();\n\t\t\telse return false;\n\t\t}\n\n\t\t$this->set_process_state(true);\n\t\treturn true;\n\t}",
"public function __sleep()\n\t{\n\t\t$this->_redisMaster = $this->_redisSlave = null;\n\t}",
"public function manageNotFoundExecutableAction()\n {\n $responses = $this->triggerEvent(__FUNCTION__ . '.normalAction');\n return !$responses->stopped() && $this->flowEvaluator->attemptResume();\n }",
"private static function start_gearman_workers($gearman_options) \n\t{\n\t\tforeach($gearman_options AS $gearman_class => $worker_count) {\n\t\t\tfor ($worker_id = 0; $worker_id < $worker_count; $worker_id++) {\n\t\t\t\t$pid_file = self::$pid_dir.$gearman_class.'_'.$worker_id.'.pid';\n\t\t\t\tself::_start_job_process($gearman_class, $pid_file, 'gearman');\n\t\t\t}\n\t\t}\n\t}",
"protected function stopTask() {}",
"public function handle()\r\n {\r\n try {\r\n $this->call(\"swooliy:stop\");\r\n\r\n sleep(2);\r\n \r\n $this->call(\"swooliy:start\");\r\n } catch (Throwable $e) {\r\n die($e);\r\n }\r\n }"
] | [
"0.63283414",
"0.62497145",
"0.6187386",
"0.58987856",
"0.5823127",
"0.5809223",
"0.5743171",
"0.56973636",
"0.5689473",
"0.56821793",
"0.5492178",
"0.5454132",
"0.54520893",
"0.54484385",
"0.5381954",
"0.53758806",
"0.53637993",
"0.5336607",
"0.5336099",
"0.53348863",
"0.52863634",
"0.5279856",
"0.52634925",
"0.52568424",
"0.525559",
"0.525077",
"0.5229018",
"0.5228736",
"0.5225528",
"0.52185607"
] | 0.6922119 | 0 |
use kill command to stop process it is unsafe and particularly dangerous for running gearman worker | public function gearmanWorkerStop()
{
for($i = 0; $i < $this->_gearmanForkCount; $i++){
$this->sub_process_keys[] = $i+1;
}
foreach ($this->sub_process_keys as $_sub_key) {
$shell_cmd = "ps aux | grep ".$this->_workerFileName. " |";
$shell_cmd .= "grep -v 'grep' | awk '{print $2}' |";
$sub_process_name = $this->_workerFileName."_".$_sub_key;
$pid_file = $this->_lockDir.$this->_workerFileName."_".$_sub_key.".pid";
$pid_cmd = "cat $pid_file";
$pid = exec($pid_cmd);
$shell_cmd .= " grep $pid";
echo $shell_cmd."\n";
//查看进程是不是存在
$ps_res = exec($shell_cmd);
if (empty($ps_res)) {
echo "process $sub_process_name is not running!\n";
} else {
$kill_cmd = "kill $pid";
exec($kill_cmd);
$this->killed_sub_process_keys[] = $_sub_key;
echo "process $sub_process_name is stopped\n";
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function kill();",
"private function serveStop()\n {\n foreach ($this->pid as $pid) {\n $command = \"kill -9 {$pid} > /dev/null 2> /dev/null &\";\n @exec($command, $output);\n }\n }",
"public function kill(): void;",
"function kill_Process()\n {\n $this->set_kill_Command();\n //Fire Script \n $this->fire_Script();\n $response = array(\"status\"=>$this->status,\n \"script_ouput\"=>$this->script_output,\n \"executation_time\"=>$this->time_interval,\n \"message\"=>$this->message);\n \n echo json_encode($response, JSON_PRETTY_PRINT);\n }",
"public function stop()\n {\n if (OS::isWin()) {\n $cmd = \"taskkill /pid {$this->pid} -t -f\";\n } else {\n $cmd = \"kill -9 {$this->pid}\";\n }\n shell_exec($cmd);\n }",
"function killProcess(string $id) : void\n {\n shell_exec(\"kill $id\");\n }",
"function killProcess($pid)\n{\n $mapper = systemToolkit::getInstance()->getMapper('process', 'process');\n $process = $mapper->searchOneByField('pid', $pid);\n if($process) {\n $mapper->delete($process);\n }\n}",
"public function stop() {\n try {\n $pid = $this->getPidFile()->read();\n\n Logger::log(\"Killing THIS PID: \" . $pid, \\Zend_Log::WARN);\n posix_kill($pid, SIGTERM);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n $this->_exit();\n }",
"public function killCommand()\n {\n $this->registry->set(Registry::DAEMON_KILL_KEY, time());\n $this->outputLine('Broadcast kill signal');\n }",
"private function stop_ATD()\n\t{\n\t\texecuteCommand('killall run-lowmem.sh', '', $result, $return_status);\n\t}",
"function stdapi_sys_process_kill($req, &$pkt) {\n # that isn't enabled by default, but better to try it and avoid shelling\n # out when unnecessary.\n my_print(\"doing kill\");\n $pid_tlv = packet_get_tlv($req, TLV_TYPE_PID);\n $pid = $pid_tlv['value'];\n if (is_callable('posix_kill')) {\n $ret = posix_kill($pid, 9);\n $ret = $ret ? ERROR_SUCCESS : posix_get_last_error();\n if ($ret != ERROR_SUCCESS) {\n my_print(posix_strerror($ret));\n }\n } else {\n $ret = ERROR_FAILURE;\n if (is_windows()) {\n my_cmd(\"taskkill /f /pid $pid\");\n # Don't know how to check for success yet, so just assume it worked\n $ret = ERROR_SUCCESS;\n } else {\n if (\"foo\" == my_cmd(\"kill -9 $pid && echo foo\")) {\n $ret = ERROR_SUCCESS;\n }\n }\n }\n return $ret;\n}",
"public static function killProcesses() {\n foreach(self::$__pIds as $pid => $active) {\n if(self::$__infoKill) {\n echo sprintf(self::$__infoKill, date('r'), $pid) . PHP_EOL;\n }\n exec('kill ' . $pid);\n unset(self::$__pIds[$pid]);\n };\n }",
"public function killChild()\n\t{\n\t\tif (!$this->child) {\n\t\t\t$this->logger->log(LogLevel::DEBUG, 'No child to kill.');\n\t\t\treturn;\n\t\t}\n\n\t\t$context = array('child' => $this->child);\n\t\t$this->logger->log(LogLevel::INFO, 'Killing child at {child}', $context);\n\t\tif (exec('ps -o pid,s -p ' . $this->child, $output, $returnCode) && $returnCode != 1) {\n\t\t\t$context = array('child' => $this->child);\n\t\t\t$this->logger->log(LogLevel::DEBUG, 'Child {child} found, killing.', $context);\n\t\t\tposix_kill($this->child, SIGKILL);\n\t\t\t$this->child = null;\n\t\t} else {\n\t\t\t$context = array('child' => $this->child);\n\t\t\t$this->logger->log(LogLevel::INFO, 'Child {child} not found, restarting.', $context);\n\t\t\t$this->shutdown();\n\t\t}\n\t}",
"public function stop() {\n\t\tLogger::getRootLogger ()->info ( \"Stopping IPsec\" );\n\t\t$pid = file_exists ( self::PID_PATH ) ? Functions::shellCommand ( \"pgrep -F \" . self::PID_PATH ) : 0;\n\t\tif ($pid > 0) {\n\t\t\tFunctions::shellCommand ( \"/bin/kill {$pid}\" );\n\t\t}\n\t}",
"protected function killProcess(): void\n {\n if (($pid = $this->getAttribute('pid')) === null) {\n return;\n }\n\n if ($this->systemCommands()->isProcessRunning($pid)) {\n $this->systemCommands()->killProcess($pid);\n }\n }",
"public function stop() {\n\t\t$this->invoke(\"stop\");\n\t}",
"protected abstract function killFree();",
"protected function stop()\n {\n $pidFile = $this->getPidFile();\n\n if(!is_file($pidFile)){\n echo \"PID file not present, so service is not started\\n\";\n exit;\n }\n if(!is_writable($pidFile)){\n echo \"Insufficient permissions. Please execute as service like 'sudo service anyterm start'\";\n exit;\n }\n\n shell_exec('kill `cat /var/run/anyterm.pid`');\n unlink($pidFile);\n }",
"public function gracefulStop(){\n $this->handleWorkerOutput('warn', \"Work done, exiting now.\");\n $this->stop();\n }",
"public function terminate();",
"public function kill()\n {\n $this->log(\"Killing process {$this->pid}\");\n $command = \"kill {$this->pid}\";\n exec($command, $output);\n\n if ($this->processIsRunning()) {\n $this->log(\"Process {$this->pid} cannot die!\");\n return false;\n }\n\n $this->log(\"Process {$this->pid} is dead.\");\n return true;\n }",
"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() {}"
] | [
"0.780975",
"0.7335286",
"0.72063285",
"0.7094114",
"0.7086525",
"0.70338255",
"0.6961979",
"0.6866553",
"0.6847355",
"0.67614466",
"0.66687155",
"0.6592907",
"0.6512263",
"0.6483066",
"0.6429606",
"0.6396682",
"0.63490456",
"0.6286256",
"0.62840074",
"0.6283107",
"0.6277343",
"0.62764525",
"0.62764525",
"0.62764525",
"0.62764525",
"0.62764525",
"0.62764525",
"0.62764525",
"0.62764525",
"0.62553215"
] | 0.7410336 | 1 |
$sql = "SELECT db_lifting_price FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id and quantity=1"; | public function get_dd_price ( $sku_id )
{
$sql = "SELECT db_lifting_price FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id HAVING MIN( quantity )";
$query = $this->db->query( $sql );
return $query->result_array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_unit_price($sku_id) {\n $sql = \"SELECT t1.outlet_lifting_price as price, t2.sku_code, t2.sku_description\n FROM `tbli_sku_mou_price_mapping` as t1 \n Inner JOIN `tbld_sku` as t2 On t1.sku_id=t2.id\n where sku_id=$sku_id and quantity=1\";\n $query = $this->db->query($sql)->result_array();\n\n return $query;\n }",
"function getStocksPurchases($mysqli,$sale_id){\n\t$query = \"SELECT stocks.description,subsales.price_per_ton,subsales.quantity,subsales.subtotal FROM sales INNER join subsales ON sales.id = subsales.sale_id INNER JOIN stocks ON stocks.id = subsales.stock_id WHERE sales.id = '$sale_id'\";\n\n\tif($result = mysqli_query($mysqli,$query)){\n\t\treturn $result ;\n\t}\n\telse{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\t\n}",
"function getPlayerWarehouseItem($player_id, $item_id)\n{\n global $db;\n return $db->where(\"player_id\", $player_id)\n ->where(\"item_id\", $item_id)\n ->getOne(\"warehouse\", \"quantity\");\n}",
"function get_price($pid){\n\t$products = \"scart_products\"; // products table\n\t$serial = \"bookid\"; // products key\n\t$result=mysql_query(\"select price from $products where $serial=$pid\")\n or die (\"Query '$products' and '$pid' failed with error message: \\\"\" . mysql_error () . '\"');\n\t$row=mysql_fetch_array($result);\n\treturn $row['price']; // products price\n}",
"function getMaxprice(){\r\n $q = \"SELECT * FROM maximum\";\r\n $result = $this->query($q);\r\n return $result;\r\n }",
"public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }",
"public function getFoodbyID($sku){\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n \r\n\r\n // YOUR CODE GOES HERE\r\n\r\n return $result;\r\n }",
"function getTotalProductsSold() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantitysold) AS sqs FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}",
"function get_price($name)\n{\n $query_setting_price = mysql_query(\"SELECT `value` FROM `setting_seagods` WHERE `name` = '$name' LIMIT 0,1\");\n $row_setting_price = mysql_fetch_array($query_setting_price);\n return $row_setting_price['value'];\n}",
"function getMinPrice(){\r\n $q = \"SELECT * FROM minimum\";\r\n $result = $this->query($q);\r\n return $result;\r\n }",
"function getTotalProductsAvailable() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantityavailable) AS sqa FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}",
"function mount_query($date){\n\n$query = \"SELECT product_quantity.quantity, product.price FROM table_order, product, product_quantity\nWHERE product.product_id = table_order.product_id\n\tAND product_quantity.pq_id = table_order.pq_id\n\tAND product_quantity.product_id = table_order.product_id\n\tAND table_order.order_date =\".$date.\";\";\n\nreturn $query;\n}",
"public function getPatientChargesQTY($itemNo) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT * from patientCharges where itemNo = '$itemNo' \");\n\nwhile($row = mysqli_fetch_array($result))\n {\nreturn $row['quantity'];\n }\n\n}",
"private function getProductSearchQuery(string $productSku): string\n {\n return <<<QUERY\n{\n products(filter: {sku: {eq: \"{$productSku}\"}}) {\n items {\n special_price\n }\n }\n}\nQUERY;\n }",
"function get_price($name)\r\n{\r\n //Read data from DB table\r\n\r\n $servername = \"localhost\";\r\n $dbname = \"webservices\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n } \r\n\t\r\n\r\n \r\n $sql = \"SELECT price, make, model, year FROM vehicles_pinefalls where make ='$name' order by price asc limit 1\";\r\n $result = $conn->query($sql);\r\n\r\n $info=mysqli_fetch_array($result,MYSQLI_ASSOC);\r\n\r\n return $info;\r\n}",
"function _get_product_stock($product_id = 0)\r\n {\r\n return @$this->db->query(\"select sum(available_qty) as t from t_stock_info where product_id = ? and available_qty >= 0 \",$product_id)->row()->t;\r\n }",
"private function getProductQuery(string $sku): string\n {\n return <<<QUERY\n{\n products(search: \"{$sku}\") {\n items {\n sku\n ... on BundleProduct {\n items {\n sku\n option_id\n uid\n required\n type\n title\n options {\n uid\n label\n product {\n sku\n }\n can_change_quantity\n id\n uid\n price\n quantity\n }\n }\n }\n }\n }\n}\nQUERY;\n }",
"function es_product_bulk_price($price, $quantity, $sku) {\n\t/*\n\t* PUB41 - Your child’s first year at school Bulk discount\n\t* For orders of x >= 20 $12.95, x >= 50 $9.90\n\t*/\n\tif ($sku == 'PUB41') {\n\t\tif ($quantity >= 20 AND $quantity < 50) {\n\t\t\t$price = 12.95;\n\t\t}\n\t\telseif ($quantity >= 50) {\n\t\t\t$price = 9.95;\n\t\t}\n\t}\n\telseif($sku == 'SUND507') {\n\t\tif ($quantity >= 3)\n\t\t\t$price = 10.95;\n\t}\n\telseif($sku == 'SUND621') {\n\t\tif ($quantity >= 3)\n\t\t\t$price = 16.95;\n\t}\n\telseif($sku == 'SUND620') {\n\t\tif ($quantity >= 5)\n\t\t\t$price = 14.95;\n\t}\n\t\n\treturn $price;\n}",
"public function get_prices ( $sku_id )\n {\n $sql = \"SELECT * FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id Order by quantity\";\n $query = $this->db->query( $sql );\n return $query->result_array();\n }",
"function jumlah_powerdall(){\n\t\t// return $this->db->query($query)->result();\n\t\tdate_default_timezone_set(\"Asia/Makassar\");\n\t\t$kondisi=date(\"m\");\n\t\t$query = \"SELECT SUM(power) as powerm FROM power_s3d WHERE m=$kondisi\";\n\t\treturn $this->db->query($query)->result();\n\t}",
"function _get_product_stock_bystkid($stock_id = 0)\r\n {\r\n return @$this->db->query(\"select available_qty as t from t_stock_info where stock_id = ? and available_qty >= 0 \",$stock_id)->row()->t;\r\n }",
"function getStockQuantity($username, $symbol)\n{\n $mysql_server = '192.168.1.101';\n \n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n \n $qry = \"SELECT * FROM portfolio WHERE username='$username' and stockSymbol='$symbol'\";\n $result = $mysqli->query($qry);\n \n $totalQty = 0;\n \n \n if($result->num_rows > 0){\n while ($row = $result->fetch_assoc()){\n \n $totalQty += $row['qty'];\n }\n }\n return $totalQty;\n}",
"function low_price(){\n\tglobal $con;\t\n\t$get_lprice = \"SELECT * FROM items ORDER BY item_pice ASC\";\n\t$run_lprice = mysql_query($get_lprice);\t\n\tshow_item($run_lprice);\n\n}",
"private function selectProductLowStock(){\n\t\t$data = $this->connection->createCommand('select id, sku, name, minimum_quantity, quantity from product where minimum_quantity is not null and quantity <= minimum_quantity and product_type_id = 2 and tenant_id = '. $this->tenant)->queryAll();\n\t\tforeach($data as $key => $value){\t\n\t\t\t$sqlBalance = 'select * from stock_balance where product_id = '. $value['id'];\n\t\t\t$sqlBalance = $this->connection->createCommand($sqlBalance)->queryOne();\n\t\t\tif(!empty($sqlBalance['warehouse_id'])){\n\t\t\t\t$sqlBalance['warehouse_id'] = $this->connection->createCommand('select id,name from warehouse where id = '. $sqlBalance['warehouse_id'])->queryOne();\n\t\t\t\t$data[$key]['balance'] = $sqlBalance;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"function fetchAllItemCurrentStock()\r{\r $link = parent::connectToDB();\r\t$query=\"select stock.item_id,item.name_brand,category.name,sum(stock.current_stock) from item,category,stock where stock.item_id=item.item_id and item.category_id=category.category_id group by stock.item_id\";\r\t$result8 = mysqli_query($link, $query);\rif($result8)\r{\rreturn $result8;\r}\relse\r{\rreturn false;\r}\r}",
"function getUpdateItem($product_id){\n\tglobal $conn;\n\t$ip = getIp();\n\t$get_qty =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip' AND `p_id`='$product_id'\");\n\t$row_qty=mysqli_fetch_array($get_qty);\n\t$quantity= $row_qty[\"qty\"];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\t$row_price = mysqli_fetch_array($get_price);\n\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\treturn $sub_total;\n}",
"function getStockQuantity($stock_id,$mysqli){\n\t$query = \"SELECT quantity_in_store FROM stocks WHERE id = '$stock_id'\";\n\tif ($result = mysqli_query($mysqli,$query)){\n\t\treturn mysqli_fetch_assoc($result)['quantity_in_store'];\n\t}else{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\n}",
"function getProductById($itemId) {\r\n $itemId - intval($itemId);\r\n $sql = \"SELECT * FROM products WHERE id = '$itemId'\";\r\n//d($sql);\r\n include '../config/db.php';\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n// d($rs);\r\n// d(mysqli_fetch_all($rs, MYSQLI_ASSOC));\r\n\r\n return mysqli_fetch_all($rs, MYSQLI_ASSOC);\r\n}",
"public function showProductQty(){\n $sId = session_id();\n $query = \"SELECT * FROM tbl_cart WHERE sId = '$sId'\";\n $select_result = $this->db->select($query);\n\n if ($select_result) {\n $row = mysqli_num_rows($select_result);\n return $row;\n //return $select_result;\n }else {\n return 0;\n }\n\n }",
"function SkuFromID($parametro){\n\t$db = new mysql();\n\t\n\t$result = $db->consulta(\"SELECT IDPRODUCTO,FECHA FROM \".PREFIX.\"productos WHERE IDPRODUCTO='\".$parametro.\"' LIMIT 1\");\n\t$row = $db->recuperar_array($result);\t\n\t$sku = $row['PRESKU'].$parametro;\n\treturn $sku;\n}"
] | [
"0.721611",
"0.6238702",
"0.62143993",
"0.61865956",
"0.6131574",
"0.6116619",
"0.6051333",
"0.6025234",
"0.59959334",
"0.59911424",
"0.59887695",
"0.5976927",
"0.596946",
"0.5967573",
"0.5916602",
"0.59155047",
"0.59089005",
"0.5861578",
"0.58375883",
"0.58290946",
"0.5820259",
"0.5788069",
"0.5761079",
"0.57468766",
"0.57400435",
"0.57193685",
"0.5714658",
"0.5710936",
"0.56805956",
"0.567372"
] | 0.64230317 | 1 |
sku Hierarchy start Gent All Sku Hierarchy table Data // | public function getSkuHierarchy ()
{
$sql = "select t1.id,t1.layer_name,t1.layer_code,t1.layer_description,t1.parent_layer_id,t2.id as parent_layer_id,"
. " (Select b.layer_name from tbld_sku_hierarchy as b where t2.id = b.id) as parent_layer_name from tbld_sku_hierarchy as t1 left join tbld_sku_hierarchy as t2 on t2.id = t1.parent_layer_id ";
$query = $this->db->query( $sql )->result_array();
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSkuHierarchyElements ()\n{\n\n// $sql = \"select t1.id as sku_hierarchy_element_by_id,t1.element_name,t1.element_code,t1.element_description,t1.element_category_id,t1.parent_element_id,\n// t2.id as parent_layer_id,t3.id,t3.layer_name as element_category,\n// (Select b.element_name from tbld_sku_hierarchy_elements as b where t2.id = b.id)\n// as parent_element_name from tbld_sku_hierarchy_elements\n// as t1 left join tbld_sku_hierarchy_elements as t2 on t2.id = t1.parent_element_id\n// left join tbld_sku_hierarchy as t3 on t2.element_category_id = t3.id \";\n $sql = \"SELECT t1.*,t1.id as sku_hierarchy_element_by_id,t2.layer_name as element_category,t3.element_name as parent_element_name FROM `tbld_sku_hierarchy_elements` as t1\n left join `tbld_sku_hierarchy` as t2 on t1.element_category_id=t2.id\n left join `tbld_sku_hierarchy_elements` as t3 on t1.parent_element_id=t3.id\";\n $query = $this->db->query( $sql )->result_array();\n\n return $query;\n\n}",
"public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }",
"function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }",
"function startCountingAddedLevels()\n {\n\tforeach ($this->getSchema()->getLevels() as $level)\n\t{\n\t $select = $this->getReadAdapter()->select()->from('elite_level_' . $this->getSchema()->id() .'_' . str_replace(' ', '_', $level), 'count(*)');\n\t $result = $select->query()->fetchColumn();\n\t $this->start_count_added_by_level[$level] = $result;\n\t}\n }",
"public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}",
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"function ext_tree($parent_id, $con, $lev, $info) {\n\n // rows selection from TBSM tables\n $sel = \"SELECT SERVICEINSTANCEID, SERVICEINSTANCENAME, DISPLAYNAME, SERVICESLANAME, TIMEWINDOWNAME\n\t\t\t\tFROM TBSMBASE.SERVICEINSTANCE, TBSMBASE.SERVICEINSTANCERELATIONSHIP\n\t\t\t\tWHERE PARENTINSTANCEKEY = '$parent_id' AND SERVICEINSTANCEID = CHILDINSTANCEKEY\";\n $stmt = db2_prepare($con, $sel);\n $result = db2_execute($stmt);\n\n $values = 0;\n while ($row = db2_fetch_assoc($stmt)) {\n $values++;\n $info[$lev] = array (\n 'level' => $lev,\n 'endpoint' => false,\n 'id' => $row['SERVICEINSTANCEID'],\n 'service' => $row['SERVICEINSTANCENAME'],\n 'display' => $row['DISPLAYNAME'],\n 'template' => $row['SERVICESLANAME'],\n 'maintenance' => $row['TIMEWINDOWNAME'],\n );\n // unique value\n if (!in_array($row['SERVICEINSTANCEID'], array_column($GLOBALS['results'], 'id')))\n $GLOBALS['results'][] = $info[count($info)-1];\n\n // recursive function call\n ext_tree($row['SERVICEINSTANCEID'], $con, $lev+1, $info);\n }\n\n return ($values > 0);\n}",
"function get_sitetree(&$massiv, $start, $level){\n\t\tglobal $web;\n\t\t\n\t\t$list \t= '';\n\t\t$class \t= '';\n\t\tif (!isset($massiv[$start])) return;\n\t\t\n\t\tif ($level == 1) {\n\t\t\t$class \t= 'sub';\n\t\t} elseif ($level == 2) {\n\t\t\t$class = 'subsub';\n\t\t}\n\t\t\n\t\tforeach($massiv[$start] as $key=>$value){\n\t\t\t$list .= '<a class=\"'.$class.'\" href=\"'.SmartUrlEncode(WBG::crosslink($value)).'\">'.$value['title'].'</a>';\n\t\t\t$list .= get_sitetree($massiv, $key, $level+1);\n\t }\n\t \n\t\treturn $list;\n\t}",
"public function getSelectedBranchStudentData($start){\n $start = ($start-1)*10 ;\n $end = $start + 10;\n if($this->databaseConnection()){\n $query = $this->db_connection->prepare('select * from branch limit :start , :end');\n $query->bindValue(':start', $start ,PDO::PARAM_INT);\n $query->bindValue(':end', $end ,PDO::PARAM_INT);\n $query->execute();\n return $query; \n }\n }",
"public function ddl_parentdetails()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$search = \"SELECT DISTINCT parent_id, label_id, label\r\n\t\t\t\t\t\t\tFROM parents\";\r\n\t\t\t\t$resultq = mysqli_query($link, $search);\r\n\t\t\t\t$sow = array();\r\n\t\t\t\t$sow_arr = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($resultq)) {\t\r\n\t\t\t\t\t$sow['parent_id'] =$row[0];\r\n\t\t\t\t\t$sow['label_id'] =$row[1];\r\n\t\t\t\t\t$sow['label'] =$row[2];\r\n\t\t\t\t\t$fsow_arr[] = $sow;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $fsow_arr;\r\n\t\t}",
"function iso639families_complete_by_table($records) {\n\t$hierarchies =array();\n\t$loc_to_spip = $GLOBALS['iso_service']['iso639families']['add_fields']['loc'];\n\n\t// On récupère la page de description de la famille sur le site SIL.\n\tinclude_spip('inc/distant');\n\t$url = _CODELANG_LOC_ISO639_5_HIERARCHY;\n\t$options = array('transcoder' => true);\n\t$flux = recuperer_url($url, $options);\n\n\t// On décrypte la page et principalement le tableau pour en extraire la colonne hiérarchie\n\t// de chaque famille et créer la colonne parent dans la table iso639families.\n\tinclude_spip('inc/filtres');\n\t$table = extraire_balise($flux['page'], 'table');\n\tif ($table) {\n\t\t// On extrait la première table de la page qui contient les données voulues\n\t\t$rows = extraire_balises($table, 'tr');\n\t\tif ($rows) {\n\t\t\t// La première ligne du tableau est celle des titres de colonnes : on la supprime.\n\t\t\tarray_shift($rows);\n\t\t\tforeach ($rows as $_row) {\n\t\t\t\t// Chaque ligne de la table est composée de deux colonnes, le première le libellé\n\t\t\t\t// et la deuxième la valeur.\n\t\t\t\t$columns = extraire_balises($_row, 'td');\n\t\t\t\t$columns = array_map('supprimer_tags', $columns);\n\t\t\t\tif (count($columns) >= 2) {\n\t\t\t\t\t// La première colonne contient la hiérarchie et la seconde le code alpha-3 de la famille.\n\t\t\t\t\t$code = trim($columns[1]);\n\t\t\t\t\t$hierarchies[$code] = str_replace(array(' ', ':'), array('', ','), trim($columns[0]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// On complète maintenant le tableau des enregistrements avec la colonne additionnelle hierarchy et la colonne\n\t// dérivée parent qui ne contient que le code alpha-3 de la famille parente si elle existe.\n\tforeach($records as $_cle => $_record) {\n\t\t$code = $_record['code_639_5'];\n\t\t$records[$_cle]['parent'] = '';\n\t\tif (isset($hierarchies[$code])) {\n\t\t\t$records[$_cle][$loc_to_spip['Hierarchy']] = $hierarchies[$code];\n\t\t\t// Calcul du parent : si la hierarchie ne contient qu'un code c'est qu'il n'y a pas de parent.\n\t\t\t// Sinon, le parent est le premier code qui précède le code du record.\n\t\t\t$parents = explode(',', $hierarchies[$code]);\n\t\t\tif (count($parents) > 1) {\n\t\t\t\tarray_pop($parents);\n\t\t\t\t$records[$_cle]['parent'] = array_pop($parents);\n\t\t\t}\n\t\t} else {\n\t\t\t$records[$_cle][$loc_to_spip['Hierarchy']] = '';\n\t\t}\n\t}\n\n\treturn $records;\n}",
"function display_node($parent, $level) {\n global $tam1;\n $tam2=array();\n global $leafnodes; \n global $responce;\n if($parent >0) {\n foreach ($tam1 as $row){\n\t if($row['ID_Parent']==$parent){\n\t\t $tam2[]=$row;\n\t }\n }\n } else {\n \n\t foreach ($tam1 as $row){\n\t if($row['ID_Parent']==''){\n\t\t $tam2[]=$row;\n\t }\n }\n }\n\n foreach ($tam2 as $row) {\n\tif(!$row['ID_Parent']) $valp = 'NULL'; else $valp = $row['ID_Parent'];\t\n\t//kiem tra node co phai lead\n\tif(array_key_exists($row['ID_Control'], $leafnodes)) $leaf='true'; else $leaf = 'false';\t\n\t$responce[] = array('ID_Control' => $row[\"ID_Control\"], 'ID_Parent' => $row[\"ID_Parent\"], 'Caption' => $row[\"Caption\"],'KieuControl' => $row[\"KieuControl\"],'IsBarButton' => $row[\"IsBarButton\"] ,'Icon' =>$row[\"Icon\"],'Active' =>$row[\"Active\"],'STT' =>$row[\"STT\"],'PageOpen' =>$row[\"PageOpen\"],'OpenType' =>$row[\"OpenType\"],'TenControl' =>$row[\"TenControl\"] , 'level' => $level, 'parent' => $valp, 'isLeaf' => $leaf, 'expanded' => \"true\", 'loaded' => \"true\");\n\t\n\t display_node($row['ID_Control'],$level+1);\n\t \n\t} \n \n return $responce;\n \n}",
"private function _readSubTableData() {}",
"function beginChildren()\n {\n echo \"<tr>\";\n }",
"public function loadStudents(){\n $data=$this->studentsInRiskForThis();\n $cantidad=count($data);\n $contador=0;\n foreach($data as $fila){\n IF(Talleresdet::firstOrCreateStatic([\n 'talleres_id'=>$this->id,\n 'codalu'=>$fila['codalu'],\n ], Talleresdet::SCENARIO_BATCH ))\n $contador++; \n }\n return ['total'=>$cantidad,'contador'=>$contador];\n }",
"static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \" Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }",
"protected function loadParentId(){return 0;}",
"function buildFamilyTrees() {\n\t\t\n\t\taddToDebugLog(\"getZerothGen(), Function Entry - no parameters, INFO\");\n\t\t\n\t\t$sql = \"SELECT * FROM hackcess.character WHERE generation = 0;\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\t\n\t\t$gen = 0;\n\t\t\n\n\t\t\n\t\tfor ($z = 0; $z < $rows; $z++) {\n\t\t\techo \"<table cellpadding=3 cellspacing=0 border=1 align=center width=1000px>\";\n\t\t\techo \"<tr bgcolor=#bbb><td align=center>Gen<td>Name<td align=right>Average Fight Length<td>Fights</tr>\";\n\t\t\t$character_id = $result[$z][0];\n\t\t\techo \"<tr><td width=50px align=center>\" . $gen . \"<td>\" . $result[$z][2] . \"<td align=right width=300px>\" . barGraph(getAverageRounds($character_id), 'char') . \"<td width=300px align=left>\" . barGraph(characterFightCount($character_id), \"enemy\") . \"</tr>\";\n\n\t\t\t$rows2 = 1;\n\t\t\t\n\t\t\twhile ($rows2 == 1) {\n\t\t\t\t\n\t\t\t\t$gen++;\n\t\t\t\t\n\t\t\t\t$sql2 = \"SELECT * FROM hackcess.character WHERE parent_id = \" . $character_id . \";\";\n\t\t\t\t$result2 = search($sql2);\n\t\t\t\t$rows2 = count($result2);\n\t\t\t\tif ($rows2 == 1) {\n\t\t\t\t\techo \"<tr><td width=50px align=center>\" . $gen . \"<td>\" . $result2[0][2] . \"<td align=right width=300px>\" . barGraph(getAverageRounds($character_id), 'char') . \"<td width=300px align=left>\" . barGraph(characterFightCount($character_id), \"enemy\") . \"</tr>\";\n\t\t\t\t\t$character_id = $result2[0][0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\techo \"</table><P>\";\n\t\t\t$gen = 0;\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function run()\n {\n $items = [\n \t['id' => 1, 'name' => 'Skincare'],\n \t['id' => 2, 'name' => 'Cleansing'],\n \t['id' => 3, 'name' => 'Base'],\n \t['id' => 4, 'name' => 'Eyes|Lips|Cheek'],\n \t['id' => 5, 'name' => 'Masks'],\n \t['id' => 6, 'name' => 'Suncare'],\n \t['id' => 7, 'name' => 'Special Care'],\n \t['id' => 8, 'name' => 'Body|Hand|Foot'],\n \t['id' => 9, 'name' => 'Hair Care'],\n \t['id' => 10, 'name' => 'Nail Care'],\n \t['id' => 11, 'name' => 'Contact Lenses'],\n \t['id' => 12, 'name' => 'Perfumes'],\n \t['id' => 13, 'name' => 'Tools|Others'],\n\n \t['id' => 14, 'parent' => 1, 'name' => 'Toner'],\n \t['id' => 15, 'parent' => 1, 'name' => 'Lotion'],\n \t['id' => 16, 'parent' => 1, 'name' => 'Essence'],\n \t['id' => 17, 'parent' => 1, 'name' => 'Cream'],\n \t['id' => 18, 'parent' => 2, 'name' => 'Cleansing Water'],\n \t['id' => 19, 'parent' => 2, 'name' => 'Cleansing Wipes'],\n \t['id' => 20, 'parent' => 3, 'name' => 'Primer'],\n \t['id' => 21, 'parent' => 3, 'name' => 'Foundation'],\n \t['id' => 22, 'parent' => 3, 'name' => 'Concealer'],\n \t['id' => 23, 'parent' => 3, 'name' => 'Powder'],\n \t['id' => 24, 'parent' => 4, 'name' => 'Blush'],\n \t['id' => 25, 'parent' => 4, 'name' => 'Contour'],\n \t['id' => 26, 'parent' => 4, 'name' => 'Highlighter'],\n \t['id' => 27, 'parent' => 4, 'name' => 'Eyebrow'],\n \t['id' => 28, 'parent' => 4, 'name' => 'Eyeshadow'],\n \t['id' => 29, 'parent' => 4, 'name' => 'Eyeliner'],\n \t['id' => 30, 'parent' => 4, 'name' => 'Mascara'],\n \t['id' => 31, 'parent' => 4, 'name' => 'Lipstick'],\n \t['id' => 32, 'parent' => 4, 'name' => 'Lip Tint'],\n \t['id' => 33, 'parent' => 5, 'name' => 'Sheet Mask'],\n \t['id' => 34, 'parent' => 6, 'name' => 'Sunblock'],\n \t['id' => 35, 'parent' => 7, 'name' => 'Wrinkle Care'],\n \t['id' => 36, 'parent' => 7, 'name' => 'Acne Care'],\n \t['id' => 37, 'parent' => 8, 'name' => 'Body Wash'],\n \t['id' => 38, 'parent' => 9, 'name' => 'Hair Color'],\n \t['id' => 39, 'parent' => 10, 'name' => 'Nail Polish'],\n \t['id' => 40, 'parent' => 11, 'name' => 'Color Lenses'],\n \t['id' => 41, 'parent' => 12, 'name' => 'Candles'],\n \t['id' => 42, 'parent' => 13, 'name' => 'Brush'],\n \t['id' => 43, 'parent' => 13, 'name' => 'Lashes'],\n ];\n\n foreach ($items as $item) {\n \tCategory::updateOrCreate(['id' => $item['id']], $item);\n }\n }",
"function getScos()\n\t{\n\t\tif ($this->chap > 0)\n\t\t{\n\t\t\t$nodes = $this->tree->getChilds($this->chap);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nodes = $this->tree->getSubTree($this->tree->getNodeData($this->tree->root_id),true,array('sco'));\n\t\t}\n\n\t\t$scos = array();\n\n\t\t$nr = 1;\n\t\tforeach($nodes as $node)\n\t\t{\n\t\t\tif ($node[\"type\"] == \"sco\")\n\t\t\t{\n\t\t\t\t$node[\"nr\"] = $nr++;\n\t\t\t\t$scos[] = $node;\n\t\t\t}\n\t\t}\n\n\t\t$this->setDefaultOrderField(\"nr\");\n\t\t$this->setDefaultOrderDirection(\"asc\");\n\t\t$this->setData($scos);\n\t}",
"function get_hierarchy_data($optparent=null,$branchparent=0,$published=null,$maxlevel=9999)\n {\n\n /*\n chu y khi lay du lieu\n Khi lay ta len nhom du lieu theo parent id de qua trinh su li phia sau duoc nhanh chong\n */\n $data=$this->_prepareData(null,$optparent,$published) ;\n //pr($data);\n $children=$this->_make_relation($data) ;\n // echo \"<br>---list Child----<br>\"; print_r($children);\n\n $list = $this->_data_recurse($branchparent, $children, array(), $maxlevel,0,'',$data);\n //echo \"<br>---list ----<br>\"; print_r($list);\n\n return $list;\n }",
"function cognitivefactory_get_subtree_list($table, $id) {\n global $DB;\n \n $res = $DB->get_records_menu($table, array('fatherid' => $id));\n $ids = array();\n if (is_array($res)) {\n foreach (array_keys($res) as $aSub) {\n $ids[] = $aSub;\n $subs = cognitivefactory_get_subtree_list($table, $aSub);\n if (!empty($subs)) $ids[] = $subs;\n }\n }\n return(implode(',', $ids));\n}",
"function getDetailAllAcIDUIDNext($admin_id1,$DbConnection)\n{\n\t$query =\"SELECT account.account_id,account.user_id FROM account,account_detail USE INDEX(ad_acamdid) WHERE account.user_type='substation' AND account.status=1 and account.account_id=account_detail.account_id AND account_detail.account_admin_id='$admin_id1'\";\n\t$result = mysql_query($query,$DbConnection);\t\n\twhile($row = mysql_fetch_object($result))\n\t{\n\t\t/*$account_id_sub = $row->account_id;\n\t\t$user_id_sub = $row->user_id;*/\n\t\t\n\t\t$data[]=array('account_id_sub'=>$row->account_id,'user_id_sub'=>$row->user_id);\t\n\t}\n\treturn $data;\t\n}",
"function get_prefix($CategoryID)\n{\n global $tpl, $template, $config, $mysql, $lang, $twig, $prefixed;\n $ParentID = $mysql->result('SELECT parent_id FROM '.prefix.'_eshop_categories WHERE id = '.$CategoryID.' ');\n \n $prefixed[$CategoryID]['f'] .= ' ';\n #$add_prefix .= ' '; \n {\n if ($ParentID == 0) \n { \n $add_prefix .= ''; \n }\n else\n {\n $prefixed[$CategoryID]['s'] .= '<img src=\"/engine/plugins/eshop/tpl/img/tree.gif\"> ';\n $add_prefix .= '<img src=\"/engine/plugins/eshop/tpl/img/tree.gif\"> ';\n \n foreach ($mysql->select(\"SELECT * FROM \".prefix.\"_eshop_categories WHERE id=\".$ParentID.\" \") as $row2)\n {\n $CategoryID2 = $row2['id']; \n $ParentID2 = $row2['parent_id'];\n }\n\n get_prefix($CategoryID2);\n }\n }\n #var_dump($prefixed[$CategoryID]);\n return $add_prefix;\n}",
"function root() \n\t{\n\t\t$sql\t=\"select * from tab_gene_user\";\n\t\t$res = $this->db->readValues($sql); \n\t\tif(count($res)> 0 )\n\t\t{\n return $res;\n\t\t}\n\t}",
"function do_offset($level){\r\n $offset = \"\"; // offset for subarry\r\n for ($i=1; $i<$level;$i++){\r\n $offset = $offset . \"<td></td>\";\r\n }\r\n return $offset;\r\n}",
"public function test_ouwiki_build_up_sub_index() {\n $index = [\n 1 => (object) ['linksto' => [2]],\n 2 => (object) ['linksto' => [1]]\n ];\n $subtree = [];\n ouwiki_build_up_sub_index(1, $index,$subtree);\n $this->assertEquals($index, $subtree);\n }",
"public function populateRegionTables() {\n\t\t$scrapeLog = $this->addLog(COUNTY_TABLE);\n\t\t\n\t\t$counties = $this->countyRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . COUNTY_PATH);\n\t\tforeach($counties as $county) {\n\t\t\t$this->countyRepository->add($county);\n\t\t\t\n\t\t\t$municipalities = $this->municipalityRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . MUNICIPALITY_PATH . $county->getCountyId(), $county->getCountyId());\n\t\t\t\n\t\t\tforeach($municipalities as $municipality) {\n\t\t\t\t$this->municipalityRepository->add($municipality);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->updateLog($scrapeLog);\n\t}",
"public function myHierarchy_get(){\n\t\t$userId = $this->token_payload[\"user_id\"];\n\t\tresponse($this,true,200,$this->getAllAccessibleProfiles($userId));\n\t}",
"protected function startTable() {}"
] | [
"0.62438357",
"0.570148",
"0.5421934",
"0.5420962",
"0.53625095",
"0.517409",
"0.51523143",
"0.5120516",
"0.510346",
"0.5090855",
"0.5054749",
"0.5049899",
"0.50401324",
"0.50165623",
"0.4974641",
"0.4960896",
"0.49574587",
"0.49430105",
"0.49391395",
"0.49017552",
"0.48735732",
"0.48642552",
"0.48486948",
"0.48475167",
"0.4842885",
"0.4830023",
"0.4812148",
"0.48118097",
"0.47862357",
"0.47740147"
] | 0.6380823 | 0 |
Update Individual Id Sku Hierarchy table Data // | public function updateTbldSkuHierarchyById ( $hierarchy_id, $data )
{
$this->db->where( 'id', $hierarchy_id );
return $this->db->update( 'tbld_sku_hierarchy', $data );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testUpdateItemSubCategory()\n {\n }",
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"function update_tbllevel($level_id,$params)\n {\n $this->db->where('level_id',$level_id);\n return $this->db->update('tbllevel',$params);\n }",
"function update($data){\n $this->deleteKritByUser($data['user_id']); //reset seluruh nilai kriteria berpasangan untuk pakar tertentu\n $this->getKriteria();\n /*foreach($this->getKriteria() as $kr){\n $this->kriteriaLabel[] = $kr->id_kriteria;\n }*/\n \n for($i=0;$i<count($data['kritEigen']);$i++){\n // update nilai eigen di table eigen_kriteria\n $this->db->set(array(\n 'value_eigen' => $data['kritEigen'][$i],\n $this->id => $this->kriteriaLabel[$i],\n 'id_user' => $data['user_id']\n )\n );\n $this->db->insert(\"eigen_kriteria\");\n \n // memasukkan nilai kriteria berpasangan ke pair_kriteria\n for($j=0;$j<count($data['kritMatriks']);$j++){\n $this->db->set(array(\n 'id_kriteria' => $this->kriteriaLabel[$i],\n 'id_kriteria_pair' => $this->kriteriaLabel[$j],\n 'id_user' => $data['user_id'], // pakai id_user\n 'value' => $data['kritMatriks'][$i][$j]\n ));\n $this->db->replace($this->pairwise);\n }\n } \n }",
"public function actionUpdate($id)\n {\n $model = $this->loadModel($id);\n $Item = Item::model()->with('orderItems')->findAll(new CDbCriteria(array('condition' => \"order_id='$id'\")));\n foreach ($Item as $key1 => $items)\n foreach ($items->orderItems as $key2 => $orderItem) {\n $ItemSku[$key1][$key2] = Sku::model()->findByAttributes(array('item_id' => $orderItem->item_id, 'props_name' => $orderItem->props_name));\n }\n if (isset($_POST['Order']) && isset($_POST['Sku'])) {\n $transaction = $model->dbConnection->beginTransaction();\n try {\n\n $model->attributes = $_POST['Order'];\n $model->update_time = time();\n if ($model->save()) {\n $flag = array();\n $OrderItem = OrderItem::model()->findAllByAttributes(array('order_id' => $id));\n foreach ($OrderItem as $key => $original) {\n $criteria=new CDbCriteria();\n $criteria->addCondition('item_id=:item_id');\n// $criteria->addCondition('price=:price');\n $criteria->addCondition('props_name=:props_name');\n $criteria->params[':item_id']=$original->item_id;\n// $criteria->params[':price']=$original->price;\n $criteria->params[':props_name']=$original->props_name;\n $sku = Sku::model()->find($criteria);\n $sku->stock+=$original->area;\n $sku->save();\n foreach ($_POST['Sku']['sku_id'] as $skuId) {\n if ($sku->sku_id == $skuId) $flag[$key] = 1;\n }\n }\n foreach ($OrderItem as $key => $original) {\n if ($flag[$key] != 1)\n {\n $original->delete();\n }\n }\n\n foreach ($_POST['Sku']['item_id'] as $key => $itemId) {\n $item = Item::model()->findByPk($itemId);\n $sku = Sku::model()->findByPk($_POST['Sku']['sku_id'][$key]);\n if ($sku->stock < $_POST['Item-number'][$key]) {\n throw new Exception('Stock is not enough');\n }\n $criteria=new CDbCriteria();\n $criteria->addCondition('item_id=:item_id');\n $criteria->addCondition('price=:price');\n $criteria->addCondition('props_name=:props_name');\n $criteria->params[':item_id']=$sku->item_id;\n $criteria->params[':price']=$sku->price;\n $criteria->params[':props_name']=$sku->props_name;\n $orderItem=OrderItem::model()->find($criteria);\n if(!isset($orderItem)){\n $orderItem=new OrderItem;\n $orderItem->item_id = $itemId;\n $orderItem->title = $item->title;\n $orderItem->desc = $item->desc;\n $orderItem->pic = $item->getMainPic();\n }\n $orderItem->props_name = $sku->props_name;\n $orderItem->price = $sku->price;\n $orderItem->area = $_POST['Item-number'][$key];\n $sku->stock -= $_POST['Item-number'][$key];\n if (!$sku->save()) {\n throw new Exception('Cut down stock fail');\n }\n $orderItem->total_price = $orderItem->price * $orderItem->area;\n $orderItem->order_id = $model->order_id;\n if (!$orderItem->save()) {\n throw new Exception('save order item fail');\n }\n }\n } else {\n throw new Exception('save order fail');\n }\n $transaction->commit();\n $this->redirect(array('view', 'id' => $model->order_id));\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n $this->render('update', array(\n 'model' => $model, 'Item' => $Item, 'ItemSku' => $ItemSku\n ));\n }",
"public function updateNode($id, $data){\n $dataline = '';\n $partupdate = false;\n\n $dataline .= '`just_created` = 0, ';\n\n for($i=0, $l=count($data); $i<$l; $i++){\n foreach($data[$i] as $key => $value){\n if($key == 'part'){\n $partupdate = true;\n $dataline .= \" `\".$key.\"` = '\".$this->checkPart($id, $value).\"',\";\n }elseif($key != 'id' && $key != 'pid'){\n $dataline .= \" `\".$key.\"` = '\".$value.\"',\";\n };\n };\n };\n\n $dataline = substr($dataline, 0, strlen($dataline)-1).' ';\n\n $query = \"\n UPDATE\n `structure_data`\n SET\n \".$dataline.\"\n WHERE\n `id` = \".$id.\"\n \";\n mysql_query($query);\n\n\n if($partupdate){\n $this->setPath($id);\n $this->setPathR($id);\n };\n }",
"public function testUpdateUnitRelationshipSource()\n {\n }",
"function update_shipto($shipto_id,$params){\n $this->company_db->update('tbl_shipto', $params,array(\"id\"=>$shipto_id)); \n }",
"public function updateMenLevelById($m_id) {\r\t\t$a_point = $this->user_model->getMemById($m_id)->aggregate_point;\r\t\t\r\t\tif ( 0 <= $a_point && $a_point <= 100)\r\t\t\t$level = 1;\r\t\telse if ( 100 < $a_point && $a_point <= 1000)\r\t\t\t$level = 2;\r\t\telse if ( 1000 < $a_point && $a_point <= 5000)\r\t\t\t$level = 3;\r\t\telse if ( 5000 < $a_point && $a_point <= 10000)\r\t\t\t$level = 4;\r\t\telse \r\t\t\t$level = 5;\r\t\t\t\r\t\t$this->db->where('m_id', $m_id);\r\t\t$this->db->update('member', array('level'=>$level));\r\t}",
"function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_group \n\t \t\t\tSET\tgru_id=?, gru_name=?, gru_head_dept=? \n\t \t\t\tWHERE gru_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->gru_id_new, $this->gru_name, $this->gru_head_dept, $this->gru_id_old));\n\t\t \n\t }",
"public function update()\n {\n $idSubmenu = $this->input->post('id_submenu');\n $data = [\n 'menu_id' => $this->input->post('menu_id'),\n 'name' => $this->input->post('name'),\n 'url' => $this->input->post('url'),\n 'icon' => $this->input->post('icon'),\n 'is_active' => $this->input->post('is_active'),\n ];\n // validation\n if ($data['name'] == null || $data['url'] == null || $data['icon'] == null) {\n echo json_encode(['message' => 'Please fill some data']);\n } else {\n echo json_encode($this->db->update('user_submenu', $data, ['id_submenu' => $idSubmenu]));\n }\n }",
"public function ubah_subjudul_detail($data, $where)\n {\n \t$this->db->where($where);\n \t$this->db->update('sub_detail_pros', $data);\n }",
"public function update($id, $obj, $projectid) {\n\t\t\t$lid = $obj[\"usecaseid\"];\n\t\t\t$nid = \"\";\n\t\t\tif($id == $obj[\"parent\"])\n\t\t\t\t$obj[\"parent\"] = 'NULL';\n\t\t\tif($obj['parent'] == '')\n\t\t\t\t$obj[\"parent\"] = 'NULL';\n\t\t\tif($obj[\"parent\"] != $this->getParent($id))\n\t\t\t\tif($obj['parent'] == 'NULL')\n\t\t\t\t\t$nid = $this->getIdWithoutParent($projectid);\n\t\t\t\telse\n\t\t\t\t\t$nid = $this->getIdWithParent($obj['parent'], $projectid);\n\t\t\telse\n\t\t\t\t$nid = $lid;\n\t\t\t$this->query(\"UPDATE usecase SET usecaseid = '{$nid}', name = '{$obj['name']}', description = '{$obj['description']}', precondition = '{$obj['precondition']}', postcondition = '{$obj['postcondition']}', mainscenario = '{$obj['mainscenario']}', alternativescenario = '{$obj['alternativescenario']}', parent = {$obj['parent']} WHERE id = {$id};\");\n\t\t\t$this->resultSet();\n\t\t\t$this->query(\"DELETE FROM usecaseinclusions WHERE usecaseid = {$id};\");\n\t\t\t$this->resultSet();\n\t\t\tforeach($obj['inclusion'] as $includedusecaseid) {\n\t\t\t\t$this->query(\"INSERT INTO usecaseinclusions VALUES ({$id}, {$includedusecaseid})\");\n\t\t\t\t$this->resultSet();\n\t\t\t}\n\t\t\t$this->query(\"DELETE FROM usecaseextensions WHERE usecaseid = {$id};\");\n\t\t\t$this->resultSet();\n\t\t\tforeach($obj['extension'] as $extendedusecaseid) {\n\t\t\t\t$this->query(\"INSERT INTO usecaseextensions VALUES ({$id}, {$extendedusecaseid})\");\n\t\t\t\t$this->resultSet();\n\t\t\t}\n\t\t\t$this->query(\"DELETE FROM usecasegeneralizations WHERE usecaseid = {$id};\");\n\t\t\t$this->resultSet();\n\t\t\tforeach($obj['generalization'] as $usecasegeneralizationsid) {\n\t\t\t\t$this->query(\"INSERT INTO usecasegeneralizations VALUES ({$id}, {$usecasegeneralizationsid})\");\n\t\t\t\t$this->resultSet();\n\t\t\t}\n\t\t\t$this->query(\"DELETE FROM usecaseactors WHERE usecaseid = {$id};\");\n\t\t\t$this->resultSet();\n\t\t\tforeach($obj['actor'] as $actorid) {\n\t\t\t\t$this->query(\"INSERT INTO usecaseactors VALUES ({$id}, {$actorid})\");\n\t\t\t\t$this->resultSet();\n\t\t\t}\n\t\t\t$this->fix($id, $lid, $nid);\n\t\t}",
"public function update_siswa($data) {\n $penggunaID = $this->session->userdata['id'];\n $this->db->where('penggunaID', $penggunaID);\n $this->db->update('tb_siswa', $data);\n \n }",
"function update_student_id1($id,$data){\n\t$this->db->where('student_id', $id);\n\t$this->db->update('students', $data);\n\t}",
"public function update($id, $nama_produk,$kategori_produk,$jumlah_produk,$harga_produk,$deskripsi,$sub_total)\n {//UPDATE `biodata` SET `nama`=[value-2],`jenis_kelamin`=[value-3],`tgl_lahir`=[value-4],`umur`=[value-5],`agama`=[value-6],`alamat`=[value-7] WHERE `id`=[value-1]\n mysqli_query($this->koneksi,\"update ulangan set nama_produk='$nama_produk',kategori_produk='$kategori_produk', jumlah_produk='$jumlah_produk' ,harga_produk='$harga_produk', deskripsi='$deskripsi',sub_total='$sub_total' where id='$id'\");\n }",
"function set_userGroup($data, $oldId){\n $data_user = array();\n $data_group = array();\n $data_user['id'] = $data['id'];\n $data_user['username'] = $data['username'];\n $data_user['password'] = $data['password'];\n $data_user['email'] = $data['email'];\n\n $group = $data['group'];\n $data['group'] = selectRecord(TAB_GROUPS, \"role = '$group'\")['id'];\n $data_group['userId'] = $data['id'];\n $data_group['groupId'] = $data['group'];\n\n updateRecord(TAB_USR_ROLE, $data_group, \"userId = $oldId\");\n updateRecord(TAB_USERS, $data_user, \"id = $oldId\");\n $data_info = array();\n if($data['group'] == 1){\n $data_info = array();\n $data_info['employment'] = \"-\";\n $data_info['img_address'] = \"upload/user/user-default.png\";\n $data_info['user'] = $data['id'];\n insertRecord(TAB_PERSONALINFO, $data_info);\n }\n}",
"function updateData($data,$id)\n\t{\n\t\tdbIdReport('update','update Benefit',json_encode($data), 100);\n\t\t$this->db->where('ben_id', $id);\n\t\t$this->db->update($this->table, $data);\n\t\t$str = $this->db->last_query();\t\n\t\tlogConfig(\"update Benefit:$str\",'logDB');\n\t\t\n\t}",
"public function m_update_supervisor_field($id){\n \n $sup->Companyname = $_POST['Companyname'];\n $sup->Position = $_POST['Position'];\n $sup->Departmentname = $_POST['Departmentname'];\n $sup->Emailpersonal = $_POST['Emailpersonal'];\n $sup->PhoneNumber = $_POST['PhoneNumber'];\n //update value to supervisor table with last id of users table \n $this->db->where('supervisor.UsersId', $id);\n if ($this->db->update('supervisor', $sup)) {\n return true;\n } else {\n return false;\n }\n }",
"public function update($id)\n {\n $input = Input::all();\n if( !empty($input['level']) ){\n // Neu co nhap trinh do cua cac mon hoc\n $levelIds = $input['level'];\n $levelOlds = Common::getLevelOfUser($id);\n $levelAdds = array_diff($levelIds, $levelOlds); // Lay cac Id moi de them vao\n $levelDels = array_diff($levelOlds, $levelIds); // Lay cac Id se xoa\n foreach ($levelDels as $key => $levelId) {\n UserCenterLevel::where('user_id', $id)->where('level_id', $levelId)->delete();\n }\n foreach ($levelAdds as $key => $levelId) {\n // Them moi level\n $userCenterLevel = CenterLevel::where('level_id', $levelId)\n ->where('center_id', $input['center_id'])\n ->first();\n if ($userCenterLevel != null) {\n $userCenterLevelId = $userCenterLevel->id;\n UserCenterLevel::create([\n 'user_id' => $id,\n 'center_level_id' => $userCenterLevelId,\n 'level_id' => $levelId\n ]);\n }\n }\n\n } else{\n // Neu khong nhap gi thi xoa het trong bang center_user_level\n $userCenterLevel = UserCenterLevel::where('user_id', $id)->delete();\n // if( $userCenterLevel ){\n // $userCenterLevel->delete();\n // }\n }\n CommonNormal::update($id, $input);\n return Redirect::action('ManagerUserController@index')->withMessage('Lưu thông tin thành viên thành công!');\n }",
"public function updateUserSubModulo($data,$id_modulo,$userUID,$ID_PERFIL){\n\t\t$sql =\"DELETE FROM user_menu_modulos where `id_modulo` = '\".$id_modulo.\"' and `id_user` ='\".$userUID.\"'\";\n\t\t$query = $this->db->query($sql);\n\n\t\tif(count($data)>0){\n\t\t\tif($query){\n\t\t\t\t//Carafar los modulo nuevos\n\t\t\t\t$i =0;\n\t\t\t\tforeach ($data as $key => $value) {\n\n\t\t\t\t\t$new[\"id_sud_modulo\"] = $key;\n\t\t\t\t\t$new[\"id_user\"] = $userUID;\n\t\t\t\t\t$new[\"id_modulo\"] = $id_modulo;\n\t\t\t\t\t$new[\"fecha\"] = date(\"Y-m-d H:i:s\");\n\t\t\t\t\t$new[\"estado\"] = 1;\n\t\t\t\t\t$new[\"id_perfil\"] = $ID_PERFIL;\n\t\t\t\t\t\n\t\t\t\t\t$this->db->insert('user_menu_modulos',$new); \n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function update() {\n\t\t$sql = \"UPDATE umgroup \n\t\t\t\tSET\tGpNameT=?, GpNameE=?, GpDesc=?, GpStID=? \n\t\t\t\tWHERE GpID=?\";\t\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpNameT, $this->GpNameE, $this->GpDesc, $this->GpStID, $this->GpID));\n\n\t}",
"function updateProduct() \n{\n global $products;\n echo \"<table border='1' cellspacing = '0px' cellpadding \n = '10px'><thead><tr>\n <th>Category</th>th>Subcategory</th>\n <th>ID</th><th>Name</th><th>Brand</th></tr></thead><tbody>\";\n foreach ($products as $category=>$value) {\n foreach ($value as $subcategory=>$x) {\n foreach ($x as $product=>$y) {\n if ($y['id'] == 'PR002') {\n $y['name'] = \"BIG-555\";\n echo \"<tr><td>\".$category.\"</td>\";\n echo \"<td>\".$subcategory.\"</td>\";\n echo \"<td>\".$y['id'].\"</td>\";\n echo \"<td>\".$y['name'].\"</td>\";\n echo \"<td>\".$y['brand'].\"</td></tr>\";\n } else {\n echo \"<tr><td>\".$category.\"</td>\";\n echo \"<td>\".$subcategory.\"</td>\";\n echo \"<td>\".$y['id'].\"</td>\";\n echo \"<td>\".$y['name'].\"</td>\";\n echo \"<td>\".$y['brand'].\"</td></tr>\";\n }\n }\n }\n }\n echo \"</tbody></table>\";\n}",
"public function element_update($id, $data, $inherit = false) {\n if (!isset($id)) {\n $this->error = \"ERR_MISSING_PARAMS\";\n return false;\n }\n\n global $db;\n $original_data = $this->element_read($id);\n $datanew = array_merge($original_data, $data);\n $datanew[\"ID_KAT\"] = $id;\n $datanew[\"FK_INFOSEITE\"] = ($data[\"FK_INFOSEITE\"] > 0 ? (int)$data[\"FK_INFOSEITE\"] : null);\n if ($data[\"KATHEAD\"] != \"DOONE\") {\n \t$query = \"UPDATE `kat` SET FK_INFOSEITE=\".($datanew[\"FK_INFOSEITE\"] == null ? \"NULL\" : $datanew[\"FK_INFOSEITE\"]).\"\\n\".\n \t\t\t\"WHERE LFT BETWEEN \".(int)$original_data[\"LFT\"].\" AND \".(int)$original_data[\"RGT\"].\"\\n\".\n \t\t\t\"\tAND ROOT=\".(int)$original_data[\"ROOT\"];\n \tif ($data[\"KATHEAD\"] == \"DOFILL\") {\n \t\t$query .= \" AND FK_INFOSEITE IS NULL\";\n \t}\n \t$db->querynow($query);\n }\n if ($data[\"KATART_RECURSIVE\"]) {\n $query = \"UPDATE `kat` SET LU_KATART=\".(int)$datanew[\"LU_KATART\"].\"\\n\".\n \"WHERE LFT BETWEEN \".(int)$original_data[\"LFT\"].\" AND \".(int)$original_data[\"RGT\"].\"\\n\".\n \"\tAND ROOT=\".(int)$original_data[\"ROOT\"];\n $db->querynow($query);\n }\n if ($this->updateid = $db->update($this->table, $datanew)) {\n unset($this->cache_nodes[$this->updateid]);\n if (!$inherit && isset($data[\"KAT_TABLE\"]) &&\n ($original_data[\"KAT_TABLE\"] != $data[\"KAT_TABLE\"])) {\n // Tabelle wurde geändert und soll nicht auf Kind-Elemente übertragen werden, zwingen!\n $datanew = array();\n $datanew[\"KAT_TABLE\"] = $data[\"KAT_TABLE\"];\n $data = $datanew;\n $inherit = true;\n }\n if ($inherit) {\n unset($data[\"ID_KAT\"]);\n unset($data[\"PARENT\"]);\n unset($data[\"V1\"]);\n unset($data[\"V2\"]);\n unset($data[\"ICON\"]);\n unset($data[\"ICON_DEL\"]);\n unset($data[\"LU_KATART\"]);\n foreach($data as $key => $null) {\n if(strstr($key, 'FK_')) {\n unset($data[$key]);\n }\n }\n $childs = $db->fetch_table(\"SELECT ID_KAT FROM `\".$this->table.\"` WHERE ROOT=\".$this->root.\" AND PARENT=\".$id);\n for ($i = 0; $i < count($childs); $i++) {\n if (!$this->element_update($childs[$i][\"ID_KAT\"], $data, true)) {\n $this->error = \"ERR_UPDATE_FAILED\";\n return false;\n }\n }\n }\n return true;\n } else {\n $this->error = \"ERR_UPDATE_FAILED\";\n return false;\n }\n }",
"public function update($tables,$data,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->update($tables,$data);\n }",
"public function update($tables,$data,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->update($tables,$data);\n }",
"public function update($tables,$data,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->update($tables,$data);\n }",
"public function update(Request $request, $id)\n {\n \n $data = array();\n $data['subcategory_name'] = $request->subcategory_name;\n $data['category_id'] = $request->category_id;\n DB::table('subcategories')->where('id',$id)->update($data);\n }",
"public function actionChildUpdate() {\n $code = $_GET['code'];\n $provinceCode = $_GET['provinceCode'];\n $cityCode = $_GET['cityCode'];\n $ppkCode = $_GET['ppkCode'];\n $models = PackageAccount::model()->findAllByAttributes(array('package_code' => \"$code\"));\n if ($models) {\n foreach ($models as $model) {\n $model->province_code = $provinceCode;\n $model->city_code = $cityCode;\n $model->ppk_code = $ppkCode;\n $model->update();\n }\n }\n }",
"public function testUpdateSuperfund()\n {\n }"
] | [
"0.5921233",
"0.55760735",
"0.5543882",
"0.5524524",
"0.5460642",
"0.5426022",
"0.5423431",
"0.54173607",
"0.5405218",
"0.5395277",
"0.5383643",
"0.5378977",
"0.53701013",
"0.536224",
"0.5361701",
"0.5348429",
"0.53216577",
"0.5300968",
"0.52959687",
"0.5285785",
"0.5280287",
"0.52698314",
"0.524776",
"0.5246451",
"0.52261484",
"0.52261484",
"0.52261484",
"0.52202696",
"0.52193767",
"0.5203305"
] | 0.6477451 | 0 |
/ sku Hierarchy end / sku Hierarchy Element Start | public function getSkuHierarchyElements ()
{
// $sql = "select t1.id as sku_hierarchy_element_by_id,t1.element_name,t1.element_code,t1.element_description,t1.element_category_id,t1.parent_element_id,
// t2.id as parent_layer_id,t3.id,t3.layer_name as element_category,
// (Select b.element_name from tbld_sku_hierarchy_elements as b where t2.id = b.id)
// as parent_element_name from tbld_sku_hierarchy_elements
// as t1 left join tbld_sku_hierarchy_elements as t2 on t2.id = t1.parent_element_id
// left join tbld_sku_hierarchy as t3 on t2.element_category_id = t3.id ";
$sql = "SELECT t1.*,t1.id as sku_hierarchy_element_by_id,t2.layer_name as element_category,t3.element_name as parent_element_name FROM `tbld_sku_hierarchy_elements` as t1
left join `tbld_sku_hierarchy` as t2 on t1.element_category_id=t2.id
left join `tbld_sku_hierarchy_elements` as t3 on t1.parent_element_id=t3.id";
$query = $this->db->query( $sql )->result_array();
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_sitetree(&$massiv, $start, $level){\n\t\tglobal $web;\n\t\t\n\t\t$list \t= '';\n\t\t$class \t= '';\n\t\tif (!isset($massiv[$start])) return;\n\t\t\n\t\tif ($level == 1) {\n\t\t\t$class \t= 'sub';\n\t\t} elseif ($level == 2) {\n\t\t\t$class = 'subsub';\n\t\t}\n\t\t\n\t\tforeach($massiv[$start] as $key=>$value){\n\t\t\t$list .= '<a class=\"'.$class.'\" href=\"'.SmartUrlEncode(WBG::crosslink($value)).'\">'.$value['title'].'</a>';\n\t\t\t$list .= get_sitetree($massiv, $key, $level+1);\n\t }\n\t \n\t\treturn $list;\n\t}",
"public function getSkuHierarchy ()\n {\n $sql = \"select t1.id,t1.layer_name,t1.layer_code,t1.layer_description,t1.parent_layer_id,t2.id as parent_layer_id,\"\n . \" (Select b.layer_name from tbld_sku_hierarchy as b where t2.id = b.id) as parent_layer_name from tbld_sku_hierarchy as t1 left join tbld_sku_hierarchy as t2 on t2.id = t1.parent_layer_id \";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }",
"function wp_find_hierarchy_loop_tortoise_hare($callback, $start, $override = array(), $callback_args = array(), $_return_loop = \\false)\n {\n }",
"function getChildNodes() ;",
"public function test_ouwiki_build_up_sub_index() {\n $index = [\n 1 => (object) ['linksto' => [2]],\n 2 => (object) ['linksto' => [1]]\n ];\n $subtree = [];\n ouwiki_build_up_sub_index(1, $index,$subtree);\n $this->assertEquals($index, $subtree);\n }",
"public function getElementPrefix();",
"function addSubListIndex($supElem,$subElem){\r\n\t\tif($supElem->data==null) $supElem->data=new LinkedList($supElem->key);\r\n\t\t$supElem->data->insertLast($subElem);\r\n\t}",
"public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }",
"function wp_find_hierarchy_loop($callback, $start, $start_parent, $callback_args = array())\n {\n }",
"function start_lvl(&$output, $depth = 0, $args = array()) {\n\t\t $output .= \"<span class='subcategories'>\";\n\t\t}",
"public function getFirstChild();",
"public function getChildNodes() {}",
"public function getChildNodes() {}",
"function _get_item_segments()\n{\n$segments = \"musical/instrument/\";\nreturn $segments;\n\n}",
"public function getSubNodeNames();",
"function getSkus() {\n\techo \"Getting Skus </br>\";\n\t$response = getRequest('/api/sku');\n\tprintInfo($response);\n}",
"public function getStopPageTree() {}",
"function GetStructureInArray( $spr, $level_start = 0, $lang_id = NULL, $default_val = NULL, $spacer = NULL, $show_shortname = 1, $show_name = 1, $show_sublevels = 1, $front_back = 'back', $mas=NULL )\n {\n $db = DBs::getInstance();\n if( empty($lang_id) ) $lang_id = $this->lang_id;\n if( $show_sublevels==0){\n $rows = 0;\n }\n else\n {\n if($level_start!=0)\n {\n $q = \"SELECT `node` FROM `\".$spr.\"` WHERE `level`='$level_start' group by level\";\n $res = $db->db_Query( $q );\n if( !$res )return false;\n $row=$db->db_FetchAssoc();\n $curr_node = $row['node'];\n }\n else\n $curr_node = 0;\n $q = \"SELECT MAX(`node`) as max FROM `\".$spr.\"`\";\n $res = $db->db_Query( $q );\n if( !$res )return false;\n $row = $db->db_FetchAssoc();\n $max_node = $row['max'];\n $rows = $max_node - $curr_node;\n }\n $q='SELECT t0.node as node0, t0.cod as cod0 ';\n if ($show_shortname==1) $q.=', t0.short as short0';\n if ($show_name==1) $q.=', t0.name as name0';\n for($i=1; $i<=$rows;$i++)\n {\n $q.=', '.'t'.$i.'.node as node'.$i.', '.'t'.$i.'.cod as cod'.$i;\n if ($show_shortname==1) $q.=', t'.$i.'.short as short'.$i;\n if ($show_name==1) $q.=', t'.$i.'.name as name'.$i;\n }\n $q.= ' FROM '.$spr.' AS t0 ';\n for($i=1; $i<=$rows;$i++)\n {\n $q.='LEFT JOIN '.$spr.' AS t'.$i.' ON ( t'.$i.'.level = t'.($i-1).'.cod AND t'.$i.'.lang_id = t'.($i-1).'.lang_id) ';\n }\n $q.=' WHERE 1 ';\n $q = $q.\" AND t0.level = '\".$level_start.\"' AND t0.lang_id='\".$lang_id.\"' ORDER BY t0.move \";\n $res = $db->db_Query( $q );\n //echo '<br>q='.$q.' res='.$res.' $db->result='.$db->result;\n if( !$res )return false;\n $rows_count = $db->db_GetNumRows();\n //echo '<br> $rows='.$rows;\n $mas[''] = $default_val;\n for( $i = 0; $i < $rows_count; $i++ )\n {\n $row=$db->db_FetchAssoc();\n for($j=0;$j<=$rows;$j++){\n if(!isset($mas[$row['cod'.$j]]) && !is_null($row['cod'.$j]))\n {\n $output_str = $spacer;\n for($k=1;$k<=$row['node'.$j];$k++){\n $output_str.= $spacer;\n }\n if( $show_shortname ) $output_str = $output_str.' '.stripslashes($row['short'.$j]);\n if( $show_name ) $output_str = $output_str.' '.stripslashes($row['name'.$j]);\n\n $mas[$row['cod'.$j]] = $output_str;\n }\n }\n }\n return $mas;\n }",
"function get_usertyp($usrid){\r\n\t\r\n}",
"function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)\n {\n }",
"public function __construct($_sKU = NULL,$_startPrice = NULL,$_quantity = NULL,$_variationSpecifics = NULL,$_quantitySold = NULL,$_sellingStatus = NULL,$_discountPriceInfo = NULL,$_any = NULL)\r\n\t{\r\n\t\tparent::__construct(array('SKU'=>$_sKU,'StartPrice'=>$_startPrice,'Quantity'=>$_quantity,'VariationSpecifics'=>($_variationSpecifics instanceof EbayShoppingStructNameValueListArrayType)?$_variationSpecifics:new EbayShoppingStructNameValueListArrayType($_variationSpecifics),'QuantitySold'=>$_quantitySold,'SellingStatus'=>$_sellingStatus,'DiscountPriceInfo'=>$_discountPriceInfo,'any'=>$_any));\r\n\t}",
"public function getChildElements() {}",
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"function beginSubMenu() {\n\t\treturn html_ao('ul', array('class' => 'submenu'));\n\t}",
"function _get_items_segments()\n{\n$segments = \"music/instruments/\";\nreturn $segments;\n\n}",
"abstract protected function get_root_element();",
"public function getChildNodes();",
"public function nodeLow();",
"abstract protected function getGroupStructure();",
"public function getSku();"
] | [
"0.56494725",
"0.537528",
"0.49004683",
"0.4899578",
"0.48560148",
"0.48519626",
"0.48373234",
"0.48091143",
"0.4774365",
"0.47695708",
"0.4730076",
"0.47124228",
"0.47107628",
"0.47100213",
"0.46926615",
"0.46922186",
"0.4612582",
"0.46087143",
"0.46086264",
"0.45995483",
"0.4599397",
"0.45908636",
"0.4583822",
"0.45752573",
"0.45456412",
"0.45228633",
"0.4522703",
"0.4521669",
"0.45085692",
"0.4496534"
] | 0.59179157 | 0 |
/ Add Sku Unit | public function addSkuUnits ( $data )
{
return $this->db->insert( 'tbld_unit', $data );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"public function setSku($sku);",
"function fontunit($args) {\r\n\t\t$args['selections'] = array('px'=>'px','pt'=>'pt', 'em'=>'em');\r\n\t\t$args['multiple'] = false;\r\n\t\t$args['width'] = '60';\r\n\t\t$args['tooltip'] = 'Choose the units';\r\n\t\t$this->select($args);\r\n\t}",
"function add_unit_to_army($unit_id, $army_id)\n\t{\n\t\t$result = pg_prepare(\"point_query\", \"SELECT init_point_cost FROM warhammer.unit_list WHERE unit_id=$1\");\n\t\t$result = pg_execute(\"point_query\", array($unit_id));\n\t\t$result_a = pg_fetch_array($result,0,PGSQL_ASSOC);\n\t\t$points = $result_a[\"init_point_cost\"];\n\t\t$result = pg_prepare(\"add_query\", \"INSERT INTO warhammer.user_army VALUES (DEFAULT,$1,null,$2)\");\n\t\t$result = pg_execute(\"add_query\", array($unit_id,$points));\n\t\tpg_free_result($result);\n\t}",
"public function setSKU($sku) {\r\n $this->_data['SKU'] = $sku;\r\n return $this;\r\n }",
"function generateSku(){\n\t\t$characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$sku = mt_rand(10000, 99999) . mt_rand(10000, 99999) . $characters[mt_rand(0, strlen($characters) - 1)];\n\t\treturn str_shuffle($sku);\n\t}",
"public function setSkus($s)\n {\n if (is_string($s)) {\n $s = [$s];\n }\n if (is_array($s)) {\n $this->resetASINs();\n $this->resetSKUs();\n $i = 1;\n foreach ($s as $x) {\n $this->options['SellerSKUList.Id.'.$i] = $x;\n $i++;\n }\n } else {\n return false;\n }\n }",
"public function getUnit();",
"public function getSku()\n {\n return $this->sku;\n }",
"public function testGetSku()\n {\n $data_from_collection = $this->data['annual_collection'];\n $this->assertEquals(\n $data_from_collection['attributes']['plan_sku'],\n $this->makePlan($data_from_collection)->getSku()\n );\n\n $data_from_site = $this->data['annual_site'];\n $this->assertEquals($data_from_site['sku'], $this->makePlan($data_from_site)->getSku());\n }",
"public function generateProductSKU()\n {\n return $this->skuString . int_random();\n }",
"protected abstract function unit();",
"public function addToCart($username, $sku, $amount){\n $cartQuery = mysqli_fetch_array($this->connection->query(\"SELECT cart FROM users WHERE username = '$username'\"));\n $cart = $cartQuery['cart'];\n $currentInventoryQuant = mysqli_fetch_array($this->connection->query(\"SELECT quantity FROM items WHERE sku = '$sku'\"));\n\n //Add queries to update overall inventory\n $updatedInventory = $currentInventoryQuant[0] - $amount;\n $query = \"UPDATE items SET quantity = '$updatedInventory' WHERE sku = '$sku'\";\n $this->connection->query($query);\n\n //Send an updated query using the new cartQuery array\n $cart[$sku-1] = $amount;\n $query = \"UPDATE users SET cart = '$cart' WHERE username = '$username'\";\n $this->connection->query($query);\n return true;\n }",
"public function getSku();",
"public function getSku();",
"public function getProductSKU()\n {\n }",
"function SkuFromID($parametro){\n\t$db = new mysql();\n\t\n\t$result = $db->consulta(\"SELECT IDPRODUCTO,FECHA FROM \".PREFIX.\"productos WHERE IDPRODUCTO='\".$parametro.\"' LIMIT 1\");\n\t$row = $db->recuperar_array($result);\t\n\t$sku = $row['PRESKU'].$parametro;\n\treturn $sku;\n}",
"public function getSku()\n {\n return 'Tomato';\n }",
"public function getSKU()\n {\n return $this->sKU;\n }",
"public function generateSku()\n {\n $number=mt_rand(1000,9999);\n if($this->checkSku($number)){\n return $this->generateSku();\n }\n return (string)$number;\n }",
"public function AddStock($SKU, $Qty) {\n\n\t\t$inventoryTable = 'Inventory';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n $piece2 = \"WHERE ProductSKU ='\" . $this->SKU . \"'\";\n\t}",
"public function generatesku()\n {\n $newsku = 111111;\n //We need to generate a random sku number that does not already exist\n $exists = true;\n $newsku = mt_rand(100000,999999);\n do {\n $product = $this->Product->findBysku($newsku);\n if(empty($product))\n $exists = false;\n } while($exists);\n return $newsku;\n }",
"public function add(int $user_id, int $spu_id, int $sku_id, int $shop_id, int $number):bool\n {\n return $this->cart->add($user_id, $spu_id, $sku_id, $shop_id, $number);\n }",
"public function getSku() {\n return $this->_sku;\n }",
"public function getItemSku();",
"public function addItem(string $sku): bool;",
"public function setSku($sku) {\n $this->_sku = $sku;\n return $this;\n }",
"public function getSku()\n {\n if (is_null($this->sku)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_SKU);\n if (is_null($data)) {\n return null;\n }\n $this->sku = (string) $data;\n }\n\n return $this->sku;\n }",
"public function generateSKU()\n {\n $number=mt_rand(1000,999999);\n if ($this->checkSKU($number)){\n return $this->generateSKU();\n }\n return (string)$number;\n }",
"public function getNewSku($sku = null)\n {\n return $this->skuProcessor->getNewSku($sku);\n }"
] | [
"0.5584529",
"0.5435871",
"0.5255547",
"0.51158816",
"0.5105537",
"0.5058601",
"0.5003133",
"0.4996606",
"0.49886966",
"0.49545717",
"0.49364898",
"0.49245793",
"0.49234742",
"0.49061763",
"0.49061763",
"0.4882671",
"0.48621067",
"0.48466876",
"0.48177937",
"0.48103306",
"0.4804211",
"0.47937196",
"0.4791107",
"0.47812656",
"0.4775994",
"0.47691843",
"0.47643337",
"0.47471127",
"0.47383416",
"0.47176853"
] | 0.5890436 | 0 |
/ Add SKU Packaging | public function addsku_packaging ( $data )
{
return $this->db->insert( 'tbli_sku_mou_price_mapping', $data );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function AddProduct () {\n $piece1 = '(';\n \t$piece2 = '';\n\t\t\n\t\tif(isset($SKU)) {\n\t\t\t$piece1 .= 'ProductSKU,';\n\t\t\t$piece2 .= \"'\" . $this->SKU . \"'\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: SKU Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$productTable = 'Products';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $productResults = OrderData::InsertData($productTable, $productPiece);\n\t\t\n\t\tif($productResults === false)\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tif(isset($Qty)) {\n\t\t\t$piece1 .= 'TotalAMT,';\n\t\t\t$piece2 .= \"\" . $this->initialquantityStock . \"\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: Quantity Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$piece1 .= 'CommittedAMT,';\n\t\t$piece2 .= $this->committedStock . ',';\n\n \t\t$piece1 .= 'AvailableAMT';\n $piece2 .= $this->availableStock . ')';\n\t\t\n\t\t$piece1 .= ') VALUES (';\n\n $inventoryPiece = $piece1 . $piece2;\n\t\t\n\t\t$inventoryTable = 'Inventory';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $inventoryResults = OrderData::InsertData($inventoryTable, $inventoryPiece);\n\t\t\n\t\tif($inventoryResults === false)\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}",
"public function addItem(string $sku): bool;",
"function addNamedPack($name) {\n if(empty($this->_packages[$name])) {\n include_once('pack.'.$name.'.inc');\n $c='x'.$name.'pack';\n $this->_packages[$name]=new $c();\n }\n }",
"public static function add_vendor_info_in_product_summery() {\n include_once dirname( __FILE__ ) . '/templates/vendor-info.php';\n }",
"public function addproducttopoAction() {\n $id = $this->getRequest()->getParam('id');\n $sku = $this->getRequest()->getParam('sku');\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')->load($id);\n try {\n $productId = Mage::getModel('catalog/product')->getIdBySku($sku);\n if (!$productId) {\n throw new Exception($this->helper()->__('Not found sku: %s', \"<i>$sku</i>\"));\n }\n $model->addProduct($productId);\n Mage::getSingleton('vendors/session')->addSuccess(\n $this->helper()->__('Product %s has been added.', \"<i>$sku</i>\")\n );\n $this->_redirect('*/*/view', array('id' => $id));\n } catch (Exception $e) {\n Mage::getSingleton('vendors/session')->addError($this->helper()->__('There is error while adding product.'));\n Mage::getSingleton('vendors/session')->addError($e->getMessage());\n $this->_redirect('*/*/view', array('id' => $id));\n }\n }",
"function addSkin()\n\t{\n\t\t\t\n\n\t\treturn $this->uploadZipFile();\n\t\t/*$skinname=$_POST['skinname'];\n\t\t$mypath=$skinname;\n \t\tmkdir( \"themes/\".$mypath);*/\n\t}",
"function add_to_purchased_songs($song){\n echo 'Adding song to purchased songs...';\n if ($this->is_purchased($song)){\n echo $song->print_song_info() . 'is already purchased';\n return False;\n }\n array_push($this->purchased_songs, $song);\n echo '</br>' . $song->print_song_info() . 'added to purchases' . '</br>';\n return True;\n }",
"public function addItem(string $sku, int $qty): Cart;",
"public function add(Request $request)\n {\n $sku = $request->input('sku');\n\n if ($item = Product::where(['name' => $sku])->first()) {\n $this->basket->insert([\n 'id' => $item->id,\n 'name' => $item->name,\n 'price' => $item->price,\n 'weight' => $item->weight,\n 'quantity' => 1,\n ]);\n\n $total = $count = $cur_count = $cur_total = 0;\n foreach ($this->basket->contents() as $item) {\n if ($item->name == $sku) {\n $cur_count = $item->quantity;\n $cur_total = $item->price * $item->quantity;\n }\n }\n $count = $this->basket->totalItems();\n $total = number_format($this->basket->total(), 0, ' ', ' ');\n $basket = View::make('partials.head-cart', ['basket' => $this->basket]);\n\n return response()->json([\n 'total' => $total,\n 'count' => $count,\n 'basket' => $basket->render(),\n 'cur_sku' => $sku,\n 'cur_count' => $cur_count,\n 'cur_total' => $cur_total,\n ]);\n } else {\n return response()->json(['error' => 'Товар не найден']);\n }\n }",
"public function AddStock($SKU, $Qty) {\n\n\t\t$inventoryTable = 'Inventory';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n $piece2 = \"WHERE ProductSKU ='\" . $this->SKU . \"'\";\n\t}",
"public function add($data)\n {\n // create product SKU\n $this->model->creating(function ($product) use ($data) {\n\n $product->sku = $this->generateProductSKU();\n\n $product->category_id = array_get($data, 'category_id');\n $product->subcategory_id = array_get($data, 'subcategory_id');\n $product->brand_id = array_get($data, 'brand_id');\n });\n\n return parent::add($data);\n }",
"function addVakoImage($object) {\n /* you can itentify the vako with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoImageIdOnMarketplace_'.rand(1000, 9999); \n}",
"function jigoshop_upgrade_161() {\n\t\n\tJigoshop_Base::get_options()->add_option( 'jigoshop_catalog_product_button', 'cart' );\n\n}",
"public function addToCart($username, $sku, $amount){\n $cartQuery = mysqli_fetch_array($this->connection->query(\"SELECT cart FROM users WHERE username = '$username'\"));\n $cart = $cartQuery['cart'];\n $currentInventoryQuant = mysqli_fetch_array($this->connection->query(\"SELECT quantity FROM items WHERE sku = '$sku'\"));\n\n //Add queries to update overall inventory\n $updatedInventory = $currentInventoryQuant[0] - $amount;\n $query = \"UPDATE items SET quantity = '$updatedInventory' WHERE sku = '$sku'\";\n $this->connection->query($query);\n\n //Send an updated query using the new cartQuery array\n $cart[$sku-1] = $amount;\n $query = \"UPDATE users SET cart = '$cart' WHERE username = '$username'\";\n $this->connection->query($query);\n return true;\n }",
"private function addUPSSmallAttributes($installer, $eavSetup)\n {\n $attributes = $this->attrNames;\n if ($this->mageVersion < '2.2.5') {\n unset($attributes['dropship'], $attributes['dropship_location']);\n $count = 65;\n foreach ($attributes as $key => $attr) {\n $isExist = $this->eavConfig\n ->getAttribute('catalog_product', 'en_'.$attr.'')->getAttributeId();\n if ($isExist == null) {\n $this->getAttributeArray(\n $eavSetup,\n 'en_'.$attr,\n \\Magento\\Framework\\DB\\Ddl\\Table::TYPE_DECIMAL,\n ucfirst($attr),\n 'text',\n '',\n $count\n );\n }\n $count++;\n }\n }\n\n $isendropshipExist = $this->eavConfig->getAttribute('catalog_product', 'en_dropship')->getAttributeId();\n\n if ($isendropshipExist == null) {\n $this->getAttributeArray(\n $eavSetup,\n 'en_dropship',\n 'int',\n 'Enable Drop Ship',\n 'select',\n 'Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Boolean',\n 71\n );\n }\n\n $isdropshiplocationExist = $this->eavConfig\n ->getAttribute('catalog_product', 'en_dropship_location')->getAttributeId();\n if ($isdropshiplocationExist == null) {\n $this->getAttributeArray(\n $eavSetup,\n 'en_dropship_location',\n 'int',\n 'Drop Ship Location',\n 'select',\n 'Eniture\\UPSSmallPackageQuotes\\Model\\Source\\DropshipOptions',\n 72\n );\n } else {\n $dataArr = [\n 'source_model' => 'Eniture\\UPSSmallPackageQuotes\\Model\\Source\\DropshipOptions',\n ];\n $this->connection\n ->update($this->tableNames['eav_attribute'], $dataArr, \"attribute_code = 'en_dropship_location'\");\n }\n\n $isHazmatExist = $this->eavConfig->getAttribute('catalog_product', 'en_hazmat')->getAttributeId();\n\n if ($isHazmatExist == null) {\n $this->getAttributeArray(\n $eavSetup,\n 'en_hazmat',\n 'int',\n 'Hazardous Material',\n 'select',\n 'Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Boolean',\n 73\n );\n }\n\n $isInsurance = $this->eavConfig->getAttribute('catalog_product', 'en_insurance')->getAttributeId();\n\n if ($isInsurance == null) {\n $this->getAttributeArray(\n $eavSetup,\n 'en_insurance',\n 'int',\n 'Insure this item',\n 'select',\n 'Magento\\Eav\\Model\\Entity\\Attribute\\Source\\Boolean',\n 74\n );\n }\n $installer->endSetup();\n }",
"function add_product_to_order($id_order,$id_product,$sauce){\r\n $bdd = Database3Splus::getinstance();//connexion();\r\n $amount = 1;\r\n $req = \"INSERT INTO order_details VALUES (:id_order, :id_product, :amount, :sauce)\";\r\n $result = $bdd->prepare($req);\r\n $result->bindParam(':id_order', $id_order);\r\n $result->bindParam(':id_product', $id_product);\r\n $result->bindParam(':amount', $amount);\r\n $result->bindParam(':sauce', $sauce);\r\n $result->execute();\r\n $count = $result->rowCount();\r\n\t\tif($count != 0){return TRUE;}\r\n\t\telse{return FALSE;}\r\n\t}",
"private function addToCart () {\n }",
"private function addToCart () {\n }",
"public function addPaketTo($UUID=''){\t\n\t\tif ($UUID!=null) {\n\t\t\t$this->cek_PaketTo($UUID);\n\t\t} else {\n\t\t\t$data['files'] = array(\n\t\t\t\tAPPPATH . 'modules/templating/views/v-data-notfound.php',\n\t\t\t\t);\n\n\t\t\t$data['judul_halaman'] = \"Bundle Paket\";\n\t\t\t#START cek hakakses#\n\t\t\t$hakAkses=$this->session->userdata['HAKAKSES'];\n\n\t\t\tif ($hakAkses =='admin') {\n\t // jika admin\n\t\t\t\tif ($babID == null) {\n\t\t\t\t\tredirect(site_url('admin'));\n\t\t\t\t} else {\n\t\t\t\t\t$this->parser->parse('admin/v-index-admin', $data);\n\t\t\t\t}\n\t\t\t} else if($hakAkses=='guru'){\n\t\t\t\tif ($babID == null) {\n\t\t\t\t\tredirect(site_url('guru/dashboard/'));\n\t\t\t\t} else {\n\t\t\t\t\t// notification\n\t\t\t\t\t$data['datKomen']=$this->datKomen();\n\t\t\t\t\t$id_guru = $this->session->userdata['id_guru'];\n // get jumlah komen yg belum di baca\n\t\t\t\t\t$data['count_komen']=$this->mkomen->get_count_komen_guru($id_guru);\n\n\t\t\t\t\t$this->parser->parse('templating/index-b-guru', $data);\n\t\t\t\t}\n\t\t\t}else{\n\t // jika siswa redirect ke welcome\n\t\t\t\tredirect(site_url('welcome'));\n\t\t\t}\n\t #END Cek USer#\n\t\t}\n\t}",
"public function addAction() {\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t}",
"public function install() {\n\t\t$this->load->model('design/layout');\n\t\t$this->load->model('setting/setting');\n\n\t\t$settings = array();\n\n\t\t// Add a module for every possible layout, in the content_bottom position\n\t\tforeach ($this->model_design_layout->getLayouts() as $layout) {\n\t\t\t$settings['basket_capture_module'][] = array(\n\t\t\t\t'layout_id' => $layout['layout_id'],\n\t\t\t\t'position' => 'content_bottom',\n\t\t\t\t'status' => '1',\n\t\t\t\t'sort_order' => '1',\n\t\t\t);\n\t\t}\n\n\t\t// Save the settings\n\t\t$this->model_setting_setting->editSetting('basket_capture', $settings);\t\t\n\t}",
"public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\n }",
"public function addProductSku($user,$newProductSku){\n \n $prodId = $newProductSku->getProdId();\n $ownerId = $user->getUserId();\n\n $authuser = new UserDao();\n $authuser->setUserId($ownerId);\n $token = explode(\" \",$user->getToken())[1];\n $authuser->setToken($token);\n\n if($authuser->verifyUserToken() && $this->product->checkOwnerId($prodId,$ownerId)){\n\n \n $this->productSku->setProdId($prodId);\n $this->productSku->setMrpPrice($newProductSku->getMrpPrice());\n $this->productSku->setRetailPrice($newProductSku->getRetailPrice());\n $this->productSku->setStock($newProductSku->getStock());\n \n \n $response = $this->productSku->addProductSku();\n \n if($response['response'] == 1){\n unset($response['last_id']);\n }\n return $response;\n }\n else{\n $this->response->setResponse(0);\n $this->response->setMessage(\"Unauthorized user\");\n }\n\n return $this->response->getResponse();\n }",
"function add() {\n\t\tif (True) {\n\n\t\t\t// create an empty product.\n\t\t\t$o =& new ufo_product(0);\n\t\t\t$this->addedObject =& $o;\n\t\t\n\t\t\t// create an entry in the db.\n\t\t\t$o->initialize();\n\t\t\t$o->create();\n\t\t\t$o->edit();\n\n\t\t\t// add it to the product array.\n\t\t\t$this->product[] = $o;\n\t\t}\n\t}",
"public function code_pack_install()\n\t{\n\t\t$prefix = trim((string) ee()->input->get_post('prefix'));\n\n\t\tif ($prefix === '')\n\t\t{\n\t\t\tee()->functions->redirect($this->base . '&method=code_pack');\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tload lib\n\t\t// -------------------------------------\n\n\t\t$lib_name = str_replace('_', '', $this->lower_name) . 'codepack';\n\t\t$load_name = str_replace(' ', '', ucwords(str_replace('_', ' ', $this->lower_name))) . 'CodePack';\n\n\t\tee()->load->library($load_name, $lib_name);\n\t\tee()->$lib_name->autoSetLang = true;\n\n\t\t// -------------------------------------\n\t\t//\t¡Las Variables en vivo! ¡Que divertido!\n\t\t// -------------------------------------\n\n\t\t$variables = array();\n\n\t\t$variables['code_pack_name']\t= $this->lower_name . '_code_pack';\n\t\t$variables['code_pack_path']\t= $this->addon_path . 'code_pack/';\n\t\t$variables['prefix']\t\t\t= $prefix;\n\n\t\t// -------------------------------------\n\t\t//\tinstall\n\t\t// -------------------------------------\n\n\t\t$details = ee()->$lib_name->getCodePackDetails($this->addon_path . 'code_pack/');\n\n\t\t$this->cached_vars['code_pack_name'] = $details['code_pack_name'];\n\t\t$this->cached_vars['code_pack_label'] = $details['code_pack_label'];\n\n\t\t$return = ee()->$lib_name->installCodePack($variables);\n\n\t\t$this->cached_vars = array_merge($this->cached_vars, $return);\n\n\t\t//--------------------------------------\n\t\t// menus and page content\n\t\t//--------------------------------------\n\n\t\t$this->cached_vars['module_menu_highlight'] = 'module_demo_templates';\n\n\t\t$this->add_crumb(lang('demo_templates'), $this->base . '&method=code_pack');\n\t\t$this->add_crumb(lang('install_demo_templates'));\n\n\t\t//$this->cached_vars['current_page'] = $this->view('code_pack_install.html', NULL, TRUE);\n\n\t\t//---------------------------------------------\n\t\t// Load Homepage\n\t\t//---------------------------------------------\n\n\t\treturn $this->ee_cp_view('code_pack_install.html');\n\t}",
"public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"public function code_pack_install()\n\t{\n\t\t$prefix = trim((string) ee()->input->get_post('prefix'));\n\n\t\tif ($prefix === '')\n\t\t{\n\t\t\tee()->functions->redirect($this->base . '&method=code_pack');\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tload lib\n\t\t// -------------------------------------\n\n\t\t$lib_name = str_replace('_', '', $this->lower_name) . 'codepack';\n\t\t$load_name = str_replace(' ', '', ucwords(str_replace('_', ' ', $this->lower_name))) . 'CodePack';\n\n\t\tee()->load->library($load_name, $lib_name);\n\t\tee()->$lib_name->autoSetLang = true;\n\n\t\t// -------------------------------------\n\t\t//\t¡Las Variables en vivo! ¡Que divertido!\n\t\t// -------------------------------------\n\n\t\t$variables = array();\n\n\t\t$variables['code_pack_name']\t= $this->lower_name . '_code_pack';\n\t\t$variables['code_pack_path']\t= $this->addon_path . 'code_pack/';\n\t\t$variables['prefix']\t\t\t= $prefix;\n\n\t\t// -------------------------------------\n\t\t//\tinstall\n\t\t// -------------------------------------\n\n\t\t$details = ee()->$lib_name->getCodePackDetails($this->addon_path . 'code_pack/');\n\n\t\t$this->cached_vars['code_pack_name'] = $details['code_pack_name'];\n\t\t$this->cached_vars['code_pack_label'] = $details['code_pack_label'];\n\n\t\t$return = ee()->$lib_name->installCodePack($variables);\n\n\t\t$this->cached_vars = array_merge($this->cached_vars, $return);\n\n\t\t//--------------------------------------\n\t\t// menus and page content\n\t\t//--------------------------------------\n\n\t\t$this->cached_vars['module_menu_highlight'] = 'module_demo_templates';\n\n\t\t$this->add_crumb(lang('demo_templates'), $this->base . '&method=code_pack');\n\t\t$this->add_crumb(lang('install_demo_templates'));\n\n\t\t$this->cached_vars['current_page'] = $this->view('code_pack_install.html', NULL, TRUE);\n\n\t\t//---------------------------------------------\n\t\t// Load Homepage\n\t\t//---------------------------------------------\n\n\t\treturn $this->ee_cp_view('index.html');\n\t}",
"public function addNewVariant(){\n\t\t$map_id = $this->Generic_model->general_fetch_array_return_row('map_attributes_values', array('attribute_id'=>$this->input->post('newAttr'), 'value'=>$this->input->post('newValue')))->map_id;\n\t\t$skuid = str_replace(' ', '', $this->input->post('skuidNew'));\n\t\t$details = array(\n\t\t\t'pid' => $this->uri->segment(4),\n\t\t\t'skuid' => $skuid,\n\t\t\t'map_id' => $map_id,\n\t\t\t'instock' => $this->input->post('qtyNew'),\n\t\t\t'reorder_level' => $this->input->post('reorderLevelNew'),\n\t\t\t'min_qty_to_order' => $this->input->post('minQtyNew'),\n\t\t\t'oos_status' => $this->input->post('oosNew')\n\t\t);\n\t\t$response = $this->Generic_model->general_insert('stock_master', $details);\n\t\tif($response){\n\t\t\t$this->session->set_flashdata('success', 'Product Updated successfully with new variant.');\n\t\t}else{\n\t\t\t$this->session->set_flashdata('failure', 'Oops!! Something went wrong. Try again...');\n\t\t}\n\t\tredirect('admin/product/editProduct/'.$this->uri->segment(4));\n\t}",
"public function add_product_bundle($image_name, $thumb_name)\n\t{\n\t\t\n\t\t\n\t\t$data = array(\n\t\t\t\t'product_bundle_name'=>ucwords(strtolower($this->input->post('product_bundle_name'))),\n\t\t\t\t'product_bundle_status'=>$this->input->post('product_bundle_status'),\n\t\t\t\t'product_bundle_price'=>$this->input->post('product_bundle_price'),\n\t\t\t\t'product_bundle_description'=>$this->input->post('product_bundle_description'),\n\t\t\t\t'created_on'=>date('Y-m-d H:i:s'),\n\t\t\t\t'created_by'=>$this->session->userdata('vendor_id'),\n\t\t\t\t'last_modified_by'=>$this->session->userdata('vendor_id'),\n\t\t\t\t'product_bundle_thumb_name'=>$thumb_name,\n\t\t\t\t'product_bundle_image_name'=>$image_name\n\t\t\t);\n\t\t\t\n\t\tif($this->db->insert('product_bundle', $data))\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function generate()\n {\n $skuCount = (int) Option::get(\"catalog.generator\", \"sku_count\");\n if($skuCount > 0)\n parent::generate();\n }"
] | [
"0.6094949",
"0.58858764",
"0.57368255",
"0.5719166",
"0.5696529",
"0.56493306",
"0.5614807",
"0.5564492",
"0.5545554",
"0.5545529",
"0.5544812",
"0.5534833",
"0.55290216",
"0.5528978",
"0.54499674",
"0.54417497",
"0.5406038",
"0.5406038",
"0.5389496",
"0.53563946",
"0.5305496",
"0.528966",
"0.52766055",
"0.5250735",
"0.5241938",
"0.5238022",
"0.5233499",
"0.5227967",
"0.52267635",
"0.5212413"
] | 0.6438181 | 0 |
Parses the received packet for problems and warnings. | abstract protected function ParsePacket( $packet ); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}",
"function process_packet($packet)\n{\n //IP Header\n $ip_header_fmt = 'Cip_ver_len/'\n .'Ctos/'\n .'ntot_len/'\n .'nidentification/'\n .'nfrag_off/'\n .'Cttl/'\n .'Cprotocol/nheader_checksum/Nsource_add/Ndest_add/';\n\n //Unpack the IP header\n $ip_header = unpack($ip_header_fmt , $packet);\n\n if($ip_header['protocol'] == '6')\n {\n print_tcp_packet($packet);\n }\n}",
"protected function analyzeData($packetData)\n {\n // check validity of the XML\n if (Functions::isValidStanza($packetData)) {\n Logs::writeLog(Logs::DEBUG, \"Message is not fragmented.\");\n return $packetData;\n }\n\n // if XML is empty, then it's a message to keep alive the exchange\n if ($packetData == \"\") {\n Logs::writeLog(Logs::DEBUG, \"Keepalive exchange\");\n $this->write($this->remote, \" \");\n }\n\n // the message is not complete, we wait for the end of it\n if (Functions::isOnlyFooterIsMissing($packetData)) {\n Logs::writeLog(Logs::DEBUG, \"Message is fragmented because footer is missing.\");\n $this->parsedMessage = null;\n $this->isParsing = true;\n\n Logs::writeLog(Logs::DEBUG, \"Parsing message..\");\n $this->parsedMessage .= $packetData;\n\n } elseif ($this->isParsing) { // this is the next part of the previous message\n $this->parsedMessage .= $packetData;\n }\n\n if ($this->isParsing && Functions::isFooterMatch($packetData)) {\n Logs::writeLog(Logs::DEBUG, \"Message parsed succesfully.\");\n $this->isParsing = false;\n return $this->parsedMessage;\n }\n\n if (Functions::isXMLStreamError($packetData)) {\n Logs::writeLog(Logs::DEBUG, \"Stream Error: Invalid XML.\");\n Logs::writeLog(Logs::DEBUG, \"FCM Server is failed to parse the XML payload.\");\n // todo throw an error and reopen connection?\n $this->exit();\n }\n\n }",
"function _PacketRead() {\n\t\t$retarray = array();\n\n\t\t//Fetch the packet size\n\t\twhile ($size = @fread($this->_Sock,4)) {\n\t\t\t$size = unpack('V1Size',$size);\n\t\t\t//Work around valve breaking the protocol\n\t\t\tif ($size[\"Size\"] > 4096) {\n\t\t\t\t//pad with 8 nulls\n\t\t\t\t$packet = \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\".fread($this->_Sock,4096);\n\t\t\t} else {\n\t\t\t\t//Read the packet back\n\t\t\t\t$packet = fread($this->_Sock, $size[\"Size\"]);\n\t\t\t}\n\n\t\t\tarray_push($retarray,unpack(\"V1ID/V1Response/a*S1/a*S2\",$packet));\n\t\t}\n\t\treturn $retarray;\n\t}",
"protected function parseResponse() \n {\n if (($line=fgets($this->socket)) === false) {\n throw new Exception('Failed reading data from redis socket.'); \n }\n $type=$line[0];\n $line=substr($line, 1, -2);\n switch ($type) {\n case '+': // Status reply\n return true;\n case '-': // Error reply\n throw new Exception('Redis error: '.$line);\n case ':': // Integer reply\n // no cast to int as it is in the range of a signed 64 bit integer\n return $line;\n case '$': // Bulk replies\n if ($line=='-1') {\n return null; \n }\n $length=$line+2;\n $data='';\n while ($length>0) {\n if (($block=fread($this->socket, $length))===false) {\n throw new Exception(\n 'Failed reading data from redis connection socket.'\n ); \n }\n $data.=$block;\n $length-= function_exists('mb_strlen')\n ? mb_strlen($block, '8bit')\n : strlen($block);\n }\n return substr($data, 0, -2);\n case '*': // Multi-bulk replies\n $count=(int)$line;\n $data=array();\n for ($i=0;$i<$count;$i++) {\n $data[]=$this->parseResponse(); \n }\n return $data;\n default:\n throw new Exception('Unable to parse data received from redis.');\n }\n }",
"protected function parseRipDetails() {\n\t}",
"public function onRead() {\n\t\tstart:\n\t\tif ($this->type === 'udp') {\n\t\t\t$this->onUdpPacket($this->read($this->highMark));\n\t\t}\n\t\tif ($this->state === self::STATE_ROOT) {\n\t\t\tif (false === ($hdr = $this->readExact(2))) {\n\t\t\t\treturn; // not enough data\n\t\t\t}\n\t\t\t$this->pctSize = Binary::bytes2int($hdr, true);\n\t\t\t$this->setWatermark($this->pctSize);\n\t\t\t$this->state = self::STATE_PACKET;\n\t\t}\n\t\tif ($this->state === self::STATE_PACKET) {\n\t\t\tif (false === ($pct = $this->readExact($this->pctSize))) {\n\t\t\t\treturn; // not enough data\n\t\t\t}\n\t\t\t$this->state = self::STATE_ROOT;\n\t\t\t$this->setWatermark(2);\n\t\t\t$this->onUdpPacket($pct);\n\t\t}\n\t\tgoto start;\n\t}",
"public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}",
"function decode_packets($data)\n\t{\n\t\treturn $this->call('--list-packets', 'post', $data);\n\t}",
"public function parseErrors(Response $response);",
"public function parse($buffer)\n {\n $pos = 1; // The remain length is start from second byte.\n $remainLen = \\Mqtt\\Message\\Util::decodeRemainLength($buffer, $pos);\n $this->header->setRemainLen($remainLen);\n $this->header->parseVarHeader($buffer, $pos);\n $this->parseBody($buffer, $pos);\n }",
"function parse_idle_response($response) {\n // check total length\n if (count($response)<16){\n return result_response_parse_error('response length != 16');\n }\n // check STX\n if ($response[0]!=STX) {\n return result_response_parse_error('response STX error');\n }\n // check command\n if ($response[1]!=CMD_IDLE && $response[1]!=CMD_SYNCHRONIZE_TIME) {\n return result_response_parse_error('response CMD error');\n }\n // check checksum\n $data = array_slice($response,2,12);\n $checksum = calc_checksum($response[1],$data);\n if ($checksum!=$response[14]) {\n return result_response_parse_error('response CHECKSUM error');\n }\n // check ETX\n if ($response[15]!=ETX) {\n return result_response_parse_error('response ETX error');\n }\n $rdata = array(\n 'cmd' => $response[1],\n 'value' => bytes_to_string($data),\n );\n return result_success_data($rdata);\n}",
"protected function parse() {}",
"function ParseMsg() \n\t{\n\t\t$this->log->WriteLog( INFO, \"Parse Msg Start\" );\n\t\t/****************************************************************************\n\t\t* ※ 결제 형태 변수의 값에 따른 결제 구분\n\t\t*\n\t\t* * AuthTy = \"card\"\t\t신용카드결제\n\t\t*\t - SubTy = \"isp\"\t\t안전결제ISP\n\t\t*\t - SubTy = \"visa3d\"\t\t안심클릭\n\t\t*\t - SubTy = \"normal\"\t\t일반결제\n\t\t*\n\t\t* * AuthTy = \"iche\"\t\t일반-계좌이체\n\t\t* \n\t\t* * AuthTy = \"virtual\"\t일반-가상계좌(무통장입금)\n\t\t* \n\t\t* * AuthTy = \"hp\"\t\t\t핸드폰결제\n\t\t*\n\t\t* * AuthTy = \"ars\"\t\tARS결제\n\t\t*\n\t\t****************************************************************************/\n\t\t\n\t\tif( strcmp( $this->REQUEST[\"AuthTy\"], \"card\" ) == 0 )\n\t\t{\n\t\t\tif( strcmp( $this->REQUEST[\"SubTy\"], \"isp\" ) == 0 )\n\t\t\t{\n\t\t\t\t/****************************************************************************\n\t\t\t\t*\n\t\t\t\t* [1-1] 신용카드 안전결제ISP 처리\n\t\t\t\t* \n\t\t\t\t* \n\t\t\t\t* -- 승인 응답 전문 포멧\n\t\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.\n\t\t\t\t* 업체ID(20)\t\t| 전문코드(4)\t\t| 거래고유번호(6)\t\t| 승인번호(8)\t\t| \n\t\t\t\t* 거래금액(12)\t| 성공여부(1)\t \t| 실패사유(20)\t\t| 승인시각(14)\t| \n\t\t\t\t* 카드사코드(4)\t|\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t\t\t\t\t\n\t\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\n\t\t\t\t$this->RESULT[\"rBusiCd\"] = $this->RecvValArray[1];\n\t\t\t\t$this->RESULT[\"rOrdNo\"] = $this->REQUEST[\"OrdNo\"];\n\t\t\t\t$this->RESULT[\"rDealNo\"] = $this->RecvValArray[2];\n\t\t\t\t$this->RESULT[\"rApprNo\"] = $this->RecvValArray[3];\n\t\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t\t$this->RESULT[\"rAmt\"] = $this->RecvValArray[4];\n\t\t\t\t$this->RESULT[\"rInstmt\"] = $this->REQUEST[\"KVP_QUOTA\"];\n\t\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[5];\n\t\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[6];\n\t\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[7];\n\t\t\t\t$this->RESULT[\"rCardCd\"] = $this->RecvValArray[8];\t\n\t\t\t\t\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t}\n\t\t\telse if( ( strcmp( $this->REQUEST[\"SubTy\"], \"visa3d\" ) == 0 ) || ( strcmp( $this->REQUEST[\"SubTy\"], \"normal\" ) == 0 ) )\n\t\t\t{\n\t\t\t\t/****************************************************************************\n\t\t\t\t* \n\t\t\t\t* [1-2] 안심클릭 or 일반결제 처리 승인응답 전문포맷\n\t\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t\t* 업체ID(20)\t\t| 전문코드(4)\t\t | 주문번호(40)\t| 승인번호(8)\t\t| 거래금액(12) |\n\t\t\t\t* 성공여부(1)\t\t| 실패사유(20)\t | 카드사명(20) \t| 승인시각(14)\t| 카드사코드(4)\t|\n\t\t\t\t* 가맹점번호(15)\t| 매입사코드(4)\t | 매입사명(20)\t| 전표번호(6)\t\t|\n\t\t\t\t* \n\t\t\t\t****************************************************************************/\n\t\t\t\t\n\t\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\n\t\t\t\t$this->RESULT[\"rBusiCd\"] = $this->RecvValArray[1];\n\t\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[2];\n\t\t\t\t$this->RESULT[\"rApprNo\"] = $this->RecvValArray[3];\n\t\t\t\t$this->RESULT[\"rInstmt\"] = $this->REQUEST[\"Instmt\"];\n\t\t\t\t$this->RESULT[\"rAmt\"] = $this->RecvValArray[4];\n\t\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[5];\n\t\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[6];\n\t\t\t\t$this->RESULT[\"rCardNm\"] = $this->RecvValArray[7];\n\t\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[8];\n\t\t\t\t$this->RESULT[\"rCardCd\"] = $this->RecvValArray[9];\n\t\t\t\t$this->RESULT[\"rMembNo\"] = $this->RecvValArray[10];\n\t\t\t\t$this->RESULT[\"rAquiCd\"] = $this->RecvValArray[11];\n\t\t\t\t$this->RESULT[\"rAquiNm\"] = $this->RecvValArray[12];\n\t\t\t\t$this->RESULT[\"rDealNo\"] = $this->RecvValArray[13];\n\t\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\"-\".$this->REQUEST[\"SubTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t}\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHE_SOCKETYN\"], \"Y\" ) == 0)\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t* \n\t\t\t* [2-1] 계좌이체 소켓방식(인터넷뱅킹) 결제 요청 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t* 결제종류(10)\t\t| 상점아이디(20)\t| 주문번호(40)\t| 이용기관주문번호(50)\t| 결과코드(4) | 결과메시지(300) |\n\t\t\t* \n\t\t\t****************************************************************************/\n\t\t\t\t\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rMTid\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"ES_SENDNO\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[5];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[6];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"iche\" ) == 0 && strcmp( $this->REQUEST[\"ICHEARS_SOCKETYN\"], \"Y\" ) == 0)\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t* \n\t\t\t* [2-2] 계좌이체 텔레뱅킹 처리\n\t\t\t*\n\t\t\t* -- 텔레뱅킹 결제 요청 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.\n\t\t\t* 결제종류(10)\t| 상점아이디(20)\t| 주문번호(40)\t| 이용기관주문번호(50)\t| 결과코드(4) | 결과메시지(300) |* \n\t\t\t*\n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rMTid\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[5];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"Parse MSG Passed \" );\n\t\t\t\t\n\t\t\t$pos = strpos($this->RESULT[\"rResMsg\"],':');\n\t\t\tif( $pos !== false ) \n\t\t\t{\n\t\t\t\t$this->RESULT[\"ES_SENDNO\"] = substr($this->RESULT[\"rResMsg\"],$pos+1,6) ;\n\t\t\t\t$this->log->WriteLog( INFO, \"ES_SENDNO : [\".$this->RESULT[\"ES_SENDNO\"].\"] \");\n\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"virtual\" ) == 0 ) \n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t*\n\t\t\t* [3] 가상계좌(무통장입금) 처리\n\t\t\t* \n\t\t\t* -- 승인 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 암호화 구분(1) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.\n\t\t\t* 결제종류(10)\t| 업체ID(20)\t\t| 승인일자(14)\t| 가상계좌번호(20)\t| 결과코드(1)\t\t| 결과메시지(100)\t | \n\t\t\t*\n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t$this->RESULT[\"rAuthTy\"] = $this->RecvValArray[0];\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rApprTm\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rVirNo\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[5];\n\t\t\t\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->REQUEST[\"OrdNo\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t\n\t\t\t$pos = strpos($this->RESULT[\"rResMsg\"],':');\n\t\t\tif( $pos !== false ) \n\t\t\t{\n\t\t\t\t$this->RESULT[\"ES_SENDNO\"] = substr($this->RESULT[\"rResMsg\"],$pos+1,6) ;\n\t\t\t\t$this->log->WriteLog( INFO, \"ES_SENDNO : [\".$this->RESULT[\"ES_SENDNO\"].\"] \");\n\t\t\t}\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t\t\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"hp\" ) == 0 )\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t* \n\t\t\t* [4] 핸드폰 결제\n\t\t\t*\n\t\t\t* -- 승인 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t* 업체ID(20)\t| 결과코드(1)\t| 결과메시지(100)\t | 핸드폰결제일(8)\t | 핸드폰결제 TID(12)\t | 거래금액(12)\t | 주문번호(40)\t |\n\t\t\t*\n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\t\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rHP_DATE\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rHP_TID\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->REQUEST[\"OrdNo\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"RECV MSG Parsing OK \" );\n\n\t\t}\n\t\telse if( strcmp( $this->REQUEST[\"AuthTy\"], \"ars\" ) == 0 )\n\t\t{\n\t\t\t/****************************************************************************\n\t\t\t* \n\t\t\t* [5] ARS 결제\n\t\t\t*\n\t\t\t* -- 승인 응답 전문 포멧\n\t\t\t* + 데이터길이(6) + 데이터\n\t\t\t* + 데이터 포멧(데이터 구분은 \"|\"로 한다.)\n\t\t\t* 업체ID(20)\t| 결과코드(1)\t| 결과메시지(100)\t | ARS결제일(8)\t | ARS결제 TID(12)\t | 거래금액(12)\t | 주문번호(40)\t |\n\t\t\t*\n\t\t\t****************************************************************************/\n\t\t\t\n\t\t\t$this->RESULT[\"rStoreId\"] = $this->RecvValArray[0];\t\n\t\t\t$this->RESULT[\"rSuccYn\"] = $this->RecvValArray[1];\n\t\t\t$this->RESULT[\"rResMsg\"] = $this->RecvValArray[2];\n\t\t\t$this->RESULT[\"rHP_DATE\"] = $this->RecvValArray[3];\n\t\t\t$this->RESULT[\"rHP_TID\"] = $this->RecvValArray[4];\n\t\t\t$this->RESULT[\"rAmt\"] = $this->REQUEST[\"Amt\"];\n\t\t\t$this->RESULT[\"rOrdNo\"] = $this->REQUEST[\"OrdNo\"];\n\t\t\t$this->RESULT[\"rProdNm\"] = $this->REQUEST[\"ProdNm\"];\n\t\t\t$this->log->WriteLog( INFO, $this->REQUEST[\"AuthTy\"].\" \".\"RECV MSG Parsing OK \" );\n\t\t}else{\n\t\t\t$this->log->WriteLog( FATAL, \"Unknown AuthTy. AuthTy:[\".$this->REQUEST[\"AuthTy\"].\"],SubTy:[\".$this->REQUEST[\"SubTy\"].\"]\");\n\t\t\treturn false;\n\t\t}\n\t\t$this->log->WriteLog( INFO, \"Parse Msg End\" );\n\t\treturn true;\n\t\t\n\t}",
"public function _parseResponce()\n\t\t{\n\t\t\t$pattern = \"/(link_cropped_no\\\" target=\\\"_blank\\\" href=\\\")(.{0,255})(\\\" )/i\";\n\t\t\tpreg_match_all($pattern, $this->responce, $out);\n\t\t\t$this->content = (!empty($out['2'])) ? array_splice($out['2'], false, AMOUNT_OF_RESULTS) : array();\n\t\t}",
"protected function parse(): void {\n $header = $this->rfc822_parse_headers($this->raw);\n\n $this->extractAddresses($header);\n\n if (property_exists($header, 'subject')) {\n $this->set(\"subject\", $this->decode($header->subject));\n }\n if (property_exists($header, 'references')) {\n $this->set(\"references\", array_map(function ($item) {\n return str_replace(['<', '>'], '', $item);\n }, explode(\" \", $header->references)));\n }\n if (property_exists($header, 'message_id')) {\n $this->set(\"message_id\", str_replace(['<', '>'], '', $header->message_id));\n }\n if (property_exists($header, 'in_reply_to')) {\n $this->set(\"in_reply_to\", str_replace(['<', '>'], '', $header->in_reply_to));\n }\n\n $this->parseDate($header);\n foreach ($header as $key => $value) {\n $key = trim(rtrim(strtolower($key)));\n if (!isset($this->attributes[$key])) {\n $this->set($key, $value);\n }\n }\n\n $this->extractHeaderExtensions();\n $this->findPriority();\n }",
"public function parse_call() {\r\n\t\t$this->spoof_check();\r\n\t\tif (count($this->request) == $this->max_requests\r\n\t\t\r\n\t\t)\r\n\t\t\texit();\r\n\t\tif (!$this->match_server($this->request['host'])) {\r\n\t\t\techo \"Fatal Error: Your address is unknown\";\r\n\t\t\texit();\r\n\t\t}\r\n\t\telse if (!$this->match_server($this->request['server'])) {\r\n\t\t\techo \"Fatal Error: Target address unknown\";\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t$host = $this->request['host'];\r\n\t\t$this->disassemble_IP($host);\r\n\t\t$this->get_user_queue();\r\n\t\t$this->users[] = $this->request['session'];\r\n\t\t$this->patch_connection();\r\n\t}",
"protected function parse()\n {\n if ($this->isParsed) {\n return;\n }\n\n if ($this->response->isServerError()) {\n throw new ResponseException(\"nic.ru server error\");\n }\n\n $contentType = $this->response->getHeader(\"Content-Type\");\n\n if (!preg_match(\"/^.*text\\/plain.*$/ui\", $contentType)) {\n throw new ResponseException(\"Incorrect Content-Type of response: {$contentType}\");\n }\n\n if (!$this->response->isOk()) {\n throw new ResponseException(\"Incorrect response code: {$this->response->getStatusCode()}\");\n }\n\n $content = $this->getRawContent();\n $contentParts = explode(\"\\r\\n\\r\\n\", $content);\n\n if (empty($contentParts)) {\n throw new ResponseException(\"Incorrect response: {$content}\");\n }\n\n if (count($contentParts) == 0) {\n throw new ResponseException(\"Response header is empty!\");\n }\n\n $this->parseHeader(trim($contentParts[0]));\n $this->parseBody(trim($contentParts[1]));\n\n $this->isParsed = true;\n }",
"function server_parse($socket, $expected_response)\n{\n $server_response = '';\n $counter = 0;\n while (substr($server_response, 3, 1) != ' ') {\n if (!($server_response = fgets($socket, 256))) {\n $counter++;\n if ($counter % 100 == 0) {\n echo json_encode([\"message\" => \"Error fetching response from server $expected_response\"]);\n sleep(1);\n }\n }\n }\n if (!(substr($server_response, 0, 3) == $expected_response)) {\n echo json_encode([\"message\" => 'Unable to send e-mail.\"' . $server_response . '\"' . \" $expected_response\"]);\n }\n}",
"public function testParseShouldReturnErrorResponseForTooShortPacket()\n {\n $payload = \"\\x01\\x38\" . // transaction id: 0138 (2 bytes)\n \"\\x00\\x00\" . // protocol id: 0000 (2 bytes)\n \"\\x00\\x07\" . // length: 0007 (2 bytes) (7 bytes after this field)\n \"\\x11\" . // unit id: 11 (1 byte)\n \"\\x16\" . // function code: 16 (1 byte)\n \"\\x04\\x10\" . // start address: 0410 (2 bytes)\n \"\\x00\\x01\" . // AND mask: 0x01 (2 bytes)\n \"\\x00\" . // OR mask: 0x02 (1 bytes) <-- should be 2 but is 1\n '';\n $packet = MaskWriteRegisterRequest::parse($payload);\n self::assertInstanceOf(ErrorResponse::class, $packet);\n $toString = $packet->__toString();\n // transaction id is random\n $toString[0] = \"\\x00\";\n $toString[1] = \"\\x00\";\n self::assertEquals(\"\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x96\\x04\", $toString);\n }",
"public function parse(){\n try {\n $table = new HomeNet_Model_DbTable_Apikeys();\n $apikey = $table->fetchRowById($this->apikey);\n\n $table = new HomeNet_Model_DbTable_Devices();\n $device = $table->fetchRowByHouseNodeDevice($apikey->house, $this->_packet->fromNode, $this->_packet->fromDevice);\n\n if(!$device && (!$device->command == $this->_packet->command)){\n throw new Zend_Exception('Cannot find matching device');\n }\n $this->saveDatapoint();\n /*\n $table = new HomeNet_Model_DbTable_Components();\n $component = $table->fetchAllByDevice($this->fromDevice);*/\n\n } catch (Zend_Exception $e){\n return $e->message();\n }\n return 'true';\n }",
"private function parseMessage(DOMElement $node)\n {\n if ($node->getAttribute('type') == 'error') {\n foreach ($node->childNodes as $_node)\n {\n if ($_node->localName == 'error')\n {\n // todo handle error response\n Log::info(\"===error===\");\n Log::error($_node->textContent);\n }\n }\n }elseif ($node->firstChild->localName == 'gcm' && ($json = $node->firstChild->textContent) && ($data = json_decode($json)) && @$data->message_type && @$data->message_id) {\n\n switch ($data->message_type)\n {\n case 'ack':\n // message acknowledgement received\n $this->events->fire(new MessageAcknowledged($data->message_id));\n break;\n case 'nack':\n switch (strtolower($data->error))\n {\n case 'bad_registration':\n // unregistered/uninstalled app\n $this->events->fire(new InvalidDeviceRegistration($data->from));\n break;\n case 'device_unregistered':\n // unregistered/uninstalled app\n $this->events->fire(new InvalidDeviceRegistration($data->from));\n break;\n case 'device_message_rate_exceeded':\n // device rate exceeded\n $this->events->fire(new DeviceMessageRateExceeded($data->from, null, $data->message_id));\n break;\n case 'invalid_json':\n // invalid json\n $this->events->fire(new InvalidJson($data->from, $data->description));\n break;\n default:\n // unknown error\n $this->events->fire(new AbstractError($data->error, $data->from, $data->description));\n break;\n }\n break;\n case 'control':\n if ($data->control_type == 'CONNECTION_DRAINING')\n {\n // connection server connection drainage\n $this->events->fire(new ConnectionDrainage());\n }\n break;\n case 'receipt':\n // ack for receipt of message receipt before processing receipt\n $this->sendAck($data->message_id, $data->data->device_registration_id);\n\n // message receipt\n $this->events->fire(new MessageReceiptReceived((array)$data));\n break;\n default:\n break;\n }\n\n if (@$data->registration_id) {\n // registration expired for token\n $this->events->fire(new RegistrationExpired($data->from, $data->registration_id));\n }\n\n } elseif (($json = $node->firstChild->textContent) && ($mData = json_decode($json)) && ($client_token = $mData->from) && ($client_message = $mData->data)) {\n // ack for receipt before processing message\n $this->sendAck($mData->message_id, $mData->from);\n\n // message received\n $this->events->fire(new MessageReceived((array)$mData, 'xmpp'));\n }\n }",
"private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n $ctx = json_decode($matches[2], true);\n if (isset($ctx['receive'])) {\n $this->in[] = [$matches[1], $matches[2]];\n $offset++;\n continue;\n }\n\n $this->out[] = [$matches[1], $matches[2]];\n }\n\n $offset++;\n }\n }",
"protected function _parseHeader() {}",
"protected static function processNCIPResponse()\n {\n $xmlElem = new QuiteSimpleXMLElement(self::getResponse());\n $xmlElem->registerXPathNamespace(self::XML_PREFIX, self::XML_NAMESPACE);\n\n if ($xmlElem->has(self::XML_PREFIX . ':' . self::XML_RESPONSE_NODE . '/co:Problem')) {\n $problemType = $xmlElem->text(self::XML_PREFIX . ':' . self::XML_RESPONSE_NODE . '/co:Problem/co:ProblemType');\n $problemDetail = $xmlElem->text(self::XML_PREFIX . ':' . self::XML_RESPONSE_NODE . '/co:Problem/co:ProblemDetail');\n\n // Log the problem.\n APILogger::addDebug('NCIP Error Message: ' . $problemDetail);\n\n $errorResponse = new CheckoutItemErrorResponse(self::getResponse());\n\n if (array_key_exists($problemType, self::$problemResponses)) {\n $errorResponse->setStatusCode(self::$problemResponses[$problemType]);\n }\n $errorResponse->setProblem($problemDetail);\n\n self::setNcipResponse($errorResponse);\n } else {\n self::setNcipResponse(new CheckoutItemResponse(self::getResponse()));\n }\n }",
"private function parseResponse() {\n $headers = Strings::split(substr($this->response, 0, $this->info['header_size']), \"~[\\n\\r]+~\", PREG_SPLIT_NO_EMPTY);\n $this->headers = static::parseHeaders($headers);\n $this->body = substr($this->response, $this->info['header_size']);\n $this->response = NULL;\n }",
"private function parseMessage() {\n\n\t\t# Regexp to parse a formatted message\n\t\t# The message should come in format of\n\t\t# :(.*)\\!(.*)\\@(.*) PRIVMSG #channelname \\:(.*) for regular chatter\n\t\t# thus returning nickname, realname, hostmask, (command, arguments) || (botname: command (arguments)) || (chatter)\n\t\t$matched = false;\n\n # Try to match against the bots name!\n # This could mean it is a direct message in chan followed by a command request\n if(!$matched) {\n $pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:('.$this->config['username'].')\\:(?: +)?([^\\s]*) (.*)/';\n preg_match($pattern, $this->inbound, $matches);\n if(count($matches) > 1) {\n $matched = true;\n $this->lastMessage = array(\n 'nickname' => $matches[1],\n 'realname' => $matches[2],\n 'hostname' => $matches[3],\n 'command' => $matches[5],\n 'args' => rtrim($matches[6],\"\\n\\r\"),\n 'chatter' => ''\n );\n # Have to match a case whereby a command of 'botname: command' with no args is provided (for help)\n # If this case occurs we have to do some arg movement otherwise the command parser won't get a hit\n if($this->lastMessage['args'] != \"\" && $this->lastMessage['command'] == '') {\n $this->lastMessage['command'] = $this->lastMessage['args'];\n $this->lastMessage['args'] = \"\";\n }\n }\n }\n\n\t\tif(!$matched) {\n\t\t\t$pattern = '/:(.*)\\!(.*)\\@(.*) PRIVMSG '.$this->config['destinationChannel'].' \\:(.*)/';\n\t\t\tpreg_match($pattern, $this->inbound, $matches);\n\t\t\tif(count($matches) > 1) {\n\t\t\t\t$this->lastMessage = array(\n\t\t\t\t\t'nickname' => $matches[1],\n\t\t\t\t\t'realname' => $matches[2],\n\t\t\t\t\t'hostname' => $matches[3],\n\t\t\t\t\t'command' => '',\n\t\t\t\t\t'args' => '',\n\t\t\t\t\t'chatter' => rtrim($matches[4],\"\\n\\r\")\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function readMsg()\n\t{\n\t\tglobal $_THRESH, $_LOCKTHRESH;\n\t\t\n\t\tif($this->_SERIAL->_ckOpened() == false) { return \"fail\";}\n\t\t$this->_SERIAL->serialflush();\n\t\t\n\t\t$result = -5;\n\t\t$data = \"\";\n\t\t$i = 0;\n\t\t\n\t\t//This regex looks for any whitespace characters (\\n, char(10), etc.)\n\t\twhile (!preg_match(\"/[\\s,]+/\", $data))\n\t\t{\n\t\t\tif($i >=75000) {\n\t\t\t\treturn \"failed to read data. Value of loop: \".$i;\n\t\t\t}\n\t\t\n\t\t\t$i++;\n\t\t\t$data .= $this->_SERIAL->readPort();\n\t\t}\n\n\t\t$arr = str_split($data);\n\n\t\t// First byte of incoming message determines what type it is.\n\t\t$resultID = $arr[0];\n\n\t\t// after type is determined these statements extract relevant data from rest of the message.\n\t\tif ($resultID == \"s\")\n\t\t{\n\t\t\t$value = (ord($arr[3])*256)+ord($arr[4]);\n\n\t\t\tif($value > $_THRESH)\n\t\t\t\t$result = 1; // Filled\n\t\t\telse \n\t\t\t\t$result = 0; // UnFilled\n\t\t}\n\t\telseif ($resultID == \"l\")\n\t\t{\n\t\t\t$value = (ord($arr[3])*256)+ord($arr[4]);\n\n\t\t\tif($value < $_LOCKTHRESH) \n\t\t\t\t$result = 1; // UnLocked\n\t\t\telse \n\t\t\t\t$result = 0; // locked\n\t\t}\n\t\telseif ($resultID == \"a\")\n\t\t{\n\t\t\t$result = 1; // message was confirmed\n\t\t}\n\t\telseif ($resultID == \"n\")\n\t\t{\n\t\t\t$iDplusCol = Array(0 => ord($arr[1]), 1 => ord($arr[2]));\n\t\t\treturn $iDplusCol; // new column was found return the number of boxes\n\t\t}\n\t\telseif ($resultID == \"t\")\n\t\t{\n\t\t\t$result= ord($arr[3]); // returns the size of queried box\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"private function parseResponses() \r\n {\r\n $validStates = array('Response', 'Response30');\r\n $messages = $this->MessageQueue->find('all', array(\r\n 'fields' => array('messageIdentity', 'message', 'processState', 'isCopied', 'sourceDeviceAlias'),\r\n 'conditions' => array(\r\n 'mailbox' => $this->CurrentDevice->deviceAlias,\r\n 'processState' => $validStates\r\n ),\r\n 'order' => 'createDate'\r\n ));\r\n \r\n // Start a transaction\r\n $this->MessageQueue->transaction(null, true);\r\n\r\n // Process all the messages. Any messages that fail will be placed into the $errors array.\r\n $errors = array();\r\n $processed = array();\r\n foreach($messages as $message)\r\n {\r\n $message = $message['MessageQueue'];\r\n\r\n try\r\n {\r\n libxml_use_internal_errors(true);\r\n $xml = Xml::build($message['message']);\r\n $namespaces = array_flip($xml->getNamespaces(true));\r\n\r\n // Convert the XML to an array and pass the resulting message to the correct processing function.\r\n $payload = Set::reverse($xml);\r\n // Set messageQuery to the payload array for message handling.\r\n $this->messageQuery[] = $payload['LawEnforcementTransaction']['Transaction']['Response'];\r\n\r\n if ($this->{\"handle{$message['processState']}\"}($message, $payload, $namespaces))\r\n $processed[] = $message['messageIdentity'];\r\n else\r\n $errors[] = array(\r\n 'message' => $message,\r\n 'error' => 'Message id ' . $message['messageIdentity'] . ' failed to process.'\r\n );\r\n }\r\n catch(Exception $e)\r\n {\r\n $errors[] = array(\r\n 'message' => $message,\r\n 'error' => 'Exception thrown while processing Message id ' . $message['messageIdentity'] . ': '\r\n . $e->getMessage()\r\n );\r\n }\r\n }\r\n \r\n // Just send the raw LawEnforcementTransaction to the user as is with a statement indicating the error.\r\n if (!empty($errors))\r\n {\r\n $copy = $errors;\r\n foreach($copy as $index => $error) {\r\n try\r\n {\r\n $this->queueErrorResponse($error['error'], $error['message']);\r\n $processed[] = $error['message']['messageIdentity'];\r\n unset($copy[$index]);\r\n }\r\n catch(Exception $e)\r\n {\r\n $errors[$index]['error'] = \"Failed to enqueue message that failed processing. \" \r\n . \"Original Error:\\n\\n\" . $error['error'];\r\n }\r\n }\r\n }\r\n\r\n // Dequeue all processed messages.\r\n if (!empty($processed))\r\n $this->MessageQueue->deleteAll(array('messageIdentity' => $processed));\r\n \r\n // Deal with any errors that failed to get directed towards the user. All we can do is change them in the queu\r\n // to a new state (so they're not lost) and log them in the CLIPS error log.\r\n //\r\n // This should almost never happen.\r\n if (!empty($errors)) {\r\n $ids = Set::extract($errors, '{n}.message.messageIdentity');\r\n \r\n // Log each of the messages that failed\r\n foreach($errors as $id => $error) {\r\n CakeLog::write('error', \"Message (id {$error['message']['messageIdentity']}) failed to process. \" \r\n . \"{$error['error']}\\n{$error['message']['message']}\");\r\n }\r\n \r\n // UpdateAll doesn't behave like other Cake model functions. We have to quote the param ourself.\r\n $this->MessageQueue->updateAll(\r\n array('processState' => '\\'CLIPS_Error\\''),\r\n array('messageIdentity' => $ids)\r\n );\r\n }\r\n\r\n return $this->MessageQueue->transaction(true, true);\r\n }",
"private function parseStatistics(string $row): array\n {\n $ping_statistics = explode(', ', explode(':', $row)[1]);\n\n $transmitted = (int) explode(' = ', $ping_statistics[0])[1];\n\n $received = (int) explode(' = ', $ping_statistics[1])[1];\n\n $lost = (int) explode(' = ', $ping_statistics[2])[1];\n\n return [\n 'packets_transmitted' => $transmitted,\n 'packets_received' => $received,\n 'packets_lost' => $lost,\n 'packet_loss' => (int) (100 - (($received * 100) / $transmitted)),\n ];\n }"
] | [
"0.61026335",
"0.56790835",
"0.5665795",
"0.5603168",
"0.5578566",
"0.55110675",
"0.54981583",
"0.5437744",
"0.5359541",
"0.5352917",
"0.532419",
"0.5294952",
"0.5276526",
"0.52681565",
"0.5256551",
"0.51810104",
"0.51350474",
"0.5113144",
"0.5104576",
"0.50874853",
"0.5084613",
"0.5082907",
"0.50483406",
"0.5038066",
"0.50163317",
"0.49945232",
"0.49809566",
"0.49763942",
"0.4962471",
"0.49618226"
] | 0.6879847 | 0 |
fonction getIdTitulaire(num_complet_cpte) returns id_titulaire,id_cpte,num_complete_cpte t361 | function getIdtitulaire($num_complete_cpte) {
global $dbHandler,$global_id_agence;
$db = $dbHandler->openConnection();
$sql = " SELECT id_cpte,id_titulaire,num_complet_cpte from ad_cpt where num_complet_cpte = '$num_complete_cpte' ; ";
$result = $db->query($sql);
if (DB::isError($result)) {
$dbHandler->closeConnection(false);
signalErreur(__FILE__,__LINE__,__FUNCTION__); // "DB: ".$result->getMessage()
}
$dbHandler->closeConnection(true);
if ($result->numRows() == 0)
return NULL;
$tmpRow = $result->fetchrow();
return $tmpRow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }",
"public static function ConsultarTemporalCid() {\r\n $db = new Conexion();\r\n\t\t$sql = $db->query(\"select MAX(idcompra) as id from compra;\");\r\n\t\t$dato3 = $db->recorrer($sql);\r\n return $dato3[0];\r\n }",
"function getId_situacion()\n {\n if (!isset($this->iid_situacion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_situacion;\n }",
"function getId_situacion()\n {\n if (!isset($this->iid_situacion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_situacion;\n }",
"public function getMvtsCpteClientParNumero($id_cpte, $numero){\n\n global $global_remote_id_agence;\n $sql = \"SELECT \tA.id_his,A.infos,A.type_fonction,A.date,b.libel_ecriture,T .traduction AS libel_operation, b.type_operation, b.info_ecriture, C.sens, C.montant\n FROM\tad_his A INNER JOIN ad_ecriture b USING (id_ag, id_his) INNER JOIN ad_mouvement C USING (id_ag, id_ecriture)\n INNER JOIN ad_traductions T ON T .id_str = b.libel_ecriture\n INNER JOIN ad_agc ag on ag.id_ag = a.id_ag and ag.langue_systeme_dft = T.langue \";\n $sql .= \"WHERE (a.id_ag = $global_remote_id_agence) AND c.cpte_interne_cli = $id_cpte \";\n\n $sql .= \" ORDER BY b.id_ecriture DESC LIMIT $numero\";\n\n $result = $this->getDbConn()-> prepareFetchAll ($sql);\n\n if ($result === FALSE || count($result) == 0) {\n return new ErrorObj(ERR_DB_SQL, $result);\n }\n\n return $result;\n }",
"public function getUltimoId() { \n return $this->ultimoId;\n }",
"function getId_situacion(): int\n {\n if (!isset($this->iid_situacion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_situacion;\n }",
"public function ultimoID()\n {\n $sentencia = \"SELECT id, clNumReporte FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n\n return $registros;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }",
"function getDatosId_situacion()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_situacion'));\n $oDatosCampo->setEtiqueta(_(\"id_situacion\"));\n return $oDatosCampo;\n }",
"function getDatosId_situacion()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_situacion'));\n $oDatosCampo->setEtiqueta(_(\"id_situacion\"));\n return $oDatosCampo;\n }",
"public function id_tarjeta();",
"function getId_carrera(){\n\t\treturn $this->id_carrera;\n\t}",
"public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }",
"public function getIdcotizacion(){\n return $this->idcotizacion;\n }",
"public function getIdCompra()\r\n {\r\n return $this->idCompra;\r\n }",
"public function getIdOrdenCompra() {\n return $this->id_orden_compra;\n }",
"public function getIdMotCle()\n {\n return $this->idMotCle;\n }",
"function generarNumOC(){\n\t\t$this->procedimiento='adq.f_cotizacion_ime';\n\t\t$this->transaccion='ADQ_GENOCDE_IME';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cotizacion','id_cotizacion','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function getCod_entidad_tuicion()\n {\n return $this->cod_entidad_tuicion;\n }",
"public function getIdPartita() {\n \tif (isset($_REQUEST['id_partita'])) {\n \t\treturn $_REQUEST['id_partita'];\n \t} else\n \t\treturn false;\n }",
"function getLoteIdGenerado($prov_id, $arti_id, $depo_id, $cod_lote){\n\n\t\t$empr_id = empresa();\n\t\t$url = AJST.'/services/asp/ALMDataService/lote/id/prov_id/'.$prov_id.'/arti_id/'.$arti_id.'/depo_id/'.$depo_id.'/empr_id/'.$empr_id.'/cod_lote/'.$cod_lote;\n\t\t$aux = $this->rest->callAPI(\"GET\",$url);\n\t\t$aux =json_decode($aux[\"data\"]);\n\t\treturn $aux->lote->lote_id;\n\t}",
"public function getIdre()\n {\n return $this->idre;\n }",
"function getTitulos() {\n //arreglo para remplazar los titulos de las columnas \n $titulos_campos['dep_id'] = COD_DEPARTAMENTO;\n $titulos_campos['dep_nombre'] = NOMBRE_DEPARTAMENTO;\n\n $titulos_campos['der_id'] = COD_DEPARTAMENTO_REGION;\n $titulos_campos['der_nombre'] = NOMBRE_DEPARTAMENTO_REGION;\n\n $titulos_campos['mun_id'] = COD_MUNICIPIO;\n $titulos_campos['mun_nombre'] = NOMBRE_MUNICIPIO;\n $titulos_campos['mun_poblacion'] = POB_MUNICIPIO;\n\n $titulos_campos['ope_id'] = OPERADOR;\n $titulos_campos['ope_nombre'] = OPERADOR_NOMBRE;\n $titulos_campos['ope_sigla'] = OPERADOR_SIGLA;\n $titulos_campos['ope_contrato_no'] = OPERADOR_CONTRATO_NRO;\n $titulos_campos['ope_contrato_valor'] = OPERADOR_CONTRATO_VALOR;\n\n $titulos_campos['Id_Ciudad'] = TITULO_CIUDAD;\n $titulos_campos['Id_Pais'] = NOMBRE_PAIS;\n $titulos_campos['Nombre_Ciudad'] = NOMBRE_CIUDAD;\n\n $titulos_campos['Nombre_Pais'] = NOMBRE_PAIS;\n\n $titulos_campos['Id_Familia'] = TITULO_FAMILIAS;\n $titulos_campos['Descripcion_Familia'] = DESCRIPCION_FAMILIA;\n\n $titulos_campos['Id_Moneda'] = TITULO_MONEDA;\n $titulos_campos['Descripcion_Moneda'] = DESCRIPCION_MONEDA;\n\n $titulos_campos['cfi_numero'] = CUENTA_NUMERO;\n $titulos_campos['cfi_nombre'] = CUENTA_NOMBRE;\n\n $titulos_campos['cft_id'] = CUENTA_TIPO;\n $titulos_campos['cft_nombre'] = CUENTA_TIPO;\n\n $titulos_campos['mov_descripcion'] = MOVIMIENTO_DESCRIPCION;\n $titulos_campos['mov_tipo'] = MOVIMIENTO_TIPO;\n\n $titulos_campos['idCentroPoblado'] = TITULO_CENTRO_POBLADO;\n $titulos_campos['codigoDane'] = CODIGO_DANE_CENTRO_POBLADO;\n $titulos_campos['nombre'] = NOMBRE_CENTRO_POBLADO;\n $titulos_campos['mun_id'] = MUNICIPIO_CENTRO_POBLADO;\n\n $titulos_campos['enc_tipo_nombre'] = TIPO_INSTRUMENTO;\n $titulos_campos['enc_tipo_desc'] = DESCRIPCION_ACTIVIDAD;\n\n $titulos_campos['Descripcion_Tipo'] = \"Plan\";\n \n $titulos_campos['descripcionTipoHallazgo'] = DESCRIPCION_TIPO_HALLAZGO;\n $titulos_campos['descripcion'] = AREA_TIPO_HALLAZGO;\n\n return $titulos_campos;\n }",
"public function getIdContratoFinanceiroNota()\n {\n return $this->id_contrato_financeiro_nota;\n }",
"function getSolicitud_id ($id_solicitud) {\n $db = new MySQL();\n $sql = \"SELECT \n t01.id as id_solicitud,\n date_format(t01.fecha_solicitud,'%d-%m-%Y') fecha_solicitud, \n t01.id_paciente, \n t01.id_medico,\n t03.nombre as medico,\n t01.id_lugarentrega,\n t01.id_servicio,\n concat(t02.nombres,' ', t02.apellidos) paciente,\n t02.edad,\n t02.id_sexo,\n t02.id_empresa,\n t04.nombre as empresa,\n t01.sumas,\n t01.descuento,\n t01.venta_total\n FROM lab_solicitud t01\n LEFT JOIN mnt_paciente t02 ON t02.id = t01.id_paciente\n LEFT JOIN ctl_medico t03 ON t03.id = t01.id_medico\n LEFT JOIN ctl_empresa t04 ON t04.id = t01.id_empresa\n WHERE t01.id=$id_solicitud\";\n return $db->fetch_array($db->consulta($sql));\n }",
"function getDatosId_preceptor()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_preceptor'));\n $oDatosCampo->setEtiqueta(_(\"id_preceptor\"));\n return $oDatosCampo;\n }",
"public function getId_carte_bleu()\n {\n return $this->id_carte_bleu;\n }",
"function obtenirIdEtablissementsOffrantChambres ($connexion) {\r\n\r\n $req = \"SELECT DISTINCT id FROM Etablissement e \r\n INNER JOIN Offre o ON e.id = o.idEtab \r\n ORDER BY id\";\r\n $stmt = $connexion -> prepare ($req);\r\n $stmt -> execute ();\r\n return $stmt;\r\n\r\n }",
"public function getId_cuisinier() {\r\n\t\treturn $this->id_cuisinier;\r\n\t}",
"static public function get_id_partida($id_ronda){\n\n $query = \"SELECT par_ron.id_partida AS 'id_partida' FROM partida_ronda_usupreg AS par_ron WHERE par_ron.id_partida_ronda_usupreg = \".self::$conexion->safeText(utf8_encode($id_ronda)).\" LIMIT 1\";\n\n $result = self::$conexion->query_db($query);\n\n if(!empty(isset($result[0])))\n return $result[0]['id_partida'];\n else\n return false;\n }"
] | [
"0.63185626",
"0.6189492",
"0.6114586",
"0.6114586",
"0.61027193",
"0.60682213",
"0.6022981",
"0.601698",
"0.6016647",
"0.6016647",
"0.5983273",
"0.5980345",
"0.59797245",
"0.59534144",
"0.59474593",
"0.59263945",
"0.59200686",
"0.5853078",
"0.5848615",
"0.5802443",
"0.5786161",
"0.5775896",
"0.5760767",
"0.57556915",
"0.57482505",
"0.57427424",
"0.57345426",
"0.57234824",
"0.57161915",
"0.5714869"
] | 0.7821603 | 0 |
/ Cette PS bloque le compte $id_cpte | function blocageCompteInconditionnel ($id_cpte) {
global $dbHandler,$global_id_agence;
$db = $dbHandler->openConnection();
$sql = "SELECT etat_cpte FROM ad_cpt WHERE id_ag = $global_id_agence AND id_cpte = $id_cpte;";
$result=$db->query($sql);
if (DB::isError($result)){
$dbHandler->closeConnection(false);
signalErreur(__FILE__,__LINE__,__FUNCTION__);
}
$tmprow = $result->fetchrow();
$etat = $tmprow[0];
if ($etat == 2){ // Le compte est fermé
$dbHandler->closeConnection(false);
signalErreur(__FILE__,__LINE__,__FUNCTION__); // "Impossible de bloquer le compte $id_cpte qui est fermé"
}
//on change l'état du compte à bloqué
$sql = "UPDATE ad_cpt SET etat_cpte = 3 WHERE id_ag=$global_id_agence AND id_cpte = $id_cpte;";
$result=$db->query($sql);
if (DB::isError($result)){
$dbHandler->closeConnection(false);
signalErreur(__FILE__,__LINE__,__FUNCTION__);
}
$dbHandler->closeConnection(true);
return new ErrorObj(NO_ERR);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBlockForEdit($id)\n {\t\n \t$DB\t\t\t= Zend_Registry::get('front_db');\n\t\t$this->view->assign('form_action', '/skiner/block/edit/id/'.$id);\n\t\t//$sql\t= \"select * from `wbs_skin_block` where \".Application_Model_Pubcon::get(1000). \" and `id`='\".$id.\"'\";\n\t\t$sql\t= \"SELECT * FROM `wbs_skin_block` AS bc LEFT JOIN `wbs_skin_block_meta` AS bm ON `bm`.`bm_bc_id`=`bc`.`id` WHERE \"\n\t\t\t\t. Application_Model_Pubcon::get(1000). \" AND `bc`.`id`=\".addslashes($id);\n\t\t$result\t= $DB->fetchAll($sql);\n\t\tif (count($result)==1)\n\t\t{\n\t\t\t$this->view->assign('data', $this->arrayParams($result[0]) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg[]= $this->translate->_('j');\n\t\t\t$this->_helper->FlashMessenger($msg);\n\t\t\t$this->_redirect('/skiner/block/frmlist#fragment-4');\n\t\t}\n\t\t\t\n }",
"function iptsr_internal_deb($debata_id) {\n\t$rocnik = cpdb_fetch_one_value(\"select rocnik from debata left join soutez using (soutez_ID) where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\n\t$status = true;\n\tcpdb_transaction();\n\t\n\t// vycistit\n\t$status &= cpdb_exec(\"delete from clovek_debata_ibody where debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id));\n\t\n\t// --- debateri\n\t// (podle poharovych bodu)\n\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) select clovek_debata.clovek_ID, clovek_debata.debata_ID, :rocnik, 'debater', debata_tym.body * 0.1 from clovek_debata left join debata_tym on clovek_debata.debata_ID = debata_tym.debata_ID and substring(clovek_debata.role,1,1) = elt(debata_tym.pozice + 1,'n','a') where clovek_debata.debata_ID = :debata_id and find_in_set(clovek_debata.role,'a1,a2,a3,n1,n2,n3')\", array(\":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik));\n\t\t\n\t// --- rozhodci\n\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) select clovek_ID, debata_ID, :rocnik, 'rozhodci', 1 from clovek_debata where debata_ID = :debata_id and role = 'r'\", array(\":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik));\n\t\n\t// --- treneri\n\t$treneri_dostanou = array();\n\t\n\tif (cpdb_fetch_all(\"select clovek_ID, ibody from clovek_debata_ibody where debata_ID = :debata_id and role = 'debater'\", array(\":debata_id\"=>$debata_id), $debateri)) {\n\t\tforeach ($debateri as $debater) {\n\t\t\t$pocet_treneru = cpdb_fetch_all(\"\n\t\t\t\tselect\n\t\t\t\t\tdk.clovek_ID as clovek_ID\n\t\t\t\tfrom\n\t\t\t\t\tclovek d, clovek_klub dk\n\t\t\t\twhere\n\t\t\t\t\td.clovek_ID = :clovek_ID\n\t\t\t\t\tand d.klub_ID = dk.klub_ID\n\t\t\t\t\tand dk.role = 't'\n\t\t\t\t\tand dk.rocnik = :rocnik\n\t\t\t\t\", array(\":clovek_ID\"=>$debater[\"clovek_ID\"], \":rocnik\"=>$rocnik), $treneri);\n\t\t\t\n\t\t\tforeach ($treneri as $trener) {\n\t\t\t\t$treneri_dostanou[$trener[\"clovek_ID\"]] += 0.1 * $debater[\"ibody\"] / $pocet_treneru;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tforeach ($treneri_dostanou as $trener_cid => $trener_ib) {\n\t\t$status &= cpdb_exec(\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) values (:clovek_id, :debata_id, :rocnik, 'trener', :ibody)\", array(\":clovek_id\"=>$trener_cid, \":debata_id\"=>$debata_id, \":rocnik\"=>$rocnik, \":ibody\"=>$trener_ib));\n\t}\n\t\n\t// --- organizatori\n\t$dostanou = 0.15; // kolik IB je z debaty\n\t$zasluhy_primych = 1; // defaultni zasluhy u primych ogranizatoru\n\t$celkem_zasluhy = 0;\n\t$zasluhy = array();\n\t\n\t// primi\n\tcpdb_fetch_all(\n\t\t\"select clovek_ID from clovek_debata where clovek_debata.role = 'o' and debata_ID = :debata_id\", array(\":debata_id\"=>$debata_id), $res_primi);\n\t\n\tforeach ($res_primi as $org) {\n\t\t$celkem_zasluhy += $zasluhy_primych;\n\t\t$zasluhy[$org[\"clovek_ID\"]] += $zasluhy_primych;\n\t}\n\t\n\t// neprimi\n\tcpdb_fetch_all(\"\n\t\tselect\n\t\t\tclovek_turnaj.clovek_ID,\n\t\t\tclovek_turnaj.mocnost\n\t\tfrom\n\t\t\tdebata, clovek_turnaj\n\t\twhere\n\t\t\tdebata.debata_ID = :debata_id\n\t\t\tand clovek_turnaj.turnaj_ID = debata.turnaj_ID\n\t\t\tand clovek_turnaj.role = 'o'\n\t\", array(\":debata_id\"=>$debata_id), $res_neprimi);\n\t\n\tforeach($res_neprimi as $org) {\n\t\t$celkem_zasluhy += $org[\"mocnost\"];\n\t\t$zasluhy[$org[\"clovek_ID\"]] += $org[\"mocnost\"];\n\t}\n\t\n\tforeach($zasluhy as $org_cid => $org_zasluhy) {\n\t\t$status &= cpdb_exec(\n\t\t\t\"insert into clovek_debata_ibody (clovek_ID, debata_ID, rocnik, role, ibody) values (:clovek_id, :debata_id, :rocnik, 'organizator', :ibody)\",\n\t\t\tarray(\n\t\t\t\t\":clovek_id\" => $org_cid,\n\t\t\t\t\":debata_id\" => $debata_id,\n\t\t\t\t\":rocnik\" => $rocnik,\n\t\t\t\t\":ibody\" => $dostanou * $org_zasluhy / $celkem_zasluhy\n\t\t\t)\n\t\t);\n\t}\n\t\n\t// zaver\n\tif ($status) {\n\t\tcpdb_commit();\n\t} else {\n\t\tcpdb_rollback();\n\t}\n}",
"public function getbateauCordonner($id)\r\n {\r\n $idbateau = $this->_bdd->query(\"SELECT gps.`id`, gps.id_bateau, gps.latitude, gps.longitude, bateau.nom FROM gps, bateau WHERE gps.id_bateau = bateau.id AND gps.id = '$id'\");\r\n $data = $idbateau->fetch();\r\n $this->_idBateau = $data[\"id\"];\r\n $this->_nomBateau = $data[\"nom\"];\r\n $this->_latitude = $data[\"latitude\"];\r\n $this->_longitude = $data[\"longitude\"];\r\n $this->_id = $data['id'];\r\n }",
"public function bloquear($id)\n {\n $unidad = Propiedad::find($id);\n $unidad->editable = 0;\n $unidad->save();\n return redirect('unidad/'.$unidad->id_des.'/edit');\n\n\n }",
"public function action_reportePlantelCE($id) {\n $this->renderPartial('_reportePlantelCE', array('model' => $this->loadModel($id)));\n }",
"public function setIdcotizacion($idcotizacion){\n $this->idcotizacion = $idcotizacion;\n }",
"function aff_comm_post($id_post) {\n\n\t\t$req = $GLOBALS['bdd']->prepare('SELECT b.*, d.*\n\t\t\t\t\t\t\t\tFROM badin b\n\t\t\t\t\t\t\t\tINNER JOIN dactyle d\n\t\t\t\t\t\t\t\tON b.bigarade = d.dazibao\n\t\t\t\t\t\t\t\tWHERE b.balsamine = ? \n\t\t\t\t\t\t\t\tAND b.bouquetin = 2\n\t\t\t\t\t\t\t\tORDER BY b.brimade DESC');\n\t\t$req->execute(array($_POST['post_id']));\n\t\t\t\t\t\t\t\t\t\n\t\twhile ($donnees = $req->fetch())\n\t\t{\n\t\t?>\n\t\t\t<div id=\"<?php echo $donnees['baliverne'];?>\" >\n\t\t\t\t<div class=\"zone_comment\" id=\"zone_comment\">\n\t\t\t\t\t<div class=\"mini_profil_comment\">\n\t\t\t\t\t\t<img class=\"mini_profil_img\" src=\"/ressources/images/profil/<?php echo $donnees['dazibao'];?>/profil_<?php echo $donnees['dessication'];?>\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"auteur_et_date_comment\" >\n\t\t\t\t\t\t<a class=\"lien_nom_comment\" href=\"/<?php echo $donnees['diatribe'].'/'.$donnees['decapode'].'-'.$donnees['dazibao'].'/';?>\">\n\t\t\t\t\t\t\t<?php echo $donnees['decapode'];?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<div class=\"date_post\" >\n\t\t\t\t\t\t\tLe <?php echo $donnees['brimade'];?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"contenu_comment\">\n\t\t\t\t\t\t<?php echo $donnees['bryophite']; ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\t\t}\n\t\t$req->closeCursor();\n\n\t}",
"public function cloture()\n {\n // On prépare la modification pour enregistrer la fermeture de la mission\n $sql = 'UPDATE `mission`\n SET `mission_statut` = 0\n WHERE `mission_id` = :mission';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':mission', $this->_data['mission_id'], PDO::PARAM_INT);\n\n // On effectue la modification\n $query->execute();\n }",
"function Cuerpo($acceso,$desde,$hasta,$id_f)\n\t{\n\t\t\n\t\t$tipo=utf8_decode($tipo);\n\t\t$this->SetFont('Arial','B',9);\n\t\t\n\t\t$acceso1=conexion();\n\t\t\n\t\t\n\t\t//$acceso->objeto->ejecutarSql(\"SELECT *FROM parametros where id_param='2'\");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$por_iva=trim($row['valor_param']);\n\t\t}\n\t\t\n\t\t$this->SetDrawColor(0,0,0);\n\t\t$this->SetLineWidth(.2);\n\t\t$this->SetFillColor(249,249,249);\n\t\t$this->SetTextColor(0);\n\t\t\n\t$w=array(20,20,25);\t\n\t$col=5;\n\t$right=10;\n\t$alto=49;\t\n\t\t$this->SetX($right);\n\t\t\t\n\t\t$this->SetX($right);\n\t\t\t$this->SetFont('Arial','BIU',8);\n\t\t\t$this->Cell($right,6,strtoupper(_('ingresos cobrados por franquicia')),\"0\",0,\"L\");\n\t\t\t\n\t\t\t\n\t\t\t$this->SetX($right)\t;\n\t\t\t\n\t\t\t\t$this->Ln(12);\n\t\t\t\t$this->SetX($right);\n\t\t\t\t$this->SetFont('Arial','B',7);\n\t\t\t\t$this->Cell($w[0],7,\"\",\"LRB\",0,\"L\");\n\t\t\t\t$der=15;\n\t\t\t\t$this->RotatedText($der, $alto, \"FECHA\", 25);\n\t\t\t\t$der=$der+$w[1];\n\t\t\t\t$dato=lectura($acceso,\"SELECT *FROM franquicia order by nombre_franq\");\n\t\t\t\tfor($j=0;$j<count($dato);$j++){\n\t\t\t\t\t$nombre_franq=trim($dato[$j][\"nombre_franq\"]);\n\t\t\t\t\t$this->RotatedText($der, $alto, $nombre_franq, 25);\n\t\t\t\t\t$der=$der+$w[1];\n\t\t\t\t\t$this->Cell($w[1],7,\"\",\"LRB\",0,\"C\");\n\t\t\t\t}\n\t\t\t\t$der=$der+5;\n\t\t\t\t$this->RotatedText($der, $alto, \"TOTAL\", 25);\n\t\t\t\t$this->Cell($w[2],7,\"\".\" \",\"LRB\",0,\"C\");\n\t\t\n\t\t\t$this->Ln(7);\n\t\t\n\t\t\t$sum_total=array();\n\t\t\t$sum_t=0;\n\twhile(comparaFecha($desde,$hasta)<=0){\n\t\t//ECHO \"SELECT sum(monto_pago) as monto FROM pagos where fecha_pago='$desde' \";\n\t\t$acceso->objeto->ejecutarSql(\"SELECT monto_pago as monto FROM pagos where fecha_pago='$desde' and pagos.id_caja_cob<>'EA00000001' limit 1 \");\n\t\t$row=row($acceso);\n\t\t$monto=trim($row[\"monto\"])+0;\n\t\t$cant=trim($row[\"cant\"])+0;\n\t\t\n\t\t\n\t if($monto>0){\n\t\t$wi=0;\n\t\t$j=0;\n\t\t$suma=0;\n\t\t$suma_m=0;\n\t\t$this->SetX(10);\n\t\t//list($ano,$mes,$dia)=explode(\"-\",$desde);\n\t\t$fecha=$desde;\n\t\t$dia=formatofecha($desde);\n\t\t$this->SetFont('Arial','B',10);\n\t\t$this->Cell($w[$wi],$col,$dia,\"LR\",0,\"C\",$fill);\n\t\t$wi++;\n\t\t\n\t\t\t\n\t\t\t$this->SetFont('Arial','',9);\n\t\t\t$sum_t=0;\n\t\t\tfor($j=0;$j<count($dato);$j++){\n\t\t\t\t$id_franq=trim($dato[$j][\"id_franq\"]);\n\t\t\t\t\n\t\t\t\t$acceso->objeto->ejecutarSql(\"SELECT sum(monto_pago) as monto_pago FROM pagos ,caja_cobrador,caja where pagos.id_caja_cob=caja_cobrador.id_caja_cob and caja_cobrador.id_caja=caja.id_caja and fecha_pago='$fecha' and status_pago='PAGADO' and id_franq='$id_franq' and pagos.id_caja_cob<>'EA00000001' \");\n\t\t\t\t$row=row($acceso);\n\t\t\t\t$monto_pago=trim($row[\"monto_pago\"])+0;\n\t\t\t\t$sum_total[$j]+=$monto_pago;\n\t\t\t\t$sum_t+=$monto_pago;\n\t\t\t\t$this->Cell($w[$wi],$col,number_format($monto_pago+0, 2, ',', '.'),\"LR\",0,\"R\",$fill);\n\t\t\t\t\n\t\t\t}\n\t\t\t\t$sum_total[$j]+=$sum_t;\n\t\t\t\t$this->SetFont('Arial','B',9);\n\t\t\t\t$this->Cell($w[2],$col,number_format($sum_t+0, 2, ',', '.'),\"LR\",0,\"R\",$fill);\n\t\t\t\t$fill=!$fill;\n\t\t\t\n\t\t$this->Ln();\n\t\t\t\n\t\t}//if monto\t\n\t\t$desde=sumadia($desde);\n\t\t\t\n\t}\n\t\t\t$this->SetFont('Arial','B',9);\n\t\t\t$this->SetX($right)\t;\n\t\t\t$this->Cell($w[0],7,\"TOTAL\",\"1\",0,\"R\",$fill);\n\t\t\t$sum_to=0;\n\t\t\tfor($j=0;$j<count($dato);$j++){\n\t\t\t\t$id_franq=trim($dato[$j][\"id_franq\"]);\n\t\t\t\t$this->SetFont('Arial','B',9);\n\t\t\t\t//$sum_to+=$sum_total[$j];\n\t\t\t\t$this->Cell($w[1],7,number_format($sum_total[$j]+0, 2, ',', '.'),\"1\",0,\"R\",$fill);\n\t\t\t\t\n\t\t\t}\n\t\t\t$this->SetFont('Arial','B',10);\n\t\t\t$this->Cell($w[2],7,number_format($sum_total[$j]+0, 2, ',', '.'),\"1\",0,\"R\",$fill);\n\t\t\n\t}",
"public function doComplaint($id)\n {\n return $this->where([\n \"id_pengaduan\" => $id,\n \"tipe\" => $this->type\n ])->update([\n \"dikerjakan_teknisi\" => 1\n ]);\n }",
"function print_cbasis($id,$ID)\n//==========================================================================\n// Function : print_basis\n//--------------------------------------------------------------------------\n// Beschreibun : erezugt eine Tabelle mit den DAten der Char_basis\n// als Anzeige modul ohne Eingabe wie eine KOPf_Zeile\n//\n// Dateiname : char_basis (local)\n//\n//\n// Argumente : $ID = charakter_id\n//\n// Returns : --\n//==========================================================================\n{\n\tglobal $DB_HOST, $DB_USER, $DB_PASS, $DB_NAME;\n\tglobal $PHP_SELF;\n\tglobal $nsc_char;\n\n\t$TABLE = 'char_basis';\n\n\t$db = mysql_connect($DB_HOST,$DB_USER,$DB_PASS) or die(\"Fehler beim verbinden!\");\n\n\tmysql_select_db($DB_NAME);\n\n\t$q = \"select * from $TABLE where id=\\\"$id\\\"\";\n\t$result = mysql_query($q) or die(\"Query Fehler...\");\n\tmysql_close($db);\n\n\t$row = mysql_fetch_row($result);\n\t//Liste der Datensätze\n\tif ($row[9]<=' ') {\n\t\t$row[9] = 'feminist.gif';\n\t};\n\tif ($row[8]<=' ') {\n\t\t$row[8] = 'default.gif';\n\t};\n\n\tif ($row[7]=='J')\n\t{\n\t\t$isnsc='true';\n\t\t$row[9] = \"ork2.gif\";\n\t} else\n\t{\n\t\t$isnsc='false';\n\t};\n\n\t$style = $GLOBALS[\"style_header_1\"];\n\techo \" <div $style >\\n\";\n\t\n\techo \"<table border=1 width=950 BGCOLOR=\\\"\\\" bordercolor=\\\"silver\\\">\\n\";\n\techo \"<tr>\";\n\techo \"<td rowspan=2 width=90 >\";\n\techo \"\\t<IMG SRC=\\\"chars/thumb/$row[9]\\\" BORDER=\\\"0\\\" HEIGHT=\\\"100\\\" ALT=\\\"Bild des Charakters\\\" title=\\\"Bild $row[9]\\\" HSPACE=\\\"0\\\" VSPACE=\\\"0\\\" ALIGN=ABSMIDDLE>\\n\";\n\techo \"</td>\";\n\techo \"<td width=150 style=\\\"font-size:75%\\\"> \";\n\techo \"<b>Charakterame</b>\";\n\techo \"</td>\";\n\techo \"<td width=150 style=\\\"font-size:75%\\\">\";\n\techo \"<b>Beruf</b>\";\n\techo \"</td>\";\n\techo \"<td width=150 style=\\\"font-size:75%\\\">\";\n\techo \"<b>Rasse</b>\";\n\techo \"</td>\";\n\techo \"<td width=150 style=\\\"font-size:75%\\\">\";\n\techo \"<b>Gilde</b>\";\n\techo \"</td>\";\n\techo \"<td rowspan=2 width=90>\";\n\techo \"\\t<IMG SRC=\\\"chars/thumb/$row[8]\\\" BORDER=\\\"0\\\" HEIGHT=\\\"100\\\" ALT=\\\"Wappen des Charakters\\\" title=\\\"Wappen $row[8]\\\" HSPACE=\\\"0\\\" VSPACE=\\\"0\\\" ALIGN=ABSMIDDLE>\\n\";\n\techo \"</td>\";\n// \techo \"<td >\";\n// \techo \"</td>\";\n\techo \"</tr>\";\n\n\techo \"<tr>\";\n\techo \"<td style=\\\"font-size:105%\\\">\";\n\techo \"$row[2]\";\n\techo \"</td>\";\n\techo \"<td style=\\\"font-size:105%\\\" >\";\n\techo \"$row[3]\";\n\techo \"</td>\";\n\techo \"<td style=\\\"font-size:105%\\\" >\";\n\techo \"$row[4]\";\n\techo \"</td>\";\n\techo \"<td style=\\\"font-size:105%\\\" >\";\n\techo \"$row[5]<BR>\";\n\tif ($row[7]=='J')\n\t{\n\t\techo \"<B>NSC\";\n\t};\n\techo \"</td>\";\n\techo \"</tr>\";\n\techo \"</table>\";\n\techo \"</div>\\n\";\n\t\n\treturn $isnsc;\n}",
"public function etatModifierUn($id,$etat)\n\t{\n\t\tGestion::modifier($etat);// votre code ici\n\t}",
"function Cuerpo($acceso,$id_contrato)\n\t{\n\t\t//echo \"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"SELECT tarifa_ser FROM vista_tarifa where id_serv='BM00001'\");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$costo_inst=utf8_decode(trim($row['tarifa_ser']));\n\t\t}\n\t\t//echo \"update contrato set contrato_imp='SI' where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"update contrato set contrato_imp='SI' where id_contrato='$id_contrato'\");\n\t\t$acceso->objeto->ejecutarSql(\"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\");\n\t\tif($row=row($acceso)){\n\t\t\n\t\t\t$observacion=utf8_decode(trim($row['observacion']));\n\t\t\t$costo_contrato=utf8_decode(trim($row['costo_contrato']));\n\t\t\t$tipo_cliente=utf8_decode(trim($row['tipo_cliente']));\n\t\t\t$nombrecli=utf8_decode(trim($row['nombrecli']));\n\t\t\t$apellidocli=utf8_decode(trim($row['apellido']));\n\t\t\t$nombrecli=utf8_decode(trim($row['nombre']));\n\t\t\t$etiqueta=utf8_decode(trim($row['etiqueta']));\n\t\t\t$cedulacli=utf8_decode(trim($row['cedula']));\n\t\t\t\n\t\t\t$fecha=formatofecha(trim($row[\"fecha_contrato\"]));\n\t\t\t$fecha_nac=formatofecha(trim($row[\"fecha_nac\"]));\n\t\t\t\n\t\t\t\n\t\t\t$nro_contrato=trim($row['nro_contrato']);\n\t\t\t$id_contrato=trim($row['id_contrato']);\n\t\t\n\t\t\n\t\t\t$puntos=utf8_decode(trim($row['puntos']));\n\t\t\t$deuda=utf8_decode(trim($row['deuda']));\n\t\t\tif($deuda==\"\"){\n\t\t\t\t$deuda=0;\n\t\t\t}\n\t\t\t\n\t\t\t$deuda=number_format($deuda, 2, ',', '.');\n\t\t\t$nombre_zona=utf8_decode(trim($row['nombre_zona']));\n\t\t\t$nombre_sector=utf8_decode(trim($row['nombre_sector']));\n\t\t\t$nombre_calle=utf8_decode(trim($row['nombre_calle']));\n\t\t\t$numero_casa=utf8_decode(trim($row['numero_casa']));\n\t\t\t$telefono=utf8_decode(trim($row['telefono']));\n\t\t\t$telf_casa=utf8_decode(trim($row['telf_casa']));\n\t\t\t$telf_adic=utf8_decode(trim($row['telf_adic']));\n\t\t\t$email=utf8_decode(trim($row['email']));\n\t\t\t$direc_adicional=utf8_decode(trim($row['direc_adicional']));\n\t\t\t$id_persona=utf8_decode(trim($row['id_persona']));\n\t\t\t$postel=utf8_decode(trim($row['postel']));\n\t\t\t$taps=utf8_decode(trim($row['taps']));\n\t\t\t$pto=utf8_decode(trim($row['pto']));\n\t\t\t$edificio=utf8_decode(trim($row['edificio']));\n\t\t\t$numero_piso=utf8_decode(trim($row['numero_piso']));\n\t\t}\n\t\t$acceso->objeto->ejecutarSql(\"SELECT nombre,apellido FROM persona where id_persona='$id_persona' LIMIT 1 offset 0 \");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$vendedor=utf8_decode(trim($row['nombre'])).\" \".utf8_decode(trim($row['apellido']));\n\t\t\t\n\t\t}\n\n\t\tif($tipo_cliente=='JURIDICO'){\n\t\t\t$rif=$cedulacli;\n\t\t\t$cedulacli='';\n\t\t}\n\t\t\n\t\t\n\t\t$this->Ln();\t\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetXY(10,35);\t\t\n\t\t$this->Cell(195,10,\"Abonado: $nro_contrato\",\"0\",0,\"R\");\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t$this->SetXY(40,50);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PERSONA JURIDICA.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Razón Social.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Actividad.\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"RIF. $rif\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail.\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Telef.\",\"1\",0,\"J\");\n\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Representante Legal\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"C.I: \",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Cargo en la Empresa.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PERSONA NATURAL.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Apellidos y Nombres: $nombrecli $apellidocli\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Cédula: $cedulacli\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Fecha de Nac: $fecha_nac\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Profesión u Oficio: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: $telf_casa\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: $telefono\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: $telf_adic\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"E-mail: $email\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Ingreso Mensual: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Deposito en Garantia: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(130,6,\"Tipo Vivienda: Propia ___ Alquilado ___ Canon Mensual: ____\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(65,6,\"Vencimiento del Contrato: / / \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"DATOS DEL CONYUGUE.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Apellidos y Nombres: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Cédula: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Fecha de Nac: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Profesión u Oficio: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail: \",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Ingreso Mensual.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"DOMICILIO DEL SERVICIO\",\"1\",0,\"C\");\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Apellidos: $apellidocli\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Vendedor: $vendedor\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Suscriptor Nº: $nro_contrato\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Fecha: $fecha\",\"1\",0,\"J\");*/\n\t\t\t\t\n\t\n\t\t/*if($tipo_cliente=='JURIDICO'){\n\t\t\t$rif=$cedulacli;\n\t\t\t$cedulacli='';\n\t\t}*/\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"C.I. $cedulacli\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"RIF. $rif\",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Ocupación: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Grupo Familiar Nº:\",\"1\",0,\"J\");\n\t\tif($fecha_nac=='11/11/1111'){\n\t\t\t$fecha_nac='';\n\t\t}\n\t\t$this->Cell(65,6,\"Fecha de Nacimiento : $fecha_nac\",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',12);\n\t\t$this->SetX(10);\n\t\t$this->SetFillColor(76,136,206);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(195,6,\"DOMICILIO DE SERVICIO\",\"1\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);*/\n\t\t\n\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Urb o Sector: $nombre_sector\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(97,6,\"Calle n°: \",\"1\",0,\"J\");\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Avenida o Calle: $nombre_calle\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(97,6,\"Vereda : \",\"1\",0,\"J\");\t\t\n\t\t\n\t\tif($edificio!='')\n\t\t\t$apto=$numero_casa;\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Edificio: $edificio\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Piso:\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"N° de Casa o Apto: $numero_casa $apto\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(130,6,\"Referencia o Zona: $nombre_zona N°Poste:$postel\",\"1\",0,\"J\");\n\t\t//$this->Cell(65,6,\"N° de Poste: $postel\",\"0\",0,\"J\");\n\t\t$this->Cell(65,6,\"Ruta Cuenta: \",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Zona: $nombre_zona\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Manzana: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Urb.: $nombre_sector\",\"1\",0,\"J\");*/\n\t\t\n\t\t/*if($edificio!='')\n\t\t\t$apto=$numero_casa;\n\t\t\n\t\t$this->Cell(97,6,\"Apto.: $apto\",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Edificio: $edificio\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Cod. Postal: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: $telf_casa\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: $telefono\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: $telf_adic\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t//Rect( float x, float y, float w, float h [, string style])\n\t\t$this->Cell(98,6,\"Vivienda Alquilada: SI ____ NO ____\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Fecha de Vencimineto de Alquiler: \",\"1\",0,\"J\");\n\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail: $email\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Proveedor de Internet: \",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','B',12);\n\t\t$this->SetX(10);\n\t\t$this->SetFillColor(76,136,206);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(195,6,\"SERVICIOS CONTRATADOS\",\"1\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);*/\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"SERVICIOS CONTRATADOS\",\"1\",0,\"C\");\t\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"SERVICIOS \",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,6,\"CANT.\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"P. UNITARIO \",\"1\",0,\"C\");\n\t\t$this->Cell(35,6,\"P. TOTAL \",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Instalación Principal\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"1\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Tomas Adicionales\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Cable Coaxial\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Conectores\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Espliter\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\" \",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(60,5,\"TOTAL A PAGAR BS\",\"1\",0,\"R\");\n\t\t$this->Cell(35,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(50,5,\"FECHA ESTIMADA\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(25,5,\"\",\"LRT\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(25,5,\"HORA\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(30,5,\"\",\"LRT\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(30,5,\"TOTAL A\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(35,5,\"$costo_contrato\",\"LRT\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(50,5,\"DE INSTALACION\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(25,5,\"\",\"LRB\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(25,5,\"SUGERIDA\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(30,5,\"\",\"LRB\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(30,5,\"PAGAR Bs.\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(35,5,\"\",\"LRB\",0,\"C\");*/\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PROGRAMACIÓN\",\"1\",0,\"C\");\t\t\t\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Descripción.\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\"Monto\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"Firma Abonado\",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Descripción\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\"Monto\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"Firma Abonado\",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Familiar Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Extendido Bs \",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Premium I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Premium I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Adulto Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Comercial I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"Monto de Contrato: Bs. $costo_inst\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(95,6,\"Firma del Abonado:_________________________ \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"Puntos Adicionales:_________________________\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(95,6,\"Costo Punto Adicional:_______________________\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Tiempo de Instalación:\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Total a Cancelar Mensual:\",\"1\",0,\"J\");\n\t\t$this->Cell(30,6,\"Total:\",\"1\",0,\"J\");\n\t\t$this->Cell(35,6,\"Contrato:\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Observaciones.\",\"1\",0,\"J\");\n\t\t\t\t\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"$observacion\",\"1\",0,\"J\");*/\n\t\t\n\t/*\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"RECIBO DE PAGO\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"*EL PRECIO INCLUYE EL IMPUESTO DE LEY\",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(35,6,\"Efectivo\",\"1\",0,\"C\");\n\t\t$this->Cell(35,6,\"Cheque\",\"1\",0,\"C\");\n\t\t$this->Cell(65,6,\"Cargo Cta. Cte.\",\"1\",0,\"C\");\n\t\t$this->Cell(60,6,\"Tarjeta de Credito:\",\"1\",0,\"C\");\n\t\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(35,6,\"Bs. $costo_contrato\",\"1\",0,\"L\");\n\t\t$this->Cell(35,6,\"Nº.\",\"1\",0,\"L\");\n\t\t$this->Cell(65,6,\"Cta. Nº Bco.\",\"1\",0,\"L\");\n\t\t$this->Cell(60,6,\"Nombre:\",\"1\",0,\"L\");\n\t\t\n\t\n\t\t\n\t\t\n\t\t$this->Ln(15);\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Nota:\",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"En caso de que el televisor no acepte la señal de todos los canales del cable, es posible que amerite la instalación de un amplificador de sintonia, el cual deberá ser adquirido por el SUSCRIPTOR\",\"0\",\"J\");\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Atención: \",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"La Empresa. No autoriza el retiro de televisores y/o VHS por el personal de la empresa. El SUSCRIPTOR conoce y acepta las condiciones del contrato del servicio que apacen al dorso del presente\",\"0\",\"J\");\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Aviso: \",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"Se le informa a todos los suscriptores y publico en general de acuerdo a la Ley Orgánica de Telecomunicaciones, en el Artículo 189, Literal 2: será penado con prisión de uno (1) a cuatro (4) años, el que utilizando equipos o tecnologías de cualquier tipo, proporciones a un tercero el acceso o disfrute en forma fraudulenta o indebida de un serbicio o facilidad de telecomunicaciones \",\"0\",\"J\");\n\t\t\n\t\t\n\t\t\n\t\t$this->Ln(10);\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,5,\"________________________\",\"0\",0,\"C\");\n\t\t$this->Cell(65,5,\"_________________________________\",\"0\",0,\"C\");\n\t\t$this->Cell(65,5,\"__________________________\",\"0\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Firma del Vendedor\",\"0\",0,\"C\");\n\t\t$this->Cell(65,6,\"Nombre y Apellido del Suscriptor\",\"0\",0,\"C\");\n\t\t$this->Cell(65,6,\"Firma del Suscriptor\",\"0\",0,\"C\");*/\n\t\t\n\t\t/*$this->Ln(4);\n\t\t\n\t\t$this->SetDrawColor(76,136,206);\n\t\t$this->SetLineWidth(.4);\n\t\t$this->SetFont('times','I',12);\n\t\t$this->SetX(10);\n\t\t$this->MultiCell(195,5,'Av. Perimetral, Centro Comercial Residencial Central. P.B. Local Nº 07. Cúa, Edo. Miranda.\ncuatv@hotmail.com / cuatv@cantv.net',\"TB\",\"C\");*/\n\t\t\n\t\t//$this->clausulas();\n\t\t\n\t\treturn $cad;\n\t}",
"function Alterar($id) {\n if($this->GetClienteCPF($this->getCli_cpf())>0 && $this->getCli_cpf() <> $_SESSION['CLI']['cli_cpf']):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este CPF já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n \n //se o email for diferente da sessao----------------------\n if($this->GetClienteEmail($this->getCli_email())>0 && $this->getCli_email() <> $_SESSION['CLI']['cli_email']):\n echo '<div class=\"alert alert-danger\" id=\"erro_mostra\">Este Email já esta cadastrado ';\n Sistema::VoltarPagina();\n echo '</div>';\n exit();\n endif;\n \n \n \n //Caso passou na verificação os dados serão gravados no banco-------------------------\n $query = \"UPDATE \".$this->prefix.\"clientes SET cli_nome=:cli_nome,\n cli_sobrenome=:cli_sobrenome,\n cli_data_nasc=:cli_data_nasc,\n cli_rg=:cli_rg,\n cli_cpf=:cli_cpf,\n cli_ddd=:cli_ddd,\n cli_fone=:cli_fone,\n cli_celular=:cli_celular,\n cli_endereco=:cli_endereco,\n cli_numero=:cli_numero,\n cli_bairro=:cli_bairro,\n cli_cidade=:cli_cidade,\n cli_uf=:cli_uf,\n cli_cep=:cli_cep,\n cli_email=:cli_email,\n cli_data_cad=:cli_data_cad,\n cli_hora_cad=:cli_hora_cad,\n cli_pass=:cli_senha \n WHERE cli_id =:cli_id\";\n \n \n $params = array(\n ':cli_nome'=> $this->getCli_nome(),\n ':cli_sobrenome'=> $this->getCli_sobrenome(),\n ':cli_data_nasc'=> $this->getCli_data_nasc(),\n ':cli_rg'=> $this->getCli_rg(),\n ':cli_cpf'=> $this->getCli_cpf(),\n ':cli_ddd'=> $this->getCli_ddd(),\n ':cli_fone'=> $this->getCli_fone(),\n ':cli_celular'=> $this->getCli_celular(),\n ':cli_endereco'=> $this->getCli_endereco(),\n ':cli_numero'=> $this->getCli_numero(),\n ':cli_bairro'=> $this->getCli_bairro(),\n ':cli_cidade'=> $this->getCli_cidade(),\n ':cli_uf'=> $this->getCli_uf(),\n ':cli_cep'=> $this->getCli_cep(),\n ':cli_email'=> $this->getCli_email(),\n ':cli_data_cad'=> $this->getCli_data_cad(),\n ':cli_hora_cad'=> $this->getCli_hora_cad(),\n ':cli_senha'=> $this->getCli_senha(),\n ':cli_id' => (int)$id\n \n \n );\n \n //echo $query;\n \n \n if($this->ExecuteSQL($query, $params)):\n return true;\n else:\n return false;\n endif;\n \n \n }",
"public function responsablesCda($id_cda_solicitud){\n \n }",
"public function getMvtsCpteClientParNumero($id_cpte, $numero){\n\n global $global_remote_id_agence;\n $sql = \"SELECT \tA.id_his,A.infos,A.type_fonction,A.date,b.libel_ecriture,T .traduction AS libel_operation, b.type_operation, b.info_ecriture, C.sens, C.montant\n FROM\tad_his A INNER JOIN ad_ecriture b USING (id_ag, id_his) INNER JOIN ad_mouvement C USING (id_ag, id_ecriture)\n INNER JOIN ad_traductions T ON T .id_str = b.libel_ecriture\n INNER JOIN ad_agc ag on ag.id_ag = a.id_ag and ag.langue_systeme_dft = T.langue \";\n $sql .= \"WHERE (a.id_ag = $global_remote_id_agence) AND c.cpte_interne_cli = $id_cpte \";\n\n $sql .= \" ORDER BY b.id_ecriture DESC LIMIT $numero\";\n\n $result = $this->getDbConn()-> prepareFetchAll ($sql);\n\n if ($result === FALSE || count($result) == 0) {\n return new ErrorObj(ERR_DB_SQL, $result);\n }\n\n return $result;\n }",
"public function block($id)\n {\n $block = $this->selectuser($id,'block');\n if($block[0]['block'] == 1)\n {\n $this->updateuser($id,'block',0);\n }\n else\n {\n $this->updateuser($id,'block',1);\n }\n }",
"public function secteurModifierUn($id,$secteur)\n\t{\n\t\tGestion::modifier($secteur);// votre code ici\n\t}",
"public function putCabecera($id,$idfiltro){ \n /* $hijos= registros que deen pintarse en la cabcera del reporte */\n $hijosCabecera=$this->getReportedetalle()->where(['and', \"esdetalle='0'\", ['or', \"visiblelabel='1'\", \"visiblecampo='1'\"]])->all();\n\t\t//var_dump($hijosCabecera);die();\n $HTML_cabecera=\"\";\n //var_dump($hijosCabecera);die();\n foreach( $hijosCabecera as $record) {\n // var_dump($this->modelToRepor($idfiltro));die();\n\t\t $HTML_cabecera.=$record->putStyleField($record->nombre_campo,$this->modelToRepor($idfiltro)->{$record->nombre_campo}); \n }\n unset($modeloToReport);unset($hijosCabecera);unset($clase);\n return $HTML_cabecera;\n }",
"public function societeModifierUn($id,$societe)\n\t{\n\t\tGestion::modifier($societe);// votre code ici\n\t}",
"function executeAttack_ctc($status){\n\tglobal $db;\n\n//\tsetStatus($status->id, 0);\n\t\n\t//lay danh sach thap canh cua chien truong nay:\n\t$sql = \"SELECT * FROM wg_ctc_diem_tap_ket WHERE cung!=0 AND cung!=6 AND ct_id=$status->object_id\";\n\t$db->setQuery($sql);\n\t$dtks = $db->loadObjectList();\n\tif($dtks){\n\t\tforeach($dtks as $dtk){\n\t\t\tattack_ctc($dtk, $status->order_);\n\t\t}\n\t}\n\t\n\t//Kiem tra va ket thuc cong thanh chien:\n\tif(checkEnd_ctc()){\n\t\t//end_ctc();\n\t}\n}",
"public function view_com_rpt($id) {\n //permittedArea();\n $data['Dashbord'] = $this->db->get_where('commissions', ['id' => $id]);\n theme('view_com_rpt', $data);\n }",
"function gera_pdf($id){\n\t\t$briefing= $this->getBriefing($id);\n\t\t$cronograma=$this->get_cronograma($id);\n\t\t$referencias = $this->get_referencias($id);\n\t\t$id_formated = str_pad($id, 4, \"0\", STR_PAD_LEFT);\n\t\t//var_dump($briefing); exit(0);\n\t\t$info_cliente = nl2br( $briefing['info_cliente']);\n\t\t//var_dump($id_formated , $briefing['titulo']); exit(0);\n\t\t$publico = nl2br($briefing['publico']);\n\t\t$demanda = nl2br($briefing['demanda']);\n\t\t$demanda_pecas=$briefing['demanda_pecas'];\n\t\t$demanda_formato=$briefing['demanda_formato'];\n\t\t$demanda_materiais=$briefing['demanda_materiais'];\n\t\t$demanda_finalizacao=$briefing['demanda_finalizacao'];\n\t\t$demanda_local=$briefing['demanda_local'];\n\t\t$objetivo = nl2br($briefing['objetivo']);\n\t\t$recomendacoes_ideia = nl2br($briefing['recomendacoes_ideia']);\n\t\t$recomendacoes_referencias = nl2br($briefing['recomendacoes_referencias']);\n\t\t$recomendacoes_objecoes = nl2br($briefing['recomendacoes_objecoes']);\n\t\t\n\t\t\n\t\t\n\t\trequire_once(\"../tcpdf/tcpdf.php\"); \n\t\t$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);\n\t\t// set document information\n\t\t$pdf->SetCreator(PDF_CREATOR);\n\t\t$pdf->SetAuthor('Daniel');\n\t\t$pdf->SetTitle('Teste');\n\t\t$pdf->SetSubject('Teste');\n\t\t$pdf->SetFont('helvetica', '', 14);\n\t\t$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);\n\t\t\n\t\t$pdf->setPrintHeader(false);\n\t\t$pdf->setPrintFooter(false);\n\t\t// add a page\n\t\t$pdf->AddPage();\n\t\t$pdf->Image('../img/logoVENTO.png', 10, 10, 50, 43, 'PNG', '#', '', true, 150, '', false, false, 0, false, false, false);\n\n\t\t$txt='<strong>Razão Social: Vento Comunicação Ltda.</strong>\n\t\t\t\t<br>\n\t\t\t\tCNPJ: 08.633.990/0001-07\n\t\t\t\t<br>\n\t\t\t\tInscrição Municipal: 50963627\n\t\t\t\t<br>\n\t\t\t\tEndereço: Rua Independência 1159/303\n\t\t\t\t<br>\n\t\t\t\tPorto Alegre/RS\n\t\t\t\t<br>\n\t\t\t\tCEP: 90035-073\n\t\t\t\t<br>\n\t\t\t\tFone: (51) 3013.3833';\n\t\t$txt= utf8_encode($txt);\n\t\t//var_dump($txt); exit(0);\n\t\t// MultiCell($w, $h, $txt, $border=0, $align='L', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)\n\t\t$pdf->SetTextColor(0, 170, 201);\n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t$pdf->MultiCell(60, 45, '', 0, 'C', 1, 0, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->MultiCell(130, 45, $txt, 0, 'L', 1, 1, '', '', true, 0, true, true, '12', 'M');\t\t\n\t\t$pdf->Ln(4);\n\t\t\t\t\n\t\t$txt=utf8_encode('BRIEFING Nº ').$id_formated.' - '.utf8_encode($briefing['titulo']);\n\t\t\n\t\t//var_dump($txt); exit(0);\n\t\t// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)\n\t\t$pdf->SetTextColor(255, 255, 255);\n\t\t$pdf->SetFillColor(0, 170, 201);\n\t\t$pdf->SetFont('helvetica', 'b', 12);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'C', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\n\t\t$txt='CLIENTE';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetTextColor(0, 170, 201);\n\t\t$pdf->SetFillColor(249,207 , 69);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'C', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(2);\n\t\t$txt='Nome do cliente: ';\n\t\t//$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $briefing['nome_cliente'];\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t$txt = utf8_encode('Informações do cliente:');\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $info_cliente;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, 'J', 1, 1, '', '', true, 0, true, true, '', 'M');\n\t\t$pdf->Ln(10);\n\t\t\n\t\t$txt = 'DEMANDA ';\n\t\t$txt= utf8_encode($txt);\n\t\t//var_dump($txt); exit(0);\n\t\t// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)\n\t\t$pdf->SetFont('helvetica', 'b', 12);\n\t\t$pdf->SetTextColor(0, 170, 201);\n\t\t$pdf->SetFillColor(249,207 , 69);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'C', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t$txt='Descrição e conceito:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $demanda;\n\t\t//$txt = str_replace(array(\"<br/>\",\"<br>\") , \"\\n\" , $demanda );\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, '', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t$txt='Objetivo de comunicação:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $objetivo;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, '', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t\n\t\t\n\t\t$txt='Público-alvo:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\n\t\t$txt = $publico;\n\t/*\t$txt = str_replace(array(\"<br/>\",\"<br />\", \"<br>\") , \"\\r\" , $publico ); */\n\t\t\n\t\t//$txt = str_replace(array(\"<br/>\",\"<br>\") , \"\\n\" , $demanda );\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, '', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t\n\t\t$txt = 'DADOS TÉCNICOS DA DEMANDA';\n\t\t$txt= utf8_encode($txt);\n\t\t//var_dump($txt); exit(0);\n\t\t// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)\n\t\t$pdf->SetFont('helvetica', 'b', 12);\n\t\t$pdf->SetTextColor(0, 170, 201);\n\t\t$pdf->SetFillColor(249,207 , 69);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'C', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t$pecas = $this->get_peca($id);\n\t\t\n\t\t\n\t\t /*\n\t\t$txt='Peças (Quais/quantas): ';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $demanda_pecas;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(3);\n\t\t\n\t\t$txt='Formatos/tamanhos:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $demanda_formato;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t*/\t\n\t\tif($pecas){\n\t\t\t$txt='Peças:';\n\t\t\t$txt= utf8_encode($txt);\n\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\n\t\t\tforeach($pecas as $pc){\n\t\t\t\t$txt =\t'Descrição';\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(128, 191, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(25, 12, $txt, 1, 'L', 1, 0, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$txt = $pc['peca_descricao'];\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(165, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$txt = 'Qtd';\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(128, 191, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(15, 12, $txt, 1, 'L', 1, 0, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\t\t\t\t\n\t\t\t\t$txt = $pc['peca_qtd' ];\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(255,255 , 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(20, 12, $txt, 1, 'L', 1, 0, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\n\t\t\t\t$txt = 'Formato';\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(128, 191, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(20, 12, $txt, 1, 'L', 1,0, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t\t\t\n\t\t\t\t$txt = $pc['peca_formato'];\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(55, 12, $txt, 1, 'L', 1, 0, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\n\t\t\t\t$txt = 'Data entrega:';\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(128, 191, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(30, 12, $txt, 1, 'L', 1, 0, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\t\t\t\t\n\t\t\t\t$txt = $pc['peca_data_entrega'];\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(50, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t$pdf->Ln(5);\n\t\t\t/*\t\n\t\t\t\t$txt = 'Prioridade';\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t\n\t\t\t\t$pdf->MultiCell(190, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t$pdf->Ln(5);\n\t\t\t\t\n\t\t\t\t$txt = $pc['peca_prioridade'];\n\t\t\t\t$txt= utf8_encode($txt);\n\t\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(190, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t$pdf->Ln(5); \n\t\t*/\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t$txt='Materiais e acabamentos:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $demanda_materiais;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\n\t\t$txt='Modo de finalização:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $demanda_finalizacao;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t$txt='Local do arquivo:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\t$txt = $demanda_local;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,0, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t$txt = 'RECOMENDAÇÕES ';\n\t\t$txt= utf8_encode($txt);\n\t\n\t\t//var_dump($txt); exit(0);\n\t\t// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)\n\t\t$pdf->SetFont('helvetica', 'b', 12);\n\t\t$pdf->SetTextColor(0, 170, 201);\n\t\t$pdf->SetFillColor(249,207 , 69);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'C', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t \n\t\t \n\t\t/* \n\t\t$txt='Ideia inicial:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t//$pdf->Ln(5);\n\t\t\n\t\t$txt = $recomendacoes_ideia;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0);\n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, '', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t//$pdf->Ln(5);\n\t\t\n\t\t*/\n\t\t$pdf->Ln(5);\n\t\t\n\t\t\n\t\t/*\t\t\n\t\t$txt = $recomendacoes_referencias;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0);\n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, '', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t*/\n\t\t\n\t\t$txt='Referências:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\n\t\tif($referencias){\n\t\t\t$txt = '';\n\t\t\t$cont=0;\n\t\t\tforeach($referencias as $ref){\n\t\t\t\t$cont++;\n\t\t\t\t$txt =$ref['caminho'];\n\t\t\t\t$pdf->SetFont('helvetica', '', 10);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\tif($cont%2==0){\n\t\t\t\t\t$pdf->SetFillColor(223, 239, 255);\n\t\t\t\t}\n\t\t\t\telse{\t\t\t\t\t\n\t\t\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t\t}\n\t\t\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t$pdf->Ln(5);\n\t\t\n\t\t$txt='Objeçoes:';\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(0,0, 0, 0);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'L', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t\t\t\n\t\t$txt = $recomendacoes_objecoes;\n\t\t$txt= utf8_encode($txt);\n\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t$pdf->SetTextColor(0, 0, 0);\n\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t// set cell margins\n\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t$pdf->MultiCell(190, 12, $txt, 1, '', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t\n\t\t\n\t\t$txt = 'CRONOGRAMA ';\n\t\t$txt= utf8_encode($txt);\n\t\t//var_dump($txt); exit(0);\n\t\t// MultiCell($w, $h, $txt, $border=0, $align='J', $fill=0, $ln=1, $x='', $y='', $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0)\n\t\t$pdf->SetFont('helvetica', 'b', 12);\n\t\t$pdf->SetTextColor(0, 170, 201);\n\t\t$pdf->SetFillColor(249,207 , 69);\n\t\t$pdf->MultiCell(190, 12, $txt, 0, 'C', 1, 1, '', '', true, 0, false, true, '12', 'M');\n\t\t$pdf->Ln(5);\n\t\t\n\t\t$txt ='';\n\t\tif($cronograma){\n\t\t\t$txt ='Atividade';\n\t\t\t$pdf->SetFont('helvetica', 'b', 12);\n\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t$pdf->SetFillColor(128, 191, 255);\n\t\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t\t// set cell margins\n\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t$pdf->MultiCell(130, 10, $txt, 0, 'L', 1, 0, '', '', true, 0, true, true, '12', 'M');\n\t\t\t$txt ='Início';\n\t\t\t$txt= utf8_encode($txt);\n\t\t\t$pdf->MultiCell(30, 10, $txt, 0, 'L', 1, 0, '', '', true, 0, true, true, '12', 'M');\n\t\t\t$txt ='Fim';\n\t\t\t$pdf->MultiCell(30, 10, $txt, 0, 'L', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t\t//$pdf->Ln(5);\n\t\t\t$cont=0;\n\t\t\tforeach($cronograma as $etapa){\n\t\t\t\t$cont++;\n\t\t\t\t$txt =$etapa['atividade'];\n\t\t\t\t$pdf->SetFont('helvetica', '', 10);\n\t\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t\tif($cont%2==0){\n\t\t\t\t\t$pdf->SetFillColor(223, 239, 255);\n\t\t\t\t}\n\t\t\t\telse{\t\t\t\t\t\n\t\t\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t\t}\n\t\t\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t\t\t// set cell margins\n\t\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t\t$pdf->MultiCell(130, 8, $txt, 0, '', 1, 0, '', '', true, 0, true, true, '12', 'M');\n\t\t\t\t$txt =$this->convert_data_bd_to_human($etapa['inicio']);\n\t\t\t\t$pdf->MultiCell(30, 8, $txt, 0, '', 1, 0, '', '', true, 0, true, true, '12', 'M');\n\t\t\t\t$txt =$this->convert_data_bd_to_human($etapa['fim']);\n\t\t\t\t$pdf->MultiCell(30, 8, $txt, 0, '', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t\t}\n\t\t\t//$txt .= \"</table>\";\n\t\t} \n\t\telse{\n\t\t\n\t\t\t//$txt= utf8_encode($txt);\n\t\t\t//var_dump($txt); exit(0);\n\t\t\t$pdf->SetFont('helvetica', '', 12);\n\t\t\t$pdf->SetTextColor(0, 0, 0); \n\t\t\t$pdf->SetFillColor(255, 255, 255);\n\t\t\t$pdf->setCellPaddings(3,3, 0, 1);\n\t\t\t// set cell margins\n\t\t\t//$pdf->setCellMargins(1, 1, 1, 1);\n\t\t\t$pdf->MultiCell(190, 12, $txt, 1, '', 1, 1, '', '', true, 0, true, true, '12', 'M');\n\t\t\t$pdf->Ln(5);\n\t\t}\n\n\t\t$pdf->lastPage();\n\t\t$pdf->Output('teste.pdf', 'I');\n\t}",
"public function prijmoutClanek($id){\n try {\n $sql = \"UPDATE PRISPEVKY \n SET stav='schváleno'\n WHERE \n id_prispevku=:id;\";\n $sth = $this->db->prepare($sql);\n $sth->bindParam(':id', $id);\n $sth->execute();\n return \"ok\";\n\n } catch (Exception $e) {\n return \"Chyba při práci s databází.\"; //. $e->getMessage(); //chyba v pozadavku\n }\n }",
"public static function cogeCajaChica($id){\n if(is_null(self::model()->find(\"hidcaja=:vhidcaja\",array(\":vhidcaja\"=>$id)))){\n $dcaja= Dcajachica::model()->findByPk($id);\n if(!is_null($dcaja)){\n $regcompra=New Registrocompras('ins_compralocal'); \n $regcompra->setAttributes(\n array(\n 'socio'=>$dcaja->cabecera->fondo->socio,\n 'femision'=>$dcaja->fecha,\n 'numerocomprobante'=>$dcaja->referencia,\n 'razpronombre'=>$dcaja->razon,\n 'hidperiodo'=>yii::app()->periodo->getperiodo(),\n 'tipodocid'=>$dcaja->tipodocid,\n 'numerodocid'=>$dcaja->numdocid,\n 'glosa'=>$dcaja->glosa,\n 'codmon'=>$dcaja->monedahaber,\n 'importe'=>$dcaja->haber,\n 'serie'=>$dcaja->serie,\n 'esservicio'=>$dcaja->esservicio,\n 'tipo'=>$dcaja->codocu,\n 'tipgrabado'=>'1',\n 'hidcaja'=>$dcaja->id,\n )\n );\n $grabo=$regcompra->save();\n //if(!$grabo)\n //print_r(yii::app()->mensajes->getErroresItem($regcompra->geterrors()));\n //die();\n return ($grabo)?$regcompra:null;\n }else{\n return null;\n }\n } \n }",
"function commandes_trig_bank_reglement_en_echec($flux){\r\n\t// Si on est dans le bon cas d'un paiement de commande et qu'il y a un id_commande et que la commande existe toujours\r\n\tif ($id_transaction = $flux['args']['id_transaction']\r\n\t AND $transaction = sql_fetsel(\"*\",\"spip_transactions\",\"id_transaction=\".intval($id_transaction))\r\n\t\tAND $id_commande = $transaction['id_commande']\r\n\t\tAND $commande = sql_fetsel('id_commande, statut, id_auteur', 'spip_commandes', 'id_commande='.intval($id_commande))){\r\n\r\n\t\t$statut_commande = $commande['statut'];\r\n\t\t$transaction_mode = $transaction['mode'];\r\n\t\t$statut_nouveau = $statut_commande;\r\n\r\n\t\t// on ne passe la commande en erreur que si le reglement a effectivement echoue,\r\n\t\t// pas si c'est une simple annulation (retour en arriere depuis la page de paiement bancaire)\r\n\t\tif (strncmp($transaction['statut'],\"echec\",5)==0){\r\n\t\t\t$statut_nouveau = 'erreur';\r\n\t\t}\r\n\t\tif ($statut_nouveau !== $statut_commande){\r\n\t\t\tspip_log(\"commandes_trig_bank_reglement_en_attente marquer la commande #$id_commande statut=$statut_nouveau\",'commandes');\r\n\t\t\t//on met a jour la commande\r\n\t\t\tinclude_spip(\"action/editer_commande\");\r\n\t\t\tcommande_modifier($id_commande,array('statut'=>$statut_nouveau,'mode'=>$transaction_mode));\r\n\t\t}\r\n\t}\r\n\r\n\treturn $flux;\r\n}",
"public function get_compte(){retrun($id_local_compte); }",
"function getLongFormatCongressBlockWithEditLink($congress)\n{\n $html = \"\n <div class='longCongressBlockDIV'\";\n \n if ($congress[\"imageURL\"] != \"\")\n {\n $html .= \" style='background-image: linear-gradient(to right, rgba(70, 99, 32, 0.7), rgba(60, 101, 124, 0.7)), url(\\\"\" . CONGRESS_IMAGES_PATH . $congress['imageURL'] . \"\\\");opacity:1;'\";\n }\n \n $html .= \">\n <div class='edit congressEdit fa'><a href='\" .HOME . \"?action=\" . POST_MODIFY_CONGRESS_DETAIL . \"&congress=\" . $congress['id'] . \"'></a></div>\n <div class='longCongressShortName'>\" . $congress[\"shortName\"] . \"</div>\n <div class='longCongressName'>\" . $congress[\"name\"] . \"</div>\n <div class='longCongressShortDates'>\" . congressDatesForHtmlShortFormat($congress) . \"</div>\n <div class='caret congressCaret fa'></div>\n <div class='longCongressVenueDetail' style='display:none;'>\n <div class='longCongressVenue'>Conference Venue :</div>\n <div>\" . $congress[\"venueName\"] . \"</div>\n <div>\" . $congress[\"venueAddress1\"] . \" \" . $congress[\"venueAddress2\"] . \"</div>\n <div>\" . $congress[\"venueCity\"] . \", \" . $congress['venueState'] . \" \" . $congress['venueZip'] . \"</div>\n <div>\" . $congress['venueCountry'] . \"</div>\n </div>\n </div>\n <script>\n $('.congressCaret').click(function()\n {\n if($('.longCongressVenueDetail').is(':visible'))\n {\n $('.longCongressVenueDetail').hide();\n $('.congressCaret').html('');\n }\n else\n {\n $('.longCongressVenueDetail').show();\n $('.congressCaret').html('');\n }\n });\n </script>\";\n return $html;\n}",
"public function chapitre(int $idChapitre) : void\n { \n $episode = $this->chapitreManager->findChapitre($idChapitre);\n $chapitrePrecedent = $this->getMaxId->getMaxId($episode['numchapitre']);\n $chapitreSuivant = $this->getMinId->getMinId($episode['numchapitre']);\n $commentaires = $this->commentaireManager->findComments($idChapitre);\n $token = new Token($this->session);\n \n $this->view->render('chapitre', [\n 'episode'=>$episode, \n 'commentaires'=>$commentaires, \n 'session'=> $this->session,\n 'chapitreSuivant'=>$chapitreSuivant,\n 'chapitrePrecedent'=>$chapitrePrecedent,\n 'token'=>$token->genererToken()\n ]);\n }",
"public function odmitnoutClanek($id){\n try {\n $sql = \"UPDATE PRISPEVKY \n SET stav='odmítnuto'\n WHERE \n id_prispevku=:id;\";\n $sth = $this->db->prepare($sql);\n $sth->bindParam(':id', $id);\n $sth->execute();\n return \"ok\";\n\n } catch (Exception $e) {\n return \"Chyba při práci s databází.\"; //. $e->getMessage(); //chyba v pozadavku\n }\n }"
] | [
"0.6159074",
"0.5798624",
"0.57816863",
"0.5773856",
"0.5746534",
"0.5709933",
"0.5669744",
"0.5667635",
"0.56286716",
"0.5545264",
"0.55301195",
"0.5518028",
"0.5515942",
"0.5489696",
"0.5471519",
"0.54623055",
"0.545624",
"0.54374224",
"0.54228544",
"0.5398787",
"0.53611594",
"0.5348866",
"0.5343304",
"0.5337201",
"0.53291845",
"0.53287864",
"0.5313547",
"0.53041804",
"0.5299648",
"0.52917236"
] | 0.72676164 | 0 |
/ Renvoie les infos sur une banque. S'il n'y a rien on renvoie NULL | function getInfosBanque($id_bqe=NULL,$id_ag=NULL) {
global $dbHandler;
$db = $dbHandler->openConnection();
$sql = "SELECT * FROM adsys_banque";
if ($id_bqe != NULL) {
if ($id_ag == NULL)
$sql .=" WHERE id_banque = $id_bqe";
else
$sql .=" WHERE id_banque = $id_bqe and id_ag = $id_ag ";
}
elseif ($id_ag != NULL) $sql .=" WHERE id_ag = $id_ag";
$sql.= ";";
$result=$db->query($sql);
if (DB::isError($result)) {
$dbHandler->closeConnection(false);
signalErreur(__FILE__,__LINE__,__FUNCTION__);
}
$dbHandler->closeConnection(true);
if ($result->numRows() == 0) return NULL;
while ( $row = $result->fetchRow(DB_FETCHMODE_ASSOC) )
$DATAS[$row["id_banque"]] = $row;
return $DATAS;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculer_boucle($id_boucle, &$boucles) {\n\n\t// gerer les statuts si declares pour cette table\n\t/*\n\t$table_statut[nom_table][] = array(\n\t\t'champ'=>'statut', // champ de la table sur lequel porte le filtrage par le statut\n\t\t'publie'=>'publie', // valeur ou liste de valeurs, qui definissent l'objet comme publie.\n\t\t'previsu'=>'publie,prop', // valeur ou liste de valeurs qui sont visibles en previsu\n\t\t'post_date'=>'date', // un champ de date pour la prise en compte des post_dates, ou rien sinon\n\t 'exception'=>'statut', // liste des modificateurs qui annulent le filtrage par statut\n\t // si plusieurs valeurs : array('statut','tout','lien')\n\t);\n\n\tPour 'publier' ou 'previsu', si la chaine commence par un \"!\" on exclu au lieu de filtrer sur les valeurs donnees\n\tsi la chaine est vide, on ne garde rien si elle est seulement \"!\" on n'exclu rien\n\n\tSi le statut repose sur une jointure, 'champ' est alors un tableau du format suivant :\n\t'champ'=>array(\n\t array(table1, cle1),\n\t ...\n\t array(tablen, clen),\n\t champstatut\n\t )\n\n\tchampstatut est alors le champ statut sur la tablen\n\tdans les jointures, clen peut etre un tableau pour une jointure complexe : array('id_objet','id_article','objet','article')\t \n\t*/\n\n\t$boucle = &$boucles[$id_boucle];\n\t$id_table = $boucle->id_table;\n\t$table_sql = $boucle->from[$id_table];\n\tif (isset($GLOBALS['table_statut'][$table_sql])){\n\t\tforeach($GLOBALS['table_statut'][$table_sql] as $s){\n\t\t\t// Restreindre aux elements publies si pas de {statut} ou autre dans les criteres\n\t\t\t$filtrer = true;\n\t\t\tif (isset($s['exception'])) {\n\t\t\t\tforeach(is_array($s['exception'])?$s['exception']:array($s['exception']) as $m) {\n\t\t\t\t\tif (isset($boucle->modificateur[$m]) OR isset($boucle->modificateur['criteres'][$m])) {\n\t\t\t\t\t\t$filtrer = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($filtrer) {\n\t\t\t\tif (is_array($s['champ'])){\n\t\t\t\t\t$statut = preg_replace(',\\W,','',array_pop($s['champ'])); // securite\n\t\t\t\t\t$jointures = array();\n\t\t\t\t\tforeach($s['champ'] as $j) {\n\t\t\t\t\t\t$jointures[] = array('',array($id=reset($j)),end($j));\n\t\t\t\t\t}\n\t\t\t\t\t$jointures[0][0] = $id_table;\n\t\t\t\t\tif (!array_search($id, $boucle->from)){\n\t\t\t\t\t\tfabrique_jointures($boucle, $jointures, true, $boucle->show, $id_table);\n\t\t\t\t\t}\n\t\t\t\t\t// trouver l'alias de la table d'arrivee qui porte le statut\n\t\t\t\t\t$id = array_search($id, $boucle->from);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$id = $id_table;\n\t\t\t\t\t$statut = preg_replace(',\\W,','',$s['champ']); // securite\n\t\t\t\t}\n\t\t\t\t$mstatut = $id .'.'.$statut;\n\n\t\t\t\tif (!$GLOBALS['var_preview']) {\n\t\t\t\t\tif (isset($s['post_date']) AND $s['post_date']\n\t\t\t\t\t\tAND $GLOBALS['meta'][\"post_dates\"] == 'non'){\n\t\t\t\t\t\t$date = $id.'.'.preg_replace(',\\W,','',$s['post_date']); // securite\n\t\t\t\t\t\tarray_unshift($boucle->where,\"quete_condition_postdates('$date')\");\n\t\t\t\t\t}\n\t\t\t\t\tarray_unshift($boucle->where,calculer_where_statut($mstatut,$s['publie']));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tarray_unshift($boucle->where,calculer_where_statut($mstatut,$s['previsu']));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\t$boucles[$id_boucle] = pipeline('post_boucle', $boucles[$id_boucle]);\n\n\t// en mode debug memoriser les premiers passages dans la boucle,\n\t// mais pas tous, sinon ca pete.\n\tif (_request('var_mode_affiche') != 'resultat') \n\t\t$trace = '';\n\telse {\n\t\t$trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle;\n\t\t$trace = \"if (count(@\\$GLOBALS['debug_objets']['resultat']['$trace'])<3)\n\t \\$GLOBALS['debug_objets']['resultat']['$trace'][] = \\$t0;\";\n\t}\n\treturn ($boucles[$id_boucle]->type_requete == 'boucle')\n\t? calculer_boucle_rec($id_boucle, $boucles, $trace) \n\t: calculer_boucle_nonrec($id_boucle, $boucles, $trace);\n}",
"function fProcesaBanco(){\n global $db, $cla, $agPar, $igNumChq, $igSecue, $ogDet;\n $alDet = fIniDetalle();\n $alDet[\"det_codcuenta\"]\t= $cla->cla_ctaorigen; \n $alDet[\"det_glosa\"] \t= substr($agPar[\"com_Concepto\"],0, 50) . ' ' . substr($agPar[\"slBenef\"],0,20);\n $alDet['det_idauxiliar']= $agPar[\"com_Emisor\"];\n $alDet[\"det_numcheque\"]\t= $igNumChq;\t\t\t// es el numero de cheque\n $alDet[\"det_feccheque\"]\t= $agPar[\"com_FechCheq\"];\n $alDet['det_valdebito']\t= $agPar[\"flValor\"] * $cla->cla_indicador; // segun el signo del indicador, se aplica como DB/CR al grabar;\n $alDet['det_valcredito']\t= 0;\n $alDet['det_secuencia']\t= $igSecue;\n\tif(fGetParam(\"pAppDbg\",0)){\n\t\tprint_r($alDet);\n\t}\n\tfInsdetalleCont($db, $alDet);\n}",
"function cargar_data_libro_banco($c_a_cuenta_banco, $limit, $nombre_mes='' , $cc='') {\n\t//$nombre_mes='DICIEMBRE';\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo \tON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes \tON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio \tON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario \tON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\tON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_plan_contable ON (prosic_comprobante.cuenta_banco = prosic_plan_contable.id_plan_contable)\n INNER JOIN prosic_moneda\t ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n WHERE prosic_comprobante.id_subdiario=8 AND prosic_comprobante.c_a_cuenta_banco='\" . $c_a_cuenta_banco . \"' \";\t\n\tif ($nombre_mes != '') $sql.= \" AND prosic_mes.nombre_mes = '\" . $nombre_mes . \"' \";\n\tif ($cc != '') $sql.=\" AND prosic_comprobante.codigo_comprobante = '\" . $cc . \"' \";\n\t$sql.=\" ORDER BY MONTH(prosic_comprobante.emision_comprobante) DESC , prosic_comprobante.codigo_comprobante*10000 DESC\";\n\t//$sql.=\" ORDER BY prosic_comprobante.status_comprobante DESC, MONTH(prosic_comprobante.emision_comprobante), prosic_comprobante.emision_comprobante\";\n\tif ($limit != '')$sql.=\" \" . $limit . \" \";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }",
"function emptyInfo() {\n\n $this->setCodigoestudiante(\"\");\n $this->setIdestudiantegeneral(\"\");\n $this->setCodigocarrera(\"\");\n $this->setSemestre(\"\");\n $this->setNumerocohorte(\"\");\n $this->setCodigotipoestudiante(\"\");\n $this->setCodigosituacioncarreraestudiante(\"\");\n $this->setCodigoperiodo(\"\");\n $this->setCodigojornada(\"\");\n }",
"function requeteur_data_dist(&$boucles, &$boucle, &$id) {\n\tinclude_spip('iterateur/data');\n\tif ($h = charger_fonction($boucle->type_requete . '_to_array' , 'inc', true)) {\n\t\t$g = charger_fonction('data', 'iterateur');\n\t\t$boucles[$id] = $g($boucle);\n\t\t// from[0] stocke le type de data (rss, yql, ...)\n\t\t$boucles[$id]->from[] = $boucle->type_requete;\n\t\t\n\t} else {\n\t\t$x = $boucle->type_requete;\n\t\t$boucle->type_requete = false;\n\t\t$msg = array('zbug_requeteur_inconnu',\n\t\t\t\tarray(\n\t\t\t\t'requeteur' => 'data',\n\t\t\t\t'type' => $x\n\t\t));\n\t\terreur_squelette($msg, $boucle);\n\t}\n}",
"function stocks_pre_boucle($boucle) {\n $id_table = $boucle->id_table;\n\n //Savoir si on consulté la table organisations_liens\n if ($jointure = array_keys($boucle->from, 'spip_stocks')) {\n //Vérifier qu'on est bien dans le cas d'une jointure automatique\n if (isset($boucle->join[$jointure[0]])\n and isset($boucle->join[$jointure[0]][3])\n and $boucle->join[$jointure[0]]\n and $boucle->join[$jointure[0]][3]\n ) {\n //Le critere ON de la jointure (index 3 dans le tableau de jointure) est incompléte\n //on fait en sorte de retomber sur ses pattes, en indiquant l'objet à joindre\n $boucle->join[$jointure[0]][3] = \"'L1.objet='.sql_quote('\".objet_type($id_table).\"')\";\n\t\t}\n }\n\n return $boucle;\n}",
"public function readAllInfo()\n {\n //recupération des données en post\n $data = $this->request->data;\n try\n {\n //selection d'une UE en foction de l'identifiant\n if (!empty($data['id_matiere'])) {\n $results = $this->model->read_all_info_id((int)$data['id_matiere']);\n\n if (empty($results)) {\n $this->_return('la matière demandée n\\'existe pas dans la base de donnée', false);\n }\n $this->_return('Informations sur la matière '.$results->nom_matiere.' ', true, $results);\n }\n //selection de toutes les UE d'enseignement\n $results = $this->model->read_all_info_matiere();\n if (empty($results)) {\n $this->_return('Vous n\\'avez pas encore de matière en base de données', false);\n }\n $this->_return('liste des matières disponibles dans la base de données', true, $results);\n }\n catch(Exception $e)\n {\n $this->_exception($e);\n }\n }",
"public function rechercherUn() {\n\n // query to read single record\n $query = \"SELECT * FROM \" . $this->sNomTable . \"\n LEFT JOIN panier ON idPanier = iNoPanier\n LEFT JOIN produit ON idProduit = iNoProduit\n WHERE iNoPanier = :iNoPanier\";\n\n // prepare query statement\n $stmt = $this->oConnexion->prepare($query);\n\n // bind id of product to be updated\n $stmt->bindParam(\":iNoPanier\", $this->iNoPanier);\n\n // execute query\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->idContenuPanier = $row['idContenuPanier'];\n $this->iQteProduit = $row['iQteProduit'];\n\n // Produit\n $this->iNoProduit = $row['iNoProduit'];\n $this->sSKUProduit = $row['sSKUProduit'];\n $this->sNomProduit = $row['sNomProduit'];\n $this->sMarque = $row['sMarque'];\n $this->fPrixProduit = $row['fPrixProduit'];\n $this->fPrixSolde = $row['fPrixSolde'];\n $this->sDescCourteProduit = $row['sDescCourteProduit'];\n $this->sDescLongProduit = $row['sDescLongProduit'];\n $this->sCouleur = $row['sCouleur'];\n $this->sCapacite = $row['sCapacite'];\n $this->sDateAjout = $row['sDateAjout'];\n $this->bAfficheProduit = $row['bAfficheProduit'];\n $this->iNoCategorie = $row['iNoCategorie'];\n $this->sNomCategorie = $row['sNomCategorie'];\n $this->sUrlCategorie = $row['sUrlCategorie'];\n\n // Panier\n $this->iNoPanier = $row['iNoPanier'];\n $this->sNumPanier = $row['sNumPanier'];\n $this->sDateModification = $row['sDateModification'];\n }",
"public function recupereDonnees (){\n\t\t$req = $this->bdd->prepare('SELECT gratuit, image, invisibleAuteur, idModerateur, moderation, affiche , titre, idAuteur, idCategorie, corps, DATE_FORMAT(date_creation, \\'%d/%m/%Y à %Hh%i\\') AS date_creation_fr FROM `Article` WHERE id = ?');\n\t\t$req->execute(array($this->id));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor(); \n\n\t\t$this->titre = $donnees['titre'];\n\t\t$this->idAuteur = $donnees['idAuteur'];\n\t\t$this->idModerateur = $donnees['idModerateur'];\n\t\t$this->idCategorie = $donnees['idCategorie'];\n\t\t$this->corps = $donnees['corps'];\n\t\t$this->extrait = $this->creationExtrait($this->corps,15); // Fixé arbitrairement à 15 mots dans l'extrait pour le moment.\n\t\t$this->extraitLong = $this->creationExtrait($this->corps,35); // Fixé arbitrairement à 35 mots dans l'extrait pour le moment.\n\n\t\t$this->image = $donnees['image'];\n\t\t/*\n\t\tif (isset($donnees['image'])) {\n\t\t\t$this->image = $donnees['image'];\n\t\t}else{\n\t\t\t$this->image = \"default.jpg\";\n\t\t}\n\t\t*/\n\n\t\t$this->date_creation_fr = $donnees['date_creation_fr'];\n\t\tif ($donnees['moderation'] == 0){\n\t\t\t$this->moderation = false;\n\t\t} else {\n\t\t\t$this->moderation = true;\n\t\t}\n\n\t\tif ($donnees['affiche'] == 0){\n\t\t\t$this->affiche = false;\n\t\t} else {\n\t\t\t$this->affiche = true;\n\t\t}\n\t\tif ($donnees['invisibleAuteur'] == 0){\n\t\t\t//echo \"false\";\n\t\t\t$this->invisibleAuteur = false;\n\t\t} else {\n\t\t\t//echo \"true\";\n\t\t\t$this->invisibleAuteur = true;\n\t\t}\n\t\tif ($donnees['gratuit'] == 0){\n\t\t\t$this->gratuit = false;\n\t\t} else {\n\t\t\t$this->gratuit = true;\n\t\t}\n\n\t\t// Recuperer le nombre de commentaire liés à cet article\n\t\t$req = $this->bdd->prepare('SELECT COUNT(id) FROM `Commentaire` WHERE idArticle = ? AND affiche = ?');\n\t\t$req->execute(array($this->id, \"1\"));\n\t\t$donnees = $req->fetch();\n\t\t$req->closeCursor();\n\t\t$this->nbCommentaire = $donnees[0];\n\t}",
"public function rechercherUn() {\n\n // query to read single record\n $query = \"SELECT * FROM \" . $this->sNomTable . \"\n LEFT JOIN produit ON idProduit = iNoProduit\n WHERE idContenuCommande = :idContenuCommande\";\n\n // prepare query statement\n $stmt = $this->oConnexion->prepare($query);\n\n // bind id of product to be updated\n $stmt->bindParam(\":idContenuCommande\", $this->idContenuCommande);\n\n // execute query\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->idContenuCommande = $row['idContenuCommande'];\n $this->iQteProduitCommande = $row['iQteProduitCommande'];\n $this->fPrixCommande = $row['fPrixCommande'];\n $this->iNoCommande = $row['iNoCommande'];\n\n // Produit\n $this->iNoProduit = $row['iNoProduit'];\n $this->sSKUProduit = $row['sSKUProduit'];\n $this->sNomProduit = $row['sNomProduit'];\n $this->sMarque = $row['sMarque'];\n $this->fPrixProduit = $row['fPrixProduit'];\n $this->fPrixSolde = $row['fPrixSolde'];\n $this->sDescCourteProduit = $row['sDescCourteProduit'];\n $this->sCouleur = $row['sCouleur'];\n $this->sCapacite = $row['sCapacite'];\n }",
"function absender_bestimmen($absender,$db){\n$query1=\"select * from user\";\n\t$antwort1=$db->query($query1);\n\t$antwort1=array_bildung($antwort1);\n\t\n\t$i=0;\n\tforeach($absender[Absender] as $name => $inhalt){\n\tif($inhalt==0){\n\t\t$absender[Absender][$i]=\"Information an Alle !\";\n\t}\n\t\n\t\t$k=0;\n\t\tforeach($antwort1[id] as $name1 => $inhalt1){\n\t\t\tif($inhalt==$inhalt1){\n\t\t\t\t$absender[Absender][$i]=$antwort1[Name][$k].\" \".$antwort1[Vorname][$k].\" - \".$antwort1[Bemerkung][$k].\" -\";\n\t\t\t}\n\t\t$k++;\n\t\t}\n\t$i++;\n\t}\n\treturn $absender;\n}",
"public function listarbiofinCE(){\n $stmt = $this->objPDO->prepare(\"SELECT b.id_biopsia,b.num_biopsia,b.fecha_ingreso,db.fecha_informe,(e.emp_nombres||' '||e.emp_appaterno||' '||e.emp_apmaterno) as medico,\n list(m.descr_muestra)as muestras from sisanatom.biopsia b \n inner join sisanatom.detalle_bioce db on b.id_biopsia=db.id_biopsia\n inner join sisanatom.muestras_biopsia mb on b.id_biopsia=mb.id_biopsia inner join empleados e on b.patologo_responsable=e.emp_id\n inner join sisanatom.muestra m on m.id_muestra=mb.id_muestrarem\n where b.estado_biopsia=3 and b.condicion_biopsia='A'\n group by b.id_biopsia,b.num_biopsia,b.fecha_ingreso,db.fecha_informe,medico\");\n $stmt->execute();\n $pacientes = $stmt->fetchAll(PDO::FETCH_OBJ);\n return $pacientes;\n }",
"function emptyInfo() {\n\n $this->setIdestudiantegeneral(\"\");\n $this->setIdtrato(\"\");\n $this->setIdestadocivil(\"\");\n $this->setTipodocumento(\"\");\n $this->setNumerodocumento(\"\");\n $this->setExpedidodocumento(\"\");\n $this->setNumerolibretamilitar(\"\");\n $this->setNumerodistritolibretamilitar(\"\");\n $this->setExpedidalibretamilitar(\"\");\n $this->setNombrecortoestudiantegeneral(\"\");\n $this->setNombresestudiantegeneral(\"\");\n $this->setApellidosestudiantegeneral(\"\");\n $this->setFechanacimientoestudiantegeneral(\"\");\n $this->setIdciudadnacimiento(\"\");\n $this->setCodigogenero(\"\");\n $this->setDireccionresidenciaestudiantegeneral(\"\");\n $this->setDireccioncortaresidenciaestudiantegeneral(\"\");\n $this->setCiudadresidenciaestudiantegeneral(\"\");\n $this->setTelefonoresidenciaestudiantegeneral(\"\");\n $this->setTelefono2estudiantegeneral(\"\");\n $this->setCelularestudiantegeneral(\"\");\n $this->setDireccioncorrespondenciaestudiantegeneral(\"\");\n $this->setDireccioncortacorrespondenciaestudiantegeneral(\"\");\n $this->setCiudadcorrespondenciaestudiantegeneral(\"\");\n $this->setTelefonocorrespondenciaestudiantegeneral(\"\");\n $this->setEmailestudiantegeneral(\"\");\n $this->setEmail2estudiantegeneral(\"\");\n $this->setFechacreacionestudiantegeneral(\"\");\n $this->setFechaactualizaciondatosestudiantegeneral(\"\");\n $this->setCodigotipocliente(\"\");\n $this->setCasoemergenciallamarestudiantegeneral(\"\");\n $this->setTelefono1casoemergenciallamarestudiantegeneral(\"\");\n $this->setTelefono2casoemergenciallamarestudiantegeneral(\"\");\n $this->setIdtipoestudiantefamilia(\"\");\n }",
"public function getRefBancaria(){\n return $this->ref_bancaria->toArray();\n }",
"function listarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_sel';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('id_cuenta_bancaria_boa','int4');\n\t\t$this->captura('banco','int4');\n\t\t$this->captura('cuenta','varchar');\n\t\t$this->captura('desc_cuenta','varchar');\n\t\t$this->captura('moneda','int4');\n\t\t$this->captura('tipo_cuenta','bpchar');\n\t\t$this->captura('estado_cuenta','bpchar');\n\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('desc_cuenta_banco','varchar');\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function Cargar($recuperanombre,$recuperacif,$recuperavisible,$recuperacic,$recuperatipo,$recuperagrupo_gestion,$recuperadireccion,$recuperalocalidad,$recuperacodigo_postal,$recuperaprovincia,$recuperapais, $recuperatelefono,$recuperafax,$recuperamail,$recuperaresponsable,\r\n\t$recuperacargo_responsable,$recuperagrupo_comision,$recuperasituacion,$recuperaobservaciones,$recuperanombre_fiscal,$recuperadireccion_fiscal,$recuperalocalidad_fiscal,$recuperacodigo_postal_fiscal,\r\n\t$recuperapais_fiscal,$recuperaswift,$recuperacc_iban,$recuperanombre_banco,$recuperadireccion_banco,$recuperamail_contabilidad){\r\n\r\n\t\t$conexion = $this ->Conexion;\r\n\r\n\t\t//Consulta\r\n\t\t$Filadesde = $this ->Filadesde;\r\n\t\t$Usuario = $this ->Usuario;\r\n\r\n\t\t//ESPECIFICO: Cargamos las lineas solicitadas para esta pantalla\r\n\t\t$buscar_codigo = $this ->Buscar_codigo;\r\n\t\t$buscar_nombre = $this ->Buscar_nombre;\r\n\t\t$buscar_grupo_gestion = $this ->Buscar_grupo_gestion;\t\r\n\r\n\r\n\r\n\t\tif($buscar_codigo != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE ID = '\".$buscar_codigo.\"'\";\r\n\t\t}elseif($buscar_nombre != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE NOMBRE LIKE '%\".$buscar_nombre.\"%'\";\r\n\t\t}elseif($buscar_grupo_gestion != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE GRUPO_GESTION = '\".$buscar_grupo_gestion.\"'\";\r\n\t\t}else{\r\n\t\t\t$CADENA_BUSCAR = \" WHERE NOMBRE = 'XX' \";\r\n\t\t\t//$CADENA_BUSCAR = \"\";\r\n\t\t}\r\n\r\n\t\t$resultado =$conexion->query(\"SELECT id,nombre,cif,visible,cic,tipo,grupo_gestion,direccion,localidad,codigo_postal,provincia,pais,telefono,fax,mail,responsable,\r\n\tcargo_responsable,grupo_comision,situacion,observaciones,nombre_fiscal,direccion_fiscal,localidad_fiscal,codigo_postal_fiscal,provincia_fiscal,pais_fiscal,swift,cc_iban,nombre_banco,direccion_banco,mail_contabilidad FROM hit_minoristas \".$CADENA_BUSCAR.\" ORDER BY NOMBRE\");\r\n\r\n\t\t/*if ($resultado == FALSE){\r\n\t\t\techo('Error en la consulta');\r\n\t\t\t$resultado->close();\r\n\t\t\t$conexion->close();\r\n\t\t\texit;\r\n\t\t}*/\r\n\t\t//----------------------------------------------------------------\r\n\r\n\t\t//Guardamos el resultado en una matriz con un numero fijo de registros\r\n\t\t//que controlaremos por una tabla de configuracion de pantallas de usuarios. ESPECIFICO: Solo el nombre del formulario en la query\r\n\t\t$numero_filas =$conexion->query(\"SELECT LINEAS_MODIFICACION FROM hit_usuarios_formularios WHERE FORMULARIO = 'MINORISTAS' AND USUARIO = '\".$Usuario.\"'\");\r\n\t\t$Nfilas\t = $numero_filas->fetch_assoc();\t\t\t\t\t\t\t\t\t\t\t //------\r\n\r\n\t\t$minoristas = array();\r\n\t\tif($recuperanombre != null){\r\n\t\t\t$minoristas[0] = array (\"id\" => null, \"nombre\" => $recuperanombre, \"cif\" => $recuperacif, \"visible\" => $recuperavisible, \"cic\" => $recuperacic, \"tipo\" => $recuperatipo, \"grupo_gestion\" => $recuperagrupo_gestion, \"direccion\" => $recuperadireccion, \"localidad\" => $recuperalocalidad, \"codigo_postal\" => $recuperacodigo_postal, \"provincia\" => $recuperaprovincia, \"pais\" => $recuperapais, \"telefono\" => $recuperatelefono, \"fax\" => $recuperafax, \"mail\" => $recuperamail, \"responsable\" => $recuperaresponsable, \"cargo_responsable\" => $recuperacargo_responsable, \"grupo_comision\" => $recuperagrupo_comision, \"situacion\" => $recuperasituacion, \"observaciones\" => $recuperaobservaciones, \"v\" => $recuperanombre_fiscal, \"direccion_fiscal\" => $recuperadireccion_fiscal, \"localidad_fiscal\" => $recuperalocalidad_fiscal, \"codigo_postal_fiscal\" => $recuperacodigo_postal_fiscal, \"provincia_fiscal\" => $recuperaprovincia_fiscal, \"pais_fiscal\" => $recuperapais_fiscal, \"swift\" => $recuperaswift, \"cc_iban\" => $recuperacc_iban, \"nombre_banco\" => $recuperanombre_banco, \"direccion_banco\" => $recuperadireccion_banco, \"mail_contabilidad\" => $recuperamail_contabilidad);\r\n\t\t}else{\r\n\t\t\tfor ($num_fila = $Filadesde-1; $num_fila <= $Filadesde + $Nfilas['LINEAS_MODIFICACION']-2; $num_fila++) {\r\n\t\t\t\t$resultado->data_seek($num_fila);\r\n\t\t\t\t$fila = $resultado->fetch_assoc();\r\n\t\t\t\tarray_push($minoristas,$fila);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Liberar Memoria usada por la consulta\r\n\t\t$resultado->close();\r\n\t\t$numero_filas->close();\r\n\r\n\t\treturn $minoristas;\t\t\t\t\t\t\t\t\t\t\t\r\n\t}",
"function getListeChamps()\n{\n\t// ATTENTION, respecter l'ordre des champs de la table dans la base de données pour construire laListeChamp\n\t$laListeChamps[]=new dbChamp(\"Cms_id\", \"entier\", \"get_id\", \"set_id\");\n\t$laListeChamps[]=new dbChamp(\"Cms_type\", \"entier\", \"get_type\", \"set_type\");\n\t$laListeChamps[]=new dbChamp(\"Cms_title\", \"text\", \"get_title\", \"set_title\");\n\t$laListeChamps[]=new dbChamp(\"Cms_description\", \"text\", \"get_description\", \"set_description\");\n\t$laListeChamps[]=new dbChamp(\"Cms_thumbnail_loc\", \"text\", \"get_thumbnail_loc\", \"set_thumbnail_loc\");\n\t$laListeChamps[]=new dbChamp(\"Cms_file\", \"text\", \"get_file\", \"set_file\");\n\t$laListeChamps[]=new dbChamp(\"Cms_youtube\", \"text\", \"get_youtube\", \"set_youtube\");\n\t$laListeChamps[]=new dbChamp(\"Cms_content_loc\", \"text\", \"get_content_loc\", \"set_content_loc\");\n\t$laListeChamps[]=new dbChamp(\"Cms_player_loc\", \"text\", \"get_player_loc\", \"set_player_loc\");\n\t$laListeChamps[]=new dbChamp(\"Cms_duration\", \"text\", \"get_duration\", \"set_duration\");\n\t$laListeChamps[]=new dbChamp(\"Cms_tag\", \"text\", \"get_tag\", \"set_tag\");\n\t$laListeChamps[]=new dbChamp(\"Cms_category\", \"text\", \"get_category\", \"set_category\");\n\t$laListeChamps[]=new dbChamp(\"Cms_family_friendly\", \"entier\", \"get_family_friendly\", \"set_family_friendly\");\n\t$laListeChamps[]=new dbChamp(\"Cms_cms_site\", \"entier\", \"get_cms_site\", \"set_cms_site\");\n\t$laListeChamps[]=new dbChamp(\"Cms_statut\", \"entier\", \"get_statut\", \"set_statut\");\n\treturn($laListeChamps);\n}",
"public function get_Banco(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n $sql=\"select * from banco;\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }",
"function voirDerniereCommandeAvecFacture(){\n\t$conditions = array();\n\t$order = array();\n\tarray_push($order, array('nameChamps'=>'idFacture','sens'=>'desc'));\n\tarray_push($conditions, array('nameChamps'=>'idFacture','type'=>'is not null','name'=>'','value'=>''));\n\t$req = new myQueryClass('commande',$conditions,$order,'','limit 1');\n\t$r = $req->myQuerySelect();\n\treturn $r[0];\n}",
"public function getCalculos() {\n\n if (count($this->aCalculos) == 0 && !empty($this->iPlanilha)) {\n\n $oDaoBensCalculo = new cl_benshistoricocalculobem();\n $sWhereCalculos = \"t58_benshistoricocalculo = {$this->iPlanilha}\";\n $sSqlBensCalculo = $oDaoBensCalculo->sql_query(null, \"benshistoricocalculobem.*, bens.*, bensdepreciacao.*\", \"t58_sequencial\", $sWhereCalculos);\n $rsBensCaculo = $oDaoBensCalculo->sql_record($sSqlBensCalculo);\n\n if ($oDaoBensCalculo->numrows > 0) {\n\n for ($iCalculo = 0; $iCalculo < $oDaoBensCalculo->numrows; $iCalculo++) {\n\n $oDadosCalculo = db_utils::fieldsMemory($rsBensCaculo, $iCalculo);\n\n $oCalculo = new CalculoBem();\n $oCalculo->setHistoricoCalculo($oDadosCalculo->t58_benshistoricocalculo);\n $oCalculo->setPercentualDepreciado($oDadosCalculo->t58_percentualdepreciado);\n $oCalculo->setSequencial($oDadosCalculo->t58_sequencial);\n $oCalculo->setTipoDepreciacao($oDadosCalculo->t58_benstipodepreciacao);\n $oCalculo->setValorAnterior($oDadosCalculo->t58_valoranterior);\n $oCalculo->setValorAtual($oDadosCalculo->t58_valoratual);\n $oCalculo->setValorCalculado($oDadosCalculo->t58_valorcalculado);\n $oCalculo->setValorResidual($oDadosCalculo->t58_valorresidual);\n $oCalculo->setValorResidualAnterior($oDadosCalculo->t58_valorresidualanterior);\n\n $oBem = new Bem();\n $oBem->setCodigoBem($oDadosCalculo->t52_bem);\n $oBem->setCodigoBemDepreciacao($oDadosCalculo->t44_sequencial);\n $oBem->setTipoDepreciacao( BemTipoDepreciacaoRepository::getPorCodigo($oDadosCalculo->t44_benstipodepreciacao) );\n $oBem->setTipoAquisicao( BemTipoAquisicaoRepository::getPorCodigo($oDadosCalculo->t44_benstipoaquisicao) );\n $oBem->setClassificacao(BemClassificacaoRepository::getPorCodigo($oDadosCalculo->t52_codcla));\n $oBem->setVidaUtil($oDadosCalculo->t44_vidautil);\n $oBem->setValorAquisicao($oDadosCalculo->t52_valaqu);\n $oBem->setValorResidual($oDadosCalculo->t44_valorresidual);\n $oBem->setValorDepreciavel($oDadosCalculo->t44_valoratual);\n $oBem->setVidaUtil($oDadosCalculo->t44_vidautil);\n $oBem->setDescricao($oDadosCalculo->t52_descr);\n\n $oCalculo->setBem($oBem);\n\n array_push($this->aCalculos, $oCalculo);\n }\n }\n\n unset($oDaoBensCalculo);\n unset($rsBensCaculo);\n }\n return $this->aCalculos;\n }",
"function set_detail(){\r\n\t\t\t\r\n\t\t$sql=\"SELECT civilite, nom, prenom, adresse, tel_fixe ,tel_mobile ,email,\r\n\t\t url_site,profil, date_creation, date_derniere_connexion, \r\n\t\t\t\t\t nombre_connexions, mode_acces, date_debut_acces, \r\n\t\t\t\t\t date_fin_acces,login, mdp\r\n\t\t\t FROM les_usagers \r\n\t\t\t WHERE id_usager='$this->id_usager'\";\t \t\t \r\n\r\n\t\t$result = $this->bdd->executer($sql);\r\n\t\t\t\r\n\t\twhile ($ligne = mysql_fetch_assoc($result)) {\r\n\r\n\t\t\t$this->civilite=$ligne['civilite'];\r\n\t\t\t$this->nom=$ligne['nom'];\r\n\t\t\t$this->prenom=$ligne['prenom'];\r\n\t\t\t$this->adresse=$ligne['adresse'];\r\n\t\t\t$this->tel_fixe=$ligne['tel_fixe'];\r\n\t\t\t$this->tel_mobile=$ligne['tel_mobile'];\r\n\t\t\t$this->email=$ligne['email'];\r\n\t\t\t$this->url_site=$ligne['url_site'];\r\n\t\t\t$this->profil=$ligne['profil'];\r\n\t\t\t$this->date_creation = trans_date($ligne['date_creation']);\r\n\t\t\t$this->date_derniere_connexion = trans_date_time($ligne['date_derniere_connexion']);\r\n\t\t\t$this->nombre_connexions = $ligne['nombre_connexions'];\r\n\t\t\t$this->mode_acces = $ligne['mode_acces'];\r\n\t\t\t$this->date_debut_acces = $ligne['date_debut_acces'];\r\n\t\t\t$this->date_fin_acces = $ligne['date_fin_acces'];\r\n\t\t\t$this->login = $ligne['login'];\r\n\t\t\t$this->mdp = $ligne['mdp'];\r\n\r\n\t\t}\r\n\t}",
"function prepare_remito($id_remito,&$filas)\r\n{\r\n while ($filas['cantidad']--)\r\n {\r\n\t$filas[$filas['cantidad']]['id_remito']=$id_remito;\r\n \t$filas[$filas['cantidad']]['descripcion']=\"'\".$filas[$filas['cantidad']]['descripcion'].\"'\";\r\n \tunset($filas[$filas['cantidad']]['subtotal']);\r\n }\r\n unset($filas['cantidad']);\r\n}",
"private function requete_deja_choisi()\r\n\t{\r\n\t\t$liste_eleves = array();\r\n\t\t$req = mysql_query(\"SELECT * FROM binome WHERE nom2 = '\" . $this->login . \"'\");\r\n\t\twhile($data = mysql_fetch_array($req)) {\r\n\t\t\tarray_push($liste_eleves, $data['nom1']);\r\n\t\t}\r\n\t\treturn $liste_eleves;\r\n\t}",
"private function iniciarRecolectarData()\r\n\t\t{\r\n\t\t\tself::findPagoDetalleActividadEconomica();\r\n\t\t\tself::findPagoDetalleInmuebleUrbano();\r\n\t\t\tself::findPagoDetalleVehiculo();\r\n\t\t\tself::findPagoDetalleAseo();\r\n\t\t\tself::findPagoDetallePropaganda();\r\n\t\t\tself::findPagoDetalleEspectaculo();\r\n\t\t\tself::findPagoDetalleApuesta();\r\n\t\t\tself::findPagoDetalleVario();\r\n\t\t\tself::findPagoDetalleMontoNegativo();\r\n\t\t\tself::ajustarDataReporte();\r\n\t\t}",
"function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }",
"function describir_campos($tabla_x,$bd_x=\"\"){\r\n\t\tif($bd_x!=\"\"){\r\n\t\t\t$bd = $bd_x.\".\";\r\n\t\t}#end if\r\n\t\t$query_x = \"SHOW FIELDS FROM \".$bd.$tabla_x;\r\n\t\t$result = mysqli_query($this->conexion,$query_x);\r\n\t\tif($result){\r\n\t\t\t$n_filas = mysqli_num_rows($result);\r\n\t\t\t$this->serial[$tabla_x] = \"\";\r\n\t\t\tfor ($i=0;$i<$n_filas;$i++){\r\n\t\t\t\t$row_x = mysqli_fetch_array($result);\r\n\t\t\t\tif($i==0){\r\n\t\t\t\t\t$this->campo_clave = $row_x[0];\r\n\t\t\t\t}#end if\r\n\t\t\t\t$this->nombre[$i] = $row_x[0];\r\n\t\t\t\t$this->tipo[$i] = $row_x[1];\r\n\t\t\t\tif($row_x[\"Key\"] == \"PRI\"){\r\n\t\t\t\t\t$this->campo_clave = $row_x[0];\r\n\t\t\t\t}#end if\r\n\t\t\t}#end next i\r\n\t\t}#end if result\r\n\t}",
"function GetInfogrupos(){\n\t\t\t$sql =\"SELECT G.grupo, G.salon, G.horario, C.descripcion AS carrera \n\t\t\t\tFROM grupos G INNER JOIN carreras C ON G.carrera = C.codigo;\";\n\t\t\t$this->bd->selectSQL($sql);\n\t\t\tif(!empty($this->bd->rowresult)){\n\t\t\t\treturn $this->bd->rowresult;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}",
"function queryRicercaAvanzata ($info_utente, $hobby){\r\n \r\n // condizione dell'info utente\r\n $cond_info_utente = '';\r\n $cond_hobby = '';\r\n \r\n foreach ($info_utente as $key => $value) {\r\n if($value != 'NULL'){\r\n $cond_info_utente .= $key . '=' . $value . ' AND ';\r\n } \r\n }\r\n \r\n //considero il caso cui siano stati inseriti hobby nella ricerca\r\n //in caso affermativo viene aggiunta la condizione per gli hobby\r\n if(!empty($hobby)){\r\n foreach ($hobby as $key => $value) {\r\n $cond_hobby .= 'tipo_hobby' . '=' . $value . ' OR '; \r\n } \r\n $condizione = (trim($cond_info_utente . '(' . $cond_hobby , 'OR ')) . ')'; \r\n }\r\n // nel caso gli hobby non siano stati inseriti ripulisco la condizione togliendo and finali e \r\n // considero solo come condizione le info utente\r\n else{\r\n $condizione = trim($cond_info_utente , 'AND ');\r\n }\r\n \r\n $sql = 'SELECT email_utente, nickname, utente_esperto, utente_seguito, utente_seguace, path_img_profilo, data_ora_richiesta, ' .\r\n 'richiesta_accettata, data_ora_risposta ' . \r\n 'FROM (utente NATURAL JOIN info_utente ) LEFT OUTER JOIN seguaci_seguiti ' . \r\n 'ON email_utente = utente_seguito AND utente_seguace =' . \r\n \"'\" . $_SESSION['email_utente'] . \"' \" .\r\n 'WHERE email_utente IN (' .\r\n 'SELECT email_utente ' .\r\n 'FROM info_utente NATURAL LEFT OUTER JOIN hobby ' .\r\n 'WHERE ' . $condizione . ')'; \r\n\r\n return $sql;\r\n}",
"public function get_recibo($num, $ser, $carga = '', $referencia = '', $cli = '', $alumno = '', $suc = '', $fecha = '', $sit = '', $fini = '', $ffin = ''){\n $pensum = $this->pensum;\n\n $sql= \"SELECT *, \";\n $sql.= \" (SELECT CONCAT(alu_nombre,' ',alu_apellido) FROM app_alumnos WHERE alu_cui = rec_alumno) as alu_nombre_completo,\";\n //-- subquery grado\n $sql.= \" (SELECT TRIM(gra_descripcion) FROM academ_grado, academ_grado_alumno\";\n $sql.= \" WHERE gra_pensum = $pensum\";\n $sql.= \" AND graa_pensum = gra_pensum\";\n $sql.= \" AND graa_nivel = gra_nivel\";\n $sql.= \" AND graa_grado = gra_codigo\";\n $sql.= \" AND graa_alumno = rec_alumno ORDER BY graa_grado DESC LIMIT 0 , 1) AS alu_grado_descripcion,\";\n //-- subquery seccion\n $sql.= \" (SELECT TRIM(sec_descripcion) FROM academ_secciones,academ_seccion_alumno\";\n $sql.= \" WHERE seca_pensum = $pensum\";\n $sql.= \" AND seca_pensum = sec_pensum\";\n $sql.= \" AND seca_nivel = sec_nivel\";\n $sql.= \" AND seca_grado = sec_grado\";\n $sql.= \" AND seca_seccion = sec_codigo\";\n $sql.= \" AND seca_alumno = rec_alumno ORDER BY seca_seccion LIMIT 0 , 1) AS alu_seccion_descripcion\";\n //--\n $sql.= \" FROM boletas_recibo_boleta,vnt_serie_recibo,fin_cliente,mast_sucursal,fin_moneda\";\n $sql.= \" WHERE rec_serie = ser_codigo\";\n $sql.= \" AND cli_nit = rec_cliente\";\n $sql.= \" AND rec_sucursal = suc_id\";\n $sql.= \" AND mon_id = rec_moneda\"; \n if (strlen($num)>0) {\n $sql.= \" AND rec_numero = $num\";\n }\n if (strlen($ser)>0) {\n $sql.= \" AND rec_serie = $ser\";\n }\n if (strlen($carga)>0) {\n $sql.= \" AND rec_carga = '$carga'\";\n }\n if (strlen($referencia)>0) {\n $sql.= \" AND rec_referencia = '$referencia'\";\n }\n if (strlen($cli)>0) {\n $sql.= \" AND ven_cliente = $cli\";\n }\n if (strlen($alumno)>0) {\n $sql.= \" AND rec_alumno = '$alumno'\";\n }\n if (strlen($suc)>0) {\n $sql.= \" AND rec_sucursal = $suc\";\n }\n if (strlen($fecha)>0) {\n $fecha = $this->regresa_fecha($fecha);\n $sql.= \" AND rec_fecha BETWEEN '$fecha' AND '$fecha'\";\n }\n if ($fini != \"\" && $ffin != \"\") {\n $fini = $this->regresa_fecha($fini);\n $ffin = $this->regresa_fecha($ffin);\n $sql.= \" AND rec_fecha BETWEEN '$fini' AND '$ffin'\";\n }\n if (strlen($sit)>0) {\n $sql.= \" AND rec_situacion = $sit\";\n }\n $sql.= \" ORDER BY rec_sucursal ASC, rec_carga ASC, rec_serie ASC, rec_numero ASC, rec_fecha ASC\";\n\n $result = $this->exec_query($sql);\n //echo $sql;\n return $result;\n }",
"function getNombres() {\n $this->db->beginTransaction();\n $sentencia = $this->db->prepare(\"select id, nombre from carrera\");\n $sentencia->execute();\n $this->db->commit();\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n $sentencia->closeCursor();\n return $resultado;\n }"
] | [
"0.5836682",
"0.57544816",
"0.5717129",
"0.56742936",
"0.5671754",
"0.5653974",
"0.56488687",
"0.56320333",
"0.5631857",
"0.5611364",
"0.55320394",
"0.5529355",
"0.5501364",
"0.5494666",
"0.54777265",
"0.54676735",
"0.54242706",
"0.5420637",
"0.5415435",
"0.540274",
"0.53966314",
"0.53945154",
"0.53882384",
"0.53795546",
"0.5370838",
"0.53621775",
"0.53506476",
"0.5333749",
"0.5324157",
"0.5319519"
] | 0.67104536 | 0 |
Fonction pour verifier si un montant est des decimaux ex. 100.15 ... PARAM : mnt RETURN : BOOLEAN $hasDecimal | function hasDecimalMontant($mnt)
{
$hasDecimal = false;
$mntIAP_Arrondie = ROUND($mnt);
$diff = abs($mnt - $mntIAP_Arrondie);
if ($diff > 0){
$hasDecimal = true;
}
return $hasDecimal;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_decimal( $val )\n {\n return is_numeric( $val ) && floor( $val ) != $val;\n }",
"public static function _decimal($value, $field, $min_decimal = 1, $max_decimal=null) {\n\t\t$regex = '/^-?[0-9]+\\.[0-9]{' . $min_decimal . ',' . $max_decimal . '}$/';\n\t\treturn (bool)preg_match($regex, $value);\n\t}",
"public function getIsDecimal()\n {\n return $this->isDecimal;\n }",
"function _fourD_analysis_validate_decimal( $d ) {\n \n if( is_numeric($d) ){\n \n $rounded = _fourD_analysis_round_decimal($d);\n\n $min = 0.0;\n $max = 1.0;\n $epsilon = 1e-11; // extra bit to satisfy validation check at a 1e-10 decimal precision\n \n // fourD_analysis_debug('_fourD_analysis_validate_decimal('.$d.'); $rounded: '.$rounded.'; $min: '.$min.'; $max: '.$max.'; $epsilon: '.$epsilon );\n\n if( $rounded <= $min + $epsilon ){\n return $min;\n }\n elseif( $rounded >= $max - $epsilon ){\n return $max;\n }\n \n if( $rounded > $min + $epsilon && $rounded < $max - $epsilon ){\n return $rounded;\n }\n }\n return false;\n}",
"function _fourD_analysis_validate_decimal_old( $d ) {\n \n if( is_numeric($d) ){\n \n $min = 0.0;\n $max = 1.0;\n $epsilon = 1e-11; // extra bit to satisfy equality check of a 1e-10 decimal precision\n \n if( $d > $min + $epsilon && $d < $max - $epsilon ){\n return true;\n }\n }\n return false;\n}",
"public function decimalNumber($decimal) {\n\t\t$error = 'The %s is not a valid price.';\n\t\t// check if there is a period\n\t\tif(!strstr($decimal, '.')) {$error .= 1;\n\t\t\t$this->form_validation->set_message('decimalNumber', $error);\n\t\t\treturn false;\n\t\t}\n\t\t// split apart the price by decimal\n\t\t$parts = explode('.', $decimal);\n\t\t// check that there is only one decimal\n\t\tif(count($parts) != 2) {$error .= 2;\n\t\t\t$this->form_validation->set_message('decimalNumber', $error);\n\t\t\treturn false;\n\t\t}\n\t\t// check that before and after the decimal is numeric\n\t\tfor($i = 0; $i < count($parts); $i++) {\n\t\t\tif(!is_numeric($parts[$i])) {$error .= 3;\n\t\t\t\t$this->form_validation->set_message('decimalNumber', $error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// check that there are two digits after the decimal\n\t\t\tif($i == 1 && strlen($parts[$i]) != 2) {$error .= 4;\n\t\t\t\t$this->form_validation->set_message('decimalNumber', $error);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// make it here, the value is fine\n\t\treturn true;\n\t}",
"public static function decimal() {}",
"public function hasAmountsDec()\n {\n return $this->AmountsDec !== null;\n }",
"static function decimal($value){\n\t\t$v = strpos($value, \",\");\n\t\t$p = strpos($value, \".\");\n\t\tif($v === false && $p === false){ // Valor inteiro sem separador de decimal e milhar (nao precisa de tratamento)\n\t\t}elseif($v !== false && $p === false){ // Virgula no separador decimal e sem separador de milhar\n\t\t\t$value = str_replace(\",\", \".\", $value);\n\t\t}elseif($v === false && $p !== false){ // Ponto no separador de decimal e sem separador de milhar (nao precisa de tratamento)\n\t\t}elseif($v > $p){ // Virgula no separador de decimal e ponto no separador de milhar\n\t\t\t$value = str_replace(\".\", \"\", $value);\n\t\t\t$value = str_replace(\",\", \".\", $value);\n\t\t}elseif($p > $v){ // Ponto no separador de decimal e virgula no separador de milhar\n\t\t\t$value = str_replace(\",\", \"\", $value);\n\t\t}\n\t\tif(is_numeric($value)){\n\t\t\treturn $value;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"private function isDecimalCast($cast)\n {\n return 0 === strncmp($cast, 'decimal:', 8);\n }",
"public function testGetDataTableDecimalDataType() {\r\n\t\t// Insert border values into database\r\n\t\t$minvalue = '-9999999999999999999.9999999999';\r\n\t\t$maxvalue = '9999999999999999999.9999999999';\r\n\t\t$this->executeQuery('insert into POTEST (UUID, DECIMAL_VALUE) values (\\'testuuid0\\','.$minvalue.')');\r\n\t\t$this->executeQuery('insert into POTEST (UUID, DECIMAL_VALUE) values (\\'testuuid1\\','.$maxvalue.')');\r\n\t\t// Extract datatable\r\n\t\t$datatable = $this->getPersistenceAdapter()->getDataTable('select DECIMAL_VALUE from POTEST order by UUID');\r\n\t\t$datamatrix = $datatable->getDataMatrix();\r\n\t\t// Check strings for correct conversion\r\n\t\t$this->assertEquals($minvalue, $datamatrix[0][0], 'Minimum decimal value is not converted to string as expected.');\r\n\t\t$this->assertEquals($maxvalue, $datamatrix[1][0], 'Maximum decimal value is not converted to string as expected.');\r\n\t}",
"public function buyDecimalAmount()\n\t{\n\t\treturn false;\n\t}",
"protected function isDecimalCast($cast)\n {\n return strncmp($cast, 'decimal:', 8) === 0;\n }",
"private function hasNumFormat() {\n\t\treturn isset($this->options['num_decimals']);\n\t}",
"protected function validateFloat($value) {\n if (preg_match(\"/^\\-?[0-9]+\\.?[0-9]*$/\", $value))\n return true;\n $this->setError(t(\"Invalid decimal number\"));\n return false;\n }",
"function decimal($number) : float\n{\n\n // return $tmp->trim();\n\n if (0 < \\strlen((string) $number)) {\n $parts = \\explode('.', $number);\n $result = $parts[0];\n\n if (true === isset($parts[1])) {\n if ($r = \\rtrim($parts[1], '0')) {\n $result .= '.' . $r;\n }\n }\n\n return (float) $result;\n }\n\n return 0;\n}",
"public function isAmount($data) {\n\t\t$values = array_values($data);\n\t\tif (!isset($values)) {\n\t\t\treturn false;\n\t\t}\n\t\t$value = $values[0];\n\t\tif (preg_match('/^[0-9]{0,23}+(\\.[0-9]{0,' . Configure::read('Account.decimal_places') . '})?$/', $value)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isAmount($data) {\n\t\t$values = array_values($data);\n\t\tif (!isset($values)) {\n\t\t\treturn false;\n\t\t}\n\t\t$value = $values[0];\n\t\tif (preg_match('/^[0-9]{0,23}+(\\.[0-9]{0,' . Configure::read('Account.decimal_places') . '})?$/', $value)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function decimal($str, $format = NULL)\r\n {\r\n // Create the pattern\r\n $pattern = '/^[0-9]%s\\.[0-9]%s$/';\r\n\r\n if ( ! empty($format))\r\n {\r\n if (count($format) > 1)\r\n {\r\n // Use the format for number and decimal length\r\n $pattern = sprintf($pattern, '{'.$format[0].'}', '{'.$format[1].'}');\r\n }\r\n elseif (count($format) > 0)\r\n {\r\n // Use the format as decimal length\r\n $pattern = sprintf($pattern, '+', '{'.$format[0].'}');\r\n }\r\n }\r\n else\r\n {\r\n // No format\r\n $pattern = sprintf($pattern, '+', '+');\r\n }\r\n\r\n return (bool) preg_match($pattern, (string) $str);\r\n }",
"public function hasDecSpeeddf(){\r\n return $this->_has(28);\r\n }",
"public function hasDecSpeeddf(){\r\n return $this->_has(25);\r\n }",
"public function validFloats() {}",
"public function testShouldReturnAmountDecimal(): void\n {\n $transaction = new Transaction(['amount' => '0000000050028']);\n\n self::assertSame('500.28', $transaction->getAmountDecimal());\n }",
"function getDecimals(): ?int;",
"public function testSaveDataTableDecimalDataType() {\r\n\t\t$minvalue = '-9999999999999999999.9999999999';\r\n\t\t$maxvalue = '9999999999999999999.9999999999';\r\n\t\t// Store datatable\r\n\t\t$datatable = new avorium_core_data_DataTable(2, 2);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'DECIMAL_VALUE');\r\n\t\t$datatable->setCellValue(0, 0, 'testuuid0');\r\n\t\t$datatable->setCellValue(0, 1, $minvalue);\r\n\t\t$datatable->setCellValue(1, 0, 'testuuid1');\r\n\t\t$datatable->setCellValue(1, 1, $maxvalue);\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t\t// Read database via SQL\r\n\t\t$results = $this->executeQuery('select DECIMAL_VALUE from POTEST order by UUID');\r\n\t\t// Compare values\r\n\t\t$this->assertEquals($minvalue, $results[0][0], 'Minimum decimal value is not converted from string as expected.');\r\n\t\t$this->assertEquals($maxvalue, $results[1][0], 'Maximum decimal value is not converted from string as expected.');\r\n\t}",
"public function is_money($price) {\n return preg_match('/^[0-9]+(\\.[0-9]{0,2})?$/', $price);\n }",
"public static function validate_numeric_integer_or_decimal_values($val) { // {{{SYNC-DETECT-PURE-NUMERIC-INT-OR-DECIMAL-VALUES}}}\n\t//--\n\t$val = (string) $val; // do not use TRIM as it may strip out null or weird characters that may inject security issues if not trimmed outside (MUST VALIDATE THE REAL STRING !!!)\n\t//--\n\t$regex_decimal = (string) self::regex_stringvalidation_expression('number-decimal', 'full');\n\t//--\n\tif(((string)$val != '') AND (is_numeric($val)) AND (preg_match((string)$regex_decimal, (string)$val))) { // detect numbers: 0..9 - .\n\t\treturn true; // VALID\n\t} else {\n\t\treturn false; // NOT VALID\n\t} //end if else\n\t//--\n}",
"function validarFlotante ($Cad) {\n// prueba si la entrada es un numero de punto flotante, con un signo opcional\nreturn preg_match(\"/^-?([0-9])+([\\.|,]([0-9])*)?$/\", $Cad );\n}",
"protected function validateUfloat($value) {\n if (preg_match(\"/^[0-9]+\\.?[0-9]*$/\", $value))\n return true;\n $this->setError(t(\"Invalid positive decimal number\"));\n return false;\n }",
"function check_approx_equal_to($num1, $num2, $tolerance=0.1){\r\n //Wide default tolerance due to possible user-side rounding choices\r\n \r\n \r\n $equal = FALSE;\r\n \r\n //echo \"check_approx_equal_to values: $num1 and $num2 <br />\";\r\n \r\n //Ensure that we have floating point numbers\r\n $float1 = floatval($num1);\r\n $float2 = floatval($num2);\r\n \r\n $diff = abs($float1 - $float2);\r\n $avg_mag = abs(($float1 + $float2) / 2.0);\r\n \r\n \r\n \r\n if($diff > (.1 * $avg_mag)){\r\n $equal = FALSE;\r\n }\r\n else{\r\n $equal = TRUE;\r\n }\r\n \r\n return $equal;\r\n }"
] | [
"0.72571033",
"0.66567105",
"0.66440564",
"0.65958655",
"0.65188366",
"0.64843667",
"0.6460818",
"0.6015678",
"0.6007987",
"0.59609187",
"0.59336364",
"0.586818",
"0.5811101",
"0.58083457",
"0.57474077",
"0.5738632",
"0.56050223",
"0.56050223",
"0.5595157",
"0.5590398",
"0.5576523",
"0.5563798",
"0.55434716",
"0.5524178",
"0.55012745",
"0.5489579",
"0.546808",
"0.54596937",
"0.54541796",
"0.539793"
] | 0.83072335 | 0 |
passing negative even number | public function testIsEvenPassNegativeEVEN()
{
$this->assertTrue(isEven(-4));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testIsEvenPassNegativeODD()\n {\n \t$this->assertFalse(isEven(-5));\n }",
"public function clipEvenOdd() {}",
"function isEven($num){\r\n\treturn (is_numeric($num)&(!($num&1)));\r\n}",
"function check_even($n)\n{\n\tif ($n % 2 == 0) {\n\t\techo \"{$n} la so so chan\";\n\t}\n}",
"public function testisEvenNumberFail()\n {\n $result = $this->calculator->isEvenNumber(3);\n $this->assertFalse($result);\n }",
"public function testIsEvenPassZERO()\n {\n \t$this->assertTrue(isEven(0));\n }",
"function odd_even($n) {\n $odd_even = fmod($n, 2);\n if($odd_even == 1) {\n return '_';\n } else {\n return 'true';\n }\n }",
"function neparan($b)\n{\n if($b%2==0)\n {\n return false;\n }\n else\n {\n return true;\n }\n}",
"function is_even (int $value) : bool\n{\n return $value % 2 === 0;\n}",
"function is_even($val) {\n\t\treturn ($val / 2 == floor($val / 2)) ? true : false;\n\t}",
"private static function makeOddEven() {\n\n\t\tif (JudgeView::$even > 0)\n\t\t{\n\t\t\tJudgeView::$even = 0;\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJudgeView::$even = 1;\n\t\t\treturn 1;\n\t\t}\n\n\t}",
"public function testIsEvenNumber()\n\t{\n\t\t$this->assertTrue(ParityGame\\isEvenNumber(2));\n\t\t$this->assertTrue(ParityGame\\isEvenNumber(10));\n\n\t\t$this->assertFalse(ParityGame\\isEvenNumber(7));\n\t\t$this->assertFalse(ParityGame\\isEvenNumber(21));\n\t}",
"function evenOrOdd($number){\n\n\tif($number % 2 == 0){\n\t $number = $number + 10;\n\n\t}else{\n\t $number = $number + 11;\n\t}\n\n\treturn $number;\n\n}",
"function is_odd (int $value) : bool\n{\n return $value % 2 !== 0;\n}",
"function isEven ($input_number) {\n if (round($input_number/2) == ($input_number/2)) {\n return true;\n }\n else { return false; }\n}",
"function isNegative () {\n return (($this->num < 0) xor ($this->denom < 0));\n }",
"function checkEvenOrOdd($value) {\n\t\tif($value % 2 == 0) {\n\t\t\techo 'Even';\n\t\t} else {\n\t\t\techo 'Odd';\n\t\t}\n\t}",
"public function testisEvenNumber()\n {\n $result = $this->calculator->isEvenNumber(2);\n $this->assertTrue($result);\n }",
"public function testIsEvenPassTwo()\n {\n \t$this->assertTrue(isEven(2));\n }",
"function numParImpar($num){\n $bool = true;\n if($num % 2 == 0){\n return true;\n }else{\n return false;\n }\n}",
"public function fillEvenOdd() {}",
"function oddEven($number)\n{\n\t$lastDigit = substr($number, -1, 1);\n\tif($lastDigit == 1 or $lastDigit == 3 or $lastDigit == 5 or $lastDigit == 7 or $lastDigit == 9) { $oddEven = 'odd'; } else { $oddEven = 'even'; }\n\treturn ($oddEven);\n}",
"function isOdd($num){\r\n\treturn (is_numeric($num)&($num&1));\r\n}",
"function isPowerOfTwo($num2)\n {\n if ($num2 === 0) {\n $return = 0;\n }\n while ($num2 != 1) {\n if ($num2 % 2 != 0)\n $return = 0;\n $num2 = $num2 / 2;\n }\n $return = 1;\n }",
"function isOdd ($input_number) {\n if (round($input_number/2) == ($input_number/2)) {\n return false;\n }\n else { return true; }\n}",
"public function even($value): bool\n {\n return is_numeric($value) && (int) $value % 2 === 0;\n }",
"function is_entier($n) {\nreturn ($n>0 || $n=='0');\n}",
"function fpb($a,$b){\n\t\treturn ($b == 0) ? ($a):( fpb($b, $a % $b) );\n\t}",
"function isOddOrEven ($number) {\n $isEven = ($number % 2 == 0);\n echo '<p>Number is ' . ($isEven ? 'even' : 'odd') . '<p>';\n }",
"public function isNegative(): bool;"
] | [
"0.75627023",
"0.67464066",
"0.65400076",
"0.6495227",
"0.64641285",
"0.6453166",
"0.6413785",
"0.6397312",
"0.63316053",
"0.6183513",
"0.6163191",
"0.6133107",
"0.612251",
"0.6113515",
"0.6083003",
"0.5966133",
"0.5951523",
"0.5935128",
"0.5880874",
"0.5804344",
"0.5792571",
"0.5765458",
"0.56889665",
"0.56807727",
"0.5680599",
"0.5675805",
"0.5652743",
"0.56431824",
"0.5640335",
"0.5623891"
] | 0.75731874 | 0 |
passing negative odd number | public function testIsEvenPassNegativeODD()
{
$this->assertFalse(isEven(-5));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testIsEvenPassNegativeEVEN()\n {\n \t$this->assertTrue(isEven(-4));\n }",
"public function clipEvenOdd() {}",
"function is_odd (int $value) : bool\n{\n return $value % 2 !== 0;\n}",
"function odd_even($n) {\n $odd_even = fmod($n, 2);\n if($odd_even == 1) {\n return '_';\n } else {\n return 'true';\n }\n }",
"function isOdd($num){\r\n\treturn (is_numeric($num)&($num&1));\r\n}",
"function isEven($num){\r\n\treturn (is_numeric($num)&(!($num&1)));\r\n}",
"private static function makeOddEven() {\n\n\t\tif (JudgeView::$even > 0)\n\t\t{\n\t\t\tJudgeView::$even = 0;\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJudgeView::$even = 1;\n\t\t\treturn 1;\n\t\t}\n\n\t}",
"function evenOrOdd($number){\n\n\tif($number % 2 == 0){\n\t $number = $number + 10;\n\n\t}else{\n\t $number = $number + 11;\n\t}\n\n\treturn $number;\n\n}",
"function neparan($b)\n{\n if($b%2==0)\n {\n return false;\n }\n else\n {\n return true;\n }\n}",
"function isOdd ($input_number) {\n if (round($input_number/2) == ($input_number/2)) {\n return false;\n }\n else { return true; }\n}",
"function checkEvenOrOdd($value) {\n\t\tif($value % 2 == 0) {\n\t\t\techo 'Even';\n\t\t} else {\n\t\t\techo 'Odd';\n\t\t}\n\t}",
"function check_even($n)\n{\n\tif ($n % 2 == 0) {\n\t\techo \"{$n} la so so chan\";\n\t}\n}",
"function isOddOrEven ($number) {\n $isEven = ($number % 2 == 0);\n echo '<p>Number is ' . ($isEven ? 'even' : 'odd') . '<p>';\n }",
"public function testisEvenNumberFail()\n {\n $result = $this->calculator->isEvenNumber(3);\n $this->assertFalse($result);\n }",
"public function odd($value): bool\n {\n return is_numeric($value) && (int) $value % 2 !== 0;\n }",
"public function fillEvenOdd() {}",
"function oddEven($number)\n{\n\t$lastDigit = substr($number, -1, 1);\n\tif($lastDigit == 1 or $lastDigit == 3 or $lastDigit == 5 or $lastDigit == 7 or $lastDigit == 9) { $oddEven = 'odd'; } else { $oddEven = 'even'; }\n\treturn ($oddEven);\n}",
"function is_even (int $value) : bool\n{\n return $value % 2 === 0;\n}",
"function numParImpar($num){\n $bool = true;\n if($num % 2 == 0){\n return true;\n }else{\n return false;\n }\n}",
"public static function clipEvenOdd()\n {\n return new FlagQualifier(self::CLIP_EVEN_ODD);\n }",
"function oddArray(array $array): int\n {\n $odd = 0;\n\n foreach($array as $number)\n {\n if($number & 1)\n {\n $odd++;\n }\n }\n\n return $odd;\n }",
"function isNegative () {\n return (($this->num < 0) xor ($this->denom < 0));\n }",
"function is_even($val) {\n\t\treturn ($val / 2 == floor($val / 2)) ? true : false;\n\t}",
"public function testIsEvenNumber()\n\t{\n\t\t$this->assertTrue(ParityGame\\isEvenNumber(2));\n\t\t$this->assertTrue(ParityGame\\isEvenNumber(10));\n\n\t\t$this->assertFalse(ParityGame\\isEvenNumber(7));\n\t\t$this->assertFalse(ParityGame\\isEvenNumber(21));\n\t}",
"public function testIsEvenPassZERO()\n {\n \t$this->assertTrue(isEven(0));\n }",
"function isEven ($input_number) {\n if (round($input_number/2) == ($input_number/2)) {\n return true;\n }\n else { return false; }\n}",
"function convertEvenToOdd($number)\n{\n $n = $number;\n if ($n % 2 === 0) {\n $n += 1;\n return $number . \" odd number\";\n }\n return $n . \" odd number\";\n}",
"public function oddMask()\n {\n $low = (-($this->low & 1)) & 0xFFFFFFFF;\n $high = $low;\n return UInt64::newValue($high, $low);\n }",
"private static function isOdd($number)\n {\n return ($number%2) ? true : false;\n }",
"public function uneven( $numeral) {\n\t\t$booleanUneven = ($numeral/2) != 0;\n\t\tswitch ($booleanUneven) {\n\t\t\tcase true:\n\t\t\t\t$this->log($numeral . \" is odd!\");\n\t\t\t\treturn true;\n\t\t\tcase false: \n\t\t\t\t$this->log($numeral . \" is not odd!\");\n\t\t\t\treturn false;\n\t\t}\n\t}"
] | [
"0.7302539",
"0.72618663",
"0.68092835",
"0.6776312",
"0.6746858",
"0.6690784",
"0.6590767",
"0.65474516",
"0.654103",
"0.6454552",
"0.6357149",
"0.6341215",
"0.62869585",
"0.6266048",
"0.6253534",
"0.6225314",
"0.6204725",
"0.6190281",
"0.6145267",
"0.61184764",
"0.611672",
"0.60635746",
"0.60579705",
"0.6054306",
"0.5989178",
"0.59559363",
"0.5936511",
"0.5813849",
"0.5812929",
"0.57674414"
] | 0.7691487 | 0 |
passing zero, assuming that 0 is even number | public function testIsEvenPassZERO()
{
$this->assertTrue(isEven(0));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function makeOddEven() {\n\n\t\tif (JudgeView::$even > 0)\n\t\t{\n\t\t\tJudgeView::$even = 0;\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJudgeView::$even = 1;\n\t\t\treturn 1;\n\t\t}\n\n\t}",
"function isEven($num){\r\n\treturn (is_numeric($num)&(!($num&1)));\r\n}",
"public function testIsEvenPassNegativeEVEN()\n {\n \t$this->assertTrue(isEven(-4));\n }",
"public function testIsEvenPassNegativeODD()\n {\n \t$this->assertFalse(isEven(-5));\n }",
"function is_even (int $value) : bool\n{\n return $value % 2 === 0;\n}",
"public function testIsEvenNumber()\n\t{\n\t\t$this->assertTrue(ParityGame\\isEvenNumber(2));\n\t\t$this->assertTrue(ParityGame\\isEvenNumber(10));\n\n\t\t$this->assertFalse(ParityGame\\isEvenNumber(7));\n\t\t$this->assertFalse(ParityGame\\isEvenNumber(21));\n\t}",
"public function fillEvenOdd() {}",
"function check_even($n)\n{\n\tif ($n % 2 == 0) {\n\t\techo \"{$n} la so so chan\";\n\t}\n}",
"function is_even($val) {\n\t\treturn ($val / 2 == floor($val / 2)) ? true : false;\n\t}",
"function is_odd (int $value) : bool\n{\n return $value % 2 !== 0;\n}",
"function isEven ($input_number) {\n if (round($input_number/2) == ($input_number/2)) {\n return true;\n }\n else { return false; }\n}",
"function evenOrOdd($number){\n\n\tif($number % 2 == 0){\n\t $number = $number + 10;\n\n\t}else{\n\t $number = $number + 11;\n\t}\n\n\treturn $number;\n\n}",
"function checkEvenOrOdd($value) {\n\t\tif($value % 2 == 0) {\n\t\t\techo 'Even';\n\t\t} else {\n\t\t\techo 'Odd';\n\t\t}\n\t}",
"public function clipEvenOdd() {}",
"public function testisEvenNumber()\n {\n $result = $this->calculator->isEvenNumber(2);\n $this->assertTrue($result);\n }",
"public function testisEvenNumberFail()\n {\n $result = $this->calculator->isEvenNumber(3);\n $this->assertFalse($result);\n }",
"function odd_even($n) {\n $odd_even = fmod($n, 2);\n if($odd_even == 1) {\n return '_';\n } else {\n return 'true';\n }\n }",
"public function even($value): bool\n {\n return is_numeric($value) && (int) $value % 2 === 0;\n }",
"function neparan($b)\n{\n if($b%2==0)\n {\n return false;\n }\n else\n {\n return true;\n }\n}",
"public function testIsEvenPassTwo()\n {\n \t$this->assertTrue(isEven(2));\n }",
"function isOdd ($input_number) {\n if (round($input_number/2) == ($input_number/2)) {\n return false;\n }\n else { return true; }\n}",
"function is_not_zero($num){\n\tif($num <= 0){\n\t\treturn 1;\n\t}\n\t\n\treturn $num;\t\n}",
"function isOddOrEven ($number) {\n $isEven = ($number % 2 == 0);\n echo '<p>Number is ' . ($isEven ? 'even' : 'odd') . '<p>';\n }",
"function numParImpar($num){\n $bool = true;\n if($num % 2 == 0){\n return true;\n }else{\n return false;\n }\n}",
"function isOdd($num){\r\n\treturn (is_numeric($num)&($num&1));\r\n}",
"function is_entier($n) {\nreturn ($n>0 || $n=='0');\n}",
"function calEventNum(int $num){\n\n $result = 0 ;\n\n for ($i=1 ,$ii = $num ; $i <= $ii ; $i++){\n if ($i%2 == 0){\n $result++;\n }\n }\n return $result;\n}",
"public function odd($value): bool\n {\n return is_numeric($value) && (int) $value % 2 !== 0;\n }",
"function __return_zero()\n {\n }",
"function oddEven($number)\n{\n\t$lastDigit = substr($number, -1, 1);\n\tif($lastDigit == 1 or $lastDigit == 3 or $lastDigit == 5 or $lastDigit == 7 or $lastDigit == 9) { $oddEven = 'odd'; } else { $oddEven = 'even'; }\n\treturn ($oddEven);\n}"
] | [
"0.682325",
"0.6682445",
"0.6615996",
"0.66006154",
"0.659337",
"0.6520555",
"0.65199983",
"0.64399946",
"0.64177495",
"0.63619536",
"0.6321866",
"0.6252898",
"0.6220042",
"0.61459035",
"0.6125508",
"0.61061996",
"0.6103357",
"0.59718966",
"0.5924956",
"0.5893173",
"0.58754516",
"0.5850596",
"0.58027995",
"0.5800596",
"0.5800409",
"0.5794604",
"0.5747118",
"0.5744126",
"0.57399815",
"0.5738241"
] | 0.75614387 | 0 |
Compile config information Lists developer config variables | protected function _compile_config()
{
$output = "\n\n";
$output .= '<fieldset id="ci_profiler_config" style="border:1px solid #000;padding:6px 10px 10px 10px;margin:20px 0 20px 0;background-color:#eee">';
$output .= "\n";
$output .= '<legend style="color:#000;"> '.$this->CI->lang->line('profiler_config').' (<span style="cursor: pointer;" onclick="var s=document.getElementById(\'ci_profiler_config_table\').style;s.display=s.display==\'none\'?\'\':\'none\';this.innerHTML=this.innerHTML==\''.$this->CI->lang->line('profiler_section_show').'\'?\''.$this->CI->lang->line('profiler_section_hide').'\':\''.$this->CI->lang->line('profiler_section_show').'\';">'.$this->CI->lang->line('profiler_section_show').'</span>)</legend>';
$output .= "\n";
$output .= "\n\n<table style='width:100%; display:none' id='ci_profiler_config_table'>\n";
foreach ($this->CI->config->config as $config=>$val)
{
if (is_array($val)||is_object($val))
{
$val = print_r($val, TRUE);
}
$output .= "<tr><td style='padding:5px; vertical-align: top;color:#900;background-color:#ddd;'>".$config." </td><td style='padding:5px; color:#000;background-color:#ddd;'>".htmlspecialchars($val)."</td></tr>\n";
}
$output .= "</table>\n";
$output .= "</fieldset>";
return $output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testconfig_vars()\n\t{\n\t\t$vars = array ('sys_name',\n\t\t\t 'sys_user_reg_restricted',\n\t\t\t 'sys_require_accept_conditions',\n\t\t\t 'sys_project_reg_restricted',\n\t\t\t 'sys_use_private_project',\n\t\t\t 'sys_default_domain',\n\t\t\t 'sys_scm_tarballs_path',\n\t\t\t 'sys_scm_snapshots_path',\n\t\t\t 'sys_theme',\n\t\t\t 'sys_lang',\n\t\t\t 'sys_default_timezone',\n\t\t\t 'sys_default_country_code',\n\t\t\t 'sys_use_scm',\n\t\t\t 'sys_use_tracker',\n\t\t\t 'sys_use_forum',\n\t\t\t 'sys_use_pm',\n\t\t\t 'sys_use_docman',\n\t\t\t 'sys_use_diary',\n\t\t\t 'sys_use_news',\n\t\t\t 'sys_use_mail',\n\t\t\t 'sys_use_survey',\n\t\t\t 'sys_use_frs',\n\t\t\t 'sys_use_project_tags',\n\t\t\t 'sys_use_project_full_list',\n\t\t\t 'sys_use_fti',\n\t\t\t 'sys_use_ftp',\n\t\t\t 'sys_use_trove',\n\t\t\t 'sys_use_snippet',\n\t\t\t 'sys_use_ssl',\n\t\t\t 'sys_use_people',\n\t\t\t 'sys_use_shell',\n\t\t\t 'sys_use_ratings',\n\t\t\t 'sys_use_ftpuploads',\n\t\t\t 'sys_use_manual_uploads',\n\t\t\t 'sys_use_gateways',\n\t\t\t 'sys_use_project_vhost',\n\t\t\t 'sys_use_project_database',\n\t\t\t 'sys_use_project_multimedia',\n\t\t\t 'sys_download_host',\n\t\t\t 'sys_shell_host',\n\t\t\t 'sys_users_host',\n\t\t\t 'sys_lists_host',\n\t\t\t 'sys_scm_host',\n\t\t\t 'sys_forum_return_domain',\n\t\t\t 'sys_chroot',\n\t\t\t 'sys_upload_dir',\n\t\t\t 'sys_ftp_upload_dir',\n\t\t\t 'sys_ftp_upload_host',\n\t\t\t 'sys_apache_user',\n\t\t\t 'sys_apache_group',\n\t\t\t 'sys_require_unique_email',\n\t\t\t 'sys_bcc_all_email_address',\n\t\t\t 'sys_themeroot',\n\t\t\t 'sys_force_login',\n\t\t\t 'sys_custom_path',\n\t\t\t 'sys_plugins_path',\n\t\t\t 'sys_use_jabber',\n\t\t\t 'sys_jabber_user',\n\t\t\t 'sys_jabber_server',\n\t\t\t 'sys_jabber_port',\n\t\t\t 'sys_jabber_pass',\n\t\t\t 'sys_ldap_host',\n\t\t\t 'sys_ldap_port',\n\t\t\t 'sys_ldap_version',\n\t\t\t 'sys_ldap_base_dn',\n\t\t\t 'sys_ldap_bind_dn',\n\t\t\t 'sys_ldap_admin_dn',\n\t\t\t 'sys_ldap_passwd',\n\t\t\t 'sys_news_group',\n\t\t\t 'sys_stats_group',\n\t\t\t 'sys_peer_rating_group',\n\t\t\t 'sys_template_group',\n\t\t\t 'sys_sendmail_path',\n\t\t\t 'sys_path_to_mailman',\n\t\t\t 'sys_path_to_jpgraph',\n\t\t\t 'sys_account_manager_type',\n\t\t\t 'unix_cipher',\n\t\t\t 'homedir_prefix',\n\t\t\t 'groupdir_prefix',\n\t\t\t 'sys_urlroot',\n\t\t\t 'sys_urlprefix',\n\t\t\t 'sys_images_url',\n\t\t\t 'sys_images_secure_url',\n\t\t\t 'sys_admin_email',\n\t\t\t 'sys_session_key',\n\t\t\t 'sys_session_expire',\n\t\t\t 'sys_show_source',\n\t\t\t 'default_trove_cat',\n\t\t\t 'sys_dbhost',\n\t\t\t 'sys_dbport',\n\t\t\t 'sys_dbname',\n\t\t\t 'sys_dbuser',\n\t\t\t 'sys_dbpasswd',\n\t\t\t 'sys_share_path',\n\t\t\t 'sys_var_path',\n\t\t\t 'sys_etc_path',\n\t\t\t) ;\n\n\t\t$pattern = implode ('|', $vars) ;\n\t\t\n\t\t$root = dirname(dirname(dirname(dirname(__FILE__))));\n\t\t$output = `cd $root ; find src tests -name '*.php' -type f | xargs pcregrep -n '\\\\$($pattern)\\b(?! *=[^=])' \\\n\t\t\t\t\t | grep -v ^src/common/include/config-vars.php`;\n\t\t$this->assertEquals('', $output, \"Found deprecated \\$var for var in ($pattern):\");\n\n\t\t$output = `cd $root ; find src tests -name '*.php' -type f | xargs pcregrep -n '\\\\\\$GLOBALS\\\\[.?($pattern).?\\\\](?! *=[^=])' \\\n\t\t\t\t\t | grep -v ^src/common/include/config-vars.php`;\n\t\t$this->assertEquals('', $output, \"Found deprecated \\$GLOBALS['\\$var'] for var in ($pattern):\");\n\t}",
"protected function declareConfig(){\n\n $output = '';\n \n foreach( $this->getConfig() as $key => $value ){\n \n $output .= $key . '=' . json_encode( $value ) . ';';\n \n }\n \n return $output;\n\n }",
"function getConfiguration() ;",
"public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}",
"function getInfo()\n {\n return array(\n 'releasetypes' => array('php', 'extsrc', 'extbin', 'bundle'),\n 'installable' => true,\n 'locationconfig' => false,\n 'honorsbaseinstall' => true,\n 'unusualbaseinstall' => false,\n 'phpfile' => false,\n 'executable' => false,\n 'phpextension' => false,\n );\n }",
"static function plInfo()\n {\n return array(\n \"plShortName\" => _(\"Argonaut Mirror settings\"),\n \"plDescription\" => _(\"Argonaut Mirror settings\").\" (\"._(\"Services\").\")\",\n \"plIcon\" => \"plugins/argonaut/images/iconMiniMirrorConfig.png\",\n\n \"plProvidedAcls\" => parent::generatePlProvidedAcls(self::getAttributesInfo())\n );\n }",
"function getConfigurationValues() ;",
"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 infosConfig(){\n $get_configuration_infos = \\App\\Helpers\\ConfigurationHelper\\Configuration::get_configuration_infos(1);\n return $get_configuration_infos;\n }",
"function compile_compile_config($variable, &$object)\r{\r\t$_result\t= \"\";\r\r\t// remove the beginning and ending #\r\t$variable = substr($variable, 1, -1);\r\r\t// get [foo] and .foo and (...) pieces\t\t\t\r\tpreg_match_all('!(?:^\\w+)|(?:' . $object->_var_bracket_regexp . ')|\\.\\$?\\w+|\\S+!', $variable, $_match);\r\t$variable = $_match[0];\r\t$var_name = array_shift($variable);\r\r\t$_result = \"\\$this->_confs['$var_name']\";\r\tforeach ($variable as $var)\r\t{\r\t\tif ($var{0} == '[')\r\t\t{\r\t\t\t$var = substr($var, 1, -1);\r\t\t\tif (is_numeric($var))\r\t\t\t{\r\t\t\t\t$_result .= \"[$var]\";\r\t\t\t}\r\t\t\telseif ($var{0} == '$')\r\t\t\t{\r\t\t\t\t$_result .= \"[\" . $object->_compile_variable($var) . \"]\";\r\t\t\t}\r\t\t\telseif ($var{0} == '#')\r\t\t\t{\r\t\t\t\t$_result .= \"[\" . $object->_compile_config($var) . \"]\";\r\t\t\t}\r\t\t\telse\r\t\t\t{\r\t\t\t\t$_result .= \"['$var']\";\r\t\t\t}\r\t }\r\t else if ($var{0} == '.')\r\t {\r \t\t\t\tif ($var{1} == '$')\r\t\t\t{\r \t\t\t\t$_result .= \"[\\$this->_TPL['\" . substr($var, 2) . \"']]\";\r\t\t\t}\r\t \t\telse\r\t\t\t{\r\t\t \t\t$_result .= \"['\" . substr($var, 1) . \"']\";\r\t\t\t}\r\t\t}\r\t\telse if (substr($var,0,2) == '->')\r\t\t{\r\t\t\tif(substr($var,2,2) == '__')\r\t\t\t{\r\t\t\t\t$object->trigger_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);\r\t\t\t}\r\t\t\telse if (substr($var, 2, 1) == '$')\r\t\t\t{\r\t\t\t\t$_output .= '->{(($var=$this->_TPL[\\''.substr($var,3).'\\']) && substr($var,0,2)!=\\'__\\') ? $_var : $this->trigger_error(\"cannot access property \\\\\"$var\\\\\"\")}';\r\t\t\t}\r\t\t}\r\t\telse\r\t\t{\r\t\t\t$object->trigger_error('#' . $var_name.implode('', $variable) . '# is an invalid reference', E_USER_ERROR, __FILE__, __LINE__);\r\t\t}\r\t}\r\treturn $_result;\r}",
"function processConfiguration() ;",
"private function LoadConstants()\r\n\t{\r\n\t\t$data_config = $this->LoadData('application/data/appconfig.xml','config');\r\n\t\t\r\n\t\tif(!defined(\"NEW_LINE\"))\r\n\t\t\tdefine(\"NEW_LINE\",\"\\n\");\r\n\t\t\t\r\n\t\tforeach ($data_config AS $elem)\r\n\t\t{\r\n\t\t\tif(!defined(strtoupper('sitename')))\r\n\t\t\t\tdefine(strtoupper('sitename'),$elem->getElementsByTagName('sitename')->item(0)->nodeValue);\r\n\t\t\t\t\r\n\t\t\tif(!defined(strtoupper('tagline')))\r\n\t\t\t\tdefine(strtoupper('tagline'),$elem->getElementsByTagName('tagline')->item(0)->nodeValue);\r\n\t\t\t\t\r\n\t\t\tif(!defined(strtoupper('ownername')))\t\r\n\t\t\t\tdefine(strtoupper('ownername'),$elem->getElementsByTagName('ownername')->item(0)->nodeValue);\r\n\t\t\t\t\r\n\t\t\tif(!defined(strtoupper('owneremail')))\t\r\n\t\t\t\tdefine(strtoupper('owneremail'),$elem->getElementsByTagName('owneremail')->item(0)->nodeValue);\r\n\t\t\t\t\r\n\t\t\tif(!defined(strtoupper('appversion')))\r\n\t\t\t\tdefine(strtoupper('appversion'),$elem->getElementsByTagName('appversion')->item(0)->nodeValue);\r\n\t\t\t\r\n\t\t\t$path = $elem->getElementsByTagName('paths');\r\n\t\t\tif($path->length > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach ($path AS $nested)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!defined(strtoupper('application')))\r\n\t\t\t\t\t\tdefine(strtoupper('application'),$nested->getElementsByTagName('application')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('controls')))\r\n\t\t\t\t\t\tdefine(strtoupper('controls'),$nested->getElementsByTagName('controls')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('data')))\r\n\t\t\t\t\t\tdefine(strtoupper('data'),$nested->getElementsByTagName('data')->item(0)->nodeValue);\r\n\r\n\t\t\t\t\tif(!defined(strtoupper('templates')))\r\n\t\t\t\t\t\tdefine(strtoupper('templates'),$nested->getElementsByTagName('templates')->item(0)->nodeValue);\r\n\r\n\t\t\t\t\tif(!defined(strtoupper('navigation')))\n\t\t\t\t\t\tdefine(strtoupper('navigation'),$nested->getElementsByTagName('navigation')->item(0)->nodeValue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('navigationdata')))\n\t\t\t\t\t\tdefine(strtoupper('navigationdata'),$nested->getElementsByTagName('navigationdata')->item(0)->nodeValue);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('modules')))\r\n\t\t\t\t\t\tdefine(strtoupper('modules'),$nested->getElementsByTagName('modules')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('pages')))\r\n\t\t\t\t\t\tdefine(strtoupper('pages'),$nested->getElementsByTagName('pages')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('public')))\r\n\t\t\t\t\t\tdefine(strtoupper('public'),$nested->getElementsByTagName('public')->item(0)->nodeValue);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif(!defined(strtoupper('logs')))\r\n\t\t\t\t\t\tdefine(strtoupper('logs'),$nested->getElementsByTagName('logs')->item(0)->nodeValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tunset($data_config);\r\n\t}",
"public static function config();",
"public function buildConfigurationSummary();",
"protected function getEditableConfigNames() {\n return ['d8_demo.weather_config'];\n }",
"private static function print_log_configs() {\n\t//--\n\tglobal $configs;\n\t//--\n\t$log = '<div class=\"smartframework_debugbar_status smartframework_debugbar_status_head\"><font size=\"4\"><b>Application :: CONFIGURATION Log</b></font></div>';\n\t//-- vars\n\t$log .= '<div class=\"smartframework_debugbar_status smartframework_debugbar_status_highlight\" style=\"width:450px;\"><b>App CONFIG VARIABLES</b></div>';\n\t$arr = (array) $configs;\n\tksort($arr);\n\t$i=0;\n\t$j=0;\n\tforeach((array)$arr as $key => $val) {\n\t\t//--\n\t\t$i++;\n\t\t//--\n\t\t$log .= '<table cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">';\n\t\t$log .= '<tr valign=\"top\" title=\"#'.$i.'\"><td width=\"195\"><div class=\"smartframework_debugbar_inforow\">';\n\t\t$log .= '<b>'.Smart::escape_html((string)$key).'</b>';\n\t\t$log .= '</div></td><td><div class=\"smartframework_debugbar_inforow\">';\n\t\tif(is_array($val)) {\n\t\t\t$log .= '<table width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" border=\"0\" style=\"font-size:13px;\">';\n\t\t\t$j=0;\n\t\t\tforeach($val as $k => $v) {\n\t\t\t\t$j++;\n\t\t\t\tif($j % 2) {\n\t\t\t\t\t$color = '#FFFFFF';\n\t\t\t\t} else {\n\t\t\t\t\t$color = '#FAFAFA';\n\t\t\t\t} //end if else\n\t\t\t\t$log .= '<tr bgcolor=\"'.$color.'\" valign=\"top\" title=\"#'.$i.'.'.$j.'\"><td width=\"290\"><b>'.Smart::escape_html((string)$k).'</b></td><td>'.SmartMarkersTemplating::prepare_nosyntax_html_template(Smart::nl_2_br(Smart::escape_html(self::print_value_by_type($v))), true).'</td></tr>';\n\t\t\t} //end foreach\n\t\t\t$log .= '</table>';\n\t\t} else {\n\t\t\t$log .= '<pre>'.SmartMarkersTemplating::prepare_nosyntax_html_template(Smart::escape_html((string)$val), true).'</pre>';\n\t\t} //end if else\n\t\t$log .= '</div></td></tr>';\n\t\t$log .= '</table>';\n\t\t//--\n\t} //end while\n\t//-- constants\n\t$log .= '<div class=\"smartframework_debugbar_status smartframework_debugbar_status_highlight\" style=\"width:450px;\"><b>App SETTING CONSTANTS</b></div>';\n\t$arr = (array) get_defined_constants(true);\n\t$arr = (array) $arr['user'];\n\tksort($arr);\n\t$i=0;\n\t$j=0;\n\tforeach((array)$arr as $key => $val) {\n\t\t//--\n\t\t$i++;\n\t\t//--\n\t\tif(((string)$key == 'SMART_FRAMEWORK_CHMOD_DIRS') OR ((string)$key == 'SMART_FRAMEWORK_CHMOD_FILES')) {\n\t\t\tif(is_numeric($val)) {\n\t\t\t\t$val = (string) '0'.@decoct($val).' (octal)';\n\t\t\t} else {\n\t\t\t\t$val = (string) $val.' (!!! Warning, Invalid ... Must be OCTAL !!!)';\n\t\t\t} //end if\n\t\t} //end if\n\t\t//--\n\t\t$log .= '<table cellspacing=\"0\" cellpadding=\"2\" width=\"100%\">';\n\t\t$log .= '<tr valign=\"top\" title=\"#'.$i.'\"><td width=\"375\"><div class=\"smartframework_debugbar_inforow\"><b>'.Smart::escape_html((string)$key).'</b></div></td><td><div class=\"smartframework_debugbar_inforow\">'.SmartMarkersTemplating::prepare_nosyntax_html_template(Smart::nl_2_br(Smart::escape_html(self::print_value_by_type($val))), true).'</div></td></tr>';\n\t\t$log .= '</table>';\n\t\t//--\n\t} //end while\n\t//--\n\treturn $log;\n\t//--\n}",
"public function ovpnDisplayConfig()\n {\n $readArr = unserialize(file_get_contents(\"./vpn/ovpn.array.config\"));\n foreach ($readArr as $key=>$value) {\n echo \"$key = $value<br />\\n\";\n }\n }",
"function display()\n\t{\n\t\tJToolBarHelper::title(JText::_('JOOMLAPACK').':: <small><small>'.JText::_('CONFIGURATION').'</small></small>');\n\t\tJToolBarHelper::apply();\n\t\tJToolBarHelper::save();\n\t\tJToolBarHelper::cancel();\n\t\tJoomlapackHelperUtils::addLiveHelp('config');\n\t\t$document =& JFactory::getDocument();\n\t\t$document->addStyleSheet(JURI::base().'components/com_joomlapack/assets/css/joomlapack.css');\n\n\t\t// Load the util helper\n\t\t$this->loadHelper('utils');\n\n\t\t// Load the model\n\t\t$model =& $this->getModel();\n\n\t\t// Pass on the lists\n\t\t$this->assign('backuptypelist',\t\t\t\t$model->getBackupTypeList());\n\t\t$this->assign('loglevellist',\t\t\t\t$model->getLogLevelList() );\n\t\t$this->assign('sqlcompatlist',\t\t\t\t$model->getSqlCompatList() );\n\t\t$this->assign('algolist',\t\t\t\t\t$model->getAlgoList() );\n\t\t$this->assign('listerlist',\t\t\t\t\t$model->getFilelistEngineList() );\n\t\t$this->assign('dumperlist',\t\t\t\t\t$model->getDatabaseEngineList() );\n\t\t$this->assign('archiverlist',\t\t\t\t$model->getArchiverEngineList() );\n\t\t$this->assign('installerlist',\t\t\t\t$model->getInstallerList() );\n\t\t$this->assign('backupmethodlist',\t\t\t$model->getBackupMethodList() );\n\t\t$this->assign('authlist',\t\t\t\t\t$model->getAuthLevelList() );\n\n\t\t// Let's pass the data\n\t\t// -- Common Basic\n\t\t$this->assign('OutputDirectory',\t\t\t$model->getVar('OutputDirectoryConfig') );\n\t\t// -- Common Frontend\n\t\t$this->assign('enableFrontend',\t\t\t\t$model->getVar('enableFrontend') );\n\t\t$this->assign('secretWord',\t\t\t\t\t$model->getVar('secretWord') );\n\t\t$this->assign('frontendemail',\t\t\t\t$model->getVar('frontendemail') );\n\t\t$this->assign('arbitraryfeemail',\t\t\t$model->getVar('arbitraryfeemail'));\n\t\t// -- Basic\n\t\t$this->assign('BackupType',\t\t\t\t\t$model->getVar('BackupType') );\n\t\t$this->assign('TarNameTemplate',\t\t\t$model->getVar('TarNameTemplate') );\n\t\t$this->assign('logLevel',\t\t\t\t\t$model->getVar('logLevel') );\n\t\t$this->assign('authlevel',\t\t\t\t\t$model->getVar('authlevel') );\n\t\t$this->assign('cubeinfile',\t\t\t\t\t$model->getVar('cubeinfile') );\n\t\t// -- Advanced\n\t\t$this->assign('MySQLCompat', \t\t\t\t$model->getVar('MySQLCompat') );\n\t\t$this->assign('dbAlgorithm',\t\t\t\t$model->getVar('dbAlgorithm') );\n\t\t$this->assign('packAlgorithm', \t\t\t\t$model->getVar('packAlgorithm') );\n\t\t$this->assign('listerengine', \t\t\t\t$model->getVar('listerengine') );\n\t\t$this->assign('dbdumpengine', \t\t\t\t$model->getVar('dbdumpengine') );\n\t\t$this->assign('packerengine', \t\t\t\t$model->getVar('packerengine') );\n\t\t$this->assign('InstallerPackage',\t\t\t$model->getVar('InstallerPackage') );\n\t\t$this->assign('backupMethod', \t\t\t\t$model->getVar('backupMethod') );\n\t\t$this->assign('minexectime',\t\t\t\t$model->getVar('minexectime'));\n\t\t$this->assign('enableSizeQuotas',\t\t\t$model->getVar('enableSizeQuotas') );\n\t\t$this->assign('enableCountQuotas',\t\t\t$model->getVar('enableCountQuotas') );\n\t\t$this->assign('sizeQuota',\t\t\t\t\t$model->getVar('sizeQuota') );\n\t\t$this->assign('countQuota',\t\t\t\t\t$model->getVar('countQuota') );\n\t\t$this->assign('enableMySQLKeepalive',\t\t$model->getVar('enableMySQLKeepalive') );\n\t\t$this->assign('gzipbinary',\t\t\t\t\t$model->getVar('gzipbinary'));\n\t\t$this->assign('effvfolder',\t\t\t\t\t$model->getVar('effvfolder'));\n\t\t$this->assign('dereferencesymlinks',\t\t$model->getVar('dereferencesymlinks'));\n\t\t$this->assign('splitpartsize',\t\t\t\t$model->getVar('splitpartsize'));\n\t\t// -- Magic numbers\n\t\t$this->assign('mnRowsPerStep', \t\t\t\t$model->getVar('mnRowsPerStep') );\n\t\t$this->assign('mnMaxFragmentSize',\t\t\t$model->getVar('mnMaxFragmentSize') );\n\t\t$this->assign('mnMaxFragmentFiles', \t\t$model->getVar('mnMaxFragmentFiles') );\n\t\t$this->assign('mnZIPForceOpen',\t\t\t\t$model->getVar('mnZIPForceOpen') );\n\t\t$this->assign('mnZIPCompressionThreshold',\t$model->getVar('mnZIPCompressionThreshold') );\n\t\t$this->assign('mnZIPDirReadChunk',\t\t\t$model->getVar('mnZIPDirReadChunk') );\n\t\t$this->assign('mnMaxExecTimeAllowed',\t\t$model->getVar('mnMaxExecTimeAllowed') );\n\t\t$this->assign('mnMinimumExectime',\t\t\t$model->getVar('mnMinimumExectime') );\n\t\t$this->assign('mnExectimeBiasPercent',\t\t$model->getVar('mnExectimeBiasPercent') );\n\t\t$this->assign('mnMaxOpsPerStep',\t\t\t$model->getVar('mnMaxOpsPerStep') );\n\t\t$this->assign('mnArchiverChunk',\t\t\t$model->getVar('mnArchiverChunk') );\n\t\t// -- MySQLDump\n\t\t$this->assign('mysqldumpPath',\t\t\t\t$model->getVar('mysqldumpPath') );\n\t\t$this->assign('mnMSDDataChunk',\t\t\t\t$model->getVar('mnMSDDataChunk') );\n\t\t$this->assign('mnMSDMaxQueryLines',\t\t\t$model->getVar('mnMSDMaxQueryLines') );\n\t\t$this->assign('mnMSDLinesPerSession',\t\t$model->getVar('mnMSDLinesPerSession') );\n\t\t// -- DirectFTP\n\t\t$this->assign('df_host',\t\t\t\t\t$model->getVar('df_host') );\n\t\t$this->assign('df_port',\t\t\t\t\t$model->getVar('df_port') );\n\t\t$this->assign('df_user',\t\t\t\t\t$model->getVar('df_user') );\n\t\t$this->assign('df_pass',\t\t\t\t\t$model->getVar('df_pass') );\n\t\t$this->assign('df_initdir',\t\t\t\t\t$model->getVar('df_initdir') );\n\t\t$this->assign('df_usessl',\t\t\t\t\t$model->getVar('df_usessl') );\n\t\t$this->assign('df_passive',\t\t\t\t\t$model->getVar('df_passive') );\n\n\t\t// Also load the Configuration HTML helper\n\t\t$this->loadHelper('config');\n\t\tparent::display();\n\t}",
"function get_debug() {\n $rd = CRand::Instance();\n $html = \"<h2>Debuginformation</h2><hr><p>The content of the config array:</p><pre>\" . htmlentities(print_r($rd->config, true)) . \"</pre>\";\n $html .= \"<hr><p>The content of the data array:</p><pre>\" . htmlentities(print_r($rd->data, true)) . \"</pre>\";\n $html .= \"<hr><p>The content of the request array:</p><pre>\" . htmlentities(print_r($rd->request, true)) . \"</pre>\";\n return $html;\n}",
"public function getConfig() {\r\n\r\n\t}",
"public function build() {\n $config = $this->getConfiguration();\n return [\n '#theme' => 'helloadvanced',\n '#text' => isset($config['text']) ? $config['text'] : NULL,\n '#person' => isset($config['person']) ? $config['person'] : NULL,\n '#session' => isset($config['session']) ? $config['session'] : NULL,\n ];\n }",
"protected function getEditableConfigNames()\n {\n return ['config.view_card'];\n }",
"function config()\n\t{\n\t\t$rows=$GLOBALS['SITE_DB']->query_select('pstore_customs',array('*'),NULL,'ORDER BY id');\n\t\t$out=array();\n\t\tforeach ($rows as $i=>$row)\n\t\t{\n\t\t\t$fields=new ocp_tempcode();\n\t\t\t$hidden=new ocp_tempcode();\n\t\t\t$fields->attach($this->get_fields('_'.strval($i),get_translated_text($row['c_title']),get_translated_text($row['c_description']),$row['c_enabled'],$row['c_cost'],$row['c_one_per_member']));\n\t\t\t$fields->attach(do_template('FORM_SCREEN_FIELD_SPACER',array('TITLE'=>do_lang_tempcode('ACTIONS'))));\n\t\t\t$fields->attach(form_input_tick(do_lang_tempcode('DELETE'),do_lang_tempcode('DESCRIPTION_DELETE'),'delete_custom_'.strval($i),false));\n\t\t\t$hidden->attach(form_input_hidden('custom_'.strval($i),strval($row['id'])));\n\t\t\t$out[]=array($fields,$hidden,do_lang_tempcode('EDIT_CUSTOM_PRODUCT'));\n\t\t}\n\n\t\treturn array($out,do_lang_tempcode('ADD_NEW_CUSTOM_PRODUCT'),$this->get_fields());\n\t}",
"public function localConfig();",
"private function generateConfig() {\n $config_json = array(\n 'version' => '1.0.0',\n 'name' => $this->gateway_name,\n 'description' => '',\n 'authors' => [],\n 'currencies' => ['USD'],\n 'signup_url' => 'https://google.com'\n );\n\n foreach($config_json as $key => $value) {\n if($key == 'authors' && isset($this->config['authors'])) {\n foreach($this->config[\"authors\"] as $config_author) {\n $config_entry = array(\n \"name\" => \"\",\n \"url\" => \"\"\n );\n \n if(isset($config_author['name'])) {\n $config_entry[\"name\"] = $config_author['name'];\n \n if(isset($config_author[\"url\"])) {\n $config_entry[\"url\"] = $config_author['url'];\n }\n $config_json[\"authors\"][] = $config_entry;\n }\n }\n }\n else {\n if(isset($this->config[$key])) {\n $config_json[$key] = $this->config[$key];\n }\n }\n }\n\n return json_encode($config_json);\n }",
"protected static function config()\n {\n return [\n 'view' => ['viewRenderClass' => 'Ice:Php', 'layout' => ''],\n 'input' => [\n 'resources' => [\n 'default' => [\n 'modules' => [\n 'Ice' => [\n 'vendor_js' => [\n 'path' => 'js/vendor/',\n 'js' => ['-modernizr-2.8.3.min.js'],\n 'css' => [],\n 'isCopy' => false,\n ],\n 'vendor_css' => [\n 'path' => 'css/vendor/',\n 'js' => [],\n 'css' => ['empty.css'],\n 'isCopy' => false,\n ],\n 'vendor' => [\n 'path' => 'vendor/',\n 'js' => [],\n 'css' => [],\n 'isCopy' => false,\n ],\n 'common' => [\n 'path' => '',\n 'js' => [],\n 'css' => ['css/flags.css', 'css/preloader.css'],\n 'isCopy' => false,\n ],\n 'module' => [\n 'path' => 'Ice/',\n 'js' => ['Helper/String.js', 'Ui/Form.js', 'Ui/Menu.js', 'Ui/Data.js'],\n 'css' => [],\n 'isCopy' => false,\n ],\n ],\n ],\n// 'vendors' => [\n// 'jquery/jquery-ui' => [\n// 'jquery' => [\n// 'path' => '/',\n// 'js' => ['external/jquery/jquery.js', '-jquery-ui.min.js'],\n// 'css' => ['-jquery-ui.min.css', '-jquery-ui.structure.min.css', '-jquery-ui.theme.min.css'],\n// 'isCopy' => true,\n// ],\n// ],\n// 'twbs/bootstrap' => [\n// 'bootstrap' => [\n// 'path' => 'dist/',\n// 'js' => ['-js/bootstrap.min.js'],\n// 'css' => ['-css/bootstrap.min.css', '-css/bootstrap-theme.min.css'],\n// 'isCopy' => true,\n// 'css_replace' => ['url(../', 'url('],\n// ],\n// ],\n// ],\n ],\n ],\n 'js' => ['default' => []],\n 'css' => ['default' => []],\n 'routeName' => ['default' => ''],\n 'context' => ['default' => '/resource/']\n ],\n 'ttl' => 3600\n ];\n }",
"public function build_config_ui($host, $context = null) {\n\t\t\t$this->host = $host;\n\t\t\t\n\t\t\t$this->host->add_field('test_mode', 'Developer Mode')->tab('Configuration')->renderAs(frm_onoffswitcher)->comment('Use the Purolator E-Ship Development Environment to try out API requests.', 'above', true);\n\n\t\t\t$this->host->add_field('billing_account_number', 'Billing Account Number', 'left')->tab('API Credentials')->comment('Required by Purolator, but no billing methods are used yet.', 'above')->renderAs(frm_text)->validation()->required('Please specify your Billing Account Number');\n\t\t\t\n\t\t\tif($context !== 'preview') {\n\t\t\t\t$this->host->add_field('api_key', 'Key', 'left')->tab('API Credentials')->comment('Purolator key.', 'above')->renderAs(frm_text)->validation()->required('Please specify API user name');\n\t\t\t\t$this->host->add_field('api_key_password', 'Key Password', 'right')->tab('API Credentials')->comment('Purolator key password.', 'above')->renderAs(frm_password)->validation();\n\t\t\t}\n\n\t\t\t$this->host->add_field('container', 'Container Type', 'left')->tab('Shipping Parameters')->renderAs(frm_dropdown)->validation()->required('Please specify container type');\n\t\t\t$this->host->add_field('pickup_type', 'Pickup Type', 'right')->tab('Shipping Parameters')->renderAs(frm_dropdown)->validation()->required('Please specify pickup type');\n\t\t\t$this->host->add_field('allowed_methods', 'Allowed methods')->tab('Shipping Parameters')->renderAs(frm_checkboxlist)->validation();\n\t\t\t$this->host->add_field('min_weight', 'Minimum Item Weight')->tab('Shipping Parameters')->comment('Minimum weight for one package. Purolator requires a minimum weight of 1 lb per item.', 'above')->renderAs(frm_text)->validation()->fn('trim')->required('Please specify a minimum weight.')->float();\n\t\t\t$this->host->add_field('max_weight', 'Maximum Item Weight')->tab('Shipping Parameters')->comment('Maximum weight for one package. Purolator requires a maximum weight of 150 lb per item.', 'above')->renderAs(frm_text)->validation()->fn('trim')->required('Please specify a maximum weight')->float();\t\n\t\t\t\n\t\t\t$this->host->add_field('free_shipping_enabled', 'Enable free shipping option')->tab('Free Shipping')->renderAs(frm_checkbox)->validation();\n\t\t\t$this->host->add_field('free_shipping_option', 'Free shipping method')->tab('Free Shipping')->renderAs(frm_dropdown)->validation();\n\t\t\t$this->host->add_field('free_shipping_min_amount', 'Minimum order amount for free shipping', 'full', $type = db_number)->tab('Free Shipping')->renderAs(frm_text)->validation();\n\t\t}",
"function info()\n\t{\n\t\t$info=array();\n\t\t$info['supports_advanced_import']=false;\n\t\t$info['product']='phpBB 3.0.x';\n\t\t$info['prefix']='phpbb_';\n\t\t$info['import']=array(\n\t\t\t\t\t\t\t\t'custom_comcode',\n\t\t\t\t\t\t\t\t'ocf_groups',\n\t\t\t\t\t\t\t\t'ocf_custom_profile_fields',\n\t\t\t\t\t\t\t\t'ocf_members',\n\t\t\t\t\t\t\t\t'ocf_member_files',\n\t\t\t\t\t\t\t\t'ocf_forums',\n\t\t\t\t\t\t\t\t'ocf_topics',\n\t\t\t\t\t\t\t\t'attachments',\n\t\t\t\t\t\t\t\t'ocf_posts',\n\t\t\t\t\t\t\t\t'ocf_polls_and_votes',\n\t\t\t\t\t\t\t\t//'notifications', Actually this is read tracking, not for notifications\n\t\t\t\t\t\t\t\t'ocf_personal_topics',\n\t\t\t\t\t\t\t\t'ocf_warnings',\n\t\t\t\t\t\t\t\t'wordfilter',\n\t\t\t\t\t\t\t\t'bookmarks',\n\t\t\t\t\t\t\t\t'config',\n\t\t\t\t\t\t\t\t'ip_bans',\n\t\t\t\t\t\t\t\t'friends',\n\t\t\t\t\t\t\t\t'reported_posts_forum',\n\t\t\t\t\t\t\t);\n\t\t$info['dependencies']=array( // This dependency tree is overdefined, but I wanted to make it clear what depends on what, rather than having a simplified version\n\t\t\t\t\t\t\t\t'attachments'=>array('ocf_members'),\n\t\t\t\t\t\t\t\t'ocf_warnings'=>array('ocf_members','ocf_posts'),\n\t\t\t\t\t\t\t\t'ocf_members'=>array('ocf_groups','ocf_custom_profile_fields'),\n\t\t\t\t\t\t\t\t'ocf_member_files'=>array('ocf_members'),\n\t\t\t\t\t\t\t\t'ocf_forums'=>array('ocf_members','ocf_groups'),\n\t\t\t\t\t\t\t\t'ocf_custom_profile_fields'=>array('ocf_groups'),\n\t\t\t\t\t\t\t\t'ocf_topics'=>array('ocf_forums','ocf_members'),\n\t\t\t\t\t\t\t\t'ocf_polls_and_votes'=>array('ocf_topics','ocf_members'),\n\t\t\t\t\t\t\t\t'ocf_posts'=>array('ocf_topics','ocf_members','attachments'),\n\t\t\t\t\t\t\t\t'notifications'=>array('ocf_topics','ocf_members'),\n\t\t\t\t\t\t\t\t'ocf_personal_topics'=>array('ocf_members','attachments'),\n\t\t\t\t\t\t\t\t'friends'=>array('ocf_members'),\n\t\t\t\t\t\t\t\t'bookmarks'=>array('ocf_members','ocf_topics'),\n\t\t\t\t\t\t\t\t'reported_posts_forum'=>array('ocf_members','ocf_topics','ocf_posts'),\n\t\t\t\t\t\t\t);\n\t\t$_cleanup_url=build_url(array('page'=>'admin_cleanup'),get_module_zone('admin_cleanup'));\n\t\t$cleanup_url=$_cleanup_url->evaluate();\n\t\t$info['message']=(get_param('type','misc')!='import' && get_param('type','misc')!='hook')?new ocp_tempcode():do_lang_tempcode('FORUM_CACHE_CLEAR',escape_html($cleanup_url));\n\n\t\treturn $info;\n\t}",
"public static function DEBUG_PRINT()\n {\n $self = new self;\n $debug = [\n 'Service_Endpoint' => $self->getServiceEndpoint(),\n 'App_key' => $self->getAppKey(),\n 'App_Secret' => $self->getSecretKey(),\n 'Server_URL' => $self->SERVER_URL\n ];\n\n echo \"<h1> Print our all configuration </h1>\";\n echo \"<br>\";\n\n foreach ($debug as $key => $value) {\n echo \"My \" . $key . ' is ' . $value . \"<br>\";\n }\n }",
"private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\t\t\t\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = 'Specials products';\r\n }\r\n $response = Configuration::updateValue('FIELD_SPECIALPLS_NBR', 6);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_TITLE', $title);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_VERTICAL', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_COLUMNITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MAXITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MEDIUMITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MINITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLLDELAY', 4000);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAGINATION', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_NAVIGATION', 0);\r\n\r\n return $response;\r\n }"
] | [
"0.6280962",
"0.6214347",
"0.5860661",
"0.5859436",
"0.58045435",
"0.57924974",
"0.57888675",
"0.57886624",
"0.5590653",
"0.5568784",
"0.55463225",
"0.5545489",
"0.5538961",
"0.55326027",
"0.5529021",
"0.5523924",
"0.5517575",
"0.5516098",
"0.55001366",
"0.5478547",
"0.546973",
"0.5460478",
"0.5436637",
"0.5417954",
"0.53963256",
"0.539512",
"0.53815687",
"0.53713334",
"0.5356068",
"0.5351617"
] | 0.6259492 | 1 |
end of testAutoSubmit() FUNCTION: CREATE FROM ARRAY / This function creates a set of radio buttons from a hash array. This can be used to generate quick radio buttons, but there are some specialty sets below that are commonly used using those specialty sets should be even faster for common tasks. Autosubmit doesn't work yet, so only feed two arguments for now. | public static function createFromArray() {
$args = func_get_args();
switch (count($args)) {
case 2:
$buttonset = $args[0];
$array = $args[1];
$auto = 0; // don't auto-submit
break;
case 3:
$buttonset = $args[0];
$array = $args[1];
$atuo = DropDownList::testAutoSubmit($args[2]);
break;
}
// Check to see if a choice has been made previously or is a session variable
$choice = RadioButton::getChoice($buttonset);
// Create the radio button set...
if ($choice == -1) { // No choice made -- user prompted to select
while (list($key, $value) = each ($array)) {
echo "<INPUT type=\"radio\" name=\"$buttonset\" value=\"$key\"> $value<BR>";
} // end of while loop
}
else { // prior choice made -- select that value
while (list($key, $value) = each ($array)) {
if ($key == $choice) { echo "<INPUT type=\"radio\" name=\"$buttonset\" value=\"$key\" checked> $value<BR>"; }
else { echo "<INPUT type=\"radio\" name=\"$buttonset\" value=\"$key\"> $value<BR>"; }
} // end of while loop
}
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRadios($hiddenName, $outerIndex)\n{\n\t// Loop through and generate all radio buttons, giving unique names \n\tfor($i = 1; $i <= 4; $i++)\n\t{\n\t\t$id = \"radio\" . $outerIndex . $i;\n\t\t$name = \"radio\" . $outerIndex;\n\t\t\n\t\tif(isset($_REQUEST[$name]))\n\t\t\t$currentSelected = $_REQUEST[$name];\n\t\telse\n\t\t\t$currentSelected = \"\";\n\t\t\n\t\techo \"<p>\\n\";\n\t\t$checked = (strcmp($currentSelected, $id) == 0) ? \"checked\" : \"\";\n\t\techo \"<input type=\\\"radio\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$id\\\" $checked>\\n\";\n\t\t\n\t\tif($i == 1)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/egypt.jpg\\\"/>\\n\";\n\t\telse if($i == 2)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/disney.jpg\\\"/>\\n\";\n\t\telse if($i == 3)\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/theater_masks.jpg\\\"/>\\n\";\n\t\telse\n\t\t\techo \"<img class=\\\"thumb\\\" src=\\\"pictures/wookie.jpg\\\"/>\\n\";\n\t\t\n\t\techo \"</p>\\n\";\n\t}\n}",
"function create_radio($values = array('16', '24'), $name = 'pace') {\n\n\t// Start the element:\n\tforeach ($values as $value) {\n\t\techo '<input type=\"radio\" name=\"' . $name .'\" value=\"' . $value . '\"';\n\n\t\t// Check for stickiness:\n\t\tif (isset($_POST[$name]) && ($_POST[$name] == $value)) {\n\t\t\techo ' checked=\"checked\"';\n\t\t}\n\n\t// Complete the element:\n\techo \"> $value hrs/week \";\n\t} // End of foreach loop.\n\n}",
"function isubmit_multi($array, $label, $confirm = false, $class = false, $id = false)\r\n{\r\n $name = 'multi_var';\r\n $value = ret_multivar($array);\r\n\r\n isubmit($name, $value, $label, $confirm, $class, $id);\r\n}",
"private function _output_options_radios($arr, $name) {\n\t\t$output = '';\n\t\tforeach ($arr as $val => $opt) :\n\t\t\t$slug = $this->_make_slug($opt);\n\t\t\t$output .= '\n\t\t\t\t\t\t<input type=\"radio\" name=\"' . $name . '[]\" value=\"' . $val . '\" id=\"' . $slug . '\"';\n\t\t\t$output .= $this->form['markup'] === 'xhtml' ? ' />' : '>';\n\t\t\t$output .= '\n\t\t\t\t\t\t<label for=\"' . $slug . '\">' . $opt . '</label>';\n\t\tendforeach;\n\t\treturn $output;\n\t}",
"function form_radio_yn($name, $array='', $yes='0', $empty='0', $extra='', $value_y = 1, $value_n = 0) {\n\n\tif ($array) {\n\t\t$name = $array . \"[\" . $name . \"]\";\n\t}\n\n\t$id = 'radio_yn' . $name . $array;\n\n\t$html = \"<div style=\\\"white-space: nowrap;\\\">\";\n\n\tif ($empty) {\n\t\tif ($yes == \"1\") {\n\t\t\t$html .= \"<label for=\\\"either_$id\\\">Either:</label> <input id=\\\"either_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"xxxNULLxxx\\\" $extra>\\n\";\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" checked=\\\"checked\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" $extra />\\n\";\n\t\t} elseif ($yes == \"0\") {\n\t\t\t$html .= \"<label for=\\\"either_$id\\\">Either:</label> <input id=\\\"either_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"xxxNULLxxx\\\" $extra>\\n\";\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" checked=\\\"checked\\\" $extra />\\n\";\n\t\t} else {\n\t\t\t$html .= \"<label for=\\\"either_$id\\\">Either:</label> <input id=\\\"either_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"xxxNULLxxx\\\" checked=\\\"checked\\\" $extra>\\n\";\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" $extra />\\n\";\n\t\t}\n\t} else {\n\t\tif ($yes) {\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" checked=\\\"checked\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" $extra />\\n\";\n\t\t} else {\n\t\t\t$html .= \"<label for=\\\"yes_$id\\\">Yes:</label> <input id=\\\"yes_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_y\\\" $extra />\\n\";\n\t\t\t$html .= \"<label for=\\\"no_$id\\\">No:</label> <input id=\\\"no_$id\\\" type=\\\"radio\\\" name=\\\"$name\\\" value=\\\"$value_n\\\" checked=\\\"checked\\\" $extra />\\n\";\n\t\t}\n\t}\n\n\t$html .= \"</div>\";\n\n\treturn $html;\n}",
"function option_radiobutton($label, $name, $value='', $keys, $comment='') {\r\n\t\techo \"<tr valign='top'><th scope='row'>\" . $label . \"</th>\";\r\n\t\techo \"<td>\";\r\n\r\n\t\tforeach ((array)$keys as $key => $description) {\r\n\t\t\tif ($key == $value)\r\n\t\t\t\t$checked = \"checked\";\r\n\t\t\telse\r\n\t\t\t\t$checked = \"\";\r\n\t\t\techo \"<input type='radio' id='$name' name='$name' value='\" . htmlentities($key, ENT_QUOTES, 'UTF-8') . \"' $checked />\" . $description . \"<br>\";\r\n\t\t}\r\n\t\techo $comment . \"<br>\";\r\n\t\techo \"</td></tr>\";\r\n\t}",
"function mk_radio( $myTitle, $myName, $myValue, $myChek1, $myChek2, $myDesc1, $myDesc2 ){\n\t#initialize needed variables\n\t$str = $chekd1 = $chekd2 = '';\n\n\tif ($myValue == $myChek1) { $chekd1 = \"checked='checked'\"; }else{$chekd2 = \"checked='checked'\";}\n\n\t$str .= '<div class=\"row hoverHighlight\">\n\t\t\t<div class=\"col-sm-3 text-right text-muted\">\n\t\t\t\t<p class=\"text-right\">\n\t\t\t\t\t<strong>' . ucwords($myTitle) . ': </strong>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t<p>';\n\t\t\t\t$str .= \"<label>\n\t\t\t\t\t<input type='radio' value='{$myChek1}' name='{$myName}' {$chekd1}> {$myDesc1} </label>\n\t\t\t\t\t<input type='radio' value='{$myChek2}' name='{$myName}' {$chekd2}> {$myDesc2} </label>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\";\n\n\treturn $str;\n}",
"function ipal_make_instructor_form(){\r\nglobal $ipal;\r\n$myform=\"<form action=\\\"?\".$_SERVER['QUERY_STRING'].\"\\\" method=\\\"post\\\">\\n\";\r\n\t$myform .= \"\\n\";\r\n\t\tforeach(ipal_get_questions() as $items){\r\n$myform .= \"<input type=\\\"radio\\\" name=\\\"question\\\" value=\\\"\".$items['id'].\"\\\" />\";\r\n\r\n$myform .=\"<a href=\\\"show_question.php?qid=\".$items['id'].\"&id=\".$ipal->id.\"\\\" target=\\\"_blank\\\">[question]</a>\";\r\n$myform .= \"<a href=\\\"standalone_graph.php?id=\".$items['id'].\"&ipalid=\".$ipal->id.\"\\\" target=\\\"_blank\\\">[graph]</a>\".$items['question'].\"<br /><br />\\n\";\r\n\t\t}\r\nif(ipal_check_active_question()){\r\n\t$myform .= \"<input type=\\\"submit\\\" value=\\\"Send Question\\\" />\\n</form>\\n\";\r\n}else{\r\n$myform .= \"<input type=\\\"submit\\\" value=\\\"Start Polling\\\" />\\n</form>\\n\";}\r\n\r\n\treturn($myform);\r\n}",
"function form_radio($name, $value, $start='', $extra='', $array='', $id='') {\n\n\t$value = html_form_escape($value, $override);\n\n\tif ($array != \"\") {\n\t\t$name = $array . \"[\" . $name . \"]\";\n\t}\n\n\tif (!$id) {\n\t\t$id = $name;\n\t}\n\n\tif ($start) {\n\t\treturn \"<input type=\\\"radio\\\" name=\\\"$name\\\" id=\\\"$id\\\" value=\\\"$value\\\" checked=\\\"checked\\\" $extra />\";\n\t} else {\n\t\treturn \"<input type=\\\"radio\\\" name=\\\"$name\\\" id=\\\"$id\\\" value=\\\"$value\\\" $extra />\";\n\t}\n}",
"public function create()\n {\n $buttons = [\n [\n \"name\" => \"舍得茶馆\",\n \"sub_button\" => [\n [\n \"type\" => \"view\",\n \"name\" => \"节目预告\",\n \"url\" => \"http://www.soso.com/\"\n ],\n [\n \"type\" => \"view\",\n \"name\" => \"在线购票\",\n \"url\" => \"http://ming.cure4.net/getseats/1\"\n ],\n [\n \"type\" => \"view\",\n \"name\" => \"往期集锦\",\n \"url\" => \"http://v.qq.com/\"\n ],\n ],\n ],\n ];\n// $buttons = [\n// [\n// \"type\" => \"click\",\n// \"name\" => \"茶文雅集\",\n// \"key\" => \"CHA_WEN_YA_JI\",\n// \"sub_button\" => [\n// [\n// \"type\" => \"view\",\n// \"name\" => \"敬请期待\",\n// \"url\" => \"http://ming.cure4.net/getseats/1\"\n// ],\n// [\n// \"type\" => \"view\",\n// \"name\" => \"敬请期待\",\n// \"url\" => \"http://ming.cure4.net/getseats/1\"\n// ],\n//// [\n//// \"type\" => \"view\",\n//// \"name\" => \"微杂志\",\n//// \"url\" => \"http://www.soso.com/\"\n//// ],\n//// [\n//// \"type\" => \"view\",\n//// \"name\" => \"掌柜说\",\n//// \"url\" => \"http://v.qq.com/\"\n//// ],\n//// [\n//// \"type\" => \"click\",\n//// \"name\" => \"文章搜索\",\n//// \"key\" => \"V1001_GOOD\"\n//// ],\n// ],\n//\n// ],\n// [\n// \"type\" => \"click\",\n// \"name\" => \"舍得茶馆\",\n// \"key\" => \"SHE_DE_CHA_GUAN\",\n// \"sub_button\" => [\n// [\n// \"type\" => \"view\",\n// \"name\" => \"节目预告\",\n// \"url\" => \"http://ming.cure4.net/getseats/1\"\n// ],\n// [\n// \"type\" => \"view\",\n// \"name\" => \"在线购票\",\n// \"url\" => \"http://ming.cure4.net/getseats/1\"\n// ],\n// [\n// \"type\" => \"view\",\n// \"name\" => \"往期集锦\",\n// \"key\" => \"http://ming.cure4.net/getseats/1\"\n// ],\n// ],\n// ],\n// [\n// \"type\" => \"click\",\n// \"name\" => \"茗品荟萃\",\n// \"key\" => \"MING_PIN_HUI_CUI\",\n// \"sub_button\" => [\n// [\n// \"type\" => \"view\",\n// \"name\" => \"敬请期待\",\n// \"url\" => \"http://ming.cure4.net/getseats/1\"\n// ],\n// [\n// \"type\" => \"view\",\n// \"name\" => \"敬请期待\",\n// \"url\" => \"http://ming.cure4.net/getseats/1\"\n// ],\n//// [\n//// \"type\" => \"view\",\n//// \"name\" => \"在线商城\",\n//// \"url\" => \"http://www.soso.com/\"\n//// ],\n//// [\n//// \"type\" => \"view\",\n//// \"name\" => \"本月推荐\",\n//// \"url\" => \"http://v.qq.com/\"\n//// ],\n//// [\n//// \"type\" => \"click\",\n//// \"name\" => \"寻茶记\",\n//// \"key\" => \"V1001_GOOD\"\n//// ],\n// ],\n// ],\n// ];\n $this->menu->add($buttons);\n }",
"function buildQuiz() {\n for ($i = 0; $i <= 9; $i++) {\n $randomNumbers = getRandomNumbers();\n $correctAnswer = getCorrectAnswer($randomNumbers);\n $answers = getRandomAnswers($correctAnswer);\n $quiz[] = [\n \"leftAdder\" => $randomNumbers[0],\n \"rightAdder\" => $randomNumbers[1],\n \"correctAnswer\" => $correctAnswer,\n \"firstIncorrectAnswer\" => $answers[0],\n \"secondIncorrectAnswer\" => $answers[1],\n ];\n }\n return $quiz;\n}",
"function radio_button($object, $field, $tag_value, $options = array()) {\n $form = new FormHelper($object, $field);\n return $form->to_radio_button_tag($tag_value, $options);\n}",
"function tep_mod_select_option($select_array, $key_name, $key_value) {\n reset($select_array);\n while (list($key, $value) = each($select_array)) {\n if (is_int($key)) $key = $value;\n $string .= '<br><input type=\"radio\" name=\"configuration[' . $key_name . ']\" value=\"' . $key . '\"';\n if ($key_value == $key) $string .= ' CHECKED';\n $string .= '> ' . $value;\n }\n\n return $string;\n}",
"protected function generateButtons() {}",
"function acf_get_radio_input($attrs = array())\n{\n}",
"public function testRadioGroup()\n {\n $form = new class extends Formulaic\\Post {};\n $form[] = (new Formulaic\\Radio\\Group(\n 'test',\n [1 => 'foo', 2 => 'bar']\n ))->isRequired();\n yield assert($form->valid() != true);\n $_POST['test'] = 1;\n $form = new class extends Formulaic\\Post {};\n $form[] = (new Formulaic\\Radio\\Group(\n 'test',\n [1 => 'foo', 2 => 'bar']\n ))->isRequired();\n yield assert($form->valid());\n yield assert(\"$form\" == <<<EOT\n<form action=\"\" method=\"post\">\n<div>\n<label for=\"test-1\"><input checked id=\"test-1\" name=\"test\" required=\"1\" type=\"radio\" value=\"1\"> foo</label>\n<label for=\"test-2\"><input id=\"test-2\" name=\"test\" required=\"1\" type=\"radio\" value=\"2\"> bar</label>\n</div>\n</form>\nEOT\n );\n }",
"public function generate($name, $value, $attributes = array()) {\r\n\t\t$this->init($name, $value, $attributes);\r\n\t\t\r\n\t\t$vmode = false;\r\n\t\tif(isset($this->attributes['vmode'])){\r\n\t\t\t$vmode = $this->attributes['vmode'];\r\n\t\t\tunset($this->attributes['vmode']);\r\n\t\t}\r\n\r\n\t\t$attTmp = array();\r\n\t\t$attTmp['name'] = $name;\r\n\t\t$attTmp['type'] = 'radio';\r\n\t\t\r\n\t\tif(isset($this->attributes['disabled']) && $this->attributes['disabled']){\r\n\t\t\t$attTmp['disabled'] = 'disabled';\t\r\n\t\t}\r\n\t\t// @TODO this not work corectlly in IE\r\n\t\tif(isset($this->attributes['readonly']) && $this->attributes['readonly']){\r\n\t\t\t$attTmp['onclick'] = 'return false';\r\n\t\t}\r\n\r\n\t\t$tmp = '';\r\n\t\t$check = false;\r\n\t\tforeach ($this->data as $val => $txt){\r\n\t\t $attTmp['id'] = uniqid();\r\n\t\t\t$attTmp['value'] = $val;\r\n\t\t\t\r\n\t\t\tif($value == $val || (!$value && !$check)){\r\n\t\t\t\t$attTmp['checked'] = 'checked';\r\n\t\t\t\t$check = true;\r\n\t\t\t}\r\n\t\t\t$tmp .= BASIC_GENERATOR::init()->element('div', 'style='.(!$vmode ? '' : '').'|class=radioBox_Item',//float:left|\r\n\t\t\t\tBASIC_GENERATOR::init()->createCloseTag('input', $attTmp).' <label for=\"'.$attTmp['id'].'\" class=\"radioBox_label\">'.$txt.'</label>'\r\n\t\t\t);\r\n\t\t\tunset($attTmp['checked']);\r\n\t\t}\r\n\t\t$this->attributes = BASIC_GENERATOR::init()->convertStringAtt($this->attributes);\r\n\t\tif(isset($this->attributes['id'])){\r\n\t\t\t$name = $this->attributes['id'];\r\n\t\t}\r\n\t\tif(isset($this->attributes['class'])){\r\n\t\t\t$this->attributes['class'] .= ' radioBox '.$name;\r\n\t\t}else{\r\n\t\t\t$this->attributes['class'] = 'radioBox '.$name;\r\n\t\t}\r\n\t\treturn BASIC_GENERATOR::init()->element('div', $this->attributes, $tmp);\r\n\t}",
"function radioButtonList($name,$values,$labels,$selected=\"\",$ids)\n\t{\n\t\t$name = $name;\n\n\t\t$str = '<div class=\"radioButton-list\" >';\n\n\t\tfor($i = 0; $i < sizeof($values); $i++){\n\t\t\tif($values[$i] == $selected){\n\t\t\t\t$str .= FormComponent::radioButton($name, $values[$i], $values[$i], $ids[$i], $labels[$i]);\n\t\t\t}else{\n\t\t\t\t$str .= FormComponent::radioButton($name, $values[$i], \"\", $ids[$i], $labels[$i]);\n\t\t\t}\n\t\t}\n\n\t\t$str .= '</div>';\n\n\t\treturn $str;\n\t}",
"function create_mcq($question_set, $question_text, $answer_list, $answer_key) {\n $question = array();\n $question['type'] = '1';\n $question['answer_list'] = $answer_list;\n $question['answer_key'] = $answer_key;\n $question_set['el_set'][] = $question;\n return $question_set;\n}",
"public function callback_radio( $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 $html .= sprintf( '<label for=\"wpuf-%1$s[%2$s]\">', $name_id, $key );\n $html .= sprintf( '<input type=\"radio\" class=\"radio\" id=\"wpuf-%1$s[%2$s]\" name=\"%1$s\" value=\"%2$s\" %3$s %4$s/>', $name_id, $key, checked( $value, $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 displayTheQuestions($questions) {\n\tif (count($questions) > 0) {\n\t\tforeach ($questions as $key => $value) {\n\t\t\techo \"<b>$value[0]</b><br/><br/>\";\n\t\t\t\n\t\t\t// Break the choices appart into a choice array\n\t\t\t$choices = explode(\",\",$value[1]);\n\t\t\t\n\t\t\t// For each choice, create a radio button as part of that questions radio button group\n\t\t\t// Each radio will be the same group name (in this case the question number) and have\n\t\t\t// a value that is the first letter of the choice.\n\t\t\t\n\t\t\tforeach($choices as $value) {\n\t\t\t\t$letter = substr(trim($value),0,1);\n\t\t\t\techo \"<input type=\\\"radio\\\" name=\\\"$key\\\" value=\\\"$letter\\\">$value<br/>\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"<br/>\";\n\t\t}\n\t}\n\telse { echo \"No questions to display.\"; }\n}",
"function drawMultiRadioBoxes($baseName,$selectedItem, $items, $valueColumnName, $titleColumnName, $options=null) {\n\n\t\t$sortBy = $options['sortBy'];\n\t\tif (!$sortBy)\n\t\t\t$sortBy = 'value';\n\t\t\n\t\t$optionType = $options['type'];\n\t\tif ($optionType=='radio' or empty($optionType)) {\n\t\t\t$optionType = 'radio';\n\t\t} else {\n\t\t\t$baseName.='[]';\n\t\t}\n\t\t\n\t\t//echo $optionType;\n\t\t\n\t\tif (!is_array($selectedItem))\n\t\t\t$selectedItems[] = $selectedItem;\n\t\telse\n\t\t\t$selectedItems = $selectedItem;\n\t\t\n\t\t$displayMode = $options['displayMode'];\n\t\tif (!$displayMode)\n\t\t\t$displayMode = 'table';\n\t\t\n\t\t$template['table'] = array(\n\t\t\t'mainWrapper' => '<table %wrapperAttributes%>%contents%</table>',\n\t\t\t'contents' => '<tr>%fields%</tr>',\n\t\t\t'fields' => '<td>%field%</td>',\n\t\t\t'defaultAttributes' => array(\n\t\t\t\t'border' => 0,\n\t\t\t),\n\t\t);\n\t\t$template['normal'] = array(\n\t\t\t'mainWrapper' => '<p>%contents%</p>',\n\t\t\t'contents' => '%fields%',\n\t\t\t'fields' => '%field%<br />',\n\t\t\t'defaultAttributes' => array(\n\t\t\t\t'border' => 0,\n\t\t\t),\n\t\t);\n\t\t\n\t\tif (is_array($options[$displayMode])){\n\t\t\t$attributes = array_merge($template[$displayMode]['defaultAttributes'], $options[$displayMode]);\n\t\t\t$wrapperAttributes = cmfcHtml::attributesToHtml($attributes);\n\t\t}\n\t\telseif (is_string($options[$displayMode]))\n\t\t\t$wrapperAttributes = $options[$displayMode];\n\t\t\n\t\tif (is_array($options['inputAttributes']))\n\t\t\t$inputAttributes = cmfcHtml::attributesToHtml($options['inputAttributes']);\n\t\telseif (is_string($options['inputAttributes']))\n\t\t\t$inputAttributes = $options['inputAttributes'];\n\t\t\n\t\t$numColumns = $options['columns'];\n\t\tif (!$numColumns)\n\t\t\t$numColumns = 5;\n\t\t\n\t\tif (is_string($items)){\n\t\t\t$items = cmfcMySql::getRowsCustom($items);\n\t\t}\n\t\t\n\t\t$counter = 0;\n\t\t$contents = '';\n\t\tif (is_array($items)){\n\t\t\t//cmfcHtml::printr($items);\n\t\t\tswitch ($sortBy){\n\t\t\tcase 'title':\n\t\t\t\t$items = cmfcArray::sortItems($items, $titleColumnName, 'asc');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'value':\n\t\t\t\t$items = cmfcArray::sortItems($items, $valueColumnName, 'asc');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$items = cmfcArray::sortItems($items, $valueColumnName, 'asc');\n\t\t\t}\n\t\t\t//cmfcHtml::printr($items);\n\t\t\t//cmfcHtml::printr( $options);\n\t\t\tforeach ($items as $item) {\n\t\t\t\t//cmfcHtml::printr($item);\n\t\t\t\t//echo $numColumns;\n\t\t\t\t$counter ++;\n\t\t\t\t\n\t\t\t\tif (in_array($item[$valueColumnName], $selectedItems) )\n\t\t\t\t\t$checked='checked=\"checked\"';\n\t\t\t\telse \n\t\t\t\t\t$checked='';\n\t\t\t\t\n\t\t\t\tif (in_array($optionType, array('checkbox', 'radio')) ){\n\t\t\t\t\t$value = $item[$valueColumnName];\n\t\t\t\t\t$field = '<input '.$inputAttributes.\n\t\t\t\t\t\t'name=\"'.$baseName.'\" id=\"'.$baseName.$counter.'\" type=\"'.$optionType.'\" value=\"'.$value.'\" '.$checked.'> <label for=\"'.$baseName.$counter.'\">';\n\t\t\t\t\t\n\t\t\t\t\tif(is_array($options['strongItems']))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array($value, $options['strongItems'])) {\n\t\t\t\t\t\t\t$itemTitleColumnName = \"<b>\".$item[$titleColumnName].\"</b>\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$itemTitleColumnName = $item[$titleColumnName];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$itemTitleColumnName = $item[$titleColumnName];\n\t\t\t\t\t}\n\t\t\t\t\t$field .= $itemTitleColumnName;\n\t\t\t\t\t$field .= '</label>';\n\t\t\t\t}\n\t\t\t\telseif ($optionType == 'custom'){\n\t\t\t\t\tif ($checked)\n\t\t\t\t\t\t$tag = $options['tag']['selected'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$tag = $options['tag']['notSelected'];\n\t\t\t\t\t\n\t\t\t\t\t$value = $item[$titleColumnName];\n\t\t\t\t\t$tag = str_replace('%value%', $value, $tag);\n\t\t\t\t\t$tag = str_replace('%inputAttributes%', $inputAttributes, $tag);\n\t\t\t\t\t\n\t\t\t\t\t$field = $tag;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= str_replace('%field%', $field, $template[$displayMode]['fields']);\n\t\t\t\t\n\t\t\t\tif ($counter % $numColumns == 0) {\n\t\t\t\t\t$contents .= str_replace('%fields%', $html, $template[$displayMode]['contents']);\n\t\t\t\t\t$html = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($html){\n\t\t\t\t$contents .= str_replace('%fields%', $html, $template[$displayMode]['contents']);\n\t\t\t}\n\t\t\t$result = str_replace('%contents%', $contents, $template[$displayMode]['mainWrapper']);\n\t\t}\n\t\telse{\n\t\t\t$result = 'no valid items';\n\t\t}\n\t\treturn $result;\n\t}",
"private function build_radio_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_as_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true, $_has_pricing_rules = \"no\") {\r\n $html = ''; \r\n $has_field_rules = isset( $_meta[\"field_rules\"] ) && is_array( $_meta[\"field_rules\"] ) && count( $_meta[\"field_rules\"] ) != 0 ? \"yes\" : \"no\";\r\n if ($_show_as_value == \"no\") {\r\n /* For admin field, we don't need <ul> wrapper */\r\n if ($_ptype != \"wccaf\") {\r\n $html = '<ul class=\"' . ((isset($_meta['layout']) && $_meta['layout'] == \"horizontal\") ? \"wccpf-field-layout-horizontal\" : \"wccpf-field-layout-vertical\") . '\" ' . $_cloneable . '>';\r\n }\r\n $choices = explode(\";\", ((isset($_meta[\"choices\"]) && ! empty($_meta[\"choices\"])) ? $_meta[\"choices\"] : \"\"));\r\n $_meta[\"default_value\"] = (isset($_meta[\"default_value\"]) && ! empty($_meta[\"default_value\"])) ? trim($_meta[\"default_value\"]) : \"\";\r\n foreach ($choices as $choice) {\r\n $attr = '';\r\n $key_val = explode(\"|\", $choice);\r\n /* It has to be two items ( Value => Label ), otherwise don't proceed */\r\n if (count($key_val) == 2) {\r\n if ($_ptype != \"wccaf\") {\r\n /* Since version 2.0.0 - Default value will be absolute value not as key|val pair */\r\n if (strpos($_meta[\"default_value\"], \"|\") !== false) {\r\n /* Compatibility for <= V 1.4.0 */\r\n if ($choice == $_meta[\"default_value\"]) {\r\n $attr = 'checked=\"checked\"';\r\n }\r\n } else {\r\n /*\r\n * For product fields from V 2.0.0\r\n * For admin fields, which will be displyed as Product Fields\r\n */\r\n if ($key_val[0] == $_meta[\"default_value\"]) {\r\n $attr = 'checked=\"checked\"';\r\n }\r\n }\r\n } else {\r\n if ($key_val[0] == $_meta[\"value\"]) {\r\n $attr = 'checked=\"checked\"';\r\n }\r\n }\r\n /* For admin field, we don't need <li></li> wrapper */\r\n $html .= (($_ptype != \"wccaf\") ? '<li>' : '') . '<label class=\"wcff-option-wrapper-label\"><input type=\"radio\" data-has_field_rules=\"'.$has_field_rules.'\" data-has_pricing_rules=\"'.$_has_pricing_rules.'\" data-fkey=\"'. $_meta[\"key\"] .'\" class=\"' . $_ptype . '-field ' . $_class . '\" name=\"' . esc_attr($_meta[\"key\"] . $_index) . '\" value=\"' . esc_attr(trim($key_val[0])) . '\" ' . $attr . ' data-field-type=\"'. $_meta[\"type\"] .'\" ' . $_ptype . '-pattern=\"mandatory\" ' . $_ptype . '-mandatory=\"' . $_meta[\"required\"] . '\" ' . $_readonly . ' /> ' . esc_html(trim($key_val[1])) . '</label>' . (($_ptype != \"wccaf\") ? '</li>' : '');\r\n }\r\n }\r\n /* For admin field, we don't need <ul> wrapper */\r\n $html .= ($_ptype != \"wccaf\") ? '</ul>' : '';\r\n } else {\r\n /*\r\n * Show the raw value instead of as a field\r\n * Used for the Admin Field showing on product page\r\n */\r\n $html = '<p class=\"wcff-wccaf-value-para-tag\">' . $_meta[\"default_value\"] . '</p>';\r\n }\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }",
"function acf_radio_input($attrs = array())\n{\n}",
"public static function init($arr)\n {\n //print_r($arr);\n //exit;\n self::makeFormString($arr);\n }",
"function buildQuickForm( ) {\n // and the grades\n require_once 'School/Utils/Conference.php';\n $details = School_Utils_Conference::getReminderDetails( );\n $string = array();\n foreach ( $details as $name => $grade ) {\n $string[] = \"{$name} (Grade: {$grade})\";\n }\n $this->assign( 'conferenceTeachers',\n implode( ', ', $string ) );\n\n $this->addButtons(array( \n array ( 'type' => 'refresh', \n 'name' => ts( 'Send Reminder' ),\n 'spacing' => ' ', \n 'isDefault' => true ), \n array ( 'type' => 'cancel', \n 'name' => ts('Cancel') ), \n )\n );\n }",
"function createQuickReplies ($title, $arr) {\n $i = 0;\n $qrs = array ();\n foreach ($arr as $key => $value) {\n $i = $i + 1;\n if ($i > 10) {\n break;\n }\n array_push($qrs, array (\n \"content_type\" => \"text\",\n \"title\" => (strlen($key) > 19) ? substr($key,0,16).'...' : $key,\n \"payload\" => $value\n ));\n }\n\n $bot_resp = array ();\n $bot_resp['text'] = $title;\n $bot_resp['quick_replies'] = $qrs;\n return $bot_resp;\n }",
"protected function buildRadio($row) {\n\t\tif (!$this->filled) $$row['Default'] = \" checked='checked'\";\n\t\t$vals = explode (',',$row['values']);\n\t\tforeach ($vals as $value) {\n\t\t\tif ($pos = strpos($value,\"=ON\")) {\n\t\t\t\t$value = substr($value,0,$pos);\n\t\t\t\t$$value = \" checked='checked'\";\n\t\t\t}\n\t\t\t$elem .= sprintf(\"<input type='radio' name='%s' value='%s'%s />%s<br />\\n\",$row['Field'],$value,$$value,$value);\n\t\t}\n\t\treturn $elem;\n\t}",
"function FormAsseretion(){\r\n $creat = new UIMAP_createFormPage();\r\n \r\n $this->assertElementPresent($creat->formName());\r\n $this->assertElementPresent($creat->formLanguige());\r\n for($i = 1; $i < 4; $i++){\r\n $this->assertElementPresent($creat->formRespuniqtype($i));\r\n }\r\n $this->assertElementPresent($creat->submitButton());\r\n }",
"private function quiz_generate($data_quiz_src) {\n // extract all possible answer\n $all_possible_answer = array();\n foreach ($data_quiz_src as $single_quiz) {\n $all_correct_answer = explode('|', $single_quiz['correct_answer']);\n $all_possible_answer[] = $all_correct_answer[0];\n }\n\n $out = array();\n $index = 0;\n foreach ($data_quiz_src as $single_quiz) {\n shuffle($all_possible_answer);\n\n $single_quiz['all_correct_answer'] = explode('|', $single_quiz['correct_answer']);\n\n $single_quiz['possible_answer'] = array($single_quiz['all_correct_answer'][0]);\n\n $single_quiz['response_type'] = !empty($single_quiz['response_type']) ? $single_quiz['response_type'] : $this->configuration['default_response_type'];\n\n // add wrong answer to $possible_answer from input data\n if (isset($single_quiz[\"wrong_answer\"])) {\n $possible_wrong_answer = explode('|', $single_quiz[\"wrong_answer\"]);\n\n //remove eventually emtpy element\n $single_quiz['possible_answer'] = array_filter($single_quiz['possible_answer']);\n\n\n $single_quiz['possible_answer'] = array_merge($single_quiz['possible_answer'], $possible_wrong_answer);\n }\n\n // add random wrong answer to $possible_answer\n $single_quiz['possible_answer'] = array_merge($single_quiz['possible_answer'], $all_possible_answer);\n\n // eliminate duplicates\n $single_quiz['possible_answer'] = array_unique($single_quiz['possible_answer']);\n\n //remove eventually emtpy element\n $single_quiz['possible_answer'] = array_filter($single_quiz['possible_answer']);\n\n //get only the correct number of elements:\n $single_quiz['response_type'] = strtolower($single_quiz['response_type']);\n $option_array = explode('_', $single_quiz['response_type']);\n if (isset($option_array[1])) {\n $max_option = $option_array[1];\n $single_quiz['response_type'] = $option_array[0];\n } else {\n $max_option = $this->configuration['num_options'];\n }\n\n $single_quiz['possible_answer'] = array_slice($single_quiz['possible_answer'], 0, $max_option);\n\n // shuffle all data:\n shuffle($single_quiz['possible_answer']);\n\n $single_quiz['all_question'] = explode('|', $single_quiz['question']);\n\n // remove all empty values \n $single_quiz['all_question'] = array_filter($single_quiz['all_question']);\n\n shuffle($single_quiz['all_question']);\n\n $single_quiz['question'] = $single_quiz['all_question'][0];\n\n\n // add id of the correct_answer to correct answer if the answer_type is 'options' \n if ($single_quiz['response_type'] == \"options\") {\n $key = array_search($single_quiz['all_correct_answer'][0], $single_quiz['possible_answer']);\n $single_quiz['all_correct_answer'][] = $key;\n }\n\n\n $output_keys = array(\n 'id',\n 'question',\n 'all_correct_answer',\n 'possible_answer',\n 'response_type',\n 'if_correct',\n 'if_wrong'\n );\n\n\n $out[$index] = array();\n foreach ($output_keys as $single_key) {\n\n $out[$index][$single_key] = isset($single_quiz[$single_key]) ? $single_quiz[$single_key] : \"\";\n }\n\n $index ++;\n }\n return $out;\n }"
] | [
"0.5851053",
"0.55911535",
"0.5372921",
"0.5343518",
"0.5342001",
"0.53135383",
"0.5303237",
"0.5252377",
"0.5118637",
"0.5106243",
"0.5092101",
"0.5055059",
"0.5021198",
"0.5008819",
"0.49969587",
"0.49287325",
"0.49158427",
"0.4912691",
"0.4900946",
"0.48587927",
"0.4856847",
"0.48421472",
"0.48239562",
"0.48222768",
"0.4813508",
"0.48067412",
"0.47975975",
"0.47958273",
"0.47798997",
"0.47796124"
] | 0.73485553 | 0 |
/\ Remove jQuery // jQuery UI \ | function remove__jquery(&$scripts) {
if ( !is_admin() ) {
$scripts->remove( 'jquery' );
$scripts->remove( 'jquery-ui-core' );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function faster_jquery_remove() {\n\n\twp_deregister_script( 'jquery' );\n\n}",
"function remove_jquery_wordpress( $scripts ) {\n if ( !is_admin() ) {\n $script = $scripts->registered['jquery'];\n \n if ( $script->deps ) { \n $script->deps = array_diff( $script->deps, array( 'jquery-core', 'jquery-migrate' ) );\n \n }\n }\n }",
"function isa_remove_jquery_migrate( &$scripts) {\n if(!is_admin()) {\n $scripts->remove( 'jquery');\n $scripts->add( 'jquery', false, array( 'jquery-core' ), '1.4.11' );\n }\n}",
"function remove_wp_embed_and_jquery() {\n\tif (!is_admin()) {\n\t\twp_deregister_script('wp-embed');\t\t\n\t}\n}",
"function bethel_move_jquery() {\n global $wp_scripts;\n foreach ($wp_scripts->registered as $k => $v) {\n if (substr($k, 0, 6) == 'jquery') {\n if (isset($wp_scripts->registered[$k]->ver) && isset($wp_scripts->registered[$k]->src) && $wp_scripts->registered[$k]->deps) {\n $ver = $wp_scripts->registered[$k]->ver;\n $src = $wp_scripts->registered[$k]->src;\n $deps = $wp_scripts->registered[$k]->deps;\n wp_deregister_script ($k);\n wp_register_script($k, $src, $deps, $ver, true);\n }\n }\n }\n}",
"function wp_deregister_script($handle)\n {\n }",
"function cm_replace_jquery() {\n\tif (!is_admin()) {\n\t\t// comment out the next two lines to load the local copy of jQuery\n\t\twp_deregister_script('jquery');\n\t\twp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3');\n\t\twp_enqueue_script('jquery');\n\t}\n}",
"function replace_jquery() {\r\n\tif (!is_admin()) {\r\n\t\t// comment out the next two lines to load the local copy of jQuery\r\n\t\twp_deregister_script('jquery');\r\n\t\twp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3');\r\n\t\twp_enqueue_script('jquery');\r\n\t}\r\n}",
"function add_qoorate_scripts(){\n\t\t// MAYBE TODO: cacheing ... place in DB options?\t\t\n\t\t// unregister our really old jquery bundled with WP\n\t\t// Maybe we can keep it? should it be an option?\n\t\twp_deregister_script( 'jquery' );\n\t\twp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' );\n\t\twp_enqueue_script( 'jquery' );\n\t}",
"function replace_jquery() {\n if (!is_admin()) {\n // comment out the next two lines to load the local copy of jQuery\n wp_deregister_script('jquery');\n wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', false, '1.12.4');\n wp_enqueue_script('jquery');\n }\n}",
"function wp_deregister_script( $handle ) {\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );\n\n\t/**\n\t * Do not allow accidental or negligent de-registering of critical scripts in the admin.\n\t * Show minimal remorse if the correct hook is used.\n\t */\n\t$current_filter = current_filter();\n\tif ( ( is_admin() && 'admin_enqueue_scripts' !== $current_filter ) ||\n\t\t( 'wp-login.php' === $GLOBALS['pagenow'] && 'login_enqueue_scripts' !== $current_filter )\n\t) {\n\t\t$no = array(\n\t\t\t'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion',\n\t\t\t'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog',\n\t\t\t'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse',\n\t\t\t'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable',\n\t\t\t'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs',\n\t\t\t'jquery-ui-tooltip', 'jquery-ui-widget', 'underscore', 'backbone',\n\t\t);\n\n\t\tif ( in_array( $handle, $no ) ) {\n\t\t\t$message = sprintf(\n\t\t\t\t/* translators: 1: script name, 2: wp_enqueue_scripts */\n\t\t\t\t__( 'Do not deregister the %1$s script in the administration area. To target the front-end theme, use the %2$s hook.' ),\n\t\t\t\t\"<code>$handle</code>\",\n\t\t\t\t'<code>wp_enqueue_scripts</code>'\n\t\t\t);\n\t\t\t_doing_it_wrong( __FUNCTION__, $message, '3.6.0' );\n\t\t\treturn;\n\t\t}\n\t}\n\n\twp_scripts()->remove( $handle );\n}",
"function wp_deregister_script( $handle ) {\r\n\tglobal $wp_scripts;\r\n\tif ( !is_a($wp_scripts, 'WP_Scripts') )\r\n\t\t$wp_scripts = new WP_Scripts();\r\n\r\n\t$wp_scripts->remove( $handle );\r\n}",
"function dequeue_jquery_migrate( &$scripts){\n\tif(!is_admin()){\n\t\t$scripts->remove( 'jquery');\n\t\t$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.10.2' );\n\t}\n}",
"function replace_default_jquery() {\n\tif (!is_admin()) {\n\t\t// comment out the next two lines to load the local copy of jQuery\n\t\twp_deregister_script('jquery');\n\t\t// wp_register_script('jquery', '//cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js', false, null);\n\t\twp_register_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.4.min.js', false, null);\n\t\t// wp_enqueue_script('jquery');\n\t}\n}",
"function upgrade_jquery() {\n\tif ( ! is_admin() ) {\n\t\twp_deregister_script( 'jquery' );\n\t\twp_enqueue_script( 'jquery-updated', 'https://code.jquery.com/jquery-3.5.1.slim.min.js' );\n\t\twp_enqueue_script( 'jquery-migrate', 'https://code.jquery.com/jquery-migrate-3.3.1.min.js' );\n\t}\n}",
"function deenqueue_parent_scripts_styles() {\n wp_dequeue_script( 'one-page-slitslider' );\n wp_deregister_script( 'one-page-slitslider' );\n wp_dequeue_script( 'one-page-custom' );\n wp_deregister_script( 'one-page-custom' );\n}",
"function registerJqueryFromCdn() {\n\t// Use jquery and jquery core from the google cdn instead of wordpress included\n\twp_deregister_script( 'jquery-ui-core' );\n\twp_deregister_script( 'jquery-ui-tab' );\n\twp_deregister_script( 'jquery-ui-autocomplete' );\n\twp_deregister_script( 'jquery-ui-accordion' );\n\twp_deregister_script( 'jquery-ui-autocomplete' );\n\twp_deregister_script( 'jquery-ui-button' );\n\twp_deregister_script( 'jquery-ui-datepicker');\n\twp_deregister_script( 'jquery-ui-dialog' );\n\twp_deregister_script( 'jquery-ui-draggable' );\n\twp_deregister_script( 'jquery-ui-droppable' );\n\twp_deregister_script( 'jquery-ui-mouse' );\n\twp_deregister_script( 'jquery-ui-position' );\n\twp_deregister_script( 'jquery-ui-progressbar');\n\twp_deregister_script( 'jquery-ui-resizable' );\n\twp_deregister_script( 'jquery-ui-selectable');\n\twp_deregister_script( 'jquery-ui-slider' );\n\twp_deregister_script( 'jquery-ui-sortable' );\n\twp_deregister_script( 'jquery-ui-tabs' );\n\twp_deregister_script( 'jquery-ui-widget' );\n\twp_deregister_script( 'jquery' );\n\n\twp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js', array(), '1.11.3' );\n\twp_register_script( 'jquery-ui-core', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js', array( 'jquery' ), '', true);\n}",
"function _h_remove_jetpack_footer_assets() {\n wp_deregister_script('sharing-js');\n\n // disable spinner when infinite loading is enabled\n wp_deregister_script('jquery.spin');\n wp_deregister_script('spin');\n}",
"function my_admin_scripts() {\n\t\t\t wp_deregister_script('jquery');\n\t\t\t wp_register_script('jquery', (\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"), false, null);\n\t\t\t wp_enqueue_script('jquery');\n\t\t\t wp_enqueue_script( 'jquery-migrate', 'https://code.jquery.com/jquery-migrate-3.0.1.min.js', array('jquery'), '3.0.1', false );\n\t\t}",
"function modify_jquery_version() {\n if (!is_admin()) {\n wp_deregister_script('jquery');\n wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js', false, '2.0.s');\n wp_enqueue_script('jquery');\n }\n}",
"function theme_remove_admin_bar() {\r\n\treturn false;\r\n}",
"function set_jquery_cdn() {\n\t\tif (is_admin()) return;\n\t\twp_deregister_script('jquery');\n\t\twp_register_script('jquery',\n\t\t\t'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');\n\t}",
"function google_hosted_jquery() {\n\tif (!is_admin()) {\n\t\twp_deregister_script('jquery');\n\n\t\tswitch ( SeekConfig::JQUERY_VERSION ) {\n\t\t\tcase 1:\n\t\t\t\twp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', false, null);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\twp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js', false, null);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\twp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js', false, null);\n\t\t\t\tbreak;\n\t\t}\n\n\t\twp_enqueue_script('jquery');\n\t}\n}",
"function admin_dequeue_scripts() {\r\n\twp_dequeue_script('jquery-qtip');\r\n}",
"function reassign_jQuery() {\n wp_deregister_script( 'jquery' );\n wp_deregister_script( 'jquery-core' );\n wp_deregister_script( 'jquery-migrate' );\n\n wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js', array(), '3.4.1', true);\n wp_add_inline_script( 'jquery', \"window.jQuery || document.write('<script src=\\\"\".get_template_directory_uri() .\"/assets/jquery-3.4.1.min.js\\\">\\\\x3C/script>')\");\n \n wp_enqueue_script('jquery');\n\n}",
"function asc_deregister_script( $handle ) {\n\tglobal $asc_scripts;\n\tif ( ! is_a( $asc_scripts, 'ASC_Scripts' ) ) {\n\t\tif ( ! did_action( 'init' ) )\n\t\t\t_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),\n\t\t\t\t'<code>asc_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );\n\t\t$asc_scripts = new ASC_Scripts();\n\t}\n\n\t/**\n\t * Do not allow accidental or negligent de-registering of critical scripts in the admin.\n\t * Show minimal remorse if the correct hook is used.\n\t */\n\t$current_filter = current_filter();\n\tif ( ( is_admin() && 'admin_enqueue_scripts' !== $current_filter ) ||\n\t\t( 'wp-login.php' === $GLOBALS['pagenow'] && 'login_enqueue_scripts' !== $current_filter )\n\t) {\n\t\t$no = array(\n\t\t\t'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion',\n\t\t\t'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog',\n\t\t\t'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse',\n\t\t\t'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable',\n\t\t\t'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs',\n\t\t\t'jquery-ui-tooltip', 'jquery-ui-widget', 'underscore', 'backbone',\n\t\t);\n\n\t\tif ( in_array( $handle, $no ) ) {\n\t\t\t$message = sprintf( __( 'Do not deregister the %1$s script in the administration area. To target the frontend theme, use the %2$s hook.' ),\n\t\t\t\t\"<code>$handle</code>\", '<code>asc_enqueue_scripts</code>' );\n\t\t\t_doing_it_wrong( __FUNCTION__, $message, '3.6' );\n\t\t\treturn;\n\t\t}\n\t}\n\n\t$asc_scripts->remove( $handle );\n}",
"public function removable()\n {\n $this->rightTools()->append(\n '<a data-toggle=\"remove\"><i class=\"zmdi zmdi-close\"></i></a>'\n );\n\n static::$scripts[0] = <<<EOF\n $('.portlet [data-toggle=\"remove\"]').click(function (e) {\n $(this).parent().parent().parent().parent().parent().toggle(100)\n })\nEOF;\n return $this;\n }",
"public static function move_jquery_to_footer() {\n\t\tadd_action('wp_enqueue_scripts', function() {\n\t\t\tif (is_admin()) {\n\t\t return;\n\t\t }\n\n\t\t $wp_scripts = wp_scripts();\n\n\t\t $wp_scripts->add_data('jquery', 'group', 1);\n\t\t $wp_scripts->add_data('jquery-core', 'group', 1);\n\t\t $wp_scripts->add_data('jquery-migrate', 'group', 1);\n\t\t}, 0);\n\t}",
"function wp_deregister_style($handle)\n {\n }",
"function ui_resizable_destroy($selector){\n return add_method_support('resizable',$selector, 'destroy');\n}"
] | [
"0.7260323",
"0.6732453",
"0.6726179",
"0.64241177",
"0.6321641",
"0.6062501",
"0.6060515",
"0.60391295",
"0.60380536",
"0.59975517",
"0.59745836",
"0.59575576",
"0.5925367",
"0.59131294",
"0.5815577",
"0.57426333",
"0.5717533",
"0.57099456",
"0.57041276",
"0.56919074",
"0.56900656",
"0.566551",
"0.56418014",
"0.5631362",
"0.5620843",
"0.5553032",
"0.5543106",
"0.55299234",
"0.5526728",
"0.55257136"
] | 0.7426778 | 0 |
Get all unseen discussions. Use in notification. | public function get_unseen() {
$this->authenticate();
$result = $this->discussion->get_unseen_discussions();
if (!is_null($result)) {
exit(json_encode([
'flg' => TRUE,
'msg' => $result
]));
} else {
exit(json_encode([
'flg' => FALSE
]));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUnreadMessages(): Collection;",
"public static function getLastDiscussions(){\n $sql = \"select * from discussions ORDER BY `id` DESC LIMIT 5\";\n return App::$db->query($sql);\n }",
"public function get_list_unread(){\n\n\t\tuser_login_required();\n\n\t\t//Get the list of unread conversations of the user\n\t\t$list_unread_conversations = components()->conversations->get_list_unread(userID);\n\n\t\t//Process the results\n\t\tforeach($list_unread_conversations as $num => $conv)\n\t\t\t$list_unread_conversations[$num] = self::UnreadConversationToAPI($conv);\n\n\t\t//Return result\n\t\treturn $list_unread_conversations;\n\t}",
"public function getUnread()\n\t{\n\t\t$msgs = $this->getAllByQuery(\"is_read=?\", [(int) false]);\n\t\t$this->updateQueryTime();\n\t\treturn $msgs;\n\t}",
"public function getDiscussionsUnread($id_user=null){\n // $id_user correspon à l'id de l'utilisateur\n // retourne un numerique qui correspond aux nombre de messages non lus\n $inst_user = new Model_DbTable_User();\n $inst_item = new Model_DbTable_Item();\n if($id_user > 0){\n $current_user = $this->find($id_user)->current();\n $id_user = $current_user->idUser;\n }else{\n $current_user = $inst_user->getUser();\n $id_user = $current_user->idUser;\n }\n $messages = $this->fetchAll($this->select()->where(\"state LIKE '%\".$id_user.\",%'\"));\n $list_unread = array();\n foreach($messages as $message){\n $message_obj = $inst_item->find($message['item_idItem'])->current();\n $list_obj = $message_obj->findParentRow(Model_DbTable_List);\n $list_unread[$list_obj->idList] = $list_obj->idList; \n }\n return $list_unread;\n }",
"protected function getUnreadConversations() {\n return DB::table('conversations')\n ->join('participants', function($join) {\n $join->on('participants.conversation_id', '=', 'conversations.id')\n ->on('participants.last_read', '<', 'conversations.last_message')\n ->where('participants.user_id', '=', Auth::user()->id);\n })\n ->pluck('conversation_id');\n }",
"public function discussions()\n {\n\n return $this->hasMany('App\\Discussion','channel_id');\n }",
"function GetUnreadNotifications($uid=false,$last_notification=false){\n\n\t$query_=$last_notification?\" and `id`> {$last_notification}\":\"\";\n\n\t$notifications = NotificationsModel::model()->findAll(\"`to` =\".helpers::uid($uid).$query_.\" and `seen`='0' order by `time` desc\");\n\n\tif($notifications!=NULL){\n\n\t//get user controller\n\t$user_c=Helpers::get_controller(USERS);\n\n\tforeach ($notifications as $k=>$notification){\n\n\t$notifications[$k]->user = $user_c->GetUserById($notification->from);\n\n\n\t}\n\n\n\t}\n\n\n\treturn $notifications==null?array():$notifications;\n\n\t}",
"public function getUnseenEmails(): array\n {\n $emails = [];\n\n try {\n $imap = $this->loginToInbox();\n\n // We only want the emails we haven't fetched before.\n foreach ($imap->search(['UNSEEN']) as $id) {\n $data = $imap->fetch(['RFC822.HEADER', 'RFC822.TEXT'], $id);\n\n // We need to combine headers and text in order to have a full email.\n $emails[] = InboundEmail::fromMessage($data['RFC822.HEADER'].\"\\r\\n\".$data['RFC822.TEXT']);\n }\n\n $imap->logout();\n } catch (\\Exception $e) {\n // Just log the error and get on with the method execution.\n $this->logger->error($e->getMessage());\n }\n\n return $emails;\n }",
"public function getLatestUnreadNotifications()\n {\n return $this->_notificationList->setPageSize(self::NOTIFICATIONS_NUMBER);\n }",
"function getUnsentNotifications($userId) {\n\t\treturn $this->_conn->arrayQuery(\"SELECT id, userid, objectid, type, title, body FROM notifications WHERE userid = :userid AND NOT SENT\",\n array(\n ':userid' => array($userId, PDO::PARAM_INT)\n ));\n\t}",
"public function notifications()\n {\n $notifications = $this->get(\"/api/v1/conversations?as_user_id=sis_user_id:mtm49\");\n return $notifications;\n }",
"public function getNotOpenedMessagesToFollow()\n {\n // no problem if one message is opened more than one time\n $modifier = Carbon::now()->modify(\"-{$this->getDelayInterval()}\");\n $messages = TrackingLog::select('tracking_logs.*')\n ->leftJoin('open_logs', 'tracking_logs.message_id', '=', 'open_logs.message_id')\n ->join('auto_triggers', 'tracking_logs.auto_trigger_id', '=', 'auto_triggers.id')\n ->join('auto_events', 'auto_triggers.auto_event_id', '=', 'auto_events.id')\n ->where('auto_event_id', $this->previousEvent->id)\n ->whereRaw(sprintf('%s NOT IN (SELECT COALESCE(subscriber_id, 0) FROM %s WHERE auto_event_id = %s)', table('tracking_logs.subscriber_id'), table('auto_triggers'), $this->id))\n ->whereRaw(sprintf('%s IS NULL', table('open_logs.id')))\n ->where('tracking_logs.created_at', '<=', $modifier)\n ->get();\n\n // one message could be opened more than one time\n // @note: use array_uniq_by() helper function for far better performance thant Collection::uniq()\n $unique = array_unique_by($messages, function ($message) {\n return $message->message_id;\n });\n\n return $unique;\n }",
"public function getUnsubscribersToFollow()\n {\n return $this->automation->subscribers()\n ->addSelect('unsubscribe_logs.created_at AS unsubscribed_at')\n ->addSelect('tracking_logs.message_id')\n ->join('tracking_logs', 'subscribers.id', '=', 'tracking_logs.subscriber_id')\n ->join('unsubscribe_logs', 'tracking_logs.message_id', '=', 'unsubscribe_logs.message_id')\n ->whereRaw(sprintf(table('subscribers') . '.id NOT IN (SELECT COALESCE(subscriber_id, 0) FROM %s WHERE auto_event_id = %s)', table('auto_triggers'), $this->id))\n ->where('unsubscribe_logs.created_at', '>=', $this->created_at)\n ->get();\n }",
"public function getUnreadMessageCollection(){\n if(!$this->_unreadMessageCollection){\n $this->_unreadMessageCollection = $this->_messageFactory->create()->getCollection();\n $this->_unreadMessageCollection->addFieldToFilter('customer_email','')->addFieldToFilter('customer_id',$this->ticketData->getCustomerId())\n ->addFieldToFilter('is_read',0)\n ->setOrder('message_id','DESC')\n ->setPageSize(5); \n }\n \n return $this->_unreadMessageCollection;\n }",
"final public function get_notifications() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT notification_id, message, user_id, type, a_href, read_status, date_notified\r\n\t\t\tFROM `notifications`\r\n\t\t\tWHERE read_status = '\" . NotificationFactory::UNREAD . \"'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\t$notifications = array();\r\n\t\t\twhile ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {\r\n\t\t\t\t$notification = '<a href=\"' . $row['a_href'] . '\">' . $row['message'] . '</a>';\r\n\t\t\t\tarray_push($notifications, $notification);\r\n\t\t\t}\r\n\t\t\treturn $notifications;\r\n\t\t}\r\n\t}",
"function getReceivedIssues() {\n\t\t$i = $this->_query->join('synd_issue','i');\n\t\t$query = clone $this->_query;\n\n\t\t$query->column($this->_grouping->getReceivedKey($this, $query), 'PK');\n\t\t$query->column(\"COUNT(DISTINCT $i.node_id)\", 'ISSUES');\n\t\t$query->groupBy($this->_grouping->getReceivedKey($this, $query));\n\t\t\n\t\t$sql = $query->toString();\n\t\t$rows = $this->_db->getAssoc($sql);\n\t\treturn $this->_grouping->filter($rows);\n\t}",
"public function unread()\n {\n request()->user()->readNotifications()->update(['read_at' => null]);\n\n return response()->json(request()->user()->notifications);\n }",
"public function unread()\n {\n return $this->unseen();\n }",
"public function getUnsentNotifications() {\n return $this->hasMany(NotificationEmployer::className(), ['employer_id' => 'employer_id'])\n ->with(['job', 'student'])\n ->where(['notification_sent' => NotificationEmployer::SENT_FALSE])\n ->orderBy(\"notification_datetime DESC\");\n }",
"public function getDiscussions($id_user=null){\n // $id_user correspon à l'id de l'utilisateur\n // retourne un tableau de liste de messages recus\n $discussions = array();\n $inst_user = new Model_DbTable_User();\n $inst_list = new Model_DbTable_List();\n \n if($id_user > 0){\n $current_user = $this->find($id_user)->current();\n $id_user = $current_user->idUser;\n }else{\n $current_user = $inst_user->getUser();\n $id_user = $current_user->idUser;\n } \n \n $select = $inst_list->select()->where('categorie_idcategories = ?',$this->Category_id);\n $lists = $current_user->findModel_DbTable_ListViaModel_DbTable_UserHasListByUserAndList($select);\n foreach($lists as $list){\n $discussions[$list->idList] = array(\"user\"=>$current_user->idUser,\"count\"=>count($inst_list->getCountItem($list->idList)));\n }\n \n foreach($this->fetchAll($this->select()->where(\"recipients_id LIKE '%\".$id_user.\",%'\")) as $message){\n $inst_item = new Model_DbTable_Item();\n $inst_list = new Model_DbTable_List();\n $current_item = $inst_item->find($message[\"item_idItem\"])->current();\n $current_list = $inst_list->find($current_item->list_idList)->current();\n $list_user = $current_list->findModel_DbTable_UserViaModel_DbTable_UserHasListByListAndUser()->current(); \n $other_user = $inst_user->find($list_user->idUser)->current(); \n $discussions[$current_item->list_idList] = array(\"user\"=>$other_user->idUser,\"count\"=>count($inst_list->getCountItem($current_item->list_idList)));\n }\n krsort($discussions);\n return $discussions; \n }",
"public function unseenReviews($itemId)\n\t{\n\t\treturn $this->review->where('item_id', $itemId)->where('status', 'unseen')->get();\n\t}",
"public function getUnread()\n {\n if(Session::has('prac_id'))\n {\n $viewer = Practitioner::find(Session::get('prac_id'));\n }\n elseif(Auth::check())\n {\n $viewer = User::find(Auth::user()->id);\n }\n\n $unreadcount = Message::latest('created_at')->GetConversationReceiver($viewer->email)\n ->GetUnreadMessages()->distinct()->lists('conv_id');\n\n if(count($unreadcount) < 1)\n {\n return null;\n }\n else\n { \n return $unreadcount;\n }\n\n }",
"public function getNotClickedMessagesToFollow()\n {\n // no problem if one message is opened more than one time\n $modifier = Carbon::now()->modify(\"-{$this->getDelayInterval()}\");\n $messages = TrackingLog::select('tracking_logs.*')\n ->leftJoin('click_logs', 'tracking_logs.message_id', '=', 'click_logs.message_id')\n ->join('auto_triggers', 'tracking_logs.auto_trigger_id', '=', 'auto_triggers.id')\n ->join('auto_events', 'auto_triggers.auto_event_id', '=', 'auto_events.id')\n ->where('auto_event_id', $this->previousEvent->id)\n ->whereRaw(sprintf('%s NOT IN (SELECT COALESCE(subscriber_id, 0) FROM %s WHERE auto_event_id = %s)', table('tracking_logs.subscriber_id'), table('auto_triggers'), $this->id))\n ->whereRaw(sprintf('%s IS NULL', table('click_logs.id')))\n ->where('tracking_logs.created_at', '<=', $modifier)\n ->get();\n\n // one message could be clicked more than one time\n // @note: use array_uniq_by() helper function for far better performance thant Collection::uniq()\n $unique = array_unique_by($messages, function ($message) {\n return $message->message_id;\n });\n\n return $unique;\n }",
"public function All () {\n\t\t$messages = DB::select(\"\n\t\t\tselect max(a.created_at) as date, max(a.id) as id, projects.name,\n\t\t\t(select message from messages where created_at = max(a.created_at) AND id = max(a.id)) message,\n\t\t\t(select seen from messages where created_at = max(a.created_at) AND id = max(a.id)) seen,\n\t\t\t(select messages.from from messages where created_at = max(a.created_at) AND id = max(a.id)) as sender,\n\t\t\t(select messages.project_id from messages where created_at = max(a.created_at) AND id = max(a.id)) as project_id,\n\t\t\t(select messages.type from messages where created_at = max(a.created_at) AND id = max(a.id)) as type\n\t\t\tfrom messages a join projects ON projects.id = a.project_id\n\t\t\tWHERE a.to = \".Auth::user()->id.\" OR a.from = \".Auth::user()->id.\"\n\t\t\tgroup by projects.name ORDER BY id DESC\");\n\n\t\t$seen = collect($messages)->pluck('seen');\n\t\t$unseen = array_diff($seen->all(), array(1));\n\t\treturn array(\"messages\" => $messages, \"unseen\" => $unseen);\n\t}",
"public function fetchAllMessages()\n {\n return Chat::with('user')->get();\n }",
"public function getDiscussions() {\n $comments = $this->getComments();\n $discussions = array();\n\n foreach($comments as $comment) {\n if(!$comment->parentId) {\n $discussions[$comment->id] = array();\n $discussions[$comment->id][] = $comment;\n }\n else {\n $discussions[$comment->parentId][] = $comment;\n }\n }\n\n return $discussions;\n }",
"public function getDiscussionsSend($id_user=null){\n // $id_user correspon à l'id de l'utilisateur\n // retourne un tableau de liste de messages envoyes\n $discussions = array();\n $inst_user = new Model_DbTable_User();\n $inst_list = new Model_DbTable_List();\n \n if($id_user > 0){\n $current_user = $this->find($id_user)->current();\n $id_user = $current_user->idUser;\n }else{\n $current_user = $inst_user->getUser();\n $id_user = $current_user->idUser;\n } \n \n $select = $inst_list->select()->where('categorie_idcategories = ?',$this->Category_id);\n $lists = $current_user->findModel_DbTable_ListViaModel_DbTable_UserHasListByUserAndList($select);\n foreach($lists as $list){\n $discussions[$list->idList] = array(\"user\"=>$current_user->idUser,\"count\"=>count($inst_list->getCountItem($list->idList)));\n }\n krsort($discussions);\n return $discussions; \n }",
"public static function get_unsubscribable_reactforums() {\n global $USER, $DB;\n\n // Get courses that $USER is enrolled in and can see.\n $courses = enrol_get_my_courses();\n if (empty($courses)) {\n return array();\n }\n\n $courseids = array();\n foreach($courses as $course) {\n $courseids[] = $course->id;\n }\n list($coursesql, $courseparams) = $DB->get_in_or_equal($courseids, SQL_PARAMS_NAMED, 'c');\n\n // Get all reactforums from the user's courses that they are subscribed to and which are not set to forced.\n // It is possible for users to be subscribed to a reactforum in subscription disallowed mode so they must be listed\n // here so that that can be unsubscribed from.\n $sql = \"SELECT f.id, cm.id as cm, cm.visible, f.course\n FROM {reactforum} f\n JOIN {course_modules} cm ON cm.instance = f.id\n JOIN {modules} m ON m.name = :modulename AND m.id = cm.module\n LEFT JOIN {reactforum_subscriptions} fs ON (fs.reactforum = f.id AND fs.userid = :userid)\n WHERE f.forcesubscribe <> :forcesubscribe\n AND fs.id IS NOT NULL\n AND cm.course\n $coursesql\";\n $params = array_merge($courseparams, array(\n 'modulename'=>'reactforum',\n 'userid' => $USER->id,\n 'forcesubscribe' => REACTFORUM_FORCESUBSCRIBE,\n ));\n $reactforums = $DB->get_recordset_sql($sql, $params);\n\n $unsubscribablereactforums = array();\n foreach($reactforums as $reactforum) {\n if (empty($reactforum->visible)) {\n // The reactforum is hidden - check if the user can view the reactforum.\n $context = \\context_module::instance($reactforum->cm);\n if (!has_capability('moodle/course:viewhiddenactivities', $context)) {\n // The user can't see the hidden reactforum to cannot unsubscribe.\n continue;\n }\n }\n\n $unsubscribablereactforums[] = $reactforum;\n }\n $reactforums->close();\n\n return $unsubscribablereactforums;\n }",
"public function allUnreadForUser($userId);"
] | [
"0.65681255",
"0.6378681",
"0.63406754",
"0.6325844",
"0.62785566",
"0.6249371",
"0.6220479",
"0.61696243",
"0.610331",
"0.60896033",
"0.60003984",
"0.5989895",
"0.5964396",
"0.59434146",
"0.59220237",
"0.5888419",
"0.58776474",
"0.58678305",
"0.5790014",
"0.5775237",
"0.5765656",
"0.5740093",
"0.5715218",
"0.57041425",
"0.5701785",
"0.5696361",
"0.56937426",
"0.5669351",
"0.5658675",
"0.5618743"
] | 0.8289016 | 0 |
Test when name is not set | public function testNoName() {
$this->expectException('HttpSourceConfigException');
$this->Field->name();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function assertValidName() : void\n {\n InvalidDescriptorArgumentException::assertIsNotEmpty(\n $this->name,\n '#[Route.name] must contain a non-empty string.'\n );\n }",
"function valid_name($name) {\r\n\tif (empty($name)) \r\n\t\treturn false;\r\n\telse\r\n\t\treturn true;\r\n }",
"final protected\tfunction\thasName($name)\n\t\t{\n\t\t\t$this->_name\t=\t$name;\n\t\t}",
"final protected\tfunction\thasName($name)\n\t\t{\n\t\t\t$this->_name\t=\t$name;\n\t\t}",
"public function testBlankNameNotAllowed()\n {\n $this->browse(function ($browser) {\n $browser->visit(new Pages\\ProfilePage())\n ->type('name', '')\n ->click('.btn-success')\n ->assertPathIs($this->pageUrl)\n ->assertSee('You need to mention your name.');\n });\n }",
"public function testMissingParameterAddCheckName() {\n $check = $this->default_check;\n $check['name'] = null;\n $this->pingdom->addCheck($check);\n }",
"public function testGetNameFail() {\r\n $this->_action->getName();\r\n }",
"public function nameIsEmpty()\n {\n if (!$this->name) {\n return true;\n }\n\n return false;\n }",
"public function hasName()\n {\n return $this->name !== null;\n }",
"public function hasName()\n {\n return $this->get(self::NAME) !== null;\n }",
"public function testIfStockManagementHasName()\n {\n $this->assertNotNull($this->stock->getName());\n }",
"public function testConstructSetsName()\n {\n self::assertNotEmpty($this->command->getName());\n }",
"private function validateName($name)\n {\n if($name != NULL && $name != \"\"){\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"public function checkInputExists($name);",
"public function testGetName() {\r\n\t\t$this->testObject->setName ( self::TEST_CONTROL_ID );\r\n\t\t$this->assertTrue ( self::TEST_CONTROL_ID == $this->testObject->getName (), 'incorrect control name returned' );\r\n\t}",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"static private function __isset($name) {}",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"public function __isset($name)\n {\n }",
"public function testStoreInvalidName(): void\n {\n $request = [\n 'name' => null,\n ];\n\n $response = $this->json('POST', '/api/menus', $request);\n\n $response->assertStatus(400);\n }",
"public function testNameValidation()\n {\n $aircraft = factory(\\App\\Aircraft::class)->create();\n $aircraft->name = '';\n $this->assertFalse($aircraft->save());\n\n $aircraft->name = str_random(201);\n $this->assertFalse($aircraft->save());\n\n $aircraft->name = str_random(200);\n $this->assertTrue($aircraft->save());\n }",
"public function hasName(): bool\n {\n return $this->nameAttr !== NULL;\n }"
] | [
"0.7126883",
"0.7051787",
"0.70507437",
"0.70507437",
"0.7032379",
"0.7005613",
"0.7003814",
"0.69903255",
"0.6954094",
"0.6922928",
"0.682972",
"0.6669657",
"0.6656195",
"0.6620851",
"0.6606527",
"0.65667284",
"0.65667284",
"0.6566536",
"0.6566536",
"0.6566536",
"0.6565861",
"0.6565432",
"0.65647787",
"0.65647787",
"0.65647787",
"0.65647787",
"0.65647787",
"0.6558251",
"0.652443",
"0.65174365"
] | 0.71519655 | 0 |
Test map to name | public function testMapToName() {
$name = 'some_name';
$otherName = 'other_name';
$this->Field->name($name);
$this->assertSame($name, $this->Field->mapToName());
$this->Field->map(null, $otherName);
$this->assertSame($otherName, $this->Field->mapToName());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetAllNames()\n {\n $map = $this->driver->getAllNames();\n $this->assertCount(1, $map);\n $types = array(\n 'http://rdfs.org/sioc/ns#Post' => 'Test\\\\Midgard\\\\CreatePHP\\\\Model',\n );\n $this->assertEquals($types, $map);\n }",
"public function testGetByName()\n {\n $types = [\n TableMap::TYPE_PHPNAME => 'Title',\n TableMap::TYPE_CAMELNAME => 'title',\n TableMap::TYPE_COLNAME => 'book.title',\n TableMap::TYPE_FIELDNAME => 'title',\n TableMap::TYPE_NUM => 1\n ];\n\n $book = new Book();\n $book->setTitle('Harry Potter and the Order of the Phoenix');\n\n $expected = 'Harry Potter and the Order of the Phoenix';\n foreach ($types as $type => $name) {\n $result = $book->getByName($name, $type);\n $this->assertEquals($expected, $result);\n }\n }",
"public function test_current_map()\n {\n $this->assertSame('Heelsum Single 01', $this->postScriptumServer->currentMap());\n }",
"public function testMap() {\n $data = array(\n 'foo' => 'bar',\n 'boolean' => true,\n 'null' => null,\n 'array' => array(),\n 'number' => 123\n );\n\n $this->assertEquals(array(\n 'foo' => 'BAR',\n 'boolean' => true,\n 'null' => null,\n 'array' => array(),\n 'number' => 123\n ), Hash::map($data, 'strtoupper'));\n\n $this->assertEquals(array(\n 'foo' => 0,\n 'boolean' => 1,\n 'null' => 0,\n 'array' => array(),\n 'number' => 123\n ), Hash::map($data, 'intval'));\n\n $this->assertEquals(array(\n 'foo' => 'string',\n 'boolean' => 'true',\n 'null' => 'null',\n 'array' => array(),\n 'number' => 'number'\n ), Hash::map($data, function($value) {\n if (is_numeric($value)) {\n return 'number';\n } elseif (is_bool($value)) {\n return $value ? 'true' : 'false';\n } elseif (is_null($value)) {\n return 'null';\n } elseif (is_string($value)) {\n return 'string';\n } else {\n return $value;\n }\n }));\n }",
"function test_getMapById() {\r\n\t\t$myArray= MemberClassesDB::getMap('memberClassId', 'memberClassName');\r\n\t\t$this->assertEqual($myArray['1'], \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myArray['1']);\r\n\t\t$this->assertEqual($myArray['2'], 'nosher',\r\n\t\t\t\t\"Should return nosher for key of 2 but returned \".$myArray['2']);\r\n\t}",
"public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }",
"public function test_current_map()\n {\n $this->assertSame('Al Basrah AAS v1', $this->btwServer->currentMap());\n }",
"function MultiMapTestCase($name = 'MultiMap test', $class_name) {\n $this->UnitTestCase($name);\n $this->class_name = $class_name;\n }",
"public function test_admin_change_map()\n {\n $this->assertTrue($this->postScriptumServer->adminChangeMap('Heelsum Single 01'));\n }",
"public function test_next_map()\n {\n $this->assertSame('Driel Single 01', $this->postScriptumServer->nextMap());\n }",
"function get_map(array $map)\n{\n\tforeach($map as $k => $v)\n\t{\n\t\tif(get_has($k))\n\t\t{\n\t\t\t$v(get($k));\n\t\t}\n\t}\n}",
"public function forName();",
"public function testIfMapsContainProperData()\n {\n $factory = new FileSystemMapFactory();\n $maps = $factory->create($this->data);\n $count = 0;\n\n foreach ($this->data as $name => $mapData) {\n /** @var FileSystemMap $map */\n $map = $maps[$count];\n\n $this->assertEquals($this->data[$name]['src'], $map->getSource());\n $this->assertEquals($this->data[$name]['dst'], $map->getDestination());\n\n if (isset($this->data['client'])) {\n $this->assertEquals($this->data['client'], $map->getClient());\n }\n\n $this->assertEquals($name, $map->getName());\n\n $count++;\n }\n }",
"function map_named($name, $pattern, $defaults=false, $requirements=false) {\n\t\t# parse pattern into regex\n\t\t$this->maps[$name] = new UsherMap($pattern, $defaults, $requirements);\n\t}",
"function test_getNameById() {\r\n\t\t$myName = MemberClassesDB::getNameById(1);\r\n\t\t$this->assertEqual($myName, \"reader\",\r\n\t\t\t\t\"Should return reader for key of 1 but returned \".$myName);\r\n\t}",
"public function test_next_map()\n {\n $this->assertSame('Belaya AAS v1', $this->btwServer->nextMap());\n }",
"public function test_admin_change_map()\n {\n $this->assertTrue($this->btwServer->adminChangeMap('Al Basrah AAS v1'));\n }",
"public function test_admin_change_map()\n {\n $this->assertTrue($this->btwServer->adminChangeMap('Al Basrah AAS v1'));\n }",
"public function test_next_map()\n {\n $this->assertSame('Al Basrah Insurgency v1', $this->btwServer->nextMap());\n }",
"public function test1()\n {\n $map = $this->dataLayer->tstTestMap1(100);\n $this->assertInternalType('array', $map);\n $this->assertCount(3, $map);\n $this->assertEquals(1, $map['c1']);\n $this->assertEquals(2, $map['c2']);\n $this->assertEquals(3, $map['c3']);\n }",
"public function testGetName()\n {\n $data_from_collection = $this->data['annual_collection'];\n $this->assertEquals(\n $data_from_collection['attributes']['plan_name'],\n $this->makePlan($data_from_collection)->getName()\n );\n\n $data_from_site = $this->data['annual_site'];\n $this->assertEquals($data_from_site['name'], $this->makePlan($data_from_site)->getName());\n }",
"public function testIfMapBagContainsMaps()\n {\n $factory = new FileSystemMapFactory();\n $result = $factory->create($this->data);\n\n $this->assertContainsOnlyInstancesOf('\\SyncFS\\Map\\FileSystemMap', $result);\n }",
"public function testGetName()\n\t{\n\t\t$this->assertEquals($this->filterName, $this->filter->getName());\n\t}",
"public function testGetName() {\r\n\t\t$this->testObject->setName ( self::TEST_CONTROL_ID );\r\n\t\t$this->assertTrue ( self::TEST_CONTROL_ID == $this->testObject->getName (), 'incorrect control name returned' );\r\n\t}",
"public function testGetName() {\r\n $action = $this->_action->setName('name');\r\n $this->assertEquals('name', $action->getName());\r\n }",
"public function testMap2()\n\t{\n\t\tTestReflection::invoke($this->_state, 'set', 'content.type', 'tag');\n\t\t$a = TestReflection::invoke($this->_instance, 'map', 1, array(5), true);\n\t\t$this->assertEquals(true, $a);\n\n\t\tTestReflection::invoke($this->_state, 'set', 'tags.content_id', '1');\n\t\t$actual = TestReflection::invoke($this->_instance, 'getList');\n\n\t\t$this->assertEquals(1, count($actual));\n\t}",
"public function testGetName()\n {\n $reflectedProperty = new PropertyReflection('TRex\\Reflection\\resources\\Foo', 'foo');\n $this->assertSame('foo', $reflectedProperty->getName());\n }",
"public function testMethodSetName()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setName(\"One\");\n\n $name = $scorebox->getName();\n\n $expName = \"One\";\n\n $this->assertEquals($name, $expName);\n }",
"function mapUsername($username) {\n $toMap = array(\n 'lauri^^' => 'Ladexi',\n 'luckyalfa' => 'lalfa',\n 'krudda' => 'Imperf3kt',\n 'chhotu_uttam' => 'Chhotu uttam',\n 'satenruiko' => 'dbx10',\n 'lizbeth' => 'Vazkii',\n 'fenn' => 'Pokefenn',\n );\n if(isset($toMap[strtolower($username)])) {\n $username = $toMap[strtolower($username)];\n }\n return $username;\n}",
"public function testMethodGetName()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setName(\"One\");\n\n $name = $scorebox->getName();\n\n $expName = \"One\";\n\n $this->assertEquals($name, $expName);\n }"
] | [
"0.5975919",
"0.5895288",
"0.5871153",
"0.57848126",
"0.5763042",
"0.57526976",
"0.57526976",
"0.5728262",
"0.5719286",
"0.5699202",
"0.56887025",
"0.5680997",
"0.5672517",
"0.5656439",
"0.5645749",
"0.5645567",
"0.5644338",
"0.5644338",
"0.5612955",
"0.5545627",
"0.55391526",
"0.55116534",
"0.5490813",
"0.54698455",
"0.54562694",
"0.5443311",
"0.538442",
"0.5367253",
"0.5364337",
"0.5359513"
] | 0.66781116 | 0 |
Print the remainder of the head contents, after the title is removed. | function head()
{
print($this->_head);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function printHead()\n\t{\n\t\t$out = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . \"\\n\";\n\t\t$out .= $this->head . PHP_EOL;;\t\t\t\n\t\techo $out;\n\t}",
"public function show_head() {\n \n $output = '<head>';\n \n if( empty( $this->title ) ) {\n $this->title = \"No Title Available\";\n } \n\n $output .= '<title>' . $this->title . '</title>';\n $output .= $this->get_header_elements();\n $output .= \"\\n</head>\";\n\n echo $output;\n }",
"public function printTitle() {\n\t\techo $this->title;\n\t}",
"public function head() {\n\t\treturn '';\n\t}",
"public function head() {\r\n return '';\r\n }",
"protected function printHead($prefix='')\n {\n echo $prefix.'<HEAD>';\n if($this->getBrowserName() === 'IE')\n {\n $this->printIeCompatability($prefix.$prefix);\n }\n echo $prefix.$prefix.'<TITLE>'.$this->title.'</TITLE>';\n echo $prefix.$prefix.'<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">';\n foreach($this->head_tags as $tag)\n {\n echo $prefix.$prefix.$tag.\"\\n\";\n }\n echo $prefix.'</HEAD>';\n }",
"function print_head_scripts()\n {\n }",
"public function display($head)\n {\n $start = $head;\n while ($start) {\n echo $start->data,' ';\n $start = $start->next;\n }\n }",
"public function renderHeadSection()\n\t{\n\t\treturn \"\";\n\t}",
"private function pageheader_print() {\n\t\tif (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t# HTML prepage requirements.\n\t\tforeach ($this->_pageheader as $line)\n\t\t\techo $line.\"\\n\";\n\n\t\t# Page Title\n\t\techo '<head>';\n\t\tprintf('<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />');\n\n\t\t$DNs = get_request('dn','REQUEST');\n\t\tif (is_array($DNs))\n\t\t\t$DNs = '';\n\n\t\tif (isset($_SESSION[APPCONFIG]))\n\t\t\tprintf('<title>%s (%s) - %s%s</title>',\n\t\t\t\t$this->_app['title'],\n\t\t\t\tapp_version(),\n\t\t\t\t$DNs ? htmlspecialchars($DNs).' ' : '',\n\t\t\t\t$_SESSION[APPCONFIG]->getValue('appearance','page_title'));\n\t\telse\n\t\t\tprintf('<title>%s - %s</title>',$this->_app['title'],app_version());\n\n\t\techo '<link rel=\"shortcut icon\" href=\"images/favicon.ico\" type=\"image/vnd.microsoft.icon\" />';\n\t\t# Style sheet.\n\t\tprintf('<link type=\"text/css\" rel=\"stylesheet\" href=\"%s\" />',$this->_app['urlcss']);\n\n\t\tif (defined('JSDIR')) {\n\t\t\tprintf('<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"%sjscalendar/calendar-blue.css\" title=\"blue\" />',JSDIR);\n\t\t\techo \"\\n\";\n\t\t\tprintf('<script type=\"text/javascript\" src=\"%sajax_functions.js\"></script>',JSDIR);\n\t\t\tprintf('<script type=\"text/javascript\" src=\"%sjscalendar/calendar.js\"></script>',JSDIR);\n\t\t\techo \"\\n\";\n\t\t}\n\n\t\t# HTML head requirements.\n\t\tif (is_array($this->_head) && count($this->_head))\n\t\t\tforeach ($this->_head as $line)\n\t\t\t\techo $line.\"\\n\";\n\n\t\techo '</head>';\n\t\techo \"\\n\";\n\t}",
"private function _print_html_head()\n\t{\n\t\t$output = \"<head>\\n\";\n\t\t$output .= \"<title>{$this->title}</title>\\n\";\n\t\t$output .= $this->_print_html_head_metatags();\n\t\t$output .= $this->_print_html_head_javascript();\n\t\t$output .= $this->_print_html_head_css();\n\t\t$output .= \"</head>\\n<body>\\n\";\n\t\t\n\t\treturn $output;\n\t}",
"public function showPageHeader() {\n\n\t\techo $this->getPageHeader();\n\t}",
"public function showTestHeadline($title)\n {\n print \"*** \" . $title . \"\\n\";\n }",
"function shoestrap_empty_page_title() {}",
"function printHeader($title) {\n\tprint <<<ENDOLA\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n\t<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\" />\n\t<title>${title}</title>\nENDOLA;\n\n\tprintJQuery();\n\n\techo '</head><body>';\n}",
"private function printHeader()\n {\n $this->printer->println('Test-Flight %s', Constants::VERSION);\n }",
"function printHtmlHeader($title)\n{\n $htmlTitle = filter_var($title, FILTER_SANITIZE_SPECIAL_CHARS);\n print '<!DOCTYPE html>';\n print '<html>';\n print \"<head><title>$htmlTitle</title></head>\";\n print '<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />';\n print '<body>';\n}",
"private function cleanHead()\n {\n remove_action('wp_head', 'print_emoji_detection_script', 7);\n remove_action('wp_print_styles', 'print_emoji_styles');\n remove_action('wp_head', 'rsd_link'); //removes EditURI/RSD (Really Simple Discovery) link.\n remove_action('wp_head', 'wlwmanifest_link'); //removes wlwmanifest (Windows Live Writer) link.\n remove_action('wp_head', 'wp_generator'); //removes meta name generator.\n remove_action('wp_head', 'wp_shortlink_wp_head'); //removes shortlink.\n remove_action('wp_head', 'feed_links', 2); //removes feed links.\n remove_action('wp_head', 'feed_links_extra', 3); //removes comments feed.\n }",
"public function header()\n {\n echo \"<!doctype html>\\n<html lang='pt'>\\n<head>\\n\";\n echo \"\\t<meta charset='UTF-8'>\\n\";\n echo \"\\t<title>{$this->controller->getTitle()}</title>\\n\";\n $this->links();\n echo \"</head>\\n<body>\\n\";\n }",
"function head($title) {\r\n print(\r\n '<!DOCTYPE html>\r\n <html lang=\"en-GB\">\r\n <head>\r\n <meta charset=\"UTF-8\">\r\n <title>'.$title.'</title>\r\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/theme.css\">\r\n <link rel=\"icon\" href=\"../img/icon.png\">\r\n </head>\r\n <body>');\r\n }",
"function MidHead($title)\n {\n // Arial bold 15\n $this->SetFont('Arial','B',15);\n // Calculate width of title and position\n $w = $this->GetStringWidth($title)+6;\n $this->SetX((210-$w)/2);\n // Colors of frame, background and text\n $this->SetDrawColor(0,80,180);\n $this->SetFillColor(230,230,0);\n //$this->SetTextColor(220,50,50);\n // Thickness of frame (1 mm)\n $this->SetLineWidth(1);\n // Title\n $this->Cell($w,9,$title,1,1,'C',true);\n // Line break\n $this->Ln(10);\n }",
"public function printAll(){\n $temp = $this->head;\n while($temp != NULL){\n echo $temp->data . \" \";\n $temp = $temp->next;\n }\n }",
"function headOptimization()\r\n\t{\r\n\t\t\r\n\t\techo \"<meta name='description' content='\".$this->PageDescription().\"' />\";\r\n\t\techo \"<meta name='keywords' content='\".$this->PageKeywords().\"' />\";\r\n\t\techo \"<title>\".$this->PageTitle().\"</title>\";\r\n\t\r\n\t}",
"function PrintHtmlHead () {\n\tGlobal $ISM, $str_font;\n\tGlobal $arr_win_dir, $arr_pozip, $arr_alm;\n\tGlobal $cDb;\n\t\n\tif (isset($cDb)) {\n\t\t$sWindowTitle = GetSetting ($cDb, 'windowtitle', '');\n\t} else {\n\t\t$sWindowTitle = '';\n\t}\n\t\n\theader(\"Content-Type: text/html; charset=UTF-8\");\n\theader(\"Pragma: no-cache\");\n\theader(\"Expires: 0\");\n\theader(\"Cache-Control: must-revalidate, post-check=0,pre-check=0\");\n\t\nprint <<<EOF\n<!DOCTYPE html>\n<html>\n<head>\n<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=UTF-8'>\n<meta name='viewport' content='user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, width=device-width, height=device-height'>\n<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>\n<title>$sWindowTitle</title>\n\n<style type='text/css'>\n\nhtml, body { height: 100%; margin: 0; padding: 0; }\n\nBODY,TD,P,DIV,INPUT,SELECT,TEXTAREA {\n\tfont-family:$str_font;\n\tfont-size:12px;\n\twhite-space:nowrap;\n}\nA {\n\tcolor:#4444FF;\n\tcursor:pointer;\n\ttext-decoration:none;\n}\nA:hover {\n\ttext-decoration:underline;\n}\nINPUT,SELECT,TEXTAREA {\n\tcolor:#000000;\n\tbackground:#FFFFFF;\n\tpadding:2px;\n\tborder:1px solid #BBBBBB;\n}\nINPUT:-moz-read-only {\n\tbackground:#DDDDDD;\n\tborder:1px solid #DDDDDD;\n}\nINPUT:read-only {\n\tbackground:#DDDDDD;\n\tborder:1px solid #DDDDDD;\n}\n.TopCurtain {\n\nEOF;\n\techo (\"\tposition:fixed; top:\".($ISM?50:0).\"px; left:0; right:0; height:16px;\\n\");\nprint <<<EOF\n\tbackground:linear-gradient(rgba(0,0,0,0.1),rgba(0,0,0,0));\n\tpointer-events: none;\n}\n.ReadBorder {\n\tborder-width:3px;\n\tborder-style:solid;\n\tpadding:5px;\n\tborder-color:#FF8888;\n\tbackground:#FFEEEE;\n}\n.OrangeBorder {\n\tborder-width:3px;\n\tborder-style:solid;\n\tpadding:5px;\n\tborder-color:#FFBB88;\n\tbackground:#FFFFFF;\n}\n.OrangeFont {\n\tcolor:#EE6633;\n\tfont-weight:bold;\n}\n.TitleFont {\n\tcolor:#666666;\n\tfont-weight:bold;\n}\n.SubMenu {\n\tcolor:#444444;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tborder-radius:7px;\n}\n.SubMenu:hover {\n\tbackground:#DDDDDD;\n}\n.SubMenuSel {\n\tcolor:#444444;\n\tbackground:#FFFFFF;\n\tfont-weight:bold;\n\tcursor:pointer;\n\tborder-radius:7px;\n}\n\n.msgPopupBox {\n\tz-index:3;\n\tdisplay: none;\n\tposition:fixed;\n\tmargin:0;\n\ttop:0;\n\tleft:0;\n\tright:0;\n\tbottom:0;\n\theight:100%;\n\twidth:100%;\n\tbackground-color:rgba(0,0,0,0.7);\n}\n.msgPopupInn {\n\tdisplay: table-cell;\n\tvertical-align: middle;\n\ttext-align:center;\n}\n.msgPopupTxt {\n\tdisplay:inline-block;\n\tcolor:#FFFFFF;\n\tborder:1px solid rgba(0,0,0,0.5);\n\tbox-shadow: 0 2px 10px 5px rgba(0,0,0,0.2);\n\tpadding:15px;\n\tborder-radius:10px;\n\ttext-align:center;\n\t\n\tbackground-color: #008800;\n\tbackground-image: linear-gradient(-45deg,\n\t\trgba(255, 255, 255, 0) 22.9%,\n\t\trgba(255, 255, 255, 0.1) 23%,\n\t\trgba(255, 255, 255, 0.1) 50%,\n\t\trgba(255, 255, 255, 0) 50.1%,\n\t\trgba(255, 255, 255, 0) 72.9%,\n\t\trgba(255, 255, 255, 0.1) 73%);\n\tbackground-size: 20px 20px;\n\t-webkit-background-size:20px 20px;\n\tbackground-repeat: repeat;\n}\n\n.mMenuLogin {\n\tpadding-left:6px;\n\tpadding-right:6px;\n\tpadding-top:4px;\n\tpadding-bottom:4px;\n\tmargin-right:10px;\n\tmargin-left:10px;\n\tfont-weight:bold;\n\tcolor:#FFFFFF;\n\tborder-radius:20px;\n\tborder:2px solid #FFFFFF;\n}\n.mMenuItem {\n\tcursor:pointer;\n\tpadding-top:12px;\n\tpadding-bottom:12px;\n\tpadding-left:16px;\n\tpadding-right:32px;\n\tfont-weight:bold;\n\tbackground:#FFFFFF;\n}\n.mMoveLast {\n\tbackground:rgba(255,255,255,0.7);\n\tborder-radius:10px;\n\tborder:1px solid rgba(0,0,0,0.5);\n\tcolor:rgba(0,0,0,0.5);\n}\n\n.windImg {\n\twidth:16px;\n\theight:16px;\n\tvertical-align:middle;\n}\n\n</style>\n\n<script type='text/javascript'>\n\nEOF;\necho (\"\tvar ism = \".($ISM?1:0).\";\\n\");\nprint <<<EOF\n\nvar gEcBusy=false;\n/*\nwindow.addEventListener('error', function(e) {\n\tif (gEcBusy) return;\n\tgEcBusy = true;\n\tif ((document.getElementById('map') != null) && (map.innerHTML == '')) {\n\t\t// MAP loading error\n\t\tmap.innerHTML = \"<table width='100%' height='100%'><tr><td align='center'><h3>Wait...</h3></td></tr></table>\";\n\t\tsetTimeout ('location.reload()',3000);\n\t} else\n\tif (document.getElementById('msgPopupTxt') != null) {\n\t\tvar msg = 'EC#'+e.lineno+':'+e.colno+'<p>'+e.message+'</p>';\n\t\tmsg += \"<input type='button' value='Close' onclick='MsgPopupHideGo()' class='pure-button'> <input type='button' value='Reload' onclick='location.reload()' class='pure-button'>\";\n\t\tMsgPopupError (msg, 0);\n\t} else {\n\t\talert ('EC#'+e.lineno+':'+e.colno+'\\\\n'+e.message);\n\t}\n\tPrintAll(e.target);\n}, true);\n*/\nwindow.onerror = function(emsg, url, eline, ecol, eerror) {\n\tif (gEcBusy) return true;\n\tgEcBusy = true;\n\tif ((document.getElementById('map') != null) && (map.innerHTML == '')) {\n\t\t// MAP loading error\n\t\tmap.innerHTML = \"<table width='100%' height='100%'><tr><td align='center'><h3>Wait...</h3></td></tr></table>\";\n\t\tsetTimeout ('location.reload()',3000);\n\t} else\n\tif (document.getElementById('msgPopupTxt') != null) {\n\t\tvar msg = '<p>EC#';\n\t\tmsg += eline ? eline : 'unknown';\n\t\tif (ecol) msg += ':' + ecol;\n\t\tmsg += '</p>';\n\t\tif (emsg) msg += '<p>'+emsg+'</p>';\n\t\tif ((emsg) && (eerror) && (emsg.indexOf(eerror) < 0)) msg += '<p>'+eerror+'</p>';\n\t\tif (url) msg += '<p>'+url+'</p>';\n\t\tmsg += \"<input type='button' value='Close' onclick='MsgPopupHideGo()' class='pure-button'> <input type='button' value='Reload' onclick='location.reload()' class='pure-button'>\";\n\t\tMsgPopupError (msg, 0);\n\t} else {\n\t\tvar msg = 'EC#';\n\t\tmsg += eline ? eline : 'unknown';\n\t\tif (ecol) msg += ':' + ecol;\n\t\tif (emsg) msg += '\\\\n'+emsg;\n\t\tif ((emsg) && (eerror) && (emsg.indexOf(eerror) < 0)) msg += '\\\\n'+eerror;\n\t\tif (url) msg += '\\\\n'+url;\n\t\talert (msg);\n\t}\n\treturn true;\n};\n\n// Prohibited area selection.\nfunction ReturnFalse () {\n\treturn false;\n}\nwindow.document.onselectstart = ReturnFalse;\nwindow.document.ondragstart = ReturnFalse;\nif (navigator.userAgent.indexOf('Firefox') >= 0) {\n\tvar eventNames = [\"mousedown\",\"mouseover\",\"mouseout\",\"mousemove\",\"mousedrag\",\"click\",\"dblclick\",\"keydown\",\"keypress\",\"keyup\"];\n\tfor(var i=0; i<eventNames.length; i++) {\n\t\twindow.addEventListener( eventNames[i], function(e) { window.event = e; }, true );\n\t}\n}\n\nfunction pwKeyCursor (npobj) {\n\tvar nplen = npobj.value.length;\n\tnpobj.setSelectionRange(nplen, nplen);\n}\nfunction pwKeyDown () {\n\tvar e = event || window.event;\n\tvar keycode = e.keyCode || e.charCode;\n\tif ((33 <= keycode) && (keycode <= 40)) {\n\t\tif (e.preventDefault) e.preventDefault(); else e.stop();\n\t}\n}\nfunction pwKeyPress (obj) {\n\tvar e = event || window.event;\n\tvar keycode = e.keyCode || e.charCode;\n\tif (keycode == 13) return;\n\tif (keycode == 8) return;\n\t\n\tvar npobj = obj;\n\tvar opobj = eval(obj.form.name+'.'+obj.name.slice(0, -1));\n\tnpobj.value += '*';\n\topobj.value += String.fromCharCode(keycode);\n\tif (e.preventDefault) e.preventDefault(); else e.stop();\n\tobj.blur();\n\tobj.focus();\n}\nfunction pwKeyUp (obj) {\n\tvar npobj = obj;\n\tvar opobj = eval(obj.form.name+'.'+obj.name.slice(0, -1));\n\tvar nplen = npobj.value.length;\n\tvar oplen = opobj.value.length;\n\tif (nplen < oplen) opobj.value = opobj.value.substr(0, nplen);\n\telse if (oplen < nplen) opobj.value += npobj.value.substr(oplen);\n\telse return;\n\tnpobj.value = '';\n\tfor (var i=0; i<nplen; i++) npobj.value += '*';\n\tobj.blur();\n\tobj.focus();\n}\n\nfunction PrintAll (obj) {\n\tvar msg = ''\n\tfor (propName in obj) try { msg += propName+'='+obj[propName]+'\\\\n'; } catch (err) { }\n\talert(msg);\n}\n\nfunction SetCookie(cKey, cValue) {\n\tdocument.cookie = cKey + '=' + escape(cValue);\n}\nfunction SetCookie(cKey, cValue, iValid) {\n\tvar date = new Date();\n\tdate.setDate(date.getDate() + iValid);\n\tdocument.cookie = cKey + '=' + escape(cValue) + ';expires=' + date.toGMTString();\n}\nfunction DelCookie(cKey) {\n\tvar date = new Date();\n\tdate.setDate(date.getDate() - 1);\n\tdocument.cookie = cKey + '=;expires=' + date.toGMTString();\n}\nfunction GetCookie(cKey, cDef) {\n\tvar cookies = document.cookie.split(\"; \");\n\tfor (var i = 0; i < cookies.length; i++) {\n\t\tvar keyValues = cookies[i].split(\"=\");\n\t\tif ((0 < keyValues.length) && (keyValues[0] == cKey)) return unescape(keyValues[1]);\n\t}\n\treturn cDef;\n}\n\nvar hMsgTimeout = null;\nfunction MsgPopupColor (msg, c, ms, ani) {\n\tif (hMsgTimeout != null) {\n\t\tclearTimeout(hMsgTimeout);\n\t\thMsgTimeout = null;\n\t}\n\t$('#msgPopupTxt').html(msg);\n\t$('#msgPopupTxt').css('background-color',c);\n\t$('#msgPopupBox').css('display','table');\n\tif (0 < ms) hMsgTimeout = setTimeout (MsgPopupHideGo,ms);\n\tif (ani) $('#msgPopupTxt').animate({zoom:'110%'},100).animate({zoom:'95%'},100).animate({zoom:'100%'},100);\n}\nfunction MsgPopupOnly (msg, ms) {\t// no animation\n\tMsgPopupColor (msg, '#008800', ms, false);\n}\nfunction MsgPopupShow (msg, ms) {\t// normal dialog box + popup animation\n\tMsgPopupColor (msg, '#008800', ms, true);\n}\nfunction MsgPopupError (msg, ms) {\t// error dialog box + popup animation\n\tMsgPopupColor ('<img src=\"img/attention.png\" style=\"vertical-align:top\"> '+msg, '#B81900', ms, true);\n}\nfunction MsgPopupHideGo () {\n\thMsgTimeout = null;\n\t$('#msgPopupBox').fadeOut();\n}\nfunction MsgPopupHide () {\n\tif (hMsgTimeout != null) {\n\t\tclearTimeout(hMsgTimeout);\n\t\tMsgPopupHideGo ();\n\t}\n}\n\nfunction js_number_format (num, decimals, zero) {\n\tif (typeof num != 'number') return '';\n\tnum = num.toFixed(decimals);\n\tvar reg = /(^[+-]?\\d+)(\\d{3})/;\n\tvar tmp = num.split('.');\n\tvar n = tmp[0];\n\tvar d = tmp[1];\n\tif (d) {\n\t\tvar l = d.length;\n\t\tif (zero === 0) {\n\t\t\twhile (0 < l) {\n\t\t\t\tif (d.charAt(l-1) != '0') break;\n\t\t\t\td = d.substring (0, --l);\n\t\t\t}\n\t\t}\n\t\td = (0<l) ? ('.' + d) : '';\n\t} else {\n\t\td = '';\n\t}\n\t\n\twhile(reg.test(n)) n = n.replace(reg, \"$1,$2\");\n\treturn n + d;\n}\n\nEOF;\n\techo (\"var arr_win_dir = [\");\n\tfor ($i=0; $i<sizeof($arr_win_dir); $i++) {\n\t\tif (0 < $i) echo (\",\");\n\t\techo (\"'$arr_win_dir[$i]'\");\n\t}\n\techo (\"];\\n\");\n\techo (\"var arr_pozip = [\");\n\tfor ($i=0; $i<sizeof($arr_pozip); $i++) {\n\t\tif (0 < $i) echo (\",\");\n\t\techo (\"'$arr_pozip[$i]'\");\n\t}\n\techo (\"];\\n\");\n\techo (\"var arr_alm = [\");\n\tfor ($i=0; $i<sizeof($arr_alm); $i++) {\n\t\tif(0 < $i) echo (\",\");\n\t\techo (\"'$arr_alm[$i]'\");\n\t}\n\techo (\"];\\n\");\nprint <<<EOF\n\nfunction js_item_format\t(val, dec, zero) {\n\tif ((0 <= dec) && (dec <= 9)) {\n\t\treturn js_number_format (val, dec, zero);\n\t}\n\tif (10 == dec) {\t// Special code: wind_direction\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 1) || (16 < val)) val = 1;\n\t\treturn arr_win_dir[val-1] + \" <img src='img/windd\"+val+\".png' class='windImg'>\";\n\t}\n\tif (11 == dec) {\t// Special code: pozip\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 0) || (1 < val)) val = 0;\n\t\treturn arr_pozip[val];\n\t}\n\tif (12 == dec) {\t// Special code: alm\n\t\tif (typeof val != 'number') val = parseInt(val);\n\t\telse val = Math.round(val);\n\t\tif ((isNaN(val)) || (val < 0) || (3 < val)) val = 0;\n\t\treturn arr_alm[val];\n\t}\n\treturn val;\n}\n\nEOF;\n\tif ($ISM) {\nprint <<<EOF\n\nvar menuStatus = false;\nfunction mfc(action) {\n\tMenuClose(1);\n\tdocument.location = action;\n}\nfunction MenuClose (opt) {\n\tif (opt != 1) {\n\t\tmenuStatus = false;\n\t\t$('body,html').css({'overflow':'visible'});\n\t\t$('body').unbind('touchmove');\n\t\t$('#menuBack').fadeOut();\n\t}\n\tvar obj = $('#menuMenu');\n\tvar w = obj.width()+10;\n\tobj.animate({left:-w});\n}\nfunction MenuClick () {\n\tmenuStatus = true;\n\t$('body,html').css({'overflow':'hidden'});\n\t$('body').bind('touchmove', function(e){if(e.preventDefault)e.preventDefault();else e.stop()});\n\t$('#menuBack').fadeIn();\n\t\n\tvar obj = $('#menuMenu');\n\tvar w = obj.width()+10;\n\tobj.css({left:-w});\n\tobj.animate({left:0});\n}\nfunction MoveLastUp() {\n\t$('body').scrollTop(0);\n}\nfunction MoveLastDn() {\n\t$('body').scrollTop($(document).height());\n}\n\n// Call from Android APP.\nvar mMyLat = 0, mMyLng = 0;\nfunction SetLocation (lat, lng) {\n\tmMyLat = lat;\n\tmMyLng = lng;\n\tif (typeof OnMyLocation == 'function') OnMyLocation (false);\n}\n\nEOF;\n\t} else {\n\t\tif ($sWindowTitle != '') echo (\"try{parent.document.title='$sWindowTitle';}catch(err){}\\n\");\n\t}\n\techo (\"</script>\\n\");\n}",
"function getHead() {\n return '';\n // return $this->document->getHead();\n }",
"function heading() {\n\t?>\n\t\t<!DOCTYPE html>\n\t\t<html>\n\t\t\t<head>\n\t\t\t\t<meta charset=\"utf-8\" />\n\t\t\t\t<title>Remember the Cow</title>\n\t\t\t\t<link href=\"https://webster.cs.washington.edu/css/cow-provided.css\" \n\t\t\t\t type=\"text/css\" rel=\"stylesheet\" />\n\t\t\t\t<link href=\"cow.css\" type=\"text/css\" rel=\"stylesheet\" />\n\t\t\t\t<link href=\"https://webster.cs.washington.edu/images/todolist/favicon.ico\" \n\t\t\t\t type=\"image/ico\" rel=\"shortcut icon\" />\n\t\t\t</head>\n\n\t\t\t<body>\n\t\t\t\t<div class=\"headfoot\">\n\t\t\t\t\t<h1>\n\t\t\t\t\t\t<img src=\"https://webster.cs.washington.edu/images/todolist/logo.gif\" alt=\"logo\" />\n\t\t\t\t\t\tRemember<br />the Cow\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t<?php\n\t}",
"public static function showHeader() {\r\n\t\t$title = (array_key_exists('headertitle', $_SESSION))?\r\n\t\t\t$_SESSION['headertitle']:\"\";\r\n\t\t\r\n\t\techo \"<!DOCTYPE html>\\n\";\r\n\t\techo \"<html>\\n\";\r\n\t\techo \"<head>\\n\";\r\n\t\techo \"<title>$title</title>\\n\";\r\n\t\techo \"</head>\\n\\t<body>\\n\";\r\n }",
"function print_head_scripts() {\n\tglobal $asc_scripts, $concatenate_scripts;\n\n\tif ( ! did_action('asc_print_scripts') ) {\n\t\t/** This action is documented in functions.asc-scripts.php */\n\t\tdo_action( 'asc_print_scripts' );\n\t}\n\n\tif ( !is_a($asc_scripts, 'ASC_Scripts') )\n\t\t$asc_scripts = new ASC_Scripts();\n\n\tscript_concat_settings();\n\t$asc_scripts->do_concat = $concatenate_scripts;\n\t$asc_scripts->do_head_items();\n\n\t/**\n\t * Filter whether to print the head scripts.\n\t *\n\t * @since 2.8.0\n\t *\n\t * @param bool $print Whether to print the head scripts. Default true.\n\t */\n\tif ( apply_filters( 'print_head_scripts', true ) ) {\n\t\t_print_scripts();\n\t}\n\n\t$asc_scripts->reset();\n\treturn $asc_scripts->done;\n}",
"function title()\n {\n print($this->_title);\n }",
"function showHTMLHeaderWithTitle($title = '') {\r\n\techo '<!DOCTYPE html>'; // započinje ispravan HTML blok koda\r\n\r\n\techo '<html lang=\"hr\">'; // postavlja jezik stranice na hrvatski\r\n\r\n\techo '<head>'; // započinje HEAD dio HTML stranice\r\n\r\n\techo '<meta charset=\"utf-8\">'; // postavlja kodiranje stranice na UTF-8\r\n\r\n\techo '<title>'; // započinje postavljanje naslova stranice koji se prikazuje u pregledniku kod bookmarka i u nazivu prozora ili taba\r\n\techo (isset($title) && !empty($title) ? $title.' :: ' : ''); // prikazuje naslov putem inline if-a, ako je postavljen\r\n\techo 'Bankomati'; // na kraju naslova uvijek doda naziv aplikacije Bankomati\r\n\techo '</title>';// završava postavljanje naslova stranice\r\n\r\n\techo '</head>'; // završava HEAD dio HTML stranice\r\n\r\n\techo '<body>'; // započinje BODY dio HTML stranice\r\n\t// prikazuje naslov kao heading (poglavlje stranice) putem običnog if-a, ako je postavljen\r\n\tif (\r\n\t\tisset($title) \r\n\t\t&& \r\n\t\t!empty($title)\r\n\t) {\r\n\t\techo '<h1>'; // započinje postavljanje headinga (poglavlja) stranice nivoa 1\r\n\t\techo $title;\r\n\t\techo '</h1>'; // završava postavljanje headinga (poglavlja) stranice nivoa 1\r\n\t}\r\n\techo '<hr/>'; // ispisuje horizontalku\r\n}"
] | [
"0.702319",
"0.69506586",
"0.66625535",
"0.64830303",
"0.6461335",
"0.6445953",
"0.64183426",
"0.63166505",
"0.6307648",
"0.63072115",
"0.6306825",
"0.63003266",
"0.6283586",
"0.6280708",
"0.62274814",
"0.62072176",
"0.61740875",
"0.6163192",
"0.6140546",
"0.6122661",
"0.6117897",
"0.6090949",
"0.60900533",
"0.6087269",
"0.603413",
"0.60202634",
"0.60097957",
"0.5993285",
"0.5986141",
"0.59850806"
] | 0.7106884 | 0 |
Print a single property. Properties found in tags are named meta.[propertyName]. Properties found on the tag as attributes are named body.[propertyName]. | function property($property_name, $default = NULL, $formatted = false)
{
$property_value = $this->get_property($property_name, $default);
if ($property_value != NULL)
{
if ($formatted)
{
if (preg_match("/^(body|meta).(.*)$/", $property_name, $match))
{
$property_prefix = $match[1];
$property_name_cut = $match[2];
}
else
{
die("Invalid property name: $property_name.\n");
}
if ($property_prefix == "meta")
{
$meta_type = $this->_meta_property_types[$property_name];
$before = "<meta $meta_type=\"$property_name_cut\" content=\"";
$after = "\" />";
}
else if ($property_prefix == "body")
{
$before = " $property_name_cut=\"";
$after = "\"";
}
else
{
die("Impossible branch: $property_name => $property_prefix $property_name_cut");
}
}
else
{
$before = "";
$after = "";
}
print "$before$property_value$after";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __get($property) \n {\n echo '<br>';\n echo \"Ban vua truy cap vao thuoc tinh {$property} khong ton tai trong class - AAAAAAA\";\n echo '<br>';\n }",
"public function tag( $property, $content ) {\n\t\tif ( empty( $content ) || ! is_scalar( $content ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$tag = 'facebook' === $this->network ? 'property' : 'name';\n\t\tprintf(\n\t\t\t'<meta %1$s=\"%2$s\" content=\"%3$s\">' . \"\\n\",\n\t\t\tesc_attr( $tag ),\n\t\t\tesc_attr( $property ),\n\t\t\tesc_attr( $content )\n\t\t);\n\t}",
"public function toString()\n {\n return sprintf('<meta property=\"%s\" content=\"%s\"/>', $this->porperty, $this->content);\n }",
"function displayProperties ()\n {\n foreach ($this as $key => $property)\n {\n echo $key . ':' . $property . '<br>';\n }\n }",
"private function get_context_meta_value( $property_name )\n\t{\n\t\t$output = '';\n\t\t$context = $this->context();\n\n\t\tif ( method_exists( $context, $property_name ) ) {\n\t\t\t$output = $context->{ $property_name }();\n\t\t}\n\n\t\tif ( empty( $output ) ) {\n\t\t\treturn $this->get_config_meta_value( $property_name );\n\t\t}\n\n\t\treturn htmlspecialchars( strip_tags( $output ), ENT_QUOTES );\n\t}",
"public function getProperty();",
"public function __get($property) {\n\t\tswitch($property) {\n\t\t\tcase 'sectionTag':\n\t\t\t\treturn $this->stepSection->tag;\n\n\t\t\tcase 'stepSection':\n\t\t\t\treturn $this->stepSection;\n\n\t\t\tdefault:\n\t\t\t\treturn parent::__get($property);\n\t\t}\n\t}",
"function print_meta_tag() : void {\n\n\t$payment_pointer_id = get_payment_pointer();\n\t$payment_pointer_url = $payment_pointer_id;\n\n\t// check if url starts with $\n\tif ( $payment_pointer_url[0] === '$' ) {\n\t\t// replace $ with https://\n\t\t$payment_pointer_url = str_replace( '$', 'https://', $payment_pointer_url );\n\t\t// remove trailing slash\n\t\t$payment_pointer_url = rtrim( $payment_pointer_url, '/' );\n\t\t// check if url path exists\n\t\t$parsed_url = wp_parse_url( $payment_pointer_url, PHP_URL_PATH );\n\n\t\t// if no url path, append /.well-known/pay\n\t\tif ( empty( $parsed_url ) ) {\n\t\t\t$payment_pointer_url = $payment_pointer_url . '/.well-known/pay';\n\t\t}\n\t}\n\n\tif ( ! empty( $payment_pointer_id ) ) {\n\t\techo '<meta name=\"monetization\" content=\"' . esc_attr( $payment_pointer_id ) . '\" />' . PHP_EOL;\n\t\techo '<link rel=\"monetization\" href=\"' . esc_url( $payment_pointer_url ) . '\" />' . PHP_EOL;\n\t}\n}",
"public function property($propertyIdent);",
"public function show(Property $property)\n {\n //\n }",
"public function show(Property $property)\n {\n //\n }",
"private function get_config_meta_value( $property_name )\n\t{\n\t\t$output = '';\n\t\t$config = $this->cfg();\n\n\t\tif ( method_exists( $config, $property_name ) ) {\n\t\t\t$output = $this->cfg()->{ $property_name }();\n\t\t}\n\t\telse {\n\t\t\t$prop = $this->cfg()->p( $property_name );\n\n\t\t\tif ( $prop ) {\n\t\t\t\t$output = $prop->text();\n\t\t\t}\n\t\t}\n\n\t\treturn htmlspecialchars( strip_tags( $output ), ENT_QUOTES );\n\t}",
"function prop($prop)\n {\n \treturn $this->get_property($prop);\n }",
"public static function property(string $property, string $content): MetaTag {\n return new MetaTag(['property' => $property, 'content' => $content]);\n }",
"public function __get($property) {\n\t\tif (property_exists($this, $property)) {\n\t\t\treturn $this->$property.\"<br>\";\n\t\t} else {\n\t\t\treturn $property.\" does not exist<br>\";\n\t\t}\n\t}",
"public function propertyFast($property, $content, $addTagAttributes = NULL) {\n // start tag\n $code = '<div property=\"' . $property . '\" content=\"' . $content . '\"';\n // additional tag attributes string (starts with whitespace)\n // if (isset) \n if ($addTagAttributes != '')\n $code .= ' ' . $addTagAttributes;\n // end tag\n $code .= '></div>' . \"\\n\";\n return $code;\n }",
"public function getProperty($property = null);",
"public function getProperty(): string;",
"abstract public function property($propertyIdent);",
"abstract public function getPropertyShort();",
"public function test_output() {\n\t\tpapi_render_property( $this->property );\n\t\t$this->expectOutputRegex( '/name=\\\"' . papi_get_property_type_key( $this->property->slug ) . '\\\"' );\n\t\t$this->expectOutputRegex( '/value=\\\"string\\\"/' );\n\t}",
"private function print_field($post, $field, $title) {\n $value = get_post_meta($post->ID, $field, true);\n echo '<p>';\n echo '<label for=\"' . $field . '\">' . $title . '</label>';\n echo '<input type=\"text\" id=\"makigas-metabox-' . $field . '\" placeholder=\"' . $title . '\" name=\"' . $field . '\" value=\"' . $value . '\" class=\"widefat\" />';\n echo '</p>';\n }",
"function bf_echo_post_meta( $key = null, $post_id = null, $force_default = null ) {\n\n\t\techo bf_get_post_meta( $key, $post_id, $force_default ); // escaped before\n\t}",
"public function show(Property $property)\n {\n return $property;\n }",
"protected function attr($variable)\n {\n echo \"{$variable}=\\\"{$this->variables[$variable]}\\\"\";\n }",
"private function generateMetaDescription(Property $property)\n {\n $metaDescription = \"Imóvel Penhorado nº $this->code\";\n\n if (isset($this->attributes['land_registry_id'])) {\n $metaDescription .= \". Prédio {$property->landRegistry()->pluck('name')}\";\n\n if (isset($this->attributes['typology'])) {\n $metaDescription .= \", tipologia T{$this->attributes['typology']}\";\n }\n }\n\n // Add location\n $municipality = $property->item->municipality()->pluck('name');\n $district = $property->item->district()->pluck('name');\n\n if (Text::removeAccents($municipality) == Text::removeAccents($district)) {\n $metaDescription .= \". Localizado em $municipality.\";\n } else {\n $metaDescription .= \". Localizado em $municipality, $district.\";\n }\n\n return $metaDescription;\n }",
"function fb_output_og_protocol( $property, $content ) {\n\tif ( empty( $property ) || empty( $content ) )\n\t\treturn;\n\n\t// array of property values or structured property\n\tif ( is_array( $content ) ) {\n\t\tforeach( $content as $structured_property => $content_value ) {\n\t\t\t// handle numeric keys from regular arrays\n\t\t\t// account for the special structured property of url which is equivalent to the root tag and sets up the structure\n\t\t\tif ( ! is_string( $structured_property ) || $structured_property === 'url' )\n\t\t\t\tfb_output_og_protocol( $property, $content_value );\n\t\t\telse\n\t\t\t\tfb_output_og_protocol( $property . ':' . $structured_property, $content_value );\n\t\t}\n\t}\n\telse {\n\t\techo \"<meta property=\\\"$property\\\" content=\\\"\" . esc_attr( $content ) . \"\\\" />\\n\";\n\t}\n}",
"public function __get($property)\n {\n if (property_exists($this, $property)) {\n return html_entity_decode($this->$property);\n }\n }",
"public function __get($prop) {}",
"public function getProperty()\n\t{\n\t\treturn empty($this->property) ? strtolower($this->getName()) : $this->property;\n\t}"
] | [
"0.61537725",
"0.6032493",
"0.59532857",
"0.59488595",
"0.5947236",
"0.57271165",
"0.5694532",
"0.5619322",
"0.5613906",
"0.55825514",
"0.55825514",
"0.5578231",
"0.54482704",
"0.54340315",
"0.5393423",
"0.5389288",
"0.5374525",
"0.53594244",
"0.535807",
"0.53430307",
"0.5342348",
"0.52877164",
"0.52833325",
"0.525509",
"0.52323455",
"0.52060646",
"0.51983213",
"0.5151232",
"0.5119025",
"0.5113027"
] | 0.654449 | 0 |
Print the page body. | function body()
{
print($this->_body);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function printPage()\n {\n $this->printDoctype();\n $this->printOpenHtml();\n $this->printHead(' ');\n $this->printBody(' ');\n $this->printCloseHtml();\n }",
"public function printContent() {\r\n $this->content .= $this->doc->endPage();\r\n echo $this->content;\r\n }",
"function printContent()\t{\n\n\t\t\t\t\t$this->content.=$this->doc->endPage();\n\t\t\t\t\techo $this->content;\n\t\t\t\t}",
"function printContent()\t{\n\n\t\t$this->content .= $this->doc->endPage();\n\t\techo $this->content;\n\t}",
"function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}",
"function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}",
"function printContent()\t{\n\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}",
"function printContent()\t{\n\t\t$this->content.=$this->doc->endPage();\n\t\techo $this->content;\n\t}",
"function printContent()\t{\n\t\t$this->content.= $this->doc->endPage();\n\t\techo $this->content;\n\t}",
"public function printHtmlPage(){\n\n // Change the content headers to that of HTML\n header('Content-type: text/html; charset=utf8');\n\n // Include the HTML wrapper and collect output\n ob_start();\n require_once(LEGACY_MMRPG_ROOT_DIR.'markup/html-wrapper.php');\n $html_markup = ob_get_clean();\n\n // Print out the collected markup and exit\n echo($html_markup);\n exit();\n\n }",
"public function printContent() {\n\t\t//$this->doc->addStyleSheet();\n\t\t$this->content .= $this->doc->endPage();\n\t\techo $this->doc->insertStylesAndJS($this->content);\n\t}",
"public function displayPage()\n {\n return $this->sBody;\n }",
"public function writePage()\n\t{\n\t\t$this->SetHeaderMargin(5);\n\t\t$this->SetFooterMargin(30);\n if($this->PageNo() > 1) {\n } else {\n }\n\t\t$this->AddPage('','',true);\n// $t = $this->getCellMargins();\n// var_dump($t);\n $this->setCellPaddings(0,0,0,0);\n\n\t\t$this->writeHTML($this->content, true, false, true, false, '');\n\t}",
"protected function printBody($prefix='')\n {\n echo $prefix.'<BODY '.$this->body_tags.'>';\n echo $prefix.$prefix.$this->body.\"\\n\";\n echo $prefix.'</BODY>';\n }",
"public function outputBody()\r\n\t{\r\n\t\t$this->header();\r\n\t\tparent::outputBody();\r\n\t}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}",
"public function printContent() {}"
] | [
"0.8182446",
"0.7376723",
"0.7212335",
"0.7184767",
"0.71688557",
"0.71688557",
"0.71688557",
"0.71419954",
"0.71362054",
"0.7063102",
"0.6974742",
"0.6866685",
"0.6770787",
"0.66232985",
"0.66109693",
"0.6604975",
"0.6604975",
"0.6604975",
"0.6604975",
"0.6604975",
"0.6604651",
"0.6604651",
"0.6604651",
"0.660421",
"0.660421",
"0.660421",
"0.660421",
"0.660421",
"0.660421",
"0.660421"
] | 0.7450329 | 1 |
Analyze the files content for relevant information. Adds the findings to the collection | protected function analyze()
{
foreach($this->_importedFile['graph']['node'] as $node) {
$entity = $node['data'][0]['MaltegoEntity'];
switch($entity['@attributes']['type']) {
case "maltego.DNSName":
$this->_findings['websites'][] = $entity['Properties']['Property']['Value'];
break;
case "maltego.Website":
$this->_findings['websites'][] = $entity['Properties']['Property'][0]['Value'];
break;
case "maltego.Domain":
$this->_findings['websites'][] = $entity['Properties']['Property'][0]['Value'];
break;
case "maltego.EmailAddress":
$email = $entity['Properties']['Property'][0]['Value'];
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
$this->_findings['emails'][] = $email;
}
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function collectInfoFiles()\r\n {\r\n $files_found = $this->findFiles($this->destination_dir, array('md', '1st', 'txt'));\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }",
"public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->store[] = $this->getTree($this->parseFile($file), $file);\n });\n }",
"public function doAnalyze()\n {\n $backdropFinder = new Finder();\n $backdropFinder->in($this->sourceDir.'/backdrop');\n foreach ($backdropFinder->files() as $row ) {\n /* @var $row SplFileInfo*/\n if (in_array($row->getExtension(), $this->filter)) {\n $this->doAnalyzingBackdrop($row, 'backdrop');\n }\n }\n $this->dumpLibraryJson('backdrop');\n\n }",
"public function findFiles();",
"protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}",
"public function lookForFiles()\n\t{\n\t\t$this->_jobOptions = [];\n\n\t\tforeach ($this->getProject()->jobs as $job) {\n\t\t\tif ($job->paramountProjectJob instanceof ParamountProjectJob){\n\n\t\t\t\t$this->setProjectJob($job);\n\n\t\t\t\t$this->buildJobOptionsForService();\n\t\t\t}\n\t\t}\n\n\t}",
"public function indexCrawledDocuments() {\n\t\tforeach ( $this->aFiles as $sFile ) {\n\t\t\t$oRepoFile = new SplFileInfo( $sFile );\n\t\t\tif ( !$oRepoFile->isFile() ) continue;\n\n\t\t\t$sFileName = $oRepoFile->getFilename();\n\t\t\t$sDocType = $this->mimeDecoding( $oRepoFile->getExtension() );\n\t\t\tif ( !$this->checkDocType( $sDocType, $sFileName ) ) continue;\n\n\t\t\tif ( !$this->oMainControl->bCommandLineMode ) set_time_limit( $this->iTimeLimit );\n\n\t\t\tif ( $this->sizeExceedsMaxDocSize( $oRepoFile->getSize(), $sFileName ) ) continue;\n\n\t\t\t//Insert URL to Filename\n\t\t\t$rURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepo' );\n\t\t\t$sURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepoUrl' );\n\t\t\t//Replace realpath with webserver url only if $sUrl is set, otherwise work as before\n\t\t\tif($sURL == \"\"){\n\t\t\t $sRepoFileRealPath = \"file:///\" . $oRepoFile->getRealPath();\n\t\t\t}else{\n\t\t\t $sRepoFileRealPath = $this->getFilePath( $rURL, $sURL, $oRepoFile );\n\t\t\t}\n\n\t\t\t$timestampImage = wfTimestamp( TS_ISO_8601, $oRepoFile->getMTime() );\n\n\t\t\tif ( $this->checkExistence( $oRepoFile->getRealPath(), 'external', $timestampImage, $sFileName ) ) continue;\n\n\t\t\t$text = $this->getFileText( $oRepoFile->getRealPath(), $sFileName );\n\n\t\t\t$doc = $this->makeRepoDocument( $sDocType, utf8_encode( $sFileName ), $text, utf8_encode( $sRepoFileRealPath ), $timestampImage );\n\t\t\t$this->writeLog( $sFileName );\n\n\t\t\twfRunHooks( 'BSExtendedSearchBeforeAddExternalFile', array( $this, $oRepoFile, &$doc ) );\n\n\t\t\tif ( $doc ) {\n\t\t\t\t// mode and ERROR_MSG_KEY are only passed for the case when addsFile fails\n\t\t\t\t$this->oMainControl->addDocument( $doc, $this->mode, self::S_ERROR_MSG_KEY );\n\t\t\t}\n\t\t}\n\t}",
"public function process(): void {\n if($this->shouldCache() && $this->hasCache()) {\n $this->restoreCache();\n\n return;\n }\n\n $folders = [];\n foreach($this->sources_to_parse as $source_to_parse) {\n $folder = $source_to_parse->getFolderToParse();\n if(!isset($folders[$folder])) {\n $folders[$folder] = [\n 'extensions' => [],\n 'flags' => [],\n ];\n }\n $folders[$folder]['extensions'] = [...$folders[$folder]['extensions'], ...$source_to_parse->getExtensions()];\n $folders[$folder]['flags'] = [...$folders[$folder]['flags'], ...$source_to_parse->getFlags()];\n }\n\n foreach($folders as $folder => $folder_sources) {\n $folder_sources['extensions'] = array_values(array_unique($folder_sources['extensions']));\n $folder_sources['flags'] = array_values(array_unique($folder_sources['flags']));\n $code_data = $this->analyzer->parseFolder($folder, $folder_sources);\n $this->info_data[] = $code_data;\n $i = count($this->info_data) - 1;\n foreach($folder_sources['flags'] as $flag) {\n if(!isset($this->info_data_flag_refs[$flag])) {\n $this->info_data_flag_refs[$flag] = [];\n }\n $this->info_data_flag_refs[$flag][] = $i;\n }\n $this->flags = [...$this->flags, ...$folder_sources['flags']];\n }\n $this->flags = array_values(array_unique($this->flags));\n\n if($this->shouldCache()) {\n file_put_contents(\n $this->file_cache,\n \"<?php\\n\\nreturn \" .\n var_export([\n 'info_data' => $this->info_data,\n 'info_data_flag_refs' => $this->info_data_flag_refs,\n ], true) . ';',\n );\n }\n }",
"abstract public function search($files, array $includedFiles);",
"public function collectLogFiles()\r\n {\r\n $folder = array($this->app_root.'/logs');\r\n $files_found = $this->findFiles($folder, array(\"log\"));\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }",
"public function find () {\n\t\t$results = array();\n\n\t\t// Iterate all paths in target\n\t\tforeach ($this->target->get_resolved_paths() as $path) {\n\t\t\t\n\t\t\t// Iterate all files in paths\n\t\t\t$files = directory_contents($path);\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$lines = file($file);\n\t\t\t\t\n\t\t\t\t// Iterate all lines in file\n\t\t\t\tfor ($i=0; $i < count($lines); $i++) { \n\t\t\t\t\tif (preg_match(self::BREAKPOINT, $lines[$i])) {\n\t\t\t\t\t\t$results[$file][] = $i + 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (count($results) == 0) $results = null;\n\t\t\n\t\treturn $results;\n\t}",
"public function analyze()\n {\n $this->line('Tokenizing your codebase, this can take a few moments');\n $this->entities = $this->filterEntities();\n $codebase = $this->codebase->getTokenized();\n\n /* @type AbstractAnalyzedEntity $entity */\n $this->line('Analyzing codebase...');\n $progress = $this->getProgressBar($this->entities);\n\n foreach ($this->entities as $key => $entity) {\n $progress->advance();\n $progress->setMessage($entity->name);\n\n foreach ($entity->getUsageMatrix() as $usageNeedle) {\n foreach ($codebase as $file => $tokens) {\n if (!$tokens) {\n continue;\n }\n\n if ($token = $this->containsTokens($tokens, $usageNeedle)) {\n $this->entities[$key]->usage = $usageNeedle->usage;\n $this->entities[$key]->occurences[] = [\n 'file' => $file,\n 'context' => $token,\n ];\n\n break 2;\n }\n }\n }\n }\n\n $progress->finish();\n\n return $this->entities;\n }",
"private function analyse()\n\t{\n\t\t// Get the latest approved revision of each extension\n\t\t$revisions = $this->get_latest_approved_revisions();\n\n\t\t$progress = $this->create_progress_bar(\n\t\t\tcount($revisions),\n\t\t\tnew SymfonyStyle($this->input, $this->output),\n\t\t\t$this->output,\n\t\t\ttrue\n\t\t);\n\n\t\t// Start the progress bar\n\t\t$progress->setMessage($this->language->lang('CLI_EXTENSION_EVENTS_SCAN_START'));\n\t\t$progress->start();\n\n\t\t// Remove temp folder - clean up before we begin\n\t\t$this->remove_temporary_folder();\n\n\t\tforeach ($revisions as $revision)\n\t\t{\n\t\t\t// Increase the progress\n\t\t\t$progress->setMessage($this->language->lang('CLI_EXTENSION_EVENTS_SCAN_CONTRIB', $revision['contrib_name'], $revision['revision_id'], $revision['real_filename']));\n\t\t\t$progress->advance();\n\n\t\t\t// Read the attachment\n\t\t\tif ($revision['extension'] === 'zip')\n\t\t\t{\n\t\t\t\t$path = $this->root_path . 'ext/phpbb/titania/files/revisions/' . $revision['physical_filename'];\n\n\t\t\t\t$zip = new \\ZipArchive();\n\t\t\t\t$result = $zip->open($path);\n\n\t\t\t\t// If we ever want a revision by revision breakdown of the events used, we could output it inside here.\n\t\t\t\tif ($result)\n\t\t\t\t{\n\t\t\t\t\t// Unzip the revision to a temporary folder\n\t\t\t\t\t$zip->extractTo($this->tmp_folder);\n\t\t\t\t\t$zip->close();\n\n\t\t\t\t\t// Find template events\n\t\t\t\t\t$this->find_template_events();\n\n\t\t\t\t\t// Find PHP events\n\t\t\t\t\t$this->find_php_events();\n\n\t\t\t\t\t// Remove temp folder before we unzip the next one.\n\t\t\t\t\t$this->remove_temporary_folder();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Complete\n\t\t$progress->setMessage($this->language->lang('CLI_EXTENSION_EVENTS_SCAN_FINISH'));\n\t\t$progress->finish();\n\n\t\t// Output the listing statistics\n\t\t$this->output->writeln('');\n\n\t\t// Sort by usages\n\t\tarsort($this->event_listing['template']);\n\t\tarsort($this->event_listing['php']);\n\n\t\t// Template stats\n\t\t$this->output->writeln($this->language->lang('CLI_EXTENSION_EVENTS_TEMPLATE'));\n\t\t$this->display_stats_table('template');\n\n\t\t// PHP stats\n\t\t$this->output->writeln($this->language->lang('CLI_EXTENSION_EVENTS_PHP'));\n\t\t$this->display_stats_table('php');\n\n\t\t// Custom events\n\t\t$this->output->writeln($this->language->lang('CLI_EXTENSION_EVENTS_CUSTOM'));\n\t\t$this->display_custom_events_table();\n\n\t\treturn count($revisions);\n\t}",
"protected function _scan_files()\n\t{\n\t\t$terms = array();\n\n\t\t$parser = new PHPParser_Parser(new PHPParser_Lexer);\n\n\t\tforeach ($this->_list_files(array('views', 'classes')) as $file)\n\t\t{\n\t\t\t$statements = $parser->parse(file_get_contents($file));\n\n\t\t\t$terms = Arr::merge($terms, $this->_get_terms_from_statements($statements));\n\t\t}\n\n\t\treturn $terms;\n\t}",
"protected function collectBackups()\n {\n $results = $this->service->files->listFiles($this->getParams());\n\n /** @var \\Google_Service_Drive_DriveFile $googleFile */\n foreach ($results->getFiles() as $googleFile) {\n if ($this->isFileMatch($this->path->getPath() . '/' . $googleFile->getName())) {\n $file = new File\\GoogleDrive($this->service, $googleFile);\n $index = $this->getFileIndex($file);\n $this->files[$index] = $file;\n }\n }\n }",
"function scan_files( ){\n\n // List of all the audio files found in the directory and sub-directories\n $audioFileArray = array();\n\n // List of filenames already handled during the scan. To detect dupe filenames.\n $alreadyhandledFileArray = array();\n\n // Make list of all files in db to remove non existent files\n $DBaudioFileArray = array();\n foreach ( $this->get_list_of_files()->fetchAll() as $row ) {\n $DBaudioFileArray[] = $row['filename'];\n }\n\n // Prepare variables for file urls\n //$base_dir = dirname(dirname(realpath($this->filedirectorypath))); // Absolute path to your installation, ex: /var/www/mywebsite\n $doc_root = preg_replace(\"!{$_SERVER['SCRIPT_NAME']}$!\", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www\n $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';\n $port = $_SERVER['SERVER_PORT'];\n $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : \":$port\";\n $domain = $_SERVER['SERVER_NAME'];\n // variables for file urls\n\n // Create recursive dir iterator which skips dot folders\n $dir = new RecursiveDirectoryIterator( $this->filedirectorypath , FilesystemIterator::SKIP_DOTS);\n\n // Flatten the recursive iterator, consider only files, no directories\n $it = new RecursiveIteratorIterator($dir);\n\n // Find all the mp3 files\n foreach ($it as $fileinfo) {\n if ($fileinfo->isFile() && !strcmp($fileinfo->getExtension(), \"mp3\")) {\n $audioFileArray[] = $fileinfo;\n\n //Warning: files with same md5key in different folders will not be inserted into the db.\n //print md5_file($fileinfo) . \"<br />\\n\";\n }\n }\n\n foreach ($audioFileArray as $key => $fileinfo) {\n\n $filename = $fileinfo->getFilename();\n\n //For each file found on disk remove entry from list from DB\n // if any left at the end, they are files that no longer are present on the drive.\n //print \"unsetting: \" . $filename . \"<br>\";\n unset($DBaudioFileArray[array_search($filename,$DBaudioFileArray,true)]);\n\n // check file not in db\n if( !$this->is_file_in_db( $filename ) ) {\n\n //decode filename date if named according to our naming scheme\n $date = $this->decode_filename($filename);\n\n // Build file url based on server path\n $filepath = realpath($fileinfo->getRealPath());\n $base_url = preg_replace(\"!^{$doc_root}!\", '', $filepath); # ex: '' or '/mywebsite'\n $full_url = \"$protocol://{$domain}{$disp_port}{$base_url}\"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.\n\n //print $filename . \" - \" . $full_url . \"<br />\\n\";\n\n //insert audiofile in db for first time\n $this->insert_new_file_into_db( $filename, $full_url, $fileinfo->getRealPath(), $fileinfo->getSize(), $date );\n\n $alreadyhandledFileArray[$key] = $filename;\n\n } else {\n // if file in alreadyhandled array, then duplicate named files have been found\n // how to check for duplicate file names?\n // if we're here then the name has already ben added to the db (but maybe during a previous run)\n //we still need to look for the file in the alreadyhandledFileArray\n if( in_array($filename, $alreadyhandledFileArray) ){\n // flag file\n $this->flag_file($filename, \"Il y a 2 ou plusieurs fichiers audio avec le même nom dans le dossier audio du serveur ftp. Veuillez changer les noms ou supprimer les doublons.\");\n }\n }\n\n\n }\n\n // If there are files from the database that weren't found in the audio folder,\n // flag them and add a comment stating that the file can no longer be found.\n if( count($DBaudioFileArray) ){\n //print_r($DBaudioFileArray);\n foreach($DBaudioFileArray as $key => $fn){\n $this->flag_file($fn, \"Le fichier en question n'est plus présent dans le dossier audio du serveur ftp. Il faut le supprimer de la base de données.\");\n $this->set_file_not_new($fn);\n }\n }\n\n return true;\n }",
"function _fillFiles()\n\t{\n\t\t// directory from which we import (real path)\n\t\t$importDirectory = ereg_replace(\n\t\t\t\t\"^(.*)/$\", \n\t\t\t\t'\\1', \n\t\t\t\tereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . $this->from);\n\t\t\n\t\t// when running on windows we have to change slashes to backslashes\n\t\tif (runAtWin()) {\n\t\t\t$importDirectory = str_replace(\"/\", \"\\\\\", $importDirectory);\n\t\t}\n\t\t$this->_files = array();\n\t\t$this->_depth = 0;\n\t\t$this->_postProcess = array();\n\t\t$this->_fillDirectories($importDirectory);\n\t\t// sort it so that webEdition files are at the end (that templates know about css and js files)\n\t\t\n\n\t\t$tmp = array();\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"folder\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] != \"folder\" && $e[\"contentType\"] != \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_files = $tmp;\n\t\t\n\t\tforeach ($this->_postProcess as $e) {\n\t\t\tarray_push($this->_files, $e);\n\t\t}\n\t}",
"private function processFile() {\n if ($this->isFileAllowed()) {\n $path_parts = pathinfo($this->filepath);\n $extention = $path_parts['extension'];\n\n $classes = get_declared_classes();\n\n foreach($classes as $class) {\n $reflect = new \\ReflectionClass($class);\n if($reflect->implementsInterface('App\\\\Classes\\\\IFileFormat')) {\n if ($extention === $class::getFileExtension()) {\n $fileFormat = new $class($this->filepath);\n $this->charsCount = $fileFormat->getCharactersCount();\n $this->wordsCount = $fileFormat->getWordsCount();\n }\n }\n }\n }\n }",
"protected function processChangedAndNewFiles() {}",
"private function parseContent()\n {\n $results = [];\n $jsonFiles = $this->parseInputFolders();\n \n $finalManifest = $this->getJobManifestTemplate();\n $this->output->writeln(\"<info>\" . static::INFO_OUTPUT_PREFIX . \"Processing JSON directory: {$this->inputPath} </info>\");\n\n foreach ($jsonFiles as $file) {\n if (file_exists($file)) {\n $results[] = $this->convertLearnosityInDirectory($file);\n } else {\n $this->output->writeln(\"<info>\" . static::INFO_OUTPUT_PREFIX . \"Learnosity JSON file \".basename($file). \" Not found in: {$this->inputPath}/items </info>\");\n }\n }\n $resourceInfo = $this->updateJobManifest($finalManifest, $results);\n $finalManifest->setResources($resourceInfo);\n $this->persistResultsFile($results, realpath($this->outputPath) . '/' . $this->rawPath . '/');\n $this->flushJobManifest($finalManifest, $results);\n CopyDirectoreyHelper::copyFiles(realpath($this->inputPath) . '/assets', realpath($this->outputPath) . '/' . $this->rawPath . '/assets');\n $this->createIMSContntPackage(realpath($this->outputPath) . '/' . $this->rawPath . '/');\n }",
"public function apply() {\n\t\t$prepLookup = clone $this->oLookup;\n\n\t\t$size = $this->oLookup->getSize();\n\n\t\t// Prepare preprocessor query\n\t\t$prepLookup->setSize( $size );\n\t\t$prepLookup->clearSourceField();\n\t\t$prepLookup->addSourceField( 'basename' );\n\t\t$prepLookup->addSourceField( 'namespace' );\n\t\t$prepLookup->addSourceField( 'prefixed_title' );\n\n\t\t$excludes = [];\n\n\t\t$this->getExcludesForCurrentPage( $prepLookup, $size, $excludes );\n\n\t\tif ( empty( $excludes ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add result _ids to exclude from the search\n\t\t$this->oLookup->addBoolMustNotTerms( '_id', $excludes );\n\t}",
"public function collectYamlFiles()\r\n {\r\n $folder = array($this->app_root.'/config');\r\n $files_found = $this->findFiles(\r\n $folder,\r\n array(\"yml\"),\r\n array(\"parameters.yml\")\r\n );\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }",
"protected function loadFiles() {\n if ($this->loaded === true) {\n return;\n }\n $iter = new RecursiveDirectoryIterator($this->directory);\n $this->iterateFiles($iter);\n $this->loaded = true;\n }",
"public function watch() {\n\t\t\t$totalFiles = 0;\n\n\t\t\twhile(true) {\n\t\t\t\t$dir = new DirectoryIterator(realpath($this->input_dir));\n\t\t\t\t$numFiles = iterator_count($dir);\n\n\t\t\t\tif($numFiles != $totalFiles) {\n\t\t\t\t\t$totalFiles = $numFiles;\n\n\t\t\t\t\tforeach($dir as $fileinfo) {\n\t\t\t\t\t if(!$fileinfo->isDot() && $fileinfo->isFile()) {\n\t\t\t\t\t \t$filename = $fileinfo->getFilename();\n\t\t\t\t\t \t$ext = pathinfo($filename, PATHINFO_EXTENSION);\n\n\t\t\t\t\t \tif(in_array($ext, array('dat')))\n\t\t\t\t\t \t\t$this->extractInfo($filename);\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsleep(3);\n\t\t\t}\n\t\t}",
"public function setup() {\n // get files content\n $this->getFileContent();\n\n $this->filterMatches();\n \n // insert the document in db\n $this->insert();\n\n // init terms list\n $this->termsList = new TermsList();\n\n // save terms and relations\n $this->manageMatches();\n }",
"private function searchDiffs()\n {\n $this->matchedCollection->each(function ($item) {\n\n $newElement = $this->findMeIn($this->mergeCollection,$item);\n\n //Unset primary key property if it's not in associative pivots because it can create Integrity constraint violation: Duplicate ID\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($newElement->id);\n\n //If found element\n if($newElement)\n $this->fillReport($newElement,$item);\n });\n }",
"protected function _findConfigs()\n {\n foreach (new DirectoryIterator($this->_configPath) as $fileInfo) {\n if ($fileInfo->isDot()) {\n continue;\n }\n if ($fileInfo->isDir()) {\n continue;\n }\n if ($fileInfo->getExtension() !== 'xml') {\n continue;\n }\n\n $name = str_replace('.' . $fileInfo->getExtension(), '', $fileInfo->getFilename());\n $this->_configFiles[$name] = [\n 'name' => $name,\n 'basename' => $fileInfo->getBasename(),\n 'pathname' => $fileInfo->getPathname(),\n ];\n }\n }",
"public function getProcessedFiles(): Collection\n {\n return $this->files->filter(function (File $file) {\n return $file->getStatus() === File::FILE_DONE;\n });\n }",
"public function getProcessedAndNewFiles(): Collection\n {\n return $this->files->filter(function (File $file) {\n return in_array($file->getStatus(), [FILE::FILE_NEW, FILE::FILE_DONE, FILE::FILE_IN_QUEUE]);\n });\n }",
"private function _discover() {\n\n $dir = new DirectoryIterator($this->dirname);\n\n foreach ($dir as $file) {\n\n if ($file->isFile() && !$file->isDot()) {\n\n $filename = $file->getFilename();\n $pathname = $file->getPathname();\n\n if (preg_match('/^(\\d+\\W*)?(\\w+)\\.php$/', $filename, $matches)) {\n require_once($pathname);\n $class = \"{$matches[2]}_{$this->suffix}\";\n $files[$filename] = new $class();\n }\n\n }\n\n }\n\n ksort($files);\n $plugins = array_values($files);\n\n return $plugins;\n\n }"
] | [
"0.6769866",
"0.6471379",
"0.6001935",
"0.5999668",
"0.59028625",
"0.58156",
"0.57391924",
"0.5710829",
"0.5695798",
"0.56572455",
"0.5624928",
"0.56242263",
"0.5584538",
"0.55749923",
"0.5557572",
"0.5513033",
"0.54700977",
"0.53777933",
"0.53340554",
"0.53281325",
"0.52866304",
"0.5276583",
"0.522169",
"0.52061194",
"0.51919854",
"0.518879",
"0.5127114",
"0.51227874",
"0.51217735",
"0.5119398"
] | 0.65273297 | 1 |
Realiza a consulta pelo tipos de taxa TDE ou TDA | function getFiltroTiposTaxa($get = null,$where = " 1 = 1"){
$Result = "";
if(isset($get['getFiltroTipo'])){
foreach ($get['getFiltroTipo'] as $key => $value ) {
switch ($value) {
case 1:
$where .= " AND TDE <> 0 ";
break;
case 2:
$where .= " AND TDA <> 0 ";
break;
case 3:
$where .= " AND TDE = 0 ";
break;
case 4:
$where .= " AND TDA = 0 ";
break;
}
}
return $where;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function calculate_tax_filter() {\n global $edd_options;\n\n if ( isset( $edd_options['taxedd_private_token'] ) ) {\n $private_key = $edd_options['taxedd_private_token'];\n \n try { \n\n $taxtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n\n $cart_items = edd_get_cart_content_details();\n\n $countrycode = \"\";\n\n $address = edd_get_customer_address();\n\n if ( isset($address['country']) && !empty($address['country']) && \"\" !== $address['country'] ) {\n $countrycode = $address['country'];\n } else {\n $ipcc = taxedd_get_country_code();\n $countrycode = $ipcc->country_code;\n }\n\n $transaction = new Input_transaction();\n $transaction->currency_code = edd_get_currency();\n $transaction->buyer_ip = $_SERVER['REMOTE_ADDR'];\n $transaction->billing_country_code = $countrycode;\n $transactionarray = array();\n $customid = \"\";\n $transaction->force_country_code = $countrycode;\n\n if ( !empty( $cart_items ) ) { \n foreach ( $cart_items as $cart_item ) {\n\n $customid++;\n $transaction_line = new Input_transaction_line();\n $transaction_line->amount = $cart_item['item_price'];\n $transaction_line->custom_id = $cart_item['name'] . $customid;\n array_push( $transactionarray, $transaction_line );\n\n }\n }\n\n $transaction->transaction_lines = $transactionarray;\n\n $resp = $taxtaxamo->calculateTax( array( 'transaction' => $transaction ) );\n\n return $resp->transaction->tax_amount;\n\n } catch ( exception $e ) {\n\n return \"\";\n }\n }\n }",
"public function buscarTaxaVigente(){\r\n\t\techo \"buscarTaxa\";\r\n\t\t\r\n\t\t$sql = \"SELECT * FROM `tb_taxa` WHERE tax_status = 'S'\";\r\n\r\n\t\t$conn = new Conexao();\r\n\t\t\r\n\t\t$query = $conn->Conn();\r\n\t\t\t\r\n\t\t$resultado = $query->query($sql);\r\n\t\t\t\r\n\t\tif(!$resultado){\r\n\t\t\tdie('Consulta Inv√°lida: ' . mysql_errno());\r\n\t\t}\r\n\t\t$reg = mysqli_fetch_assoc($resultado);\r\n\r\n\t\t$taxa = $reg[\"tax_valor\"];\r\n\t\t\r\n\t\tmysqli_free_result($resultado);\r\n\t\t\r\n\t\t$conn->fecharConn();\r\n\t\t\r\n\t\treturn $taxa;\r\n\t}",
"function getTaxPercenTax($id)\n\t{\n\n\n\t\t$query3=\"SELECT (ps.cgst+ps.sgst) as gst FROM `product` as p INNER JOIN product_variant as pv on pv.`ptdvar_id` = p.ptdvar_id INNER JOIN product_sub_category as ps on ps.pr_sub_id = pv.ptd_sub_catgry_id where p.product_id ='$id'\";\n\t $data3=$this->get_results( $query3 );\n\t\treturn $data3;\n\n\t}",
"function getReceiptTax()\n\t{\n\t\tglobal $db;\n\n\t\t$query = 'SELECT t.tax_desc AS \"Tax\", rt.tax_rate AS \"Tax Rate\", rt.tax_value AS \"Tax Value\"\n\t\tFROM '.receipt_tax_table.' rt JOIN '.tax_table.' t USING (tax_id) \n\t\tWHERE rt.receipt_id = '.$this->receipt_id.' \n\t\tORDER BY rt.tax_sequence';\n\t\t$result = $db->query($query);\n\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_info = $db->errorInfo();\n\t\t\techo $err_info[2];\n\t\t\terror_log('Function : getReceiptTax, Class : receipt, '.$err_info[2]);\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arr = $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\treturn $arr;\n\t}",
"public function selectTaxCodes() {\n \n // query preparation\n $select = 'STEUERSATZCODE';\n $from = $this->getTableName('BHSTEUER');\n $where = '1';\n $groupBy = 'STEUERSATZCODE';\n $orderBy = 'STEUERSATZCODE';\n $limit = '';\n \n // exec query using TYPO3 DB API\n $res = $this->gsaDbObj->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);\n if ($res == false || $this->gsaDbObj->sql_num_rows($res) == 0) {\n throw new tx_pttools_exception('Query failed or returned empty result', 1, $this->gsaDbObj->sql_error());\n } \n \n // store codes in array keys\n $a_result = array();\n while ($a_row = $this->gsaDbObj->sql_fetch_assoc($res)) {\n // if enabled, do charset conversion of all non-binary string data \n if ($this->charsetConvEnabled == 1) {\n $a_row = tx_pttools_div::iconvArray($a_row, $this->gsaCharset, $this->siteCharset);\n }\n $a_result[$a_row['STEUERSATZCODE']] = array('taxRate'=>0, 'taxNote'=>'');\n }\n $this->gsaDbObj->sql_free_result($res);\n \n // query current tax rates and notes (get notes from \"old\" DB table STEUER, if this table exists in the GSA DB) for all codes\n foreach ($a_result as $taxCode=>$taxDataArr) {\n $taxDataArr['taxRate'] = $this->selectTaxRate($taxCode);\n // get note from \"old\" DB table STEUER, if this table exists in the GSA DB\n if ($this->oldTaxTableExists() == true) {\n $tmpOldTaxDataArr = $this->selectTaxDataOld($taxCode);\n $taxDataArr['taxNote'] = $tmpOldTaxDataArr['BEMERKUNG'];\n }\n $a_result[$taxCode] = $taxDataArr;\n }\n \n trace($a_result);\n return $a_result;\n \n }",
"public function selectTaxRateRecords($taxCode='') {\n \n // query preparation\n $select = 'bh.NUMMER, bh.STEUERSATZCODE, bh.STEUERSATZPROZ, bh.GUELTIGABTTMMJJJJ'.\n ($this->oldTaxTableExists() == true ? ', st.BEMERKUNG AS BEMERKUNG' : '').' ';\n $from = $this->getTableName('BHSTEUER').' bh'. \n ($this->oldTaxTableExists() == true ? ' LEFT JOIN '.$this->getTableName('STEUER').' st ON bh.STEUERSATZCODE LIKE st.CODE' : '');\n $where = (empty($taxCode) ? '1' : 'STEUERSATZCODE LIKE '.$this->gsaDbObj->fullQuoteStr($taxCode, $from)).' ';\n $groupBy = 'bh.STEUERSATZCODE, bh.GUELTIGABTTMMJJJJ, bh.STEUERSATZPROZ'; // this is required due to a bug of the ERP system: it creates multiple redundant records (but with different UIDs in field NUMMER) in the DB table BHSTEUER\n $orderBy = 'bh.STEUERSATZCODE, bh.GUELTIGABTTMMJJJJ';\n $limit = '';\n \n // exec query using TYPO3 DB API\n $res = $this->gsaDbObj->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);\n if ($res == false) {\n throw new tx_pttools_exception('Query failed or returned empty result', 1, $this->gsaDbObj->sql_error());\n } \n \n // store all data in twodimensional array\n $a_result = array();\n while ($a_row = $this->gsaDbObj->sql_fetch_assoc($res)) {\n // if enabled, do charset conversion of all non-binary string data \n if ($this->charsetConvEnabled == 1) {\n $a_row = tx_pttools_div::iconvArray($a_row, $this->gsaCharset, $this->siteCharset);\n }\n $a_result[] = $a_row;\n }\n $this->gsaDbObj->sql_free_result($res);\n \n trace($a_result);\n return $a_result;\n \n }",
"abstract public function getTaxType();",
"function EstadoCuentaDes(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_AGTD_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('id_agencia','id_agencia','int4');\n //Definicion de la lista del resultado del query\n $this->captura('fecha_ini','date');\n $this->captura('fecha_fin','date');\n $this->captura('titulo','varchar');\n $this->captura('mes','varchar');\n $this->captura('fecha','date');\n $this->captura('autorizacion__nro_deposito','varchar');\n $this->captura('id_periodo_venta','int4');\n $this->captura('monto_total','numeric');\n $this->captura('neto','numeric');\n $this->captura('monto','numeric');\n $this->captura('cierre_periodo','varchar');\n $this->captura('ajuste','varchar');\n $this->captura('tipo','varchar');\n $this->captura('transaccion','varchar');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n // var_dump($this->respuesta);exit;\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"public function getTaxRates() {\n // Parse XML\n $xml = \"<TaxRateGetRq></TaxRateGetRq>\\n\";\n\t\t\n // Create request and pack\n\t\t$this->createRequest($xml);\n $len = strlen($this->xmlRequest);\n $packed = pack(\"N\", $len);\n\n // Send and get the response\n fwrite($this->id, $packed, 4);\n fwrite($this->id, $this->xmlRequest);\n $this->getResponse();\n\n // Set the result\n $this->setResult($this->parseXML($this->xmlResponse));\n }",
"function listarTotalesPeriodoAgencia(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_PERAGTOT_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n\n $this->setParametro('id_periodo_venta','id_periodo_venta','int4');\n\n $this->capturaCount('total_credito_mb','numeric');\n $this->capturaCount('total_credito_me','numeric');\n $this->capturaCount('total_boletos_mb','numeric');\n $this->capturaCount('total_boletos_usd','numeric');\n $this->capturaCount('total_comision_mb','numeric');\n $this->capturaCount('total_comision_usd','numeric');\n $this->capturaCount('total_debito_mb','numeric');\n $this->capturaCount('total_debito_usd','numeric');\n $this->capturaCount('total_neto_mb','numeric');\n $this->capturaCount('total_neto_usd','numeric');\n\n\n //Definicion de la lista del resultado del query\n $this->captura('id_periodo_venta_agencia','int4');\n $this->captura('codigo_periodo','varchar');\n $this->captura('id_agencia','int4');\n $this->captura('medio_pago','varchar');\n $this->captura('mes','varchar');\n $this->captura('gestion','varchar');\n $this->captura('id_periodo_venta','int4');\n $this->captura('fecha_ini','varchar');\n $this->captura('fecha_fin','varchar');\n $this->captura('moneda_restrictiva','varchar');\n $this->captura('codigo_int','varchar');\n $this->captura('nombre','varchar');\n $this->captura('fecha_ini2','varchar');\n $this->captura('fecha_fin2','varchar');\n $this->captura('estado','varchar');\n $this->captura('total_credito_mb','numeric');\n $this->captura('total_credito_me','numeric');\n $this->captura('total_boletos_mb','numeric');\n $this->captura('total_boletos_usd','numeric');\n $this->captura('total_comision_mb','numeric');\n $this->captura('total_comision_usd','numeric');\n $this->captura('total_debito_mb','numeric');\n $this->captura('total_debito_usd','numeric');\n $this->captura('total_neto_mb','numeric');\n $this->captura('total_neto_usd','numeric');\n $this->captura('monto_mb','numeric');\n $this->captura('monto_usd','numeric');\n $this->captura('billetes','text');\n\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"function _ConsultarRutinasTotales()\n\t{\n\t\t\n\t\t//Este querie devuelve TODAS las rutinas ordenadas de principiante hasta avanzado.\n\t\t$query = '\n\t\tSELECT\n\t\tRut.id as id_rutina,\n\t\tRut.nb_rutina,\n\t\tRut.desc_rutina,\n\t\tRut.fh_creacion,\n\t\tUsu.nb_nombre,\n\t\tUsu.nb_apellidos,\n\t\tCat.nb_categoriarutina,\n\t\tGen.id as id_genero,\n\t\tGen.nb_tiporutina,\n\t\tcuerpo.id as id_cuerpo,\n\t\tcuerpo.nb_cuerpo,\n\t\tedad.nb_edad\n\t\tFROM sgrutinas Rut\n\t\tleft JOIN sgusuarios Usu\n\t\tON Usu.id=Rut.id_usuariocreacion\n\t\tleft JOIN sgcategoriasrutina Cat\n\t\tON Cat.id=Rut.id_categoriarutina\n\t\tLEFT JOIN sggenerosrutina Gen\n\t\tON Gen.id= Rut.id_generorutina\n\t\tLEFT JOIN sgtipocuerpo cuerpo\n\t\tON cuerpo.id = Rut.id_tipocuerpo\n\t\tLEFT JOIN sgedad edad\n\t\tON edad.id = Rut.id_edad\n\t\twhere Rut.sn_activo=1 order by id_rutina asc\n\t\t';\t\n\t\t$rutinas = $this->EjecutarTransaccionAllNoParams($query);\n\t\treturn $rutinas;\n\t}",
"public function getCustomerTaxvat();",
"function ciniki_taxes_typeList(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'locations'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Locations'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'taxes', 'private', 'checkAccess');\n $rc = ciniki_taxes_checkAccess($ciniki, $args['tnid'], 'ciniki.taxes.typeList'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n $modules = $rc['modules'];\n\n $rsp = array('stat'=>'ok', 'active'=>array(), 'inactive'=>array());\n\n //\n // Get the list of active tax types, with current tax rates\n //\n $strsql = \"SELECT ciniki_tax_types.id, \"\n . \"ciniki_tax_types.name, \"\n . \"ciniki_tax_types.flags, \"\n . \"ciniki_tax_type_rates.rate_id AS rate_id, \"\n . \"ciniki_tax_rates.name AS rate_name \"\n . \"\";\n if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n $strsql .= \", IFNULL(ciniki_tax_locations.name, '') AS rate_location \";\n } else {\n $strsql .= \", '' AS rate_location \";\n }\n $strsql .= \"FROM ciniki_tax_types \"\n . \"LEFT JOIN ciniki_tax_type_rates ON (ciniki_tax_types.id = ciniki_tax_type_rates.type_id \"\n . \"AND ciniki_tax_type_rates.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_tax_rates ON (ciniki_tax_type_rates.rate_id = ciniki_tax_rates.id \"\n . \"AND ciniki_tax_rates.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_tax_rates.start_date < UTC_TIMESTAMP \"\n . \"AND (ciniki_tax_rates.end_date = '0000-00-00 00:00:00' \"\n . \"OR ciniki_tax_rates.end_date > UTC_TIMESTAMP()) \"\n . \") \";\n if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n $strsql .= \"LEFT JOIN ciniki_tax_locations ON (\"\n . \"ciniki_tax_rates.location_id = ciniki_tax_locations.id \"\n . \"AND ciniki_tax_locations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \";\n }\n $strsql .= \"WHERE ciniki_tax_types.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (ciniki_tax_types.flags&0x01) = 0 \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.taxes', array(\n array('container'=>'types', 'fname'=>'id', 'name'=>'type',\n 'fields'=>array('id', 'name', 'flags')),\n array('container'=>'rates', 'fname'=>'rate_id', 'name'=>'rate',\n 'fields'=>array('id'=>'rate_id', 'name'=>'rate_name', 'location'=>'rate_location')),\n// 'fields'=>array('id', 'name', 'flags', 'rate_ids', 'rates'),\n// 'idlists'=>array('rate_ids'), 'lists'=>array('rates')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['types']) ) {\n $rsp['active'] = $rc['types'];\n// foreach($rsp['active'] as $tid => $type) {\n// $rsp['active'][$tid]['type']['rate_text'] = '';\n// foreach($type['type']['rates'] as $rid => $rate) {\n// $rsp['active'][$tid]['type']['rate_text'] .= ($rsp['active'][$tid]['type']['rate_text']!=''?'<br/>':'');\n// if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n// $rsp['active'][$tid]['type']['rate_text'] .= $rate['rate']['location'] . ' - ';\n// }\n// }\n// }\n }\n\n //\n // Get the list of inactive tax types\n //\n $strsql = \"SELECT ciniki_tax_types.id, \"\n . \"ciniki_tax_types.name, \"\n . \"ciniki_tax_types.flags, \"\n . \"ciniki_tax_type_rates.rate_id AS rate_ids, \"\n . \"ciniki_tax_rates.name AS rates \"\n . \"\";\n if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n $strsql .= \", IFNULL(ciniki_tax_locations.name, '') AS rate_location \";\n } else {\n $strsql .= \", '' AS rate_location \";\n }\n $strsql .= \"FROM ciniki_tax_types \"\n . \"LEFT JOIN ciniki_tax_type_rates ON (ciniki_tax_types.id = ciniki_tax_type_rates.type_id \"\n . \"AND ciniki_tax_type_rates.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_tax_rates ON (ciniki_tax_type_rates.rate_id = ciniki_tax_rates.id \"\n . \"AND ciniki_tax_rates.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_tax_rates.start_date < UTC_TIMESTAMP \"\n . \"AND (ciniki_tax_rates.end_date = '0000-00-00 00:00:00' \"\n . \"OR ciniki_tax_rates.end_date > UTC_TIMESTAMP()) \"\n . \") \";\n if( ($modules['ciniki.taxes']['flags']&0x01) > 0 ) {\n $strsql .= \"LEFT JOIN ciniki_tax_locations ON (\"\n . \"ciniki_tax_rates.location_id = ciniki_tax_locations.id \"\n . \"AND ciniki_tax_locations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \";\n }\n $strsql .= \"WHERE ciniki_tax_types.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (ciniki_tax_types.flags&0x01) = 1 \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.taxes', array(\n array('container'=>'types', 'fname'=>'id', 'name'=>'type',\n 'fields'=>array('id', 'name', 'flags')),\n array('container'=>'rates', 'fname'=>'rate_id', 'name'=>'rate',\n 'fields'=>array('id'=>'rate_id', 'name'=>'rate_name', 'location'=>'rate_location')),\n// 'fields'=>array('id', 'name', 'flags', 'rate_ids', 'rates'),\n// 'idlists'=>array('rate_ids'), 'lists'=>array('rates')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['types']) ) {\n $rsp['inactive'] = $rc['types'];\n }\n\n //\n // If locations specified, get the list of known locations\n //\n if( isset($args['locations']) && $args['locations'] == 'yes' ) {\n $strsql = \"SELECT id, code, name \"\n . \"FROM ciniki_tax_locations \"\n . \"WHERE ciniki_tax_locations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.taxes', array(\n array('container'=>'locations', 'fname'=>'id', 'name'=>'location',\n 'fields'=>array('id', 'code', 'name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['locations']) ) {\n $rsp['locations'] = $rc['locations'];\n } else {\n $rsp['locations'] = array();\n }\n }\n\n return $rsp;\n}",
"function pnh_getreceiptttl_valuebytypeterry($type=0,$tid=false)\r\n\t{\r\n\t\tif($type==0)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,f.franchise_name,a.name AS admin FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 and is_submitted=0 and f.territory_id=? ORDER BY instrument_date DESC\",$tid)->row_array();\r\n\t\tif($type==1 )\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,f.franchise_name,a.name AS admin FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 AND date(from_unixtime(instrument_date)) <= curdate() and is_submitted=0 and f.territory_id=? and r.is_active=1 ORDER BY instrument_date asc\",$tid)->row_array();\r\n\t\tif($type==2 )\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,f.franchise_name,a.name AS admin FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by WHERE r.status=0 AND r.is_active=1 AND date(from_unixtime(instrument_date)) > curdate() and is_submitted=0 and f.territory_id=? ORDER BY instrument_date asc\",$tid)->row_array();\r\n\t\tif($type==3)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,DATE_FORMAT(r.activated_on,'%d/%m/%Y')as activated_on,f.franchise_name,a.name AS admin,d.username AS activated_by FROM pnh_t_receipt_info r JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id LEFT OUTER JOIN king_admin a ON a.id=r.created_by LEFT OUTER JOIN king_admin d ON d.id=r.activated_by WHERE r.status=1 AND r.is_active=1 and is_submitted=1 and f.territory_id=? ORDER BY date(from_unixtime(activated_on)) DESC\",$tid)->row_array();\r\n\t\tif($type==4)\r\n\t\t\t$total_value=$this->db->query(\"SELECT r.*,sum(receipt_amount) as total,b.bank_name AS submit_bankname,s.name AS submittedby,a.name AS admin,f.franchise_name,d.remarks AS submittedremarks,DATE(d.submitted_on) AS submitted_on,r.created_on FROM `pnh_m_deposited_receipts`d JOIN `pnh_t_receipt_info` r ON r.receipt_id=d.receipt_id JOIN `pnh_m_bank_info` b ON b.id=d.bank_id JOIN king_admin s ON s.id=d.submitted_by JOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id left outer join king_admin a on a.id=r.created_by WHERE r.is_submitted=1 AND f.is_suspended=0 AND r.status=0 and r.is_active=1 and f.territory_id=? order by d.submitted_on desc\",$tid)->row_array();\r\n\t\tif($type==5)\r\n\t\t{\r\n\t\t\t$sql = \"SELECT r.*,f.franchise_name,a.name AS admin,d.username AS activated_by ,c.cancel_reason,c.cancelled_on,sum(receipt_amount) as total \r\n\t\t\t\t\t\tFROM pnh_t_receipt_info r \r\n\t\t\t\t\t\tJOIN pnh_m_franchise_info f ON f.franchise_id=r.franchise_id \r\n\t\t\t\t\t\tleft JOIN `pnh_m_deposited_receipts`c ON c.receipt_id=r.receipt_id\r\n\t\t\t\t\t\tLEFT OUTER JOIN king_admin a ON a.id=r.created_by \r\n\t\t\t\t\t\tLEFT OUTER JOIN king_admin d ON d.id=r.activated_by \r\n\t\t\t\t\t\tWHERE r.status in (2,3) AND r.is_active=1 AND r.is_active=1 and f.territory_id=? \r\n\t\t\t\t\t\tORDER BY cancelled_on DESC\";\r\n\t\t\t$total_value=$this->db->query($sql,$tid)->row_array();\r\n\t\t}\t\r\n\t\treturn $total_value;\r\n\t}",
"function buildTaxonQuery($params) {\n $url = \"https://laji.fi/api/taxa?langFallback=false&selectedFields=vernacularName,id,scientificName,synonyms.scientificName&lang=fi&pageSize=\" . $params['pageSize'] . \"&page=\" . $params['page'];\n debugData($url, __LINE__);\n return $url;\n}",
"public function getTaxedPrice();",
"public function getTaxInvoiced();",
"public function consulta_tienda_cart(){\n\n $this->que_dba=\"SELECT * FROM tienda t, inventario i, temp_pedido tp\n\t\t\tWHERE t.cod_tie=i.tienda_cod_tie\n\t\t\tAND i.cod_inv=tp.inventario_cod_inv\n\t\t\tAND tp.usuario_cod_usu='\".$_SESSION['cod_usu'].\"'\n\t\t\tGROUP BY raz_tie;\"; \n\t\t\t \n\t\treturn $this->ejecutar();\n\t}",
"function tratamentoDadosProduto( $name_prod, $preco_prod, $qntd_prod, $categoria_prod,\n $tipo_venda_prod, $qntd_min_prod, $descricao, $producao, $validade, $imgProdutos, \n $tipo_function) \n {\n // limpar o nome do produto para não correr risco de SQLI ou partes html\n $name_prod = filter_var($name_prod, FILTER_SANITIZE_STRING);\n // limpar o valor do produto p/conter apenas números\n $preco_prod = filter_var($preco_prod, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n // limpar a qntd disponivel do produto p/conter apenas números\n $qntd_prod = filter_var($qntd_prod, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n // limpar a categoria do produto p/conter apenas números\n $categoria_prod = filter_var($categoria_prod, FILTER_SANITIZE_STRING);\n // limpar o tipo de venda do produto p/conter apenas números\n $tipo_venda_prod = filter_var($tipo_venda_prod, FILTER_SANITIZE_NUMBER_INT);\n // limpar a qntd minima de venda do produto p/conter apenas números\n $qntd_min_prod = filter_var($qntd_min_prod, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n // limpar a descrição do produto para não correr risco de SQLI ou partes html\n $descricao = filter_var($descricao, FILTER_SANITIZE_STRING);\n // limpar e verificar se a data contém apenas números\n $producao = preg_replace(\"([^0-9/-])\", \"\", $producao);\n // limpar e verificar se a data contém apenas números\n $validade = preg_replace(\"([^0-9/-])\", \"\", $validade);\n\n if ($tipo_function == 1) {\n return $this->cadastrarProduto( $name_prod, $preco_prod, $qntd_prod, $categoria_prod, \n $tipo_venda_prod, $qntd_min_prod, $descricao, $producao, $validade, $imgProdutos);\n\n } elseif ($tipo_function == 2) {\n return $this->updateProduto( $name_prod, $preco_prod, $qntd_prod, $categoria_prod,\n $tipo_venda_prod, $qntd_min_prod, $descricao, $producao, $validade, $imgProdutos);\n }\n }",
"function EstadoCuenta(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_SALAT_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('id_agencia','id_agencia','int4');\n //Definicion de la lista del resultado del query\n $this->captura('id_agencia','int4');\n $this->captura('id_periodo_venta','int4');\n $this->captura('nombre','varchar');\n $this->captura('mes','varchar');\n $this->captura('fecha_ini','date');\n $this->captura('fecha_fin','date');\n $this->captura('credito','varchar');\n $this->captura('total_credito','numeric');\n $this->captura('debito','varchar');\n $this->captura('total_debito','numeric');\n $this->captura('saldo','numeric');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n // var_dump($this->respuesta);exit;\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"public function getTaxList($type ='Both'){\n\t \n\t \t\t$this->db->select(\"TS.tax_id, TS.tax_per, TS.tax_type\");\n\t\t\t$this->db->from(\"tax_structure AS TS\");\n\t\t\t//$this->db->where(\"TS.tax_type\",'Active');\n\t\t\tif($type == 'Both'){\n\t\t\t\t$this->db->where_in('TS.tax_type', array('CST','VAT'));\n\t\t\t}else{\n\t\t\t\t$this->db->where('TS.tax_type', 'Excise');\n\t\t\t}\n\t\t\t$this->db->where(\"TS.status\",'Active');\n\t\t\t$query_tax_array = $this->db->get();\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_tax_array->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_tax_array->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t \n\t }",
"function get_tipos_cuentas_registro() {\n $this->db->select();\n $this->db->from(\"tipo_cuenta_registro\");\n $query = $this->db->get();\n \n if ($query->num_rows() > 0) return $query;\n return NULL;\n }",
"public function getExciseTaxList($type ='Excise'){\n\t \n\t \t\t$this->db->select(\"TS.tax_id, TS.tax_per, TS.tax_type\");\n\t\t\t$this->db->from(\"tax_structure AS TS\");\n\t\t\t//$this->db->where(\"TS.tax_type\",'Active');\n\t\t\t$this->db->where('TS.tax_type', 'Excise');\n\t\t\t$this->db->where(\"TS.status\",'Active');\n\t\t\t$query_tax_array = $this->db->get();\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_tax_array->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_tax_array->result_array();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t \n\t }",
"function getNonTaxable($month, $year, $emp_id){\n \t$sql = \"SELECT (pe_entry_amt+amm_amt)-(statutory_amt+pe_entry_deduct_amt+amm_deduct_amt) AS nontax\n\t\t\t\tFROM \n\t\t\t\t\n\t\t\t\t(SELECT COALESCE(sum(a.ppe_amount),0) as pe_entry_amt \n\t\t\t\tFROM payroll_paystub_entry a \n\t\t\t\tJOIN payroll_paystub_report b on (b.paystub_id=a.paystub_id) \n\t\t\t\tJOIN payroll_pay_period c on (c.payperiod_id=b.payperiod_id) \n\t\t\t\tJOIN emp_masterfile em on (em.emp_id=b.emp_id)\n\t\t\t\tWHERE a.psa_id IN (select distinct a.psa_id \n\t\t\t\tFROM payroll_ps_account a \n\t\t\t\tJOIN payroll_paystub_entry b on (b.psa_id=a.psa_id) \n\t\t\t\tJOIN payroll_pay_stub c on (c.paystub_id=b.paystub_id) \n\t\t\t\tJOIN payroll_pay_period d on (d.payperiod_id=c.payperiod_id)\n\t\t\t\tJOIN payroll_paystub_report e on (e.paystub_id=b.paystub_id) \n\t\t\t\tWHERE a.psa_type=1 and a.psa_procode!=6 and e.emp_id='{$emp_id}' and d.payperiod_period = '{$month}' and d.payperiod_period_year = '{$year}' AND a.psa_tax=0) \n\t\t\t\tAND b.emp_id='{$emp_id}' AND c.payperiod_period = '{$month}' and c.payperiod_period_year = '{$year}') pe_entry_tbl,\n\t\t\t\t\n\t\t\t\t(select COALESCE(sum(a.amendemp_amount),0) as amm_amt \n\t\t\t\tFROM payroll_ps_amendemp a \n\t\t\t\tJOIN payroll_ps_amendment b on (b.psamend_id=a.psamend_id)\n\t\t\t\tJOIN payroll_pay_stub c on (c.paystub_id=a.paystub_id)\n\t\t\t\tJOIN payroll_pay_period d on (d.payperiod_id=c.payperiod_id)\n\t\t\t\tJOIN emp_masterfile em on (em.emp_id=a.emp_id)\n\t\t\t\tWHERE b.psa_id IN (select distinct a.psa_id \n\t\t\t\tFROM payroll_ps_account a \n\t\t\t\tJOIN payroll_ps_amendment b on (b.psa_id=a.psa_id) \n\t\t\t\tJOIN payroll_ps_amendemp c on (c.psamend_id=b.psamend_id) \n\t\t\t\tJOIN payroll_pay_stub d on (d.paystub_id=c.paystub_id) \n\t\t\t\tJOIN payroll_pay_period e on (e.payperiod_id=d.payperiod_id) \n\t\t\t\tWHERE a.psa_type=1 and a.psa_procode!=6 and c.emp_id='{$emp_id}' and e.payperiod_period = '{$month}' and e.payperiod_period_year = '{$year}' AND a.psa_tax=0) \n\t\t\t\tAND a.emp_id='{$emp_id}' AND a.paystub_id!=0 AND d.payperiod_period = '{$month}' AND d.payperiod_period_year = '{$year}') amm_tbl,\n\t\t\t\t\n\t\t\t\t(SELECT COALESCE(sum(a.ppe_amount),0) as statutory_amt \n\t\t\t\tFROM payroll_paystub_entry a \n\t\t\t\tJOIN payroll_paystub_report b on (b.paystub_id=a.paystub_id) \n\t\t\t\tJOIN payroll_pay_period c on (c.payperiod_id=b.payperiod_id) \n\t\t\t\tJOIN emp_masterfile em on (em.emp_id=b.emp_id)\n\t\t\t\tWHERE a.psa_id IN (7,14,15) \n\t\t\t\tAND b.emp_id='{$emp_id}' AND c.payperiod_period = '{$month}' and c.payperiod_period_year = '{$year}') statutory_tbl,\n\t\t\t\t\n\t\t\t\t(SELECT COALESCE(sum(a.ppe_amount),0) as pe_entry_deduct_amt \n\t\t\t\tFROM payroll_paystub_entry a \n\t\t\t\tJOIN payroll_paystub_report b on (b.paystub_id=a.paystub_id) \n\t\t\t\tJOIN payroll_pay_period c on (c.payperiod_id=b.payperiod_id) \n\t\t\t\tJOIN emp_masterfile em on (em.emp_id=b.emp_id)\n\t\t\t\tWHERE a.psa_id IN (select distinct a.psa_id \n\t\t\t\tFROM payroll_ps_account a \n\t\t\t\tJOIN payroll_paystub_entry b on (b.psa_id=a.psa_id) \n\t\t\t\tJOIN payroll_pay_stub c on (c.paystub_id=b.paystub_id) \n\t\t\t\tJOIN payroll_pay_period d on (d.payperiod_id=c.payperiod_id)\n\t\t\t\tJOIN payroll_paystub_report e on (b.paystub_id=e.paystub_id)\n\t\t\t\tWHERE a.psa_type=2 and a.psa_procode!=6 and e.emp_id='{$emp_id}' and d.payperiod_period = '{$month}' and d.payperiod_period_year = '{$year}' AND a.psa_tax=1) \n\t\t\t\tAND b.emp_id='{$emp_id}' AND c.payperiod_period = '{$month}' and c.payperiod_period_year = '{$year}') pe_entry_deduct_tbl,\n\t\t\t\t\n\t\t\t\t(select COALESCE(sum(a.amendemp_amount),0) as amm_deduct_amt \n\t\t\t\tFROM payroll_ps_amendemp a \n\t\t\t\tJOIN payroll_ps_amendment b on (b.psamend_id=a.psamend_id)\n\t\t\t\tJOIN payroll_pay_stub c on (c.paystub_id=a.paystub_id)\n\t\t\t\tJOIN payroll_pay_period d on (d.payperiod_id=c.payperiod_id)\n\t\t\t\tJOIN emp_masterfile em on (em.emp_id=a.emp_id)\n\t\t\t\tWHERE b.psa_id IN (select distinct a.psa_id \n\t\t\t\tFROM payroll_ps_account a \n\t\t\t\tJOIN payroll_ps_amendment b on (b.psa_id=a.psa_id) \n\t\t\t\tJOIN payroll_ps_amendemp c on (c.psamend_id=b.psamend_id) \n\t\t\t\tJOIN payroll_pay_stub d on (d.paystub_id=c.paystub_id) \n\t\t\t\tJOIN payroll_pay_period e on (e.payperiod_id=d.payperiod_id) \n\t\t\t\tWHERE a.psa_type=2 and a.psa_procode!=6 and c.emp_id='{$emp_id}' and e.payperiod_period = '{$month}' and e.payperiod_period_year = '{$year}' AND a.psa_tax=1) \n\t\t\t\tAND a.emp_id='{$emp_id}' AND a.paystub_id!=0 AND d.payperiod_period = '{$month}' AND d.payperiod_period_year = '{$year}') amm_deduct_tbl\";\n \t$rsResult = $this->conn->Execute($sql);\n \twhile(!$rsResult->EOF){\n \t\treturn $rsResult->fields['nontax'];\n \t}\n }",
"function mostra_taxonomia($tax,$sentido) {\n // creditos: https://code.tutsplus.com/tutorials/taxonomy-archives-list-posts-by-taxonomys-terms--cms-20045\n global $post;\n\n $terms = get_terms( $tax, array(\n 'orderby' => 'name',\n 'order' => $sentido,\n 'hide_empty' => 0\n ) );\n\n foreach( $terms as $term ) {\n \n $args = array(\n 'post_type' => 'revistasufg',\n 'orderby' => 'name',\n 'order' => $sentido,\n $tax => $term->slug\n );\n\n $query = new WP_Query($args);\n \n echo'<h4 class=\"divisoria titulo-taxonomia\">' . $term->name . '</h4>';\n \n while ( $query->have_posts() ) : $query->the_post(); \n if( have_rows('revista_informacoes') ): while( have_rows('revista_informacoes') ): the_row();\n loop_revista(); \n endwhile; endif;\n endwhile; wp_reset_postdata();\n }\n}",
"function consulta_datos_formulario_033($req_no) { \n $sql=\" SELECT \n COALESCE(a.req_no::TEXT,'No Aplica') AS req_no\n ,COALESCE(a.dcm_no::TEXT,'No Aplica') AS dcm_no\n ,COALESCE(a.dcm_nm::TEXT,'No Aplica') AS dcm_nm\t\t\t\t\t\n ,COALESCE(a.req_city_nm::TEXT,'No Aplica') AS req_city_nm\n ,COALESCE(nullif(a.exp_sty_ctft_req_no,'')::TEXT,'No Aplica') AS exp_sty_ctft_req_no\n ,COALESCE(nullif(a.qlt_ctft_no,'')::TEXT,'No Aplica') AS qlt_ctft_no\t\t\t\t\t\n ,case \n when dclr_cl_cd='001' \n then 'Persona Jurídica'::TEXT\n WHEN dclr_cl_cd='002'\n then 'Persona Natural'::TEXT\n else\n 'No Aplica'\n end AS dclr_cl_cd\t\t\t\t\t\t\t\t\t\t\n ,COALESCE(a.dclr_idt_no::TEXT,'No Aplica') AS dclr_idt_no\n ,COALESCE(nullif(a.dclr_nole,'')::TEXT,'No Aplica') AS dclr_nole\n ,COALESCE(a.dclr_nm::TEXT,'No Aplica') AS dclr_nm\n ,COALESCE(a.dclr_rpgp_nm::TEXT,'No Aplica') AS dclr_rpgp_nm\t\t\t\t\t\n ,COALESCE(a.dclr_prvhc_nm::TEXT,'No Aplica') AS dclr_prvhc_nm\t\t\t\n ,COALESCE(a.dclr_cuty_nm::TEXT,'No Aplica') AS dclr_cuty_nm\t\t\t\t\t\n ,COALESCE(a.dclr_prqi_nm::TEXT,'No Aplica') AS dclr_prqi_nm\n ,COALESCE(a.dclr_ad::TEXT,'No Aplica') AS dclr_ad\n ,COALESCE(a.dclr_tel_no::TEXT,'No Aplica') AS dclr_tel_no\n ,COALESCE(nullif(a.dclr_fax_no,'')::TEXT,'No Aplica') AS dclr_fax_no\n ,COALESCE(nullif(a.dclr_em,'')::TEXT,'No Aplica') AS dclr_em\n ,COALESCE(a.impr_nm::TEXT,'No Aplica') AS impr_nm\t\t\t\t\t\n ,COALESCE(a.impr_ntn_nm::TEXT,'No Aplica') AS impr_ntn_nm\t\t\t\t\t\n ,COALESCE(a.impr_city_nm::TEXT,'No Aplica') AS impr_city_nm\n ,COALESCE(a.impr_ad::TEXT,'No Aplica') AS impr_ad\n ,COALESCE(nullif(a.impr_tel_no,'')::TEXT,'No Aplica') AS impr_tel_no\n ,COALESCE(nullif(a.impr_fax_no,'')::TEXT,'No Aplica') AS impr_fax_no\n ,COALESCE(nullif(a.impr_em,'')::TEXT,'No Aplica') AS impr_em\n ,case \n when expr_cl_cd='001' \n then 'Persona Jurídica'::TEXT\n WHEN expr_cl_cd='002'\n then 'Persona Natural'::TEXT\n else\n 'No Aplica'\n end AS expr_cl_cd\t\t\t\t\t\t\t\t\t\t\n ,COALESCE(a.expr_idt_no::TEXT,'No Aplica') AS expr_idt_no\n ,COALESCE(a.expr_nm::TEXT,'No Aplica') AS expr_nm\n ,COALESCE(a.expr_atr_no::TEXT,'No Aplica') AS expr_atr_no\t\t\t\t\t\n ,COALESCE(a.expr_ntn_nm::TEXT,'No Aplica') AS expr_ntn_nm\t\t\t\t\t\n ,COALESCE(nullif(a.expr_city_nm,'')::TEXT,'No Aplica') AS expr_city_nm\t\t\t\t\t\n ,COALESCE(a.expr_prvhc_nm::TEXT,'No Aplica') AS expr_prvhc_nm\t\t\t\t\t\n ,COALESCE(a.expr_cuty_nm::TEXT,'No Aplica') AS expr_cuty_nm\t\t\t\t\t\n ,COALESCE(a.expr_prqi_nm::TEXT,'No Aplica') AS expr_prqi_nm\n ,COALESCE(a.expr_ad::TEXT,'No Aplica') AS expr_ad\n ,COALESCE(a.expr_tel_no::TEXT,'No Aplica') AS expr_tel_no\n ,COALESCE(NULLIF(a.expr_fax_no,'')::TEXT,'No Aplica') AS expr_fax_no\n ,COALESCE(NULLIF(a.expr_em,'')::TEXT,'No Aplica') AS expr_em\n ,case \n when pcs_cl_cd='001' \n then 'Persona Jurídica'::TEXT\n WHEN pcs_cl_cd='002'\n then 'Persona Natural'::TEXT\n else\n 'No Aplica'\n end AS pcs_cl_cd\t\t\t\t\t\t\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_idt_no,'')::TEXT,'No Aplica') AS pcs_idt_no\n ,COALESCE(NULLIF(a.pcs_nm,'')::TEXT,'No Aplica') AS pcs_nm\n ,COALESCE(NULLIF(a.pcs_atr_no,'')::TEXT,'No Aplica') AS pcs_atr_no\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_ntn_nm,'')::TEXT,'No Aplica') AS pcs_ntn_nm\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_city_nm,'')::TEXT,'No Aplica') AS pcs_city_nm\n ,COALESCE(NULLIF(a.pcs_rpgp_nm,'')::TEXT,'No Aplica') AS pcs_rpgp_nm\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_prvhc_nm,'')::TEXT,'No Aplica') AS pcs_prvhc_nm\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_cuty_nm,'')::TEXT,'No Aplica') AS pcs_cuty_nm\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_prqi_nm,'')::TEXT,'No Aplica') AS pcs_prqi_nm\n ,COALESCE(NULLIF(a.pcs_ad,'')::TEXT,'No Aplica') AS pcs_ad\n ,COALESCE(NULLIF(a.pcs_tel_no,'')::TEXT,'No Aplica') AS pcs_tel_no\n ,COALESCE(NULLIF(a.pcs_fax_no,'')::TEXT,'No Aplica') AS pcs_fax_no\n ,COALESCE(NULLIF(a.pcs_em,'')::TEXT,'No Aplica') AS pcs_em\t\t\t\t\t\n ,COALESCE(a.dst_ntn_nm::TEXT,'No Aplica') AS dst_ntn_nm\t\t\t\t\t\n ,COALESCE(a.dst_city_nm::TEXT,'No Aplica') AS dst_city_nm\t\t\t\t\t\n ,COALESCE(a.dst_port_nm::TEXT,'No Aplica') AS dst_port_nm\n ,COALESCE(a.inv_no::TEXT,'No Aplica') AS inv_no\t\t\t\t\t\n ,COALESCE(a.spm_port_ntn_nm::TEXT,'No Aplica') AS spm_port_ntn_nm\t\t\t\t\t\n ,COALESCE(a.spm_port_city_nm::TEXT,'No Aplica') AS spm_port_city_nm\n ,COALESCE(a.trsp_way_nm::TEXT,'No Aplica') AS trsp_way_nm\t\t\t\t\t\n ,COALESCE(a.carr_nm::TEXT,'No Aplica') AS carr_nm\n ,COALESCE(nullif(a.vsl_nm,'')::TEXT,'No Aplica') AS vsl_nm\n ,COALESCE(nullif(a.fghnb,'')::TEXT,'No Aplica') AS fghnb\n ,COALESCE(nullif(a.oter_trsp_way_nm,'')::TEXT,'No Aplica') AS oter_trsp_way_nm\n ,COALESCE(nullif(a.ctnr_no,'')::TEXT,'No Aplica') AS ctnr_no\n ,COALESCE(nullif(a.seal_no,'')::TEXT,'No Aplica') AS seal_no\t\t\t\t\t\n ,COALESCE(CAST(round(a.prdt_tot_qt,2)AS CHARACTER VARYING)::TEXT,'No Aplica') AS prdt_tot_qt\n ,COALESCE(a.prdt_tot_qt_ut::TEXT,'No Aplica') AS prdt_tot_qt_ut\t\t\t\t\t\n ,COALESCE(CAST(round(a.prdt_tot_nwt,2)AS CHARACTER VARYING)::TEXT,'No Aplica') AS prdt_tot_nwt\n ,COALESCE(a.prdt_tot_nwt_ut::TEXT,'No Aplica') AS prdt_tot_nwt_ut\n ,COALESCE(a.dclr_rmk::TEXT,'No Aplica') AS dclr_rmk\t\t\t\t\t\n ,COALESCE(to_char(a.mdf_dt,'DD/MM/YYYY HH24:MI:SS')::TEXT,'No Aplica') AS mdf_dt\t\t\t\t\t\n FROM vue_gateway.tn_inp_033 as a \n where a.req_no='\".$req_no.\"'\"; \n $conexion=new DB();\n $row = $conexion->consultar($sql,1); \n $TnInp033=new TnInp033($row); \n return $TnInp033; \n}",
"public function getNominaEtau($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo\n , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca,\n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau\n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon \n inner join n_formulas h on h.id=g.idFor \n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }",
"public function consultarDadosAnexoIHtml($dados) {\n\n $ano = $dados['ano'];\n\n $campo = $dados['mes'];\n\n // $mes = $dados['mes'];\n switch ($dados['mes']) {\n case 'IMPO_VL_TOTAL_JAN':\n $mes = '01';\n break;\n case 'IMPO_VL_TOTAL_FEV':\n $mes = '02';\n break;\n case 'IMPO_VL_TOTAL_MAR':\n $mes = '03';\n break;\n case 'IMPO_VL_TOTAL_ABR':\n $mes = '04';\n break;\n case 'IMPO_VL_TOTAL_MAI':\n $mes = '05';\n break;\n case 'IMPO_VL_TOTAL_JUN':\n $mes = '06';\n break;\n case 'IMPO_VL_TOTAL_JUL':\n $mes = '07';\n break;\n case 'IMPO_VL_TOTAL_AGO':\n $mes = '08';\n break;\n case 'IMPO_VL_TOTAL_SET':\n $mes = '09';\n break;\n case 'IMPO_VL_TOTAL_OUT':\n $mes = '10';\n break;\n case 'IMPO_VL_TOTAL_NOV':\n $mes = '11';\n break;\n case 'IMPO_VL_TOTAL_DEZ':\n $mes = '12';\n break;\n }\n\n\n $tipo = $dados['tipo'];\n\n $ugMostrar = $dados['ug'] === false ? \"\" : \" AND IMPO_CD_UG = {$dados['ug']}\";\n\n if (!empty($tipo)) {\n $sqlTipo = \" AND IMPA_IC_TP_ARQUIVO = {$tipo} \";\n }\n \n $ugMostrar = $dados['ug'] === false ? \"\" : \" AND IMPO_CD_UG = {$dados['ug']}\";\n \n $sql = $this->retornaSqlRelatorio ( $tipo, $dados );\n\n \n \n \n/* $sql = \"\n\n\nSELECT ALIN_ID_ALINEA, INCI_ID_INCISO,ALIN_VL_ALINEA, ALIN_DS_ALINEA, INCI_VL_INCISO, INCI_DS_INCISO, \nUNGE_CD_UG, UNGE_SG_SECAO, UNGE_SG_UG, UNGE_DS_AUTORIDADE_MAXIMA, UNGE_DS_UG,\nSUM($campo) AS TOTAL\nFROM\n(SELECT C.ALIN_ID_ALINEA, D.INCI_ID_INCISO, C.ALIN_VL_ALINEA, C.ALIN_DS_ALINEA, D.INCI_VL_INCISO, D.INCI_DS_INCISO,\nUNGE_CD_UG, UNGE_SG_SECAO, UNGE_SG_UG, UNGE_DS_AUTORIDADE_MAXIMA, UNGE_DS_UG,\n A.$campo\n \n FROM CEO.CEO_TB_IMPO_IMPORTACAO A\n INNER JOIN CEO.CEO_TB_REGC_REGRA_CNJ B ON A.IMPO_IC_CATEGORIA = B.REGC_IC_CATEGORIA\n INNER JOIN CEO.CEO_TB_ALIN_ALINEA C ON B.REGC_ID_ALINEA = C.ALIN_ID_ALINEA\n INNER JOIN CEO.CEO_TB_INCI_INCISO D ON C.ALIN_ID_INCISO = D.INCI_ID_INCISO\n INNER JOIN CEO.CEO_TB_IMPA_IMPORTAR_ARQUIVO E ON A.IMPO_ID_IMPORT_ARQUIVO = E.IMPA_ID_IMPORT_ARQUIVO\n INNER JOIN CEO_TB_UNGE_UNIDADE_GESTORA UNGE ON A.IMPO_CD_UG = UNGE.UNGE_CD_UG \n \n WHERE \n 1= 1\n $sqlTipo\n AND A.$campo <> 0\n AND A.IMPO_ID_ALINEA IS NULL \n AND A.IMPO_ID_INCISO IS NULL\n $ugMostrar\n UNION\n SELECT C.ALIN_ID_ALINEA, D.INCI_ID_INCISO, C.ALIN_VL_ALINEA, C.ALIN_DS_ALINEA, D.INCI_VL_INCISO, D.INCI_DS_INCISO,\n UNGE_CD_UG, UNGE_SG_SECAO, UNGE_SG_UG, UNGE_DS_AUTORIDADE_MAXIMA, UNGE_DS_UG,\n A.$campo\n \n FROM CEO.CEO_TB_IMPO_IMPORTACAO A\n INNER JOIN CEO.CEO_TB_ALIN_ALINEA C ON C.ALIN_ID_ALINEA = A.IMPO_ID_ALINEA\n INNER JOIN CEO.CEO_TB_INCI_INCISO D ON D.INCI_ID_INCISO = A.IMPO_ID_INCISO\n INNER JOIN CEO.CEO_TB_IMPA_IMPORTAR_ARQUIVO E ON A.IMPO_ID_IMPORT_ARQUIVO = E.IMPA_ID_IMPORT_ARQUIVO\n INNER JOIN CEO_TB_UNGE_UNIDADE_GESTORA UNGE ON A.IMPO_CD_UG = UNGE.UNGE_CD_UG \n WHERE \n 1= 1\n $sqlTipo\n AND A.$campo <> 0\n $ugMostrar)\n GROUP BY ALIN_ID_ALINEA, INCI_ID_INCISO, ALIN_VL_ALINEA, ALIN_DS_ALINEA, INCI_VL_INCISO, INCI_DS_INCISO,UNGE_CD_UG, UNGE_SG_SECAO, UNGE_SG_UG, UNGE_DS_AUTORIDADE_MAXIMA, UNGE_DS_UG\n ORDER BY 1,3 \n \";\n*/\n\n\n $db = Zend_Db_Table::getDefaultAdapter();\n $retorno = $db->fetchAll($sql);\n\n return $retorno;\n }",
"function tax()\n {\n if (($data['logedUser'] = $this->_admin_pages()))\n { \n \n $manufacturer['content'] = Modules::run('tax/_index'); \n \n $data['header'] = '';\n $data['titelHeader'] = $this->lang->line('tax');\n $data['content'] = Modules::run('ajaxme/ajaxmeAdmintax',$manufacturer);\n \n \n $this->load->view('general',$data);\n \n }\n }",
"public function allTdgRatificacion(Request $request){\n\n // Inicializar variables\n $escuela_id = '';\n $escuela_id = $request->escuela_id;\n $codigo = '';\n $codigo = $request->codigo;\n $nombre = '';\n $nombre = $request->nombre;\n $tipo_solicitud = '';\n $tipo_solicitud = $request->tipo_solicitud;\n\n // Realizar consultas a la base de datos\n $tdgs = '';\n if($tipo_solicitud == 'cambio_de_nombre'){\n //Solicitudes de cambio de nombre\n $request_name = RequestName::where('aprobado',null)->get();\n $tdgs = array();\n //Validacion para que existan solicitudes de cambio de nombre\n if($request_name->isEmpty()){\n\n }else{\n //Si existen las recorremos\n foreach($request_name as $re1){\n $enable_name[]= $re1->tdg_id;\n }\n\n //Pasamos las solicitudes\n $enable_request = $enable_name;\n\n foreach($enable_request as $enable){\n //Tdg::where('id',$enable)->where('nombre', 'like', '%WP%')->get();\n $consulta = DB::table('tdgs')\n ->select('id', 'codigo', 'nombre')\n ->where('escuela_id', 'like', '%'.$escuela_id.'%')\n ->where('codigo', 'like', '%'.$codigo.'%')\n ->where('nombre', 'like', '%'.$nombre.'%')\n ->where('tdgs.id','=',$enable)\n ->get();\n\n if(!$consulta->isEmpty()){\n array_push($tdgs, $consulta);\n }\n }\n }\n } else if($tipo_solicitud == 'prorroga'){\n //Solicitudes de prorroga\n $request_extension1 = RequestExtension::where('aprobado',null)->where('type_extension_id',1)->get();\n $tdgs = array();\n //Validacion para que existan solicitudes prorroga\n if($request_extension1->isEmpty()){\n\n }else{\n //Si existen las recorremos\n foreach($request_extension1 as $re1){\n $enable_extension1[]= $re1->tdg_id;\n }\n\n //Pasamos las solicitudes\n $enable_request = $enable_extension1;\n\n foreach($enable_request as $enable){\n //Tdg::where('id',$enable)->where('nombre', 'like', '%WP%')->get();\n $consulta = DB::table('tdgs')\n ->select('id', 'codigo', 'nombre')\n ->where('escuela_id', 'like', '%'.$escuela_id.'%')\n ->where('codigo', 'like', '%'.$codigo.'%')\n ->where('nombre', 'like', '%'.$nombre.'%')\n ->where('tdgs.id','=',$enable)\n ->get();\n\n if(!$consulta->isEmpty()){\n array_push($tdgs, $consulta);\n }\n }\n }\n } else if($tipo_solicitud == 'extension_de_prorroga'){\n\n //Solicitudes de extension de prorroga\n $request_extension2 = RequestExtension::where('aprobado',null)->where('type_extension_id',2)->get();\n $tdgs = array();\n //Validacion para que existan solicitudes prorroga\n if($request_extension2->isEmpty()){\n\n }else{\n //Si existen las recorremos\n foreach($request_extension2 as $re2){\n $enable_extension2[]= $re2->tdg_id;\n }\n\n //Pasamos las solicitudes\n $enable_request = $enable_extension2;\n\n foreach($enable_request as $enable){\n //Tdg::where('id',$enable)->where('nombre', 'like', '%WP%')->get();\n $consulta = DB::table('tdgs')\n ->select('id', 'codigo', 'nombre')\n ->where('escuela_id', 'like', '%'.$escuela_id.'%')\n ->where('codigo', 'like', '%'.$codigo.'%')\n ->where('nombre', 'like', '%'.$nombre.'%')\n ->where('tdgs.id','=',$enable)\n ->get();\n\n if(!$consulta->isEmpty()){\n array_push($tdgs, $consulta);\n }\n }\n }\n\n } else if($tipo_solicitud == 'prorroga_especial'){\n //Solicitudes de extension de prorroga\n $request_extension3 = RequestExtension::where('aprobado',null)->where('type_extension_id',3)->get();\n $tdgs = array();\n //Validacion para que existan solicitudes prorroga\n if($request_extension3->isEmpty()){\n\n }else{\n //Si existen las recorremos\n foreach($request_extension3 as $re3){\n $enable_extension3[]= $re3->tdg_id;\n }\n\n //Pasamos las solicitudes\n $enable_request = $enable_extension3;\n\n foreach($enable_request as $enable){\n //Tdg::where('id',$enable)->where('nombre', 'like', '%WP%')->get();\n $consulta = DB::table('tdgs')\n ->select('id', 'codigo', 'nombre')\n ->where('escuela_id', 'like', '%'.$escuela_id.'%')\n ->where('codigo', 'like', '%'.$codigo.'%')\n ->where('nombre', 'like', '%'.$nombre.'%')\n ->where('tdgs.id','=',$enable)\n ->get();\n\n if(!$consulta->isEmpty()){\n array_push($tdgs, $consulta);\n }\n }\n } \n \n } else if($tipo_solicitud == 'nombramiento_de_tribunal'){\n //Solicitudes de nombramiento tribunal\n $request_tribunal = RequestTribunal::where('aprobado',null)->get();\n $tdgs = array();\n //Validacion para que existan solicitudes nombramiento tribunal\n if($request_tribunal->isEmpty()){\n\n }else{\n //Si existen las recorremos\n foreach($request_tribunal as $re2){\n $enable_tribunal[]= $re2->tdg_id;\n }\n\n //Pasamos las solicitudes\n $enable_request = $enable_tribunal;\n\n foreach($enable_request as $enable){\n //Tdg::where('id',$enable)->where('nombre', 'like', '%WP%')->get();\n $consulta = DB::table('tdgs')\n ->select('id', 'codigo', 'nombre')\n ->where('escuela_id', 'like', '%'.$escuela_id.'%')\n ->where('codigo', 'like', '%'.$codigo.'%')\n ->where('nombre', 'like', '%'.$nombre.'%')\n ->where('tdgs.id','=',$enable)\n ->get();\n\n if(!$consulta->isEmpty()){\n array_push($tdgs, $consulta);\n }\n }\n }\n \n } \n else if($tipo_solicitud == 'ratificacion_de_resultados') {\n //Solicitudes de extension de resultado\n $request_results = RequestResult::where('aprobado',null)->get();\n $tdgs = array();\n //Validacion para que existan solicitudes resultado\n if($request_results->isEmpty()){\n\n }else{\n //Si existen las recorremos\n foreach($request_results as $re2){\n $enable_results[]= $re2->tdg_id;\n }\n\n //Pasamos las solicitudes\n $enable_request = $enable_results;\n\n foreach($enable_request as $enable){\n //Tdg::where('id',$enable)->where('nombre', 'like', '%WP%')->get();\n $consulta = DB::table('tdgs')\n ->select('id', 'codigo', 'nombre')\n ->where('escuela_id', 'like', '%'.$escuela_id.'%')\n ->where('codigo', 'like', '%'.$codigo.'%')\n ->where('nombre', 'like', '%'.$nombre.'%')\n ->where('tdgs.id','=',$enable)\n ->get();\n\n if(!$consulta->isEmpty()){\n array_push($tdgs, $consulta);\n }\n }\n }\n }\nelse if($tipo_solicitud=='aprobado'){\n //Solicitudes de extension de resultado\n $request_approved = RequestApproved::where('aprobado',null)->get();\n $tdgs = array();\n //Validacion para que existan solicitudes resultado\n if($request_approved->isEmpty()){\n\n }else{\n //Si existen las recorremos\n foreach($request_approved as $re2){\n $enable_approved[]= $re2->tdg_id;\n }\n\n //Pasamos las solicitudes\n $enable_request = $enable_approved;\n\n foreach($enable_request as $enable){\n //Tdg::where('id',$enable)->where('nombre', 'like', '%WP%')->get();\n $consulta = DB::table('tdgs')\n ->select('id', 'codigo', 'nombre')\n ->where('escuela_id', 'like', '%'.$escuela_id.'%')\n ->where('habilitado', '=', '1')\n ->where('codigo', 'like', '%'.$codigo.'%')\n ->where('nombre', 'like', '%'.$nombre.'%')\n ->where('tdgs.id','=',$enable)\n ->get();\n\n if(!$consulta->isEmpty()){\n array_push($tdgs, $consulta);\n }\n }\n}\n}else if($tipo_solicitud == 'oficializacion'){\n //Solicitudes de extension de resultado\n $request_official = RequestOfficial::where('aprobado',null)->get();\n $tdgs = array();\n //Validacion para que existan solicitudes resultado\n if($request_official->isEmpty()){\n \n }else{\n //Si existen las recorremos\n foreach($request_official as $re2){\n $enable_official[]= $re2->tdg_id;\n }\n \n //Pasamos las solicitudes\n $enable_request = $enable_official;\n \n foreach($enable_request as $enable){\n //Tdg::where('id',$enable)->where('nombre', 'like', '%WP%')->get();\n $consulta = DB::table('tdgs')\n ->select('id', 'codigo', 'nombre')\n ->where('escuela_id', 'like', '%'.$escuela_id.'%')\n ->where('codigo', 'like', '%'.$codigo.'%')\n ->where('nombre', 'like', '%'.$nombre.'%')\n ->where('tdgs.id','=',$enable)\n ->get();\n \n if(!$consulta->isEmpty()){\n array_push($tdgs, $consulta);\n }\n }\n }\n}\n return $tdgs;\n }"
] | [
"0.66550237",
"0.6265659",
"0.6242223",
"0.6144572",
"0.6118079",
"0.6059821",
"0.5950713",
"0.5885671",
"0.5866491",
"0.5849872",
"0.58299667",
"0.5793177",
"0.5777902",
"0.57726985",
"0.5766309",
"0.57435226",
"0.5730709",
"0.5709373",
"0.57048285",
"0.5688068",
"0.56801844",
"0.566887",
"0.5666248",
"0.56402457",
"0.5635889",
"0.56221455",
"0.5597094",
"0.5588911",
"0.5580799",
"0.5580318"
] | 0.63616866 | 1 |
Filtro utilizado para as empresa | function getFiltroEmpresa($get,$where = "1 = 1"){
if(isset($get['cdFilial']) ){
$CdFilial = $get['cdFilial'];
if(!empty($CdFilial)){
return $where .= " AND CDFILIALENTREGA IN ($CdFilial) ";
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function filtrarListaAlumnos($tipo_filtro, $valor)\n {\n //`al`.`carrera_especialidad`\n $filtro = \"\";\n switch ($tipo_filtro){\n case \"1\":\n //Filtro por sexo\n $filtro = \" AND p.sexo = \".$valor;\n break;\n case \"2\":\n //Filtro por municipio\n $filtro = \" AND al.id_municipio = \".$valor;\n break;\n case \"3\":\n //Filtro por por estatus de la cuenta (activa/inactva)\n $filtro = \" AND p.estatus = \".$valor;\n break;\n case \"4\":\n //Filtro por por Id de iniversidad\n $filtro = \" AND al.id_universidad = \".$valor;\n break;\n case \"5\":\n //Filtro por tipo de procedenceia\n $filtro = \" AND al.tipo_procedencia = \".$valor;\n break;\n case \"6\":\n //Filtro por carrera\n $filtro = \" AND al.carrera_especialidad = \".$valor;\n break;\n default:\n $filtro = \"\";\n break;\n }\n $query = \"SELECT \n al.id_alumno, p.nombre, p.app, \n p.apm, p.telefono, p.sexo, \n p.estatus AS estatus_p, al.id_municipio, \n al.id_universidad, al.id_persona, \n al.matricula, al.nombre_uni, al.carrera_especialidad, \n al.email, al.fecha_registro, al.perfil_image, al.estatus \n AS estatus_al, tp.id_tipo_procedencia, tp.tipo_procedencia\n FROM alumno al,persona p , tipo_procedencia tp\n WHERE al.id_persona = p.id_persona \n AND al.id_tipo_procedencia_fk = tp.id_tipo_procedencia\n AND p.estatus = 1 \".$filtro.\" ORDER BY `p`.`nombre` ASC\";\n $this->connect();\n $result = $this->getData($query);\n $this->close();\n return $result;\n }",
"protected function setFiltroBusqueda()\n {\n \tsfLoader::loadHelpers('Date');\n\n \t$parcial = '';\n \t$modulo = $this->getModuleName();\n\n\t\t$this->cajaBsq = $this->getRequestParameter('caja_busqueda');\n\t\t$this->desdeBsq = $this->getRequestParameter('desde_busqueda');\n\t\t$this->hastaBsq = $this->getRequestParameter('hasta_busqueda');\n\t\t$this->ambitoBsq= $this->getRequestParameter('ambito_busqueda');\n\t\t\n\t\tif (!empty($this->cajaBsq)) {\n\t\t\t$parcial .= \" AND (titulo LIKE '%$this->cajaBsq%')\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcaja', $this->cajaBsq);\n\t\t}\n\t\tif (!empty($this->desdeBsq)) {\n\t\t\t$parcial .= \" AND fecha >= '\".format_date($this->desdeBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdesde', $this->desdeBsq);\n\t\t}\n\t\tif (!empty($this->hastaBsq)) {\n\t\t\t$parcial .= \" AND fecha <= '\".format_date($this->hastaBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowhasta', $this->hastaBsq);\n\t\t}\n\t\tif (!empty($this->ambitoBsq)) {\n\t\t\t$parcial .= \" AND ambito = '$this->ambitoBsq'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowambito', $this->ambitoBsq);\n\t\t}\n\t\t//\n\t\tif (!empty($parcial)) {\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowfilter', $parcial);\n\t\t} else {\n\t\t\tif ($this->hasRequestParameter('btn_buscar')) {\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowambito');\n\t\t\t} else {\n\t\t\t\t$parcial = $this->getUser()->getAttribute($modulo.'_nowfilter');\n\t\t\t\t$this->cajaBsq = $this->getUser()->getAttribute($modulo.'_nowcaja');\n\t\t\t\t$this->desdeBsq = $this->getUser()->getAttribute($modulo.'_nowdesde');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowhasta');\n\t\t\t\t$this->ambitoBsq= $this->getUser()->getAttribute($modulo.'_nowambito');\n\t\t\t}\n\t\t}\n\t\tif ($this->hasRequestParameter('btn_quitar')){\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowambito');\n\t\t\t$parcial = \"\";\n\t\t\t$this->cajaBsq = '';\n\t\t\t$this->desdeBsq = '';\n\t\t\t$this->hastaBsq = '';\n\t\t\t$this->ambitoBsq= '';\n\t\t}\n\t\t$this->roles = UsuarioRol::getRepository()->getRolesByUser($this->getUser()->getAttribute('userId'),1);\n\t\t$finalFilter = 'deleted = 0'.$parcial;\n\n\t\tif (!Common::array_in_array(array('1'=>'1', '2'=>'2'), $this->roles)) {\n\t\t\t$finalFilter .= ' AND destacada = 1';\n\t\t}\n\t\treturn $finalFilter;\n }",
"public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n $filters = [];\n\n TSession::setValue(__CLASS__.'_filter_data', NULL);\n TSession::setValue(__CLASS__.'_filters', NULL);\n\n if (isset($data->exemplar_id) AND ( (is_scalar($data->exemplar_id) AND $data->exemplar_id !== '') OR (is_array($data->exemplar_id) AND (!empty($data->exemplar_id)) )) )\n {\n\n $filters[] = new TFilter('exemplar_id', '=', $data->exemplar_id);// create the filter \n }\n\n if (isset($data->leitor_id) AND ( (is_scalar($data->leitor_id) AND $data->leitor_id !== '') OR (is_array($data->leitor_id) AND (!empty($data->leitor_id)) )) )\n {\n\n $filters[] = new TFilter('leitor_id', '=', $data->leitor_id);// create the filter \n }\n\n if (isset($data->dt_emprestimo) AND ( (is_scalar($data->dt_emprestimo) AND $data->dt_emprestimo !== '') OR (is_array($data->dt_emprestimo) AND (!empty($data->dt_emprestimo)) )) )\n {\n\n $filters[] = new TFilter('dt_emprestimo', '>=', $data->dt_emprestimo);// create the filter \n }\n\n if (isset($data->dt_emprestimo_final) AND ( (is_scalar($data->dt_emprestimo_final) AND $data->dt_emprestimo_final !== '') OR (is_array($data->dt_emprestimo_final) AND (!empty($data->dt_emprestimo_final)) )) )\n {\n\n $filters[] = new TFilter('dt_emprestimo', '<=', $data->dt_emprestimo_final);// create the filter \n }\n\n if (isset($data->dt_previsao) AND ( (is_scalar($data->dt_previsao) AND $data->dt_previsao !== '') OR (is_array($data->dt_previsao) AND (!empty($data->dt_previsao)) )) )\n {\n\n $filters[] = new TFilter('dt_previsao', '>=', $data->dt_previsao);// create the filter \n }\n\n if (isset($data->dt_prevista_final) AND ( (is_scalar($data->dt_prevista_final) AND $data->dt_prevista_final !== '') OR (is_array($data->dt_prevista_final) AND (!empty($data->dt_prevista_final)) )) )\n {\n\n $filters[] = new TFilter('dt_previsao', '<=', $data->dt_prevista_final);// create the filter \n }\n\n if (isset($data->dt_devolucao) AND ( (is_scalar($data->dt_devolucao) AND $data->dt_devolucao !== '') OR (is_array($data->dt_devolucao) AND (!empty($data->dt_devolucao)) )) )\n {\n\n $filters[] = new TFilter('dt_devolucao', '>=', $data->dt_devolucao);// create the filter \n }\n\n if (isset($data->dt_devolucao_final) AND ( (is_scalar($data->dt_devolucao_final) AND $data->dt_devolucao_final !== '') OR (is_array($data->dt_devolucao_final) AND (!empty($data->dt_devolucao_final)) )) )\n {\n\n $filters[] = new TFilter('dt_devolucao', '<=', $data->dt_devolucao_final);// create the filter \n }\n\n $param = array();\n $param['offset'] = 0;\n $param['first_page'] = 1;\n\n // fill the form with data again\n $this->form->setData($data);\n\n // keep the search data in the session\n TSession::setValue(__CLASS__.'_filter_data', $data);\n TSession::setValue(__CLASS__.'_filters', $filters);\n\n $this->onReload($param);\n }",
"protected function setFiltroBusqueda()\n {\n \tsfLoader::loadHelpers('Date');\n \t$parcial = '';\n \t$modulo = $this->getModuleName();\n\n\t\t$this->cajaBsq = $this->getRequestParameter('caja_busqueda');\n\t\t$this->categoriaBsq = $this->getRequestParameter('archivo_d_o[categoria_organismo_id]');\n\t\t$this->subcategoriaBsq = $this->getRequestParameter('archivo_d_o[subcategoria_organismo_id]');\n\t\t$this->organismoBsq = $this->getRequestParameter('archivo_d_o[organismo_id]');\n\t\t$this->documentacionBsq = $this->getRequestParameter('archivo_d_o[documentacion_organismo_id]');\n\t\t$this->desdeBsq = $this->getRequestParameter('desde_busqueda');\n\t\t$this->hastaBsq = $this->getRequestParameter('hasta_busqueda');\n\t\t\n\n\t\tif (!empty($this->cajaBsq)) {\n\t\t\t$parcial .= \" AND (ao.nombre LIKE '%$this->cajaBsq%')\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcaja', $this->cajaBsq);\n\t\t}\n\t\tif (!empty($this->categoriaBsq)) {\n\t\t\t$parcial .= \" AND ao.categoria_organismo_id =\".$this->categoriaBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowcategoria', $this->categoriaBsq);\n\t\t}\n\t\tif (!empty($this->subcategoriaBsq)) {\n\t\t\t$parcial .= \" AND ao.subcategoria_organismo_id =\".$this->subcategoriaBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowsubcategoria', $this->subcategoriaBsq);\n\t\t}\n\t\tif (!empty($this->organismoBsq)) {\n\t\t\t$parcial .= \" AND ao.organismo_id =\".$this->organismoBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_noworganismos', $this->organismoBsq);\n\t\t}\n\t\tif (!empty($this->documentacionBsq)) {\n\t\t\t$parcial .= \" AND ao.documentacion_organismo_id =\".$this->documentacionBsq ;\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdocumentacion', $this->documentacionBsq);\n\t\t}\n\t\tif (!empty($this->desdeBsq)) {\n\t\t\t$parcial .= \" AND ao.fecha >= '\".format_date($this->desdeBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowdesde', $this->desdeBsq);\n\t\t}\n\t\tif (!empty($this->hastaBsq)) {\n\t\t\t$parcial .= \" AND ao.fecha <= '\".format_date($this->hastaBsq,'d').\"'\";\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowhasta', $this->hastaBsq);\n\t\t}\n\n\n\t\tif (!empty($parcial)) {\n\t\t\t$this->getUser()->setAttribute($modulo.'_nowfilter', $parcial);\n\t\t} else {\n\t\t\tif ($this->hasRequestParameter('btn_buscar')) {\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcategoria');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowsubcategoria');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_noworganismos');\n\t\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdocumentacion');\n\t\t\t} else {\n\t\t\t\t$parcial = $this->getUser()->getAttribute($modulo.'_nowfilter');\n\t\t\t\t$this->cajaBsq = $this->getUser()->getAttribute($modulo.'_nowcaja');\n\t\t\t\t$this->desdeBsq = $this->getUser()->getAttribute($modulo.'_nowdesde');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowhasta');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowcategoria');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowsubcategoria');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_noworganismos');\n\t\t\t\t$this->hastaBsq = $this->getUser()->getAttribute($modulo.'_nowdocumentacion');\n\t\t\t}\n\t\t} \n\n\t\t\n\t\tif ($this->hasRequestParameter('btn_quitar')){\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowfilter');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcaja');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdesde');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowhasta');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowcategoria');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowsubcategoria');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_noworganismos');\n\t\t\t$this->getUser()->getAttributeHolder()->remove($modulo.'_nowdocumentacion');\n\t\t\t$parcial=\"\";\n\t\t\t$this->cajaBsq = \"\";\n\t\t\t$this->categoriaBsq = '';\n\t\t\t$this->subcategoriaBsq = '';\n\t\t\t$this->organismoBsq = '';\n\t\t\t$this->documentacionBsq = '';\n\t\t\t$this->desdeBsq = '';\n\t\t\t$this->hastaBsq = '';\n\t\t}\n\t\t$organismos = Organismo::IdDeOrganismo($this->getUser()->getAttribute('userId'),1);\n $this->roles = UsuarioRol::getRepository()->getRolesByUser($this->getUser()->getAttribute('userId'),1);\n\t\tif(Common::array_in_array(array('1'=>'1', '2'=>'2', '6'=>'6'), $this->roles))\n\t\t{\n\t\t\treturn \"ao.deleted=0\".$parcial.\" AND (do.owner_id = \".$this->getUser()->getAttribute('userId').\" OR do.estado != 'guardado')\";\n\t\t}\n\t\telse\n\t\t{\n $responsables = ArchivoDO::getUSerREsponsables();\n return \"ao.deleted=0\".$parcial.\" AND ao.organismo_id IN \".$organismos.\" AND (do.owner_id = \".$this->getUser()->getAttribute('userId').\" OR do.estado != 'guardado') AND (ao.owner_id \".$responsables.\" OR do.confidencial != 1 OR ao.owner_id = \".$this->getUser()->getAttribute('userId').\")\";\n }\n\t\t \n\n }",
"public function busquda_Filtro($_Palabra,$_Orden,$_Estado,$_Calificaciones,$_Certificaciones,$_Asociaciones,$IDEMpresa){\n\t\t//primero verifico en que ordern las voy a solicitar\n\t\tif($_Orden===''){\n\t\t\t$_Orden=\"\";\n\t\t}else if($_Orden==='az'){\n\t\t\t$_Orden=\" order by Razon_Social asc\";\n\t\t}else if($_Orden==='za'){\n\t\t\t$_Orden=\" order by Razon_Social desc\";\n\t\t}\n\t\t$_Resultadosr=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Razon_Social LIKE '%$_Palabra%'\");\n\t\t$_Resultadosr=$_Resultadosr->result_array();\n\t\t\n\t\t//busco en su nombre comercial\n\t\t$_Resultadosnc=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Nombre_Comer LIKE '%$_Palabra%'\");\n\t\t$_Resultadosnc=$_Resultadosnc->result_array();\n\n\t\t//busco por su rfc\n\t\t$_Resultadosrfc=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE RFC LIKE '%$_Palabra%' \");\n\t\t$_Resultadosrfc=$_Resultadosrfc->result_array();\n\n\t\t//busco por su descripcion\n\t\t$_Resultadosprefil=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Perfil LIKE '%$_Palabra%' \");\n\t\t$_Resultadosprefil=$_Resultadosprefil->result_array();\n\t\t\n\t\t//buscos por sus productos y servicios\n\t\t$_Resultadospprod=$this->db->query(\"SELECT IDEmpresa FROM productos WHERE Producto LIKE '%$_Palabra%'\");\n\t\t$_Resultadospprod=$_Resultadospprod->result_array();\n\t\t\n\n\t\t//buscos por sus productos y servicios de su descripcion\n\t\t$_Resultadospprodd=$this->db->query(\"SELECT IDEmpresa FROM productos WHERE Descripcion LIKE '%$_Palabra%'\");\n\t\t$_Resultadospprodd=$_Resultadospprodd->result_array();\n\t\t\n\n\t\n\t\n\n\t\t//buscos por sus marca\n\t\t$_Resultadosmarcas=$this->db->query(\"SELECT IDEmpresa FROM marcas WHERE Marca LIKE '%$_Palabra%'\");\n\t\t$_Resultadosmarcas=$_Resultadosmarcas->result_array();\n\n\t\t//buscos por sus normas de calidad\n\t\t$_Resultadosnormas=$this->db->query(\"SELECT IDEmpresa FROM normascalidad WHERE Norma LIKE '%$_Palabra%'\");\n\t\t$_Resultadosnormas=$_Resultadosnormas->result_array();\n\n\t\t// ahohora tengo que unir todos los resultados en un solo array para obtener sus datos\n\t\t$todos=array_merge($_Resultadosr, $_Resultadosnc,$_Resultadosrfc,$_Resultadosprefil,$_Resultadospprod,$_Resultadospprodd,$_Resultadosmarcas,$_Resultadosnormas);\n\t\t\n\t\t$_Resultados=[];\n\t\t//ahora elimino los repetidos\n\t\tforeach($todos as $empresa){\n\t\t\t$bandera=false;\n\t\t\t$resulta=in_array_r($empresa[\"IDEmpresa\"],$_Resultados);\n\t\t\tif($resulta===false){\n\t\t\t\tarray_push($_Resultados,array(\"IDEmpresa\"=>$empresa[\"IDEmpresa\"]));\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// ahora obtengo el filtro de estados\n\t\tif($_Estado!==''){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_Empresa($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif($_datos_empresa[\"Estado\"]!==$_Estado){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\n\t\t\n\t\t// ahora obtengo el filtro de Certificaciones\n\t\tif($_Certificaciones===TRUE){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_certificaciones($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif(count($_datos_empresa)===0){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\n\t\t\n\t\t// ahora obtengo el filtro de Asociaciones\n\t\tif($_Asociaciones===TRUE){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_Asociaciones($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif(count($_datos_empresa)===0){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\t\n\t\t$_Datos=[];\n\t\t\n\t\tif($_Calificaciones!==\"\"){\n\t\t\t$_DatosCalificaciones=explode('-',$_Calificaciones);\n\t\t\t\n\t\t\tforeach($_Resultados as $_Empresa){\n\t\t\t\t$_DatosEmpresa=$this->Datos_Empresa($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_DatosNormas=$this->Model_Norma->getall($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_seguida = $this->Model_Follow->getfollowtrue($IDEMpresa,$_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$ImagenCliente= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'cliente');\n\t\t\t\t$ImagenProveedor= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'proveedor');\n\t\t\t\t$_total=$this->db->query(\"SELECT COUNT('*') AS total FROM tbcalificaciones where IDEmpresaReceptor='\".$_Empresa[\"IDEmpresa\"].\"'\");\n\t\t\t\t$_total=$_total->row_array();\n\t\t\t\tif((int)$_total[\"total\"]>=(int)$_DatosCalificaciones[0] && (int)$_total[\"total\"]<=(int)$_DatosCalificaciones[1] ){\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t$_Datos,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"IDEmpresa\"=>$_DatosEmpresa[\"IDEmpresa\"],\n\t\t\t\t\t\t\t\"Razon_Social\"=>$_DatosEmpresa[\"Razon_Social\"],\n\t\t\t\t\t\t\t\"RFC\"=>$_DatosEmpresa[\"RFC\"],\n\t\t\t\t\t\t\t\"Nombre_Comer\"=>$_DatosEmpresa[\"Nombre_Comer\"],\n\t\t\t\t\t\t\t\"Perfil\"=>$_DatosEmpresa[\"Perfil\"],\n\t\t\t\t\t\t\t\"Logo\"=>$_DatosEmpresa[\"Logo\"],\n\t\t\t\t\t\t\t\"Banner\"=>$_DatosEmpresa[\"Banner\"],\n\t\t\t\t\t\t\t\"Normas\"=>$_DatosNormas,\n\t\t\t\t\t\t\t\"Follow\"=>$_seguida,\n\t\t\t\t\t\t\t\"ImagenCliente\"=>$ImagenCliente,\n\t\t\t\t\t\t\t\"ImagenProveedor\"=>$ImagenProveedor\n\t\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}else{\n\t\t\tforeach($_Resultados as $_Empresa){\n\t\t\t\t\n\t\t\t\t$_DatosEmpresa=$this->Datos_Empresa($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_DatosNormas=$this->Model_Norma->getall($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_seguida = $this->Model_Follow->getfollowtrue($IDEMpresa,$_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$ImagenCliente= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'cliente');\n\t\t\t\t$ImagenProveedor= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'proveedor');\n\t\t\t\t$_total=$this->db->query(\"SELECT COUNT('*') AS total FROM tbcalificaciones where IDEmpresaReceptor='\".$_Empresa[\"IDEmpresa\"].\"'\");\n\t\t\t\tarray_push($_Datos,\n\t\t\t\tarray(\n\t\t\t\t\t\"IDEmpresa\"=>$_DatosEmpresa[\"IDEmpresa\"],\n\t\t\t\t\t\"Razon_Social\"=>$_DatosEmpresa[\"Razon_Social\"],\n\t\t\t\t\t\"RFC\"=>$_DatosEmpresa[\"RFC\"],\n\t\t\t\t\t\"Nombre_Comer\"=>$_DatosEmpresa[\"Nombre_Comer\"],\n\t\t\t\t\t\"Perfil\"=>$_DatosEmpresa[\"Perfil\"],\n\t\t\t\t\t\"Logo\"=>$_DatosEmpresa[\"Logo\"],\n\t\t\t\t\t\"Banner\"=>$_DatosEmpresa[\"Banner\"],\n\t\t\t\t\t\"Normas\"=>$_DatosNormas,\n\t\t\t\t\t\"Follow\"=>$_seguida,\n\t\t\t\t\t\"ImagenCliente\"=>$ImagenCliente,\n\t\t\t\t\t\"ImagenProveedor\"=>$ImagenProveedor\n\t\t\t\t));\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $_Datos;\t\t\n\t}",
"function filterBy_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}",
"function iniciarFiltro(&$filtro) {\n\n if (isset($_GET['order']))\n $filtro->order($_GET['order']);\n $filtro->nombres[] = 'Nombre';\n $filtro->valores[] = array('input', 'nombre', $filtro->filtro('nombre'));\n $filtro->nombres[] = 'Descripción';\n $filtro->valores[] = array('input', 'descripcion', $filtro->filtro('descripcion'));\n }",
"public function filtro($bus,$tip) {\n $this->buscar=$bus;\n $this->tipo=$tip;\n \n switch ($this->tipo){\n case 'apellido': $this->consulta=$this->con->query(\"SELECT * FROM usuarios WHERE apellido LIKE '%$this->buscar%' ORDER BY apellido ASC, nombre ASC\");\n break;\n case 'dni': $this->consulta=$this->con->query(\"SELECT * FROM usuarios WHERE dni = '$this->buscar'\");\n break;\n case 'telefono': $this->consulta=$this->con->query(\"SELECT * FROM usuarios WHERE telefono = '$this->buscar' ORDER BY apellido ASC, nombre ASC\");\n }\n $this->i=1;\n while($this->datos= $this->consulta->fetch_array()) {\n ?>\n <tr>\n <td>\n <b><?php echo $this->i;?></b>\n <img src=\"fotos/<?php echo $this->datos['idUsuario'];?>\" width=\"50px\"> \n </td>\n <td><?php echo $this->datos['apellido'].\", \".$this->datos['nombre'];?></td>\n <td><?php echo $this->datos['usuario'];?></td>\n <td><?php echo $this->datos['dni'];?></td>\n <td><?php echo $this->datos['edad'];?></td>\n <td><?php echo $this->datos['domicilio'];?></td>\n <td><?php echo $this->datos['telefono'];?></td>\n <td><?php echo $this->datos['email'];?></td>\n <td><?php echo $this->datos['sexo'];?></td>\n <td><?php echo $this->datos['privilegio'];?></td>\n <td>\n <div class=\"row\">\n <a class=\"btn btn-success btn-sm\" href=\"formmodificar.php?idUsuario=<?php echo $this->datos['idUsuario'];?>\"><i class=\"material-icons\">create</i></a>\n <a class=\"btn btn-danger btn-sm\" onclick=\"return confirm('¿Desea eliminar este registro?')\" href=\"formeliminar.php?idUsuario=<?php echo $this->datos['idUsuario'];?>\"><i class=\"material-icons\">delete</i></a>\n </div>\n </td>\n </tr> \n <?php \n $this->i++;\n }\n $this->con->close();\n }",
"function filterBy_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}",
"function listarEmpresa(){\n\t\t$this->procedimiento='dir.f_empresa_sel';\n\t\t$this->transaccion='DIR_EMP_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_empresa','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('tipo_sociedad','varchar');\n\t\t$this->captura('actividad','text');\n\t\t$this->captura('actividad_esp','varchar');\n\t\t$this->captura('nit','varchar');\n\t\t$this->captura('actividad_gral','varchar');\n\t\t$this->captura('domicilio','text');\n\t\t$this->captura('matricula','int8');\n\t\t$this->captura('renovado','int4');\n\t\t$this->captura('actividad_prim','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('departamento','varchar');\n\t\t$this->captura('telefono','varchar');\n\t\t$this->captura('municipio','varchar');\n\t\t$this->captura('estado_matricula','varchar');\n\t\t$this->captura('mail','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"private function busquedaUsuarios($filter = array()) {\n $usuarios = new \\Modelos\\userPosix($this->dn, $this->pswd, 'central' );\n $atributos = array('uid','cn','title','o', 'ou','mail', 'telephoneNumber');\n $filtro = empty($filter) ? array(\"cn\"=>\"NOT (root OR nobody)\") : array_merge($filter, array(\"cn\"=>\"NOT (root OR nobody)\"));\n $datos = $usuarios->search($filtro, $atributos, \"dc=sv\");\n $this->parametros['errorLdap'] = $usuarios->getErrorLdap();\n return $datos; \n }",
"private static function _getFilter() {}",
"public function filtrarclientes(){\n\n $this->request->allowMethod(['get']);\n \n $keyword = $this->request->query('keyword');\n $activo = $this->request->query('activo');\n\n $condiciones = array();\n\n $condiciones['name like '] = '%'.$keyword.'%';\n\n if($activo){\n $condiciones['borrado = '] = false;\n }\n \n $query = $this->Clientes->find('all', [\n 'conditions' => $condiciones,\n 'order' => [\n 'Clientes.id' => 'ASC'\n ],\n 'limit' => 100\n ]);\n\n $clientes = $this->paginate($query);\n $this->set(compact('clientes'));\n $this->set('_serialize', 'clientes');\n }",
"public function onSearch()\n {\n // get the search form data\n $data = $this->form->getData();\n $filters = [];\n\n if (count($data->relatorio_id) == 0)\n { \n TTransaction::open('bedevops');\n $conn = TTransaction::get();\n $result = $conn->query('SELECT * FROM relatorio WHERE user_id = '.TSession::getValue(\"userid\").' ORDER BY id DESC LIMIT 4');\n $objects = $result->fetchAll(PDO::FETCH_CLASS, \"stdClass\");\n foreach ($objects as $value) {\n array_push($data->relatorio_id,$value->id);\n }\n TTransaction::close();\n } \n\n TSession::setValue(__CLASS__.'_filter_data', NULL);\n TSession::setValue(__CLASS__.'_filters', NULL);\n\n if (isset($data->categoria_id) AND ( (is_scalar($data->categoria_id) AND $data->categoria_id !== '') OR (is_array($data->categoria_id) AND (!empty($data->categoria_id)) )) )\n {\n\n $filters[] = new TFilter('categoria_id', '=', $data->categoria_id);// create the filter \n }\n\n if (count($data->relatorio_id) <= 4)\n {\n if (isset($data->relatorio_id) AND ( (is_scalar($data->relatorio_id) AND $data->relatorio_id !== '') OR (is_array($data->relatorio_id) AND (!empty($data->relatorio_id)) )) )\n {\n\n $filters[] = new TFilter('relatorio_id', 'in', $data->relatorio_id);// create the filter \n }\n } else {\n throw new Exception('Selecione no máximo 4 relatórios!');\n }\n\n // fill the form with data again\n $this->form->setData($data);\n\n // keep the search data in the session\n TSession::setValue(__CLASS__.'_filter_data', $data);\n TSession::setValue(__CLASS__.'_filters', $filters);\n }",
"function filter_TR_By_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_R)\n{\n global $mysqli;\n $TRES = $TABLE_R;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,ps,pca,pcg,gatb,verbal,numer,indice FROM \" .$TRES. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}",
"public function filtrar(){\n\n \t\t$sql=\"select * from __________ where ;\";\n \t return $this->ejecutar($sql); \n\n }",
"function filter_TR_By_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_R)\n{\n global $mysqli;\n $TRES = $TABLE_R;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio))AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,ps,pca,pcg,gatb,verbal,numer,indice FROM \" .$TRES. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}",
"function filterByS_A_F($SEDE, $AREA, $FACULTAD,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ?\");\n $parametros = array(\"iii\", &$SEDE, &$AREA, &$FACULTAD);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}",
"public function consultaEmpresas() {\n\t\t\treturn $this->entidad->getRepository('\\Entidades\\Expertos\\UsuariosEmpresa')->findBy(array('estado' => 1));\n\t\t}",
"private function filterByPermission(){\n\n }",
"function get_all_empresas($filtrar_aseguradoras = TRUE) {\n $this->db->select();\n $this->db->from(\"empresas\");\n if( $filtrar_aseguradoras ) {\n \t$this->db->where('tipo_empresa_id !=', 4); //SE FILTRAN LAS ASEGURADORAS\n \t}\n $query = $this->db->get();\n \n if ($query->num_rows() > 0) return $query;\n return NULL;\n }",
"public function filtering();",
"public function filter_get()\n {\n //obteniendo parametros filtro\n $ciudades = $this->input->get(\"cities\", true);\n $categorias = $this->input->get(\"categories\", true);\n $distance = $this->input->get(\"distance\", true);\n $current_position = $this->input->get(\"current\", true);\n\n $services = [];\n $filtered = false;\n if ($categorias) {\n $filtered = true;\n $services = $this->filterBySubcategories($categorias);\n $services = $this->filterByCitiesFiltered($ciudades, $filtered, $services);\n } else {\n if ($ciudades) {\n $services = $this->filterByCitiesFiltered($ciudades, false, null);\n $filtered = true;\n }\n }\n if ($current_position && $distance) {\n $services = $this->filterByDistance($distance, $current_position, $filtered, $services);\n }\n $result[\"data\"] = $services;\n $this->set_response($result, REST_Controller::HTTP_OK);\n }",
"public function filtro($dados) {\n\n $data_de = $dados[\"data_de\"];\n $data_ate = $dados[\"data_ate\"];\n $id_usuario = $dados['id_usuario'];\n \n $param = \"\";\n \n if ($data_de != NULL && $data_ate != NULL):\n $objDateFormat = $this->DateFormat;\n $data_de = $objDateFormat->date_mysql($data_de);\n $data_ate = $objDateFormat->date_mysql($data_ate);\n \n $param .= \"and DATE(c.data) BETWEEN '$data_de' AND '$data_ate'\"; \n \n endif;\n \n\n if ($dados[\"id_usuario\"] != NULL):\n $param .= \" and c.id_usuario = $id_usuario\";\n\n endif;\n \n\n \n $query = $this->db->query(\"select c.data,p.codigo,u.login,f.nome,c.valor_venda,c.percentual,(c.valor_venda/100) * c.percentual as 'receber' from fin_comissao c\n inner join com_pedidos p\n on(c.id_pedido = p.id_pedido)\n inner join acesso_usuarios u\n on(c.id_usuario = u.id_usuario)\n inner join rh_colaboradores f\n on(u.id_colaborador = f.id_colaborador) \".$param.\" and p.faturado = 1 \");\n \n $result = $query->result_array();\n\n return $result;\n \n }",
"private function loadFilters() {\n\n // buscando usuários\n $companyId = $this->Session->read('CompanyLoggedIn.Company.id');\n $params = array(\n 'CompaniesUser' => array(\n 'fields' => array(\n 'CompaniesUser.user_id'\n ),\n 'conditions' => array(\n 'CompaniesUser.status' => 'ACTIVE'\n )\n )\n );\n $userIds = $this->Utility->urlRequestToGetData('companies', 'list', $params);\n if (!empty($userIds) && empty($userIds ['status'])) {\n $_SESSION ['addOffer'] ['userIds'] = $userIds;\n\n // conta público alvo\n $this->offerFilters ['target'] = count($userIds);\n\n // busca os filtros\n foreach ($this->offerFilters as $key => $value) {\n if ($key == 'gender') {\n $Paramsgenero = array(\n 'CompaniesUser' => array(\n 'fields' => array(\n \"COUNT(User.id) AS count\",\n \"User.gender AS filter\"\n ),\n 'group' => array(\n \"User.gender\"\n ),\n 'order' => array(\n 'COUNT(User.id)' => 'DESC'\n )\n ),\n 'User' => array()\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'all', $Paramsgenero);\n } else if ($key == 'age_group') {\n // busca faixa etária\n $query = \"SELECT\n\t\t\t\t\t SUM(IF(age < 20,1,0)) AS '{$this->ageGroupRangeKeys['0_20']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 20 AND 29,1,0)) AS '{$this->ageGroupRangeKeys['20_29']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 30 AND 39,1,0)) AS '{$this->ageGroupRangeKeys['30_39']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 40 AND 49,1,0)) AS '{$this->ageGroupRangeKeys['40_49']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 50 AND 59,1,0)) AS '{$this->ageGroupRangeKeys['50_59']}',\n\t\t\t\t\t SUM(IF(age >=60, 1, 0)) AS '{$this->ageGroupRangeKeys['60_120']}',\n\t\t\t\t\t SUM(IF(age IS NULL, 1, 0)) AS '{$this->ageGroupRangeKeys['empty']}'\n\t\t\t\t\t\tFROM (SELECT YEAR(CURDATE())-YEAR(birthday) AS age FROM facebook_profiles) AS derived\";\n\n $filterParams = array(\n 'FacebookProfile' => array(\n 'query' => $query\n )\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'query', $filterParams);\n } else {\n $filterParams = array(\n 'FacebookProfile' => array(\n 'fields' => array(\n \"COUNT(FacebookProfile.{$key}) AS count\",\n \"FacebookProfile.{$key} AS filter\"\n ),\n 'conditions' => array(\n 'FacebookProfile.user_id' => $userIds\n ),\n 'group' => array(\n \"FacebookProfile.{$key}\"\n ),\n 'order' => array(\n \"FacebookProfile.{$key}\" => 'ASC'\n )\n )\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'all', $filterParams);\n }\n if (!empty($filter) && empty($filter ['status'])) {\n $this->offerFilters [$key] = $this->formatOfferFilters($filter);\n }\n }\n return $this->offerFilters;\n } else {\n $this->Session->setFlash('Houve um problema para carregar os filtros. Tente novamente.');\n }\n }",
"function get_elecciones_criterio(){\r\n\r\n\t\tif (isset($_GET['term'])) {\r\n\t\t\t$filtro = $_GET['term'];\r\n\t\t}else{\r\n\t\t\t$filtro = $this->input->get(\"filtro\");\r\n\t\t}\r\n\r\n\t\t$datos = $this->Elecciones_model->get_elecciones_by_criterio($filtro);\r\n\r\n\t\tif (isset($_GET['term'])) {\r\n\t\t\t\r\n\t\t\tforeach ($datos as $dato) {\r\n\t\t\t\t$new_row['label']=htmlentities(stripslashes($dato['desc_eleccion']));\r\n\t\t\t\t$new_row['value']=htmlentities(stripslashes($dato['ideleccion']));\r\n\t\t\t\t$row_set[] = $new_row; //build an array\r\n\t\t\t}\r\n\t\t\r\n\t\t\techo json_encode($row_set);\r\n\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\techo json_encode($datos);\r\n\t\t}\r\n\r\n\t}",
"function getPago($filter) {\n \n $where = \" WHERE Id_pago LIKE :Id_pago OR Estatus LIKE :Estatus\";\n $array = array(\n 'Id_pago' => '%' . $filter . '%',\n 'Estatus' => '%' . $filter . '%',\n );\n $columns = \"`Id_pago`, `Nombre`, `Email`, `Fecha_anterior`, `Pago`, `Proxima_fecha`, `Estatus`, `Id_cliente`\";\n return $this->db->select1($columns, \"pagos\", $where, $array);\n }",
"function getCliente($filter) {\n $where = \" WHERE Id_cliente LIKE :Id_cliente OR Nombre LIKE :Nombre OR Apellido_paterno LIKE :Apellido_paterno\";\n $array = array(\n 'Id_cliente' => '%' . $filter . '%',\n 'Nombre' => '%' . $filter . '%',\n 'Apellido_paterno' => '%' . $filter . '%',\n );\n\n $columns = \"Id_cliente, Nombre, Apellido_paterno, Apellido_materno, Email, Edad, Fecha_inicio, Folio\";\n //Retorname el valor de acuerdo a los parametros que estan arriba\n return $this->db->select1($columns, \"clientes\", $where, $array);\n }",
"private function filtrarPersonas() {\n $aFil = array();\n $aPer = $this->aDatosPersonas;\n $fHom = $this->filtroHombre;\n $fMuj = $this->filtroMujer;\n $fOtr = $this->filtroOtro; \n $fCor = $this->filtroCorreo; \n $fEnv = $this->filtroEnvios;\n $fTel = $this->filtroTelefono;\n $fNot = $this->filtroNotas;\n $fPro = $this->filtroPropietario;\n \n // array('cod'=>array(0 apellidos, 1 nombre, 2 sexo, 3 codusu, 4 correo, 5 envios, 6 telefono, 7 notas)...)\n foreach ($aPer as $per => $aPersona) {\n $bOK = TRUE;\n if ($fHom == 'S' || $fMuj == 'S' || $fOtr == 'S') {\n $bOK = (($fHom == 'S' && $aPersona[2] == 'H') || ($fMuj == 'S' && $aPersona[2] == 'M') || ($fOtr == 'S' && $aPersona[2] == '')) ? TRUE : FALSE;\n }\n if ($fCor == 'S') {\n $bOK = ($fCor == 'S' && !$aPersona[4]) ? FALSE : $bOK;\n }\n if ($fEnv == 'S') {\n $bOK = ($fEnv == 'S' && !$aPersona[5]) ? FALSE : $bOK;\n }\n if ($fTel == 'S') {\n $bOK = ($fTel == 'S' && !$aPersona[6]) ? FALSE : $bOK;\n }\n if ($fNot == 'S') {\n $bOK = ($fNot == 'S' && !$aPersona[7]) ? FALSE : $bOK;\n }\n if ($fPro == 'S') {\n $bOK = (!$this->esPropietario($per)) ? FALSE : $bOK;\n }\n if ($bOK) {\n $aFil[$per] = $aPersona;\n }\n }\n $this->aFiltradas = $aFil;\n }",
"public function buscar() \n {\n \n if($buscar = \\Request::get('q')){\n $personas= Persona:: where(function($query) use ($buscar){\n $query->where('nombre','LIKE', \"%$buscar%\")->orWhere('cedula','LIKE',\"%$buscar%\")\n ->orWhere('tipo','LIKE',\"%$buscar%\")->orWhere('apellido','LIKE',\"%$buscar%\");\n\n })->paginate(20);\n }\n\n return $personas; //retorna toda la consulta\n }"
] | [
"0.6547165",
"0.6509606",
"0.65028065",
"0.64058983",
"0.637555",
"0.6325661",
"0.63012654",
"0.6282521",
"0.62425196",
"0.6237797",
"0.6194856",
"0.6154795",
"0.6150095",
"0.6121487",
"0.6112989",
"0.6094773",
"0.60873294",
"0.6065891",
"0.60560966",
"0.6051112",
"0.60350245",
"0.6004207",
"0.5984788",
"0.5946201",
"0.59430885",
"0.59395874",
"0.5934827",
"0.59336776",
"0.5929484",
"0.59212846"
] | 0.6578873 | 0 |
Updates recipe specified by rid in parameters Performs 1 update for 'recipe' table, and 1 for each 'ingredients' and 1 for each 'directions' | public function updateRecipe($data) {
// Prepare sql query for new recipe entry
$this->db->query('UPDATE recipes SET title=:title, description=:description, prepTime=:prepTime, servingSize=:servingSize, link=:link WHERE rid=:rid;');
// Bind values for prepared statement
$this->db->bind(':title', $data['title']);
$this->db->bind(':description', $data['description']);
$this->db->bind(':prepTime', $data['prepTime']);
$this->db->bind(':servingSize', $data['servingSize']);
$this->db->bind(':link', $data['link']);
$this->db->bind(':rid', $data['rid']);
// Execute query
try {
$this->db->execute();
} catch (PDOException $e) {
echo '</br>FAILED recipe: ' . $e->getMessage() . '</br>';
return false;
}
// Update Ingredients table
for($i = 0; $i < count($data['ingredients']); $i++) {
$this->db->query('UPDATE ingredients SET value=:value WHERE rid=:rid AND ingredientid=:iid;');
$this->db->bind(':value', $data['ingredients'][$i]);
$this->db->bind(':rid', $data['rid']);
$this->db->bind(':iid', $i+1);
$this->db->execute();
}
// Update Directions table
for($i = 0; $i < count($data['directions']); $i++) {
$this->db->query('UPDATE directions SET description=:desc WHERE rid=:rid AND stepNum=:stepNum;');
$this->db->bind(':desc', $data['directions'][$i]);
$this->db->bind(':rid', $data['rid']);
$this->db->bind(':stepNum', $i+1);
$this->db->execute();
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update() {\n\t\tglobal $DB_LINK, $db_table_recipes, $LangUI;\n\t\t$sql = \"\n\t\t\tUPDATE $db_table_recipes\n\t\t\tSET recipe_name='\".$DB_LINK->addq($this->name, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_ethnic='\".$DB_LINK->addq($this->ethnic, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_base=\".$DB_LINK->addq($this->base, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_course=\".$DB_LINK->addq($this->course, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_prep_time=\".$DB_LINK->addq($this->prep_time, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_difficulty=\".$DB_LINK->addq($this->difficulty, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_directions='\".$DB_LINK->addq($this->directions, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_comments='\".$DB_LINK->addq($this->comments, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_serving_size=\".$DB_LINK->addq($this->serving_size, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_source_desc='\".$DB_LINK->addq($this->source_desc, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_source=\".$DB_LINK->addq($this->source, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_private='\".$DB_LINK->addq($this->private, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_modified=$this->modified,\n\t\t\t\trecipe_user='\".$DB_LINK->addq($this->user, get_magic_quotes_gpc()).\"'\n\t\t\t\tWHERE recipe_id=\".$DB_LINK->addq($this->id, get_magic_quotes_gpc()).\"\";\n\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, $LangUI->_('Recipe Successfully updated') . \": \". $this->name,\n\t\t\t$LangUI->_('There was an error updating the recipe'), $sql);\n\t}",
"public function update($recipe){\n $query = $this->db\n ->prepare('UPDATE recipes\n SET\n name = ?,\n directions = ?,\n servings = ?,\n source = ?,\n notes = ?\n WHERE id = ?\n ');\n\n // @ operator to suppress bind_param asking for variables by reference\n // See: https://stackoverflow.com/questions/13794976/mysqli-prepared-statement-complains-that-only-variables-should-be-passed-by-ref\n @$query->bind_param(\"ssissi\",\n $recipe->getName(),\n $recipe->getDirections(),\n $recipe->getServings(),\n $recipe->getSource(),\n $recipe->getNotes(),\n $recipe->getId()\n );\n $bool = $query->execute();\n\n if(!$bool) {\n $error = $query->error;\n echo \"\\n\" . __CLASS__ .\"::\" . __FUNCTION__ . \":\" . $error . \"\\n\";\n }\n return $bool;\n\n }",
"public function updateRecipe(Request $request)\n {\n $user = Auth::user();\n $userId = $user->id;\n $recipeId = $request->input('id');;\n $name = $request->input('name');\n $preparation_time = $request->input('preparation_time');\n $cooking_time = $request->input('cooking_time');\n $description = $request->input('description');\n\n DB::update('UPDATE recipes SET name=?, preparation_time=?, cooking_time=?, description=?, updated_at = NOW() WHERE id=? AND user_id=?', [$name, $preparation_time, $cooking_time, $description, $recipeId, $userId]);\n\n ///Update data in recipes_ingredients table\n $ingredientsToUpdate = $request->input('ingredientsToUpdate');\n\n for ($i = 0; $i < count($ingredientsToUpdate); $i++) {\n $quantity = $ingredientsToUpdate[$i]['quantity'];\n $ingredientId = $ingredientsToUpdate[$i]['ingredients_id'];\n\n DB::update('UPDATE recipes_ingredients SET quantity=? WHERE recipes_id=? AND ingredients_id=?', [$quantity, $recipeId, $ingredientId]);\n }\n\n //If there are ingredients to delete, delete ingredients from recipes_ingredients table\n $ingredientsToDelete = $request->input('ingredientsToDelete');\n\n if ($ingredientsToDelete != null) {\n for ($i = 0; $i < count($ingredientsToDelete); $i++) {\n $ingredientId = $ingredientsToDelete[$i]['ingredients_id'];\n\n DB::delete('DELETE FROM recipes_ingredients WHERE recipes_id=? AND ingredients_id=?', [$recipeId, $ingredientId]);\n }\n }\n\n //If user create new ingredients, send data to recipes_ingredients table\n $ingredientsToAdd = $request->input('ingredientsToAdd');\n\n if ($ingredientsToAdd != null) {\n for ($i = 0; $i < count($ingredientsToAdd); $i++) {\n $ingredientId = $ingredientsToAdd[$i]['ingredients_id'];\n $quantity = $ingredientsToAdd[$i]['quantity'];\n\n DB::insert('INSERT INTO recipes_ingredients SET ingredients_id=?, quantity=?, recipes_id=?', [$ingredientId, $quantity, $recipeId]);\n }\n }\n\n return redirect()->route('recipes');\n }",
"function ciniki_recipes_recipeUpdate(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'recipe_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Recipe'), \n 'name'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Name'), \n 'primary_image_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Image'),\n 'num_servings'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Number of Servings'), \n 'webflags'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Web Flags'), \n 'prep_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Prep Time'), \n 'roast_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Roast Time'), \n 'cook_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Cook Time'), \n 'synopsis'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Synopsis'), \n 'description'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Description'), \n 'ingredients'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Ingredients'), \n 'instructions'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Instructions'), \n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Notes'), \n 'tag-10'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Meals'),\n 'tag-20'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Ingredients'),\n 'tag-30'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Cuisines'),\n 'tag-40'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Methods'),\n 'tag-50'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Occasions'),\n 'tag-60'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Diets'),\n 'tag-70'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Seasons'),\n 'tag-80'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Collections'),\n 'tag-90'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Products'),\n 'tag-100'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Contributors'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'recipes', 'private', 'checkAccess');\n $rc = ciniki_recipes_checkAccess($ciniki, $args['tnid'], 'ciniki.recipes.recipeUpdate'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n if( isset($args['name']) ) {\n $args['permalink'] = preg_replace('/ /', '-', preg_replace('/[^a-z0-9 ]/', '', strtolower($args['name'])));\n //\n // Make sure the permalink is unique\n //\n $strsql = \"SELECT id, name, permalink FROM ciniki_recipes \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \"\n . \"AND id <> '\" . ciniki_core_dbQuote($ciniki, $args['recipe_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.recipes', 'recipe');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.recipes.16', 'msg'=>'You already have a recipe with this name, please choose another name'));\n }\n }\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.recipes');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Update the recipe\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.recipes.recipe', \n $args['recipe_id'], $args);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the tags\n //\n $tag_types = array(\n '10'=>'meals',\n '20'=>'mainingredients',\n '30'=>'cuisines',\n '40'=>'methods',\n '50'=>'occasions',\n '60'=>'diets',\n '70'=>'seasons',\n '80'=>'collections',\n '90'=>'products',\n '100'=>'contributors',\n );\n foreach($tag_types as $tag_type => $arg_name) {\n if( isset($args['tag-' . $tag_type]) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.recipes', 'tag', $args['tnid'],\n 'ciniki_recipe_tags', 'ciniki_recipe_history',\n 'recipe_id', $args['recipe_id'], $tag_type, $args['tag-' . $tag_type]);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.recipes');\n return $rc;\n }\n }\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.recipes');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'recipes');\n\n return array('stat'=>'ok');\n}",
"public function updateRecipeIngredient($recipeIngredientId, $amountGrams);",
"public function update($reign_id, $attributes);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'title' => 'required',\n 'category' => 'required',\n 'time' => 'required',\n 'difficulty' => 'required',\n 'preparation' => 'required',\n // 'cover' => 'required',\n 'ingrdient' => 'required',\n 'persons' => 'required',\n ] , [\n 'title.required' => 'Ingresa el título de la receta',\n 'category.required' => 'Selecciona la categoría de la receta',\n 'time.required' => 'Ingresa el tiempo de preparación de la receta',\n 'difficulty.required' => 'Selecciona la dificultad de la receta',\n 'preparation.required' => 'Ingresa el método de preparación de la receta',\n 'cover.required' => 'Ingresa la imagen de la receta',\n 'ingrdient.required' => 'Ingresa los ingredientes de la receta',\n 'persons.required' => 'Ingresa el número de personas de la receta',\n ]);\n\n\n $r = Recipe::find($id);\n $r->title = $request->title;\n $r->category_id = $request->category;\n $r->time = $request->time;\n $r->difficulty = $request->difficulty;\n $r->preparation = $request->preparation;\n $r->persons = $request->persons;\n\n $old_i = RecipeIngredient::where('recipe_id' , $r->id)->get();\n\n if (count($old_i) > 0) {\n foreach ($old_i as $o_i) {\n $o_i->delete();\n }\n }\n\n foreach ($request->ingrdient as $i) {\n $ri = new RecipeIngredient;\n $ri->recipe_id = $r->id;\n $ri->item = $i;\n $ri->save();\n }\n\n if ($request->cover) {\n @unlink(public_path().'/files/recipes/'.$r->cover);\n $name_cover = md5(uniqid().$request->cover->getClientOriginalName()).'.'.$request->cover->getClientOriginalExtension();\n $r->cover = $name_cover;\n $request->cover->move(public_path().'/files/recipes/' , $name_cover);\n }\n \n $r->save();\n\n return back()->with('msj' , 'Receta actualizada exitosamente');\n }",
"public function update(Request $request, $id) {\n $validator = Validator::make($request->all(), [\n 'nom' => 'required',\n 'description' => 'required',\n 'prix' => 'min:1|max:5',\n 'difficulte' => 'min:1|max:5',\n 'nbre_personnes' => 'min:1',\n 'image' => 'url'\n ]);\n\n if ($validator->fails()) {\n return redirect('recettes/' . $id . '/edit')->withErrors($validator);\n } else {\n $recette = Recette::findOrFail($id);\n $recette->nom = $request['nom'];\n $recette->description = $request['description'];\n $recette->prix = $request['prix'];\n $recette->difficulte = $request['difficulte'];\n $recette->nbre_personnes = $request['nbre_personnes'];\n $recette->calories = 0;\n $recette->lipides = 0;\n $recette->glucides = 0;\n $recette->protides = 0;\n $recette->duree_totale = 0;\n $recette->save();\n\n $recette->ingredients()->detach();\n //ajout des ingrédients\n $nbr_ing = count($request->ingredient_id);\n for ($i=0; $i<$nbr_ing; $i++) {\n //avoid duplicates entries\n $exists = $recette->ingredients()\n ->where('id_ingredients', $request->ingredient_id[$i])\n ->exists();\n\n if(!$exists) {\n $ingredient = Ingredient::find($request->ingredient_id[$i]);\n $ingredient_qte = $request->ingredient_qte[$i];\n\n //on suppose que les infos d'un ing. sont stockées pour une qté de 1\n $recette->calories += ($ingredient->calories * $ingredient_qte)/$recette->nbre_personnes;\n $recette->glucides += ($ingredient->glucides * $ingredient_qte)/$recette->nbre_personnes;\n $recette->protides += ($ingredient->protides * $ingredient_qte)/$recette->nbre_personnes;\n $recette->lipides += ($ingredient->lipides * $ingredient_qte)/$recette->nbre_personnes;\n\n $recette->ingredients()->attach($request->ingredient_id[$i], [\n 'id_recettes' => $recette->id,\n 'quantite' => $ingredient_qte\n ]);\n }\n }\n\n Etape::where('id_recettes', $recette->id)->delete();\n //ajout des étapes\n $nbr_etapes = count($request->etapes_new);\n\n for ($i=0; $i<$nbr_etapes; $i++) {\n if($request->etapes_new[$i] != NULL) {\n $etape = new Etape;\n $etape->description = $request->etapes_new[$i];\n $etape->nom = $request->titres[$i];\n $etape->duree = $request->durees[$i];\n $etape->ordre = $i;\n $etape->id_recettes = $recette->id;\n $etape->id_etape_types = $request->type[$i];\n $etape->save();\n\n $recette->duree_totale += $etape->duree;\n }\n }\n\n Media::where('id_recettes', $recette->id)->delete();\n //ajout de l'image\n $image = new Media;\n $image->url = $request->image;\n $image->id_recettes = $recette->id;\n $image->id_media_types = 1;\n $image->save();\n\n $recette->save();\n\n return redirect('recettes');\n }\n }",
"public static function updateServings(int $id, int $servings, mysqli $db) {\n\t\tif($update = $db->prepare('update recipe set servings=? where id=? limit 1'))\n\t\t\tif($update->bind_param('ii', $servings, $id))\n\t\t\t\tif($update->execute())\n\t\t\t\t\t$update->close();\n\t\t\t\telse\n\t\t\t\t\tself::DatabaseError('Error updating recipe servings', $update);\n\t\t\telse\n\t\t\t\tself::DatabaseError('Error binding parameters to update recipe servings', $update);\n\t\telse\n\t\t\tself::DatabaseError('Error preparing to update recipe servings', $db);\n\t}",
"function updateRecipe($id, $name,$url,$img,$time,$instructions){\n\t\t if(($name != NULL) && ($id != NULL))\n\t\t { \n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Recipes WHERE (RecipeID = '$id')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0)\n\t\t print \"Recipe doesn't exist\";\n\t\t else\n\t\t @mysql_query(\"UPDATE Recipes SET RecipeName = $name,\n \t\t\t URL = '$url', Image = '$img', TotalCookingTime = '$time',\n\t\t\t\t\t\t\t Instructions = '$instructions' WHERE (RecipeID = '$id')\");\n\t }\n\t}",
"public function update(Request $request, Instruction $instruction, $recipe_id, $id)\n {\n $instruction = Instruction::find($id);\n $instruction->description = $request->description;\n $instruction->update();\n }",
"function UpdateIngredientRecipe($recipe, $old, $ingredient, $qty, $units){\n\t $recipeid = $this->getRecipeID($recipe);\n\t if(($recipeid != NULL) && ($ingredient != NULL) && ($old != NULL) && ($qty !=NULL) && ($units != NULL))\n\t\t{ \n\t\t if($qty <= 0)\n\t\t return;\n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Ingredients WHERE (Recipe = '$recipeid' AND IngredientName = '$old')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0)\n\t\t print \"Item doesn't exist\";\n\t\t\telse\n\t\t @mysql_query(\"UPDATE Ingredients SET IngredientName = $ingredient,\n \t\t\t Quantity ='$qty', Units = '$units'\n\t\t\t\t\t\t\t WHERE (Recipe = '$recipeid' AND IngredientName = '$old')\");\n\t }\n\t}",
"public function createNewRecipe($data) {\n // Get id of new recipe\n $this->db->query('SELECT rid FROM recipes WHERE rid=(SELECT MAX(rid) FROM recipes)');\n $this->db->execute();\n $row = $this->db->single();\n // Increment recipe id\n $newRecipeID = $row->rid + 1;\n\n // Upload image and return path\n $imgPath = $this->uploadImage($newRecipeID, $data['uid'], $data['img']);\n\n // Prepare sql query for new recipe entry\n $this->db->query('INSERT INTO recipes (rid,title,ownerid,description,prepTime,servingSize,imagePath,link) VALUES(:rid,:title,:uid,:description,:prepTime,:servingSize,:imagePath,:link);');\n // Bind values for prepared statement\n $this->db->bind(':rid', $newRecipeID);\n $this->db->bind(':uid', $data['uid']);\n $this->db->bind(':title', $data['title']);\n $this->db->bind(':description', $data['description']);\n $this->db->bind(':prepTime', $data['prepTime']);\n $this->db->bind(':servingSize', $data['servingSize']);\n $this->db->bind(':imagePath', $imgPath);\n $this->db->bind(':link', $data['link']);\n // Execute query\n try {\n $this->db->execute();\n } catch (PDOException $e) {\n echo '</br>FAILED recipe: ' . $e->getMessage() . '</br>';\n return false;\n }\n\n // Insert ingredients\n $ingredQueryArray = $this->convertIngredientsFormat($newRecipeID, $data['ingredients']);\n $ingredQueryString = 'INSERT INTO ingredients (rid,ingredientid,value) VALUES ' . implode(\", \", $ingredQueryArray) . ';';\n // echo $ingredQueryString;\n $this->db->query($ingredQueryString);\n // Bind all values in ingredients query\n for($i = 0; $i < count($ingredQueryArray); $i++) {\n $this->db->bind(':value' . ($i + 1), $data['ingredients'][$i]);\n }\n // Execute query\n try {\n $this->db->execute();\n } catch (PDOException $e) {\n echo '</br>FAILED ingredients: ' . $e->getMessage() . '</br>';\n return false;\n }\n\n // Insert directions\n $direcQueryArray = $this->convertDirectionsFormat($newRecipeID, $data['directions']);\n $direcQueryString = 'INSERT INTO directions (rid,stepNum,description) VALUES ' . implode(\", \", $direcQueryArray) . ';';\n // echo $direcQueryString;\n $this->db->query($direcQueryString);\n // Bind all values in ingredients query\n for($i = 0; $i < count($direcQueryArray); $i++) {\n $this->db->bind(':value' . ($i + 1), $data['directions'][$i]);\n }\n // Execute query\n try {\n $this->db->execute();\n } catch (PDOException $e) {\n echo '</br>FAILED directions: ' . $e->getMessage() . '</br>';\n return false;\n }\n\n return true;\n }",
"public function edit(Recipe $recipe)\n {\n //\n }",
"public function edit(Recipe $recipe)\n {\n //\n }",
"public function ActualizarIngredientes()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"codingrediente\"]) or empty($_POST[\"nomingrediente\"]) or empty($_POST[\"cantingrediente\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select nomingrediente from ingredientes where codingrediente != ? and nomingrediente = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"codingrediente\"], $_POST[\"nomingrediente\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" nomingrediente = ?, \"\n\t\t.\" cantingrediente = ?, \"\n\t\t.\" costoingrediente = ?, \"\n\t\t.\" unidadingrediente = ?, \"\n\t\t.\" codproveedor = ?, \"\n\t\t.\" stockminimoingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $nomingrediente);\n\t\t$stmt->bindParam(2, $cantingrediente);\n\t\t$stmt->bindParam(3, $costoingrediente);\n\t\t$stmt->bindParam(4, $unidadingrediente);\n\t\t$stmt->bindParam(5, $codproveedor);\n\t\t$stmt->bindParam(6, $stockminimoingrediente);\n\t\t$stmt->bindParam(7, $codingrediente);\n\n\t\t$nomingrediente = strip_tags($_POST[\"nomingrediente\"]);\n\t\t$cantingrediente = strip_tags($_POST[\"cantingrediente\"]);\n\t\t$costoingrediente = strip_tags($_POST[\"costoingrediente\"]);\n\t\t$unidadingrediente = strip_tags($_POST[\"unidadingrediente\"]);\n\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t$stockminimoingrediente = strip_tags($_POST[\"stockminimoingrediente\"]);\n\t\t$codingrediente = strip_tags($_POST[\"codingrediente\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL INGREDIENTE FUE ACTUALIZADO EXITOSAMENTE\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n}",
"public function assignRecipeIngredientToRecipe($recipeId, RecipeIngredient $recipeIngredient): RecipeIngredient;",
"public function editAction(){\n\t\t$recipe = new Recipe();\n\t\t\n\t\t//updating the meal\n\t\tif ($this->_request->isPost()) {\n\t\n\t\t\t$data = $this->_validateRecipe();\n\t\t\t//if no errors validating fields add recipe\n\t\t\tif ($this->view->errorMsg == null) {\n\t\t\t\t$recipe_id = $this->_request->getPost('recipe_idTF');\n\t\t\t\t\n\t\t\t\t//make sure recipe with this name does not already exist\n\t\t\t\t$where = array(\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('user_id = ?', $this->session->user_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('recipe_id != ?', $recipe_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('title = ?', $data['recipe']['title']),\n\t\t\t\t\t'status is null'\n\t\t\t\t); \n\t\t\t\t$recipe_row = $recipe->fetchRow($where);\n\t\t\t\tif($recipe_row != null){\n\t\t\t\t\t$this->view->errorMsg = 'Meal \"'.$data['recipe']['title'].'\" already exists, please use a different title.';\n\t\t\t\t\t$data['recipe']['recipe_id'] = $recipe_id;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//update recipe\n\t\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$recipe->update($data['recipe'], $where);\n\t\n\t\t\t\t\t//delete old recipexquantityxingredients\n\t\t\t\t\t$rxqxi = new RecipexQuantityxIngredient();\n\t\t\t\t\t$where = $rxqxi->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$rxqxi->delete($where);\n\t\t\t\t\t\n\t\t\t\t\t$this->_saveRecipexQuantityxIngredient($recipe_id, $data);\n\t\t\n\t\t\t\t\t//if successful, redirect to main page\n\t\t\t\t \t$this->_redirect($this->baseUrl.'/meals');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t$this->view->recipe_data = $data;\t\t\n\t\t}\n\t\t//get meal to display in edit form\n\t\telse{\n\t\t\t$filter = new Zend_Filter_StripTags();\n\t\t\t$id = trim($filter->filter($this->_request->getQuery('id')));\n\t\t\tif($id != null){\n\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $id);\n\t\t\t\t$row = $recipe->fetchRow($where);\n\t\t\n\t\t\t\t$data = $this->_getRecipe($row);\n\t\t\t\t$this->view->recipe_data = $data;\n\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t//populate amounts and ingredients for autocomplete textfields (COPY&PASTE = YUCK!)\n \t$ingredient_arr = array();\n \t$ingredient = new Ingredient();\n\t\t$ingredient_rs = $ingredient->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$ingredient = $ingredient_rs->current();\n\t\t\t$ingredient_arr[$i] = $ingredient->name;\n\t\t\t$i++;\n\t\t\t$ingredient_rs->next();\n\t\t}\n \t$this->view->ingredient_data = $ingredient_arr;\n\t\n \t$amount_arr = array();\n \t$quantity = new Quantity();\n\t\t$quantity_rs = $quantity->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$amount = $quantity_rs->current();\n\t\t\tif($amount->measure != null) $amount_arr[$i] = $this->_convertd2f($amount->amount).' '.$amount->measure;\n\t\t\telse $amount_arr[$i] = $amount->amount;\n\t\t\t$i++;\n\t\t\t$quantity_rs->next();\n\t\t}\n \t$this->view->amount_data = $amount_arr;\n \t\n \t\n \t\n \t// additional view fields required by form\n\t\t$this->view->action = 'edit';\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->render('add');\n }",
"public function updaterecord( Request $r,$rid)\n {\n //checking whether we are getting edited vlues in the controller\n $t=task::find($rid);\n $t->title= $r->input('title');\n \n $t->detail= $r->input('detail');\n \n $t->date= $r->input('date');\n \n $res= $t->save();//insert function\n if($res==1)\n {\n //echo\"Record inserted Suceefully\";\n return redirect('home');\n }\n else\n {\n echo\"Failed to update the record\";\n }\n\n\n }",
"public function update(Request $request, Recipe $recipe)\n {\n /*if($recipe->update($request->validate([\n 'name' => 'required',\n 'description' => 'required'\n ]))){\n return response(['message' => \"Recipe successfully updated!\"], 200)\n ->header('Content-Type', 'application/json');\n }else\n abort('500');\n */\n return $recipe->update($request->validate([\n 'name' => 'required',\n 'description' => 'required'\n ]));\n\n }",
"public function update(Request $request, Recipe $recipe)\n {\n \\Log::info(json_encode($request));\n\n \\DB::transaction(function() use($request) {\n $steps = $request->get(\"steps\");\n });\n\n return response()->json();\n }",
"public function editRent($args = []){\r\n\t\ttry {\r\n\t\t\t$conn = $this->connect();\r\n\t\t\t$sql = \"UPDATE rent\" \r\n\t\t\t\t\t.\"SET\" \r\n\t\t\t\t\t.\"rent_name = :rent_name, price = :price, type_id= :type_id, square = :square,\" \r\n\t\t\t\t\t.\"describe_rent = :describe_rent, post_time = :post_time, drop_time = :drop_time,\"\r\n\t\t\t\t\t.\"status = :status, user_id = :user_id, province_id = :province_id, district_id = :district_id,\" \r\n\t\t\t\t\t.\"ward_id = :ward_id, address_detail = :address_detail\" \r\n\t\t\t\t\t.\"WHERE rent_id = :rent_id\";\r\n\t\t\t$stmt = $conn->prepare($sql);\r\n\t\t\t$stmt->bindParam(':rent_name',$args['rent_name']);\r\n\t\t\t$stmt->bindParam(':price',$args['price']);\r\n\t\t\t$stmt->bindParam(':type_id',$args['type_id']);\r\n\t\t\t$stmt->bindParam(':square',$args['square']);\r\n\t\t\t$stmt->bindParam(':describe_rent',$args['describe_rent']);\r\n\t\t\t$stmt->bindParam(':post_time',$args['post_time']);\r\n\t\t\t$stmt->bindParam(':drop_time',$args['drop_time']);\r\n\t\t\t$stmt->bindParam(':status',$args['status']);\r\n\t\t\t$stmt->bindParam(':user_id',$args['user_id']);\r\n\t\t\t$stmt->bindParam(':province_id',$args['province_id']);\r\n\t\t\t$stmt->bindParam(':district_id',$args['district_id']);\r\n\t\t\t$stmt->bindParam(':ward_id',$args['ward_id']);\r\n\t\t\t$stmt->bindParam(':address_detail',$args['address_detail']);\r\n\t\t\t$stmt->bindParam(':rent_id',$args['rent_id']);\t\t\t\r\n\t\t\t$stmt->execute();\r\n\t\t\treturn true;\r\n\t }catch(PDOException $e){\t \t\r\n\t \treturn false;//error 404\r\n\t }\r\n\t}",
"function addIngredientToRecipe($recipe, $ingredient, $qty, $units){\n\t $recipeid = $this->getRecipeID($recipe);\n\t if(($recipeid != NULL) && ($ingredient != NULL) && ($qty != NULL)&& ($units != NULL))\n\t\t{ \n\t\t if($qty <= 0)\n\t\t return;\n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Ingredients WHERE (Recipe = '$recipeid' AND IngredientName = '$ingredient' AND Units ='$units')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] >= 1)\n\t\t @mysql_query(\"UPDATE Ingredients SET Quantity = Quantity + '$qty' WHERE (Recipe = '$recipeid' AND IngredientName = '$ingredient' AND Units ='$units')\");\n\t\t else\n\t\t @mysql_query(\"INSERT INTO Ingredients VALUES ('$recipeid','$ingredient','$qty','$units')\");\n\t }\n\t}",
"public function setRecipes(array $recipes):void\n {\n $this->recipes = $recipes;\n }",
"public function update(Request $request, $id)\n {\n $receta = Receta::find($id);\n\n $inputs = $request->only('nombre','porciones','preparacion','comedor_id');\n $ingredientes = $request->get('ingredientes');\n\n //dd($inputs);\n\n try{\n \\DB::beginTransaction();\n\n $receta->update($inputs);\n\n $receta->ingredientes()->delete();\n\n //dd($ingredientes);\n\n foreach ($ingredientes as $ingrediente){\n $receta->ingredientes()->create($ingrediente);\n }\n\n //$receta->ingredientes->updateOrCreate($ingredientes);\n\n \\DB::commit();\n $receta->load('ingredientes');\n return $this->jsonMensajeData('Receta Modificada','','success',$receta);\n\n }catch (\\Exception $e){\n \\DB::rollBack();\n return $this->jsonMensajeError('Error',$e->getMessage());\n }\n\n\n }",
"public function update($id, UpdateRecipeRequest $request)\n\t{\n\n\t\t// dd($request);\n\t\t$input = $request->all();\n\t\tif(array_key_exists('thumbnail', $input)){\n\t $file = $input['thumbnail'];\n\t $file_id = $this->addThumbnail($file);\n\t $input['thumbnail_id'] = $file_id;\n \t}\n\t\t$recipe = $this->recipeRepository->find($id);\n\n\t\tif(empty($recipe))\n\t\t{\n\t\t\tFlash::error('Recipe not found');\n\n\t\t\treturn redirect(route('recipes.index'));\n\t\t}\n\n\t\t$recipe->fill($input);\n\t\tif(array_key_exists('products', $input)){\n\t\t\t$recipe->products()->sync($input['products']);\n\t\t}\n\t\t\n\t\t$recipe->save();\n\n\n\t\tFlash::success('Recipe updated successfully.');\n\n\t\treturn redirect(route('recipes.index'));\n\t}",
"public function update(Request $request, $id)\r\n {\r\n //\r\n //validujemo\r\n $this->validate($request, [\r\n 'title' => 'required',\r\n 'ingredients' => 'required',\r\n 'description' => 'required',\r\n 'photo' => 'required'\r\n ]);\r\n\r\n // upisujemo u bazu\r\n $recipe = Recipe::find($id);\r\n $recipe->user_id = auth()->user()->id;\r\n $recipe->title = $request->input('title'); // vracamo ime iz input\r\n $recipe->ingredients = $request->input('ingredients'); \r\n $recipe->description = $request->input('description');\r\n $recipe->photo = $request->input('photo');\r\n \r\n // cuvamo poruku\r\n $recipe->save();\r\n\r\n return redirect('/dashboard')->with('success', 'Izmenjen recept!');\r\n }",
"public function editingredients($id)\n\n {\n\n\t\tif($this->uri->segment(3)==\"\")\n\n\t\t{\n\n\t\t\t$this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); \n\n\t\t\tredirect('admin/recipe/viewingredients');\t\n\n\t\t}\n\n\t\t\n\n\t\tif ($this->input->server('REQUEST_METHOD') == 'POST')\n\n\t\t{\n\n \n\n\t $data['name']= strip_tags($this->input->post('name'));\n\n\t\t\t$name=strip_tags($this->input->post('slug'));\n\n\t\t\t$data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name)));\n\n\t\t\t$data['description']= strip_tags($this->input->post('description'));\n\n\t\t\t$data['status']= strip_tags($this->input->post('status'));\n\n \n\n \n\n\t\t\t $this->form_validation->set_rules('name', 'Name', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('description', 'Description', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('slug', 'Slug', 'trim|required');\n\n \n\n if ($this->form_validation->run() == TRUE) {\n\n $data_inserted = $this->Ingredients_model->edit_data($data,$id);\n\n $this->session->set_flashdata('success_msg', 'Ingredient edited Successfully'); \n\n redirect('admin/recipe/viewingredients');\t\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t\n\n\t\t$site_name=$this->config->item('site_name');\n\n\t $this->template->set('title', 'Edit Ingredients | '.$site_name);\n\n\t\t$data_single = $this->Ingredients_model->get_data_by_id($id);\n\n\t\t$data['ingredients']=$data_single ;\n\n\t\t//print_r($data_single);die();\n\n $this->template->set_layout('layout_main', 'front');\n\n $this->template->build('editingredients',$data);\n\n }",
"public function editrecipe($id)\n\n {\n\n\t\tif($this->uri->segment(3)==\"\")\n\n\t\t{\n\n\t\t\t$this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); \n\n\t\t\tredirect('admin/recipe/viewrecipe');\t\n\n\t\t}\n\n\t\t$data_class['all_difficulty'] = $this->Recipe_model->difficulty_allvalue();\n\n\t\t$data_class['all_meal'] = $this->Recipe_model->meal_allvalue();\n\n\t\t$data_class['all_category'] = $this->Recipe_model->category_allvalue();\n\n \t$data_class['all_unit'] = $this->Recipe_model->unit_allvalue();\n \t\n \t$data_class['all_instruction'] = $this->Recipe_model->instruction_allvalue();\n \t\n \t$data_class['all_ingredients'] = $this->Recipe_model->ingredients_allvalue();\n \t\n \t$data_class['all_nutritional'] = $this->Recipe_model->nutritional_allvalue();\n \t\n\t\tif ($this->input->server('REQUEST_METHOD') == 'POST')\n\t\t\n\t\t{\n\t\t\textract($_POST);\n\t\t\textract($_FILES);\n\t\t\t/*echo \"<pre>\";\n\t\t\tprint_r($_POST);\n\t\t\tprint_r($_FILES);\n\t\t\techo \"</pre>\";*/\t\t\t\n\t\t\t//print_r($lastid);\n\t\t\t//echo $recipe_code;die(\"here\");\n\t\t\t//INSERT INSTUCTION\n\t\t\tfor($i=0;$i<count($inst_name);$i++){\n\t\t\t\t$this->load->library('upload');\n\t\t\t\t$_FILES['userfile']['name']=$_FILES['ins_image']['name'][$i];\n\t\t\t\t$_FILES['userfile']['type'] = $_FILES['ins_image']['type'][$i];\n $_FILES['userfile']['tmp_name'] = $_FILES['ins_image']['tmp_name'][$i];\n $_FILES['userfile']['error'] = $_FILES['ins_image']['error'][$i];\n $_FILES['userfile']['size'] = $_FILES['ins_image']['size'][$i];\n $config['upload_path'] = '../uploads/recipe_image/instruction';\n $config['allowed_types'] = 'png|jpg|jpeg';\n $config['max_size'] = 100000;\n //$config['max_width'] = 1024;\n // $config['max_height'] = 768;\n $this->upload->initialize($config);\t\n if (! $this->upload->do_upload()) {\n \t$error = array('error' => $this->upload->display_errors()); \n\t\t\t\t} else {\n\t\t\t\t\t$instruction['recipe_code']=$recipe_code;\n\t\t\t\t\t$instruction['name']=$inst_name[$i];\n\t\t\t\t\t$final_files_data[] = $this->upload->data(); \n\t\t\t\t\t$instruction['images']= $final_files_data[0]['file_name'];\n\t\t\t\t\t$data_instuction_insert = $this->Recipe_model->instruction_insert($instruction);\n\t\t\t\t}\t\t\t \n\t\t\t\t\n\t\t\t}\n\t\t\t//insert into ingradients\n\t\t\t//$delete_ingradient=$this->Recipe_model->delete_ingredient($recipe_code);\n\t\t\t\n\t\t\tfor($ig=0;$ig<count($ing_name);$ig++){\n\t\t\t\t$ingradients['recipe_code']=$recipe_code;\n\t\t\t\t$ingradients['name']=$ing_name[$ig];\n\t\t\t\t$ingradients['quantity']=$ing_quantity[$ig];\n\t\t\t\t$ingradients['unit']=$ing_unit[$ig];\n\t\t\t\t$data_ingradients_insert = $this->Recipe_model->ingradients_insert($ingradients);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//insert nutrituioin element\n\t\t\t\n\t\t\tfor($ne=0;$ne<count($ne_name);$ne++){\n\t\t\t\t$nutrition['recipe_code']=$recipe_code;\n\t\t\t\t$nutrition['name']=$ne_name[$ne];\n\t\t\t\t$nutrition['quantity']=$ne_quantity[$ne];\n\t\t\t\t$nutrition['unit']=$ne_unit[$ne];\n\t\t\t\t$data_nutrition_insert = $this->Recipe_model->nutrition_insert($nutrition);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//die(\"here\");\n\t\t\t\n\t\t\t\n\t\t\t$data['recipe_code']= strip_tags($recipe_code);\n\n\t\t\t$name=strip_tags($this->input->post('recipe_name'));\n\n\t\t\t$data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name)));\n\n\t\t\t\n\n\t\t\t$data['recipe_name']= strip_tags($this->input->post('recipe_name'));\n\n\t\t\t$data['preparetion_time']= strip_tags($this->input->post('preparetion_time'));\n\n\t\t\t$data['cook_time']= strip_tags($this->input->post('cook_time'));\n\n\t\t\t$data['serving_people']= strip_tags($this->input->post('serving_people'));\n\n\t\t\t$data['dificulty']= strip_tags($this->input->post('dificulty'));\n\n\t\t\t$data['type_of_meal']= strip_tags($this->input->post('type_of_meal'));\n\t\t\t\n\t\t\t$data['category']=json_encode($this->input->post('category'));\n\t\t \n\t\t\t//print_r($data['category']);die();\n\t\t\t$data['description']= $this->input->post('description');\n\n\t\t\t$data['status']= strip_tags($this->input->post('status'));\n\n\t\t\t$now = date('Y-m-d');\n\n\t\t\t$data['created_on'] =$now;\n\t\t\t$data['approve_on']=date('Y-m-d H:i:s');\n\t\t\t\t\t\t\n\n\t\t\t $this->form_validation->set_rules('recipe_name', 'Recipe Name', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('preparetion_time', 'Preparetion Time', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('cook_time', 'Cook Time', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('serving_people', 'Serving People', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('dificulty', 'Dificulty', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('type_of_meal', 'Type Of Meal', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('description', 'Description', 'trim|required');\n\t\t\t \n\t\t\t\t\t $this->load->library('upload');\n $number_of_files_uploaded = count($_FILES['feature_image']['name']);\n\n\n\n // Faking upload calls to $_FILE\n\n $_FILES['userfile']['name'] = $_FILES['feature_image']['name'];\n\n $_FILES['userfile']['type'] = $_FILES['feature_image']['type'];\n\n $_FILES['userfile']['tmp_name'] = $_FILES['feature_image']['tmp_name'];\n\n $_FILES['userfile']['error'] = $_FILES['feature_image']['error'];\n\n $_FILES['userfile']['size'] = $_FILES['feature_image']['size'];\n\n $config['upload_path'] = '../uploads/recipe_image';\n $config['allowed_types'] = 'png|jpg|jpeg';\n\n $config['max_size'] = 100000;\n\n //$config['max_width'] = 1024;\n\n // $config['max_height'] = 768;\n\n $this->upload->initialize($config);\n\n\n\n\n\n if (! $this->upload->do_upload()) {\n\n $error = array('error' => $this->upload->display_errors()); \n\n \n\n } else {\n\n \n\n $final_files_data[] = $this->upload->data();\n\n \n\n $data['feature_image']= $final_files_data[0]['file_name'];\n\n\t\t\t if ($this->form_validation->run() == TRUE) {\n\n $data_inserted = $this->Recipe_model->edit_data($data,$id);\n\n $this->session->set_flashdata('success_msg', 'Recipe edited Successfully'); \n\n redirect('admin/recipe/viewrecipe');\n \t\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t\n\n\t\t}\n\t\t\n\n\t\t\n\n\t\t$site_name=$this->config->item('site_name');\n\n\t $this->template->set('title', 'Edit Recipe | '.$site_name);\n\n\t\t$data_single = $this->Recipe_model->get_data_by_recipecode($id);\n\n\t\t$data_class['recipe_all']=$data_single ;\n\t\t$data_class['ingredients']=$this->Ingredients_model->get_data_by_recipe_code($id);\n\t\t$data_class['instruction']=$this->Recipe_model->instruction_by_recipecode($id);\n\t\t$data_class['nutrition_element']=$this->Nutritional_elements_model->get_data_by_recipecode($id);\n\n\t\t//print_r($data_single);die();\n\n $this->template->set_layout('layout_main', 'front');\n\n $this->template->build('editrecipe',$data_class);\n\n }",
"public function update(RecipeRequest $request, $id)\n {\n $recipe = Recipe::find($id);\n if(!$recipe)\n {\n\n return response()->json(\"'message':'resource not found'\", 404)\n ->header('Content-Type', 'application/json');\n\n }\n else{\n $recipe->update((new Recipe())->getCreateArray( $request));\n $recipe->save();\n\n return new RecipeResource( $recipe );\n }\n\n }"
] | [
"0.69037193",
"0.67274123",
"0.6386638",
"0.61902964",
"0.6058181",
"0.57459766",
"0.57151175",
"0.56524765",
"0.5652353",
"0.5621309",
"0.5475809",
"0.54728484",
"0.5432611",
"0.54289174",
"0.54289174",
"0.5392331",
"0.53768164",
"0.5358123",
"0.5350924",
"0.5293205",
"0.5274517",
"0.5266395",
"0.52395517",
"0.5220455",
"0.51822305",
"0.51544887",
"0.5145137",
"0.5143037",
"0.51192075",
"0.50836706"
] | 0.73330796 | 0 |
HELPER FUNCTION Convert ingredients array to sql value template. Each element follows format: '(rid, x, :valuex)' where x increments from 1 to number of ingredients To use in sql query: implode(", ", convertIngredientsFormat($rid, $data['ingredients'])) | private function convertIngredientsFormat($rid, $ingredients) {
$result = [];
for($i = 1; $i < count($ingredients) + 1; $i++) {
$result[$i - 1] = '(' . $rid . ', ' . $i . ', :value' . $i . ')';
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function prepareValuesRow(): string\n {\n $values = [];\n foreach ($this->storage as $key => $value) {\n $values[] = \"('{$key}', '{$value}')\";\n }\n\n return implode(', ', $values);\n }",
"function convert_array($in_array, $start_pos)\n{\n\t$string1 = \"\";\n\t$string2 = \"\";\n\t$total = count($in_array);\n\twhile ($start_pos < $total)\n\t{\n\t\t$string1 = $string1 . \"`\" . $in_array[$start_pos] . \"`\";\n\t\t$start_pos++;\n\t\t$string2 = $string2 . \"\\\"\" . $in_array[$start_pos] . \"\\\"\";\n\t\t$start_pos++;\n\t\tif ($start_pos < $total)\n\t\t{\n\t\t\t$string1 = $string1 . \", \";\n\t\t\t$string2 = $string2 . \", \";\n\t\t}\n\t}\n\tif ($start_pos == 2)\n\t{\t$return_string = \"(clanid, \" . $string1 . \") values (0, \" . $string2 . \")\";\t}\n\telse\n\t{\t$return_string = \"(\" . $string1 . \") values (\" . $string2 . \")\";\t}\n\treturn $return_string;\n}",
"function sqlingData(array $data)\n{\n\n $keys = \"(\" . implode(\",\", array_keys($data)) . \")\";\n $values = \"('\" . implode(\"','\", array_values($data)) . \"')\";\n\n return $keys . 'Values' . $values;\n}",
"public function toInterpolatedSql() {\n $query = $this->toSql();\n $params = $this->values;\n\n $keys = array();\n $values = $params;\n\n # build a regular expression for each parameter\n foreach ($params as $key => $value) {\n if (is_string($key)) {\n $keys[] = '/:'.$key.'/';\n } else {\n $keys[] = '/[?]/';\n }\n\n if (is_string($value))\n $values[$key] = \"'\" . self::quoteValue($value) . \"'\";\n\n if (is_array($value))\n $values[$key] = \"'\" . implode(\"','\", self::quoteValue($value)) . \"'\";\n\n if (is_null($value))\n $values[$key] = 'NULL';\n }\n\n $query = preg_replace($keys, $values, $query, 1, $count);\n\n return $query;\n }",
"public function createRecipeIngredientsTable()\r\n\t{\r\n\t\t$query = 'CREATE TABLE `recipeIngredients` (\r\n\t\t\t`articleId` int(8) unsigned NOT NULL,\r\n\t\t\t`NDB_No` int(5) unsigned zerofill NOT NULL,\r\n\t\t\t`amount` double unsigned default NULL,\r\n\t\t\t`weightId` int(3) unsigned NOT NULL,\r\n\t\t\tPRIMARY KEY (`articleId`,`NDB_No`),\r\n\t\t\tKEY `recipe` (`articleId`)\r\n\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT=\"Recipe ingredient (amount) mapping\"';\r\n\t\t$this->_db->setQuery($query);\r\n\t\treturn $this->_db->query();\r\n\t}",
"public function getIngredients(): array{\r\n $ingredients = array();\r\n $con = $this->db->getConnection();\r\n foreach(mysqli_query($con, 'SELECT * FROM ingredients')as $key){ $ingredients[$key['idingredients']] = $key['ingredient']; }\r\n return $ingredients;\r\n $this->con->closeConnection();\r\n }",
"function getRecipeIngredients($recipe){\n\t $recipeid = $this->getRecipeID($recipe);\n\t $array = array();\n\t\t$i = 0;\n\t $list = @mysql_query(\"SELECT * FROM Ingredients WHERE Recipe = '$recipeid'\");\n\t\t while($row = @mysql_fetch_assoc($list)) \n\t\t { \n\t\t $name=$row['IngredientName'];\n\t\t $qty = $row['Quantity'];\n\t\t $unit = $row['Units'];\n\t\t $array2 = array($qty,$unit,$name);\n\t\t\t$array[$i] = $array2;\n\t\t\t$i = $i+1;\n\t\t\t\n\t\t }\t\n\t\treturn $array;\n\t}",
"final public function generateFormattedSQL()\n {\n $parts = $this->generateOrderedSQLParts();\n return array_reduce($parts, function ($memo, $part) {\n $type = current(array_keys($part));\n $value = current($part);\n $sep = $this->getSeparatorForPartType($type);\n if (!$memo) {\n return $value;\n }\n return \"{$memo}{$sep}{$value}\";\n }, null);\n }",
"public function toInClausePlaceHolderString(array &$values, $prefix = null)\n {\n if (is_null($prefix)) {\n $prefix = 'parameter';\n }\n\n $resultArray = [];\n foreach (array_values($values) as $index => $value) {\n $name = sprintf(\n ':%s%s',\n $prefix,\n $index\n );\n $resultArray[$name] = $value;\n }\n $values = $resultArray; // overwrite referenced array\n\n return sprintf(\n '(%s)',\n implode(', ', array_keys($resultArray))\n );\n }",
"public static function import_nutrition( $ingredients ) {\n\t\t$wpurp_nutrition = get_option( 'wpurp_nutritional_information', array() );\n\n\t\tforeach ( $ingredients as $ingredient_id ) {\n\t\t\t$ingredient = get_term( $ingredient_id, 'ingredient' );\n\n\t\t\t$nutrition = isset( $wpurp_nutrition[ $ingredient_id ] ) ? $wpurp_nutrition[ $ingredient_id ] : false;\n\n\t\t\tif ( $nutrition ) {\n\t\t\t\t$wprm_nutrition = array(\n\t\t\t\t\t'amount' => isset( $nutrition['_meta']['serving_quantity'] ) ? sanitize_text_field( $nutrition['_meta']['serving_quantity'] ) : '',\n\t\t\t\t\t'unit' => isset( $nutrition['_meta']['serving_unit'] ) ? sanitize_text_field( $nutrition['_meta']['serving_unit'] ) : '',\n\t\t\t\t\t'nutrients' => array(),\n\t\t\t\t);\n\n\t\t\t\t$nutrition_mapping = array(\n\t\t\t\t\t'calories' => 'calories',\n\t\t\t\t\t'carbohydrate' => 'carbohydrates',\n\t\t\t\t\t'protein' => 'protein',\n\t\t\t\t\t'fat' => 'fat',\n\t\t\t\t\t'saturated_fat' => 'saturated_fat',\n\t\t\t\t\t'polyunsaturated_fat' => 'polyunsaturated_fat',\n\t\t\t\t\t'monounsaturated_fat' => 'monounsaturated_fat',\n\t\t\t\t\t'trans_fat' => 'trans_fat',\n\t\t\t\t\t'cholesterol' => 'cholesterol',\n\t\t\t\t\t'sodium' => 'sodium',\n\t\t\t\t\t'potassium' => 'potassium',\n\t\t\t\t\t'fiber' => 'fiber',\n\t\t\t\t\t'sugar' => 'sugar',\n\t\t\t\t\t'vitamin_a' => 'vitamin_a',\n\t\t\t\t\t'vitamin_c' => 'vitamin_c',\n\t\t\t\t\t'calcium' => 'calcium',\n\t\t\t\t\t'iron' => 'iron',\n\t\t\t\t);\n\t\t\n\t\t\t\t$migrate_values = array(\n\t\t\t\t\t'vitamin_a' => 5000,\n\t\t\t\t\t'vitamin_c' => 82.5,\n\t\t\t\t\t'calcium' => 1000,\n\t\t\t\t\t'iron' => 18,\n\t\t\t\t);\n\t\t\n\t\t\t\tforeach ( $nutrition_mapping as $wpurp_field => $wprm_field ) {\n\t\t\t\t\t$wprm_nutrition['nutrients'][ $wprm_field ] = isset( $nutrition[ $wpurp_field ] ) ? $nutrition[ $wpurp_field ] : '';\n\t\t\n\t\t\t\t\tif ( array_key_exists( $wprm_field, $migrate_values ) && $recipe['nutrition'][ $wprm_field ] ) {\n\t\t\t\t\t\t// Daily needs * currently saved as percentage, round to 1 decimal.\n\t\t\t\t\t\t$wprm_nutrition['nutrients'][ $wprm_field ] = round( $migrate_values[ $nutrient ] * ( $recipe['nutrition'][ $wprm_field ] / 100 ), 1 );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$term_id = self::get_or_create_ingredient( $ingredient->name );\n\t\t\t\tupdate_term_meta( $term_id, 'wprpn_nutrition', $wprm_nutrition );\n\t\t\t}\n\t\t}\n\t}",
"function prepSelected($data){\n\t\n\t$current = 0;\n\t$count = count($data);\n\t\n\t$placeholders = ''; $selected = array(); $i = 0;\n\t$keys = array_keys($data); \n\t\n\tforeach($keys as $item){\n\t\tprint_r($data);\n\t\t\n\t\tswitch($item){\n\t\t\tcase $data[$i] == $keys[$i] : array_push($selected, $item);\n\t\t\tbreak;\n\t\t}\n\t\t$i++;\n\t}\n\tprint_r($selected);\n\t\t\n\t//While there are selected items\n\twhile($current < $count){\n\t\t//create the keys\t\n\t\tif($count == 1) { \n\t\t\t$keys .= $selected[$current];\n\t\t} else {\n\t\t\t$keys .= $selected[$current].',';\n\t\t} \t\n\t\t//create the placeholders\t\n\t\tif($count == 1) { \n\t\t\t$placeholders .= '?';\n\t\t} else {\n\t\t\t$placeholders .= '?,';\n\t\t} \t\n\t\t$current++; \n\t}\n\tif($count > 1){\n\t\t$keys = explode(',', $keys);\n\t\t$trash = array_pop($keys);\n\t\t$keys = implode(',', $keys);\n\t\t\t\n\t\t$placeholders = explode(',', $placeholders);\n\t\t$trash = array_pop($placeholders);\n\t\t$placeholders = implode(',', $placeholders);\n\t\t\t\n\t}\n\t\n\n\t\n\treturn $sql_vals = array($keys, $placeholders);\n}",
"public function getIngredientsById($r_id)\r\n {\r\n require 'database.php';\r\n $sql = \"SELECT i.ingredient, i.amount, m.measurements FROM `ingredients` AS i LEFT JOIN measurement AS m ON m.id = i.measurement WHERE i.recipe_id = $r_id\";\r\n $output = $DB_con->query($sql);\r\n foreach ($output as $outputs) {\r\n echo \"<p>\" . $outputs['ingredient'] . \" \" . $outputs['amount'] . \" \". $outputs['measurements'] . \"</p>\";\r\n \r\n \r\n }\r\n }",
"public function values($data, $format)\n {\n $result = '';\n $replace = (strpos($format, '%value%') !== false) || (strpos($format, '%column%') !== false); \n if (is_array($data)) {\n foreach ($data as $key => $value) {\n $value = is_null($value) ? 'NULL' : (is_int($value) ? $value : '\"' . $this->escapeSQL($value) . '\"');\n $key = $this->escapeDbIdentifier($key);\n if ($format == 'fields') {\n $result .= \", $key\";\n } else{\n if ($format == 'pairs') {\n $result .= \", $key = $value\";\n } elseif ($replace) {\n $result .= \", \" . strtr($format, ['%value%' => $value, '%column%' => $key]);\n } else {\n $result .= \",\\t$value\";\n }\n }\n }\n }\n return substr($result, 2 /* length of the initial \", \" */);\n }",
"protected function buildValuesForInsert()\n {\n return ' ('\n . $this->indentCsv(array_keys($this->col_values))\n . PHP_EOL . ') VALUES ('\n . $this->indentCsv(array_values($this->col_values))\n . PHP_EOL . ')';\n }",
"public function formatIngredients($ingr)\n {\n // Clean input of \\r's and then create array of ingredients\n $ingr = str_replace(\"\\n\\r\", \"\\n\", $ingr);\n $ingrList = explode(\"\\n\", $ingr);\n\n $ingrStr = '<li><label><input class=\"step-ingredient-check\" type=\"checkbox\"> ';\n $ingrStr .= implode(\"</label></li>\\n<li><label><input class=\\\"step-ingredient-check\\\" type=\\\"checkbox\\\"> \", $ingrList);\n $ingrStr .= \"</label></li>\\n\";\n\n return $ingrStr;\n }",
"function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)\n //VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');\n\n $col_str= array_map(function($obj){\n //\n //Return the full description of the columns\n return \"`$obj->name`\"; \n }, $this->values);\n //\n //\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return $value;\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n $values= implode(\",\",$values_str);\n $cols= implode(\",\",$col_str);\n return \"($cols) VALUES ($values)\";\n }",
"public function fillIngredients()\n {\n $ingredients_data = $this->_db()->select('select id_ingredient, base_quantity from product_ingredients where id_product=?d', $this->id);\n foreach ($ingredients_data as $ing)\n {\n $this->ingredients[$ing['id_ingredient']] = new Model_Product($ing['id_ingredient']);\n $this->ingredients[$ing['id_ingredient']]->base_quantity = $ing['base_quantity'];\n $this->ingredients[$ing['id_ingredient']]->fillIngredients();\n }\n }",
"function arrayIntoString_sql(array $arr)\n {\n $str = \"\";\n foreach ($arr as $k => $v) {\n $str .= (count($arr) - 1 != $k)\n ? \"'\". $v . \"', \"\n : \"'\". $v . \"'\";\n }\n return $str;\n }",
"private function transform($value) {\n $CI = & get_instance();\n // caso seja um array\n if (is_array($value)) {\n // percorre os valores\n foreach ($value as $x) {\n // se for um inteiro\n if (is_integer($x)) {\n $foo[] = $x;\n } else if (is_string($x)) {\n // se for string, adiciona aspas\n $foo[] = $CI->db->escape($x);\n }\n }\n // converte o array em string separada por \",\"\n $result = '(' . implode(',', $foo) . ')';\n }\n // caso seja uma string\n else if (is_string($value)) {\n // adiciona aspas\n $result = $CI->db->escape($value);\n }\n // caso seja valor nullo\n else if (is_null($value)) {\n // armazena NULL\n $result = 'NULL';\n }\n\n // caso seja booleano\n else if (is_bool($value)) {\n // armazena TRUE ou FALSE\n $result = $value ? 'TRUE' : 'FALSE';\n } else {\n $result = $CI->db->escape($value);\n }\n // retorna o valor\n return $result;\n }",
"function prepareVariableString($value) {\n\t\t if (!is_array($value)) {\n\t\t return '\"'.addslashes($value).'\"';\n\t\t } else {\n\t\t $str = 'array('.chr(10);\n\t\t foreach ($value as $key => $item) {\n\t\t $str .= '\"'. addslashes($key).'\" => '.'\"'.addslashes($item).'\",'.chr(10);\n\t\t } \n\t\t $str .= \")\";\n\t\t } \n\t\t return $str;\n\t\t}",
"private function formatArrayValues(array $data): string\n {\n return implode(\n ', ',\n array_map(\n function ($value) {\n return '\"'.$value.'\"';\n },\n $data\n )\n );\n }",
"private function buildIds(){\n\n\t\t$string = 'data-id=\"'.$this->fullId.'\" ';\n\t\t$string .= 'data-column_id=\"'.$this->id.'\" ';\n\t\t$string .= 'data-section_id=\"'.$this->section_id.'\" ';\n\t\t$string .= 'data-post_id=\"'.$this->post_id.'\" ';\n\n\t\treturn $string;\n\t}",
"protected function buildValues(): string\n {\n $sql = '';\n\n // Only add values when something is on the stack and there isn't a\n // SELECT statement waiting to go in there instead.\n if ( $this->fieldValueSet->isEmpty() )\n {\n return $sql;\n }\n\n $markers = $this->fieldValueSet->getValueMarkers();\n\n if ( count($markers) == 0 )\n {\n return $sql;\n }\n\n $sql .= 'VALUES' . PHP_EOL;\n $sql .= $this->indent() . '(';\n $sql .= implode(', ', $markers);\n $sql .= ')' . PHP_EOL;\n\n return $sql;\n }",
"function toSQL($mixed,$addslashes = false,$quotes = true){\n\tif (is_null($mixed)){\n\t\treturn 'NULL';\n\t}\n\tif (!is_array($mixed)){\n\t\treturn tosql_string($mixed,$addslashes,$quotes);\n\t}\n\t$string = '';\n\tforeach($mixed as $value){\n\t\tif ($string != ''){\n\t\t\t$string .= ',';\n\t\t}\n\t\t$string .= tosql_string($value,$addslashes,$quotes);\n\t}\n\treturn $string;\n}",
"public function AgregarIngredientes()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"codproducto\"]) or empty($_POST[\"codingrediente\"]) or empty($_POST[\"cantidad\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\n\t$ingrediente = $_POST['codingrediente'];\n\t$repeated = array_filter(array_count_values($ingrediente), function($count) {\n\t\treturn $count > 1;\n\t});\n\tforeach ($repeated as $key => $value) {\n\t\techo \"2\";\n\t\texit;\n\t}\n\n############## AQUI VALIDO SI LOS NUEVOS INGREDIENTES YA EXISTEN EN LA BASE DE DATOS ############\nfor($i=0;$i<count($_POST['codingrediente']);$i++){ //recorro el array\n\tif (!empty($_POST['codingrediente'][$i])) {\n\n\t\t$sql = \" select * from productosvsingredientes where codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codproducto\"], $_POST[\"codingrediente\"][$i]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 0)\n\t\t{\n\t\t\techo \"3\";\n\t\t\texit;\n\t\t}\n\t}\n}\n\n###################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ###########################\nfor($i=0;$i<count($_POST['codingrediente']);$i++){ //recorro el array\n\tif (!empty($_POST['codingrediente'][$i])) {\n\n\t\t$query = \" insert into productosvsingredientes values (null, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproducto);\n\t\t$stmt->bindParam(2, $codingrediente);\n\t\t$stmt->bindParam(3, $cantidad);\n\n\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t$codingrediente = strip_tags($_POST['codingrediente'][$i]);\n\t\t$cantidad = strip_tags($_POST['cantidad'][$i]);\n\t\t$stmt->execute();\n\t}\n}\n##################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ####################\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\necho \"<span class='fa fa-check-square-o'></span> LOS INGREDIENTES FUERON AGREGADOS AL PRODUCTO EXITOSAMENTE\";\necho \"</div>\";\t\t\nexit;\n}",
"private function transforme($value){\n if(is_array($value))\n {\n foreach ($value as $x)\n {\n if(is_integer($x))\n {\n $foo[] = $x;\n }\n else if(is_string($x))\n {\n $foo[]=\"'$x'\";\n }\n }\n $result = '('.implode(',',$foo).')';\n }\n //caso seja uma string\n else if(is_string($value))\n {\n $result = \"'$value'\";\n }\n // caso seja uma valor nulo\n else if(is_null($value))\n {\n $result = 'NULL';\n }\n //caso seja boleano\n else if(is_bool($value))\n {\n $result = $value ? 'TRUE' : 'FALSE';\n }\n else\n {\n $result = $value;\n }\n\n return $result;\n }",
"function values($data) {\n\n $VALUES = array();\n\n foreach ($data as $key => $value) {\n $value = $data[$key];\n $VALUES[] = \"'\" . str_replace(\"'\", \"\\'\", $value) . \"'\";\n }\n\n return implode(', ', $VALUES);\n}",
"function db_quote_many($array) {\n $to_return = array();\n foreach($array as $value) {\n $to_return[] = db_quote($value);\n }\n return $to_return;\n}",
"function addDaysToQuery($array, $db) {\n\t\t$query = \"\";\n\t\tforeach($array as $value) {\n\t\t\t$value = $db->quote($value);\n\t\t\t$query .= \", $value\";\n\t\t}\n\t\treturn $query;\n\t}",
"public function RegistrarIngredientes()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"nomingrediente\"]) or empty($_POST[\"cantingrediente\"]) or empty($_POST[\"unidadingrediente\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select nomingrediente from ingredientes where nomingrediente = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"nomingrediente\"]) );\n\t$num = $stmt->rowCount();\n\tif($num > 0)\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\n\t$sql = \" select codingrediente from ingredientes order by codingrediente desc limit 1\";\n\tforeach ($this->dbh->query($sql) as $row){\n\n\t$nro=$row[\"codingrediente\"];\n\n\t}\n\tif(empty($nro))\n\t{\n\t\techo $codingrediente = '00001';\n\n\t} else\n\t{\n\t\t$resto = substr($nro, 0, -0);\n\t\t$coun = strlen($resto);\n\t\t$num = substr($nro , $coun);\n\t\t$dig = $num + 1;\n\t\t$codigo = str_pad($dig, 5, \"0\", STR_PAD_LEFT);\n\t\techo $codingrediente = $codigo;\n\t}\n\n\t$sql = \" select codingrediente from ingredientes where codingrediente = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codingrediente\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$query = \" insert into ingredientes values (null, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codingrediente);\n\t\t\t$stmt->bindParam(2, $nomingrediente);\n\t\t\t$stmt->bindParam(3, $cantingrediente);\n\t\t\t$stmt->bindParam(4, $costoingrediente);\n\t\t\t$stmt->bindParam(5, $unidadingrediente);\n\t\t\t$stmt->bindParam(6, $codproveedor);\n\t\t\t$stmt->bindParam(7, $stockminimoingrediente);\n\n\t\t\t//$codingrediente = strip_tags($_POST[\"codingrediente\"]);\n\t\t\t$nomingrediente = strip_tags($_POST[\"nomingrediente\"]);\n\t\t\t$cantingrediente = strip_tags($_POST[\"cantingrediente\"]);\n\t\t\t$costoingrediente = strip_tags($_POST[\"costoingrediente\"]);\n\t\t\t$unidadingrediente = strip_tags($_POST[\"unidadingrediente\"]);\n\t\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t\t$stockminimoingrediente = strip_tags($_POST[\"stockminimoingrediente\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codproceso);\n\t\t\t$stmt->bindParam(2, $codresponsable);\n\t\t\t$stmt->bindParam(3, $codigoproducto);\n\t\t\t$stmt->bindParam(4, $codingrediente);\n\t\t\t$stmt->bindParam(5, $movimiento);\n\t\t\t$stmt->bindParam(6, $entradas);\n\t\t\t$stmt->bindParam(7, $salidas);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciounit);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codproceso = strip_tags(GenerateRandomString());\n\t\t\t$codresponsable = strip_tags(\"0\");\n\t\t\t$codigoproducto = strip_tags('0');\n\t\t\t$codingrediente = strip_tags($_POST['codingrediente']);\n\t\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t\t$entradas = strip_tags($_POST['cantingrediente']);\n\t\t\t$salidas = strip_tags(\"0\");\n\t\t\t$stockactual = strip_tags($_POST['cantingrediente']);\n\t\t\t$preciounit = strip_tags($_POST['costoingrediente']);\n\t\t\t$costototal = strip_tags($_POST['costoingrediente'] * $_POST['cantingrediente']);\n\t\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t\t$stmt->execute();\n\n\t\t\techo \"<div class='alert alert-success'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\t\t\techo \"<span class='fa fa-check-square-o'></span> EL INGREDIENTE FUE REGISTRADO EXITOSAMENTE\";\n\t\t\techo \"</div>\";\t\t\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"3\";\n\t\t\texit;\n\t\t}\n\t}\n}"
] | [
"0.61420566",
"0.557417",
"0.5513314",
"0.5507276",
"0.55015767",
"0.54453224",
"0.5405676",
"0.53422636",
"0.5321844",
"0.5292877",
"0.52655715",
"0.5256081",
"0.5246699",
"0.5239184",
"0.52147526",
"0.5180942",
"0.515816",
"0.5110368",
"0.51079303",
"0.50987566",
"0.5090281",
"0.5074688",
"0.50456375",
"0.5045439",
"0.50286984",
"0.5026552",
"0.501638",
"0.5013484",
"0.5003364",
"0.49900565"
] | 0.7288106 | 0 |
HELPER FUNCTION Convert directions array to sql value template. Each element follows format: '(rid, x, :valuex)' where x increments from 1 to number of directions To use in sql query: implode(", ", convertDirectionsFormat($rid, $data['directions'])) | private function convertDirectionsFormat($rid, $directions) {
$result = [];
for($i = 1; $i < count($directions) + 1; $i++) {
$result[$i - 1] = '(' . $rid . ', ' . $i . ', :value' . $i . ')';
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convert_array($in_array, $start_pos)\n{\n\t$string1 = \"\";\n\t$string2 = \"\";\n\t$total = count($in_array);\n\twhile ($start_pos < $total)\n\t{\n\t\t$string1 = $string1 . \"`\" . $in_array[$start_pos] . \"`\";\n\t\t$start_pos++;\n\t\t$string2 = $string2 . \"\\\"\" . $in_array[$start_pos] . \"\\\"\";\n\t\t$start_pos++;\n\t\tif ($start_pos < $total)\n\t\t{\n\t\t\t$string1 = $string1 . \", \";\n\t\t\t$string2 = $string2 . \", \";\n\t\t}\n\t}\n\tif ($start_pos == 2)\n\t{\t$return_string = \"(clanid, \" . $string1 . \") values (0, \" . $string2 . \")\";\t}\n\telse\n\t{\t$return_string = \"(\" . $string1 . \") values (\" . $string2 . \")\";\t}\n\treturn $return_string;\n}",
"function simplifyDirections($directionsArr) {\n\n\t$directionsCount = array_count_values($directionsArr);\n\t$newDirections = [];\n\n\tif (!isset($directionsCount['North'])) $directionsCount['North'] = 0;\n\tif (!isset($directionsCount['South'])) $directionsCount['South'] = 0;\n\tif (!isset($directionsCount['East'])) $directionsCount['East'] = 0;\n\tif (!isset($directionsCount['West'])) $directionsCount['West'] = 0;\n\n\twhile (abs($directionsCount['North'] - $directionsCount['South']) > 0) {\n\n\t\tif ($directionsCount['North'] > $directionsCount['South']) {\n\n\t\t\t$newDirections[] = 'North';\n\t\t\t$directionsCount['North']--;\n\n\t\t} elseif ($directionsCount['North'] < $directionsCount['South']) {\n\n\t\t\t$newDirections[] = 'South';\n\t\t\t$directionsCount['South']--;\n\n\t\t}\n\t}\n\n\twhile (abs($directionsCount['East'] - $directionsCount['West']) > 0) {\n\n\t\tif ($directionsCount['East'] > $directionsCount['West']) {\n\n\t\t\t$newDirections[] = 'East';\n\t\t\t$directionsCount['East']--;\n\n\t\t} elseif ($directionsCount['East'] < $directionsCount['West']) {\n\n\t\t\t$newDirections[] = 'West';\n\t\t\t$directionsCount['West']--;\n\n\t\t}\n\t}\n\n\treturn implode(', ', $newDirections);\n\n}",
"function sqlingData(array $data)\n{\n\n $keys = \"(\" . implode(\",\", array_keys($data)) . \")\";\n $values = \"('\" . implode(\"','\", array_values($data)) . \"')\";\n\n return $keys . 'Values' . $values;\n}",
"private function prepareValuesRow(): string\n {\n $values = [];\n foreach ($this->storage as $key => $value) {\n $values[] = \"('{$key}', '{$value}')\";\n }\n\n return implode(', ', $values);\n }",
"function array_to_sqladd($arr) {\n\t$s = '';\n\tforeach($arr as $k=>$v) {\n\t\t$v = addslashes($v);\n\t\t$op = substr($k, -1);\n\t\tif($op == '+' || $op == '-') {\n\t\t\t$k = substr($k, 0, -1);\n\t\t\t$s .= \"`$k`=`$k`$op'$v',\";\n\t\t} else {\n\t\t\t$s .= \"`$k`='$v',\";\n\t\t}\n\t}\n\treturn substr($s, 0, -1);\n}",
"function addDaysToQuery($array, $db) {\n\t\t$query = \"\";\n\t\tforeach($array as $value) {\n\t\t\t$value = $db->quote($value);\n\t\t\t$query .= \", $value\";\n\t\t}\n\t\treturn $query;\n\t}",
"public function toInterpolatedSql() {\n $query = $this->toSql();\n $params = $this->values;\n\n $keys = array();\n $values = $params;\n\n # build a regular expression for each parameter\n foreach ($params as $key => $value) {\n if (is_string($key)) {\n $keys[] = '/:'.$key.'/';\n } else {\n $keys[] = '/[?]/';\n }\n\n if (is_string($value))\n $values[$key] = \"'\" . self::quoteValue($value) . \"'\";\n\n if (is_array($value))\n $values[$key] = \"'\" . implode(\"','\", self::quoteValue($value)) . \"'\";\n\n if (is_null($value))\n $values[$key] = 'NULL';\n }\n\n $query = preg_replace($keys, $values, $query, 1, $count);\n\n return $query;\n }",
"function db_array_to_update_sqladd( $arr ) {\n\t$s = '';\n\tif ( DB_TYPE == 'access' ) $arr = toutf( $arr );\n\tif ( is_array( $arr ) ) {\n\t\tforeach ( $arr as $k => $v ) {\n\t\t\t$v = ( $v );\n\t\t\t$op = substr( $k, -1 );\n\t\t\tif ( $op == '+' || $op == '-' ) {\n\t\t\t\t$k = substr( $k, 0, -1 );\n\t\t\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t\t\t$s .= \"`$k`=$k$op$v,\";\n\t\t\t} else {\n\t\t\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t\t\t$s .= \"`$k`=$v,\";\n\t\t\t}\n\t\t}\n\t\treturn substr( $s, 0, -1 );\n\t} else {\n\t\treturn $arr;\n\t}\n}",
"private function transform($value) {\n $CI = & get_instance();\n // caso seja um array\n if (is_array($value)) {\n // percorre os valores\n foreach ($value as $x) {\n // se for um inteiro\n if (is_integer($x)) {\n $foo[] = $x;\n } else if (is_string($x)) {\n // se for string, adiciona aspas\n $foo[] = $CI->db->escape($x);\n }\n }\n // converte o array em string separada por \",\"\n $result = '(' . implode(',', $foo) . ')';\n }\n // caso seja uma string\n else if (is_string($value)) {\n // adiciona aspas\n $result = $CI->db->escape($value);\n }\n // caso seja valor nullo\n else if (is_null($value)) {\n // armazena NULL\n $result = 'NULL';\n }\n\n // caso seja booleano\n else if (is_bool($value)) {\n // armazena TRUE ou FALSE\n $result = $value ? 'TRUE' : 'FALSE';\n } else {\n $result = $CI->db->escape($value);\n }\n // retorna o valor\n return $result;\n }",
"function d2d_implode($array) {\n if (!is_array($array)) {\n return FALSE;\n }\n $escaped_array = array();\n foreach ($array as $key => $value) {\n // escape separators and escape-character in $key\n $key = d2d_replace(array('\\\\', ',', '='), array('\\\\\\\\', '\\\\,', '\\\\='), $key);\n if ($key === FALSE) { // replacement failed\n return FALSE;\n }\n // encode $value\n $value = d2d_value_encode($value);\n // escape separators and escape-character in $value\n $value = d2d_replace(array('\\\\', ',', '='), array('\\\\\\\\', '\\\\,', '\\\\='), $value);\n if ($value === FALSE) { // replacement failed\n return FALSE;\n }\n $escaped_array[] = \"{$key}={$value}\";\n }\n return implode(',', $escaped_array);\n}",
"protected function buildValuesForInsert()\n {\n return ' ('\n . $this->indentCsv(array_keys($this->col_values))\n . PHP_EOL . ') VALUES ('\n . $this->indentCsv(array_values($this->col_values))\n . PHP_EOL . ')';\n }",
"function toSQL($mixed,$addslashes = false,$quotes = true){\n\tif (is_null($mixed)){\n\t\treturn 'NULL';\n\t}\n\tif (!is_array($mixed)){\n\t\treturn tosql_string($mixed,$addslashes,$quotes);\n\t}\n\t$string = '';\n\tforeach($mixed as $value){\n\t\tif ($string != ''){\n\t\t\t$string .= ',';\n\t\t}\n\t\t$string .= tosql_string($value,$addslashes,$quotes);\n\t}\n\treturn $string;\n}",
"public function columnsWithValues()\n {\n // $sqlQuery = str_replace(\"&\", ', ',$query);\n $keys = array_keys($this->attributes);\n $values = array_values($this->attributes);\n $sql = null;\n for ($i = 0; $i < sizeof($this->attributes); $i++) {\n $sql .= $keys[$i]. '=';\n if (is_string($values[$i])) {\n $sql .= '\"'.$values[$i].'\"';\n } else { \n $sql .= $values[$i];\n }\n if ($i != sizeof($values) - 1) {\n $sql .= ', ';\n }\n } \n return $sql;\n }",
"function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)\n //VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');\n\n $col_str= array_map(function($obj){\n //\n //Return the full description of the columns\n return \"`$obj->name`\"; \n }, $this->values);\n //\n //\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return $value;\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n $values= implode(\",\",$values_str);\n $cols= implode(\",\",$col_str);\n return \"($cols) VALUES ($values)\";\n }",
"private function convertIngredientsFormat($rid, $ingredients) {\n $result = [];\n for($i = 1; $i < count($ingredients) + 1; $i++) {\n $result[$i - 1] = '(' . $rid . ', ' . $i . ', :value' . $i . ')';\n }\n return $result;\n }",
"function bindQuery($dades,$orders)\n{\n\n\t$qstring='';\n\t$orders=params2array($orders,array(',',':'));\n\t$last_item = count($orders);\n\t$counter=0;\n\tforeach ($orders as $camp=>$func)\n\t{\n\t\t$counter++;\n\t\t$noq=false;\n\t\tif ($func===true)\t//cap funció a fer, agafa-ho de l'array\n\t\t{\n\t\t\t$dada_final=$dades[$camp];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch ($func)\n\t\t\t{\n\t\t\t\tcase 'real':\t//convertir cadena a nombre real\n\t\t\t\t\t$dada_final=redigit($dades[$camp]);\n\t\t\t\t\t$dada_final=(float)$dada_final;\n\t\t\t\t\t$noq=true;\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'dataasql':\t//convertir data php a mysql\n\t\t\t\t\t$dada_final=dataasql($dades[$camp]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sha1':\t//codificar\n\t\t\t\t\t$dada_final=$dades[camp]!=''?sha1($dades[camp]):'';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ornull':\t//si es buit convertir a null\n\t\t\t\t\t$dada_final=$dades[$camp];\n\t\t\t\t\tif ($dada_final=='')\n\t\t\t\t\t{\n\t\t\t\t\t\t$dada_final='NULL';\n\t\t\t\t\t\t$noq=true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ($func[0]=='=')\t//expresió mysql\n\t\t\t\t\t{\n\t\t\t\t\t\t$dada_final=substr($func,1);\n\t\t\t\t\t\t$noq=true;\n\t\t\t\t\t}\n\t\t\t\t\telse {$dada_final=$func;}\t// asignar valor directe\n\t\t\t\n\t\t\t}\n\t\t}\n\t\tif (!$noq) {$dada_final=\"'\".MQ($dada_final).\"'\";}\n\t\t$qstring.=\"$camp = $dada_final\".($counter!=$last_item?\", \":\" \");\n\t}\n\treturn $qstring;\n}",
"protected static function param_to_db($param_id, $queryvars)\n {\n switch ($param_id)\n {\n case 2:\n $corners = array();\n for ($i = 1; $i <= 4; $i++)\n {\n $idx = \"box_corner_$i\";\n $lat = \"{$idx}_lat\";\n $lon = \"{$idx}_lon\";\n $corners[] = \"{$queryvars[$lat]},{$queryvars[$lon]}\";\n }\n return implode($corners, \";\");\n\n default:\n return $queryvars[$param_id];\n \n }\n }",
"function arrayToSQLString ($arr) {\r\n $sql = \"\";\r\n foreach ($arr as $key => $value) {\r\n $sql = $sql . $value . ',';\r\n }\r\n $sql = rtrim($sql,',');\r\n return $sql;\r\n}",
"private function convertColumnsPdo(\n array $array_keys,\n String $pattern = '',\n Bool $double = false\n ): String {\n $columns = array();\n foreach($array_keys as $key)\n {\n $pdoColumn = $double ? \"$key\" . \"$pattern\" . \"$key\" : \"$pattern\" . \"$key\";\n array_push($columns, $pdoColumn);\n }\n\n return implode(\", \", $columns);\n }",
"public function values($data, $format)\n {\n $result = '';\n $replace = (strpos($format, '%value%') !== false) || (strpos($format, '%column%') !== false); \n if (is_array($data)) {\n foreach ($data as $key => $value) {\n $value = is_null($value) ? 'NULL' : (is_int($value) ? $value : '\"' . $this->escapeSQL($value) . '\"');\n $key = $this->escapeDbIdentifier($key);\n if ($format == 'fields') {\n $result .= \", $key\";\n } else{\n if ($format == 'pairs') {\n $result .= \", $key = $value\";\n } elseif ($replace) {\n $result .= \", \" . strtr($format, ['%value%' => $value, '%column%' => $key]);\n } else {\n $result .= \",\\t$value\";\n }\n }\n }\n }\n return substr($result, 2 /* length of the initial \", \" */);\n }",
"function arrayIntoString_sql(array $arr)\n {\n $str = \"\";\n foreach ($arr as $k => $v) {\n $str .= (count($arr) - 1 != $k)\n ? \"'\". $v . \"', \"\n : \"'\". $v . \"'\";\n }\n return $str;\n }",
"private function setFields()\n\t{\t\n\t\t$sql = '';\n\t\t\n\t\tforeach (array_keys($this->data) as $key)\n\t\t{\n\t\t\t$sql .= '`' . $key . '` = ? , ';\n\t\t}\n\t\t\n\t\t$sql = rtrim($sql, ', ');\n\t\t\n\t\treturn $sql;\n\t}",
"private function formatArrayValues(array $data): string\n {\n return implode(\n ', ',\n array_map(\n function ($value) {\n return '\"'.$value.'\"';\n },\n $data\n )\n );\n }",
"protected function buildValues(): string\n {\n $sql = '';\n\n // Only add values when something is on the stack and there isn't a\n // SELECT statement waiting to go in there instead.\n if ( $this->fieldValueSet->isEmpty() )\n {\n return $sql;\n }\n\n $markers = $this->fieldValueSet->getValueMarkers();\n\n if ( count($markers) == 0 )\n {\n return $sql;\n }\n\n $sql .= 'VALUES' . PHP_EOL;\n $sql .= $this->indent() . '(';\n $sql .= implode(', ', $markers);\n $sql .= ')' . PHP_EOL;\n\n return $sql;\n }",
"private function transforme($value){\n if(is_array($value))\n {\n foreach ($value as $x)\n {\n if(is_integer($x))\n {\n $foo[] = $x;\n }\n else if(is_string($x))\n {\n $foo[]=\"'$x'\";\n }\n }\n $result = '('.implode(',',$foo).')';\n }\n //caso seja uma string\n else if(is_string($value))\n {\n $result = \"'$value'\";\n }\n // caso seja uma valor nulo\n else if(is_null($value))\n {\n $result = 'NULL';\n }\n //caso seja boleano\n else if(is_bool($value))\n {\n $result = $value ? 'TRUE' : 'FALSE';\n }\n else\n {\n $result = $value;\n }\n\n return $result;\n }",
"function prepareVariableString($value) {\n\t\t if (!is_array($value)) {\n\t\t return '\"'.addslashes($value).'\"';\n\t\t } else {\n\t\t $str = 'array('.chr(10);\n\t\t foreach ($value as $key => $item) {\n\t\t $str .= '\"'. addslashes($key).'\" => '.'\"'.addslashes($item).'\",'.chr(10);\n\t\t } \n\t\t $str .= \")\";\n\t\t } \n\t\t return $str;\n\t\t}",
"public function getDirectionString() : string\n {\n $str = \"Gateways: \";\n if ($this->gateways->isEmpty()) {\n $str .= \"none\";\n }\n else {\n $str .= implode(\", \", $this->getGateways()->toArray());\n }\n\n return $str;\n }",
"final public function generateFormattedSQL()\n {\n $parts = $this->generateOrderedSQLParts();\n return array_reduce($parts, function ($memo, $part) {\n $type = current(array_keys($part));\n $value = current($part);\n $sep = $this->getSeparatorForPartType($type);\n if (!$memo) {\n return $value;\n }\n return \"{$memo}{$sep}{$value}\";\n }, null);\n }",
"private function setFields(): string\n {\n $sql = '';\n\n foreach (array_keys($this->data) as $key) {\n $sql .= '`' . $key . '` = ? , ';\n }\n return rtrim($sql, ', ');\n }",
"function toSqlList($lista) {\n $sql = \"\";\n foreach( explode(\",\",$lista) as $opc) {\n $sql .= ($sql!=\"\" ? \",\" : \"\").\"'\".trim($opc).\"'\";\n }\n return $sql;\n }"
] | [
"0.57742035",
"0.5723555",
"0.54118776",
"0.53859895",
"0.53433186",
"0.52005756",
"0.5181006",
"0.51499707",
"0.51309294",
"0.5080498",
"0.5064301",
"0.50194925",
"0.5017345",
"0.49897757",
"0.49502593",
"0.4927679",
"0.49001387",
"0.48884308",
"0.48809934",
"0.48740852",
"0.48464736",
"0.48456427",
"0.48378402",
"0.48273855",
"0.4825536",
"0.4801892",
"0.4798741",
"0.4798639",
"0.47559795",
"0.47511598"
] | 0.6723766 | 0 |
Returns recipes title and description containing keywords specified by query string | public function searchRecipes($query) {
$query = '%'.$query.'%';
$this->db->query('SELECT * FROM recipes WHERE ( title LIKE ? OR description LIKE ? )');
$this->db->bind(1, $query);
$this->db->bind(2, $query);
return $this->db->resultSet();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function searchRecipesTitle($query) {\n $query = '%'.$query.'%';\n $this->db->query('SELECT * FROM recipes WHERE ( title LIKE ? )');\n $this->db->bind(1, $query);\n return $this->db->resultSet();\n }",
"public function index() {\n $count = Configure::read('number_of_search_results');\n\n //Get the query param q from the server\n $keyword = $_GET['q'];\n\n //Search for the recipes using the keyword\n $recipes = $this->Yummly->recipes($keyword, $count);\n\n $this->set(array(\n 'title_for_layout' => 'ChefMemo - Recipes of ' . $keyword,\n 'keyword' => $keyword,\n 'recipes' => $recipes\n ));\n\n }",
"function searchRecipe($text=false){\n\t\t$filter=false;\n\t\tif($text!=false){\n\t\t\t$filter=\"Name like '%$text%'\";\n\t\t}\n\t\t\n\t\treturn $this->getRecipe($filter);\n\t}",
"abstract function getKeywords();",
"public function getRecipeList($title)\n {\n $client = new client();\n $response = $client->request('GET', 'https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/search?number=10&offset=0&query='. $title, ['headers' => [\n 'X-RapidAPI-Key' => 'fce84bdd65msh9340789ab474c49p170d1ajsn3b7244498eac']]);\n\n if($response->getStatusCode() == 200){\n $contents = json_decode($response->getBody()->getContents());\n $recipeArrayID=[];\n $recipes = $contents->results;\n if(sizeof($recipes) > 0){\n $rec = [\"recipe\" => $recipes[0], \"baseURL\" => $contents->baseUri];\n // $rec = new class{};\n // $rec->recipe = $recipes[0]; \n // $rec->baseURL= $contents->baseUri;\n\n return $rec;\n }else{\n return null;\n }\n }else{ \n return null;\n }\n }",
"public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}",
"public function getRecipeByName($searchTerm)\n {\n \n $db = getAdapter(); \n $statement = $db->createStatement(\"SELECT * FROM Recipe WHERE recipeName LIKE '%\".$searchTerm.\"%'\");\n $result = $statement->execute();\n $rowset = new ResultSet;\n $rowset->initialize($result); \n return $rowset; \n }",
"public function getKeywords();",
"protected static function GET_search(array $params) {\n\t\tif($search = trim(array_shift($params))) {\n\t\t\tif($db = self::RequireLatestDatabase())\n\t\t\t\tif($select = $db->prepare('select id, name, lastServed, complexity from recipe where name like concat(\\'%\\',?,\\'%\\') order by not name like concat(?,\\'%\\'), name'))\n\t\t\t\t\tif($select->bind_param('ss', $search, $search))\n\t\t\t\t\t\tif($select->execute()) {\n\t\t\t\t\t\t\t$recipe = new Row();\n\t\t\t\t\t\t\tif($select->bind_result($recipe->id, $recipe->name, $recipe->lastServed, $recipe->complexity)) {\n\t\t\t\t\t\t\t\t$recipes = [];\n\t\t\t\t\t\t\t\twhile($select->fetch())\n\t\t\t\t\t\t\t\t\t$recipes[] = $recipe->dupe();\n\t\t\t\t\t\t\t\tself::Success($recipes);\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\tself::DatabaseError('Error binding results from recipe search', $select);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tself::DatabaseError('Error searching recipes', $select);\n\t\t\t\t\telse\n\t\t\t\t\t\tself::DatabaseError('Error binding parameters to search recipes', $select);\n\t\t\t\telse\n\t\t\t\t\tself::DatabaseError('Error preparing to search recipes', $db);\n\t\t} else\n\t\t\tself::GET_list(); // no search parameters means we list everything\n\t}",
"function searchRecipes($search_term, $category='all')\r\n {\r\n //add wildcards to search\r\n $search_term = '%' . $search_term . '%';\r\n //search all categories\r\n if($category == 'all') {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE (title LIKE :search\r\n OR description LIKE :search\r\n OR ingredients LIKE :search\r\n OR instructions LIKE :search\r\n OR time LIKE :search)\r\n ORDER BY date_created DESC\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameter\r\n $statement->bindParam(':search', $search_term, PDO::PARAM_STR);\r\n }\r\n //search category supplied\r\n else {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE (category = :category)\r\n AND (title LIKE :search\r\n OR description LIKE :search\r\n OR ingredients LIKE :search\r\n OR instructions LIKE :search\r\n OR time LIKE :search)\r\n ORDER BY date_created DESC\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameters\r\n $statement->bindParam(':category', $category, PDO::PARAM_STR);\r\n $statement->bindParam(':search', $search_term, PDO::PARAM_STR);\r\n }\r\n\r\n //execute\r\n $statement->execute();\r\n\r\n //get result\r\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n return $result;\r\n }",
"function h_keywords($cat_id){\r\n\t\r\n\t\tconnect(); \r\n\t\t\t$cp_id = clean_input($cat_id);\r\n\t\t\t\r\n\t\t\r\n\t\t\t//\r\n\t\t\tif(!empty($_GET['cat_id'])){ \r\n\t\t\t\t$xyquery = \"SELECT cat_desc_long FROM categories WHERE cat_id = '$cp_id'\";\r\n\t\t\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t\t\tlist($cat_desc_long)= mysql_fetch_row($xyresult);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading2 = explode('<h2>',$heading);\r\n\t\t\t$heading2 = explode('</h2>', $heading2[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading2[0])) echo \",\".$heading2[0];\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading3 = explode('<h1>',$heading);\r\n\t\t\t$heading3 = explode('</h1>', $heading3[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading3[0])) echo \",\".$heading3[0];\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading4 = explode('<h3>',$heading);\r\n\t\t\t$heading4 = explode('</h3>', $heading4[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading4[0])) echo \",\".$heading4[0];\t\r\n\t\t\t\t\r\n\t\t}",
"public function getMetaKeywords();",
"public function getRecipeByNameAndDuration($searchTerm, $duration)\n {\n $db = getAdapter(); \n $statement = $db->createStatement(\"SELECT * FROM Recipe WHERE recipeName LIKE '%\".$searchTerm.\"%' AND duration <=\".$duration);\n $result = $statement->execute();\n $rowset = new ResultSet;\n $rowset->initialize($result);\n \n return $rowset; \n }",
"public function displayRecipe()\n {\n return $this->title . \"by\" . $this->source;\n }",
"public function search($searchTerm)\n {\n $results = array(\n 'snippet' => [],\n 'snippet_code' => [],\n 'page' => [],\n 'product' => [],\n 'actions' => [],\n 'word' => [],\n 'post' => []\n );\n\n $snippets = Yii::$app->user->identity->portal->hasMany(Snippet::className(), ['id' => 'snippet_id'])\n ->viaTable('snippet_portal', ['portal_id' => 'id'])\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'description', $searchTerm],\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippets as $snippet) {\n $results['snippet'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet->id\n ]),\n 'name' => $snippet->name,\n 'id' => $snippet->id,\n 'class' => 'suggest-snippet'\n ];\n }\n\n // SNIPPET CODES / ALTERNATIVES\n\n /** @var SnippetCode[] $snippet_codes */\n $snippet_codes = SnippetCode::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'code', $searchTerm]\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippet_codes as $snippet_code) {\n $results['snippet_code'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet_code['snippet_id'],\n '#' => 'code' . $snippet_code['id'],\n ]),\n 'name' => $snippet_code->getSnippet()->one()->name . ' -> ' . $snippet_code->name,\n 'id' => $snippet_code->id,\n 'class' => 'suggest-snippet-code'\n ];\n }\n\n // Slovnik\n $words = (new Query())->select(\"id, identifier\")->from(\"word\")->where(['like', 'identifier', $searchTerm])\n ->limit(10)->all();\n\n foreach ($words as $word) {\n $results['word'][] = [\n 'link' => Url::to([\n '/word/edit',\n 'id' => $word['id']\n ]),\n 'name' => $word['identifier'],\n 'id' => $word['id'],\n 'class' => 'suggest-word'\n ];\n }\n\n // PAGES\n\n $pages = Page::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($pages as $page) {\n $results['page'][] = [\n 'link' => Url::to(['/page/edit', 'id' => $page['id']]),\n 'id' => $page->id,\n 'name' => $page->breadcrumbs,\n 'class' => 'suggest-page'\n ];\n }\n\n // POSTS\n\n $posts = Post::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($posts as $post) {\n $results['post'][] = [\n 'link' => Url::to(['/post/edit', 'id' => $post['id']]),\n 'id' => $post->id,\n 'name' => $post->name,\n 'class' => 'suggest-post'\n ];\n }\n\n // PRODUCTS\n\n $products = Product::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ])\n ->andWhere([\n 'language_id' => Yii::$app->user->identity->portal->language_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($products as $product) {\n $results['product'][] = [\n 'link' => Url::to([\n '/product/edit',\n 'id' => $product['id']\n ]),\n 'name' => $product->breadcrumbs,\n 'id' => $product->id,\n 'class' => 'suggest-product'\n ];\n }\n\n $processActions = function ($searchTerm, $list, $prefix, $urlSuffix = '') {\n $actions = [];\n foreach ($list as $item) {\n $name = $prefix . $item[0];\n\n if ($searchTerm == '' || (mb_strlen($name) >= mb_strlen($searchTerm) && mb_substr(mb_strtolower($name), 0, mb_strlen($searchTerm)) == mb_strtolower($searchTerm))) {\n $actions[] = [\n 'link' => Url::to([\n '/' . $item[1] . '/' . $urlSuffix,\n ]),\n 'name' => $name,\n 'class' => 'suggest-action'\n ];\n }\n };\n return $actions;\n };\n\n $listActions = [['stránok', 'page'], ['ďakovačiek', 'thanks'], ['prekladov', 'word'], ['multimédii', 'multimedia'], ['snippetov', 'snippet'], ['produktov', 'product'], ['produktových premenných', 'product-var'], ['typov produktu', 'product-type'], ['tagov', 'tag'], ['šablón', 'template'], ['portálov', 'portal'], ['používateľov', 'user'], ['krajín', 'language']];\n $addActions = [['stránku', 'page'], ['ďakovačku', 'thanks'], ['preklad', 'word'], ['snippet', 'snippet'], ['produkt', 'product'], ['produktovú premennú', 'product-var'], ['typ produktu', 'product-type'], ['tag', 'tag'], ['šablónu', 'template'], ['portál', 'portal'], ['používateľa', 'user'], ['krajinu', 'language']];\n\n $results['actions'] += $processActions($searchTerm, $listActions, 'Zoznam ');\n $results['actions'] += $processActions($searchTerm, $addActions, 'Pridať ', 'edit');\n\n return $results;\n }",
"public function actionRecipesForPartialName()\n {\n $recipes = RecipeDao::findAll([\"name LIKE\" => \"%\" . SiteUtil::getUrlParameters()[2]. \"%\"] );\n echo json_encode($this->recipesToArray($recipes));\n }",
"protected function getKeywordsExample()\n {\n return '<p><b>' . __('Example') . '</b><p><p>[name][, {color} color][, {size} measurements||size][, {category}] <p>' . __('will be transformed into') . '<br>\n <p>CN Clogs Beach/Garden Clog, Blue color, 10 size, Shoes';\n }",
"public function getSeoKeywords();",
"function ccontent_search()\n\t{\n\t\t$post_data = linput_post();\n\t\t$table = llang_table('content');\n\t\t$cols = array('body', 'name');\n\t\t$keywords = $post_data['keywords'];\n\n\t\tif (strlen($keywords) >= 3)\n\t\t{\n\t\t\t$data['content'] = lcrud_search($table, $cols, $keywords, 'AND `published`=\\'1\\' ORDER BY `updated` DESC');\n\n\t\t\tfor ($i = 0; $i < count($data['content']); $i++)\n\t\t\t{\n\t\t\t\t$data['content'][$i]['title'] = $data['content'][$i]['name'];\n\t\t\t\t$data['content'][$i]['link'] = mcategories_read_path($data['content'][$i]['link'], false);\n\t\t\t}\n\n\t\t\tif (!count($data['content'])) hmessage_set(l('No results.'));\n\n\t\t\tlloader_load_view('search', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['content'] = array();\n\t\t\thmessage_set(l('Keyword must be at least 3 characters long'));\n\t\t\tlloader_load_view('search', $data);\n\t\t}\n\t}",
"public function searchTitle(Request $request)\n {\n $query = $request->request->get('search');\n $em = $this->getDoctrine()->getManager();\n $result = $em->getRepository('AppBundle:Recipe')->searchTitle($query);\n\n return $this->render('recipe/search.html.twig', [\n 'query' => $query,\n 'recipes' => $result,\n ]);\n }",
"public function searchByKeyword($query);",
"public function search($keywords) {\n\n\t\t$sql = \"SELECT * FROM {$this->table_name} WHERE title LIKE '%{$keywords}%' OR overview LIKE '%{$keywords}%'\";\n\n\t\t$stmt = $this->conn->query($sql);\n\t\treturn $stmt->fetchAll();\n\t}",
"public function index() {\n $output = $this->verifyProvidedInput(['keywords' => 'Keywords are required to perform a search']);\n\n if (empty($output)) {\n $preparedKeywords = htmlspecialchars($this->request->keywords);\n if (!empty($this->request->advancedSearch) && $this->request->advancedSearch) {\n $sortBy = (isset($this->request->sortBy) ? $this->request->sortBy : 'rawListPrice');\n $reverseSort = (isset($this->request->reverseSort) ? boolval($this->request->reverseSort) : false);\n $data = $this->getRETS->getListing()\n ->setSortBy($sortBy)\n ->setReverseSort($reverseSort)\n ->search($preparedKeywords, \n $this->request->extra, \n $this->request->maxPrice, \n $this->request->minPrice, \n $this->request->beds, \n $this->request->baths, \n $this->request->includeResidential, \n $this->request->includeLand, \n $this->request->includeCommercial);\n \n $this->addThumbnails($data);\n $output = $this->respondData($data);\n } else {\n $preparedKeywords = htmlspecialchars($this->request->keywords);\n $data = $this->getRETS->getListing()->searchByKeyword($preparedKeywords);\n $this->addThumbnails($data);\n $output = $this->respondData($data);\n }\n }\n\n return $output;\n }",
"function searchByKeyword($searchTerm) {\n $searchTerm=striptags(htmlspecialchars($searchTerm));\n $query=\"SELECT * FROM ads WHERE description LIKE '%{$searchTerm}%'\";\n }",
"function test_general_entries_search_on_post_title() {\n\t\t$search_string = \"Jamie's\";\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\t}",
"public function postSearch(Request $request){\n\n $results = array();\n\n //Validate search input\n $this->validate($request, ['input' => 'required|max:255']);\n\n //Define search terms, and add search filters to search terms\n $search_terms = $request->input('input');\n $search_terms_array = array_map('strtolower', explode(\" \", $search_terms));\n\n if( !(empty($request['prep_time'])) )\n $max_prep_time = $request->input('prep_time');\n else\n $max_prep_time = PHP_INT_MAX;\n\n if( !(empty($request['cook_time'])) )\n $max_cook_time = $request->input('cook_time');\n else\n $max_cook_time = PHP_INT_MAX;\n\n //Narrow down search to include only certain courses\n if( isset($request['course']) ){\n\n if( $request['course'] == 'entree' )\n $course_results = \\App\\Recipe::where('tags', 'LIKE', '%entree%')->get();\n\n if( $request['course'] == 'main' )\n $course_results = \\App\\Recipe::where('tags', 'LIKE', '%main%')->get();\n\n if( $request['course'] == 'dessert' )\n $course_results = \\App\\Recipe::where('tags', 'LIKE', '%dessert%')->get();\n }\n else{\n\n $course_results = \\App\\Recipe::all();\n }\n\n\n //Narrow down the search to include time constraints\n $timeconstraint_results = array();\n foreach( $course_results as $result ){\n\n if( ($result->prep_time <= $max_prep_time) && ($result->cook_time <= $max_cook_time) ){\n\n array_push($timeconstraint_results, $result);\n }\n }\n\n //Narrow down the search to only include search term matches\n $searchterm_results = array();\n foreach( $timeconstraint_results as $result ){\n\n //Get terms that potentially match search terms\n $title_terms = array_map('strtolower', array_map('trim', explode(\" \", $result->title)));\n $tag_terms = array_map('strtolower', array_map('trim', explode(\"#\", $result->tags)));\n $recipe_terms = array_merge($title_terms, $tag_terms);\n\n if( sizeof(array_intersect($search_terms_array, $recipe_terms)) > 0 ){\n\n array_push($results, $result);\n }\n }\n\n return view('Recipes.search')->with('results', $results);\n\n }",
"public function all(){\t\r\n\t\t//Get ALL recipes from the database, but limit the search according to the \r\n\t\t//GET parameters outlining upper and lowerl imits\r\n\t\t$recipes = Recipe::retrieve();\r\n\t\t//Set the recipes results to the template and display\r\n\t\t$this->template->recipes = $recipes;\r\n\t\t$this->template->display('all.html.php');\r\n\t}",
"function getsearch_get(){\n $keyword = $this->get('keyword');\n $result = $this->lecturers_model->getsearch_all($keyword);\n $this->response($result); \n\n }",
"function getTitle()\n\t{\n\t\t\n\t\t$query = new Bin_Query();\t\n\t\t$title=$_GET['word'];\n\t\tif($title!='')\n\t\t{\n\t\t\t$sql= \"SELECT title FROM products_table WHERE title like '\".$title.\"%'\"; \n\t\t\t$query->executeQuery($sql);\n\t\t\t$arr=$query->records;\n\t\t\treturn Display_DManageProducts::getTitle($query->records);\t\t\t\t\t\n\t\t}\t\n\n\t}",
"function search($query) {\n $query = Sanitize::escape($query);\n \t$fields = null;\n \t$titleResults = $this->find(\n\t\t\t'all',\n\t\t\tarray(\n\t\t\t\t'conditions' => \"{$this->name}.title LIKE '%$query%' and {$this->name}.draft=0\",\n\t\t\t\t'fields' => $fields\n\t\t\t)\n\t\t);\n \t$contentResults = array();\n \tif (empty($titleResults)) {\n \t\t$titleResults = array();\n\t\t\t$contentResults = $this->find(\n\t\t\t\t'all',\n\t\t\t\tarray(\n\t\t\t\t\t'conditions' => \"MATCH ({$this->name}.content) AGAINST ('$query')\",\n\t\t\t\t\t'fields' => $fields\n\t\t\t\t)\n\t\t\t);\n \t} else {\n \t\t$alredyFoundIds = join(', ', Set::extract($titleResults, '{n}.' . $this->name . '.id'));\n \t\t$notInQueryPart = '';\n \t\tif (!empty($alredyFoundIds)) {\n \t\t\t$notInQueryPart = \" AND {$this->name}.id NOT IN ($alredyFoundIds) AND {$this->name}.draft=0\";\n \t\t}\n \t\t$contentResults = $this->find(\n\t\t\t\t'all',\n\t\t\t\tarray(\n\t\t\t\t\t'conditions' => \"MATCH ({$this->name}.content) AGAINST ('$query')$notInQueryPart\",\n\t\t\t\t\t'fields' => $fields\n\t\t\t\t)\n\t\t\t);\n \t}\n \t\n \tif (!is_array(($contentResults))) {\n \t\t$contentResults = array();\n \t}\n \n \t$results = array_merge($titleResults, $contentResults);\n \treturn $results;\n }"
] | [
"0.6260258",
"0.6142933",
"0.59934634",
"0.5904319",
"0.5824127",
"0.5709628",
"0.570016",
"0.56579196",
"0.5611754",
"0.5606446",
"0.5584824",
"0.5473852",
"0.54737926",
"0.54268765",
"0.541755",
"0.53800887",
"0.53564155",
"0.5346712",
"0.53352284",
"0.5276532",
"0.5252896",
"0.5251571",
"0.5239298",
"0.5193318",
"0.5188285",
"0.5186121",
"0.5159754",
"0.51331055",
"0.51240975",
"0.511011"
] | 0.67255175 | 0 |
Returns recipes title only for keywords specified by query string | public function searchRecipesTitle($query) {
$query = '%'.$query.'%';
$this->db->query('SELECT * FROM recipes WHERE ( title LIKE ? )');
$this->db->bind(1, $query);
return $this->db->resultSet();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTitle()\n\t{\n\t\t\n\t\t$query = new Bin_Query();\t\n\t\t$title=$_GET['word'];\n\t\tif($title!='')\n\t\t{\n\t\t\t$sql= \"SELECT title FROM products_table WHERE title like '\".$title.\"%'\"; \n\t\t\t$query->executeQuery($sql);\n\t\t\t$arr=$query->records;\n\t\t\treturn Display_DManageProducts::getTitle($query->records);\t\t\t\t\t\n\t\t}\t\n\n\t}",
"abstract function getKeywords();",
"public function searchRecipes($query) {\n $query = '%'.$query.'%';\n $this->db->query('SELECT * FROM recipes WHERE ( title LIKE ? OR description LIKE ? )');\n $this->db->bind(1, $query);\n $this->db->bind(2, $query);\n return $this->db->resultSet();\n }",
"function searchRecipe($text=false){\n\t\t$filter=false;\n\t\tif($text!=false){\n\t\t\t$filter=\"Name like '%$text%'\";\n\t\t}\n\t\t\n\t\treturn $this->getRecipe($filter);\n\t}",
"public function searchTitle(Request $request)\n {\n $query = $request->request->get('search');\n $em = $this->getDoctrine()->getManager();\n $result = $em->getRepository('AppBundle:Recipe')->searchTitle($query);\n\n return $this->render('recipe/search.html.twig', [\n 'query' => $query,\n 'recipes' => $result,\n ]);\n }",
"function test_general_entries_search_on_post_title() {\n\t\t$search_string = \"Jamie's\";\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\t}",
"function searchByTitle($title){\n $name = $title['search'];\n return db()->QUERY(\"SELECT * FROM posts WHERE title LIKE '%$name%' ORDER BY title\");\n }",
"function uvasomrfd_do_search_title() {\n\t$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );\n\tif(!is_page('27718')){\n\t//if (!strpos($_SERVER[\"REQUEST_URI\"], 'faculty-mentoring-undergraduates')) {\n\tif (is_tax( 'primary')||is_tax( 'training-grant')) {$preterm='Department of ';}\n\tif (is_tax( 'research-discipline')) {$preterm='Research Discipline: ';}\n\tif (is_tax( 'training-grant')) {$preterm='Training Program: ';}\n\t//if (strpos($_SERVER[\"REQUEST_URI\"], '?undergraduates')){$preterm='Faculty Accepting Undergraduates';$term->name='';}\n$title = sprintf( '<div class=\"clearfix\"></div><div id=\"uvasom_page_title\">'.genesis_do_breadcrumbs().'<h1 class=\"archive-title\">%s %s</h1>', apply_filters( 'genesis_search_title_text', __( $preterm, 'genesis' ) ), $term->name).'</div>';\n\techo apply_filters( 'genesis_search_title_output', $title ) . \"\\n\";\n\t}\n}",
"public function getKeywords();",
"public function searchByKeyword($query);",
"function test_field_specific_search_on_post_title() {\n\n\t\t// Single word. Two matching entries should be found.\n\t\t$search_string = \"Jamie's\";\n\t\t$field_key = 'yi6yvm';\n\t\t$items = self::generate_and_run_field_specific_query( 'create-a-post', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in post title field ' . $field_key;\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\n\t\t// Single word. No entries should be found.\n\t\t$search_string = 'TextThatShouldNotBeFound';\n\t\t$items = self::generate_and_run_field_specific_query( 'create-a-post', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in post title field ' . $field_key;\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}",
"public function Filter_title($title, $negate = false) {\r\n\t\t$title\t\t= trim($title);\r\n\t\t$queryParts\t= false;\r\n\r\n\t\tif( $title !== '' ) {\r\n\t\t\t$titleParts\t= explode(' ', $title);\r\n\r\n\t\t\t$where\t= TodoyuSql::buildLikeQueryPart($titleParts, array(self::TABLE . '.title'), $negate);\r\n\r\n\t\t\t$queryParts = array(\r\n\t\t\t\t'where'\t=> $where\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn $queryParts;\r\n\t}",
"static function get_keywords($post_id, $title = null){\n\t\t\t$keywords = get_post_meta($post_id, 'affiliate_keywords', true);\t\t\t\n\t\t\treturn empty($keywords) ? '' : $keywords;\n\t\t}",
"protected function getTitleQuery()\n {\n return $this->titleQuery;\n }",
"function genesis_do_search_title() {\n\n\t$title = sprintf( '<div class=\"archive-description\"><h1 class=\"archive-title\">%s %s</h1></div>', apply_filters( 'genesis_search_title_text', __( 'Search results for: ', 'genesis' ) ), get_search_query() );\n\n\techo apply_filters( 'genesis_search_title_output', $title ) . \"\\n\";\n\n}",
"function findKeyword() {\n \n }",
"function h_keywords($cat_id){\r\n\t\r\n\t\tconnect(); \r\n\t\t\t$cp_id = clean_input($cat_id);\r\n\t\t\t\r\n\t\t\r\n\t\t\t//\r\n\t\t\tif(!empty($_GET['cat_id'])){ \r\n\t\t\t\t$xyquery = \"SELECT cat_desc_long FROM categories WHERE cat_id = '$cp_id'\";\r\n\t\t\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t\t\tlist($cat_desc_long)= mysql_fetch_row($xyresult);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading2 = explode('<h2>',$heading);\r\n\t\t\t$heading2 = explode('</h2>', $heading2[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading2[0])) echo \",\".$heading2[0];\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading3 = explode('<h1>',$heading);\r\n\t\t\t$heading3 = explode('</h1>', $heading3[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading3[0])) echo \",\".$heading3[0];\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading4 = explode('<h3>',$heading);\r\n\t\t\t$heading4 = explode('</h3>', $heading4[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading4[0])) echo \",\".$heading4[0];\t\r\n\t\t\t\t\r\n\t\t}",
"function tck_add_random( $keyword, $url, $title ) {\n return tck_get_prefix(0) . $keyword;\n }",
"function find_all_product_info_by_title($title){\n global $db;\n $sql = \"SELECT * FROM products \";\n $sql .= \" WHERE name ='{$title}'\";\n $sql .=\" LIMIT 1\";\n return find_by_sql($sql);\n }",
"function get_title() {\n\t\tglobal $Thesaurus;\n\t\tif (isset($_GET['p'])) {\n\t\t\techo ucwords($_GET['p']);\n\t\t} else if (isset($_GET['cat'])) {\n\t\t\techo ucwords($Thesaurus[$_GET['cat']]['T']);\n\t\t} else {\n\t\t\techo 'Home';\n\t\t}\n\t}",
"function get_post_from_name($id){\n\t\t$hsl = $this->db->query(\"SELECT * FROM `jsts_post` WHERE `keywords` LIKE '%\".$id.\"%'\");\n\t\treturn $hsl;\n\t}",
"public function getMetaKeywords();",
"function edan_search_set_title( $title )\n {\n $options = new esw_options_handler();\n $cache = new esw_cache_handler();\n\n /**\n * if in the loop and the title is cached (or if object group is retrieved successfully)\n * modify the page title on display.\n */\n if(in_the_loop() && edan_search_name_from_url() == $options->get_path() && $options->get_title() != '')\n {\n if(get_query_var('edanUrl'))\n {\n $object = $cache->get()['object'];\n\n if($object)\n {\n if(property_exists($object, 'content') && property_exists($object->{'content'}, 'descriptiveNonRepeating'))\n {\n if(property_exists($object->{'content'}->{'descriptiveNonRepeating'}, 'title'))\n {\n $title = $object->{'content'}->{'descriptiveNonRepeating'}->{'title'}->{'content'};\n }\n }\n elseif(property_exists($object, 'title'))\n {\n if(property_exists($object->{'title'}, 'content'))\n {\n $title = $this->object->{'title'}->{'content'};\n }\n else\n {\n $title = $this->object->{'title'};\n }\n }\n }\n }\n else\n {\n $title = $options->get_title();\n }\n }\n\n return $title;\n }",
"public function getTitle($route = NULL) {\n if ($route === NULL) {\n $route = $this->routeMatch->getRouteName();\n }\n $facet = $this->request->get('facets_query');\n\n $title = $this->getTitleFromRoute($route);\n $search = $this->request->query->all();\n\n if ($route === 'search.view') {\n if (!empty($search)) {\n return t('@title results', ['@title' => $title]);\n }\n else {\n return $title;\n }\n }\n // Applying the term being viewed to Judiciary Sentencing guidelines page title.\n elseif ($route === 'view.judicial_decisions_search.sentence_guide_search_page') {\n $current_path = $this->currentPath->getPath();\n // Match the last number in the URL string with the type filter applied.\n if (preg_match_all('/.*\\/type\\/.*-(\\d+)/', $current_path, $matches)) {\n $tid = $matches[1][0];\n if (is_numeric($tid)) {\n $decision_type = Term::load($tid);\n $term_name = $decision_type->getName();\n $title = 'Sentencing guidelines - ' . $term_name;\n }\n }\n else {\n $title = 'Sentencing guidelines';\n }\n return $title;\n }\n else {\n if (!empty($facet) || !empty($search)) {\n return t('@title - search results', ['@title' => $title]);\n }\n else {\n return $title;\n }\n }\n }",
"public function search($keywords) {\n\n\t\t$sql = \"SELECT * FROM {$this->table_name} WHERE title LIKE '%{$keywords}%' OR overview LIKE '%{$keywords}%'\";\n\n\t\t$stmt = $this->conn->query($sql);\n\t\treturn $stmt->fetchAll();\n\t}",
"function searchByKeyword($searchTerm) {\n $searchTerm=striptags(htmlspecialchars($searchTerm));\n $query=\"SELECT * FROM ads WHERE description LIKE '%{$searchTerm}%'\";\n }",
"public function testFilterKeywords()\n {\n $this->visit('/properties')\n ->type('the', '#keywords')\n ->press('Update results')\n ->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n }",
"public function searchTitleActionGet()\n {\n $title = \"Search for a movie by title\";\n $searchTitle = $this->app->request->getGet(\"searchTitle\");\n\n $this->app->db->connect();\n\n if ($searchTitle) {\n $sql = \"SELECT * FROM movie WHERE title LIKE ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$searchTitle]);\n }\n\n $this->app->page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle,\n ]);\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }",
"public function getTitle()\n {\n return \\Yii::t('app', 'Recipe');\n }",
"function searchRecipes($search_term, $category='all')\r\n {\r\n //add wildcards to search\r\n $search_term = '%' . $search_term . '%';\r\n //search all categories\r\n if($category == 'all') {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE (title LIKE :search\r\n OR description LIKE :search\r\n OR ingredients LIKE :search\r\n OR instructions LIKE :search\r\n OR time LIKE :search)\r\n ORDER BY date_created DESC\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameter\r\n $statement->bindParam(':search', $search_term, PDO::PARAM_STR);\r\n }\r\n //search category supplied\r\n else {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE (category = :category)\r\n AND (title LIKE :search\r\n OR description LIKE :search\r\n OR ingredients LIKE :search\r\n OR instructions LIKE :search\r\n OR time LIKE :search)\r\n ORDER BY date_created DESC\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameters\r\n $statement->bindParam(':category', $category, PDO::PARAM_STR);\r\n $statement->bindParam(':search', $search_term, PDO::PARAM_STR);\r\n }\r\n\r\n //execute\r\n $statement->execute();\r\n\r\n //get result\r\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n return $result;\r\n }"
] | [
"0.6314272",
"0.59863436",
"0.59801906",
"0.5965524",
"0.5944365",
"0.5808339",
"0.57880396",
"0.56803334",
"0.5669686",
"0.5658574",
"0.56492674",
"0.5633799",
"0.5610529",
"0.55742544",
"0.5523392",
"0.5523169",
"0.551889",
"0.5511958",
"0.5508049",
"0.54987174",
"0.54906666",
"0.548462",
"0.54648834",
"0.54533505",
"0.54527164",
"0.5444307",
"0.5441657",
"0.5432166",
"0.54131556",
"0.5401904"
] | 0.67693764 | 0 |
Returns average of all comment ratings associated to rid | public function getAverageRating($rid){
$comments = $this->getAllComments($rid);
$sum = 0;
if(sizeof($comments)!=0){
foreach($comments as $comment){
$sum += $comment->rating;
}
return $sum/sizeof($comments);
} else {
return $sum;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAvgRating()\n {\n $sum =0;\n foreach($this->comments as $comment)\n {\n $sum = $sum + $comment->getRating() ;\n }\n\n if(count($this->comments)) return $sum/count($this->comments);\n\n return 0 ;\n }",
"public function averageRating()\n {\n $total = 0;\n $average = null;\n\n foreach ($this->notes as $n) {\n $total += $n->note;\n }\n\n $nbNotes = $this->notes->count();\n if ($total > 0 && $nbNotes > 0) {\n $average = $total / $nbNotes;\n }\n\n return $average;\n }",
"public function getAvgRating(){\n if($this->ratings){\n return $this->ratings->avg('rating');\n }\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 getAverageAndNumberRatings (): array\n {\n /**\n * Hier verwenden wir $this->_buffer, damit der nachfolgende MySQL Query nicht jedes mal aufgerufen werden muss,\n * sondern wir das Ergebnis zwischenspeichern.\n */\n if (empty($this->_buffer)) {\n\n /**\n * Datenbankverbindung herstellen.\n */\n $database = new Database();\n\n /**\n * Query abschicken.\n *\n * Hier verwenden wir die AVG()-Funktion von MySQL um einen Durchschnitt aller ratings zu berechnen. Diese\n * Berechnung könnten wir in PHP auch machen, dazu müssten wir aber alle Einträge aus der Datenbank laden\n * und manuell drüber iterieren. In MySQL brauchen wir nur einen einzigen Query und kriegen alles, was wir\n * brauchen.\n */\n $result = $database->query(\"SELECT AVG(rating) as average, COUNT(*) as count FROM comments WHERE post_id = ? AND rating IS NOT NULL\", [\n 'i:post_id' => $this->id\n ]);\n\n /**\n * Daten aus dem Result holen und Datentypen konvertieren.\n */\n $numberOfRatings = (int)$result[0]['count'];\n $average = (float)$result[0]['average'];\n\n /**\n * Cache anlegen.\n */\n $this->_buffer = [\n 'average' => $average,\n 'numberOfRatings' => $numberOfRatings\n ];\n\n }\n\n /**\n * Werte zurückgeben.\n */\n return $this->_buffer;\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 rating()\n {\n $rating = Review::where('product_id', $this->id)->avg('rating');\n if ($rating) {\n $rating = (float)$rating;\n $rating = round($rating, 2);\n } else {\n $rating = 0;\n }\n return $rating;\n }",
"public function getCustomRatingAttribute(){\n return $this->reviews->avg('rating');\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 averageRating() : float\n {\n return $this->ratings()->exists() ? $this->ratings()->avg('rating') : 0;\n }",
"public function calculateStarRating($ratings)\n {\n // $array = [$ratings->quality, $ratings->price, $ratings->value];\n //Calculate the average.\n return round(array_sum($ratings) / count($ratings), 2);\n }",
"public function computeAvgRating()\n {\n return Doctrine_Query::create()\n ->select('AVG(value) as avg_val')\n ->from('Rate')\n ->where('record_model = ? AND record_id = ?', array(\n $this->getModel(),\n $this->getItemId(),\n ))\n ->fetchOne()\n ->avg_val;\n }",
"public function fetchAvgRating()\n {\n return number_format($this->ratings()->avg('rating'), 1);\n }",
"public function getAverageReviews()\n {\n /* code goes here */\n }",
"function get_average_rating($product_id)\r\n\t{\r\n\t\t$product_id_as_int = (int)$product_id;\r\n\t\t\r\n\t\treturn ceil($this->_db->get_first_cell('SELECT AVG(rating) FROM product_review WHERE product_id = ' . $product_id_as_int));\r\n\t}",
"public function getRestaurantRating($id){\n $query=$this->db->query(\"SELECT COUNT(review_id) AS num_review,ROUND(AVG(rating),0) AS rating FROM reviews WHERE restaurant_id=\".$id);\n if($query->num_rows){\n $restaurant['num_review']=$query->rows[0]['num_review'];\n if($restaurant['num_review']!=0)\n $restaurant['rating']=$query->rows[0]['rating'];\n else\n $restaurant['rating']=0;\n }\n else{\n $restaurant['num_review']=0;\n $restaurant['rating']=0;\n }\n\n return $restaurant;\n }",
"public function getAverageRating($connection,$userID){\n $userID = $this->e($connection,$userID);\n \n $ratings = [];\n //get sold and giverName\n $query_sold = \"SELECT feedback.rating FROM feedback \";\n $query_sold .=\" LEFT JOIN ( \";\n $query_sold .=\" SELECT b1.auctionID,b1.highestBid as currentBid,b2.buyerID as winnerID \";\n $query_sold .=\" FROM ( \";\n $query_sold .=\" SELECT bid.auctionID,MAX(bid.bidValue) AS highestBid \";\n $query_sold .=\" FROM bid \";\n $query_sold .=\" GROUP BY bid.auctionID \";\n $query_sold .=\" ) AS b1 \";\n $query_sold .=\" LEFT JOIN ( \";\n $query_sold .=\" SELECT bid.auctionID, bid.bidValue, bid.buyerID \";\n $query_sold .=\" FROM bid \";\n $query_sold .=\" ) AS b2 \";\n $query_sold .=\" ON b2.auctionID = b1.auctionID AND b2.bidValue = b1.highestBid \";\n $query_sold .=\" ) AS winner ON winner.auctionID = feedback.auctionID \";\n $query_sold .= \"INNER JOIN user ON user.id = winner.winnerID \";\n $query_sold .= \"INNER JOIN auction ON auction.id = feedback.auctionID \";\n $query_sold .= \"WHERE auction.sellerID = {$userID} \";\n $query_sold .= \"AND feedback.giverID = winner.winnerID\";\n\n $result = mysqli_query($connection,$query_sold);\n if ($result){\n while ($row = mysqli_fetch_assoc($result)){\n $ratings[] = $row[\"rating\"];\n }\n }else {\n die( \"Database query failed (get feedbacks 1). \" . mysqli_error( $connection ) );\n }\n\n\n\n //get bought \n $query_bought =\" SELECT feedback.rating FROM feedback \";\n $query_bought .= \"INNER JOIN user ON user.id = feedback.giverID \";\n $query_bought .=\" LEFT JOIN ( \";\n $query_bought .=\" SELECT b1.auctionID,b1.highestBid as currentBid,b2.buyerID as winnerID \";\n $query_bought .=\" FROM ( \";\n $query_bought .=\" SELECT bid.auctionID,MAX(bid.bidValue) AS highestBid \";\n $query_bought .=\" FROM bid \";\n $query_bought .=\" GROUP BY bid.auctionID \";\n $query_bought .=\" ) AS b1 \";\n $query_bought .=\" LEFT JOIN ( \";\n $query_bought .=\" SELECT bid.auctionID, bid.bidValue, bid.buyerID \";\n $query_bought .=\" FROM bid \";\n $query_bought .=\" ) AS b2 \";\n $query_bought .=\" ON b2.auctionID = b1.auctionID AND b2.bidValue = b1.highestBid \";\n $query_bought .=\" ) AS winner \";\n $query_bought .=\" ON winner.auctionID = feedback.auctionID WHERE winner.winnerID={$userID} \";\n $query_bought .=\" AND feedback.giverID <> {$userID}\";\n\n\n $result2 = mysqli_query($connection,$query_bought);\n if ($result2){\n while ($row2 = mysqli_fetch_assoc($result2)){\n $ratings[] = $row2[\"rating\"];\n }\n }else {\n die( \"Database query failed (get feedbacks 2). \" . mysqli_error( $connection ));\n }\n\n $avg = 0;\n if (count($ratings)>0){\n $avg = array_sum($ratings) / count($ratings); \n }\n\n return $avg;\n \n }",
"protected function getCriterionsAverageScore(\\SimpleXMLElement $rating)\n {\n $criterions = array('criterion1', 'criterion2', 'criterion3', 'criterion4', 'criterion5', 'criterion6');\n $sum = 0;\n $divider = 0;\n foreach ($criterions as $criterion) {\n $criterionValue = (float) $rating->$criterion;\n if ($criterionValue > 0) {\n ++$divider;\n $sum += $criterionValue;\n }\n }\n $divider = (0 == $divider) ? count($criterions) : $divider;\n\n return $sum / $divider;\n }",
"public function average(){\n $i = 0;\n $total = 0;\n for($i = 0; $i < count($this->collection); $i++){\n $total += $this->collection[$i]->amount;\n }\n if($i == 0)\n return 3;\n return (int)round($total/$i);\n }",
"public function getCompanyAverageRatings($ratings){\n\n\t\t$total=count($ratings);\n\t\t$culture=$management=$work_live_balance=$career_development=0;\n\n\t\tforeach($ratings as $rating){\n\t\t\t$culture += $rating['culture'];\n\t\t $management += $rating['management'];\n\t\t\t$work_live_balance += $rating['work_live_balance'];\n\t\t\t$career_development += $rating['career_development'];\t\n\t\t}\t\n\t\t\n\t\t$avgCulture = $culture/$total;\n\t\t$avgManagement = $management/$total;\n\t\t$avgWork_live = $work_live_balance/$total;\n\t\t$avgCareer_dev = $career_development/$total;\n\n\t\treturn array('culture'=>$avgCulture, 'management'=>$avgManagement, 'work_live_balance'=>$avgWork_live, 'career_development'=>$avgCareer_dev);\n\t}",
"public function averageUserRatings($params = array()) {\n\n $averageUserRatings = $this->select()\n ->from($this->info('name'), array('AVG(rating) AS avg_rating'))\n ->where(\"event_id = ?\", $params['event_id'])\n ->where(\"user_id = ?\", $params['user_id'])\n ->query()\n ->fetchColumn();\n return $averageUserRatings;\n }",
"public function getAggregateRating()\n {\n $collection = Mage::getModel('rating/rating_option_vote')\n ->getResourceCollection()\n ->setEntityPkFilter($this->getProduct()->getId())\n ->setStoreFilter(Mage::app()->getStore()->getId());\n return $this->getAverageRatingByCollection($collection);\n }",
"function getAvgAuthor($a_id)\n{\n $sql = \"SELECT ROUND(AVG(CAST(CAST (review_author.rating AS char)AS INT)),2) FROM review_author WHERE a_id = $a_id\";\n $result = pg_query($sql);\n $avgscore = pg_fetch_row($result);\n if ($avgscore[0]!=0) echo \" <label class=\\\"label label-warning\\\"><span class=\\\"glyphicon glyphicon-star\\\"></span> \".$avgscore[0].\"</label>\"; \n}",
"public function avgViews()\n {\n $query = \"SELECT AVG(views) FROM blog_post \n WHERE deleted = 0\";\n\n $stmt = static::$dbh->query($query);\n\n $views = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $views;\n }",
"public function getAverageShopRating($userId)\n {\n $verifiedUserIds = UserEntity::find()->select('id')->where(['status' => UserEntity::STATUS_VERIFIED]);\n $reviews = ShopFeedbackEntity::find()->where(['shop_id' => $userId, 'created_by' => $verifiedUserIds])->all();\n\n $count = 0;\n if ($reviews) {\n $sumProductRating = 0; $sumReliabilityRating = 0;\n $sumOperatorRating = 0; $sumMarkerRating = 0; $sumAverageRating = 0;\n\n /** @var $item ShopFeedbackEntity.php */\n foreach ($reviews as $item) {\n $count++;\n $sumProductRating += $item->product_rating;\n $sumReliabilityRating += $item->reliability_rating;\n $sumOperatorRating += $item->operator_rating;\n $sumMarkerRating += $item->marker_rating;\n $sumAverageRating += $item->average_rating;\n }\n\n return [\n 'average_product_rating' => round($sumProductRating / $count, 1),\n 'average_reliability_rating' => round($sumReliabilityRating / $count, 1),\n 'average_operator_rating' => round($sumOperatorRating / $count, 1),\n 'average_marker_rating' => round($sumMarkerRating / $count, 1),\n 'average_rating' => round($sumAverageRating / $count, 1)\n ];\n }\n return false;\n }",
"public function getAvgRating($idUser, $idPost){\n $result = $this->getRating($idUser, $idPost);\n if($result != null){\n $return = ($result[\"originality\"] + $result[\"topic\"] + $result[\"language_level\"])/3;\n return number_format($return, 2);\n }\n return null;\n }",
"public function calculateAverageRating($data)\n {\n return ($data['product_rating'] + $data['operator_rating']\n + $data['marker_rating'] + $data['reliability_rating']) / 4;\n }",
"function ratings($id_us){\n\t\n\t$val = listAll(\"reviews\", \"WHERE r_user_id = '$id_us' GROUP BY r_pro_id\");\n\t$rows_val = mysql_num_rows($val);\n\t\n\tif($rows_val > 0){\n\t\n $user = getUserInfo($id_us);\n\n //usuario creativo/fotografo\n if($user['user_type'] == User::USER_TYPE_PHOTOGRAPHER){\n $rev = listAll(\"reviews\", \"WHERE r_user_id = '$id_us' AND r_type!='CO' AND r_type != 'F'\");\n $rev_rows = mysql_num_rows($rev);\n $calification = 0;\n $trato = 0;\n $calidad = 0;\n $prof = 0;\n $resp = 0;\n $punt = 0;\n $t=0;\n $p=0;\n $r=0;\n $pr=0;\n $ca =0;\n while ($rs_rev = mysql_fetch_object($rev)){\n $calification = $calification + $rs_rev->r_value;\n if($rs_rev->r_type == \"CA\"){\n $calidad = $calidad + $rs_rev->r_value;\n $ca++;\n }else if($rs_rev->r_type == \"T\"){\n $trato = $trato + $rs_rev->r_value;\n $t++;\n }else if($rs_rev->r_type == \"P\"){\n $punt = $punt + $rs_rev->r_value;\n $p++;\n }else if($rs_rev->r_type == \"R\"){\n $resp = $resp + $rs_rev->r_value;\n $r++;\n }else if($rs_rev->r_type == \"PR\"){\n $prof = $prof + $rs_rev->r_value;\n $pr++;\n }\n\n }\n //totales\n $global = $calification/$rev_rows;\n $trato_fin = $trato/$t;\n $calidad_fin = $calidad/$ca;\n $punt_fin = $punt/$p;\n $resp_fin = $resp/$r;\n $prof_fin = $prof/$pr;\n\n //global\n if($global < 2){\n $review['stars'] = '<img src=\"images/rating_1.jpg\" title=\"Calificacion '.number_format($global,1,'.',',').'\" alt=\"Calificacion '.number_format($global,1,'.',',').'\"/>';\n $review['starsP']=1;\n }else if(round($global) == 2){\n $review['stars'] = '<img src=\"images/rating_2.jpg\" title=\"Calificacion '.number_format($global,1,'.',',').'\" alt=\"Calificacion '.number_format($global,1,'.',',').'\"/>';\n $review['starsP']=2;\n }else if(round($global) == 3){\n $review['stars'] = '<img src=\"images/rating_3.jpg\" title=\"Calificacion '.number_format($global,1,'.',',').'\" alt=\"Calificacion '.number_format($global,1,'.',',').'\"/>';\n $review['starsP']=3;\n }else if(round($global) == 4){\n $review['stars'] = '<img src=\"images/rating_4.jpg\" title=\"Calificacion '.number_format($global,1,'.',',').'\" alt=\"Calificacion '.number_format($global,1,'.',',').'\"/>';\n $review['starsP']=4;\n }else if(round($global) == 5){\n $review['stars'] = '<img src=\"images/rating_5.jpg\" title=\"Calificacion '.number_format($global,1,'.',',').'\" alt=\"Calificacion '.number_format($global,1,'.',',').'\"/>';\n $review['starsP']=5;\n }\n\n //trato\n if($trato_fin < 2){\n $review['trato_star'] = '<img src=\"images/rating_1.jpg\" title=\"Calificacion '.number_format($trato_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($trato_fin,1,'.',',').'\"/>';\n }else if(round($trato_fin) == 2){\n $review['trato_star'] = '<img src=\"images/rating_2.jpg\" title=\"Calificacion '.number_format($trato_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($trato_fin,1,'.',',').'\"/>';\n }else if(round($trato_fin) == 3){\n $review['trato_star'] = '<img src=\"images/rating_3.jpg\" title=\"Calificacion '.number_format($trato_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($trato_fin,1,'.',',').'\"/>';\n }else if(round($trato_fin) == 4){\n $review['trato_star'] = '<img src=\"images/rating_4.jpg\" title=\"Calificacion '.number_format($trato_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($trato_fin,1,'.',',').'\"/>';\n }else if(round($trato_fin) == 5){\n $review['trato_star'] = '<img src=\"images/rating_5.jpg\" title=\"Calificacion '.number_format($trato_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($trato_fin,1,'.',',').'\"/>';\n }\n\n //calidad\n if($calidad_fin < 2){\n $review['cal_star'] = '<img src=\"images/rating_1.jpg\" title=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\"/>';\n }else if(round($calidad_fin) == 2){\n $review['cal_star'] = '<img src=\"images/rating_2.jpg\" title=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\"/>';\n }else if(round($calidad_fin) == 3){\n $review['cal_star'] = '<img src=\"images/rating_3.jpg\" title=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\"/>';\n }else if(round($calidad_fin) == 4){\n $review['cal_star'] = '<img src=\"images/rating_4.jpg\" title=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\"/>';\n }else if(round($calidad_fin) == 5){\n $review['cal_star'] = '<img src=\"images/rating_5.jpg\" title=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($calidad_fin,1,'.',',').'\"/>';\n }\n\n //puntualidad\n if($punt_fin < 2){\n $review['punt_star'] = '<img src=\"images/rating_1.jpg\" title=\"Calificacion '.number_format($punt_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($punt_fin,1,'.',',').'\"/>';\n }else if(round($punt_fin) == 2){\n $review['punt_star'] = '<img src=\"images/rating_2.jpg\" title=\"Calificacion '.number_format($punt_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($punt_fin,1,'.',',').'\"/>';\n }else if(round($punt_fin) == 3){\n $review['punt_star'] = '<img src=\"images/rating_3.jpg\" title=\"Calificacion '.number_format($punt_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($punt_fin,1,'.',',').'\"/>';\n }else if(round($punt_fin) == 4){\n $review['punt_star'] = '<img src=\"images/rating_4.jpg\" title=\"Calificacion '.number_format($punt_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($punt_fin,1,'.',',').'\"/>';\n }else if(round($punt_fin) == 5){\n $review['punt_star'] = '<img src=\"images/rating_5.jpg\" title=\"Calificacion '.number_format($punt_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($punt_fin,1,'.',',').'\"/>';\n }\n\n //responsabilidad\n\n if($resp_fin < 2){\n $review['resp_star'] = '<img src=\"images/rating_1.jpg\" title=\"Calificacion '.number_format($resp_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($resp_fin,1,'.',',').'\"/>';\n }else if(round($resp_fin) == 2){\n $review['resp_star'] = '<img src=\"images/rating_2.jpg\" title=\"Calificacion '.number_format($resp_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($resp_fin,1,'.',',').'\"/>';\n }else if(round($resp_fin) == 3){\n $review['resp_star'] = '<img src=\"images/rating_3.jpg\" title=\"Calificacion '.number_format($resp_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($resp_fin,1,'.',',').'\"/>';\n }else if(round($resp_fin) == 4){\n $review['resp_star'] = '<img src=\"images/rating_4.jpg\" title=\"Calificacion '.number_format($resp_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($resp_fin,1,'.',',').'\"/>';\n }else if(round($resp_fin) == 5){\n $review['resp_star'] = '<img src=\"images/rating_5.jpg\" title=\"Calificacion '.number_format($resp_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($resp_fin,1,'.',',').'\"/>';\n }\n //profesionalismo\n\n if($prof_fin < 2){\n $review['prof_star'] = '<img src=\"images/rating_1.jpg\" title=\"Calificacion '.number_format($prof_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($prof_fin,1,'.',',').'\"/>';\n }else if(round($prof_fin) == 2){\n $review['prof_star'] = '<img src=\"images/rating_2.jpg\" title=\"Calificacion '.number_format($prof_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($prof_fin,1,'.',',').'\"/>';\n }else if(round($prof_fin) == 3){\n $review['prof_star'] = '<img src=\"images/rating_3.jpg\" title=\"Calificacion '.number_format($prof_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($prof_fin,1,'.',',').'\"/>';\n }else if(round($prof_fin) == 4){\n $review['prof_star'] = '<img src=\"images/rating_4.jpg\" title=\"Calificacion '.number_format($prof_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($prof_fin,1,'.',',').'\"/>';\n }else if(round($prof_fin) == 5){\n $review['prof_star'] = '<img src=\"images/rating_5.jpg\" title=\"Calificacion '.number_format($prof_fin,1,'.',',').'\" alt=\"Calificacion '.number_format($prof_fin,1,'.',',').'\"/>';\n }\n\n\n $com = listAll(\"reviews\", \"WHERE r_user_id = '$id_us' AND r_type='CO' GROUP BY r_pro_id\");\n $com_rows = mysql_num_rows($com);\n $review['comentarios'] = $com_rows;\n $review['global'] = $global;\n $review['trato'] = $trato_fin ;\n $review['calidad'] = $calidad_fin;\n $review['punt'] = $punt_fin;\n $review['resp'] = $resp_fin;\n $review['prof'] = $prof_fin;\n\n\n //usuario cliente\n } else if($user['user_type'] == User::USER_TYPE_CLIENT){\n $rev = listAll(\"reviews\", \"WHERE r_user_id = '$id_us' AND r_type='C'\");\n $rev_rows = mysql_num_rows($rev);\n $calification = 0;\n while ($rs_rev = mysql_fetch_object($rev)){\n $calification = $calification + $rs_rev->r_value;\n }\n $cal_final = $calification/$rev_rows;\n\n if($cal_final < 2){\n $review['stars'] = '<img src=\"images/rating_1.jpg\" title=\"Calificacion '.number_format($cal_final,1,'.',',').' \" alt=\"Calificacion '.number_format($cal_final,1,'.',',').'\"/>';\n }else if(round($cal_final) == 2){\n $review['stars'] = '<img src=\"images/rating_2.jpg\" title=\"Calificacion '.number_format($cal_final,1,'.',',').'\" alt=\"Calificacion '.number_format($cal_final,1,'.',',').'\"/>';\n }else if(round($cal_final) == 3){\n $review['stars'] = '<img src=\"images/rating_3.jpg\" title=\"Calificacion '.number_format($cal_final,1,'.',',').'\" alt=\"Calificacion '.number_format($cal_final,1,'.',',').'\"/>';\n }else if(round($cal_final) == 4){\n $review['stars'] = '<img src=\"images/rating_4.jpg\" title=\"Calificacion '.number_format($cal_final,1,'.',',').'\" alt=\"Calificacion '.number_format($cal_final,1,'.',',').'\"/>';\n }else if(round($cal_final) == 5){\n $review['stars'] = '<img src=\"images/rating_5.jpg\" title=\"Calificacion '.number_format($cal_final,1,'.',',').'\" alt=\"Calificacion '.number_format($cal_final,1,'.',',').'\"/>';\n }\n $com = listAll(\"reviews\", \"WHERE r_user_id = '$id_us' AND r_type='CO' GROUP BY r_pro_id\");\n $com_rows = mysql_num_rows($com);\n $review['comentarios'] = $com_rows;\n $review['global'] = $cal_final;\n\n }\n\t// sino tiene ningun review\n\t} else {\n\t\t$review['stars'] = '<img src=\"images/rating_0.jpg\" title=\"Calificacion 0\" alt=\"Calificacion 0\"/>';\n\t\t$review['starsP']=0;\n\t\t$review['cal_star'] = '<img src=\"images/rating_0.jpg\" title=\"Calificacion 0\" alt=\"Calificacion 0\"/>';\n\t\t$review['resp_star'] = '<img src=\"images/rating_0.jpg\" title=\"Calificacion 0\" alt=\"Calificacion 0\"/>';\n\t\t$review['punt_star'] = '<img src=\"images/rating_0.jpg\" title=\"Calificacion 0\" alt=\"Calificacion 0\"/>';\n\t\t$review['trato_star'] = '<img src=\"images/rating_0.jpg\" title=\"Calificacion 0\" alt=\"Calificacion 0\"/>';\n\t\t$review['prof_star'] = '<img src=\"images/rating_0.jpg\" title=\"Calificacion 0\" alt=\"Calificacion 0\"/>';\n\t\t$review['comentarios'] = 0;\n\t\t$review['global'] = 0;\n\t\t$review['trato'] = 0;\n\t\t$review['calidad'] = 0;\n\t\t$review['punt'] = 0;\n\t\t$review['resp'] = 0;\n\t\t$review['prof'] = 0;\n\t}\n\t\n\treturn $review;\n\t\n}",
"public function getAvgNotePresse()\n {\n $result = DB::table('movies')\n ->select(DB::raw('ROUND(AVG(note_presse)) as avgpress'))\n ->first();\n\n return $result;\n }",
"function findRating($data)\n {\n $result = array();\n for ($i = 0; $i< count($data);$i++){\n\n $obj = $data[$i];\n $roomID = $data[$i][\"roomId\"];\n\n $obj[\"rating\"] = \"0\";\n\n //query and get the average rating for the user reviews for meeting room given by usres\n $query = $this->db->query(\"SELECT AVG(rating) as rating FROM room_reviews where roomID = $roomID\");\n if($query->num_rows()>0)\n {\n $obj[\"rating\"] = !$query->result_array()[0][\"rating\"]? \"0.0\" :$query->result_array()[0][\"rating\"];\n }\n else\n {\n $obj[\"rating\"] = \"0\";\n\n }\n\n array_push($result, $obj);\n }\n //return the result\n return $result;\n\n }"
] | [
"0.7815952",
"0.7160213",
"0.69731236",
"0.69356567",
"0.66185904",
"0.6595174",
"0.64630806",
"0.6456797",
"0.64519626",
"0.64074165",
"0.6389168",
"0.63694394",
"0.6358621",
"0.63110065",
"0.62753147",
"0.6258707",
"0.61612374",
"0.6128268",
"0.6099714",
"0.6086556",
"0.60219306",
"0.59764737",
"0.59654313",
"0.5885262",
"0.58838236",
"0.58838",
"0.58798826",
"0.58124083",
"0.5802436",
"0.57965094"
] | 0.84239227 | 0 |
Returns all comments on recipe given by recipe id, will also fetch username associated to ownerid | public function getAllComments($rid) {
$this->db->query('SELECT comments.*, users.user_username FROM comments JOIN users ON ownerid=user_id
WHERE recipe_id = :rid ORDER BY date DESC');
$this->db->bind(':rid', $rid);
return $this->db->resultSet();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getComments()\n {\n $id = $this->getId();\n\n $stmt = \" SELECT c.*, c.id as id, u.username, u.profile_picture FROM _xyz_article_comment_pivot acp \" .\n \" LEFT JOIN _xyz_comment c ON c.id = acp.comment_id \" .\n \" LEFT JOIN _xyz_user u ON u.id = c.user_id \" .\n \" WHERE acp.article_id = $id \"\n ;\n\n $sql = DB::instance()->query( $stmt );\n\n $rows = $sql->fetchAll(\\PDO::FETCH_UNIQUE|\\PDO::FETCH_ASSOC );\n\n $result = CommentCollection::toTree( $rows );\n\n return $result;\n }",
"public function getAllComments() {\r\n \r\n $commentEntries = array();\r\n\r\n $sql = \"SELECT *\r\n FROM RecipeComments\r\n WHERE page = '$this->page'\r\n ORDER BY timestamp\"; \r\n \r\n $result = $this->conn->query($sql);\r\n \r\n $rows = $result->num_rows;\r\n \r\n for($i=1; $i<=$rows; $i++) {\r\n $row = $result->fetch_assoc();\r\n array_push($commentEntries, $row[\"username\"]);\r\n array_push($commentEntries, $row[\"comment\"]);\r\n array_push($commentEntries, $row[\"timestamp\"]);\r\n \r\n }\r\n\r\n return $commentEntries;\r\n \r\n }",
"public function comments()\n\t{\n\t\t$this->_crud->set_table('ent_cr_comments');\n\t\t$this->_crud->set_subject('Comment');\n\t\t$this->_crud->set_relation('ent_cr_recipes_id','ent_cr_recepies','title');\n\t\t$this->_crud->display_as('ent_cr_recepies_id', 'Recipe');\n\t\t$this->_crud->required_fields('name', 'email', 'comments', 'ent_cr_recipes_id');\n\t\tstatic::$data['name'] = 'crud';\n\t\tstatic::$data['content_replace'] = $this->_crud->render();\n\n\t\t$this->_crud_output('main', static::$data);\n\t}",
"public function ListComments($id) {\n try {\n \n\t //$res = $this->db->ExecuteSelectQueryAndFetchAll(\"SELECT Comment.*, User.acronym as owner FROM Comment INNER JOIN User ON Comment.idUser=User.id WHERE idContent=? AND Comment.deleted IS NULL;\", array($id));\n\t $res = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('select * by content'), array($id));\n\t print_r($id);\n\t print_r($res);\n\t return $res;\n } catch(Exception $e) {\n\t\techo $e;\n\t\treturn null;\n }\n }",
"function getPostingComment($id = 0) {\n return getAll(\"SELECT r.content FROM posting_reply pr \n INNER JOIN posting p on pr.posting_id = p.id \n INNER JOIN reply r on pr.reply_id = r.id WHERE p.id = $id\");\n}",
"private function GetComments($_id)\n\t{\n\t\t//Get Database\n\t\t$_database = $this->ConnectDatabase();\n\t\t//Create Data\n\t\t$_data = array($_id);\n\t\t//Call and return Database Function\n\t\treturn $this->CallDatabase(\n\t\t\t$_database,\n\t\t\t$_data,\n\t\t\tfunction($_pdo, $_parameters)\n\t\t\t{\n\t\t\t\t//Create Query\n\t\t\t\t$_query = $_pdo->prepare(\"SELECT \n\t\t\t\t\t\tcm.id id, \n\t\t\t\t\t\tcm.description description, \n\t\t\t\t\t\tcm.ratting rate, \n\t\t\t\t\t\tcm.created date, \n\t\t\t\t\t\tcm.type `type`,\n\t\t\t\t\t\tus.nick_name user_nick, \n\t\t\t\t\t\tus.url_profile user_url_perfil\n\t\t\t\t\tFROM Comments cm\n\t\t\t\t\tLEFT JOIN Users us ON us.id = cm.id_user\n\t\t\t\t\tWHERE cm.id_partner = ?\n\t\t\t\t\");\n\t\t\t\t//Execute Query\n\t\t\t\t$_query->execute($_parameters);\n\n\t\t\t\t$_data = null;\n\t\t\t\twhile ($_row = $_query->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$_row['user_url_perfil'] = strlen($_row['user_url_perfil']) > 1 ? \n\t\t\t\t\t\t$this->image_client_path . $_row['user_url_perfil'] : \n\t\t\t\t\t\tnull;\n\t\t\t\t\t$_row['date'] = $this->ConvertDataClient($_row['date']);\n\t\t\t\t\t$_data = $_row;\n\t\t\t\t}\n\t\t\t\treturn $_data;\n\t\t\t}\n\t\t);\n\t}",
"public function getAllCommentsByBattleID($battle_id) {\n $stmt = $this->db->query(\"SELECT *\n FROM comments\n INNER JOIN users\n ON comments.userid = users.userid\n WHERE battle_id = :id\");\n\n $stmt->bindParam(':id', $battle_id);\n $stmt->execute();\n $rows = array();\n while($row = $stmt->fetch()) {\n $rows[] = $row;\n }\n return $rows;\n\n }",
"public function readComment(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }",
"public function getComments() {\n\t\treturn $this->api->getCommentsByPhotoId($this->getId());\n\t}",
"public function getCommentaire($id){\n $bdd = $this->bdConnect();\n $req = $bdd->prepare('SELECT `id`, `content`, `id_jeu`, `notepost`, `pseudo`, `totalContent`,(SELECT `title` FROM `jeux` WHERE `id`=`id_jeu`)AS titreJeu,(SELECT `categorie` FROM `jeux` WHERE `id`=`id_jeu`)AS categorieJeu FROM `commentaires` WHERE `id`=?');\n $req->execute(array($id));\n return $req;\n }",
"public function getAllComments() {\n\n\t\t$sql = \"SELECT comment_id, comment_text, entries.post_title, users.user_name FROM comments\n\t\t\t\tINNER JOIN entries ON comments.post_id = entries.post_id \n\t\t\t\tINNER JOIN users ON users.user_id = comments.comment_author\";\n\t\t//create stdStatemment object | call to Model method from core/Database.php\n\t\treturn $this->setStatement($sql);\n\t}",
"function get_all_comments() {\n global $db;\n $query = \"SELECT c.comment_id, c.comment, c.user_id, c.created, u.userName FROM comments c\n JOIN users u on u.user_id = c.user_id\n ORDER BY created DESC\";\n $statement = $db->prepare($query);\n $statement->execute();\n $comments = $statement->fetchAll();\n $statement->closeCursor();\n return $comments; \n }",
"public function comments()\n {\n $sort = Sorter::getCommentSortId();\n $orderField = $sort == 1 ? 'rate' : 'id';\n $orderDir = $sort == 1 ? 'desc' : 'asc';\n return $this->morphMany(Comment::class, 'commentable')->orderBy($orderField, $orderDir);\n }",
"public function selectComments() {\n $query=\"SELECT c.id_comentario, c.comentario, c.valoracion, cp.catalogo_producto, ec.estado_comentario, CONCAT(cl.nombres, ' ', cl.apellidos) as cliente, c.fecha_comentario\n FROM comentarios c\n INNER JOIN catalogo_productos cp\n ON cp.id_catalogo_producto = c.id_catalogo_producto\n INNER JOIN estados_comentario ec\n ON ec.id_estado_comentario = c.id_estado_comentario\n INNER JOIN clientes cl\n ON cl.id_cliente = c.id_cliente\";\n $params = null;\n return Database::getRow($query, $params);\n }",
"public function getComments() {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"SELECT * FROM comments_table where parent_id=0 ORDER BY create_date DESC;\";\n $result = mysql_query($sql, $db);\n $comments = [];\n while ($row = mysql_fetch_assoc($result)) {\n $comment = $row;\n $reply_1_sql = \"SELECT * FROM comments_table where parent_id=\" . $row['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_1 = mysql_query($reply_1_sql, $db);\n $replies = [];\n while ($row1 = mysql_fetch_assoc($result)) {\n $reply = $row1;\n $reply_2_sql = \"SELECT * FROM comments_table where parent_id=\" . $row1['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_2 = mysql_query($reply_2_sql, $db);\n $replies_to_replies = [];\n while ($row2 = mysql_fetch_assoc($result)) {\n $replies_to_replies[] = $row2;\n }\n $reply['replies'] = $replies_to_replies;\n $replies[] = $reply;\n }\n $comment['replies'] = $replies;\n $comments[] = $comment;\n }\n return $comments;\n }",
"function selectComments($id_rubric, $type_comment)\n\t{\n\t\tglobal $dbh;\n\n\n\t\t$sql = \"SELECT \tC.id_comment,\n\t\t\t\t\t\tC.type_comment,\n\t\t\t\t\t\tC.content,\n\t\t\t\t\t\tC.dateCreated,\n\t\t\t\t\t\tC.dateModified,\n\n\t\t\t\t\t\tU.id_user,\n\t\t\t\t\t\tU.user_pseudo,\n\t\t\t\t\t\tU.score\n\n\t\t\t\tFROM users AS U, comments AS C\t\t\t\t\n\t\t\t\tWHERE U.id_user = C.id_user\n\t\t\t\tAND C.id_rubric = :id_rubric\n\t\t\t\tAND C.type_comment = :type_comment\n\t\t\t\tORDER BY C.dateCreated DESC\n\t\t\t\tLIMIT 3\";\n\n\t\t$stmt = $dbh->prepare($sql);\n\t\t$stmt->bindValue(\":id_rubric\", $id_rubric);\n\t\t$stmt->bindValue(\":type_comment\", $type_comment);\n\t\t$stmt->execute();\n\t\t\n\t\t//affiche\n\t\treturn $stmt->fetchAll();\n\t}",
"public function getComments ()\n {\n $db = $this->dbConnect ();\n $req = $db->prepare ('SELECT id_comment,signalement,id_chapter,author,comment,DATE_FORMAT(dateComment, \\'%d/%m/%Y \\') AS dateComment FROM comments WHERE ? ORDER BY id_comment DESC ');\n $req->execute (array ( 1 ));\n return $req;\n }",
"public function recipes($id)\n\t{\n\t\tif (!isset($_SESSION['user']))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/session/new\");\n\t\t\texit;\n\t\t}\n\t\t// this page is only accessable by self and admin (type 2)\n\t\tif (($_SESSION['user']['type'] != 2) && ($_SESSION['user']['id'] != $id))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/{$_SESSION['user']['id']}\");\n\t\t\texit;\n\t\t}\n\t\n\t\tif(!$user = User::findUser(array('user_id' => $id)))\n\t\t{\n\t\t\t// something has gone wrong with db request\n\t\t\theader(\"Location: /myrecipe/users/\".$id);\n\t\t\texit;\n\t\t}\n\t\t$this->template->user = $user[0];\n\t\t\n\t\t// get all the recipes uploaded by the user\n\t\t$myrecipes = Recipe::findRecipe(array('recipes.user_id'=>$id, 'recipe_images.is_cover'=>'yes'));\n\t\t$this->template->myrecipes = $myrecipes;\n/*\t\techo \"<pre>\";\n\t\tprint_r($myrecipes);\n\t\techo \"</pre>\";\n*/\t\n\t\t$this->template->display('recipes.html.php');\n\t}",
"public function getComment(int $id)\n\t{\n\n\t\treturn $this->select('c.*', 'e.title AS `episode`','ch.name AS `chapter`', 'u.first_name', 'u.last_name', 'c.email')\n\t\t\t ->from('comments c')\n\t\t\t ->join('LEFT JOIN episodes e ON c.episode_id=e.id')\n\t\t\t ->join('LEFT JOIN chapters ch ON e.chapter_id=ch.id')\n\t\t\t ->join('LEFT JOIN users u ON c.user_id=u.id')\n\t\t\t ->where('c.id=?', $id)\n\t\t\t ->fetch();\n\t}",
"function getComment() {\n\tglobal $db;\n\t\n\t$query = \"SELECT idComment, content, photo, date, Comment.idUser, idEvent, parentComment, firstName AS userFirstName, lastName AS userLastName FROM Comment,User WHERE User.idUser = Comment.idUser\";\n\t\n\tif (isset($_GET['idComment']))\n\t\t$query .= \" AND idComment = \" . $_GET['idComment'];\n\tif (isset($_GET['idUser']))\n\t\t$query .= \" AND idUser = \" . $_GET['idUser'];\n\tif (isset($_GET['idEvent']))\n\t\t$query .= \" AND idEvent = \" . $_GET['idEvent'];\n\tif (isset($_GET['parentComment']))\n\t\t$query .= \" AND parentComment = \" . $_GET['parentComment'];\n\t\t\t\t\n\t$stmt = $db->prepare($query);\n\t$stmt->execute(); \n\t$comments = $stmt->fetchAll();\n\t\n\t\n\t\n\t/* Content-Type must be defined, otherwise the output is seen as plain text */\n\theader(\"Content-Type: application/json\");\n\techo json_encode($comments);\n}",
"function fetchArticleComments()\r\n\t{\r\n\t\t$comments = array();\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT * FROM \" . PREFIX . \"_modul_shop_artikel_kommentare WHERE Publik = '1' AND ArtId = '\" . (int)$_REQUEST['product_id'] . \"' ORDER BY Id DESC\");\r\n\t\twhile($row = $sql->fetchrow())\r\n\t\t{\r\n\t\t\t$sql_u = $GLOBALS['db']->Query(\"SELECT Vorname,Nachname FROM \" . PREFIX . \"_users WHERE Id = '$row->Benutzer'\");\r\n\t\t\t$row_u = $sql_u->fetchrow();\r\n\r\n\t\t\t$row->Titel = htmlspecialchars($row->Titel);\r\n\t\t\t$row->Kommentar = nl2br(htmlspecialchars($row->Kommentar));\r\n\t\t\t$row->Autor = substr($row_u->Vorname,0,1) . '. ' . $row_u->Nachname;\r\n\t\t\tarray_push($comments, $row);\r\n\t\t}\r\n\t\treturn $comments;\r\n\t}",
"public function getAlbumComments($albumId){\n return DB::select('SELECT comments.*, users.username\n FROM comments\n LEFT JOIN users ON comments.user_id = users.id\n WHERE album_id = ?', array($albumId));\n }",
"public static function findCommentsOn($id=0){\n\t\t//So custom find function() is needed\n\t\tglobal $connection;\n\t\t$sql = \"SELECT * FROM \".static::$table_name.\" WHERE post_id = \";\n\t\t$sql .= $connection->real_escape_string($id) . \" ORDER BY created ASC \";\n\t\t//echo $sql;\n\t\treturn static::findBySql($sql);\n\t}",
"public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }",
"public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }",
"public function getComments($id){\n $id = (int)$id;\n $sql = \"select * from comments WHERE discussion_id = '{$id}'\";\n return $this->db->query($sql);\n }",
"public function getComments($objectType, $objectId, $parent = null) {\n \t$query = $this->createQuery();\n \t$query->addCondition('{objectType} = %1% AND {objectId} = %2%', $objectType, $objectId);\n \t$query->addOrderBy('{dateAdded} ASC');\n\n \tif ($parent) {\n \t $query->addCondition('{parent} = %1%', $parent);\n \t} else {\n \t $query->addCondition('{parent} IS NULL');\n \t}\n\n \t$comments = $query->query();\n \tforeach ($comments as $comment) {\n \t\t$comment->replies = $this->getComments($objectType, $objectId, $comment->id);\n \t}\n\n \treturn $comments;\n }",
"public function get_reply_comments($id) {\n $this->db->query(\"SELECT * FROM replies, users WHERE comment_id = :id and replies.user_id = users.id\");\n $this->db->bind(':id', $id);\n $row = $this->db->resultSet();\n if ( $this->db->rowCount() > 0) {\n return $row;\n } else {\n return 'false';\n }\n }",
"public function getAllComments()\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users, id_post, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE moderate >0 ORDER BY moderate DESC');\n\t\t\n\t\t$comments=[];\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t\n\t\t\t\t $comments[]=new Comments($datas);\n\t\t\t\t //return $comments;\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $comments;\n\t}",
"public function readCommentCustomer(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=? and comentarios.estado = 1';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n\n }"
] | [
"0.61224645",
"0.6109855",
"0.60941076",
"0.60582006",
"0.5990077",
"0.5915567",
"0.5905671",
"0.5865427",
"0.58383465",
"0.58379555",
"0.5833757",
"0.58172387",
"0.5810213",
"0.57930654",
"0.57820207",
"0.578193",
"0.57788545",
"0.5764521",
"0.57105434",
"0.57089597",
"0.56992435",
"0.569821",
"0.56754",
"0.56714684",
"0.5663193",
"0.5657325",
"0.5641558",
"0.563157",
"0.56109107",
"0.56050235"
] | 0.6960151 | 0 |
Add a layout handle on "checkout_cart_index"page IF veritifaction doesn't exist for the customer AND verification is required THEN add the layout handle | public function addLayoutHandle(Varien_Event_Observer $observer)
{
/* @var $update Mage_Core_Model_Layout_Update */
$update = $observer->getEvent()->getLayout()->getUpdate();
$userIsVerified = Mage::getModel("postident/verification")->userIsVerified();
//New handle for all store parts
if (true === $this->getConfig()->isEnabled() && false === $userIsVerified) {
$update->addHandle('postident_verification_required');
}
//New handle for shoppinh_cart
if (true === $this->getConfig()->isEnabled() && "checkout-cart-index" == $this->getHelper()->getPageCode() && false === $userIsVerified) {
$update->addHandle('postident_checkout_cart_verification_required');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function layoutAction()\n {\n if (!$this->_isActive()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $this->loadLayout();\n $this->getResponse()->setBody(\n $this->getLayout()->getBlock('checkout.layout')->toHtml()\n );\n }",
"protected function _prepareLayout()\n {\n $section = $this->getAction()->getRequest()->getParam('section', false);\n if ($section == 'paynovapayment') {\n $this->getLayout()\n ->getBlock('head')\n ->addJs('mage/adminhtml/paynovapayment.js');\n }\n parent::_prepareLayout();\n }",
"public function _prepareLayout()\n {\n $this->setSubscription(Mage::getSingleton('customer/session')->getNewSubscription());\n\n // Call parent\n parent::_prepareLayout();\n }",
"protected function setupLayout()\n\t{\n\n $this->user = Auth::user();\n $this->theme = Theme::uses('default')->layout('default');\n $user = $this->user;\n $this->theme->bind('user', function() use($user)\n {\n return $user;\n });\n $cat = Category::all();\n $this->theme->bind('cat', function() use($cat)\n {\n return $cat;\n });\n if (Session::get('cart')){\n $cart_count = count(Session::get('cart'));\n $this->theme->bind('cart_count', function() use($cart_count)\n {\n return $cart_count;\n });\n }\n\t}",
"public function initProductLayout($product, $controller)\n {\n $design = Mage::getSingleton('catalog/design');\n $settings = $design->getDesignSettings($product);\n\n /*if ($settings->getCustomDesign()) {\n $design->applyCustomDesign($settings->getCustomDesign());\n }*/\n\n\n\n\n\n if(Mage::helper('zmags')->isMobile())\n {\n\n\n $_theme = \"zmags/mobile\";\n\n }else{\n $_theme = \"zmags/default\";\n }\n\n if ($_theme) {\n\n list($package, $theme) = explode('/', $_theme);\n Mage::getSingleton('core/design_package')\n ->setPackageName($package)\n ->setTheme($theme);\n\n\n }\n\n\n\n $update = $controller->getLayout()->getUpdate();\n\n\n $update->addHandle('default');\n\n\n $controller->addActionLayoutHandles();\n\n\n $update->addHandle('PRODUCT_TYPE_' . $product->getTypeId());\n $update->addHandle('PRODUCT_' . $product->getId());\n $controller->loadLayoutUpdates();\n\n $update->addUpdate($product->getCustomLayoutUpdate());\n\n\n //$update->merge(strtolower($controller->getFullActionName()).'_FINAL');\n\n /*// Apply custom layout update once layout is loaded\n $layoutUpdates = $settings->getLayoutUpdates();\n if ($layoutUpdates) {\n if (is_array($layoutUpdates)) {\n foreach($layoutUpdates as $layoutUpdate) {\n $update->addUpdate($layoutUpdate);\n }\n }\n }\n\n*/\n\n\n $controller->generateLayoutXml()->generateLayoutBlocks();\n\n // Apply custom layout (page) template once the blocks are generated\n /* if ($settings->getPageLayout()) {\n $controller->getLayout()->helper('page/layout')->applyTemplate($settings->getPageLayout());\n }\n\n $currentCategory = Mage::registry('current_category');\n $root = $controller->getLayout()->getBlock('root');\n if ($root) {\n $controllerClass = $controller->getFullActionName();\n if ($controllerClass != 'catalog-product-view') {\n $root->addBodyClass('catalog-product-view');\n }\n $root->addBodyClass('product-' . $product->getUrlKey());\n if ($currentCategory instanceof Mage_Catalog_Model_Category) {\n $root->addBodyClass('categorypath-' . $currentCategory->getUrlPath())\n ->addBodyClass('category-' . $currentCategory->getUrlKey());\n }\n }*/\n $head = $controller->getLayout()->getBlock('head');\n\n if( Mage::getStoreConfig( 'zmags/design/product_template' ) !=\"default\" )\n {\n $slug = Mage::getStoreConfig( 'zmags/configuration/slug' );\n $head->addCss('../../../../index.php/'.$slug.'/zmags.css');\n }\n\n\n return $this;\n }",
"protected function _prepareLayout()\n {\n $public_key = Mage::getStoreConfig(MercadoPago_Core_Helper_Data::XML_PATH_PUBLIC_KEY);\n\n //init js no header\n $block = Mage::app()->getLayout()->createBlock('core/text', 'js_mercadopago');\n if (Mage::getStoreConfigFlag(MercadoPago_OneStepCheckout_Helper_Data::XML_PATH_ONS_ACTIVE)) {\n $block->setText(\n sprintf(\n '\n <script type=\"text/javascript\">var PublicKeyMercadoPagoCustom = \"' . $public_key . '\";</script>\n <script src=\"https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js\"></script>\n <script type=\"text/javascript\" src=\"%s\"></script>\n <script type=\"text/javascript\" src=\"%s\"></script>\n <script type=\"text/javascript\" src=\"%s\"></script>',\n Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS, true) . 'mercadopago/mercadopago_osc.js',\n Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS, true) . 'mercadopago/tiny.min.js',\n Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS, true) . 'mercadopago/tinyJ.js'\n )\n );\n\n $head = Mage::app()->getLayout()->getBlock('after_body_start');\n\n if ($head) {\n $head->append($block);\n }\n\n return Mage_Payment_Block_Form_Cc::_prepareLayout();\n } else {\n return parent::_prepareLayout();\n }\n\n }",
"public function checkIn()\n\t{\n\t\t$this->layout = 'index';\n\t}",
"protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\n\n\t\t\t$cb_js_var = array(\n\t\t\t\t'site_url' => url('/'),\n\t\t\t\t'admin_url' => url('/admin'),\n\t\t\t\t'admin_assets_url' => asset('packages/vizioart/cookbook/'),\n\t\t\t\t'admin_api_url' => url('/admin/api')\n\t\t\t);\n\n\n\t\t\t$this->layout = View::make($this->layout, array(\n\t\t\t\t'cb_js_var' => $cb_js_var\n\t\t\t));\n\t\t}\n\t}",
"protected function setNonAuthenticatedPageLayout() {\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::HeaderTemplate;\n }\n\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::ContenTemplate;\n\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::FooterTemplate;\n }\n }",
"protected function _prepareLayout()\n {\n // Set custom submit url route for form - to submit updated options to cart\n $block = $this->getLayout()->getBlock('product.info');\n if ($block) {\n $block->setSubmitRouteData(\n [\n 'route' => 'checkout/cart/updateItemOptions',\n 'params' => ['id' => $this->getRequest()->getParam('id')],\n ]\n );\n }\n\n return parent::_prepareLayout();\n }",
"protected function _prepareLayout()\n\t{\n\t\t$this->getLayout()->getBlock('head')->setTitle($this->__($this->_helper->pageTitle()));\n $this->getLayout()->getBlock('root')->setTemplate('page/1column.phtml');\n\t\t$this->getLayout()->getBlock('head')->addCss('css/extrembler/prelogin/form.css');\n\t\t$this->getLayout()->getBlock('root')->unsetChild('header');\n\t\t$this->getLayout()->getBlock('content')->insert('store_language');\n\t\t$this->getLayout()->getBlock('root')->unsetChild('footer');\n\t return parent::_prepareLayout();\n\t}",
"public function controller_action_layout_generate_blocks_after(Varien_Event_Observer $observer){\r\n\t\tif(!Mage::helper('vendorscms')->moduleEnable()) return;\r\n\t\t$action = $observer->getEvent()->getAction();\r\n\t\t$layout = $observer->getEvent()->getLayout();\r\n\t\tif($vendor = Mage::registry('vendor')){\r\n\t\t\t/*Remove all default blocks*/\r\n\t\t\t$leftBlock = $layout->getBlock('left');\r\n\t\t\t//$layout->getBlock('left')->unsetChildren();\r\n\t\t\tif($leftBlock) foreach($leftBlock->getChild() as $key=>$value){\r\n\t\t\t\tif(substr($key, 0,7) == 'vendors') continue;\r\n\t\t\t\t$leftBlock->unsetChild($key);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$rightBlock = $layout->getBlock('right');\r\n\t\t\t//$layout->getBlock('left')->unsetChildren();\r\n\t\t\tif($rightBlock) foreach($rightBlock->getChild() as $key=>$value){\r\n\t\t\t\tif(substr($key, 0,7) == 'vendors') continue;\r\n\t\t\t\t$rightBlock->unsetChild($key);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$layout->getBlock('footer')->unsetChildren();\r\n\t\t\t\r\n\t\t\t/*Remove default top menu*/\r\n\t\t\t$layout->getBlock('top.menu')->unsetChildren();\r\n\t\t\t\r\n\t\t\t/*Remove default top search*/\r\n\t\t\t//$layout->getBlock('top.search')->addAttribute('ignore', true);\r\n\t\t\t/*Change Logo to vendor logo*/\r\n\t\t\t$headerBlock = $layout->getBlock('header');\r\n\t\t\t$headerBlock->setLogo($vendor->getLogo(),$vendor->getTitle());\r\n\t\t\t/*Process frontend instance*/\r\n\t\t\t$apps = Mage::getModel('vendorscms/app')->getCollection()->addFieldToFilter('vendor_id',$vendor->getId())->addOrder('sort_order','ASC');\r\n\t\t\tforeach($apps as $app){\r\n\t\t\t\tMage::helper('vendorscms')->processFrontendApp($app,$layout,$action);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($vendorConfig = Mage::helper('vendorsconfig')->getVendorConfig('design/config/theme',$vendor->getId())){\r\n\t\t\t\t$vendorConfig = explode(\"/\", $vendorConfig);\r\n\t\t\t\tMage::getDesign()->setPackageName($vendorConfig[0]);\r\n\t\t\t\tMage::getDesign()->setTheme($vendorConfig[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function wp_register_layout_support($block_type)\n {\n }",
"function beforeLayout() {\n }",
"protected function setAuthenticatedPageLayout() {\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::HeaderTemplate;\n// require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::HeaderTemplate;\n }\n\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::ContenTemplate;\n\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::FooterTemplate;\n }\n }",
"function apptivo_ecommerce_order_review() {\r\n apptivo_ecommerce_get_template('checkout/review_order.php', false);\r\n}",
"protected function setupLayout() {\n\t\t$this->data['route'] = Route::getCurrentRoute()->getPath();\t\n\t\tif ( ! is_null($this->layout)) {\n\t\t\t$this->data['enrolledCourses'] = NULL;\n\t\t\t\n\t\t\tif (Auth::check() && in_array(Auth::user()->user_type, array(3, 5))) {\n\t\t\t\t$this->data['enrolledCourses'] = EnrolledCourses::getEnrolledCourses();\n\t\t\t\t$this->data['endedCourses'] = EnrolledCourses::getEndedCourses();\n\t\t\t\t$this->data['profiling'] = User::getRegProfile();\t\n\t\t\t\t$this->data['profiling_ctr'] = $this->data['profiling'];\t\t\t\t\n\t\t\t} else if (Auth::check() && Auth::user()->user_type == 2) {\n\t\t\t\t$this->data['assigned_courses'] = Courses::getAssignedCourses();\n\t\t\t}\n\n\t\t\t$this->layout = View::make($this->layout, $this->data);\n\t\t}\n\t}",
"public function swc_shop_layout() {\n\t\t$shop_layout\t\t\t\t\t= get_theme_mod( 'swc_shop_layout', 'default' );\n\t\t$archive_description\t\t\t= get_theme_mod( 'swc_archive_description', 'default' );\n\t\t$product_layout\t\t\t\t\t= get_theme_mod( 'swc_product_layout', 'default' );\n\t\t$header_search\t\t\t\t\t= get_theme_mod( 'swc_header_search', true );\n\t\t$header_cart\t\t\t\t\t= get_theme_mod( 'swc_header_cart', true );\n\t\t$homepage_content\t\t\t\t= get_theme_mod( 'swc_homepage_content', true );\n\t\t$homepage_cats\t\t\t\t\t= get_theme_mod( 'swc_homepage_categories', true );\n\t\t$homepage_recent\t\t\t\t= get_theme_mod( 'swc_homepage_recent', true );\n\t\t$homepage_featured\t\t\t\t= get_theme_mod( 'swc_homepage_featured', true );\n\t\t$homepage_top_rated\t\t\t\t= get_theme_mod( 'swc_homepage_top_rated', true );\n\t\t$homepage_on_sale\t\t\t\t= get_theme_mod( 'swc_homepage_on_sale', true );\n\t\t$homepage_best_sellers\t\t\t= get_theme_mod( 'swc_homepage_best_sellers', true );\n\t\t$archive_results_count\t\t\t= get_theme_mod( 'swc_product_archive_results_count', true );\n\t\t$archive_sorting\t\t\t\t= get_theme_mod( 'swc_product_archive_sorting', true );\n\t\t$archive_image\t\t\t\t\t= get_theme_mod( 'swc_product_archive_image', true );\n\t\t$archive_sale_flash\t\t\t\t= get_theme_mod( 'swc_product_archive_sale_flash', true );\n\t\t$archive_rating\t\t\t\t\t= get_theme_mod( 'swc_product_archive_rating', true );\n\t\t$archive_price\t\t\t\t\t= get_theme_mod( 'swc_product_archive_price', true );\n\t\t$archive_add_to_cart\t\t\t= get_theme_mod( 'swc_product_archive_add_to_cart', true );\n\t\t$archive_product_description\t= get_theme_mod( 'swc_product_archive_description', false );\n\t\t$product_gallery_layout\t\t\t= get_theme_mod( 'swc_product_gallery_layout', 'default' );\n\t\t$product_details_tabs\t\t\t= get_theme_mod( 'swc_product_details_tab', true );\n\t\t$product_related\t\t\t\t= get_theme_mod( 'swc_related_products', true );\n\t\t$product_meta\t\t\t\t\t= get_theme_mod( 'swc_product_meta', true );\n\t\t$product_description\t\t\t= get_theme_mod( 'swc_product_description', true );\n\n\t\tif ( class_exists( 'WooCommerce' ) ) {\n\n\t\t\tif ( is_shop() || is_product_taxonomy() || is_product_category() || is_product_tag() ) {\n\t\t\t\tif ( 'full-width' == $shop_layout ) {\n\t\t\t\t\tremove_action( 'storefront_sidebar', 'storefront_get_sidebar' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( is_product() ) {\n\t\t\t\tif ( 'hidden' == $product_gallery_layout ) {\n\t\t\t\t\tremove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );\n\t\t\t\t}\n\n\t\t\t\tif ( 'full-width' == $product_layout ) {\n\t\t\t\t\tremove_action( 'storefront_sidebar', 'storefront_get_sidebar' );\n\t\t\t\t}\n\n\t\t\t\tif ( false == $product_details_tabs ) {\n\t\t\t\t\tremove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );\n\t\t\t\t}\n\n\t\t\t\tif ( false == $product_related ) {\n\t\t\t\t\tremove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );\n\t\t\t\t}\n\n\t\t\t\tif ( false == $product_description ) {\n\t\t\t\t\tremove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );\n\t\t\t\t}\n\n\t\t\t\tif ( false == $product_meta ) {\n\t\t\t\t\tremove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( 'beneath' == $archive_description ) {\n\t\t\t\tremove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );\n\t\t\t\tremove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10 );\n\t\t\t\tadd_action( 'woocommerce_after_main_content', 'woocommerce_taxonomy_archive_description', 5 );\n\t\t\t\tadd_action( 'woocommerce_after_main_content', 'woocommerce_product_archive_description', 5 );\n\t\t\t}\n\t\t}\n\n\t\tif ( false == $header_search ) {\n\t\t\tremove_action( 'storefront_header', 'storefront_product_search', \t40 );\n\t\t}\n\n\t\tif ( false == $header_cart ) {\n\t\t\t$header_layout = get_theme_mod( 'sd_header_layout' );\n\n\t\t\tif ( $header_layout && 'inline' == $header_layout ) {\n\t\t\t\tremove_action( 'storefront_header', 'storefront_header_cart', \t\t69 );\n\t\t\t} else {\n\t\t\t\tremove_action( 'storefront_header', 'storefront_header_cart', \t\t60 );\n\t\t\t}\n\n\t\t}\n\n\t\tif ( false == $homepage_content ) {\n\t\t\tremove_action( 'homepage', 'storefront_homepage_content', 10 );\n\t\t}\n\n\t\tif ( false == $homepage_cats ) {\n\t\t\tremove_action( 'homepage', 'storefront_product_categories', 20 );\n\t\t}\n\n\t\tif ( false == $homepage_recent ) {\n\t\t\tremove_action( 'homepage', 'storefront_recent_products', 30 );\n\t\t}\n\n\t\tif ( false == $homepage_featured ) {\n\t\t\tremove_action( 'homepage', 'storefront_featured_products', 40 );\n\t\t}\n\n\t\tif ( false == $homepage_top_rated ) {\n\t\t\tremove_action( 'homepage', 'storefront_popular_products', 50 );\n\t\t}\n\n\t\tif ( false == $homepage_on_sale ) {\n\t\t\tremove_action( 'homepage', 'storefront_on_sale_products', 60 );\n\t\t}\n\n\t\tif ( false == $homepage_best_sellers ) {\n\t\t\tremove_action( 'homepage', 'storefront_best_selling_products', 70 );\n\t\t}\n\n\t\tif ( false == $archive_results_count ) {\n\t\t\tremove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 );\n\t\t\tremove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );\n\t\t}\n\n\t\tif ( false == $archive_sorting ) {\n\t\t\tremove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 );\n\t\t\tremove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );\n\t\t}\n\n\t\tif ( false == $archive_image ) {\n\t\t\tremove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );\n\t\t}\n\n\t\tif ( false == $archive_sale_flash ) {\n\t\t\tremove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 6 );\n\t\t}\n\n\t\tif ( false == $archive_rating ) {\n\t\t\tremove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );\n\t\t}\n\n\t\tif ( false == $archive_price ) {\n\t\t\tremove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );\n\t\t}\n\n\t\tif ( false == $archive_add_to_cart ) {\n\t\t\tremove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );\n\t\t}\n\n\t\tif ( true == $archive_product_description ) {\n\t\t\tadd_action( 'woocommerce_after_shop_loop_item', array( $this, 'swc_loop_product_description' ), 6 );\n\t\t}\n\t}",
"public function _prepareLayout()\n {\n $this->setTemplate('authorizenetcim/form/cc.phtml');\n }",
"public function hookHeader()\n {\n if ($this->context->controller instanceof OrderConfirmationController) {\n $this->context->controller->addJS($this->_path . '/views/js/scratch-card.js');\n $this->context->controller->addCSS($this->_path . '/views/css/front.css');\n }\n }",
"protected function _prepareLayout()\n {\n parent::_prepareLayout();\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n }",
"protected function _prepareLayout()\n {\n parent::_prepareLayout();\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n }",
"function hankart_add_product_layouts_area() {\n get_template_part(\"inc/template_parts/single-prod-layouts\");\n}",
"function wp_render_layout_support_flag($block_content, $block)\n {\n }",
"public function checkout()\r\n\t{\r\n\t\t$data['view_file_name'] = 'checkout_view';\r\n $this->template->load_info_view('order/checkout_view',$data);\r\n\t}",
"public function customization_checkout_page() {\n\n\t\t\tif ( ! is_checkout() ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Display order notes.\n\t\t\tif ( ! astra_get_option( 'checkout-order-notes-display' ) ) {\n\t\t\t\tadd_filter( 'woocommerce_enable_order_notes_field', '__return_false' );\n\t\t\t}\n\t\t\t// Display coupon.\n\t\t\tif ( ! astra_get_option( 'checkout-coupon-display' ) ) {\n\t\t\t\tremove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Two Step Checkout Page\n\t\t\t */\n\t\t\tif ( astra_get_option( 'two-step-checkout' ) && 'default' === astra_get_option( 'checkout-layout-type' ) ) {\n\t\t\t\tadd_action( 'woocommerce_checkout_before_customer_details', 'astra_two_step_checkout_form_wrapper_div', 1 );\n\t\t\t\tadd_action( 'woocommerce_checkout_before_customer_details', 'astra_two_step_checkout_form_ul_wrapper', 2 );\n\t\t\t\tadd_action( 'woocommerce_checkout_order_review', 'astra_woocommerce_div_wrapper_close', 30 );\n\t\t\t\tadd_action( 'woocommerce_checkout_order_review', 'astra_woocommerce_ul_close', 30 );\n\t\t\t\tadd_action( 'woocommerce_checkout_before_customer_details', 'astra_two_step_checkout_address_li_wrapper', 5 );\n\t\t\t\tadd_action( 'woocommerce_checkout_after_customer_details', 'astra_woocommerce_li_close' );\n\t\t\t\tadd_action( 'woocommerce_checkout_before_order_review', 'astra_two_step_checkout_order_review_wrap', 1 );\n\t\t\t\tadd_action( 'woocommerce_checkout_after_order_review', 'astra_woocommerce_li_close', 40 );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Two Step Modern Checkout Page\n\t\t\t */\n\t\t\tif ( ! defined( 'CARTFLOWS_VER' ) && astra_get_option( 'two-step-checkout' ) && 'modern' === astra_get_option( 'checkout-layout-type' ) && ! is_wc_endpoint_url( 'order-received' ) ) {\n\n\t\t\t\tadd_action( 'astra_entry_content_before', array( $this, 'get_checkout_form_note' ), 10, 1 );\n\n\t\t\t\tadd_action( 'woocommerce_checkout_before_customer_details', array( $this, 'add_two_step_first_step_wrapper' ), 13 );\n\n\t\t\t\tadd_action( 'astra_entry_content_before', array( $this, 'add_two_step_second_step_wrapper' ), 11 );\n\n\t\t\t\tadd_action( 'astra_entry_content_before', array( $this, 'add_two_step_nav_menu' ), 12, 1 );\n\n\t\t\t\tadd_action( 'woocommerce_checkout_after_customer_details', array( $this, 'add_two_step_next_btn' ), 12 );\n\n\t\t\t\tadd_action( 'woocommerce_checkout_after_customer_details', array( $this, 'add_two_step_closing_div' ), 13 );\n\n\t\t\t\tadd_action( 'astra_entry_content_after', array( $this, 'add_two_step_closing_div' ), 14 );\n\n\t\t\t\tadd_action( 'woocommerce_checkout_before_order_review_heading', array( $this, 'add_two_step_second_step_order_wrapper' ), 14 );\n\n\t\t\t\tadd_action( 'woocommerce_checkout_after_order_review', array( $this, 'add_two_step_closing_div' ), 14 );\n\n\t\t\t}\n\n\t\t\tif ( astra_get_option( 'checkout-distraction-free' ) ) {\n\n\t\t\t\t// HFB Support for distration free checkout.\n\t\t\t\tif ( true === astra_addon_builder_helper()->is_header_footer_builder_active ) {\n\t\t\t\t\tremove_action( 'astra_header', array( Astra_Builder_Header::get_instance(), 'prepare_header_builder_markup' ) );\n\t\t\t\t\tremove_action( 'astra_footer', array( Astra_Builder_Footer::get_instance(), 'footer_markup' ), 10 );\n\t\t\t\t}\n\n\t\t\t\tremove_action( 'astra_header', 'astra_header_markup' );\n\t\t\t\tremove_action( 'astra_footer', 'astra_footer_markup' );\n\n\t\t\t\tadd_action( 'astra_header', array( $this, 'checkout_header_markup' ) );\n\t\t\t\tadd_action( 'astra_footer', array( $this, 'checkout_footer_markup' ) );\n\n\t\t\t\t// Store Sidebar Layout.\n\t\t\t\tadd_filter( 'astra_page_layout', array( $this, 'checkout_sidebar_layout' ), 99 );\n\t\t\t}\n\t\t}",
"public function hookHeader()\n\t{\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\n\t\t/* Continue only if we are in the checkout process */\n\t\tif (Tools::getValue('controller') != 'order-opc' && (!($_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order.php' || $_SERVER['PHP_SELF'] == __PS_BASE_URI__.'order-opc.php' || Tools::getValue('controller') == 'order' || Tools::getValue('controller') == 'orderopc' || Tools::getValue('step') == 3)))\n\t\t\treturn;\n\n\t\t/* Load JS and CSS files through CCC */\n\t\t$this->context->controller->addCSS($this->_path.'views/css/stripe-prestashop.css');\n\t\t\n\t\treturn '<script src=\"https://checkout.stripe.com/checkout.js\"></script>';\n\t}",
"protected function _prepareLayout()\n {\n $otp = $this->oauth2otp->create();\n\n // The final url to use (must utilise same admin key as current user)\n // If session code is not enabled in the url key, then the cookie will work for us\n // We set this here because the session key may be included in the url - this cannot be achieved reliably within\n // the frontend controller callback, as the request will not have admin access permissions (cookie or other).\n\n $successUrl = $this->backendHelper->getUrl( 'hotlink_brightpearl/oauth2/confirm' ); // No more OTP\n\n\n // To be copy and pasted into Proxy UI\n $callbackUrl = $this->brightpearlHelper->getBaseCallbackUrl( 'hotlink_brightpearl/oauth2/callback',\n array( '_query' => array( 'otp' => $otp ) ) );\n\n $this->oauth2otp->save( $otp, $callbackUrl, $successUrl );\n\n $this->setCallbackUrl( $callbackUrl );\n\n $this->setProxyUrl( $this->oauth2config->getProxyUrl() );\n return parent::_prepareLayout();\n }",
"public function beforeLoadLayout($observer)\n {\n \t//Si la page générée est pour une mise en cache (varnish_static) on se considère comme non loggé\n\t if (Mage::registry('varnish_static')) {\n\t\t\t$observer->getEvent()->getLayout()->getUpdate()->addHandle('customer_logged_out');\n\t\t} else {\n\t\t\tparent::beforeLoadLayout($observer);\n\t\t}\n\n\t\tif (Mage::getStoreConfig('system/external_page_cache/varnish_customer_group_cache')) {\n\t \t//Si on est loggé on ajoute un cookie avec l'id de group (utilisé dans varnish pour hasher différement les pages selon le grope de client)\n\t\t\t$session = Mage::getSingleton('customer/session');\n\t\t\t$cookie = Mage::getSingleton('core/cookie');\n\t\t\t$cgCookie = $cookie->get(self::CUSTOMER_GROUP_COOKIE);\n\t\t\tif ( $session->isLoggedIn()) {\n\t\t\t\tif ($cgCookie) {\n\t\t\t\t\t$cookie->renew(self::CUSTOMER_GROUP_COOKIE, $session->getLifeTime());\n\t\t\t\t} else {\n\t\t\t\t\t$cookie->set(self::CUSTOMER_GROUP_COOKIE, $session->getCustomerGroupId() , $session->getLifeTime());\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($cgCookie) {\n\t\t\t\t\t$cookie->delete(self::CUSTOMER_GROUP_COOKIE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n }",
"public function initContent()\n {\n $this->display_column_left = false;\n $this->display_column_right = false;\n\n // Debug\n // $cart234 = $this->context->cart;\n // $cart_methods = get_class_methods(new Cart());\n // print_r(get_object_vars($this->context));\n // $foo = $this->context->foo;\n\n // Get POST params\n // Favoring Prestashop's Tools::getValue($key, $default_value) over using the superglobals directly\n // $number_of_installments = 0; // default to 0\n // if ($_POST['number_of_installments'])\n // \t$number_of_installments = $_POST['number_of_installments'];\n $number_of_installments = Tools::getValue('number_of_installments', 0);\n\n // Call parent\n parent::initContent();\n\n // Set template to use\n $this->setTemplate('paymentConfirmation.tpl');\n\n // Get cart id\n $id_cart = $this->context->cart->id;\n\n // Set language code\n // TODO Make it a little more general?\n // Accepted values: en-US, el-GR, ru-RU, de-DE\n $language_code = $this->context->language->language_code;\n\n // Get merchant reference\n $merchant_reference = WinbankRedirectTransaction::getMerchantReferenceByCartId($id_cart);\n\n // Set params to be sent with the bank link\n $param_back_link = '';\n\n // Set URL to make POST request\n $api_url = '';\n\n // Assign cart data to smarty\n $this->context->smarty->assign(array(\n 'nb_products' => $this->context->cart->nbProducts(),\n 'total_amount' => $this->context->cart->getOrderTotal(true, Cart::BOTH),\n 'shipping_amount' => $this->context->cart->getOrderTotal(true, Cart::ONLY_SHIPPING),\n 'products_amount' => $this->context->cart->getOrderTotal(true, Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING),\n 'path' => $this->module->getPathUri(),\n 'api_url' => $api_url,\n 'number_of_installments' => $number_of_installments,\n 'acquirer_id' => Configuration::get('WINBANKREDIRECT_CRED_ACQUIRERID'),\n 'merchant_id' => Configuration::get('WINBANKREDIRECT_CRED_MERCHANTID'),\n 'pos_id' => Configuration::get('WINBANKREDIRECT_CRED_POSID'),\n 'user' => Configuration::get('WINBANKREDIRECT_CRED_USERNAME'),\n 'language_code' => $language_code,\n 'merchant_reference' => $merchant_reference,\n 'param_back_link' => $param_back_link\n ));\n }"
] | [
"0.6442868",
"0.63423246",
"0.59605473",
"0.5849184",
"0.5824462",
"0.5799398",
"0.578177",
"0.5749272",
"0.5697371",
"0.5694159",
"0.56639576",
"0.564474",
"0.5641866",
"0.563732",
"0.5611357",
"0.54907304",
"0.5459894",
"0.5454881",
"0.54532266",
"0.5445816",
"0.535731",
"0.535731",
"0.5353853",
"0.534789",
"0.53471476",
"0.53346264",
"0.53329897",
"0.53224343",
"0.5321216",
"0.53021353"
] | 0.6847302 | 0 |
Save ident data from quote to customer after placing an order | public function saveIdentDataForNewCustomer(Varien_Event_Observer $observer)
{
if (!Mage::getModel('postident/config')->isEnabled()) {
return;
}
$quote = $observer->getEvent()->getOrder()->getQuote();
$customer = $observer->getEvent()->getOrder()->getCustomer();
$checkoutMethod = $quote->getCheckoutMethod();
if (!is_null($quote)
&& !is_null($quote->getPostidentVerificationData())
&& $checkoutMethod != Mage_Sales_Model_Quote::CHECKOUT_METHOD_GUEST
) {
$customer = Mage::Helper('postident/data')->saveIdentDataToCustomer($customer, $quote);
//This updates the customer object in the session - ensures that it has the postident data
Mage::getSingleton('customer/session')->setCustomer($customer);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }",
"private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }",
"public function storeDataInSession() {\n\t\t$_SESSION['Order__id'] = $this->insertedOrderId;\n\t\t$_SESSION['transactionAmount'] = $this->totalPrice;\n\t}",
"public function ___orderSaved(PadOrder $order) {\n }",
"public function saveQuote()\n {\n $this->calculateSubscription();\n $this->calculateService();\n $this->calculateGoods();\n \n $return = array();\n $return['services'] = $this->services;\n $return['goods'] = $this->goods;\n $return['subscription'] = $this->subscription;\n $return['userEmail'] = $this->user->getEmail();\n $return['UUID'] = $this->generateQuoteUUID($return);\n $return['user'] = $this->user;\n $return['subtotal'] = $this->subtotal;\n return $return;\n\n }",
"public function saved(Order $Order)\n {\n //code...\n }",
"public function saving(Order $Order)\n {\n //code...\n }",
"public function _setCustomerQuote()\n {\n // Retrieve a valid quote\n if ($quote = $this->_retrieveQuote()) {\n\n // Verify that the customer is a valid customer of the quote\n $this->_verifyCustomerForQuote($quote);\n /* Set the session quote if required.\n Needs to be done after verifying the current customer */\n if ($this->_getCheckoutSession()->getQuoteId() != $quote->getId()) {\n $this->_logger->debug(__(\"Setting quote to current session\"));\n // Set the quote in the current object\n $this->_setQuote($quote);\n // Set the quote in the session\n $this->_getCheckoutSession()->setQuoteId($quote->getId());\n }\n // Make sure the qoute is active\n $this->_activateQuote($quote);\n } else {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__(\"Could not retrieve the quote\"));\n }\n }",
"public function setPaymentInfoToQuote()\n {\n $expercashCode = Mage::getModel('expercash/expercashmpf')->getCode();\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n\n if ($quote->isVirtual()) {\n $quote->getBillingAddress()->setPaymentMethod($expercashCode);\n } else {\n $quote->getShippingAddress()->setPaymentMethod($expercashCode);\n }\n\n // shipping totals may be affected by payment method\n if (!$quote->isVirtual() && $quote->getShippingAddress()) {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n }\n\n $payment = $quote->getPayment();\n $payment->importData(array('method' => $expercashCode));\n $quote->save();\n }",
"private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }",
"public function saveTemporaryOrder()\r\n {\r\n $order = Shopware()->Modules()->Order();\r\n\r\n $order->sUserData = $this->View()->sUserData;\r\n $order->sComment = isset($this->session['sComment']) ? $this->session['sComment'] : '';\r\n $order->sBasketData = $this->View()->sBasket;\r\n $order->sAmount = $this->View()->sBasket['sAmount'];\r\n $order->sAmountWithTax = !empty($this->View()->sBasket['AmountWithTaxNumeric']) ? $this->View()->sBasket['AmountWithTaxNumeric'] : $this->View()->sBasket['AmountNumeric'];\r\n $order->sAmountNet = $this->View()->sBasket['AmountNetNumeric'];\r\n $order->sShippingcosts = $this->View()->sBasket['sShippingcosts'];\r\n $order->sShippingcostsNumeric = $this->View()->sBasket['sShippingcostsWithTax'];\r\n $order->sShippingcostsNumericNet = $this->View()->sBasket['sShippingcostsNet'];\r\n $order->bookingId = Shopware()->System()->_POST['sBooking'];\r\n $order->dispatchId = $this->session['sDispatch'];\r\n $order->sNet = $this->View()->sUserData['additional']['show_net'];\r\n\r\n $order->sDeleteTemporaryOrder();\t// Delete previous temporary orders\r\n $order->sCreateTemporaryOrder();\t// Create new temporary order\r\n }",
"protected function _prepareNewCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $quote->getCustomer();\n /* @var $customer Mage_Customer_Model_Customer */\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n $customerBilling->setIsDefaultBilling(true);\n if ($shipping && !$shipping->getSameAsBilling()) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n $customerShipping->setIsDefaultShipping(true);\n } else {\n $customerBilling->setIsDefaultShipping(true);\n }\n\n Mage::helper('core')->copyFieldset('checkout_onepage_quote', 'to_customer', $quote, $customer);\n $customer->setPassword($customer->decryptPassword($quote->getPasswordHash()));\n $quote->setCustomer($customer)\n ->setCustomerId(true);\n }",
"function saveorder()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$cid \t= JRequest::getVar( 'cid', array(), 'post', 'array' );\n\t\t$order \t= JRequest::getVar( 'order', array(), 'post', 'array' );\n\t\tJArrayHelper::toInteger($cid);\n\t\tJArrayHelper::toInteger($order);\n\n\t\t$model = $this->getModel('weblink');\n\t\t$model->saveorder($cid, $order);\n\n\t\t$msg = JText::_( 'New ordering saved' );\n\t\t$this->setRedirect( 'index.php?option=com_weblinks', $msg );\n\t}",
"protected function _prepareCustomerQuote($quote)\n {\n /** @var Quote $quote */\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $this->customerRepository->getById($quote->getCustomerId());\n $hasDefaultBilling = (bool)$customer->getDefaultBilling();\n $hasDefaultShipping = (bool)$customer->getDefaultShipping();\n\n if ($shipping && !$shipping->getSameAsBilling()\n && (!$shipping->getCustomerId() || $shipping->getSaveInAddressBook())\n ) {\n $shippingAddress = $shipping->exportCustomerAddress();\n if (!$hasDefaultShipping) {\n //Make provided address as default shipping address\n $shippingAddress->setIsDefaultShipping(true);\n $hasDefaultShipping = true;\n if (!$hasDefaultBilling && !$billing->getSaveInAddressBook()) {\n $shippingAddress->setIsDefaultBilling(true);\n $hasDefaultBilling = true;\n }\n }\n //save here new customer address\n $shippingAddress->setCustomerId($quote->getCustomerId());\n $this->addressRepository->save($shippingAddress);\n $quote->addCustomerAddress($shippingAddress);\n $shipping->setCustomerAddressData($shippingAddress);\n $this->addressesToSync[] = $shippingAddress->getId();\n $shipping->setCustomerAddressId($shippingAddress->getId());\n }\n\n if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) {\n $billingAddress = $billing->exportCustomerAddress();\n if (!$hasDefaultBilling) {\n //Make provided address as default shipping address\n if (!$hasDefaultShipping) {\n //Make provided address as default shipping address\n $billingAddress->setIsDefaultShipping(true);\n }\n $billingAddress->setIsDefaultBilling(true);\n }\n $billingAddress->setCustomerId($quote->getCustomerId());\n $this->addressRepository->save($billingAddress);\n $quote->addCustomerAddress($billingAddress);\n $billing->setCustomerAddressData($billingAddress);\n $this->addressesToSync[] = $billingAddress->getId();\n $billing->setCustomerAddressId($billingAddress->getId());\n }\n if ($shipping && !$shipping->getCustomerId() && !$hasDefaultBilling) {\n $shipping->setIsDefaultBilling(true);\n }\n }",
"protected function save_subscription_meta( $order_id, $customer_id ) {\n\t\tupdate_post_meta( $order_id, '_simplify_customer_id', wc_clean( $customer_id ) );\n\t}",
"public function storeSelf() {\n trace('[METHOD] '.__METHOD__);\n\t\t$dataArray = $this->getDataArray();\n $this->set_uid(tx_ptgsaaccounting_orderCreditBalanceAccessor::getInstance()->storeOrderCreditBalanceData($dataArray));\n \n\n\t}",
"protected function _prepareCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $this->getCustomerSession()->getCustomer();\n if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) {\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n }\n if ($shipping && !$shipping->getSameAsBilling() &&\n (!$shipping->getCustomerId() || $shipping->getSaveInAddressBook())) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n }\n\n if (isset($customerBilling) && !$customer->getDefaultBilling()) {\n $customerBilling->setIsDefaultBilling(true);\n }\n if ($shipping && isset($customerShipping) && !$customer->getDefaultShipping()) {\n $customerShipping->setIsDefaultShipping(true);\n } else if (isset($customerBilling) && !$customer->getDefaultShipping()) {\n $customerBilling->setIsDefaultShipping(true);\n }\n $quote->setCustomer($customer);\n }",
"protected function _prepareCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $this->getCustomerSession()->getCustomer();\n if (!$billing->getCustomerId() || $billing->getSaveInAddressBook()) {\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n }\n\n if ($shipping && !$shipping->getSameAsBilling()\n && (!$shipping->getCustomerId() || $shipping->getSaveInAddressBook())\n ) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n }\n\n if (isset($customerBilling) && !$customer->getDefaultBilling()) {\n $customerBilling->setIsDefaultBilling(true);\n }\n\n if ($shipping && isset($customerShipping) && !$customer->getDefaultShipping()) {\n $customerShipping->setIsDefaultShipping(true);\n } else if (isset($customerBilling) && !$customer->getDefaultShipping()) {\n $customerBilling->setIsDefaultShipping(true);\n }\n\n $quote->setCustomer($customer);\n }",
"public function placeOrder(Mage_Sales_Model_Quote $quote)\n {\n Mage::dispatchEvent(\"fontis_masterpass_place_order_before\", array(\"quote\" => $quote));\n\n // Check to see if the customer is logged in or not.\n if (!$quote->getCustomerId()) {\n $quote->setCustomerIsGuest(true)\n ->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID)\n ->setCustomerEmail($quote->getBillingAddress()->getEmail());\n }\n $quote->collectTotals();\n\n /** @var Mage_Sales_Model_Service_Quote $service */\n $service = Mage::getModel(\"sales/service_quote\", $quote);\n\n // The Mage_Sales_Model_Service_Quote interface changed from v1.4.1.0 CE onwards.\n // This accounts for this change.\n if (method_exists($service, \"submitAll\")) {\n $service->submitAll();\n $order = $service->getOrder();\n } else {\n $order = $service->submit();\n }\n $order->save();\n\n Mage::dispatchEvent(\"fontis_masterpass_place_order_after\", compact(\"quote\", \"order\"));\n\n return $order;\n }",
"protected function _prepareNewCustomerQuote()\n {\n $quote = $this->getQuote();\n $billing = $quote->getBillingAddress();\n $shipping = $quote->isVirtual() ? null : $quote->getShippingAddress();\n\n $customer = $quote->getCustomer();\n /* @var $customer Mage_Customer_Model_Customer */\n $customerBilling = $billing->exportCustomerAddress();\n $customer->addAddress($customerBilling);\n $billing->setCustomerAddress($customerBilling);\n $customerBilling->setIsDefaultBilling(true);\n if ($shipping && !$shipping->getSameAsBilling()) {\n $customerShipping = $shipping->exportCustomerAddress();\n $customer->addAddress($customerShipping);\n $shipping->setCustomerAddress($customerShipping);\n $customerShipping->setIsDefaultShipping(true);\n } elseif ($shipping) {\n $customerBilling->setIsDefaultShipping(true);\n }\n\n if ($quote->getCustomerTaxnumber() && !$billing->getCustomerTaxnumber()) {\n $billing->setCustomerTaxnumber($quote->getCustomerTaxnumber());\n }\n\n Mage::helper('core')->copyFieldset('checkout_onepage_quote', 'to_customer', $quote, $customer);\n $customer->setPassword($customer->decryptPassword($quote->getPasswordHash()));\n $customer->setPasswordHash($customer->hashPassword($customer->getPassword()));\n $quote->setCustomer($customer)\n ->setCustomerId(true);\n }",
"function saveOrder()\n\t\t{\n\t\t\tglobal $current_user, $wpdb, $pmpro_checkout_id;\n\n\t\t\t//get a random code to use for the public ID\n\t\t\tif(empty($this->code))\n\t\t\t\t$this->code = $this->getRandomCode();\n\n\t\t\t//figure out how much we charged\n\t\t\tif(!empty($this->InitialPayment))\n\t\t\t\t$amount = $this->InitialPayment;\n\t\t\telseif(!empty($this->subtotal))\n\t\t\t\t$amount = $this->subtotal;\n\t\t\telse\n\t\t\t\t$amount = 0;\n\n\t\t\t//Todo: Tax?!, Coupons, Certificates, affiliates\n\t\t\tif(empty($this->subtotal))\n\t\t\t\t$this->subtotal = $amount;\n\t\t\tif(isset($this->tax))\n\t\t\t\t$tax = $this->tax;\n\t\t\telse\n\t\t\t\t$tax = $this->getTax(true);\n\t\t\t$this->certificate_id = \"\";\n\t\t\t$this->certificateamount = \"\";\n\n\t\t\t//calculate total\n\t\t\tif(!empty($this->total))\n\t\t\t\t$total = $this->total;\n\t\t\telse {\n\t\t\t\t$total = (float)$amount + (float)$tax;\n\t\t\t\t$this->total = $total;\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//these fix some warnings/notices\n\t\t\tif(empty($this->billing))\n\t\t\t{\n\t\t\t\t$this->billing = new stdClass();\n\t\t\t\t$this->billing->name = $this->billing->street = $this->billing->city = $this->billing->state = $this->billing->zip = $this->billing->country = $this->billing->phone = \"\";\n\t\t\t}\n\t\t\tif(empty($this->user_id))\n\t\t\t\t$this->user_id = 0;\n\t\t\tif(empty($this->paypal_token))\n\t\t\t\t$this->paypal_token = \"\";\n\t\t\tif(empty($this->couponamount))\n\t\t\t\t$this->couponamount = \"\";\n\t\t\tif(empty($this->payment_type))\n\t\t\t\t$this->payment_type = \"\";\n\t\t\tif(empty($this->payment_transaction_id))\n\t\t\t\t$this->payment_transaction_id = \"\";\n\t\t\tif(empty($this->subscription_transaction_id))\n\t\t\t\t$this->subscription_transaction_id = \"\";\n\t\t\tif(empty($this->affiliate_id))\n\t\t\t\t$this->affiliate_id = \"\";\n\t\t\tif(empty($this->affiliate_subid))\n\t\t\t\t$this->affiliate_subid = \"\";\n\t\t\tif(empty($this->session_id))\n\t\t\t\t$this->session_id = \"\";\n\t\t\tif(empty($this->accountnumber))\n\t\t\t\t$this->accountnumber = \"\";\n\t\t\tif(empty($this->cardtype))\n\t\t\t\t$this->cardtype = \"\";\n\t\t\tif(empty($this->expirationmonth))\n\t\t\t\t$this->expirationmonth = \"\";\n\t\t\tif(empty($this->expirationyear))\n\t\t\t\t$this->expirationyear = \"\";\n\t\t\tif(empty($this->ExpirationDate))\n\t\t\t\t$this->ExpirationDate = \"\";\n\t\t\tif (empty($this->status))\n\t\t\t\t$this->status = \"\";\n\n\t\t\tif(empty($this->gateway))\n\t\t\t\t$this->gateway = pmpro_getOption(\"gateway\");\n\t\t\tif(empty($this->gateway_environment))\n\t\t\t\t$this->gateway_environment = pmpro_getOption(\"gateway_environment\");\n\n\t\t\tif(empty($this->datetime) && empty($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", time());\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp) && is_numeric($this->timestamp))\n\t\t\t\t$this->datetime = date(\"Y-m-d H:i:s\", $this->timestamp);\t//get datetime from timestamp\n\t\t\telseif(empty($this->datetime) && !empty($this->timestamp))\n\t\t\t\t$this->datetime = $this->timestamp;\t\t//must have a datetime in it\n\n\t\t\tif(empty($this->notes))\n\t\t\t\t$this->notes = \"\";\n\n\t\t\tif(empty($this->checkout_id) || intval($this->checkout_id)<1) {\n\t\t\t\t$highestval = $wpdb->get_var(\"SELECT MAX(checkout_id) FROM $wpdb->pmpro_membership_orders\");\n\t\t\t\t$this->checkout_id = intval($highestval)+1;\n\t\t\t\t$pmpro_checkout_id = $this->checkout_id;\n\t\t\t}\n\n\t\t\t//build query\n\t\t\tif(!empty($this->id))\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_update_order\";\n\t\t\t\t$after_action = \"pmpro_updated_order\";\n\t\t\t\t//update\n\t\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t\tSET `code` = '\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t`session_id` = '\" . $this->session_id . \"',\n\t\t\t\t\t\t\t\t\t`user_id` = \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t`membership_id` = \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t`paypal_token` = '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t`billing_name` = '\" . esc_sql($this->billing->name) . \"',\n\t\t\t\t\t\t\t\t\t`billing_street` = '\" . esc_sql($this->billing->street) . \"',\n\t\t\t\t\t\t\t\t\t`billing_city` = '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t`billing_state` = '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t`billing_zip` = '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t`billing_country` = '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t`billing_phone` = '\" . esc_sql($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t`subtotal` = '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t`tax` = '\" . $this->tax . \"',\n\t\t\t\t\t\t\t\t\t`couponamount` = '\" . $this->couponamount . \"',\n\t\t\t\t\t\t\t\t\t`certificate_id` = \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t`certificateamount` = '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t`total` = '\" . $this->total . \"',\n\t\t\t\t\t\t\t\t\t`payment_type` = '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t`cardtype` = '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t`accountnumber` = '\" . $this->accountnumber . \"',\n\t\t\t\t\t\t\t\t\t`expirationmonth` = '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t`expirationyear` = '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t`status` = '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t`gateway` = '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t`gateway_environment` = '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t`payment_transaction_id` = '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`subscription_transaction_id` = '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t`timestamp` = '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_id` = '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t`affiliate_subid` = '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t`notes` = '\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t`checkout_id` = \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\tWHERE id = '\" . $this->id . \"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set up actions\n\t\t\t\t$before_action = \"pmpro_add_order\";\n\t\t\t\t$after_action = \"pmpro_added_order\";\n\t\t\t\t\n\t\t\t\t//only on inserts, we might want to set the expirationmonth and expirationyear from ExpirationDate\n\t\t\t\tif( (empty($this->expirationmonth) || empty($this->expirationyear)) && !empty($this->ExpirationDate)) {\n\t\t\t\t\t$this->expirationmonth = substr($this->ExpirationDate, 0, 2);\n\t\t\t\t\t$this->expirationyear = substr($this->ExpirationDate, 2, 4);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//insert\n\t\t\t\t$this->sqlQuery = \"INSERT INTO $wpdb->pmpro_membership_orders\n\t\t\t\t\t\t\t\t(`code`, `session_id`, `user_id`, `membership_id`, `paypal_token`, `billing_name`, `billing_street`, `billing_city`, `billing_state`, `billing_zip`, `billing_country`, `billing_phone`, `subtotal`, `tax`, `couponamount`, `certificate_id`, `certificateamount`, `total`, `payment_type`, `cardtype`, `accountnumber`, `expirationmonth`, `expirationyear`, `status`, `gateway`, `gateway_environment`, `payment_transaction_id`, `subscription_transaction_id`, `timestamp`, `affiliate_id`, `affiliate_subid`, `notes`, `checkout_id`)\n\t\t\t\t\t\t\t\tVALUES('\" . $this->code . \"',\n\t\t\t\t\t\t\t\t\t '\" . session_id() . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->user_id) . \",\n\t\t\t\t\t\t\t\t\t \" . intval($this->membership_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->paypal_token . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->name)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql(trim($this->billing->street)) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->city) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->state) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->zip) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->billing->country) . \"',\n\t\t\t\t\t\t\t\t\t '\" . cleanPhone($this->billing->phone) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->subtotal . \"',\n\t\t\t\t\t\t\t\t\t '\" . $tax . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->couponamount. \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->certificate_id) . \",\n\t\t\t\t\t\t\t\t\t '\" . $this->certificateamount . \"',\n\t\t\t\t\t\t\t\t\t '\" . $total . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->payment_type . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->cardtype . \"',\n\t\t\t\t\t\t\t\t\t '\" . hideCardNumber($this->accountnumber, false) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationmonth . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->expirationyear . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->status) . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway . \"',\n\t\t\t\t\t\t\t\t\t '\" . $this->gateway_environment . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->payment_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->subscription_transaction_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->datetime) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_id) . \"',\n\t\t\t\t\t\t\t\t\t '\" . esc_sql($this->affiliate_subid) . \"',\n\t\t\t\t\t\t\t\t\t\t'\" . esc_sql($this->notes) . \"',\n\t\t\t\t\t\t\t\t\t \" . intval($this->checkout_id) . \"\n\t\t\t\t\t\t\t\t\t )\";\n\t\t\t}\n\n\t\t\tdo_action($before_action, $this);\n\t\t\tif($wpdb->query($this->sqlQuery) !== false)\n\t\t\t{\n\t\t\t\tif(empty($this->id))\n\t\t\t\t\t$this->id = $wpdb->insert_id;\n\t\t\t\tdo_action($after_action, $this);\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"function persistOrder(User $user, Order $order, array $orderItems);",
"public function insertOrderCustomer($value,$line_item, $mainOrderId)\n {\n\n\n //customer info\n $customer_arr['order_id'] = $mainOrderId;\n $customer_arr['line_item_id'] = $line_item->id;\n $customer_arr['billing_address_name'] =$value->billing_address->name;\n $customer_arr['billing_address_first_name'] =$value->billing_address->first_name;\n $customer_arr['billing_address_last_name'] =$value->billing_address->last_name;\n $customer_arr['billing_address_address1'] =$value->billing_address->address1;\n $customer_arr['billing_address_address2'] =$value->billing_address->address2;\n $customer_arr['billing_address_phone'] =$value->billing_address->phone;\n $customer_arr['billing_address_city'] =$value->billing_address->city;\n $customer_arr['billing_address_zip'] =$value->billing_address->zip;\n $customer_arr['billing_address_province'] =$value->billing_address->province;\n $customer_arr['billing_address_country'] =$value->billing_address->country;\n $customer_arr['billing_address_company'] =$value->billing_address->company;\n $customer_arr['billing_address_latitude'] =$value->billing_address->latitude;\n $customer_arr['billing_address_longitude'] =$value->billing_address->longitude;\n $customer_arr['billing_address_province_code'] =$value->billing_address->province_code;\n $customer_arr['billing_address_country_code'] =$value->billing_address->country_code;\n $customer_arr['shipping_address_name'] = $value->shipping_address->name;\n $customer_arr['shipping_address_first_name'] = $value->shipping_address->first_name;\n $customer_arr['shipping_address_last_name'] = $value->shipping_address->last_name;\n $customer_arr['shipping_address_address1'] = $value->shipping_address->address1;\n $customer_arr['shipping_address_address2'] = $value->shipping_address->address2;\n $customer_arr['shipping_address_phone'] = $value->shipping_address->phone;\n $customer_arr['shipping_address_city'] = $value->shipping_address->city;\n $customer_arr['shipping_address_zip'] = $value->shipping_address->zip;\n $customer_arr['shipping_address_province'] = $value->shipping_address->province;\n $customer_arr['shipping_address_country'] = $value->shipping_address->country;\n $customer_arr['shipping_address_company'] = $value->shipping_address->company;\n $customer_arr['shipping_address_latitude'] = $value->shipping_address->latitude;\n $customer_arr['shipping_address_longitude'] = $value->shipping_address->longitude;\n $customer_arr['shipping_address_province_code'] = $value->shipping_address->province_code;\n $customer_arr['shipping_address_country_code'] = $value->shipping_address->country_code;\n $customer_arr['customer_id'] = $value->customer->id;\n $customer_arr['customer_email'] = $value->customer->email;\n $customer_arr['customer_first_name'] = $value->customer->first_name;\n $customer_arr['customer_last_name'] = $value->customer->last_name;\n $customer_arr['customer_total_spent'] = $value->customer->total_spent;\n $customer_arr['customer_last_order_id'] = $value->customer->last_order_id;\n $customer_arr['customer_phone'] = $value->customer->phone;\n $customer_arr['customer_tags'] = $value->customer->tags;\n $customer_arr['customer_last_order_name'] = $value->customer->last_order_name;\n $customer_arr['customer_currency'] = $value->customer->currency;\n $customer_arr['default_address_id'] = $value->customer->default_address->id;\n $customer_arr['default_address_customer_id'] = $value->customer->default_address->customer_id;\n $customer_arr['default_address_first_name'] = $value->customer->default_address->first_name;\n $customer_arr['default_address_last_name'] = $value->customer->default_address->last_name;\n $customer_arr['default_address_company'] = $value->customer->default_address->company;\n $customer_arr['default_address_address1'] = $value->customer->default_address->address1;\n $customer_arr['default_address_address2'] = $value->customer->default_address->address2;\n $customer_arr['default_address_city'] = $value->customer->default_address->city;\n $customer_arr['default_address_province'] = $value->customer->default_address->province;\n $customer_arr['default_address_country'] = $value->customer->default_address->country;\n $customer_arr['default_address_zip'] = $value->customer->default_address->zip;\n $customer_arr['default_address_phone'] = $value->customer->default_address->phone;\n $customer_arr['default_address_name'] = $value->customer->default_address->name;\n $customer_arr['default_address_province_code'] = $value->customer->default_address->province_code;\n $customer_arr['default_address_country_code'] = $value->customer->default_address->country_code;\n $customer_arr['default_address_country_name'] = $value->customer->default_address->country_name;\n\n\n return OrderCustomerDetails::insertGetId($customer_arr);\n\n }",
"public function save_temporary_order_id(Varien_Event_Observer $observer)\n {\n\t\t$helper = Mage::helper('iconnectsync');\t\t\n $order = $observer->getEvent()->getOrder(); \n\t $order->setTemporaryOrderId($helper->NewGuid()); \n }",
"function save_order_information($data){\n\t\t$this->db->insert($this->config->item('ems_payment_history','dbtables'),$data);\n\t\t$insert_id = $this->db->insert_id();\n\t\treturn $insert_id;\n\t}",
"public function save()\n {\n $sql = new Sql();\n\n $results = $sql->select(\n \"CALL sp_orders_save(:idorder, :idcart, :iduser, :idstatus, :idaddress, :vltotal)\",\n [\n ':idorder'=>$this->getidorder(),\n ':idcart'=>$this->getidcart(),\n ':iduser'=>$this->getiduser(),\n ':idstatus'=>$this->getidstatus(),\n ':idaddress'=>$this->getidaddress(),\n ':vltotal'=>$this->getvltotal()\n ]\n );\n\n if (count($results) > 0) {\n $this->setData($results[0]);\n }\n }",
"public function testSaveIdentDataToCustomer()\n {\n \n // no verification data on customer\n $customer = Mage::getModel('customer/customer')->load(1);\n $this->assertEquals(null, $customer->getPostidentVerificationData());\n \n // verification data on quote\n $quote = Mage::getModel('sales/quote')->load(2);\n $helperMock = $this->getHelperMock('postident/data', array(\n 'getQuote',\n 'getCustomer'\n )\n );\n $helperMock->expects($this->any())\n ->method('getQuote')\n ->will($this->returnValue($quote));\n \n $helperMock->expects($this->any())\n ->method('getCustomer')\n ->will($this->returnValue($customer));\n $this->replaceByMock('helper', 'postident/data', $helperMock);\n \n /**\n * No matter if parameters are null or not, the result \n * allways should be the same !\n * \n * \n */\n \n //test if customer and quote is given as parameter\n Mage::helper('postident/data')->saveIdentDataToCustomer($customer, $quote);\n $this->assertEquals(\n $quote->getPostidentVerificationData(),\n Mage::getModel('customer/customer')->load(1)->getPostidentVerificationData()\n );\n //test if only customer is given as parameter\n Mage::helper('postident/data')->saveIdentDataToCustomer($customer, null);\n $this->assertEquals(\n $quote->getPostidentVerificationData(),\n Mage::getModel('customer/customer')->load(1)->getPostidentVerificationData()\n );\n \n //test if only quote is given as parameter\n Mage::helper('postident/data')->saveIdentDataToCustomer(null, $quote);\n $this->assertEquals(\n $quote->getPostidentVerificationData(),\n Mage::getModel('customer/customer')->load(1)->getPostidentVerificationData()\n );\n \n //test if nothing is given as parameter\n Mage::helper('postident/data')->saveIdentDataToCustomer(null, null);\n $this->assertEquals(\n $quote->getPostidentVerificationData(),\n Mage::getModel('customer/customer')->load(1)->getPostidentVerificationData()\n );\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 }",
"public function insertOrder(Request $request){\n\n $invoice = new tblInvoices;\n\n $invoice->cust_id = $request->input('cust_id');\n $invoice->amount = $request->input('amount');\n $invoice->discount = $request->input('discount');\n $invoice->final_amount = $request->input('final_amount');\n $invoice->branch_id = $request->input('branch_id');\n $invoice->offer_id - $request->input('offer_id');\n\n\n $invoice->save();\n $invoice->id;\n\n $insertedId = $invoice->id;\n\n $order = new tblOrder;\n $order->all->branch_id = $request->input('branch_id');\n $order->all->cust_id = $request->input('cust_id');\n $order->all->invoice_id = $insertedId;\n $order->item_name = $request->\n $order -> save();\n }",
"public function onCheckoutSaveOrder()\n {\n $order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();\n $order = Mage::getModel('sales/order')->loadByIncrementId($order_id);\n\n $this->clearAbandonment($order);\n $this->subscribeDuringCheckout($order);\n }"
] | [
"0.6548253",
"0.6534452",
"0.625877",
"0.6206583",
"0.6163551",
"0.6133944",
"0.6111372",
"0.6100383",
"0.60627747",
"0.60495",
"0.60291576",
"0.59329224",
"0.5926883",
"0.59221417",
"0.59219086",
"0.59196496",
"0.59079766",
"0.5906571",
"0.5895255",
"0.5869619",
"0.58536214",
"0.5849446",
"0.5826278",
"0.5808301",
"0.5792551",
"0.57902604",
"0.5771754",
"0.57493794",
"0.5725525",
"0.57203263"
] | 0.6608938 | 0 |
add address template to billing step | public function appendAddressDataToBillingStep($observer)
{
if( false === Mage::getModel('postident/config')->isEnabled()
|| false === Mage::getModel('postident/config')->getAddressDataUsage()) {
return;
}
if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Billing
&& false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Billing
) {
$transport = $observer->getTransport();
$block = $observer->getBlock();
$layout = $block->getLayout();
$html = $transport->getHtml();
$addAddressTemplateHtml = $layout->createBlock(
'postident/checkout_onepage_billing', 'postident_onepage_billing')
->renderView();
$html = $html . $addAddressTemplateHtml;
$transport->setHtml($html);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de envío</p>\r\n ';\r\n \r\n }\r\n return $field;\r\n}",
"function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}",
"public function appendAddressDataToShippingStep($observer)\n {\n if( false === Mage::getModel('postident/config')->isEnabled()\n || false === Mage::getModel('postident/config')->getAddressDataUsage()) {\n return;\n }\n \n if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Shipping\n && false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Shipping\n ) {\n $transport = $observer->getTransport();\n $block = $observer->getBlock();\n $layout = $block->getLayout();\n $html = $transport->getHtml();\n $addAddressTemplateHtml = $layout->createBlock(\n 'postident/checkout_onepage_shipping', 'postident_onepage_billing')\n ->renderView();\n $html = $html . $addAddressTemplateHtml;\n $transport->setHtml($html);\n }\n }",
"private function addAddress($options)\n {\n $address = $options['billing_address']\n ?: $options['address'];\n\n $this->post['card']['address_line1'] = $address['address1'];\n $this->post['card']['address_line2'] = $address['address2'];\n $this->post['card']['address_city'] = $address['city'];\n $this->post['card']['address_postcode'] = $address['zip'];\n $this->post['card']['address_state'] = $address['state'];\n $this->post['card']['address_country'] = $address['country'];\n }",
"function addAddressBookEntry($customer_id, $address_question_arr, $make_default = false) {\n // first get the zone id's from the 2 digit iso codes\n // country first\n $country_query = tep_db_query('SELECT countries_id, address_format_id\n FROM ' . TABLE_COUNTRIES . '\n WHERE countries_name = \\'' . $address_question_arr['country'] . '\\'\n LIMIT 1');\n\n // see if we found a record, if not default to American format\n if (tep_db_num_rows($country_query) > 0) {\n $country = tep_db_fetch_array($country_query);\n // grab the country id and address format\n $country_id = $country['countries_id'];\n $address_format_id = $country['address_format_id'];\n } else {\n // default\n $country_id = '223';\n $address_format_id = '2'; //2 is the American format\n }\n\n // see if the country code has a state\n $country_zone_check_query = tep_db_query('SELECT zone_country_id\n FROM ' . TABLE_ZONES . '\n WHERE zone_country_id = \\'' . $country_id . '\\'\n LIMIT 1');\n if (tep_db_num_rows($country_zone_check_query) > 0) {\n $check_zone = true;\n } else {\n $check_zone = false;\n }\n\n // now try and find the zone_id (state/province code)\n // use the country id above\n if ($check_zone) {\n $zone_query = tep_db_query('SELECT zone_id\n FROM ' . TABLE_ZONES . '\n WHERE zone_country_id = \\'' . $country_id . '\\' AND\n zone_code = \\'' . $address_question_arr['state'] . '\\'\n LIMIT 1');\n if (tep_db_num_rows($zone_query) > 0) {\n // grab the id\n $zone = tep_db_fetch_array($zone_query);\n $zone_id = $zone['zone_id'];\n } else {\n $check_zone = false;\n }\n }\n\n // now run the insert\n // this isnt the best way but it will get the majority of cases\n list($fname, $lname) = explode(' ', $address_question_arr['name']);\n if ($check_zone) {\n tep_db_query('INSERT INTO ' . TABLE_ADDRESS_BOOK . '\n (address_book_id, customers_id, entry_gender, entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_postcode, entry_city, entry_country_id,\n entry_zone_id)\n VALUES\n (NULL, \\'' . $customer_id . '\\', \\'\\', \\'' . $fname . '\\', \\'' . $lname . '\\',\n \\'' . $address_question_arr['street_address'] . '\\', \\'' . $address_question_arr['suburb'] . '\\',\n \\'' . $address_question_arr['postcode'] . '\\', \\'' . $address_question_arr['city'] . '\\',\n \\'' . $country_id . '\\', \\'' . $zone_id . '\\')');\n } else {\n tep_db_query('INSERT INTO ' . TABLE_ADDRESS_BOOK . '\n (address_book_id, customers_id, entry_gender, entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_postcode, entry_city, entry_country_id)\n VALUES\n (NULL, \\'' . $customer_id . '\\', \\'\\', \\'' . $fname . '\\', \\'' . $lname . '\\',\n \\'' . $address_question_arr['street_address'] . '\\', \\'' . $address_question_arr['suburb'] . '\\',\n \\'' . $address_question_arr['postcode'] . '\\', \\'' . $address_question_arr['city'] . '\\',\n \\'' . $country_id . '\\')');\n }\n $address_book_id = tep_db_insert_id();\n\n // make default if set, update\n if ($make_default) {\n tep_db_query('UPDATE '. TABLE_CUSTOMERS . '\n SET customers_default_address_id = \\'' . $address_book_id . '\\'\n WHERE customers_id = \\'' . $customer_id . '\\'');\n $_SESSION['customer_default_address_id'] = $address_book_id;\n }\n\n // set the sendto\n $_SESSION['sendto'] = $address_book_id;\n\n // return the address_id\n return $address_book_id;\n }",
"public function addAddress()\r\n {\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n # Community after 1.4.1.0 and Enterprise\r\n $salesFlatOrderAddress = $this->_helper()->getSql()->getTable('sales_flat_order_address');\r\n $this->getSelect()\r\n ->joinLeft(array('flat_order_addr_ship' => $salesFlatOrderAddress), \"flat_order_addr_ship.parent_id = main_table.entity_id AND flat_order_addr_ship.address_type = 'shipping'\", array())\r\n ->joinLeft(array('flat_order_addr_bill' => $salesFlatOrderAddress), \"flat_order_addr_bill.parent_id = main_table.entity_id AND flat_order_addr_bill.address_type = 'billing'\", array())\r\n ->columns(array('country_id' => 'IFNULL(flat_order_addr_ship.country_id, flat_order_addr_bill.country_id)'))\r\n ->group('country_id');\r\n } else {\r\n # Old Community\r\n $entityValue = $this->_helper()->getSql()->getTable('sales_order_entity_varchar');\r\n $entityAtribute = $this->_helper()->getSql()->getTable('eav_attribute');\r\n $entityType = $this->_helper()->getSql()->getTable('eav_entity_type');\r\n $orderEntity = $this->_helper()->getSql()->getTable('sales_order_entity');\r\n\r\n $this->getSelect()\r\n ->joinLeft(array('_eavType' => $entityType), \"_eavType.entity_type_code = 'order_address'\", array())\r\n ->joinLeft(array('_addrTypeAttr' => $entityAtribute), \"_addrTypeAttr.entity_type_id = _eavType.entity_type_id AND _addrTypeAttr.attribute_code = 'address_type'\", array())\r\n ->joinLeft(array('_addrValueAttr' => $entityAtribute), \"_addrValueAttr.entity_type_id = _eavType.entity_type_id AND _addrValueAttr.attribute_code = 'country_id'\", array())\r\n\r\n # Shipping values\r\n ->joinRight(array('_orderEntity_ship' => $orderEntity), \"_orderEntity_ship.entity_type_id = _eavType.entity_type_id AND _orderEntity_ship.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_ship' => $entityValue), \"_addrTypeVal_ship.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_ship.entity_id = _orderEntity_ship.entity_id AND _addrTypeVal_ship.value = 'shipping'\", array())\r\n ->joinRight(array('_addrCountryVal_ship' => $entityValue), \"_addrCountryVal_ship.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_ship.entity_id = _orderEntity_ship.entity_id\", array())\r\n\r\n # Billing values\r\n ->joinRight(array('_orderEntity_bill' => $orderEntity), \"_orderEntity_bill.entity_type_id = _eavType.entity_type_id AND _orderEntity_bill.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_bill' => $entityValue), \"_addrTypeVal_bill.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_bill.entity_id = _orderEntity_bill.entity_id AND _addrTypeVal_bill.value = 'billing'\", array())\r\n ->joinRight(array('_addrCountryVal_bill' => $entityValue), \"_addrCountryVal_bill.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_bill.entity_id = _orderEntity_bill.entity_id\", array())\r\n\r\n ->columns(array('country_id' => 'IFNULL(_addrCountryVal_ship.value, _addrCountryVal_bill.value)'))\r\n ->group('country_id');\r\n }\r\n return $this;\r\n }",
"function edd_stripe_setup_billing_address_fields() {\n\n\tif( ! function_exists( 'edd_use_taxes' ) ) {\n\t\treturn;\n\t}\n\n\tif( edd_use_taxes() || 'stripe' !== edd_get_chosen_gateway() || ! edd_get_cart_total() > 0 ) {\n\t\treturn;\n\t}\n\n\t$display = edd_get_option( 'stripe_billing_fields', 'full' );\n\n\tswitch( $display ) {\n\n\t\tcase 'full' :\n\n\t\t\t// Make address fields required\n\t\t\tadd_filter( 'edd_require_billing_address', '__return_true' );\n\n\t\t\tbreak;\n\n\t\tcase 'zip_country' :\n\n\t\t\tremove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 );\n\t\t\tadd_action( 'edd_after_cc_fields', 'edd_stripe_zip_and_country', 9 );\n\n\t\t\t// Make Zip required\n\t\t\tadd_filter( 'edd_purchase_form_required_fields', 'edd_stripe_require_zip_and_country' );\n\n\t\t\tbreak;\n\n\t\tcase 'none' :\n\n\t\t\tremove_action( 'edd_after_cc_fields', 'edd_default_cc_address_fields', 10 );\n\n\t\t\tbreak;\n\n\t}\n\n}",
"public function idc_authnet_add_address($customer_payment_profile, $fields, $line) {\r\n\t\tglobal $avs;\r\n\t\t// if AVS (Address verification system) is turned on, add address in billing\r\n\t\tif (isset($avs) && $avs) {\r\n\t\t\t// echo \"fields: \"; print_r($fields); echo \"\\n\";\r\n\t\t\tforeach ($fields as $field) {\r\n\t\t\t\t// Address 1 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_1\") {\r\n\t\t\t\t\t$idc_address_1 = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Address 2 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_2\") {\r\n\t\t\t\t\tif (!empty($field['value'])) {\r\n\t\t\t\t\t\t$idc_address_2 = sanitize_text_field($field['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// State field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_city\") {\r\n\t\t\t\t\t$idc_address_city = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// City field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_state\") {\r\n\t\t\t\t\t$idc_address_state = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Zip code field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_zip_code\") {\r\n\t\t\t\t\t$idc_address_zip_code = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$address_1 = apply_filters('idc_authnet_address_1_filter', $idc_address_1);\r\n\t\t\t$address_2 = apply_filters('idc_authnet_address_2_filter', ((isset($idc_address_2)) ? $idc_address_2 : ''));\r\n\t\t\t$address_city = apply_filters('idc_authnet_address_city_filter', $idc_address_city);\r\n\t\t\t$address_state = apply_filters('idc_authnet_address_state_filter', $idc_address_state);\r\n\t\t\t$address_zip_code = apply_filters('idc_authnet_address_zip_code_filter', $idc_address_zip_code);\r\n\r\n\t\t\t// Adding it to payment_profile\r\n\t\t\t$customer_payment_profile->billTo->address = $address_1 . \" \" . $address_2;\r\n\t\t\t$customer_payment_profile->billTo->city = $address_city;\r\n\t\t\t$customer_payment_profile->billTo->state = $address_state;\r\n\t\t\t$customer_payment_profile->billTo->zip = $address_zip_code;\r\n\r\n\t\t\tunset ($customer_payment_profile->payment->bankAccount);\r\n\t\t}\r\n\t\t// echo \"customer_payment_profile: \"; print_r($customer_payment_profile); echo \"\\n\";\r\n\r\n\t\treturn $customer_payment_profile;\r\n\t}",
"function address_shortcode() {\n ob_start();\n get_template_part('address');\n return ob_get_clean();\n}",
"function default_template_shipping ()\r\n{\r\n$template = '\r\n{shipping_content alias=$shipping_alias}\r\n';\r\nreturn $template;\r\n}",
"public function setBillingAddressAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n $billingAddressModel = $customerModel->getBilling();\n\n $billingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($billingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['billingAddressId' => $billingAddressModel->getId()]);\n }",
"protected function _toHtml()\n {\n $addressType = $this->getType() ? $this->getType() : 'billing';\n $isGuest = $this->getIsGuest();\n\n /** @var $formXmlObj Mage_XmlConnect_Model_Simplexml_Form */\n $formXmlObj = Mage::getModel('xmlconnect/simplexml_form', array(\n 'xml_id' => $addressType, 'action' => '', 'use_container' => true\n ))->setFieldNameSuffix($addressType);\n\n /** @var $formFieldset Mage_XmlConnect_Model_Simplexml_Form_Element_Fieldset */\n $formFieldset = $formXmlObj->addFieldset($addressType);\n\n $formFieldset->addField('firstname', 'text', array(\n 'name' => 'firstname', 'label' => $this->__('First Name'), 'required' => '1'\n ));\n\n $formFieldset->addField('lastname', 'text', array(\n 'name' => 'lastname', 'label' => $this->__('Last Name'), 'required' => '1'\n ));\n\n $formFieldset->addField('company', 'text', array(\n 'name' => 'company', 'label' => $this->__('Company'), 'required' => '1'\n ));\n\n if ($isGuest) {\n $emailField = $formFieldset->addField('email', 'text', array(\n 'name' => 'email', 'label' => $this->__('Email Address'), 'required' => '1'\n ));\n $emailValidator = $emailField->addValidator();\n $emailValidator->addRule(array('type' => 'email'));\n }\n\n $formFieldset->addField('street', 'text', array(\n 'name' => 'street[]',\n 'label' => $this->__('Address'),\n 'required' => '1',\n ));\n\n $formFieldset->addField('street_2', 'text', array(\n 'name' => 'street[]', 'label' => $this->__('Address 2')\n ));\n\n $formFieldset->addField('city', 'text', array(\n 'name' => 'city', 'label' => $this->__('City'), 'required' => '1'\n ));\n\n $formFieldset->addField('country_id', 'countryListSelect', array(\n 'name' => 'country_id', 'label' => $this->__('Country'), 'required' => '1',\n ));\n\n $formFieldset->addField('postcode', 'text', array(\n 'name' => 'postcode', 'label' => $this->__('Zip/Postal Code'), 'required' => '1'\n ));\n\n $formFieldset->addField('telephone', 'text', array(\n 'name' => 'telephone', 'label' => $this->__('Telephone'), 'required' => '1'\n ));\n\n $formFieldset->addField('fax', 'text', array('name' => 'fax', 'label' => $this->__('Fax')));\n\n // Add custom address attributes\n Mage::helper('xmlconnect/customer_form_renderer')->setAttributesBlockName('customer_address')\n ->setFormCode('customer_register_address')->setBlockEntity(Mage::getModel('sales/quote_address'))\n ->setBlockEntityType('customer_address')\n ->addCustomAttributes($formFieldset, $this->getLayout(), $addressType);\n\n $formFieldset->addField('save_in_address_book', 'checkbox', array(\n 'name' => 'save_in_address_book', 'label' => $this->__('Save in address book')\n ));\n\n return $formXmlObj->toXmlObject();\n }",
"protected function processBillingAddress()\n {\n\n // Unlike in shipping address, on billing address there is a lot of different billing forms.\n // Each of these forms must be processed.\n foreach ($this->paymentsList as &$payment) {\n foreach ($this->fieldsConfig as $fieldName => $config) {\n if (!isset($payment['children']['form-fields'])) {\n continue;\n }\n\n if ('region' === $fieldName || 'region_id' === $fieldName) {\n $payment = $this->copyRegionLayoutFromShippingAddress($payment, $fieldName);\n }\n\n $field = &$payment['children']['form-fields']['children'][$fieldName];\n $this->configureField($field, 'billingAddress', $config);\n\n if ('street' === $fieldName) {\n $this->updateStreetFields($field, 'billingAddress');\n }\n }\n unset($payment['children']['form-fields']['children']['region_id']);\n }\n }",
"public function billing()\n {\n\n //this is a good time to calc shippable items as the nbext screen will be for a shipping address\n $this->count_shippable_items();\n\n\n //customer is stil step 0\n $this->is_step(1) OR redirect( NC_ROUTE.'/checkout/');\n\n $this->load->helper('nitrocart/nitrocart_zone');\n $this->load->model('nitrocart/addresses_m');\n $data = new ViewObject();\n\n $this->form_validation->set_rules('useragreement', 'User Agreement', 'required|numeric|trim');\n\n\n // Initi the data\n foreach ($this->addresses_m->address_validation AS $rule)\n {\n $data->{$rule['field']} = $this->input->post($rule['field']);\n }\n\n $data->addresses = [];\n\n // if logged in get some fields from our profile\n if ($this->current_user)\n {\n $data = $this->get_existing_address('billing');\n }\n\n\n\n // Existing Adress\n if($this->input->post('selection') == 'existing')\n {\n $this->form_validation->set_rules('address_id', 'Address', 'required|numeric|trim');\n \n if ($this->form_validation->run())\n {\n\n $this->session->set_userdata('billing', $this->input->post('address_id'));\n\n if ($this->input->post('sameforshipping'))\n {\n\n $address_id = $this->input->post('address_id');\n\n if($this->validate_country_list_by_address_id( $address_id ))\n {\n //update this row to allow for shipping\n $this->addresses_m->doShippingAlso( $this->input->post('address_id') );\n //$this->session->set_userdata('shipping', $this->input->post('address_id'));\n $this->set_shipping_address_id( $address_id );\n $this->set_step(3); //+2\n redirect( NC_ROUTE. '/checkout/shipment');\n }\n else\n {\n $this->session->set_flashdata(JSONStatus::Error,'This product can not be shipped to your location.');\n redirect( NC_ROUTE.'/cart');\n }\n\n\n }\n\n $this->set_step(2); \n redirect( NC_ROUTE.'/checkout/shipping');\n }\n }\n\n\n\n // New Adress\n if($this->input->post('selection') == 'new')\n {\n\n $this->form_validation->set_rules( $this->addresses_m->address_validation );\n $this->form_validation->set_rules('state', 'State', 'callback_country_state_check');\n\n if ($this->form_validation->run())\n {\n $input = $this->input->post();\n $input['user_id'] = $this->session->userdata('user_id');\n\n $same_for_shipping = ($this->input->post('sameforshipping'))?1:0;\n //add the new address, note this is for billing\n $address_id = $this->addresses_m->create($input, 1, $same_for_shipping );\n\n $this->session->set_userdata('billing', $address_id);\n\n if ($same_for_shipping)\n {\n\n if($this->validate_country_list_by_address_id( $address_id ))\n { \n //$this->session->set_userdata('shipping', $address_id);\n $this->set_shipping_address_id( $address_id );\n\n $this->set_step(3); //+2\n redirect( NC_ROUTE.'/checkout/shipment');\n }\n else\n {\n $this->session->set_flashdata(JSONStatus::Error,'This product can not be shipped to your location.');\n redirect( NC_ROUTE.'/cart'); \n }\n }\n else\n {\n $this->set_step(2); \n redirect(NC_ROUTE.'/checkout/shipping'); \n }\n }\n else\n {\n //recall info that was entered\n foreach ($this->addresses_m->address_validation AS $rule)\n {\n $data->{$rule['field']} = $this->input->post($rule['field']);\n } \n }\n }\n\n $this->set_step(1);\n\n $this->template\n ->title(Settings::get('shop_name'),'billing') \n ->set_breadcrumb('User Account',NC_ROUTE.'/checkout')\n ->set_breadcrumb('Billing')\n ->build($this->theme_layout_path .'address_billing', $data);\n }",
"private function addAddress($options)\n {\n if (!isset($options['address'])\n || !isset($options['billing_address'])\n ) {\n return false;\n }\n\n $address = isset($options['billing_address'])\n ? $options['billing_address']\n : $options['address'];\n\n $this->post['BillingStreet'] = isset($address['address1']) ? $address['address1'] : null;\n $this->post['BillingHouseNumber'] = isset($address['address2']) ? $address['address2'] : null;\n $this->post['BillingCity'] = isset($address['city']) ? $address['city'] : null;\n $this->post['BillingState'] = isset($address['state']) ? $address['state'] : null;\n $this->post['BillingPostCode'] = isset($address['zip']) ? $address['zip'] : null;\n }",
"public function save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}",
"private function register_place_fields() {\n\n $address_children = [\n 'street_01' => new \\Fieldmanager_Textfield( esc_html__( 'Street Address', 'pedestal' ), [\n 'name' => 'street_01',\n ] ),\n 'street_02' => new \\Fieldmanager_Textfield( esc_html__( 'Street Address (Line 2)', 'pedestal' ), [\n 'name' => 'street_02',\n ] ),\n 'po_box' => new \\Fieldmanager_Textfield( esc_html__( 'P.O. Box Number', 'pedestal' ), [\n 'name' => 'po_box',\n 'description' => esc_html__( 'Include number only (no \"P.O.\" needed).', 'pedestal' ),\n ] ),\n 'postal_code' => new \\Fieldmanager_Textfield( esc_html__( 'Postal Code', 'pedestal' ), [\n 'name' => 'postal_code',\n ] ),\n ];\n $address = new \\Fieldmanager_Group( false, [\n 'name' => 'place_address',\n 'children' => $address_children,\n 'description' => esc_html__( 'Street address only. City info is entered in the Locality box below.', 'pedestal' ),\n 'serialize_data' => false,\n ] );\n\n $address->add_meta_box( esc_html__( 'Street Address', 'pedestal' ), [ 'pedestal_place' ], 'normal', 'high' );\n\n }",
"private function _addBillingElement($order)\n {\n $billingAddress = $order->addChild('billingAddress');\n $this->_addAddressElement(\n $billingAddress,\n $this->billingAddress['firstName'],\n $this->billingAddress['lastName'],\n $this->billingAddress['street'],\n $this->billingAddress['postalCode'],\n $this->billingAddress['city'],\n $this->billingAddress['countryCode']\n );\n }",
"public function getNewAddress($account = null);",
"function add_address() {\n\t\t //$mailchimpform = mailchimpSF_signup_form();\n $cont .= '<span class=\"logo-address\">507 Kent Street, Utica, NY 13501 | (315) 797-2233 toll free (877) 719-9996</span>';\n\t \n\t echo $cont;\n }",
"public function addAddress($address);",
"public function updateCustomerAddressAction() {\n if(!Mage::app()->getRequest()->isAjax()){\n $this->norouteAction();\n exit;\n }\n\n $postData = $this->getRequest()->getPost();\n parse_str($postData['form'], $billing);\n\n $customer = $this->_getCustomer();\n\n $address = new Varien_Object();\n $address->addData(\n array(\n 'state' => $billing['state'],\n 'city' => $billing['city'],\n 'street' => $billing['street'],\n 'zip_code' => $billing['zipcode'],\n 'firstname' => $billing['firstname'],\n 'lastname' => $billing['lastname'],\n 'telephone' => $billing['telephone'],\n 'phone_number' => $billing['telephone'],\n 'country_code' => $billing['country_id'],\n )\n );\n\n $response = Mage::getModel(\"payments/api\")->updateBilling($customer->getId(), $address);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('token' => $response)));\n }",
"function edd_stripe_update_billing_address_field() {\n\t$payment_mode = strtolower( edd_get_chosen_gateway() );\n\tif ( edd_is_checkout() && 'stripe' !== $payment_mode ) {\n\t\treturn;\n\t}\n\n\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\tif ( empty( $existing_cards ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! did_action( 'edd_stripe_cc_form' ) ) {\n\t\treturn;\n\t}\n\n\t$default_card = false;\n\n\tforeach ( $existing_cards as $existing_card ) {\n\t\tif ( $existing_card['default'] ) {\n\t\t\t$default_card = $existing_card['source'];\n\t\t\tbreak;\n\t\t}\n\t}\n\t?>\n\t<p class=\"edd-stripe-update-billing-address-current\">\n\t\t<?php\n\t\tif ( $default_card ) :\n\t\t\t$address_fields = array( \n\t\t\t\t'line1' => isset( $default_card->address_line1 ) ? $default_card->address_line1 : null,\n\t\t\t\t'line2' => isset( $default_card->address_line2 ) ? $default_card->address_line2 : null,\n\t\t\t\t'city' => isset( $default_card->address_city ) ? $default_card->address_city : null,\n\t\t\t\t'state' => isset( $default_card->address_state ) ? $default_card->address_state : null,\n\t\t\t\t'zip' => isset( $default_card->address_zip ) ? $default_card->address_zip : null,\n\t\t\t\t'country' => isset( $default_card->address_country ) ? $default_card->address_country : null,\n\t\t\t);\n\n\t\t\t$address_fields = array_filter( $address_fields );\n\n\t\t\techo esc_html( implode( ', ', $address_fields ) );\n\t\tendif;\n\t\t?>\n\t</p>\n\n\t<p class=\"edd-stripe-update-billing-address-wrapper\">\n\t\t<input type=\"checkbox\" name=\"edd_stripe_update_billing_address\" id=\"edd-stripe-update-billing-address\" value=\"1\" />\n\t\t<label for=\"edd-stripe-update-billing-address\"><?php _e( 'Enter new billing address', 'edds' ); ?></label>\n\t</p>\n\t<?php\n}",
"public function getBillingAddress();",
"public function getBillingAddress();",
"public function addPickupOrderEmailTemplate()\n {\n $template = $this->templateFactory->create();\n $template->setTemplateCode('New Pickup Order');\n $template->setTemplateText($this->getEmailTemplate());\n $template->setTemplateType(TemplateTypesInterface::TYPE_HTML);\n $template->setTemplateSubject(\n '{{trans \"Your %store_name order confirmation\" store_name=$store.getFrontendName()}}'\n );\n $template->setOrigTemplateCode('sales_email_order_template');\n // @codingStandardsIgnoreLine\n $template->setOrigTemplateVariables('{\"var formattedBillingAddress|raw\":\"Billing Address\",\"var order.getEmailCustomerNote()\":\"Email Order Note\",\"var order.increment_id\":\"Order Id\",\"layout handle=\\\"sales_email_order_items\\\" order=$order area=\\\"frontend\\\"\":\"Order Items Grid\",\"var payment_html|raw\":\"Payment Details\",\"var formattedShippingAddress|raw\":\"Shipping Address\",\"var order.getShippingDescription()\":\"Shipping Description\",\"var shipping_msg\":\"Shipping message\"}');\n\n $this->templateResource->save($template);\n }",
"function give_default_cc_address_fields( $form_id ) {\n\t// Get user info.\n\t$give_user_info = _give_get_prefill_form_field_values( $form_id );\n\n\tob_start();\n\t?>\n\t<fieldset id=\"give_cc_address\" class=\"cc-address\">\n\t\t<legend><?php echo apply_filters( 'give_billing_details_fieldset_heading', esc_html__( 'Billing Details', 'give' ) ); ?></legend>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, before address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_top' );\n\n\t\t// For Country.\n\t\t$selected_country = give_get_country();\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\t\t$countries = give_get_country_list();\n\n\t\t// For state.\n\t\t$selected_state = '';\n\t\tif ( $selected_country === give_get_country() ) {\n\t\t\t// Get default selected state by admin.\n\t\t\t$selected_state = give_get_state();\n\t\t}\n\t\t// Get the last payment made by user states.\n\t\tif ( ! empty( $give_user_info['card_state'] ) && '*' !== $give_user_info['card_state'] ) {\n\t\t\t$selected_state = $give_user_info['card_state'];\n\t\t}\n\t\t// Get the country code.\n\t\tif ( ! empty( $give_user_info['billing_country'] ) && '*' !== $give_user_info['billing_country'] ) {\n\t\t\t$selected_country = $give_user_info['billing_country'];\n\t\t}\n\n\n\t\t// Get the country list that does not require city.\n\t\t$city_required = ! array_key_exists( $selected_country, give_city_not_required_country_list() );\n\n\t\t?>\n\t\t<p id=\"give-card-country-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"billing_country\" class=\"give-label\">\n\t\t\t\t<?php esc_html_e( 'Country', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'billing_country', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The country for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\n\t\t\t<select\n\t\t\t\tname=\"billing_country\"\n\t\t\t\tautocomplete=\"country\"\n\t\t\t\tid=\"billing_country\"\n\t\t\t\tclass=\"billing-country billing_country give-select<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'billing_country', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t>\n\t\t\t\t<?php\n\t\t\t\tforeach ( $countries as $country_code => $country ) {\n\t\t\t\t\techo '<option value=\"' . esc_attr( $country_code ) . '\"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 1', 'give' ); ?>\n\t\t\t\t<?php\n\t\t\t\tif ( give_field_is_required( 'card_address', $form_id ) ) :\n\t\t\t\t\t?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The primary billing address for your credit card.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address\"\n\t\t\t\tname=\"card_address\"\n\t\t\t\tautocomplete=\"address-line1\"\n\t\t\t\tclass=\"card-address give-input<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 1', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address'] ) ? $give_user_info['card_address'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-address-2-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_address_2\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Address 2', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_address_2', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( '(optional) The suite, apartment number, post office box (etc) associated with your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_address_2\"\n\t\t\t\tname=\"card_address_2\"\n\t\t\t\tautocomplete=\"address-line2\"\n\t\t\t\tclass=\"card-address-2 give-input<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Address line 2', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_address_2'] ) ? $give_user_info['card_address_2'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_address_2', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<p id=\"give-card-city-wrap\" class=\"form-row form-row-wide\">\n\t\t\t<label for=\"card_city\" class=\"give-label\">\n\t\t\t\t<?php _e( 'City', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_city', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator <?php echo( $city_required ? '' : 'give-hidden' ); ?>\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The city for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tid=\"card_city\"\n\t\t\t\tname=\"card_city\"\n\t\t\t\tautocomplete=\"address-level2\"\n\t\t\t\tclass=\"card-city give-input<?php echo( give_field_is_required( 'card_city', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'City', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo( isset( $give_user_info['card_city'] ) ? $give_user_info['card_city'] : '' ); ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_city', $form_id ) && $city_required ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\n\t\t<?php\n\t\t/**\n\t\t * State field logic.\n\t\t */\n\t\t$state_label = __( 'State', 'give' );\n\t\t$states_label = give_get_states_label();\n\t\t// Check if $country code exists in the array key for states label.\n\t\tif ( array_key_exists( $selected_country, $states_label ) ) {\n\t\t\t$state_label = $states_label[ $selected_country ];\n\t\t}\n\t\t$states = give_get_states( $selected_country );\n\t\t// Get the country list that do not have any states.\n\t\t$no_states_country = give_no_states_country_list();\n\t\t// Get the country list that does not require states.\n\t\t$states_not_required_country_list = give_states_not_required_country_list();\n\t\t// Used to determine if state is required.\n\t\t$require_state = ! array_key_exists( $selected_country, $no_states_country ) && give_field_is_required( 'card_state', $form_id );\n\t\t// Used to determine is state input should be marked as required.\n\t\t$validate_state = ! array_key_exists( $selected_country, $states_not_required_country_list ) && give_field_is_required( 'card_state', $form_id );\n\n\t\t?>\n\t\t<p id=\"give-card-state-wrap\"\n\t\t class=\"form-row form-row-first form-row-responsive <?php echo ( ! empty( $selected_country ) && ! $require_state ) ? 'give-hidden' : ''; ?> \">\n\t\t\t<label for=\"card_state\" class=\"give-label\">\n\t\t\t\t<span class=\"state-label-text\"><?php echo $state_label; ?></span>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"give-required-indicator <?php echo $validate_state ? '' : 'give-hidden'; ?> \">*</span>\n\t\t\t\t<span class=\"give-tooltip give-icon give-icon-question\"\n\t\t\t\t data-tooltip=\"<?php esc_attr_e( 'The state, province, or county for your billing address.', 'give' ); ?>\"></span>\n\t\t\t</label>\n\t\t\t<?php\n\n\t\t\tif ( ! empty( $states ) ) :\n\t\t\t\t?>\n\t\t\t\t<select\n\t\t\t\t\tname=\"card_state\"\n\t\t\t\t\tautocomplete=\"address-level1\"\n\t\t\t\t\tid=\"card_state\"\n\t\t\t\t\tclass=\"card_state give-select<?php echo $validate_state ? ' required' : ''; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>>\n\t\t\t\t\t<?php\n\t\t\t\t\tforeach ( $states as $state_code => $state ) {\n\t\t\t\t\t\techo '<option value=\"' . $state_code . '\"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t<?php else : ?>\n\t\t\t\t<input type=\"text\" size=\"6\" name=\"card_state\" id=\"card_state\" class=\"card_state give-input\"\n\t\t\t\t placeholder=\"<?php echo $state_label; ?>\" value=\"<?php echo $selected_state; ?>\"\n\t\t\t\t\t<?php echo $validate_state ? ' required aria-required=\"true\" ' : ''; ?>\n\t\t\t\t/>\n\t\t\t<?php endif; ?>\n\t\t</p>\n\n\t\t<p id=\"give-card-zip-wrap\" class=\"form-row <?php echo $require_state ? 'form-row-last' : ''; ?> form-row-responsive\">\n\t\t\t<label for=\"card_zip\" class=\"give-label\">\n\t\t\t\t<?php _e( 'Zip / Postal Code', 'give' ); ?>\n\t\t\t\t<?php if ( give_field_is_required( 'card_zip', $form_id ) ) : ?>\n\t\t\t\t\t<span class=\"give-required-indicator\">*</span>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t<?php echo Give()->tooltips->render_help( __( 'The zip or postal code for your billing address.', 'give' ) ); ?>\n\t\t\t</label>\n\n\t\t\t<input\n\t\t\t\ttype=\"text\"\n\t\t\t\tsize=\"4\"\n\t\t\t\tid=\"card_zip\"\n\t\t\t\tname=\"card_zip\"\n\t\t\t\tautocomplete=\"postal-code\"\n\t\t\t\tclass=\"card-zip give-input<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required' : '' ); ?>\"\n\t\t\t\tplaceholder=\"<?php _e( 'Zip / Postal Code', 'give' ); ?>\"\n\t\t\t\tvalue=\"<?php echo isset( $give_user_info['card_zip'] ) ? $give_user_info['card_zip'] : ''; ?>\"\n\t\t\t\t<?php echo( give_field_is_required( 'card_zip', $form_id ) ? ' required aria-required=\"true\" ' : '' ); ?>\n\t\t\t/>\n\t\t</p>\n\t\t<?php\n\t\t/**\n\t\t * Fires while rendering credit card billing form, after address fields.\n\t\t *\n\t\t * @param int $form_id The form ID.\n\t\t *\n\t\t * @since 1.0\n\t\t *\n\t\t */\n\t\tdo_action( 'give_cc_billing_bottom' );\n\t\t?>\n\t</fieldset>\n\t<?php\n\techo ob_get_clean();\n}",
"public function addAddress($address, $name = '')\n {\n }",
"private function buildAddressFields()\n {\n /**\n * Check if WooCommerce is active\n */\n if (!Local::hasWooCommerce()) {\n return;\n }\n //====================================================================//\n // Customer Full Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"company_safe\")\n ->name(\"Customer Fullname\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Company\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"company\")\n ->name(__(\"Company\"))\n ->isReadOnly()\n ;\n //====================================================================//\n // Address 1\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_1\")\n ->name(__(\"Address line 1\"))\n ->microData(\"http://schema.org/PostalAddress\", \"streetAddress\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Address 2\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_2\")\n ->name(__(\"Address line 2\"))\n ->microData(\"http://schema.org/PostalAddress\", \"postOfficeBoxNumber\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Address Full\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"address_full\")\n ->name(__(\"Address line 1 & 2\"))\n ->microData(\"http://schema.org/PostalAddress\", \"alternateName\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Zip Code\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"postcode\")\n ->name(__(\"Postcode / ZIP\"))\n ->microData(\"http://schema.org/PostalAddress\", \"postalCode\")\n ->isReadOnly()\n ;\n //====================================================================//\n // City Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"city\")\n ->name(__(\"City\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressLocality\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country\")\n ->name(__(\"Country\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ->isReadOnly()\n ;\n //====================================================================//\n // State code\n $this->fieldsFactory()->create(SPL_T_STATE)\n ->identifier(\"state\")\n ->name(__(\"State / County\"))\n ->microData(\"http://schema.org/PostalAddress\", \"addressRegion\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Phone Pro\n $this->fieldsFactory()->create(SPL_T_PHONE)\n ->identifier(\"phone\")\n ->name(__(\"Phone\"))\n ->microData(\"http://schema.org/Person\", \"telephone\")\n ->isIndexed()\n ->isReadOnly()\n ;\n }",
"public function getBillingAddress() : Address;"
] | [
"0.68376",
"0.6243044",
"0.6204326",
"0.6124597",
"0.5990082",
"0.5962371",
"0.59493023",
"0.5938982",
"0.5904406",
"0.58969545",
"0.58705926",
"0.5829504",
"0.58080435",
"0.5777113",
"0.57673466",
"0.57512295",
"0.57440794",
"0.57407075",
"0.5728406",
"0.57063544",
"0.5698722",
"0.5651871",
"0.56516856",
"0.56458116",
"0.56458116",
"0.56253767",
"0.5606777",
"0.5582266",
"0.5580843",
"0.5565326"
] | 0.68225914 | 1 |
add address template to shipping step | public function appendAddressDataToShippingStep($observer)
{
if( false === Mage::getModel('postident/config')->isEnabled()
|| false === Mage::getModel('postident/config')->getAddressDataUsage()) {
return;
}
if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Shipping
&& false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Shipping
) {
$transport = $observer->getTransport();
$block = $observer->getBlock();
$layout = $block->getLayout();
$html = $transport->getHtml();
$addAddressTemplateHtml = $layout->createBlock(
'postident/checkout_onepage_shipping', 'postident_onepage_billing')
->renderView();
$html = $html . $addAddressTemplateHtml;
$transport->setHtml($html);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function default_template_shipping ()\r\n{\r\n$template = '\r\n{shipping_content alias=$shipping_alias}\r\n';\r\nreturn $template;\r\n}",
"public function appendAddressDataToBillingStep($observer)\n {\n if( false === Mage::getModel('postident/config')->isEnabled()\n || false === Mage::getModel('postident/config')->getAddressDataUsage()) {\n return;\n }\n \n if ($observer->getBlock() instanceof Mage_Checkout_Block_Onepage_Billing \n && false == $observer->getBlock() instanceof Mage_Paypal_Block_Express_Review_Billing\n ) {\n $transport = $observer->getTransport();\n $block = $observer->getBlock();\n $layout = $block->getLayout();\n $html = $transport->getHtml();\n $addAddressTemplateHtml = $layout->createBlock(\n 'postident/checkout_onepage_billing', 'postident_onepage_billing')\n ->renderView();\n $html = $html . $addAddressTemplateHtml;\n $transport->setHtml($html);\n }\n }",
"function custom_template_single_shipping()\n {\n global $product;\n ?>\n <span class=\"shipping-cs-tag\">\n <span>Shipping:</span>\n <span>Free</span>\n </span>\n <?php\n }",
"public function shipping()\n\t{\n\t\t\n\t\t$this->templateFileName = 'shipping.tpl';\n\t\t\n\t\t// Make sure there is something in the user's cart.\n\t\t$cartID = $this->session->cartID;\n\t\t\n\t\t$cart = $this->dbConnection->prepareRecordSet(\"SELECT * FROM b_cart WHERE cart_id = ? AND record_status = 'A'\", $cartID);\n\t\t\n\t\tif ( !$cart )\n\t\t{\n\t\t\t// There is nothing in the cart, so display an error message\n\t\t\t$errormessage = urlencode('There is nothing in your cart');\n\t\t\theader(\"Location: /cart?emsg={$errormessage}\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t// Get the list of shipping addresses to display on the page\n\t\t\t$addresses = $this->getAddresses();\n\t\t\t$this->set('addresses', $addresses);\n\t\t\t\n\t\t\t// Determine what to do based on user input\n\t\t\tif ( count($_POST) > 0 && isset($_POST['submit_shipping_address']) )\n\t\t\t{\n\t\t\t\t// A form was submitted, so handle the form input\n\t\t\t\t\n\t\t\t\tif (!isset($_POST['addressSelect']) || empty($_POST['addressSelect']))\n\t\t\t\t{\n\t\t\t\t\t$errors[] = 'Please select an address or create a new one.';\n\t\t\t\t}\n\t\t\t\telseif ( $_POST['addressSelect'] == 'new' )\n\t\t\t\t{\n\t\t\t\t\t// The user has selected to enter a new address\n\t\t\t\t\t// Make sure the address is complete\n\t\t\t\t\t\n\t\t\t\t\t$formComplete = true;\n\t\t\t\t\t\n\t\t\t\t\tif ( ! isset($_POST['address_name']) || empty($_POST['address_name']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['address_name'] = 'Address Name is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['address_1']) || empty($_POST['address_1']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['address_1'] = 'Address Line 1 is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['city']) || empty($_POST['city']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['city'] = 'City is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['state']) || empty($_POST['state']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['state'] = 'State is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isset($_POST['zip']) || empty($_POST['zip']) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$fieldErrors['zip'] = 'Zip is required';\n\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sanitized_zip = preg_replace('/\\D/', '', (string)$_POST['zip']);\n\t\t\t\t\t\t$zip_length = strlen($sanitized_zip);\n\t\t\t\t\t\tif ( $zip_length != 5 && $zip_length != 9 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$formComplete = false;\n\t\t\t\t\t\t\t$fieldErrors['zip'] = 'Zip must be 5 or 9 digits.';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($zip_length == 9)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_POST['zip'] = substr($sanitized_zip, 0, 5) . '-' . substr($sanitized_zip, 5, 4);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_POST['zip'] = $sanitized_zip;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($formComplete)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t// The form is complete, so create the record\n\t\t\t\t\t\t$insertSQL = \"INSERT INTO b_user_address (user_id, address_name, address_1, address_2, city, state, zip, record_status) \"\n\t\t\t\t\t\t . \"VALUES(?, ?, ?, ?, ?, ?, ?, 'A')\";\n\t\t\t\t\t\tif ( ! $this->dbConnection->prepareCommand($insertSQL, $this->session->userID, $_POST['address_name'], $_POST['address_1'], $_POST['address_2'], $_POST['city'], $_POST['state'], $_POST['zip']) )\n\t\t\t\t\t\t\t$errors[] = 'Error creating record. Please try again.';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// The record was successfully created, so set the shipping address ID and move on to the next step\n\t\t\t\t\t\t\t$this->session->shippingAddressID = $this->dbConnection->insert_id;\n\t\t\t\t\t\t\t// Have the address be automatically selected in the billing page\n\t\t\t\t\t\t\t$_POST['addressSelect'] = $this->dbConnection->insert_id;\n\t\t\t\t\t\t\t$this->__default();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->set('fieldErrors', $fieldErrors);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// The user selected an existing address for shipping\n\t\t\t\t\t// Verify it is a valid record ID\n\t\t\t\t\t$address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $_POST['addressSelect']);\n\t\t\t\t\tif (!$address)\n\t\t\t\t\t\t$errors[] = 'Error selecting address. This address does not exist.';\n\t\t\t\t\telseif ( $address['user_id'] != $this->session->userID )\n\t\t\t\t\t\t$errors[] = 'Error: The selected address is for a different user.';\n\t\t\t\t\telseif ( $address['record_status'] != 'A')\n\t\t\t\t\t\t$errors[] = 'Error: The selected address is not active.';\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// The address is valid, so use it.\n\t\t\t\t\t\t// set the shipping address and move on to the next step\n\t\t\t\t\t\t$this->session->shippingAddressID = $_POST['addressSelect'];\n\t\t\t\t\t\t$this->__default();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\n\t\t\t// Set address ID for output, so the field is pre-selected\n\t\t\tif ( $this->session->shippingAddressID )\n\t\t\t\t$this->set('addressSelect', $this->session->shippingAddressID);\n\n\n\t\t\t// Set all of the view data for post data so the form will be reloaded\n\t\t\tforeach ($_POST as $id => $val)\n\t\t\t{\n\t\t\t\t$this->set($id, $val);\n\t\t\t}\n\n\t\t\t// Set the error list for output\n\t\t\t$this->set('errors', $errors);\n\t\t\t\n\t\t\t\n\t\t\t// Get the list of state codes to output\n\t\t\t$states = $this->dbConnection->recordSet(\"SELECT short_description AS code, long_description AS name FROM b_value WHERE data_member = 'STATE' ORDER BY short_description\");\n\t\t\t$this->set('states', $states);\n\t\t\t\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}",
"function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de envío</p>\r\n ';\r\n \r\n }\r\n return $field;\r\n}",
"public function addAddress()\r\n {\r\n if ($this->_helper()->checkSalesVersion('1.4.0.0')) {\r\n # Community after 1.4.1.0 and Enterprise\r\n $salesFlatOrderAddress = $this->_helper()->getSql()->getTable('sales_flat_order_address');\r\n $this->getSelect()\r\n ->joinLeft(array('flat_order_addr_ship' => $salesFlatOrderAddress), \"flat_order_addr_ship.parent_id = main_table.entity_id AND flat_order_addr_ship.address_type = 'shipping'\", array())\r\n ->joinLeft(array('flat_order_addr_bill' => $salesFlatOrderAddress), \"flat_order_addr_bill.parent_id = main_table.entity_id AND flat_order_addr_bill.address_type = 'billing'\", array())\r\n ->columns(array('country_id' => 'IFNULL(flat_order_addr_ship.country_id, flat_order_addr_bill.country_id)'))\r\n ->group('country_id');\r\n } else {\r\n # Old Community\r\n $entityValue = $this->_helper()->getSql()->getTable('sales_order_entity_varchar');\r\n $entityAtribute = $this->_helper()->getSql()->getTable('eav_attribute');\r\n $entityType = $this->_helper()->getSql()->getTable('eav_entity_type');\r\n $orderEntity = $this->_helper()->getSql()->getTable('sales_order_entity');\r\n\r\n $this->getSelect()\r\n ->joinLeft(array('_eavType' => $entityType), \"_eavType.entity_type_code = 'order_address'\", array())\r\n ->joinLeft(array('_addrTypeAttr' => $entityAtribute), \"_addrTypeAttr.entity_type_id = _eavType.entity_type_id AND _addrTypeAttr.attribute_code = 'address_type'\", array())\r\n ->joinLeft(array('_addrValueAttr' => $entityAtribute), \"_addrValueAttr.entity_type_id = _eavType.entity_type_id AND _addrValueAttr.attribute_code = 'country_id'\", array())\r\n\r\n # Shipping values\r\n ->joinRight(array('_orderEntity_ship' => $orderEntity), \"_orderEntity_ship.entity_type_id = _eavType.entity_type_id AND _orderEntity_ship.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_ship' => $entityValue), \"_addrTypeVal_ship.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_ship.entity_id = _orderEntity_ship.entity_id AND _addrTypeVal_ship.value = 'shipping'\", array())\r\n ->joinRight(array('_addrCountryVal_ship' => $entityValue), \"_addrCountryVal_ship.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_ship.entity_id = _orderEntity_ship.entity_id\", array())\r\n\r\n # Billing values\r\n ->joinRight(array('_orderEntity_bill' => $orderEntity), \"_orderEntity_bill.entity_type_id = _eavType.entity_type_id AND _orderEntity_bill.parent_id = e.entity_id\", array())\r\n ->joinRight(array('_addrTypeVal_bill' => $entityValue), \"_addrTypeVal_bill.attribute_id = _addrTypeAttr.attribute_id AND _addrTypeVal_bill.entity_id = _orderEntity_bill.entity_id AND _addrTypeVal_bill.value = 'billing'\", array())\r\n ->joinRight(array('_addrCountryVal_bill' => $entityValue), \"_addrCountryVal_bill.attribute_id = _addrValueAttr.attribute_id AND _addrCountryVal_bill.entity_id = _orderEntity_bill.entity_id\", array())\r\n\r\n ->columns(array('country_id' => 'IFNULL(_addrCountryVal_ship.value, _addrCountryVal_bill.value)'))\r\n ->group('country_id');\r\n }\r\n return $this;\r\n }",
"public function save_addressAction() {\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\t$shipping_data = $this->getRequest()->getPost('shipping', false);\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', false);\r\n\t\t$billing_address_id = $this->getRequest()->getPost('billing_address_id', false);\t\r\n\t\t\r\n\t\t//load default data for disabled fields\r\n\t\tif (Mage::helper('onestepcheckout')->isUseDefaultDataforDisabledFields()) {\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($billing_data);\r\n\t\t\tMage::helper('onestepcheckout')->setDefaultDataforDisabledFields($shipping_data);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($billing_data['use_for_shipping']) && $billing_data['use_for_shipping'] == '1') {\r\n\t\t\t$shipping_address_data = $billing_data;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$shipping_address_data = $shipping_data;\r\n\t\t}\r\n\t\t\r\n\t\t$billing_street = trim(implode(\"\\n\", $billing_data['street']));\r\n\t\t$shipping_street = trim(implode(\"\\n\", $shipping_address_data['street']));\r\n\t\t\r\n\t\tif(isset($billing_data['email'])) {\r\n\t\t\t$billing_data['email'] = trim($billing_data['email']);\r\n\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t// Ignore disable fields validation --- Only for 1..4.1.1\r\n\t\t$this->setIgnoreValidation();\r\n\t\tif(Mage::helper('onestepcheckout')->isShowShippingAddress()) {\r\n\t\t\tif(!isset($billing_data['use_for_shipping']) || $billing_data['use_for_shipping'] != '1')\t{\t\t\r\n\t\t\t\t$shipping_address_id = $this->getRequest()->getPost('shipping_address_id', false);\r\n\t\t\t\t$this->getOnepage()->saveShipping($shipping_data, $shipping_address_id);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getOnepage()->saveBilling($billing_data, $billing_address_id);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t//var_dump($billing_data['country_id']);die();\r\n\t\t//Mage::getModel('core/session')->setData('country',$billing_data['country_id']);\r\n\t\t// if different shipping address is enabled and customer ship to another address, save it\r\n\t\t\r\n\t\t\r\n\t\tif ($shipping_method && $shipping_method != '') {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t}\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\t\r\n\t}",
"public function addShippingAddress($shiptoname, $shiptostreet, $shiptocity, $shiptostate, $shiptozip, $shiptocountrycode, $shiptophonenum = null)\n\t{\n\t\t$address = func_get_args();\n\n\t\t// Validate fields\n\t\tif (strlen($shiptoname) > 32) throw new PayPalException('Shipping address name cannot exceed 32 characters!');\n\t\tif (strlen($shiptostreet) > 200) throw new PayPalException('Shipping street address cannot exceed 200 characters!');\n\t\telse if (strlen($shiptostreet) > 100) {\n\t\t\t$words = explode(\" \", $shiptostreet);\n\t\t\t$address['shiptostreet'] = \"\";\n\t\t\twhile(strlen($address['shiptostreet']) < 100 && $words) $address['shiptostreet'] += array_shift($words) . \" \";\n\t\t\tif ($words) $address['shiptostreet2'] = implode(\" \", $words);\n\t\t}\n\t\tif (strlen($shiptocity) > 40) throw new PayPalException('Shipping address city cannot exceed 40 characters!');\n\t\tif (strlen($shiptozip) > 20) throw new PayPalException('Shipping address postal code/ZIP cannot exceed 20 characters!');\n\t\tif (strlen($shiptocountrycode) > 2) throw new PayPalException('Shipping address country must be a 2 character code!');\n\t\tif ($shiptophonenum && strlen($shiptophonenum) > 20) throw new PayPalException('Shipping address phone number cannot exceed 20 characters!');\n\t\telse if (is_null($shiptophonenum)) unset($address['shiptophonenum']);\n\n\t\t$this->_payment_fields = array_merge($this->_payment_fields, compact('shiptoname', 'shiptostreet', 'shiptocity', 'shiptostate', 'shiptozip', 'shiptocountrycode', 'shiptophonenum'));\n\t\t$this->addroverride = 1;\n\t}",
"function ShipToAddress()\r\n\t{\r\n\t\r\n\t}",
"private function _generateShippingAddressData(){\n \n $address = new PagSeguroAddress();\n $delivery_address = new Address($this->context->cart->id_address_delivery);\n \n if (!is_null($delivery_address)){\n $address->setCity($delivery_address->city);\n $address->setPostalCode($delivery_address->postcode);\n $address->setStreet($delivery_address->address1);\n $address->setDistrict($delivery_address->address2);\n $address->setComplement($delivery_address->other);\n $address->setCity($delivery_address->city);\n \n $country = new Country($delivery_address->id_country);\n $address->setCountry($country->iso_code);\n \n $state = new State($delivery_address->id_state);\n $address->setState($state->iso_code);\n }\n \n return $address;\n }",
"public function create()\n {\n return view(\"admin.shipping-management.create-shipping\",[\"shipping\" => false]);\n \n }",
"private function _addShippingElement($order)\n {\n $shippingAddress = $order->addChild('shippingAddress');\n $this->_addAddressElement(\n $shippingAddress,\n $this->shippingAddress['firstName'],\n $this->shippingAddress['lastName'],\n $this->shippingAddress['street'],\n $this->shippingAddress['postalCode'],\n $this->shippingAddress['city'],\n $this->shippingAddress['countryCode']\n );\n }",
"public function setShippingAddressAction()\n {\n $data = $this->Request()->getParams();\n //we need to set this because of a bug in the shopware models\n if (!isset($data['stateId'])) {\n $data['stateId'] = 0;\n }\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n if ($shippingAddressModel = $customerModel->getShipping()) {\n $shippingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($shippingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['shippingAddressId' => $shippingAddressModel->getId()]);\n }\n }",
"public function create()\n {\n $shippingAddress = Sentinel::getUser()->shippingAddress()->first();\n return view('frontend.place-order', compact('shippingAddress'));\n }",
"function custom_content_after_shippingform() {\r\n\tinclude ('vendor_shipping_form.php');\r\n}",
"public function addPickupOrderGuestEmailTemplate()\n {\n $template = $this->templateFactory->create();\n $template->setTemplateCode('New Pickup Order For Guest');\n $template->setTemplateText($this->getEmailTemplateForGuest());\n $template->setTemplateType(TemplateTypesInterface::TYPE_HTML);\n $template->setTemplateSubject(\n '{{trans \"Your %store_name order confirmation\" store_name=$store.getFrontendName()}}'\n );\n $template->setOrigTemplateCode('sales_email_order_guest_template');\n // @codingStandardsIgnoreLine\n $template->setOrigTemplateVariables('{\"var formattedBillingAddress|raw\":\"Billing Address\",\"var order.getEmailCustomerNote()\":\"Email Order Note\",\"var order.getBillingAddress().getName()\":\"Guest Customer Name\",\"var order.getCreatedAtFormatted(2)\":\"Order Created At (datetime)\",\"var order.increment_id\":\"Order Id\",\"layout handle=\\\"sales_email_order_items\\\" order=$order\":\"Order Items Grid\",\"var payment_html|raw\":\"Payment Details\",\"var formattedShippingAddress|raw\":\"Shipping Address\",\"var order.getShippingDescription()\":\"Shipping Description\",\"var shipping_msg\":\"Shipping message\"}');\n\n $this->templateResource->save($template);\n }",
"public function sSaveShippingAddress($address, $id)\n {\n $sql = '\n INSERT INTO s_order_shippingaddress\n (\n userID,\n orderID,\n company,\n department,\n salutation,\n firstname,\n lastname,\n street,\n zipcode,\n city,\n phone,\n countryID,\n stateID,\n additional_address_line1,\n additional_address_line2,\n title\n )\n VALUES (\n :userID,\n :orderID,\n :company,\n :department,\n :salutation,\n :firstname,\n :lastname,\n :street,\n :zipcode,\n :city,\n :phone,\n :countryID,\n :stateID,\n :additional_address_line1,\n :additional_address_line2,\n :title\n )\n ';\n $sql = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveShipping_FilterSQL',\n $sql,\n ['subject' => $this, 'address' => $address, 'id' => $id]\n );\n $array = [\n ':userID' => $address['userID'],\n ':orderID' => $id,\n ':company' => (string) $address['company'],\n ':department' => (string) $address['department'],\n ':salutation' => (string) $address['salutation'],\n ':firstname' => (string) $address['firstname'],\n ':lastname' => (string) $address['lastname'],\n ':street' => (string) $address['street'],\n ':zipcode' => (string) $address['zipcode'],\n ':city' => (string) $address['city'],\n ':phone' => (string) $address['phone'],\n ':countryID' => $address['countryID'],\n ':stateID' => $address['stateID'],\n ':additional_address_line1' => (string) $address['additional_address_line1'],\n ':additional_address_line2' => (string) $address['additional_address_line2'],\n ':title' => (string) $address['title'],\n ];\n $array = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveShipping_FilterArray',\n $array,\n ['subject' => $this, 'address' => $address, 'id' => $id]\n );\n $result = $this->db->executeUpdate($sql, $array);\n\n $shippingId = $this->db->lastInsertId();\n\n $shippingAddressId = null;\n\n if ($this->session !== null) {\n $shippingAddressId = $this->session->get('checkoutShippingAddressId');\n }\n\n if ($shippingAddressId === null) {\n /** @var Customer $customer */\n $customer = $this->modelManager->getRepository(\\Shopware\\Models\\Customer\\Customer::class)\n ->find($address['userID']);\n $shippingAddressId = $customer->getDefaultShippingAddress()->getId();\n }\n\n $attributes = $this->attributeLoader->load('s_user_addresses_attributes', $shippingAddressId);\n\n $this->attributePersister->persist($attributes, 's_order_shippingaddress_attributes', $shippingId);\n\n return $result;\n }",
"protected function processShippingAddress()\n {\n $this->updateStreetFields($this->addressFields['children']['street'], 'shippingAddress');\n\n if(false === $this->configResolver->getUseRegions()){\n unset($this->addressFields['children']['region']['filterBy']);\n unset($this->addressFields['children']['region_id']);\n }\n\n foreach ($this->fieldsConfig as $fieldName => $config) {\n $field = &$this->addressFields['children'][$fieldName];\n $this->configureField($field, 'shippingAddress', $config);\n }\n }",
"public function saveShippingAction() {\n\t\tif ($this->getRequest ()->isPost ()) {\n\t\t\t$preAddr = Mage::getSingleton ( 'customer/session' )->getPreaddress ();\n\t\t\t\n\t\t\tif ($preAddr) {\n\t\t\t\t$data = array ();\n\t\t\t\tif (! empty ( $preAddr ['ShippingAddress'] [0] )) {\n\t\t\t\t\t$preData = $preAddr ['ShippingAddress'];\n\t\t\t\t} else {\n\t\t\t\t\t$preData = $preAddr;\n\t\t\t\t}\n\t\t\t\t$dataId = $this->getRequest ()->getPost ( 'addressid' );\n\t\t\t\t\n\t\t\t\t$mpData = Mage::getModel ( 'masterpass/masterpass' );\n\t\t\t\tforeach ( $preData as $value ) {\n\t\t\t\t\tif ($dataId == $value ['AddressId']) {\n\t\t\t\t\t\t$reecipientName = $value ['RecipientName'];\n\t\t\t\t\t\t$name = Mage::helper ( 'masterpass' )->getRecipienName ( $reecipientName );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! is_array ( $value ['Line2'] )) {\n\t\t\t\t\t\t\t$lin2 = $value ['Line2'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$lin2 = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! is_array ( $value ['Line3'] )) {\n\t\t\t\t\t\t\t$lin3 = $value ['Line3'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$lin3 = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$regionIdS = Mage::helper ( 'masterpass' )->checkMasterpassData ( $mpData->statesMapping ( $value ['CountrySubdivision'] ) );\n\t\t\t\t\t\t$regionS = Mage::helper ( 'masterpass' )->checkMasterpassData ( $mpData->getMasterpassRegion ( $value ['CountrySubdivision'] ) );\n\t\t\t\t\t\t$shippingPhone = $mpData->getRemoveDash ( Mage::helper ( 'masterpass' )->checkMasterpassData ( $value ['RecipientPhoneNumber'] ) );\n\t\t\t\t\t\t$data = array (\n\t\t\t\t\t\t\t\t'firstname' => $name [0],\n\t\t\t\t\t\t\t\t'lastname' => $name [1],\n\t\t\t\t\t\t\t\t'street' => array (\n\t\t\t\t\t\t\t\t\t\t0 => $value ['Line1'],\n\t\t\t\t\t\t\t\t\t\t1 => $lin2,\n\t\t\t\t\t\t\t\t\t\t2 => $lin3 \n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'city' => $value ['City'],\n\t\t\t\t\t\t\t\t'region_id' => $regionIdS,\n\t\t\t\t\t\t\t\t'region' => $regionS,\n\t\t\t\t\t\t\t\t'postcode' => $value ['PostalCode'],\n\t\t\t\t\t\t\t\t'country_id' => $value ['Country'],\n\t\t\t\t\t\t\t\t'telephone' => $shippingPhone \n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$customerAddressId = $this->getRequest ()->getPost ( 'shipping_address_id', false );\n\t\t\t\t$this->getOnepage ()->saveShipping ( $data, $customerAddressId );\n\t\t\t}\n\t\t}\n\t\t$this->loadLayout ( false );\n\t\t$this->renderLayout ();\n\t}",
"public function addPickupOrderEmailTemplate()\n {\n $template = $this->templateFactory->create();\n $template->setTemplateCode('New Pickup Order');\n $template->setTemplateText($this->getEmailTemplate());\n $template->setTemplateType(TemplateTypesInterface::TYPE_HTML);\n $template->setTemplateSubject(\n '{{trans \"Your %store_name order confirmation\" store_name=$store.getFrontendName()}}'\n );\n $template->setOrigTemplateCode('sales_email_order_template');\n // @codingStandardsIgnoreLine\n $template->setOrigTemplateVariables('{\"var formattedBillingAddress|raw\":\"Billing Address\",\"var order.getEmailCustomerNote()\":\"Email Order Note\",\"var order.increment_id\":\"Order Id\",\"layout handle=\\\"sales_email_order_items\\\" order=$order area=\\\"frontend\\\"\":\"Order Items Grid\",\"var payment_html|raw\":\"Payment Details\",\"var formattedShippingAddress|raw\":\"Shipping Address\",\"var order.getShippingDescription()\":\"Shipping Description\",\"var shipping_msg\":\"Shipping message\"}');\n\n $this->templateResource->save($template);\n }",
"public function create()\n {\n return view('sadmin.shippingadd');\n }",
"function uc_order_pane_ship_to($op, $order, &$form = NULL, &$form_state = NULL) {\n switch ($op) {\n case 'customer':\n if (!uc_order_is_shippable($order)) {\n return;\n }\n case 'view':\n $build = array('#markup' => uc_order_address($order, 'delivery') . '<br />' . check_plain($order->delivery_phone));\n return $build;\n\n case 'edit-form':\n $form['ship_to'] = array(\n '#type' => 'uc_address',\n '#default_value' => $order,\n '#required' => FALSE,\n '#attributes' => array('class' => array('uc-store-address-field')),\n '#key_prefix' => 'delivery',\n );\n return $form;\n\n case 'edit-theme':\n $output = '<div class=\"order-pane-icons\">';\n $output .= ' <img src=\"' . base_path() . drupal_get_path('module', 'uc_store')\n . '/images/address_book.gif\" alt=\"' . t('Select from address book.') . '\" '\n . 'title=\"' . t('Select from address book.') . '\" onclick=\"load_address_select(' . $form['order_uid']['#value'] . ', \\'#delivery_address_select\\', \\'delivery\\');\" />';\n $output .= ' <img src=\"' . base_path() . drupal_get_path('module', 'uc_store')\n . '/images/copy.gif\" alt=\"' . t('Copy billing information.') . '\" title=\"'\n . t('Copy billing information.') . '\" onclick=\"uc_order_copy_billing_to_shipping();\" />';\n $output .= '</div>';\n $output .= '<div id=\"delivery_address_select\"></div>';\n return $output . drupal_render($form['ship_to']);\n\n case 'edit-process':\n foreach ($form_state['values'] as $key => $value) {\n if (substr($key, 0, 9) == 'delivery_') {\n if (uc_address_field_enabled(substr($key, 9))) {\n $changes[$key] = $value;\n }\n }\n }\n return $changes;\n }\n}",
"public function toString()\n\t{\n\t\treturn \"Customer on checkout page - Shipping address popup - created address is shown on [Shipping address] and [Billing address] section\";\n\t}",
"function addAddressBookEntry($customer_id, $address_question_arr, $make_default = false) {\n // first get the zone id's from the 2 digit iso codes\n // country first\n $country_query = tep_db_query('SELECT countries_id, address_format_id\n FROM ' . TABLE_COUNTRIES . '\n WHERE countries_name = \\'' . $address_question_arr['country'] . '\\'\n LIMIT 1');\n\n // see if we found a record, if not default to American format\n if (tep_db_num_rows($country_query) > 0) {\n $country = tep_db_fetch_array($country_query);\n // grab the country id and address format\n $country_id = $country['countries_id'];\n $address_format_id = $country['address_format_id'];\n } else {\n // default\n $country_id = '223';\n $address_format_id = '2'; //2 is the American format\n }\n\n // see if the country code has a state\n $country_zone_check_query = tep_db_query('SELECT zone_country_id\n FROM ' . TABLE_ZONES . '\n WHERE zone_country_id = \\'' . $country_id . '\\'\n LIMIT 1');\n if (tep_db_num_rows($country_zone_check_query) > 0) {\n $check_zone = true;\n } else {\n $check_zone = false;\n }\n\n // now try and find the zone_id (state/province code)\n // use the country id above\n if ($check_zone) {\n $zone_query = tep_db_query('SELECT zone_id\n FROM ' . TABLE_ZONES . '\n WHERE zone_country_id = \\'' . $country_id . '\\' AND\n zone_code = \\'' . $address_question_arr['state'] . '\\'\n LIMIT 1');\n if (tep_db_num_rows($zone_query) > 0) {\n // grab the id\n $zone = tep_db_fetch_array($zone_query);\n $zone_id = $zone['zone_id'];\n } else {\n $check_zone = false;\n }\n }\n\n // now run the insert\n // this isnt the best way but it will get the majority of cases\n list($fname, $lname) = explode(' ', $address_question_arr['name']);\n if ($check_zone) {\n tep_db_query('INSERT INTO ' . TABLE_ADDRESS_BOOK . '\n (address_book_id, customers_id, entry_gender, entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_postcode, entry_city, entry_country_id,\n entry_zone_id)\n VALUES\n (NULL, \\'' . $customer_id . '\\', \\'\\', \\'' . $fname . '\\', \\'' . $lname . '\\',\n \\'' . $address_question_arr['street_address'] . '\\', \\'' . $address_question_arr['suburb'] . '\\',\n \\'' . $address_question_arr['postcode'] . '\\', \\'' . $address_question_arr['city'] . '\\',\n \\'' . $country_id . '\\', \\'' . $zone_id . '\\')');\n } else {\n tep_db_query('INSERT INTO ' . TABLE_ADDRESS_BOOK . '\n (address_book_id, customers_id, entry_gender, entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_postcode, entry_city, entry_country_id)\n VALUES\n (NULL, \\'' . $customer_id . '\\', \\'\\', \\'' . $fname . '\\', \\'' . $lname . '\\',\n \\'' . $address_question_arr['street_address'] . '\\', \\'' . $address_question_arr['suburb'] . '\\',\n \\'' . $address_question_arr['postcode'] . '\\', \\'' . $address_question_arr['city'] . '\\',\n \\'' . $country_id . '\\')');\n }\n $address_book_id = tep_db_insert_id();\n\n // make default if set, update\n if ($make_default) {\n tep_db_query('UPDATE '. TABLE_CUSTOMERS . '\n SET customers_default_address_id = \\'' . $address_book_id . '\\'\n WHERE customers_id = \\'' . $customer_id . '\\'');\n $_SESSION['customer_default_address_id'] = $address_book_id;\n }\n\n // set the sendto\n $_SESSION['sendto'] = $address_book_id;\n\n // return the address_id\n return $address_book_id;\n }",
"function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}",
"public function print_steps() {\n\t\tWC()->session->set( 'checkout_step', 'address' );\n\n\t\twc_get_template( 'checkout/multistep/steps.php', array( 'multistep' => $this ) );\n\t}",
"function address_shortcode() {\n ob_start();\n get_template_part('address');\n return ob_get_clean();\n}",
"private function register_place_fields() {\n\n $address_children = [\n 'street_01' => new \\Fieldmanager_Textfield( esc_html__( 'Street Address', 'pedestal' ), [\n 'name' => 'street_01',\n ] ),\n 'street_02' => new \\Fieldmanager_Textfield( esc_html__( 'Street Address (Line 2)', 'pedestal' ), [\n 'name' => 'street_02',\n ] ),\n 'po_box' => new \\Fieldmanager_Textfield( esc_html__( 'P.O. Box Number', 'pedestal' ), [\n 'name' => 'po_box',\n 'description' => esc_html__( 'Include number only (no \"P.O.\" needed).', 'pedestal' ),\n ] ),\n 'postal_code' => new \\Fieldmanager_Textfield( esc_html__( 'Postal Code', 'pedestal' ), [\n 'name' => 'postal_code',\n ] ),\n ];\n $address = new \\Fieldmanager_Group( false, [\n 'name' => 'place_address',\n 'children' => $address_children,\n 'description' => esc_html__( 'Street address only. City info is entered in the Locality box below.', 'pedestal' ),\n 'serialize_data' => false,\n ] );\n\n $address->add_meta_box( esc_html__( 'Street Address', 'pedestal' ), [ 'pedestal_place' ], 'normal', 'high' );\n\n }",
"public function addAddressParams()\n {\n $oUser = $this->getUser();\n if (!$oUser) {\n return;\n }\n $oRequest = $this->getPayPalRequest();\n\n $oRequest->setParameter(\"EMAIL\", $oUser->oxuser__oxusername->value);\n\n $sAddressId = $oUser->getSelectedAddressId();\n if ($sAddressId) {\n $oAddress = oxNew(\"oxAddress\");\n $oAddress->load($sAddressId);\n\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oAddress->oxaddress__oxfname->value . \" \" . $oAddress->oxaddress__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oAddress->oxaddress__oxstreet->value . \" \" . $oAddress->oxaddress__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oAddress->oxaddress__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oAddress->oxaddress__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oAddress->oxaddress__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oAddress->oxaddress__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oAddress->oxaddress__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oAddress->oxaddress__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n } else {\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTONAME\", getStr()->html_entity_decode($oUser->oxuser__oxfname->value . \" \" . $oUser->oxuser__oxlname->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTREET\", getStr()->html_entity_decode($oUser->oxuser__oxstreet->value . \" \" . $oUser->oxuser__oxstreetnr->value));\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCITY\", $oUser->oxuser__oxcity->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOZIP\", $oUser->oxuser__oxzip->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOPHONENUM\", $oUser->oxuser__oxfon->value);\n\n $oCountry = oxNew(\"oxCountry\");\n $oCountry->load($oUser->oxuser__oxcountryid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE\", $oCountry->oxcountry__oxisoalpha2->value);\n\n if ($oUser->oxuser__oxstateid->value) {\n $oState = oxNew(\"oxState\");\n $oState->load($oUser->oxuser__oxstateid->value);\n $oRequest->setParameter(\"PAYMENTREQUEST_0_SHIPTOSTATE\", $oState->oxstates__oxisoalpha2->value);\n }\n }\n }",
"function custom_template_single_tabs_shipping_delivery()\n { \n include('shipping-delivery-custom.php');\n }"
] | [
"0.6982514",
"0.65228075",
"0.6460018",
"0.6321133",
"0.63001853",
"0.62993824",
"0.6196611",
"0.6036511",
"0.60358757",
"0.60184723",
"0.59829247",
"0.5980058",
"0.5934677",
"0.58779925",
"0.58539397",
"0.5826276",
"0.5822766",
"0.58132094",
"0.57802045",
"0.5775925",
"0.57503325",
"0.5742169",
"0.5729532",
"0.57101613",
"0.57087964",
"0.56689435",
"0.56178886",
"0.56117314",
"0.5597432",
"0.5590663"
] | 0.7136997 | 0 |
Get Postident Config Model | public function getConfig()
{
return Mage::getModel("postident/config");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function model()\n {\n return Config::class;\n }",
"public function _getConfigModel()\n {\n return Mage::getModel(self::CONFIG);\n }",
"private function getConfigModel()\n {\n return Mage::getSingleton('wallee_payment/system_config');\n }",
"protected function getModelConfiguration()\n {\n return app('sleeping_owl')->getModel(get_class($this->getModel()));\n }",
"protected function _getConfigModel()\n {\n if (!$this->hasConfigModel()) {\n $this->setConfigModel(Mage::getConfig());\n }\n\n return $this->getConfigModel();\n }",
"public function model()\n {\n return config('litecms.portfolio.portfolio.model.model');\n }",
"public function getModelConfiguration()\n\t{\n\t\treturn $this->configuration;\n\t}",
"public function model()\n {\n return config('laraauto.automobile.accessory.model.model');\n }",
"protected function _getModel() {\n $model = Configure::read('Postmark.Inbound.model');\n return $model ? ClassRegistry::init($model) : false;\n }",
"public function getConfig(){\n return $this->config;\n }",
"public function getConfig(){\n\t\treturn $this->_config;\n\t}",
"protected function getPlateformeConfig()\r\n {\r\n return $this->config;\r\n }",
"function getConfig()\n {\n return $this->config;\n }",
"public function model()\n {\n return 'App\\Models\\Config';\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig() \n {\n return $this->config;\n }",
"protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }",
"public function config(): Config;",
"public function getConfig()\n {\n return $this->get('config');\n }",
"public function model()\n {\n return config('teams.team.model.model');\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }",
"public function getConfig()\n {\n return $this->config;\n }"
] | [
"0.7315183",
"0.719311",
"0.7160724",
"0.6961395",
"0.68676054",
"0.66918975",
"0.653293",
"0.6473519",
"0.64597386",
"0.64424676",
"0.6372694",
"0.63283515",
"0.63244635",
"0.63166165",
"0.6305188",
"0.6295142",
"0.6263295",
"0.62404084",
"0.6227747",
"0.62243545",
"0.62235564",
"0.62235564",
"0.62235564",
"0.62235564",
"0.62235564",
"0.62235564",
"0.62235564",
"0.62235564",
"0.62235564",
"0.62235564"
] | 0.80496407 | 0 |
Gets the new flash keys array | protected function getNewFlashKeys(): array
{
return $this->get(self::NEW_FLASH_KEYS_KEY, []);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getStaleFlashKeys(): array\n {\n return $this->get(self::STALE_FLASH_KEYS_KEY, []);\n }",
"protected function getPreloadKeys() {\n\t\t$keys = array(\n\t\t\t'echo-notification-timestamp',\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::ALERT,\n\t\t\t'echo-notification-count',\n\t\t\t'echo-notification-count-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-count-' . EchoAttributeManager::ALERT,\n\t\t);\n\n\t\treturn array_filter( array_merge(\n\t\t\tarray_map( array( $this, 'getMemcKey' ), $keys ),\n\t\t\tarray_map( array( $this, 'getGlobalMemcKey' ), $keys )\n\t\t) );\n\t}",
"public function getKeys() {}",
"public function getKeys(): array;",
"static function getKeys();",
"public static function keys(): array;",
"protected function getKeysMap(): array\n {\n return [\n 'baz' => 'greet',\n ];\n }",
"public function getKeys(){\n\t\treturn $this->keys;\n\t}",
"public function keys(): array;",
"public function keys(): array;",
"public function keys(): array;",
"public function keys() : array;",
"public function keys() : array;",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function getKeys(): array\n {\n return $this->keys;\n }",
"public function getKeys();",
"public function getKeys()\n {\n $private_key = $this->config->getAppValue($this->appName, \"privatekey\");\n $public_key = $this->config->getAppValue($this->appName, \"publickey\");\n\n return [$private_key, $public_key];\n }",
"function flashcard_dbcleaner_add_keys() {\n global $DB;\n\n $flashcardmoduleid = $DB->get_field('modules', 'id', array('name' => 'flashcard'));\n\n $keys = array(\n array('flashcard', 'course', 'course', 'id', ''),\n array('flashcard', 'id', 'course_modules', 'instance', ' module = '.$flashcardmoduleid.' '),\n array('flashcard_card', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_card', 'userid', 'user', 'id', ''),\n array('flashcard_deckdata', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_userdeck_state', 'flashcardid', 'flashcard', 'id', ''),\n array('flashcard_userdeck_state', 'userid', 'user', 'id', ''),\n );\n\n return $keys;\n}",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"function KeyNameList ( ) { return $this->_KeyNameList; }",
"public function keys()\n {\n return static::from($this->keyR);\n }"
] | [
"0.7978015",
"0.7138449",
"0.67302215",
"0.6721577",
"0.6705986",
"0.66578674",
"0.66106",
"0.6608496",
"0.6587365",
"0.6587365",
"0.6587365",
"0.65845835",
"0.65845835",
"0.65813076",
"0.65813076",
"0.65813076",
"0.65813076",
"0.65813076",
"0.65813076",
"0.65393656",
"0.6509184",
"0.6467519",
"0.64049655",
"0.63913095",
"0.63913095",
"0.63913095",
"0.63913095",
"0.63913095",
"0.63828087",
"0.63800627"
] | 0.8839694 | 0 |
Gets the stale flash keys array | protected function getStaleFlashKeys(): array
{
return $this->get(self::STALE_FLASH_KEYS_KEY, []);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getNewFlashKeys(): array\n {\n return $this->get(self::NEW_FLASH_KEYS_KEY, []);\n }",
"protected function getPreloadKeys() {\n\t\t$keys = array(\n\t\t\t'echo-notification-timestamp',\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::ALERT,\n\t\t\t'echo-notification-count',\n\t\t\t'echo-notification-count-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-count-' . EchoAttributeManager::ALERT,\n\t\t);\n\n\t\treturn array_filter( array_merge(\n\t\t\tarray_map( array( $this, 'getMemcKey' ), $keys ),\n\t\t\tarray_map( array( $this, 'getGlobalMemcKey' ), $keys )\n\t\t) );\n\t}",
"public function __sleep()\n {\n foreach ($this->keys as $key) {\n unset($key->x5c);\n unset($key->x5t);\n unset($key->{'x5t#S256'});\n }\n return ['keys'];\n }",
"public function getKeys()\n {\n $keys = array_keys($this->cache) + array_keys($this->factories);\n return array_unique($keys);\n }",
"public function getKeys() {}",
"private function getAllCacheKeys(){\n $keys = array();\n foreach ($this->storages as $name => $storage){\n $keys[] = $this->getCacheKey($name);\n }\n return $keys;\n }",
"public function keys(): array\n {\n return array_keys($this->storage);\n }",
"public function getKeys(){\n\t\treturn $this->keys;\n\t}",
"public static function keys()\n {\n return static::$keys;\n }",
"public function getKeys(): array\n {\n return $this->keys;\n }",
"public function getKeys(): array;",
"public function statKeys()\n {\n \treturn $this->statKeys;\n }",
"public function validKeys()\n\t{\n\t\treturn array_merge($this->keysOnlyUsedDuringCreation(), $this->statKeys());\n\t}",
"public function getAttachEvent():array{\r\n return array_keys($this->storage);\r\n }",
"public static function keys(): array;",
"public function loadKeys() {\n\t\treturn end($this->getKeys());\n\t}",
"public function getFlashNotifications()\n {\n $notif = Session::get('flash_notification');\n Session::forget('flash_notification');\n\n return $notif;\n }",
"function &keys(){\n\t\tif ( isset($this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$out = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$keys =& $tables[$tablename]->keys();\n\t\t\tforeach ( array_keys($keys) as $fieldname){\n\t\t\t\t$out[$fieldname] =& $keys[$fieldname];\n\t\t\t}\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $out;\n\t\treturn $out;\n\t\t\n\t}",
"public function pull_flashes()\n\t{\n\t\t$w = $this->session->delete ('__flash_warning');\n\t\t$m = $this->session->delete ('__flash_message');\n\t\t$n = $this->session->delete ('__flash_notice');\n\n\t\treturn array (\n\t\t\t'warning'\t=> coalesce ($w, array()),\n\t\t\t'message'\t=> coalesce ($m, array()),\n\t\t\t'notice'\t=> coalesce ($n, array()),\n\t\t);\n\t}",
"public function keys(): array;",
"public function keys(): array;",
"public function keys(): array;",
"function keys() {\n\t\treturn array_keys($this->_cache);\n\t}",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getNames()\n {\n if($this->isKeycacheInvalid())\n {\n $this->regenerateKeyCache();\n }\n if(is_array($this->__keycacheindex))\n {\n return $this->__keycacheindex;\n }\n return array();\n }",
"public function __sleep()\n {\n $keys = get_object_vars($this);\n unset($keys['_authorization']);\n\n return array_keys($keys);\n }"
] | [
"0.84772134",
"0.71192783",
"0.67744887",
"0.6449073",
"0.6274906",
"0.6257662",
"0.62471503",
"0.6222829",
"0.6222128",
"0.6212292",
"0.62106645",
"0.6185599",
"0.6184555",
"0.61776835",
"0.6164328",
"0.61579704",
"0.6149772",
"0.6080845",
"0.6075199",
"0.606832",
"0.606832",
"0.606832",
"0.60617054",
"0.60584116",
"0.60584116",
"0.60584116",
"0.60584116",
"0.60584116",
"0.605105",
"0.6035439"
] | 0.91230685 | 0 |
Count all public calendars of other users. | public function countPublicCalendars(UserInterface $user)
{
$qb = $this->repository->createQueryBuilder('c');
$qb->select('COUNT(c.id)');
$qb->where('c.visible = :visible');
$qb->andwhere('c.createdBy != :user');
$qb->setParameter('visible', true);
$qb->setParameter('user', $user);
return $qb->getQuery()->getSingleScalarResult();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function count_user_events($user_id = NULL) {\r\n global $uid;\r\n if (is_null($user_id)) {\r\n $user_id = $uid;\r\n }\r\n return Database::get()->querySingle(\"SELECT COUNT(*) AS count FROM personal_calendar WHERE user_id = ?d\", $user_id)->count;\r\n }",
"private function countRegisteredUsers( &$users ): void\n {\n foreach($users as $user)\n {\n if( $user -> created_at && $user -> created_at -> year == $this -> year)\n {\n $this -> data[ self :: REGISTERED ][ $user -> created_at -> month - 1 ]++;\n }\n }\n }",
"public function getCalendars(User $user = null);",
"public function getCountEvents(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('types', $request->getArray('types', 'Text'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = $record->getEntityRecordsCount();\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}",
"function countUsers(){\n\t\n\t}",
"function getUsersCount() {\n $company_id = $this->getId(); \n \treturn Users::count(\"company_id LIKE $company_id\");\n }",
"public function getCountEventsGroup(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('types', $request->getArray('types', 'Text'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$result = [];\n\t\tforeach ($request->getArray('dates', 'DateTimeInUserFormat') as $datePair) {\n\t\t\t$record->set('start', $datePair[0]);\n\t\t\t$record->set('end', $datePair[1]);\n\t\t\t$result[] = $record->getEntityRecordsCount();\n\t\t}\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($result);\n\t\t$response->emit();\n\t}",
"function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\t\n\t\t\t// Is it a group calendar?\n\t\t\tif ( is_group_calendar( $calendar->term_id ) ) :\n\t\t\t\t$group_id\t= groups_get_id( $calendar->slug );\n\t\t\t\t$can_view \t= groups_is_user_member( get_current_user_id() , $group_id ) ? true : false;\n\t\t\telse :\n\t\t\t\t$can_view = true;\n\t\t\tendif;\n\t\t\t\n\t\t\t// If we find a calendar for which the user is authorized, go ahead and display it\n\t\t\tif( $can_view ) :\n\t\t\t\t$this->calendar = $calendar;\n\t\t\t\t$this->can_view = true;\n\t\t\t\tbreak;\n\t\t\tendif;\n\t\t}\n\n\t\t// If the user is not allowed to view any calendar, redirect them to the group\n\t\tif ( !$can_view ) {\n\t\t\t$redirect = SITEURL . '/groups/' . $this->calendar->slug;\n\t\t\tbp_core_add_message( 'You cannot access events on this calendar.' , 'error' );\n\t\t\tbp_core_redirect( $redirect );\n\t\t}\n\t}",
"public function getCountEvents(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('types', $request->getArray('types', 'Text'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = $record->getEntityRecordsCount();\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}",
"function count_many_users_posts($users, $post_type = 'post', $public_only = \\false)\n {\n }",
"public function countUsers() {\n require('database.php');\n if ($result = $mysqli->query('SELECT Count(Distinct id) as count\n FROM users')) {\n while ($row = $result->fetch_assoc()) {\n echo $row['count'];\n }\n }\n }",
"public function getCountEventsGroup(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('types', $request->getArray('types', 'Text'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$result = [];\n\t\tforeach ($request->getArray('dates', 'DateTimeInUserFormat') as $datePair) {\n\t\t\t$record->set('start', $datePair[0]);\n\t\t\t$record->set('end', $datePair[1]);\n\t\t\t$result[] = $record->getEntityRecordsCount();\n\t\t}\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($result);\n\t\t$response->emit();\n\t}",
"public function countCalendarEventDates() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".$this->dbNo.\"_calendar_event_date\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute();\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}",
"public function countEvents()\n {\n $count = 0;\n foreach ($this->listEvents() as $dayevents) {\n $count += count($dayevents);\n }\n return $count;\n }",
"public function countAll() {}",
"public function countAll() {}",
"public function countAll() {}",
"public function userStatics()\n { \n if (func_num_args() > 0) {\n $year = func_get_arg(0);\n $select = \"SELECT COUNT(u.user_id) AS total, m.month\n FROM (\n SELECT 'JAN' AS MONTH\n UNION SELECT 'FEB' AS MONTH\n UNION SELECT 'MAR' AS MONTH\n UNION SELECT 'APR' AS MONTH\n UNION SELECT 'MAY' AS MONTH\n UNION SELECT 'JUN' AS MONTH\n UNION SELECT 'JUL' AS MONTH\n UNION SELECT 'AUG' AS MONTH\n UNION SELECT 'SEP' AS MONTH\n UNION SELECT 'OCT' AS MONTH\n UNION SELECT 'NOV' AS MONTH\n UNION SELECT 'DEC' AS MONTH\n ) AS m\n LEFT JOIN users u ON MONTH(STR_TO_DATE(CONCAT(m.month, ' $year'),'%M %Y')) = MONTH(u.reg_date) AND YEAR(u.reg_date) = '$year'\n GROUP BY m.month\n ORDER BY 1+1\";\n\n $result = $this->getAdapter()->fetchAll($select); \n return $result;\n }\n }",
"function getAllUsersCount() {\n\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t $params = null;\n $userObj = new App42Response();\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/count/all\";\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $userObj->setStrResponse($response->getResponse());\n $userObj->setResponseSuccess(true);\n $userResponseObj = new UserResponseBuilder();\n $userObj->setTotalRecords($userResponseObj->getTotalRecords($response->getResponse()));\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $userObj;\n }",
"public function ownerCombinedCal()\n {\n // Restricted access\n if ( ! $this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n\n require_once('views/OwnerCombinedCalView.class.php');\n $site = new SiteContainer($this->db);\n $page = new OwnerCombinedCalView();\n \n $site->printHeader();\n $site->printNav(\"owner\");\n $site->printCombinedCalFooter();\n $page->printHtml();\n $page->printCalendar(); \n\n }",
"public function getAllThisWeek()\n {\n $now = Carbon::today();\n $today = $now->toDateString();\n $last_sun = new Carbon('last sunday');\n $last_sunday = $last_sun->toDateString();\n\n return $this->appUser->whereBetween('date_created', array($last_sunday, $today))->count();\n }",
"public function numUsers(){\n $query = \"SELECT count(*) FROM final_usuario\";\n return $this->con->action($query);\n }",
"public function countCalendarEventDateParticipation() {\n\t\t$sql = \"SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf\".$this->dbNo.\"_calendar_event_participation_to_user\";\n\t\t$statement = $this->database->prepareStatement($sql);\n\t\t$statement->execute();\n\t\t$row = $statement->fetchArray();\n\t\treturn $row['count'];\n\t}",
"function loadPublicCalendars() {\n $sql = \"\n SELECT c.calendar_id, c.title, c.color\n FROM %s AS c\n WHERE c.surfer_id IS NULL\n ORDER BY c.title\n \";\n $result = $this->databaseQueryFmt($sql, $this->tableCalendars);\n if (!$result || $result->count() == 0) {\n // database error or no public calendars defined\n return FALSE;\n }\n\n $calendars = array();\n while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {\n $calendars[] = $row;\n }\n\n return $calendars;\n }",
"public function somaTodosUsuarios()\n {\n $query = $this->db->query('SELECT COUNT(us_id) AS total_usuarios FROM users_gestores');\n $row = $query->row();\n echo $row->total_usuarios;\n }",
"function countUsersCS(){\n\t\t\t\t\trequire_once(\"database\\database_connection.php\");\n\t\t\t\t\t$conn=database();\n\t\t\t\t\t//Query the database\n\t\t\t\t\t$resultSet = $conn->query(\"SELECT * FROM users_cs_count_view\");\n\n\t\t\t\t\tif($resultSet->num_rows != 0){\n\t\t\t\t\t\twhile($rows = $resultSet->fetch_assoc()){\n\t\t\t\t\t\t\t$users = $rows['users_with_cs'];\n\n\t\t\t\t\t\t\techo \"<h4 class='heading'>\n\t\t\t\t\t\t\tRegistered users with CS:GO: $users\n\t\t\t\t\t\t\t</h4>\";\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\techo\"ERROR\";\n\t\t\t\t\t}\n\t\t \t\t$conn->close();\n}",
"private function countActiveUsers(): void\n {\n $userIds = [];\n for($i=0; $i <= 11; $i++)\n {\n $userIds[$i] = [];\n }\n\n Order :: where( 'charging_status', OrderStatusEnum :: FINISHED ) -> get()\n -> filter(function($order) {\n return $order -> created_at && $order -> created_at -> year == $this -> year;\n })\n -> each(function($order) use( &$userIds ) {\n array_push($userIds[ $order -> created_at -> month - 1], $order -> user_id); \n });\n\n\n for($i = 0; $i <= 11; $i++)\n {\n $this -> data[ self :: ACTIVE ][$i] = count(array_unique($userIds[$i]));\n }\n }",
"public function getProjectsByUserIdCount(int $userId) : int;",
"protected function getSecurityCount()\n\t{\n\t\t$count = App\\Log::getLogs('access_for_admin', 'oneDay', true);\n\t\t$count += App\\Log::getLogs('access_to_record', 'oneDay', true);\n\t\t$count += App\\Log::getLogs('access_for_api', 'oneDay', true);\n\t\treturn $count + App\\Log::getLogs('access_for_user', 'oneDay', true);\n\t}",
"public static function obtenerPublicacionesCount()\n {\n return self::builder()->where('tipo', false)->count() ?? 0;\n }"
] | [
"0.6198609",
"0.6029905",
"0.5829278",
"0.57265466",
"0.5712421",
"0.564941",
"0.5628115",
"0.5564134",
"0.5560409",
"0.5533492",
"0.55293584",
"0.55071753",
"0.5494965",
"0.5344268",
"0.534248",
"0.534248",
"0.534248",
"0.53321004",
"0.53293794",
"0.5319155",
"0.53061175",
"0.5296471",
"0.5289069",
"0.52849853",
"0.5275254",
"0.52705353",
"0.52643037",
"0.52584743",
"0.5247386",
"0.5241359"
] | 0.70849925 | 0 |
Find all calendars by given user. | public function findCalendarsByUser(UserInterface $user)
{
$qb = $this->repository->createQueryBuilder('c');
$qb->where('c.createdBy = :user');
$qb->setParameter('user', $user);
return $qb->getQuery()->execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCalendars(User $user = null);",
"public function getUserCalendar(User $user): array\n {\n $calendarsURL = $user->getCalendars();\n\n $calendars = [];\n foreach ($calendarsURL as $calendar) {\n array_push($calendars, $this->fetchEvents($calendar->getURL()));\n }\n return $calendars;\n }",
"public function get_calendar_list() {\n $calendars = array();\n $uri = 'https://www.googleapis.com/calendar/v3/users/me/calendarList';\n $params = array(\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->get_access_token(),\n ),\n );\n\n $response = wp_remote_get( $uri, $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $calendars = $body->items;\n\n $this->debug( 'Calendar List retrieved successfully', $body );\n } else {\n $this->error( 'Error while retrieving Calendar List: ', $response );\n }\n\n return $calendars;\n }",
"public function getCalendarsForUser($principalUri) {\n\t\n\n\t\t\\GO::debug(\"c:getCalendarsForUser($principalUri)\");\n\t\t\n\t\tif(!isset($this->_cachedCalendars[$principalUri])){\n\t\t\n\t\t\t$user = $this->_getUser($principalUri);\n\t\t\t\t\t\n\t\t\t$findParams = \\GO\\Base\\Db\\FindParams::newInstance()->ignoreAcl()\n\t\t\t\t->joinModel(array(\n\t\t\t\t\t\t'model' => 'GO\\Sync\\Model\\UserCalendar',\n\t\t\t\t\t\t'localTableAlias' => 't', //defaults to \"t\"\n\t\t\t\t\t\t'localField' => 'id', //defaults to \"id\"\n\t\t\t\t\t\t'foreignField' => 'calendar_id', //defaults to primary key of the remote model\n\t\t\t\t\t\t'tableAlias' => 'l', //Optional table alias\n\t\t\t\t))\n\t\t\t\t->criteria(\\GO\\Base\\Db\\FindCriteria::newInstance()->addCondition('user_id', $user->id, '=', 'l'));\n\n\t\t\t$stmt = \\GO\\Calendar\\Model\\Calendar::model()->find($findParams);\n\t\t\t\n\t\t\tif(!$stmt->rowCount()){\t\t\n\t\t\t //If the sync settings dialog for this user is never opened no default settings are created\n\t\t\t \\GO\\Sync\\Model\\Settings::model()->findForUser($user); //create default settings\n\t\t\t $stmt = \\GO\\Calendar\\Model\\Calendar::model()->find($findParams);\n\t\t\t}\n\n\t\t\t$this->_cachedCalendars[$principalUri] = array();\n\t\t\twhile ($calendar = $stmt->fetch()) {\n\t\t\t\t$this->_cachedCalendars[$principalUri][] = $this->_modelToDAVCalendar($calendar, $principalUri);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\\GO::debug($this->_cachedCalendars[$principalUri]);\n\t\t\n\t\treturn $this->_cachedCalendars[$principalUri];\n\t}",
"public static function getSharedCalendarsForUser($a_usr_id = 0)\r\n\t{\r\n\t\tglobal $ilDB,$ilUser,$rbacreview;\r\n\t\t\r\n\t\tif(!$a_usr_id)\r\n\t\t{\r\n\t\t\t$a_usr_id = $ilUser->getId();\r\n\t\t}\r\n\r\n\t\t$query = \"SELECT * FROM cal_shared \".\r\n\t\t\t\"WHERE obj_type = \".$ilDB->quote(self::TYPE_USR ,'integer').\" \".\r\n\t\t\t\"AND obj_id = \".$ilDB->quote($a_usr_id ,'integer').\" \".\r\n\t\t\t\"ORDER BY create_date\";\r\n\t\t$res = $ilDB->query($query);\r\n\t\t$calendars = array();\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\t$calendars[] = $row->cal_id; \r\n\t\t\t\r\n\t\t\t$shared[$row->cal_id]['cal_id'] = $row->cal_id;\r\n\t\t\t$shared[$row->cal_id]['create_date'] = $row->create_date;\r\n\t\t\t$shared[$row->cal_id]['obj_type'] = $row->obj_type;\r\n\t\t}\r\n\t\t\r\n\t\t$assigned_roles = $rbacreview->assignedRoles($ilUser->getId());\r\n\t\t\r\n\t\t$query = \"SELECT * FROM cal_shared \".\r\n\t\t\t\"WHERE obj_type = \".$ilDB->quote(self::TYPE_ROLE ,'integer').\" \".\r\n\t\t\t\"AND \".$ilDB->in('obj_id',$assigned_roles,false ,'integer');\r\n\r\n\t\t$res = $ilDB->query($query);\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\tif(in_array($row->cal_id,$calendars))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(ilCalendarCategories::_isOwner($ilUser->getId(),$row->cal_id))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$shared[$row->cal_id]['cal_id'] = $row->cal_id;\r\n\t\t\t$shared[$row->cal_id]['create_date'] = $row->create_date;\r\n\t\t\t$shared[$row->cal_id]['obj_type'] = $row->obj_type;\r\n\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\treturn $shared ? $shared : array();\r\n\t\t// TODO: return also role calendars\r\n\t\t\r\n\t}",
"public function getCalendarItems($month = FALSE, $year = FALSE, $user_id = FALSE)\n\t{\n\t\t$sql = $this->db->select();\n\t\t$sql = $sql->from(array('i'=>'times'))->columns(array(new \\Zend\\Db\\Sql\\Expression('SUM(hours) AS total'), 'date', 'creator', 'user_id'));\n\n\t\tif($month)\n\t\t{\n\t\t\t$sql = $sql->where(array('month' => $month));\n\t\t}\n\t\t\n\t\tif($year)\n\t\t{\n\t\t\t$sql = $sql->where(array('year' => $year));\n\t\t}\n\t\t\n\t\tif($user_id)\n\t\t{\n\t\t\t$sql = $sql->where('creator = ? ', $user_id);\n\t\t}\t\t\t\t\n\t\t\n\t\t$sql = $sql->join(array('u' => 'users'), 'u.id = i.creator', array('creator_first_name' => 'first_name', 'creator_last_name' => 'last_name'), 'left');\t\t\t\t \n\t\t$sql = $sql->group('date')\n\t\t\t\t ->group('creator');\n\t\t\n\t\t$route_options = array('month' => $month, 'year' => $year);\n\t\t$route_options['user_id'] = $user_id;\n\t\t\n\t\treturn $this->_translateCalendarItems($this->getRows($sql), 'date', array('route_name' => 'times/view-day', 'options' => $route_options));\n\t}",
"public function listCalendars()\n {\n Kronolith::initialize();\n $all_external_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_EXTERNAL_CALENDARS);\n $result = new stdClass;\n $auth_name = $GLOBALS['registry']->getAuth();\n\n // Calendars. Do some twisting to sort own calendar before shared\n // calendars.\n foreach (array(true, false) as $my) {\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS) as $id => $calendar) {\n $owner = ($auth_name && ($calendar->owner() == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['internal'][$id] = $calendar->toHash();\n }\n }\n\n // Tasklists\n if (Kronolith::hasApiPermission('tasks')) {\n foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW, false) as $id => $tasklist) {\n if (isset($all_external_calendars['tasks/' . $id])) {\n $owner = ($auth_name &&\n ($tasklist->get('owner') == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['tasklists']['tasks/' . $id] =\n $all_external_calendars['tasks/' . $id]->toHash();\n }\n }\n }\n }\n }\n\n // Resources\n if (!empty($GLOBALS['conf']['resource']['driver'])) {\n foreach (Kronolith::getDriver('Resource')->listResources() as $resource) {\n if ($resource->get('type') != Kronolith_Resource::TYPE_GROUP) {\n $rcal = new Kronolith_Calendar_Resource(array(\n 'resource' => $resource\n ));\n $result->calendars['resource'][$resource->get('calendar')] = $rcal->toHash();\n } else {\n $rcal = new Kronolith_Calendar_ResourceGroup(array(\n 'resource' => $resource\n ));\n $result->calendars['resourcegroup'][$resource->getId()] = $rcal->toHash();\n }\n }\n }\n\n // Timeobjects\n foreach ($all_external_calendars as $id => $calendar) {\n if ($calendar->api() != 'tasks' && $calendar->display()) {\n $result->calendars['external'][$id] = $calendar->toHash();\n }\n }\n\n // Remote calendars\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_REMOTE_CALENDARS) as $url => $calendar) {\n $result->calendars['remote'][$url] = $calendar->toHash();\n }\n\n // Holidays\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_HOLIDAYS) as $id => $calendar) {\n $result->calendars['holiday'][$id] = $calendar->toHash();\n }\n\n return $result;\n }",
"function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\t\n\t\t\t// Is it a group calendar?\n\t\t\tif ( is_group_calendar( $calendar->term_id ) ) :\n\t\t\t\t$group_id\t= groups_get_id( $calendar->slug );\n\t\t\t\t$can_view \t= groups_is_user_member( get_current_user_id() , $group_id ) ? true : false;\n\t\t\telse :\n\t\t\t\t$can_view = true;\n\t\t\tendif;\n\t\t\t\n\t\t\t// If we find a calendar for which the user is authorized, go ahead and display it\n\t\t\tif( $can_view ) :\n\t\t\t\t$this->calendar = $calendar;\n\t\t\t\t$this->can_view = true;\n\t\t\t\tbreak;\n\t\t\tendif;\n\t\t}\n\n\t\t// If the user is not allowed to view any calendar, redirect them to the group\n\t\tif ( !$can_view ) {\n\t\t\t$redirect = SITEURL . '/groups/' . $this->calendar->slug;\n\t\t\tbp_core_add_message( 'You cannot access events on this calendar.' , 'error' );\n\t\t\tbp_core_redirect( $redirect );\n\t\t}\n\t}",
"public function fetchAllForCalendarHome(string $principalUri): array;",
"public function getCalendarEvents($organizationId, $userId, $calendarId, $start, $end, $connections, $extraField);",
"public function test_getAllCalendars() {\n// \t\t$user = TestingUtil::getTestAdminUser();\n// \t\t$userApp = new UserApp();\n// \t\t$userApp->initializeForAppID($user, 5);\n// \t\t$outlookClient = new OutlookClient($user, $userApp);\n// \t\t$outlookCalendar = new OutlookCalendar($outlookClient);\n// \t\t$calendars = $outlookCalendar->getAllCalendars();\n// \t\t$this->assertCount(3, $calendars);\n\t\t$this->assertEquals(1,1);\n\t}",
"public function getCalendars($where = null)\n {\n $result = [];\n $byParent = [];\n $values = [];\n $cond = $where ? ' where ' . self::buildWhere($where, $values) : '';\n $stmt = $this->db->prepare('select * from calendars ' . $cond);\n\n if (!$stmt->execute($values)) {\n throw new Exception($this->getPDOError('Cannot get calendars list.'), E_APP_GET_CALENDARS);\n }\n\n while ($e = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\n $e['intervals'] = $this->getCalendarIntervals(['calendar' => @$e['id']]);\n $e['daysPerMonth'] = intval($e['daysPerMonth']);\n $e['daysPerWeek'] = intval($e['daysPerWeek']);\n $e['hoursPerDay'] = intval($e['hoursPerDay']);\n\n if (!$where) {\n $parentId = $e['parentId'] ? $e['parentId'] : '';\n\n if (!isset($byParent[$parentId])) {\n $byParent[$parentId] = [];\n }\n\n $byParent[$parentId][] = $e;\n } else {\n $result[] = $e;\n }\n }\n\n return $where ? $result : self::buildTree($byParent, '');\n }",
"public function findEventsByUser(UserInterface $user)\r\n {\r\n $qb = $this->repository->createQueryBuilder('e');\r\n $qb->where('e.createdBy = :user');\r\n $qb->setParameter('user', $user);\r\n\r\n return $qb->getQuery()->execute();\r\n }",
"public static function delete_all_events($user_id = NULL) {\r\n global $uid;\r\n $resp = Database::get()->query(\"DELETE FROM personal_calendar WHERE user_id = ?\", $uid);\r\n if ($resp) {\r\n Log::record(0, MODULE_ID_PERSONALCALENDAR, LOG_DELETE, array('user_id' => $uid, 'id' => 'all'));\r\n return array('success' => true, 'message' => '');\r\n } else {\r\n return array('success' => false, 'message' => 'Database error');\r\n }\r\n }",
"public function getEventos($usuario) {\n $this->db->select('*');\n $this->db->from('calendario');\n if ($usuario) {\n $this->db->where('usuario', $usuario);\n }\n \n return $this->db->get()->result();\n }",
"function loadPublicCalendars() {\n $sql = \"\n SELECT c.calendar_id, c.title, c.color\n FROM %s AS c\n WHERE c.surfer_id IS NULL\n ORDER BY c.title\n \";\n $result = $this->databaseQueryFmt($sql, $this->tableCalendars);\n if (!$result || $result->count() == 0) {\n // database error or no public calendars defined\n return FALSE;\n }\n\n $calendars = array();\n while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {\n $calendars[] = $row;\n }\n\n return $calendars;\n }",
"public function allForUser($userId);",
"public function allForUser($userId);",
"public function calendars()\n {\n return $this->hasMany('App\\Models\\Calendar');\n }",
"public static function get_all_course_events($cid = NULL) {\r\n global $uid, $course_id;\r\n if (is_null($cid)) {\r\n $cid = $course_id;\r\n }\r\n return Database::get()->queryArray(\"SELECT id, title, content FROM personal_calendar WHERE user_id = ? AND reference_obj_course = ? \", $uid, $cid);\r\n }",
"public static function get_calendar_events($scope = \"month\", $startdate = null, $enddate = null, $user_id = NULL) {\r\n global $uid;\r\n\r\n if (is_null($user_id)) {\r\n $user_id = $uid;\r\n }\r\n\r\n //form date range condition\r\n $dateconditions = array(\"month\" => \"date_format(?t\".',\"%Y-%m\") = date_format(start,\"%Y-%m\")',\r\n \"week\" => \"YEARWEEK(?t,1) = YEARWEEK(start,1)\",\r\n \"day\" => \"date_format(?t\".',\"%Y-%m-%d\") = date_format(start,\"%Y-%m-%d\")');\r\n if (!is_null($startdate) && !is_null($enddate)) {\r\n $datecond = \" AND start >= ?t AND start <= ?t\";\r\n } elseif (!is_null($startdate)) {\r\n $datecond = \" AND \";\r\n $datecond .= (array_key_exists($scope, $dateconditions))? $dateconditions[$scope]:$dateconditions[\"month\"];\r\n } else {\r\n $datecond = \"\";\r\n }\r\n $student_groups = array_map(function ($item) {\r\n return $item->group_id;\r\n }, Database::get()->queryArray('SELECT group_id\r\n FROM group_members, `group`\r\n WHERE group_id = `group`.id AND user_id = ?d', $uid));\r\n if (count($student_groups)) {\r\n $group_sql_template = 'OR group_id IN (' . implode(', ', array_fill(0, count($student_groups), '?d')) . ')';\r\n $group_sql_template2 = 'AND group_id IN (' . implode(', ', array_fill(0, count($student_groups), '?d')) . ')';\r\n } else {\r\n $group_sql_template = '';\r\n $group_sql_template2 = '';\r\n }\r\n //retrieve events from various tables according to user preferences on what type of events to show\r\n $q = '';\r\n $q_args = array();\r\n $q_args_templ = array($user_id);\r\n if (!is_null($startdate)) {\r\n $q_args_templ[] = $startdate;\r\n }\r\n if (!is_null($enddate)) {\r\n $q_args_templ[] = $enddate;\r\n }\r\n\r\n if (isset($uid)) {\r\n Calendar_Events::get_calendar_settings();\r\n if (Calendar_Events::$calsettings->show_personal == 1) {\r\n $dc = str_replace('start', 'pc.start', $datecond);\r\n $q .= \"SELECT id, title, start, date_format(start,'%Y-%m-%d') startdate, duration, date_format(addtime(start, time(duration)), '%Y-%m-%d %H:%i') `end`, content, 'personal' event_group, 'event-special' class, 'personal' event_type, null as course FROM personal_calendar pc \"\r\n . \"WHERE user_id = ?d \" . $dc;\r\n $q_args = array_merge($q_args, $q_args_templ);\r\n }\r\n if (Calendar_Events::$calsettings->show_admin == 1) {\r\n //admin\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'adm.start', $datecond);\r\n $q .= \"SELECT id, title, start, date_format(start, '%Y-%m-%d') startdate, duration, date_format(addtime(start, time(duration)), '%Y-%m-%d %H:%i') `end`, content, 'admin' event_group, 'event-success' class, 'admin' event_type, null as course FROM admin_calendar adm \"\r\n . \"WHERE visibility_level >= ?d \" . $dc;\r\n $q_admin_events_args = $q_args_templ;\r\n $q_admin_events_args[0] = Calendar_Events::get_user_visibility_level();\r\n $q_args = array_merge($q_args, $q_admin_events_args);\r\n }\r\n if (Calendar_Events::$calsettings->show_course == 1) {\r\n // agenda\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'ag.start', $datecond);\r\n $q .= \"SELECT ag.id, CONCAT(c.title,': ',ag.title), ag.start, date_format(ag.start,'%Y-%m-%d') startdate, ag.duration, date_format(addtime(ag.start, time(ag.duration)), '%Y-%m-%d %H:%i') `end`, content, 'course' event_group, 'event-info' class, 'agenda' event_type, c.code course \"\r\n . \"FROM agenda ag JOIN course_user cu ON ag.course_id=cu.course_id \"\r\n . \"JOIN course c ON cu.course_id=c.id \"\r\n . \"JOIN course_module cm ON c.id=cm.course_id \"\r\n . \"WHERE cu.user_id = ?d \"\r\n . \"AND ag.visible = 1 \"\r\n . \"AND cm.module_id = \" . MODULE_ID_AGENDA . \" \"\r\n . \"AND cm.visible = 1 \"\r\n . \"AND c.visible != \" . COURSE_INACTIVE . \" \"\r\n . $dc;\r\n $q_args = array_merge($q_args, $q_args_templ);\r\n\r\n // BigBlueButton\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'tc.start_date', $datecond);\r\n $q .= \"SELECT tc.id, CONCAT(c.title,': ',tc.title), tc.start_date start, date_format(tc.start_date,'%Y-%m-%d') startdate, '00:00' duration, date_format(tc.start_date, '%Y-%m-%d %H:%i') `end`, tc.description content, 'course' event_group, 'event-info' class, 'teleconference' event_type, c.code course \"\r\n . \"FROM tc_session tc JOIN course_user cu ON tc.course_id=cu.course_id \"\r\n . \"JOIN course c ON cu.course_id=c.id \"\r\n . \"WHERE cu.user_id = ?d AND tc.active = '1' AND c.visible != \" . COURSE_INACTIVE . \" \"\r\n . $dc;\r\n $q_args = array_merge($q_args, $q_args_templ);\r\n\r\n // requests\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'rfd.data', $datecond);\r\n $q .= \"SELECT req.id, concat(c.title, ?s, req.title), concat(rfd.data, ' 08:00:00') start, rfd.data startdate, '00:00' duration, concat(rfd.data, ' 08:00:01') `end`, concat(req.description, '\\n', '(deadline: ', rfd.data, ')') content, 'course' event_group, 'event-info' class, 'request' event_type, c.code course \"\r\n . \"FROM request req JOIN course c ON req.course_id = c.id\r\n JOIN request_field_data rfd ON rfd.request_id = req.id\r\n JOIN request_field rf ON rf.id = rfd.field_id\r\n LEFT JOIN request_watcher rw ON req.id = rw.request_id\r\n WHERE req.state NOT IN (?d, ?d)\r\n AND (req.creator_id = ?d OR rw.user_id = ?d) \"\r\n . $dc;\r\n $q_args = array_merge($q_args, [': ' . trans('langSingleRequest') . ': ',\r\n REQUEST_STATE_LOCKED, REQUEST_STATE_CLOSED, $uid], $q_args_templ);\r\n }\r\n if (Calendar_Events::$calsettings->show_deadline == 1) {\r\n // assignments\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n\r\n $dc = str_replace('start', 'ass.deadline', $datecond);\r\n $q .= \"SELECT ass.id, CONCAT(c.title,': ',ass.title), ass.deadline start, date_format(ass.deadline,'%Y-%m-%d') startdate, '00:00' duration, date_format(ass.deadline, '%Y-%m-%d %H:%i') `end`, concat(ass.description,'\\n','(deadline: ',deadline,')') content, 'deadline' event_group, 'event-important' class, 'assignment' event_type, c.code course \"\r\n . \"FROM assignment ass JOIN course_user cu ON ass.course_id=cu.course_id \"\r\n . \"JOIN course c ON cu.course_id=c.id LEFT JOIN assignment_to_specific ass_sp ON ass.id=ass_sp.assignment_id \"\r\n . \"WHERE cu.user_id = ?d \" . $dc\r\n . \"AND (assign_to_specific = 0 OR\r\n ass.id IN\r\n (SELECT assignment_id FROM assignment_to_specific WHERE user_id = ?d\r\n UNION\r\n SELECT assignment_id FROM assignment_to_specific\r\n WHERE group_id != 0 $group_sql_template2)\r\n OR cu.status = 1) \"\r\n . \"AND ass.active = 1 AND c.visible != \" . COURSE_INACTIVE . \" \";\r\n $q_args = array_merge($q_args, $q_args_templ, array($user_id), $student_groups);\r\n\r\n // exercises\r\n if (!empty($q)) {\r\n $q .= \" UNION \";\r\n }\r\n $dc = str_replace('start', 'ex.end_date', $datecond);\r\n $q .= \"SELECT ex.id, CONCAT(c.title,': ',ex.title), ex.end_date start, date_format(ex.end_date,'%Y-%m-%d') startdate, '00:00' duration, date_format(addtime(ex.end_date, time('00:00')), '%Y-%m-%d %H:%i') `end`, concat(ex.description,'\\n','(deadline: ',ex.end_date,')') content, 'deadline' event_group, 'event-important' class, 'exercise' event_type, c.code course \"\r\n . \"FROM exercise ex JOIN course_user cu ON ex.course_id=cu.course_id \"\r\n . \"JOIN course c ON cu.course_id=c.id LEFT JOIN exercise_to_specific ex_sp ON ex.id = ex_sp.exercise_id \"\r\n . \"WHERE cu.user_id = ?d \" . $dc\r\n . \"AND ex.public = 1 AND ex.active = 1 AND (assign_to_specific = 0 OR ex_sp.user_id = ?d $group_sql_template) AND c.visible != \" . COURSE_INACTIVE . \" \";\r\n $q_args = array_merge($q_args, $q_args_templ, array($user_id), $student_groups);\r\n }\r\n }\r\n if (empty($q)) {\r\n return null;\r\n }\r\n $q .= \" ORDER BY start, event_type\";\r\n return Database::get()->queryArray($q, $q_args);\r\n }",
"public function getCalendarObjects($calendarId)\n {\n $params[\"calendar_id\"] = $calendarId;\n\n list($type, $user) = explode(\"_\", $calendarId);\n\n $events = MyScEvents::getMyScEvents($params);\n\n// Info: Array scheme\n// $events[] = array(\n// \"allDay\"=> false,\n// \"description\" => $description,\n// \"end\" => $end->format(\"Y-m-d H:i:s\"),\n// \"id\" => $id,\n// \"start\" => $start->format(\"Y-m-d H:i:s\"),\n// \"title\" => $title,\n// \"summary\" => \"Test2\",\n// \"calendardata\" => \"BEGIN:VCALENDAR\\nVERSION:2.0\\n\"\n// . \"PRODID:mySchoolCalendar\"\n// . \\OCP\\App::getAppVersion('mySchoolCalendar') . \"\\n\"\n// . $vevent->serialize() . \"END:VCALENDAR\"\n// );\n\n $objects = array();\n\n foreach ($events as $event) {\n $object = array(\n \"id\" => $event[\"id\"],\n \"uri\" => $type . \"_event_\" . $event[\"id\"],\n \"lastmodified\" => time(),\n \"calendarid\" => $calendarId,\n \"calendardata\" => $event[\"calendardata\"]\n );\n\n $objects[] = $object;\n }\n\n return $objects;\n }",
"public function getAllServicesByUser($userId) {\n $services = self::find()->where(['created_by' => $userId])->all();\n\n return $services;\n }",
"public function findTodasLasReservas($usuario)\n {\n $em = $this->getEntityManager();\n \n $consulta = $em->createQuery('SELECT r FROM ReservaBundle:Reserva r JOIN r.espacio e WHERE r.usuario = :id ORDER BY r.fecha DESC');\n $consulta->setParameter('id', $usuario); \n \n return $consulta->getResult();\n }",
"public static function getCollections($user_id, $options = []) {\n\t\t$options = array_merge([\n\t\t\t'type' => 'all',\n\t\t\t'conditions' => []\n\t\t], $options);\n\n\t\t//Remove contain flag, all must be included!\n\t\tif (isset($options['contain'])) {\n\t\t\tunset($options['contain']);\n\t\t}\n\n\t\t//Conditions\n\t\t$options['conditions']['UserCollection.deleted'] = 0;\n\t\t$options['conditions']['UserCollection.revision_id'] = 0;\n\t\t$options['conditions']['UserCollection.user_id'] = $user_id;\n\n\t\treturn parent::$db->selectEx(new self(), $options);\n\t}",
"public function allByUser($user)\n {\n $this->andWhere('[[account_id]]=' . $user);\n return $this;\n }",
"public function index()\n {\n return Calendar::all();\n }",
"public function getAll($user = \"\")\n {\n $log = $user == \"\" ? R::findAll('mcslogs') : R::findAll('mcslogs',' user = :user', array( ':user' => $user ));\n return $log;\n }",
"public function findPublicCalendarsByTerm($term, UserInterface $user)\r\n {\r\n $qb = $this->repository->createQueryBuilder('c');\r\n $qb->select('c.id, c.name, u.username');\r\n $qb->join('c.createdBy', 'u');\r\n $qb->where('c.name LIKE :term');\r\n $qb->orWhere('c.description LIKE :term');\r\n $qb->orWhere('u.username LIKE :term');\r\n $qb->andWhere('c.visible = :visible');\r\n $qb->andwhere('c.createdBy != :user');\r\n $qb->setMaxResults($this->autocompleteMaxResults);\r\n $qb->orderBy('c.name', 'ASC');\r\n $qb->setParameter('term', '%' . $term . '%');\r\n $qb->setParameter('visible', true);\r\n $qb->setParameter('user', $user);\r\n\r\n return $qb->getQuery()->getScalarResult();\r\n }",
"public function countPublicCalendars(UserInterface $user)\r\n {\r\n $qb = $this->repository->createQueryBuilder('c');\r\n $qb->select('COUNT(c.id)');\r\n $qb->where('c.visible = :visible');\r\n $qb->andwhere('c.createdBy != :user');\r\n $qb->setParameter('visible', true);\r\n $qb->setParameter('user', $user);\r\n\r\n return $qb->getQuery()->getSingleScalarResult();\r\n }"
] | [
"0.8625929",
"0.739091",
"0.65626097",
"0.6485882",
"0.6477315",
"0.6391695",
"0.59377193",
"0.5838466",
"0.5786328",
"0.5778732",
"0.57739645",
"0.5744249",
"0.57347906",
"0.572469",
"0.5718613",
"0.56601167",
"0.55454266",
"0.55454266",
"0.54526913",
"0.5445954",
"0.54184556",
"0.54075",
"0.54046094",
"0.5401774",
"0.5396446",
"0.53947824",
"0.53838414",
"0.53654194",
"0.53589463",
"0.53460026"
] | 0.8041804 | 1 |
Find all public calendars by given term (name, description or creator of the calendar) of other users. | public function findPublicCalendarsByTerm($term, UserInterface $user)
{
$qb = $this->repository->createQueryBuilder('c');
$qb->select('c.id, c.name, u.username');
$qb->join('c.createdBy', 'u');
$qb->where('c.name LIKE :term');
$qb->orWhere('c.description LIKE :term');
$qb->orWhere('u.username LIKE :term');
$qb->andWhere('c.visible = :visible');
$qb->andwhere('c.createdBy != :user');
$qb->setMaxResults($this->autocompleteMaxResults);
$qb->orderBy('c.name', 'ASC');
$qb->setParameter('term', '%' . $term . '%');
$qb->setParameter('visible', true);
$qb->setParameter('user', $user);
return $qb->getQuery()->getScalarResult();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCalendars(User $user = null);",
"function get_calendars() {\n\n\t\t// Get the attached calendars\n\t\t$calendars = wp_get_post_terms( $this->post_id , 'calendar' );\n\t\t$this->calendars = $calendars;\n\t\t\n\t\t// Loop through calendars, checking permissions\n\t\tforeach ( $calendars as $calendar ) {\n\t\t\t\n\t\t\t// Is it a group calendar?\n\t\t\tif ( is_group_calendar( $calendar->term_id ) ) :\n\t\t\t\t$group_id\t= groups_get_id( $calendar->slug );\n\t\t\t\t$can_view \t= groups_is_user_member( get_current_user_id() , $group_id ) ? true : false;\n\t\t\telse :\n\t\t\t\t$can_view = true;\n\t\t\tendif;\n\t\t\t\n\t\t\t// If we find a calendar for which the user is authorized, go ahead and display it\n\t\t\tif( $can_view ) :\n\t\t\t\t$this->calendar = $calendar;\n\t\t\t\t$this->can_view = true;\n\t\t\t\tbreak;\n\t\t\tendif;\n\t\t}\n\n\t\t// If the user is not allowed to view any calendar, redirect them to the group\n\t\tif ( !$can_view ) {\n\t\t\t$redirect = SITEURL . '/groups/' . $this->calendar->slug;\n\t\t\tbp_core_add_message( 'You cannot access events on this calendar.' , 'error' );\n\t\t\tbp_core_redirect( $redirect );\n\t\t}\n\t}",
"public function listCalendars()\n {\n Kronolith::initialize();\n $all_external_calendars = $GLOBALS['calendar_manager']->get(Kronolith::ALL_EXTERNAL_CALENDARS);\n $result = new stdClass;\n $auth_name = $GLOBALS['registry']->getAuth();\n\n // Calendars. Do some twisting to sort own calendar before shared\n // calendars.\n foreach (array(true, false) as $my) {\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_CALENDARS) as $id => $calendar) {\n $owner = ($auth_name && ($calendar->owner() == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['internal'][$id] = $calendar->toHash();\n }\n }\n\n // Tasklists\n if (Kronolith::hasApiPermission('tasks')) {\n foreach ($GLOBALS['registry']->tasks->listTasklists($my, Horde_Perms::SHOW, false) as $id => $tasklist) {\n if (isset($all_external_calendars['tasks/' . $id])) {\n $owner = ($auth_name &&\n ($tasklist->get('owner') == $auth_name));\n if (($my && $owner) || (!$my && !$owner)) {\n $result->calendars['tasklists']['tasks/' . $id] =\n $all_external_calendars['tasks/' . $id]->toHash();\n }\n }\n }\n }\n }\n\n // Resources\n if (!empty($GLOBALS['conf']['resource']['driver'])) {\n foreach (Kronolith::getDriver('Resource')->listResources() as $resource) {\n if ($resource->get('type') != Kronolith_Resource::TYPE_GROUP) {\n $rcal = new Kronolith_Calendar_Resource(array(\n 'resource' => $resource\n ));\n $result->calendars['resource'][$resource->get('calendar')] = $rcal->toHash();\n } else {\n $rcal = new Kronolith_Calendar_ResourceGroup(array(\n 'resource' => $resource\n ));\n $result->calendars['resourcegroup'][$resource->getId()] = $rcal->toHash();\n }\n }\n }\n\n // Timeobjects\n foreach ($all_external_calendars as $id => $calendar) {\n if ($calendar->api() != 'tasks' && $calendar->display()) {\n $result->calendars['external'][$id] = $calendar->toHash();\n }\n }\n\n // Remote calendars\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_REMOTE_CALENDARS) as $url => $calendar) {\n $result->calendars['remote'][$url] = $calendar->toHash();\n }\n\n // Holidays\n foreach ($GLOBALS['calendar_manager']->get(Kronolith::ALL_HOLIDAYS) as $id => $calendar) {\n $result->calendars['holiday'][$id] = $calendar->toHash();\n }\n\n return $result;\n }",
"public function findCalendarsByUser(UserInterface $user)\r\n {\r\n $qb = $this->repository->createQueryBuilder('c');\r\n $qb->where('c.createdBy = :user');\r\n $qb->setParameter('user', $user);\r\n\r\n return $qb->getQuery()->execute();\r\n }",
"public static function getSharedCalendarsForUser($a_usr_id = 0)\r\n\t{\r\n\t\tglobal $ilDB,$ilUser,$rbacreview;\r\n\t\t\r\n\t\tif(!$a_usr_id)\r\n\t\t{\r\n\t\t\t$a_usr_id = $ilUser->getId();\r\n\t\t}\r\n\r\n\t\t$query = \"SELECT * FROM cal_shared \".\r\n\t\t\t\"WHERE obj_type = \".$ilDB->quote(self::TYPE_USR ,'integer').\" \".\r\n\t\t\t\"AND obj_id = \".$ilDB->quote($a_usr_id ,'integer').\" \".\r\n\t\t\t\"ORDER BY create_date\";\r\n\t\t$res = $ilDB->query($query);\r\n\t\t$calendars = array();\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\t$calendars[] = $row->cal_id; \r\n\t\t\t\r\n\t\t\t$shared[$row->cal_id]['cal_id'] = $row->cal_id;\r\n\t\t\t$shared[$row->cal_id]['create_date'] = $row->create_date;\r\n\t\t\t$shared[$row->cal_id]['obj_type'] = $row->obj_type;\r\n\t\t}\r\n\t\t\r\n\t\t$assigned_roles = $rbacreview->assignedRoles($ilUser->getId());\r\n\t\t\r\n\t\t$query = \"SELECT * FROM cal_shared \".\r\n\t\t\t\"WHERE obj_type = \".$ilDB->quote(self::TYPE_ROLE ,'integer').\" \".\r\n\t\t\t\"AND \".$ilDB->in('obj_id',$assigned_roles,false ,'integer');\r\n\r\n\t\t$res = $ilDB->query($query);\r\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\r\n\t\t{\r\n\t\t\tif(in_array($row->cal_id,$calendars))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(ilCalendarCategories::_isOwner($ilUser->getId(),$row->cal_id))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$shared[$row->cal_id]['cal_id'] = $row->cal_id;\r\n\t\t\t$shared[$row->cal_id]['create_date'] = $row->create_date;\r\n\t\t\t$shared[$row->cal_id]['obj_type'] = $row->obj_type;\r\n\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t\treturn $shared ? $shared : array();\r\n\t\t// TODO: return also role calendars\r\n\t\t\r\n\t}",
"public function calendarSearchAction(Request $request)\r\n {\r\n if (false === $this->getSecurity()->isGranted('IS_AUTHENTICATED_REMEMBERED')) {\r\n throw new AccessDeniedException();\r\n }\r\n\r\n $isAjax = $request->isXmlHttpRequest();\r\n\r\n if ($isAjax) {\r\n $results = $this->getCalendarManager()->findPublicCalendarsByTerm($request->query->get('term'), $this->getUser());\r\n\r\n $json = array();\r\n foreach ($results as $result) {\r\n $json[] = $result;\r\n };\r\n\r\n return new Response(json_encode($json));\r\n }\r\n\r\n return new Response('This is not ajax.', 400);\r\n }",
"public static function getPersons($term) {\n $sql = \"SELECT \n usuarios.dni, usuarios.nombre_persona, usuarios.dni+' '+usuarios.nombre_persona as label\n FROM\n (select \n persona.CodPer as dni\n ,persona.Nombres\n ,persona.Ape1\n ,persona.Ape2\n ,(RTRIM(persona.Nombres)+' '+RTRIM(persona.Ape1)+' '+RTRIM(persona.Ape2)) as nombre_persona\n from dbo.Identis persona\n left join dbo.permis usuario ON(\n persona.CodPer = usuario.LogIn\n )\n where usuario.FHasta >= GETDATE()\n ) usuarios\n WHERE usuarios.nombre_persona+usuarios.dni LIKE '%{$term}%'\n group BY usuarios.dni, usuarios.nombre_persona \";\n\n $command = Yii::$app->chacad->createCommand($sql);\n return $command->queryAll();\n }",
"function getAllUsersMatching($terms){\n\t\treturn $this->avalanche->getAllUsersMatching($terms);\n\t}",
"public function getCalendarEvents($organizationId, $userId, $calendarId, $start, $end, $connections, $extraField);",
"function loadPublicCalendars() {\n $sql = \"\n SELECT c.calendar_id, c.title, c.color\n FROM %s AS c\n WHERE c.surfer_id IS NULL\n ORDER BY c.title\n \";\n $result = $this->databaseQueryFmt($sql, $this->tableCalendars);\n if (!$result || $result->count() == 0) {\n // database error or no public calendars defined\n return FALSE;\n }\n\n $calendars = array();\n while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {\n $calendars[] = $row;\n }\n\n return $calendars;\n }",
"function search($term, $fields=array(), $limit=array()) { /* {{{ */\n\t\t$querystr = '';\n\t\t$term = trim($term);\n\t\tif($term) {\n\t\t\t$querystr = substr($term, -1) != '*' ? $term.'*' : $term;\n\t\t}\n\t\tif(!empty($fields['owner'])) {\n\t\t\tif(is_string($fields['owner'])) {\n\t\t\t\tif($querystr)\n\t\t\t\t\t$querystr .= ' ';\n\t\t\t\t$querystr .= 'owner:'.$fields['owner'];\n\t\t\t} elseif(is_array($fields['owner'])) {\n\t\t\t\tif($querystr)\n\t\t\t\t\t$querystr .= ' ';\n\t\t\t\t$querystr .= '(owner:';\n\t\t\t\t$querystr .= implode(' OR owner:', $fields['owner']);\n\t\t\t\t$querystr .= ')';\n\t\t\t}\n\t\t}\n\t\tif(!empty($fields['category'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(category:';\n\t\t\t$querystr .= implode(' OR category:', $fields['category']);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['status'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$status = array_map(function($v){return $v+10;}, $fields['status']);\n\t\t\t$querystr .= '(status:';\n\t\t\t$querystr .= implode(' OR status:', $status);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['user'])) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(users:';\n\t\t\t$querystr .= implode(' OR users:', $fields['user']);\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['rootFolder']) && $fields['rootFolder']->getFolderList()) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(path:';\n\t\t\t$querystr .= str_replace(':', 'x', $fields['rootFolder']->getFolderList().$fields['rootFolder']->getID().':');\n\t\t\t$querystr .= ')';\n\t\t}\n\t\tif(!empty($fields['startFolder']) && $fields['startFolder']->getFolderList()) {\n\t\t\tif($querystr)\n\t\t\t\t$querystr .= ' ';\n\t\t\t$querystr .= '(path:';\n\t\t\t$querystr .= str_replace(':', 'x', $fields['startFolder']->getFolderList().$fields['startFolder']->getID().':');\n\t\t\t$querystr .= ')';\n\t\t}\n\t\ttry {\n\t\t\t$result = $this->index->find($querystr, $limit);\n\t\t\t$recs = array();\n\t\t\tforeach($result[\"hits\"] as $hit) {\n\t\t\t\t$recs[] = array('id'=>$hit->id, 'document_id'=>$hit->documentid);\n\t\t\t}\n\t\t\treturn array('count'=>$result['count'], 'hits'=>$recs, 'facets'=>array());\n\t\t} catch (Exception $e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function usuarios()\n {\n $parametros = Input::only('term');\n\n $data = SisUsuario::with(\"SisUsuariosGrupos\", \"SisUsuariosContactos\")->where(function($query) use ($parametros) {\n $query->where('nombre','LIKE',\"%\".$parametros['term'].\"%\")\n ->orWhere('email','LIKE',\"%\".$parametros['term'].\"%\");\n });\n\n $data = $data->get();\n return $this->respuestaVerTodo($data);\n }",
"public function getCalendarsForUser($principalUri) {\n\t\n\n\t\t\\GO::debug(\"c:getCalendarsForUser($principalUri)\");\n\t\t\n\t\tif(!isset($this->_cachedCalendars[$principalUri])){\n\t\t\n\t\t\t$user = $this->_getUser($principalUri);\n\t\t\t\t\t\n\t\t\t$findParams = \\GO\\Base\\Db\\FindParams::newInstance()->ignoreAcl()\n\t\t\t\t->joinModel(array(\n\t\t\t\t\t\t'model' => 'GO\\Sync\\Model\\UserCalendar',\n\t\t\t\t\t\t'localTableAlias' => 't', //defaults to \"t\"\n\t\t\t\t\t\t'localField' => 'id', //defaults to \"id\"\n\t\t\t\t\t\t'foreignField' => 'calendar_id', //defaults to primary key of the remote model\n\t\t\t\t\t\t'tableAlias' => 'l', //Optional table alias\n\t\t\t\t))\n\t\t\t\t->criteria(\\GO\\Base\\Db\\FindCriteria::newInstance()->addCondition('user_id', $user->id, '=', 'l'));\n\n\t\t\t$stmt = \\GO\\Calendar\\Model\\Calendar::model()->find($findParams);\n\t\t\t\n\t\t\tif(!$stmt->rowCount()){\t\t\n\t\t\t //If the sync settings dialog for this user is never opened no default settings are created\n\t\t\t \\GO\\Sync\\Model\\Settings::model()->findForUser($user); //create default settings\n\t\t\t $stmt = \\GO\\Calendar\\Model\\Calendar::model()->find($findParams);\n\t\t\t}\n\n\t\t\t$this->_cachedCalendars[$principalUri] = array();\n\t\t\twhile ($calendar = $stmt->fetch()) {\n\t\t\t\t$this->_cachedCalendars[$principalUri][] = $this->_modelToDAVCalendar($calendar, $principalUri);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\\GO::debug($this->_cachedCalendars[$principalUri]);\n\t\t\n\t\treturn $this->_cachedCalendars[$principalUri];\n\t}",
"function getAllVisibleAuthors()\r\n {\r\n $CI = &get_instance();\r\n $userlogin=getUserLogin();\r\n \r\n if ($userlogin->hasRights('read_all_override'))\r\n return $this->getAllAuthors();\r\n \r\n if ($userlogin->isAnonymous()) //get only public authors\r\n {\r\n $Q = $CI->db->query(\"SELECT DISTINCT \".AIGAION_DB_PREFIX.\"author.* FROM \".AIGAION_DB_PREFIX.\"author, \".AIGAION_DB_PREFIX.\"publicationauthorlink, \".AIGAION_DB_PREFIX.\"publication\r\n WHERE \".AIGAION_DB_PREFIX.\"publication.derived_read_access_level = 'public'\r\n AND \".AIGAION_DB_PREFIX.\"publicationauthorlink.pub_id = \".AIGAION_DB_PREFIX.\"publication.pub_id \r\n AND \".AIGAION_DB_PREFIX.\"author.author_id = \".AIGAION_DB_PREFIX.\"publicationauthorlink.author_id\r\n ORDER BY \".AIGAION_DB_PREFIX.\"author.cleanname\");\r\n }\r\n else //get all non-private authors and authors for publications that belong to the user\r\n {\r\n $Q = $CI->db->query(\"SELECT DISTINCT \".AIGAION_DB_PREFIX.\"author.* FROM \".AIGAION_DB_PREFIX.\"author, \".AIGAION_DB_PREFIX.\"publicationauthorlink, \".AIGAION_DB_PREFIX.\"publication\r\n WHERE (\".AIGAION_DB_PREFIX.\"publication.derived_read_access_level != 'private' \r\n OR \".AIGAION_DB_PREFIX.\"publication.user_id = \".$userlogin->userId().\")\r\n AND \".AIGAION_DB_PREFIX.\"publicationauthorlink.pub_id = \".AIGAION_DB_PREFIX.\"publication.pub_id \r\n AND \".AIGAION_DB_PREFIX.\"author.author_id = \".AIGAION_DB_PREFIX.\"publicationauthorlink.author_id\r\n ORDER BY \".AIGAION_DB_PREFIX.\"author.cleanname\");\r\n }\r\n \r\n //retrieve results or fail \r\n foreach ($Q->result() as $row)\r\n {\r\n $next = $this->getFromRow($row);\r\n if ($next != null)\r\n {\r\n $result[] = $next;\r\n }\r\n }\r\n return $result;\r\n \r\n }",
"function cwrc_get_authorities_list($setup_data, $query) {\n $collection = $setup_data['collection'];\n $query_string = 'collection:\"' . $collection . '\"';\n // $records = emic_process_query($query_string);\n $terms = explode(' ', $query);\n $terms = array_filter($terms);\n $solr = variable_get('islandora_solr_search_block_url', 'http://localhost:8080/solr');\n\n $url = \"http://$solr/select?indent=on&version=2.2&q=$query_string&fq=&start=0&rows=1000&qt=standard&wt=json&explainOther=&hl.fl=\";\n $results = json_decode(file_get_contents($url), TRUE);\n $docs = $results['response']['docs'];\n foreach ($docs as $doc) {\n $pid = $doc['PID'];\n $contents = array();\n foreach ($doc['emic.searchname'] as $sample) {\n $identifier = null;\n if (!empty($sample) & !$identifier) {\n $identifier = $sample;\n }\n }\n //$identifier = implode('', $doc['emic.searchname']);\n $contents['identifier'] = $identifier;\n $contents['Object'] = \"<a href='/fedora/repository/$pid' target='_blank'>$pid</a>\";\n $contents['Note'] = $doc['dc.description'][0];\n $records[$doc['PID']] = $contents;\n }\n\n while (count($terms) > 0) {\n $term = array_shift($terms) . \"*\";\n $query_string = 'collection:\"' . $collection . '\" AND emic.searchname:' . strtolower($term);\n\n $new_records = emic_process_query($query_string);\n if (is_array($new_records) && is_array($records)) {\n $records = array_intersect_key($records, $new_records);\n }\n }\n if (is_array($records)) {\n return array_values($records);\n }\n}",
"public function get_calendar_list() {\n $calendars = array();\n $uri = 'https://www.googleapis.com/calendar/v3/users/me/calendarList';\n $params = array(\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->get_access_token(),\n ),\n );\n\n $response = wp_remote_get( $uri, $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $calendars = $body->items;\n\n $this->debug( 'Calendar List retrieved successfully', $body );\n } else {\n $this->error( 'Error while retrieving Calendar List: ', $response );\n }\n\n return $calendars;\n }",
"function getCalendarsForAdmin() {\n //\n // http://dev4.krubner.com/admin.php?page=admin_calendar\n //\n // this brings back 2 months worth of days to show in a calendar\n\n global $controller; \n\n $today = new DateTime(date('Y-m-d'));\n\n //Get Calendar for this week\n if(!isset($_GET['ym'])){\n $top_month = date('Y-m');\n } else {\n $top_month = $_GET['ym'];\n }\n\n $firstDayOfMonthDateTime = new DateTime($top_month.\"-01\");\n $lastDayOfMonthDateTime = clone $firstDayOfMonthDateTime;\n $lastDayOfMonthDateTime->modify(\"+1 month\");\n $lastDayOfMonthDateTime->modify(\"-1 day\");\n\n $arrayOfDaysForThisMonth = array();\n $arrayOfDaysForThisMonth = $controller->command(\"loadAllNights\", $firstDayOfMonthDateTime, $lastDayOfMonthDateTime); \n\n $calendars = array();\n $calendars[$top_month] = $arrayOfDaysForThisMonth;\n\n $firstDayOfMonthDateTime2 = clone $firstDayOfMonthDateTime;\n $firstDayOfMonthDateTime2->modify(\"+1 month\");\n $lastDayOfMonthDateTime2 = clone $firstDayOfMonthDateTime2;\n $lastDayOfMonthDateTime2->modify(\"+1 month\");\n $lastDayOfMonthDateTime2->modify(\"-1 day\");\n\n $arrayOfDaysForThisMonth = array();\n $arrayOfDaysForThisMonth = $controller->command(\"loadAllNights\", $firstDayOfMonthDateTime2, $lastDayOfMonthDateTime2); \n\n $calendars[$lastDayOfMonthDateTime2->format('Y-m')] = $arrayOfDaysForThisMonth;\n\n return $calendars; \n}",
"public function listByTerm($term, $offset = null)\n {\n $request = new Highrise_Api_Request();\n $request->endpoint = '/people/search.xml?term=' . str_replace(' ', '+', $term);\n $request->method = Highrise_Api_Client::METHOD_GET;\n $request->expected = 200;\n\n $response = $this->_client->request($request);\n \n $xml = simplexml_load_string($response->getData());\n $result = $xml->xpath('/people/person');\n $collection = array();\n if (!$result) return $collection;\n foreach ($result as $xmlEntry)\n {\n $person = new Highrise_Entity_Person();\n $person->fromXml($xmlEntry->saveXml());\n $collection[] = $person;\n }\n return $collection;\n }",
"private function internal_query($start, $limit, $year) {\n global $DB, $CFG;\n $from = '';\n $fromarray = array();\n $where = '';\n $wherearray = array();\n $total = '';\n\n $occurstable = year_tables::get_occurs_table($year);\n $docstable = year_tables::get_docs_table($year);\n\n $join = 0;\n foreach ($this->terms as $term) {\n foreach ($term->ids as $id) {\n $alias = \"o$join\";\n if ($join == 0) {\n $from .= \"{\" . $occurstable . \"} $alias \";\n $where .= \"$alias.wordid = ?\";\n $wherearray[] = $id;\n $total .= \"$alias.score\";\n } else {\n // Note: This line uses the id directly rather than as a ?\n // parameter, because.\n $from .= \"JOIN {\" . $occurstable . \"} $alias\n ON $alias.documentid = o0.documentid AND $alias.wordid = ? \";\n $fromarray[] = $id;\n $total .= \"+$alias.score\";\n }\n $join++;\n }\n }\n // Because it kills the server to search for a large number of terms\n // when the database is full, we need to limit it.\n $maxterms = $CFG->local_ousearch_maxterms;\n if ($join > $maxterms) {\n $referer = $_SERVER['HTTP_REFERER'];\n if (!$referer) {\n $referer = ''; // Use default.\n }\n throw new moodle_exception('toomanyterms', 'local_ousearch', $referer, $maxterms);\n }\n foreach ($this->negativeterms as $term) {\n if (count($term->ids) == 1) {\n $alias = \"o$join\";\n $from .= \"LEFT JOIN {\" . $occurstable . \"} $alias\n ON $alias.documentid = o0.documentid AND $alias.wordid = ?\";\n $fromarray[] = $term->ids[0];\n $total .= \"-(CASE WHEN $alias.score IS NULL THEN 0 ELSE 999999 END)\";\n $join++;\n }\n }\n\n list ($restrict, $restrictarray) = $this->internal_get_restrictions();\n $query = \"\n SELECT o0.documentid, $total AS totalscore, d.*,\n c.shortname AS courseshortname, c.fullname AS coursefullname,\n g.name AS groupname\n FROM $from\n JOIN {\" . $docstable . \"} d ON d.id = o0.documentid\n LEFT JOIN {course} c ON d.courseid = c.id\n LEFT JOIN {groups} g ON d.groupid = g.id\n WHERE $where\n $restrict\n AND $total > 0\n ORDER BY totalscore DESC, o0.documentid\";\n $queryarray = array_merge($fromarray, $wherearray, $restrictarray);\n $result = $DB->get_records_sql($query, $queryarray, $start, $limit);\n if (!$result) {\n $result = array();\n }\n return $result;\n }",
"public function getAll($searchTerm);",
"public function actionDocauthorAutoComplete($term)\n {\n header('Content-type: application/json');\n\n $criteria = new CDbCriteria();\n $criteria->compare('name', $term, true);\n $criteria->limit = 5;\n\n $data = Docauthor::model()->findAll($criteria);\n\n $result = array();\n foreach ($data as $m) {\n $result[] = array(\n 'value' => $m->name,\n 'label' => $m->name,\n );\n }\n\n echo CJSON::encode($result);\n Yii::app()->end();\n }",
"private function getEvents( $days , $filter = null , $startDate = null, $q = null, $city = null ){\n\t\t$events = array();\n\t\t$google_calendar_id = Yii::$app->params['google-calendar-id'];\n\t\t$google_api_key = Yii::$app->params['google-api-key'];\n\n\t\tif( is_null($startDate) )\n\t\t\t$startDate = new \\Datetime();\n\t\t$endPeriod = clone $startDate;\n\t\tif( $days < 84 )\n\t\t\t$movedays = $days;\n\t\telse{\n\t\t\t$movedays = 84;\n\t\t}\n\t\t$endPeriod->modify( ($movedays) . ' days');\n\t\t$format = 'Y-m-d';\n\t\tdo{\n\n\t\t\t$google_url = 'https://www.googleapis.com/calendar/v3/calendars/' . urlencode($google_calendar_id) . '/events?key=' . urlencode($google_api_key) . '&maxResults=2500&orderBy=startTime&singleEvents=true&timeMin=' . urlencode( $startDate->format($format) . 'T07:00:00+00:00') . '&timeMax=' . urlencode( $endPeriod->format($format) . 'T23:59:59+00:00' );\n\t\t\tif(isset($q)){\n\t\t\t\t$google_url.='&q='.urlencode($q);\n\t\t\t}\n\t\t\tif(isset($city) && !empty($city)){\n\t\t\t\t$google_url.='&sharedExtendedProperty=city%3D'.urlencode($city);\n\t\t\t}\n\t\t\t$json_array = $this->getFromApi( $google_url );\n\n\t\t\t$collected_events = $json_array['items'];\n\t\t\tif( !is_null($filter) ){\n\t\t\t\t$collected_events = $this->filterEvents( $filter , $collected_events );\n\t\t\t}\n\t\t\t$events = array_merge( $events , $collected_events );\n\n\t\t\t$startDate = $endPeriod;\n\t\t\t$endPeriod = clone $startDate;\n\t\t\tif( $days < 84 )\n\t\t\t\t$movedays = $days;\n\t\t\telse{\n\t\t\t\t$movedays = 84;\n\t\t\t}\n\t\t\t$endPeriod->modify( ($movedays) . ' days');\n\t\t\t$days-= 84;\n\t\t}while( $days > 0 );\n\n\t\treturn $events;\n\t}",
"public function search($val): AnonymousResourceCollection\n {\n $election = Election::where('election_name', 'like', '%'.$val.'%')->paginate(4);\n\n return ElectionResource::collection($election);\n }",
"public static function getAllSdById($term){\n // ->join('clienttype as ct', function($join){\n // $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n // })\n // ->join('acctstat as as', function($join){\n // $join->on('c.AccountStatus', '=', 'as.AcctStatID');\n // })\n // ->where('c.ClientID', '=', $clientIdSd)\n // ->get();\n\n return DB::table('client as c')\n ->join('clienttype as ct', function($join) {\n $join->on('c.ClientType', '=', 'ct.ClientTypeID');\n })\n ->join('acctstat as acs', function($join){\n $join->on('c.AccountStatus', '=', 'acs.AcctStatID');\n })\n ->where('c.ClientID', '=', $term)\n ->orWhere('c.FName', 'like', '%'.$term.'%')\n ->orWhere('c.LName', 'like', '%'.$term.'%')\n // ->where('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n // ->orWhere('c.AccountStatus', '=', $status)\n ->paginate(10);\n }",
"public function getCalendarItems($month = FALSE, $year = FALSE, $user_id = FALSE)\n\t{\n\t\t$sql = $this->db->select();\n\t\t$sql = $sql->from(array('i'=>'times'))->columns(array(new \\Zend\\Db\\Sql\\Expression('SUM(hours) AS total'), 'date', 'creator', 'user_id'));\n\n\t\tif($month)\n\t\t{\n\t\t\t$sql = $sql->where(array('month' => $month));\n\t\t}\n\t\t\n\t\tif($year)\n\t\t{\n\t\t\t$sql = $sql->where(array('year' => $year));\n\t\t}\n\t\t\n\t\tif($user_id)\n\t\t{\n\t\t\t$sql = $sql->where('creator = ? ', $user_id);\n\t\t}\t\t\t\t\n\t\t\n\t\t$sql = $sql->join(array('u' => 'users'), 'u.id = i.creator', array('creator_first_name' => 'first_name', 'creator_last_name' => 'last_name'), 'left');\t\t\t\t \n\t\t$sql = $sql->group('date')\n\t\t\t\t ->group('creator');\n\t\t\n\t\t$route_options = array('month' => $month, 'year' => $year);\n\t\t$route_options['user_id'] = $user_id;\n\t\t\n\t\treturn $this->_translateCalendarItems($this->getRows($sql), 'date', array('route_name' => 'times/view-day', 'options' => $route_options));\n\t}",
"public function searchContacts($userId, $searchterm)\n { \n $sql = \"SELECT * FROM contacts WHERE ((`firstname` LIKE ?) OR (`lastname` LIKE ?) OR (`phone` LIKE ?) OR (`city` LIKE ?) OR (`birthday` LIKE ?) OR (`email` LIKE ?)) AND (`userid`=?)\";\n $stmt = $this->pdo->prepare($sql);\n $stmt->execute([\"%$searchterm%\", \"%$searchterm%\", \"%$searchterm%\", \"%$searchterm%\", \"%$searchterm%\", \"%$searchterm%\", $userId]);\n return $stmt->fetchAll();\n }",
"public function getAuthors();",
"public function findCRTForAYear($user,$year)\n {\n $yearp1=$year+1;\n $qb = $this->createQueryBuilder('crt');\n $qb->where('crt.user = :user')\n ->andWhere($qb->expr()->orX(\n $qb->expr()->andX(\n $qb->expr()->eq('YEAR(crt.date )', $year),\n $qb->expr()->gt('MONTH(crt.date )', '5')\n ),\n $qb->expr()->andX(\n $qb->expr()->eq('YEAR(crt.date )', $yearp1),\n $qb->expr()->lte('MONTH(crt.date )', '5')\n )\n )\n \n )\n ->setParameter('user', $user)\n ;\n \n return $qb->getQuery()->getResult();\n }",
"public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }",
"private function busquedaUsuarios($filter = array()) {\n $usuarios = new \\Modelos\\userPosix($this->dn, $this->pswd, 'central' );\n $atributos = array('uid','cn','title','o', 'ou','mail', 'telephoneNumber');\n $filtro = empty($filter) ? array(\"cn\"=>\"NOT (root OR nobody)\") : array_merge($filter, array(\"cn\"=>\"NOT (root OR nobody)\"));\n $datos = $usuarios->search($filtro, $atributos, \"dc=sv\");\n $this->parametros['errorLdap'] = $usuarios->getErrorLdap();\n return $datos; \n }"
] | [
"0.5598045",
"0.5595388",
"0.5437381",
"0.5436465",
"0.5308328",
"0.52769184",
"0.521769",
"0.51238567",
"0.4972738",
"0.49298882",
"0.49289572",
"0.49045506",
"0.48545828",
"0.4790912",
"0.4786395",
"0.4769992",
"0.47561833",
"0.47351235",
"0.46823883",
"0.46598724",
"0.465732",
"0.4656136",
"0.4624035",
"0.46165702",
"0.46128997",
"0.46026406",
"0.4597121",
"0.4590554",
"0.4588253",
"0.45870352"
] | 0.74065596 | 0 |
Parses a dscan to an array | function parseDscan($dscan) {
$objects = array();
//Split into rows
$rows = explode("\n", $dscan);
//Iterate through our rows
foreach($rows as $row) {
//Check if it matches a dscan row format
if(preg_match("/^([^\t]+)\t([^\t]+)\t([^\t]+)\t(([0-9,.]+) (km|m|AU)|-)/", $row, $matches) == 1) {
$ob['type'] = $matches[3];
$ob['name'] = $matches[2];
//Parse distance
if(count($matches) == 5) {
//Unknown distance
$ob['distance'] = -1;
} else {
//Known distance
$ob['distance'] = distanceToMeters($matches[5], $matches[6]);
}
//Add to list
$objects[] = $ob;
}
}
return $objects;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function data2Array($data);",
"public function getDataprotArray() {\n\t\t$arr = array();\n\t\t$ds = $this->getDataprotXML();\n\t\tif (strlen($ds) > 1) {\n\t\t\t$arr = GeneralUtility::xml2array($ds);\n\t\t}\n\n\t\treturn $arr;\n\t}",
"function ussd_string_to_array($ussd_string){\n return explode(\"*\",$ussd_string);\n}",
"function parse($data) {\n $output=[];\n $val=0;\n foreach(str_split($data) as $value){\n switch($value){\n case 'i': $val++;break;\n case 'd': $val--; break;\n case 's': $val **= 2; break;\n case 'o': $output[] = $val; break;\n }\n }\n return $output;\n}",
"public function parse($input) {\n\t//--\n\treturn (array) $this->loadWithSource((array)$this->loadFromString((string)$input));\n\t//--\n}",
"abstract public function parseInput(array $input): array;",
"public function ParseFromArray() {\n $this->value = $this->reader->next();\n $this->clean();\n }",
"function darr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"uint8\",$n,$m);\n\t\t}",
"function parsescan($arLines)\n {\n #no data in first two lines.skip them.\n array_shift($arLines);\n array_shift($arLines);\n\n $result = array();\n foreach($arLines as $key=>$line)\n {\n if(trim($line) == '')\n {\n continue;\n }\n\n $arMatches = array();\n $temp = array();\n if (!preg_match($this->channelreg, $line, $arMatches))\n print \"channel not found\";\n\n $temp['channel']=$arMatches[0];\n\n $line = trim(substr($line,strlen($arMatches[0])));\n if (!preg_match($this->essidreg, $line, $arMatches))\n print \"essid not found\";\n\n $temp['essid']=trim($arMatches[0]);\n\n $line = trim(substr($line,strlen($arMatches[0])));\n if (!preg_match($this->macreg, $line, $arMatches))\n print \"mac not found\";\n\n $temp['mac']=$arMatches[0];\n\n $line = trim(substr($line,strlen($arMatches[0])));\n if (!preg_match($this->securityreg, $line, $arMatches))\n print \"security not found\";\n\n $temp['security']=$arMatches[0];\n\n $line = trim(substr($line,strlen($arMatches[0])));\n\n if (!preg_match($this->signalreg, $line, $arMatches))\n print \"signal not found\";\n\n $temp['signal']=$arMatches[0];\n\n array_push($result, $temp);\n\n print(\"\\n\");\n\n }\n return $result;\n }",
"public function importArray($data);",
"function parseDscanTower($dscan) {\n\t//Parse mods file\n\t$csv = explode(\"\\n\", file_get_contents(\"posmods.csv\"));\n\tforeach($csv as $mod) {\n\t\t$mod = str_getcsv($mod, \",\", \"\\\"\", \"\\\\\");\n\t\t$m['id'] = $mod[0];\n\t\t$m['igbName'] = $mod[1];\n\t\t$m['typeName'] = $mod[2];\n\t\t$mods[$m['typeName']] = $m;\n\t}\n\t\n\t//Parse control towers file\n\t$csv = explode(\"\\n\", file_get_contents(\"controltowers.csv\"));\n\tforeach($csv as $ct) {\n\t\t$ct = str_getcsv($ct, \",\", \"\\\"\", \"\\\\\");\n\t\t$m['id'] = $ct[0];\n\t\t$m['igbName'] = $ct[1];\n\t\t$m['typeName'] = $ct[2];\n\t\t$cts[$m['typeName']] = $m;\n\t}\n\t\n\t//Parse the dscan\n\t$pos = array();\n\t$ct = null;\n\t$rows = explode(\"\\n\", $dscan);\n\tforeach($rows as $row) {\n\t\t$cols = explode(\"\\t\", $row);\n\t\t\n\t\t//Check if it's on grid\n\t\tif(preg_match(\"/([0-9,]+) (km|m|AU)/\", $cols[2], $matches) == 1) {\n\t\t\t//Check if this module exists in our pos mod db\n\t\t\tif(array_search($cols[1], array_keys($mods)) != false) {\n\t\t\t\t//Add it to our pos\n\t\t\t\t$pos[] = $mods[$cols[1]];\n\t\t\t} else {\n\t\t\t\t//Check if it's a control tower\n\t\t\t\tif(array_search($cols[1], array_keys($cts)) != false) {\n\t\t\t\t\t//Check we don't already have one\n\t\t\t\t\tif($ct != null) {\n\t\t\t\t\t\tdie(\"Error, more than 1 control tower on scan\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$ct = $cts[$cols[1]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Check if empty\n\tif($ct === null) {\n\t\treturn null;\n\t}\n\t\n\t//Generate URL\n\t$url = \"http://eve.1019.net/pos/index.php?ct=%%CT%%&mod=%%MODS%%&off=\";\n\t$modlist = \"\";\n\tforeach($pos as $mod) {\n\t\t$modlist .= $mod['id'];\n\t}\n\t$url = str_replace(\"%%CT%%\", $ct['id'], $url);\n\t$url = str_replace(\"%%MODS%%\", $modlist, $url);\n\treturn $url;\n}",
"public function read(): array;",
"function sloodle_vector_to_array($vector)\n {\n if (preg_match('/<(.*?),(.*?),(.*?)>/',$vector,$vectorbits)) {\n $arr = array();\n $arr['x'] = $vectorbits[1];\n $arr['y'] = $vectorbits[2];\n $arr['z'] = $vectorbits[3];\n return $arr;\n }\n return false;\n }",
"public function parse2array() {\n\t\t/**\n\t\t * Thanks to Vladimir Struchkov <great_boba yahoo com> for providing the\n\t\t * code to extract base64 encoded values\n\t\t */\n\n\t\t$arr1 = explode( \"\\n\", str_replace( \"\\r\", '', $this->rawdata ) );\n\t\t$i = $j = 0;\n\t\t$arr2 = array();\n\n\t\t/* First pass, rawdata is splitted into raw blocks */\n\t\tforeach ( $arr1 as $v ) {\n\t\t\tif ( trim( $v ) == '' ) {\n\t\t\t\t++ $i;\n\t\t\t\t$j = 0;\n\t\t\t} else {\n\t\t\t\t$arr2[ $i ][ $j ++ ] = $v;\n\t\t\t}\n\t\t}\n\n\t\t/* Second pass, raw blocks are updated with their name/value pairs */\n\t\tforeach ( $arr2 as $k1 => $v1 ) {\n\t\t\t$i = 0;\n\t\t\t$decode = false;\n\t\t\tforeach ( $v1 as $v2 ) {\n\t\t\t\tif ( ereg( '::', $v2 ) ) { // base64 encoded, chunk start\n\t\t\t\t\t$decode = true;\n\t\t\t\t\t$arr = explode( ':', str_replace( '::', ':', $v2 ) );\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = base64_decode( $arr[1] );\n\t\t\t\t} elseif ( ereg( ':', $v2 ) ) {\n\t\t\t\t\t$decode = false;\n\t\t\t\t\t$arr = explode( ':', $v2 );\n\t\t\t\t\t$count = count( $arr );\n\t\t\t\t\tif ( $count != 2 ) {\n\t\t\t\t\t\tfor ( $i = $count - 1; $i > 1; -- $i ) {\n\t\t\t\t\t\t\t$arr[ $i - 1 ] .= ':' . $arr[ $i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $arr[1];\n\t\t\t\t} else {\n\t\t\t\t\tif ( $decode ) { // base64 encoded, next chunk\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] .= base64_decode( $v2 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $v2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"abstract public function array2Data($arr);",
"function csv_to_array($input, $delimiter=',') { \n $header = null; \n $data = array(); \n $csvData = str_getcsv($input, \"\\n\"); \n \n foreach($csvData as $csvLine){ \n if(is_null($header)) $header = explode($delimiter, $csvLine); \n else{ \n \n $items = explode($delimiter, $csvLine); \n \n for($n = 0, $m = count($header); $n < $m; $n++){ \n $prepareData[$header[$n]] = $items[$n]; \n } \n \n $data[] = $prepareData; \n } \n } \n \n return $data; \n}",
"function csv_to_array($input, $delimiter=',') { \n $header = null; \n $data = array(); \n $csvData = str_getcsv($input, \"\\n\"); \n \n foreach($csvData as $csvLine){ \n if(is_null($header)) $header = explode($delimiter, $csvLine); \n else{ \n \n $items = explode($delimiter, $csvLine); \n \n for($n = 0, $m = count($header); $n < $m; $n++){ \n $prepareData[$header[$n]] = $items[$n]; \n } \n \n $data[] = $prepareData; \n } \n } \n \n return $data; \n}",
"abstract public function to_array();",
"function parseSDSS($output) {\n\n $xml = new SimpleXMLElement($output);\n \n\t\t\t\t$xpath_run = \"//field[@col='run']\";\n $xpath_camcol = \"//field[@col='camcol']\";\n\t\t\t\t$xpath_rerun = \"//field[@col='rerun']\";\n $xpath_field = \"//field[@col='field']\";\n\n $out_run = $xml->xpath($xpath_run);\n $out_camcol = $xml->xpath($xpath_camcol);\n\t\t\t\t$out_rerun = $xml->xpath($xpath_rerun);\n $out_field = $xml->xpath($xpath_field);\n \n $imagefields = array();\n \n $i = 0;\n while(list( , $node) = each($out_run)) {\n $imagefields[$i] = array(trim($node), 0);\n $i++;\n }\n \n $i = 0;\n while(list( , $node) = each($out_camcol)) {\n $imagefields[$i][1] = trim($node);\n $i++;\n }\n\n\t\t\t\t$i = 0;\n\t while(list( , $node) = each($out_rerun)) {\n\t $imagefields[$i][2] = trim($node);\n\t $i++;\n\t }\n\t\t\t\t$i = 0;\n\t while(list( , $node) = each($out_field)) {\n\t $imagefields[$i][3] = trim($node);\n\t $i++;\n\t }\n \n return $imagefields;\n }",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function asArray();",
"public function parseFromArray()\n {\n $this->value = $this->reader->next();\n }",
"function raw_zone_to_array($data)\n{\n $records = array();\n $data = explode(\"\\n\", $data);\n foreach ($data as $line)\n {\n if (psf_string_startsWith($line, \";\"))\n continue;\n // This is a little bit hard-core, we need to parse output from dig, which is terrible\n // In past we did some magic by simply replacing all tabs and spaces to split it, but that doesn't work\n // for some special TXT records\n // For example:\n // 2 tabs tab double space\n // v v v\n // example.org.\t\t600\tIN\tTXT\t\"v=spf1 a mx include:_spf.example.org ip4:124.6.178.206 ~all\"\n //\n // keep in mind that dig is randomly using tabs as separators and randomly spaces\n //\n // So there are two easy ways of this mess\n // 1) we use regular expressions and pray a lot (we use this one)\n // 2) we simply walk through out the whole string, that's the correct way, but this is actually CPU intensive,\n // so we might want to implement this into some kind of C library I guess\n \n // Get rid of empty lines\n if (strlen(str_replace(\" \", \"\", $line)) == 0)\n continue;\n\n $records[] = preg_split('/[\\t\\s]/', $line, 5, PREG_SPLIT_NO_EMPTY);\n }\n return $records;\n}",
"function db_result_to_array($result){\n\t\t\t\t\t\t\t$res_array = array();\n\n\t\t\t\t\t\t\tfor($count=0; $row= @mysql_fetch_array($result); $count++)\n\t\t\t\t\t\t\t\t$res_array[$count] = $row;\n\t\t\t\t\t\t\treturn $res_array;\n\t\t\t\t\t\t}",
"function parseBISArray($str) {\n $str = substr($str, 1, -1); // Strip trailing quotes\n $bla = parseBISArray_helper($str);\n $result = array();\n\n foreach ($bla as $row) {\n foreach ($row as $child) {\n $result[] = $child;\n }\n if (count($row) == 0)\n $result[] = array();\n }\n //var_dump($result);\n return $result;\n}",
"public function _parse_to_array($in) {\n\t\t$string = str_replace(' ', '', trim($in));\n\t\t\n\t\tif ( ! empty($string)) {\n\t\t\treturn (array) explode('|', $string);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t}\n\t}"
] | [
"0.5584773",
"0.54677004",
"0.5435761",
"0.5323445",
"0.5300616",
"0.5297419",
"0.5217488",
"0.52032334",
"0.5166246",
"0.5157352",
"0.5154616",
"0.51353115",
"0.5130848",
"0.51080436",
"0.50948715",
"0.50821775",
"0.50821775",
"0.5065223",
"0.505185",
"0.502081",
"0.502081",
"0.502081",
"0.502081",
"0.502081",
"0.502081",
"0.500788",
"0.5003174",
"0.49915376",
"0.49260435",
"0.49218258"
] | 0.7394252 | 0 |
Parses a dscan down for an ongrid control tower | function parseDscanTower($dscan) {
//Parse mods file
$csv = explode("\n", file_get_contents("posmods.csv"));
foreach($csv as $mod) {
$mod = str_getcsv($mod, ",", "\"", "\\");
$m['id'] = $mod[0];
$m['igbName'] = $mod[1];
$m['typeName'] = $mod[2];
$mods[$m['typeName']] = $m;
}
//Parse control towers file
$csv = explode("\n", file_get_contents("controltowers.csv"));
foreach($csv as $ct) {
$ct = str_getcsv($ct, ",", "\"", "\\");
$m['id'] = $ct[0];
$m['igbName'] = $ct[1];
$m['typeName'] = $ct[2];
$cts[$m['typeName']] = $m;
}
//Parse the dscan
$pos = array();
$ct = null;
$rows = explode("\n", $dscan);
foreach($rows as $row) {
$cols = explode("\t", $row);
//Check if it's on grid
if(preg_match("/([0-9,]+) (km|m|AU)/", $cols[2], $matches) == 1) {
//Check if this module exists in our pos mod db
if(array_search($cols[1], array_keys($mods)) != false) {
//Add it to our pos
$pos[] = $mods[$cols[1]];
} else {
//Check if it's a control tower
if(array_search($cols[1], array_keys($cts)) != false) {
//Check we don't already have one
if($ct != null) {
die("Error, more than 1 control tower on scan");
}
$ct = $cts[$cols[1]];
}
}
}
}
//Check if empty
if($ct === null) {
return null;
}
//Generate URL
$url = "http://eve.1019.net/pos/index.php?ct=%%CT%%&mod=%%MODS%%&off=";
$modlist = "";
foreach($pos as $mod) {
$modlist .= $mod['id'];
}
$url = str_replace("%%CT%%", $ct['id'], $url);
$url = str_replace("%%MODS%%", $modlist, $url);
return $url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseDscan($dscan) {\n\t$objects = array();\n\t\n\t//Split into rows\n\t$rows = explode(\"\\n\", $dscan);\n\t\n\t//Iterate through our rows\n\tforeach($rows as $row) {\n\t\t//Check if it matches a dscan row format\n\t\tif(preg_match(\"/^([^\\t]+)\\t([^\\t]+)\\t([^\\t]+)\\t(([0-9,.]+) (km|m|AU)|-)/\", $row, $matches) == 1) {\n\t\t\t$ob['type'] = $matches[3];\n\t\t\t$ob['name'] = $matches[2];\n\t\t\t\n\t\t\t//Parse distance\n\t\t\tif(count($matches) == 5) {\n\t\t\t\t//Unknown distance\n\t\t\t\t$ob['distance'] = -1;\n\t\t\t} else {\n\t\t\t\t//Known distance\n\t\t\t\t$ob['distance'] = distanceToMeters($matches[5], $matches[6]);\n\t\t\t}\n\t\t\t\n\t\t\t//Add to list\n\t\t\t$objects[] = $ob;\n\t\t}\n\t}\n\t\n\treturn $objects;\n}",
"function getDscanTower($key) {\n\t/*$csv = explode(\"\\n\", file_get_contents(\"controltowers.csv\"));\n\tforeach($csv as $ct) {\n\t\t$ct = str_getcsv($ct, \",\", \"\\\"\", \"\\\\\");\n\t\t$m['id'] = $ct[0];\n\t\t$m['igbName'] = $ct[1];\n\t\t$m['typeName'] = $ct[2];\n\t\t$cts[$m['typeName']] = $m;\n\t}*/\n\n\t//Connect MySQL\n\t/*include(\"config.php\");\n\t$db = new PDO('mysql:host='.$mysql_host.';dbname='.$mysql_db.';charset=utf8', $mysql_user, $mysql_pass);\n\t\n\t//Check if scan exists\n\t$st = $db->prepare(\"SELECT * FROM dscanScans WHERE `key`=:key LIMIT 1\");\n\t$st->bindValue(\":key\", $key, PDO::PARAM_STR);\n\t$st->execute();\n\t$rows = $st->fetchAll(PDO::FETCH_ASSOC);\n\tif(count($rows) < 1) {\n\t\t//No scan found\n\t\treturn null;\n\t}\n\t\n\t//Get objects for scan\n\t$id = $rows[0]['id'];\n\t$st = $db->prepare(\"SELECT type, distance FROM dscanObjects WHERE scan=:scan AND distance >= 0\");\n\t$st->bindValue(\":scan\", $id, PDO::PARAM_STR);\n\t$st->execute();\n\t$rows = $st->fetchAll(PDO::FETCH_ASSOC);\n\t\n\t//Search objects for tower\n\t$found = false;\n\tforeach($rows as $row) {\n\t\tif(array_search($row['type'], array_keys($cts)) !== false) {\n\t\t\t$type = $row['type'];\n\t\t\t$found = true;\n\t\t}\n\t}*/\n\t\n\tif(true) {\n\t\t$dscan = file_get_contents(\"scans/\".$key);\n\t\t//echo $dscan;\n\t\treturn parseDscanTower($dscan);\n\t} else {\n\t\treturn null;\n\t}\n}",
"private function fillWireGrid($input): array\n {\n $grid = [0 => [0 => \"B\"]];\n\n foreach($input as $line_number => $line) {\n $last_x_cor = 0;\n $last_y_cor = 0;\n $line_steps = 0;\n foreach ($line as $instruction) {\n // A letter as dir and a number as cor the direction determines X or Y the number how much\n $direction = substr($instruction, 0, 1);\n $cor = (int) substr($instruction, 1);\n\n switch ($direction) {\n case \"U\":\n for ($new_x_cor = $last_x_cor + 1; $new_x_cor <= $last_x_cor + $cor; $new_x_cor++) {\n $line_steps++;\n $grid = $this->fillGridPoints($line_number, $grid, $new_x_cor, $last_y_cor, $line_steps);\n }\n $last_x_cor = $last_x_cor + $cor;\n break;\n case \"D\":\n for ($new_x_cor = $last_x_cor - 1; $new_x_cor >= $last_x_cor - $cor; $new_x_cor--) {\n $line_steps++;\n $grid = $this->fillGridPoints($line_number, $grid, $new_x_cor, $last_y_cor, $line_steps);\n }\n $last_x_cor = $last_x_cor - $cor;\n break;\n case \"R\":\n for ($new_y_cor = $last_y_cor + 1; $new_y_cor <= $last_y_cor + $cor; $new_y_cor++) {\n $line_steps++;\n $grid = $this->fillGridPoints($line_number, $grid, $last_x_cor, $new_y_cor, $line_steps);\n }\n $last_y_cor = $last_y_cor + $cor;\n break;\n case \"L\":\n for ($new_y_cor = $last_y_cor - 1; $new_y_cor >= $last_y_cor - $cor; $new_y_cor--) {\n $line_steps++;\n $grid = $this->fillGridPoints($line_number, $grid, $last_x_cor, $new_y_cor, $line_steps);\n }\n $last_y_cor = $last_y_cor - $cor;\n break;\n }\n }\n }\n\n return $grid;\n }",
"public function processInput()\n {\n $directionsArray = explode(',', $this->input[0]);\n $allVisitedCoordinates = [];\n $currentPositionX = 0;\n $currentPositionY = 0;\n # This represents an angle\n $currentDirection = 0;\n foreach ($directionsArray as $step) {\n $step = trim($step);\n $turn = substr($step, 0, 1);\n $distance = substr($step, -1 * (strlen($step) - 1));\n // Check where we're facing\n $currentDirection += ($turn == 'L' ? -90 : 90);\n if ($currentDirection % 360 == 0) {\n $currentDirection = 0;\n }\n // Move by given distance changing the coordinates\n switch ($currentDirection) {\n case 0:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY + $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY += $distance;\n break;\n case 90:\n case -270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX + $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX += $distance;\n break;\n case -90:\n case 270:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = ($currentPositionX - $i) . ':' . $currentPositionY;\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionX -= $distance;\n break;\n case 180:\n case -180:\n for ($i = 1; $i <= $distance; $i++) {\n $nextCoordinates = $currentPositionX . ':' . ($currentPositionY - $i);\n $allVisitedCoordinates[] = $nextCoordinates;\n }\n $currentPositionY -= $distance;\n break;\n }\n }\n $countArray = [];\n foreach ($allVisitedCoordinates as $key => $coordinates) {\n if (array_key_exists($coordinates, $countArray)) {\n $countArray[$coordinates]++;\n $c = $coordinates;\n break;\n } else {\n $countArray[$coordinates] = 1;\n }\n }\n $coordinates = explode(':', $c);\n $this->distanceTotal = abs($coordinates[0]) + abs($coordinates[1]);\n }",
"public function scan()\r\n {\r\n $result = array(\"wormholes\" => array(), \"asteroids\" => array());\r\n // asteroids first.\r\n foreach ($this->asteroids as $asteroid) {\r\n // if the asteroid is within scanning range of the ship....\r\n if (abs($asteroid->getX() - $this->spaceShip->getX()) < $this->asteroidScanningRange &&\r\n abs($asteroid->getY() - $this->spaceShip->getY()) < $this->asteroidScanningRange &&\r\n abs($asteroid->getZ() - $this->spaceShip->getZ()) < $this->asteroidScanningRange) {\r\n // then add it's details to the result\r\n $result['asteroids'][] = array(\r\n // we don't give absolute positions of asteroids, only their location relative to the ship\r\n 'x' => $asteroid->getX() - $this->spaceShip->getX(),\r\n 'y' => $asteroid->getY() - $this->spaceShip->getY(),\r\n 'z' => $asteroid->getZ() - $this->spaceShip->getZ(),\r\n 'dx' => $asteroid->getDx(),\r\n 'dy' => $asteroid->getDY(),\r\n 'dz' => $asteroid->getDz()\r\n );\r\n }\r\n }\r\n // now do the same for the wormholes...\r\n // for wormholes we only return the nearest end, and then the SHA1 of the furthest end\r\n // the navigator will have to figure out what the input of the SHA1 was. If you've actually\r\n // bothered to read these comments, please be assured that there is a better way to do it\r\n // then to brute force them.\r\n foreach ($this->wormholes as $wormhole) {\r\n // we'll do pythagorean distance\r\n // first for end1\r\n $diffX = abs($wormhole->getX1() - $this->spaceShip->getX());\r\n $diffY = abs($wormhole->getY1() - $this->spaceShip->getY());\r\n $diffZ = abs($wormhole->getZ1() - $this->spaceShip->getZ());\r\n $diffXY = sqrt(($diffX * $diffX) + ($diffY * $diffY));\r\n $diffXYZ1 = sqrt(($diffZ * $diffZ) + ($diffXY * $diffXY));\r\n // then for end2\r\n $diffX = abs($wormhole->getX2() - $this->spaceShip->getX());\r\n $diffY = abs($wormhole->getY2() - $this->spaceShip->getY());\r\n $diffZ = abs($wormhole->getZ2() - $this->spaceShip->getZ());\r\n $diffXY = sqrt(($diffX * $diffX) + ($diffY * $diffY));\r\n $diffXYZ2 = sqrt(($diffZ * $diffZ) + ($diffXY * $diffXY));\r\n // now show them the details for the nearest end, and let them figure out the further one...\r\n if ($diffXYZ1 < $diffXYZ2) {\r\n $result['wormholes'][] = array(\r\n 'x' => $wormhole->getX1(),\r\n 'y' => $wormhole->getY1(),\r\n 'z' => $wormhole->getZ1(),\r\n 'destination' => sha1($wormhole->getX2() . ',' . $wormhole->getY2() . ',' . $wormhole->getZ2())\r\n );\r\n } else {\r\n $result['wormholes'][] = array(\r\n 'x' => $wormhole->getX2(),\r\n 'y' => $wormhole->getY2(),\r\n 'z' => $wormhole->getZ2(),\r\n 'destination' => sha1($wormhole->getX1() . ',' . $wormhole->getY1() . ',' . $wormhole->getZ1())\r\n );\r\n }\r\n }\r\n return $result;\r\n }",
"function parseSDSS($output) {\n\n $xml = new SimpleXMLElement($output);\n \n\t\t\t\t$xpath_run = \"//field[@col='run']\";\n $xpath_camcol = \"//field[@col='camcol']\";\n\t\t\t\t$xpath_rerun = \"//field[@col='rerun']\";\n $xpath_field = \"//field[@col='field']\";\n\n $out_run = $xml->xpath($xpath_run);\n $out_camcol = $xml->xpath($xpath_camcol);\n\t\t\t\t$out_rerun = $xml->xpath($xpath_rerun);\n $out_field = $xml->xpath($xpath_field);\n \n $imagefields = array();\n \n $i = 0;\n while(list( , $node) = each($out_run)) {\n $imagefields[$i] = array(trim($node), 0);\n $i++;\n }\n \n $i = 0;\n while(list( , $node) = each($out_camcol)) {\n $imagefields[$i][1] = trim($node);\n $i++;\n }\n\n\t\t\t\t$i = 0;\n\t while(list( , $node) = each($out_rerun)) {\n\t $imagefields[$i][2] = trim($node);\n\t $i++;\n\t }\n\t\t\t\t$i = 0;\n\t while(list( , $node) = each($out_field)) {\n\t $imagefields[$i][3] = trim($node);\n\t $i++;\n\t }\n \n return $imagefields;\n }",
"function live_neighbors($key, $type, $cells, $cols)\r\n\t{\r\n\t\t$live_neighbors = 0;\r\n\t\tif ($type !== 'ur' && $type !== 'rs' && $type !== 'br' && $cells[$key+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'bl' && $cells[$key-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'bl' && $type !== 'bs' && $type !== 'br' && $cells[$key+$cols] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ur' && $type !== 'rs' && $type !== 'br' && $type !== 'bl' && $type !== 'bs' && $cells[$key+$cols+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'br' && $type !== 'bl' && $type !== 'bs' && $cells[$key+$cols-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\r\n\t\tif ($type !== 'ul' && $type !== 'us' && $type !== 'ur' && $cells[$key-$cols] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\t\r\n\t\tif ($type !== 'ul' && $type !== 'ls' && $type !== 'us' && $type !== 'bl' && $type !== 'ur' && $cells[$key-$cols-1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\t\r\n\t\tif ($type !== 'ul' && $type !== 'us' && $type !== 'br' && $type !== 'ur' && $type !== 'rs' && $cells[$key-$cols+1] == 'alive') {\r\n\t\t\t$live_neighbors++;\r\n\t\t}\r\n\t\treturn $live_neighbors;\r\n\t}",
"function get_inverter_data() {\n\t$context = stream_context_create(array(\n\t\t\t'http' => array(\n\t\t\t\t\t'header' => \"Authorization: Basic \" . base64_encode(\"pvserver:pvwr\"))));\n\t$data = file_get_contents('http://inverter.fritz.box', false, $context);\n\n\t$search_string = '<td width=\"70\" align=\"right\" bgcolor=\"#FFFFFF\">';\n\t$sl = strlen($search_string);\n\n\t/* Locate fields in order current, total, totalDaily */\n\t$cur_pos = strpos($data, $search_string, 0) + $sl;\n\t$total_pos = strpos($data, $search_string, $cur_pos+1) + $sl;\n\t$total_daily_pos = strpos($data, $search_string, $total_pos+1) + $sl;\n\n\t/* echo \"${cur_pos}, ${total_pos}, ${total_daily_pos}\"; */\n\n\t$cur = get_field($data, $cur_pos);\n\tif (strpos($cur, ' x x') != FALSE)\n\t\t$cur = 0;\n\t$total = get_field($data, $total_pos);\n\t$total_daily = get_field($data, $total_daily_pos);\n\t\n\t/* Next are: string voltage 1(V), L1(V), string 1 current (A), L1 power(W), string 2 voltage (V), L2(V), string 2 current (A) */\n\t/* Aim is to calculate DC input and thereby efficiency */\n\t$s1_v_pos = strpos($data, $search_string, $total_daily_pos+1) + $sl;\n\t$l1_v_pos = strpos($data, $search_string, $s1_v_pos+1) + $sl;\n\t$s1_a_pos = strpos($data, $search_string, $l1_v_pos+1) + $sl;\n\t$l1_w_pos = strpos($data, $search_string, $s1_a_pos+1) + $sl;\n\t$s2_v_pos = strpos($data, $search_string, $l1_w_pos+1) + $sl;\n\t$l2_v_pos = strpos($data, $search_string, $s2_v_pos+1) + $sl;\n\t$s2_a_pos = strpos($data, $search_string, $l2_v_pos+1) + $sl;\n\t\n\t$s1_v = get_field($data, $s1_v_pos);\n\t$s1_a = get_field($data, $s1_a_pos);\n\t$s2_v = get_field($data, $s2_v_pos);\n\t$s2_a = get_field($data, $s2_a_pos);\n\t\n\tif ($cur == 0) {\n\t\t$dc = 0;\n\t\t$eff = 0;\n\t} else {\n\t\t$dc = $s1_v * $s1_a + $s2_v * $s2_a;\n\t\t$eff = round (100.0 * $cur / $dc, 1);\n\t}\n\t\n\t/* echo \"${s1_v} ${s1_a} ${s2_v} ${s2_a} .. ${dc} .. ${eff}\\n\"; */\n\t\n\n\treturn join(\",\", array($cur, $total_daily, $total, $eff));\n}",
"function read_cld_xml($xml_path, &$datetime, &$vehicleserial, &$vehiclename, &$vehiclenumber, &$last_halt_time, &$lat, &$lng, &$vehicletype, &$speed, &$io1, &$io2, &$io3, &$io4, &$io5, &$io6, &$io7, &$io8)\r\n {\r\n $fexist =1;\r\n $fix_tmp = 1;\r\n $DataValid == 0;\r\n $final_xml = $xml_path;\r\n $xml = fopen($final_xml, \"r\") or $fexist = 0;\r\n \r\n $count = count(file($xml_unsorted));\r\n //echo \"<BR>COUNT======== $count lines in $xml\";\r\n //$xml2 = '\"'.$xml.'\"';\r\n if($fexist)\r\n {\r\n $i=0;\r\n $format = 2;\r\n \r\n \twhile(!feof($xml)) // WHILE LINE != NULL\r\n \t{\r\n \t\t$DataValid = 0;\r\n $line = fgets($xml); // STRING SHOULD BE IN SINGLE QUOTE \r\n //echo '<textarea>'.$line.'</textarea>'; \r\n \r\n if(strpos($line,'c=\"1\"')) // RETURN FALSE IF NOT FOUND\r\n {\r\n $format = 1;\r\n $fix_tmp = 1;\r\n } \r\n if(strpos($line,'c=\"0\"'))\r\n {\r\n $format = 1;\r\n $fix_tmp = 0;\r\n } \r\n \r\n if ((preg_match('/d=\"\\d+.\\d+[a-zA-Z0-9]\\\"/', $line, $lat_match) ) && (preg_match('/d=\"\\d+.\\d+[a-zA-Z0-9]\\\"/', $line, $lng_match)) )\r\n { \r\n $lat_value = explode('=',$lat_match[0]);\r\n $lng_value = explode('=',$lng_match[0]);\r\n //echo \"<br>lat=\".$lat_value[1].\" lng=\".$lng_value[1];\r\n \r\n if( (strlen($lat_value[1])>5) && ($lat_value[1]!=\"-\") && (strlen($lng_value[1])>5) && ($lng_value[1]!=\"-\") )\r\n {\r\n $DataValid = 1;\r\n }\r\n }\r\n \r\n if( ($line[0] == '<') && ($line[strlen($line)-2] == '>') && ($fix_tmp==1) && ($format == 1) && ($DataValid == 1))\r\n {\r\n // echo \"<br>IN format1\"; \r\n $status = preg_match('/v=\"[^\" ]+/', $line, $vehicleserial_tmp);\r\n //echo \"Status=\".$status.'<BR>';\r\n //echo \"test1\".'<BR>';\r\n if($status==0)\r\n {\r\n continue;\r\n }\r\n //echo \"test2\".'<BR>';\r\n $status = preg_match('/w=\"[^\"]+/', $line, $vehiclename_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n }\r\n \r\n //echo \"test2\".'<BR>';\r\n $status = preg_match('/x=\"[^\"]+/', $line, $vehiclenumber_tmp);\r\n /*if($status==0)\r\n {\r\n continue;\r\n }*/\r\n // echo \"test3\".'<BR>';\r\n //$status = preg_match('/\\d+-\\d+-\\d+ \\d+:\\d+:\\d+/', $line, $datetime_tmp);\r\n $status = preg_match('/h=\"[^\"]+/', $line, $datetime_tmp);\t\r\n if($status==0)\r\n {\r\n continue;\r\n }\r\n\t\t\t\r\n\t\t\t $status = preg_match('/u=\"[^\"]+/', $line, $lasthalt_tmp);\t\r\n if($status==0)\r\n {\r\n continue;\r\n }\r\n\t\t\r\n //echo 'test4<BR>';\r\n $status = preg_match('/d=\"[^\" ]+/', $line, $lat_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n }\r\n //echo \"test5\".'<BR>';\r\n $status = preg_match('/e=\"[^\" ]+/', $line, $lng_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n }\r\n //echo \"test6\".'<BR>';\r\n /* $status = preg_match('/vehicletype=\"[^\" ]+/', $line, $vehicletype_tmp); \r\n if($status==0)\r\n {\r\n continue;\r\n }*/ \r\n //echo \"test7\".'<BR>'; \r\n $status = preg_match('/f=\"[^\" ]+/', $line, $speed_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n }\r\n\t\t\t\r\n\t\t\t\r\n //echo \"test8\".'<BR>';\r\n \r\n $tmp = explode(\"=\",$vehicleserial_tmp[0]);\r\n $vehicleserial[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n \r\n\t\t\t$status = preg_match('/i=\"[^\" ]+/', $line, $io1_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n } \r\n \r\n $status = preg_match('/j=\"[^\" ]+/', $line, $io2_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n } \r\n \r\n $status = preg_match('/k=\"[^\" ]+/', $line, $io3_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n } \r\n \r\n $status = preg_match('/l=\"[^\" ]+/', $line, $io4_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n } \r\n \r\n $status = preg_match('/m=\"[^\" ]+/', $line, $io5_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n } \r\n \r\n $status = preg_match('/n=\"[^\" ]+/', $line, $io6_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n } \r\n \r\n $status = preg_match('/o=\"[^\" ]+/', $line, $io7_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n } \r\n\t\t\t\r\n\t\t\t$status = preg_match('/p=\"[^\" ]+/', $line, $io8_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n } \r\n \r\n \r\n \r\n /* $tmp = explode(\"=\",$vehicleserial_tmp[0]);\r\n $vehicleserial[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n $io = get_io($vehicleserial[$i],'fuel');\r\n //echo \"io=\".$io;\r\n if($io!=\"io\")\r\n {\r\n $status = preg_match('/'.$io.'=\"[^\" ]+/', $line, $fuel_tmp);\r\n if($status==0)\r\n {\r\n continue;\r\n }\r\n }\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$fuel_tmp[0]);\r\n $fuel[$i] = preg_replace('/\"/', '', $tmp[1]);*/\r\n \r\n $tmp = explode(\"=\",$datetime_tmp[0]);\r\n $datetime[$i] = preg_replace('/\"/', '', $tmp[1]); \r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$lasthalt_tmp[0]);\r\n $last_halt_time[$i] = preg_replace('/\"/', '', $tmp[1]);\t\t\r\n \r\n $tmp = explode(\"=\",$vehiclename_tmp[0]);\r\n $vehiclename[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n \r\n $tmp = explode(\"=\",$vehiclenumber_tmp[0]);\r\n $vehiclenumber[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n \r\n $tmp = explode(\"=\",$lat_tmp[0]);\r\n $lat[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n \r\n $tmp = explode(\"=\",$lng_tmp[0]);\r\n $lng[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n \r\n $tmp = explode(\"=\",$speed_tmp[0]);\r\n $speed[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n if($speed[$i]>200)\r\n\t\t\t{\r\n $speed[$i] =0; \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$io1_tmp[0]);\r\n $io1[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$io2_tmp[0]);\r\n $io2[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$io3_tmp[0]);\r\n $io3[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$io4_tmp[0]);\r\n $io4[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$io5_tmp[0]);\r\n $io5[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$io6_tmp[0]);\r\n $io6[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$io7_tmp[0]);\r\n $io7[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n\t\t\t\r\n\t\t\t$tmp = explode(\"=\",$io8_tmp[0]);\r\n $io8[$i] = preg_replace('/\"/', '', $tmp[1]);\r\n \r\n $i++; \r\n } // IF FORMAT 2 CLOSED \r\n \r\n ///////////////////////////////////////////////////////////// \r\n } // WHILE CLOSED\r\n }\r\n}",
"function get_drag_at_v($v) { \r\n\tglobal $kr,$mw,$mw_zu,$cw,$proj_A,$steig; # Annahme Luftdichte: 1.2051 bar\r\n $F_w=(($kr*($mw+$mw_zu)*9.81)+((9.810463*(10**-11))*(($v/3.6)**5)))+($cw*$proj_A*1.2051/2*(($v/3.6)**2))+(($mw+$mw_zu)*9.81*$steig/100);\r\n return $F_w;\r\n}",
"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 }",
"function solve_two(string $input) : string\n{\n\n $seats = array_map('str_split', xplode_input($input));\n $limit = 5;\n while(true) {\n [$seats, $hasChanged, $occupied] = walk_matrix($seats, $limit, 'visible_neighbors');\n if (!$hasChanged) {\n return sprintf(\"Occupied seats: %d\\n\", $occupied);\n }\n }\n}",
"function calc_time_elapsed_and_barcode_command_type($scanner){\n\t$last_barcode_history_processed = css_get_last_barcode_time_elapsed_for_scanner($scanner);\n\t\n\t// Get some uncalculated data for this scanner.\n\t$barcode_data = css_get_new_barcode_history_for_scanner($scanner);\n\t\n\t// No calculated elapsed times yet, first call to function \n\tif(empty($last_barcode_history_processed)){\n\t\t//echo(\"First barcode skipped\");\n\t\t$elapsed_time = '-2'; //very first barcode data..\n\t\t$command_type_id = '-1'; //will get updated on the next function call\n\t\tcss_update_barcode_history_elapsed_time_command_type($barcode_data[0]['id'], $elapsed_time, $command_type_id);\n\t\tcalc_time_elapsed_and_barcode_command_type($scanner); // Call self, start the function over.\n\t}\n\t//print_r($last_barcode_history_processed);\n\t\n\t$barcode_commands = css_get_barcode_commands();\n\t//print_r($barcode_commands);\n\t\n\t$last_time = \"\";\n\t$command_type_id = \"\";\n\tforeach($barcode_data as $k => $v)\n\t{\n\t\t// Time Elapsed\n\t\tif($last_time == \"\"){\n\t\t\t$elapsed_time = strtotime($v['time_scanned']) - strtotime($last_barcode_history_processed[0]['time_scanned']);\n\t\t}else{\n\t\t\t$elapsed_time = strtotime($v['time_scanned']) - strtotime($last_time);\n\t\t}\n\t\t//echo(\"v\");\n\t\t//print_r($v);\n\t\t\n\t\t//$command_id = array_search($v['barcode'], array_column($barcode_commands,'barcode'));\n\t\t$command_id = searchForId(str_replace(\"\\n\",'',$v['barcode']), $barcode_commands, 'barcode');\n\t\t//echo(\"barcode:\");\n\t\t//echo($v['barcode']);\n\t\t//echo(\"Command_id:\");\n\t\t//echo($command_id);\n\t\t//echo(\"OK\");\n\t\t\t\n\t\t// Barcode Command Type\n\t\t//echo(\"<br>\");\n\t\t//echo($v['barcode'].\" \".$v['barcode'][0].\"<br>\");\n\t\t\n\t\tif($v['barcode'][0] == \"T\")\n\t\t{\n\t\t\t$command_type_id = \"2\";\n\t\t}else{\n\t\t\t//$command_id = array_search($v['barcode'], array_column($barcode_commands,'barcode'));\n\t\t\t//echo($command_id);\n\t\t\t//echo(\"<br>\");\n\t\t\tif($command_id == FALSE){\n\t\t\t\t$command_type_id = \"9\"; //unknown type of barcode\n\t\t\t}else{\n\t\t\t\t$command_type_id = $barcode_commands[$command_id]['command_type_id'];\n\t\t\t\t//echo($command_type_id);\n\t\t\t\t//echo(\"<br>\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tcss_update_barcode_history_elapsed_time_command_type($v['id'], $elapsed_time, $command_type_id);\n\t\t$last_time = $v['time_scanned'];\t\n\t}\n\n\n}",
"private function getJumps(& $deck){\n\t\t$cards=$deck->getCards();\n\t\t\n\t\t$straight=array();\t//array for straight , ace is copied as 1\n\t\t$doubles=array();\t//array for dublicates\n\t\t$lastCardVal=0;\n\t\t// generate counters\n\t\t\tforeach ($cards as $card){\n\t\t\t//echo $card->value.',';\n\t\t\t\tif ($lastCardVal==0){\n\t\t\t\t\t$lastCardVal=$card->value;\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=1;\n\t\t\t\t\t$straight[]=$jump;\n\t\t\t\t\t$doubles[]=$jump;\n\t\t\t\t}else{\n\t\t\t\t\t$lastCardVal=$card->value - $lastCardVal;\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=$lastCardVal;\n\t\t\t\t\t$lastCardVal=$card->value;\n\t\t\t\t\t$straight[]=$jump;\n\t\t\t\t\t$doubles[]=$jump;\n\t\t\t\t}\n\t\t\t\tunset($jump);\n\t\t\t\t// if ace , add to start of [straight]ers\n\t\t\t\tif ($card->value==14){\n\t\t\t\t\t$x=$straight[0]->card->value;\n\t\t\t\t\tif($x==14){$x=1;}\n\t\t\t\t\t$newJump=$x-1;\n\t\t\t\t\t$straight[0]->val=$newJump;\n\t\t\t\t\t\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=1;\n\t\t\t\t\tarray_unshift($straight,$jump);\n\t\t\t\t}\n\t\t\t}//end foreach\n\t\t\t\n\t\t\t$sCount=count($straight)-1;\n\t\t\t$new_straight=array();\n\t\t\t$lastNStraighter=0;\n\t\t// flip straights values (inverse the diffirence)\n\t\t\tfor ($i=$sCount ; $i>=0 ; $i--){\n\t\t\t\t$card=$straight[$i]->card;\n\t\t\t\t\n\t\t\t\tif ($lastNStraighter==0){\n\t\t\t\t\t$lastNStraighter=$card->value;\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=1;\n\t\t\t\t\t$new_straight[]=$jump;\n\t\t\t\t}else{\n\t\t\t\t\t$lastNStraighter=$lastNStraighter - $card->value;\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=$lastNStraighter;\n\t\t\t\t\t$lastNStraighter=$card->value;\n\t\t\t\t\t$new_straight[]=$jump;\n\t\t\t\t}\n\t\t\t\tunset($jump);\n\t\t\t}//\n\t\t\t\n\t\t\tunset($straight);\n\t\t\t$straight = $new_straight;\n\t\t// get straights\n\t\t\t$sCount=count($straight);\n\t\t\t$straightCounters=array();\n\t\t\t$lastStraightCounter=0;\n\t\t\t//echo \"\\n\";\n\t\t\tfor ($i=0 ; $i<$sCount ; $i++){\n\t\t\t\t//echo $i.'-';\n\t\t\t\tif (!isset($straightCounters[$lastStraightCounter]->cards)){ // create cards array\n\t\t\t\t\t$straightCounters[$lastStraightCounter]->cards=array();\n\t\t\t\t}//\n\t\t\t\tif ($straight[$i]->val==1){\t// if next card , add it and count it\n\t\t\t\t\t$straightCounters[$lastStraightCounter]->count=$straightCounters[$lastStraightCounter]->count+1;\n\t\t\t\t\t$straightCounters[$lastStraightCounter]->cards[]=$straight[$i]->card;\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t\tif ($straight[$i]->val==0 && $straightCounters[$lastStraightCounter]->count>0){\t// if same card , just add it to know the suites\n\t\t\t\t\t$straightCounters[$lastStraightCounter]->cards[]=$straight[$i]->card;\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t\tif ($straight[$i]->val>1 && $straightCounters[$lastStraightCounter]->count>0){\n\t\t\t\t\t$lastStraightCounter++;\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t}//end for\n\t\t\t\n\t\t// get doubles (count how many zeros series)\n\t\t\t$dCount=count($doubles);\n\t\t\t$doubleCounters=array();\n\t\t\t$lastDblCounter=0;\n\t\t\tfor ($i=0 ; $i<$dCount ; $i++){\n\t\t\t\tif (!isset($doubleCounters[$lastDblCounter]->cards)){ // create cards array\n\t\t\t\t\t$doubleCounters[$lastDblCounter]->cards=array();\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t\tif ($doubles[$i]->val==0){\t// if same card , add it and count it\n\t\t\t\t\t$doubleCounters[$lastDblCounter]->count=$doubleCounters[$lastDblCounter]->count+1;\n\t\t\t\t\t$doubleCounters[$lastDblCounter]->cards[]=$doubles[$i]->card;\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t\tif ($doubles[$i]->val>0 && $doubleCounters[$lastDblCounter]->count>0){\t// if diffirent card , generate next counter\n\t\t\t\t\t$lastDblCounter++;\n\t\t\t\t}//\n\t\t\t}//end for\n\t\t\t\n\t\t\t\n\t\t$result->straights=$straightCounters;\n\t\t$result->doubles=$doubleCounters;\n\t\t\n\t\t//print_r($straight);\n\t\t//print_r($result);\n\t\t\n\t\treturn $result;\n\t}",
"public function getDn();",
"public function get_smart_data($drive)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $shell = new Shell();\n $args = '-A ' . $drive;\n $options['env'] = 'LANG=en_US';\n $shell->execute(self::CMD_SMARTCTL, $args, TRUE, $options);\n $retval = $shell->get_output();\n } catch (Exception $e) {\n //do nothing\n }\n\n foreach ($retval as $line) {\n $line2 = \" \".$line;\n $line2 = preg_replace('/\\s+/m', '|', $line2);\n $pieces = explode(\"|\", $line2);\n\n if ($pieces[1]=='194') {\n $field = 'Temp';\n // fudge for odd raw values which contain hours and minutes\n $output[$field]['Raw'] = $pieces[10].$pieces[11].$pieces[12].$pieces[13].$pieces[14];\n $output[$field]['T'] = $pieces[6];\n $output[$field]['W'] = $pieces[5];\n $output[$field]['V'] = $pieces[4];\n }\n if ($pieces[1]=='1') {\n $field = 'RawReadErrorRate';\n $output[$field]['Raw'] = $pieces[10];\n $output[$field]['T'] = $pieces[6];\n $output[$field]['W'] = $pieces[5];\n $output[$field]['V'] = $pieces[4];\n }\n if ($pieces[1]=='12') {\n $field ='PowerCycle';\n $output[$field]['Raw'] = $pieces[10];\n $output[$field]['T'] = $pieces[6];\n $output[$field]['W'] = $pieces[5];\n $output[$field]['V'] = $pieces[4];\n } \n if ($pieces[1]=='9') {\n $field = 'PowerOnHours';\n $output[$field]['Raw'] = $pieces[10];\n $output[$field]['T'] = $pieces[6];\n $output[$field]['W'] = $pieces[5];\n $output[$field]['V'] = $pieces[4];\n }\n if ($pieces[1]=='7') {\n $field = 'SeekErrorRate';\n $output[$field]['Raw'] = $pieces[10];\n $output[$field]['T'] = $pieces[6];\n $output[$field]['W'] = $pieces[5];\n $output[$field]['V'] = $pieces[4];\n }\n if ($pieces[1]=='5') {\n $field = 'ReAllocSector';\n $output[$field]['Raw'] = $pieces[10];\n $output[$field]['T'] = $pieces[6];\n $output[$field]['W'] = $pieces[5];\n $output[$field]['V'] = $pieces[4];\n }\n if ($pieces[1]=='10') {\n $field = 'SpinRetryCnt';\n $output[$field]['Raw'] = $pieces[10];\n $output[$field]['T'] = $pieces[6];\n $output[$field]['W'] = $pieces[5];\n $output[$field]['V'] = $pieces[4];\n }\n if ($pieces[1]=='3') {\n $field = 'SpinUpTime';\n $output[$field]['Raw'] = $pieces[10];\n $output[$field]['T'] = $pieces[6];\n $output[$field]['W'] = $pieces[5];\n $output[$field]['V'] = $pieces[4];\n } \n }\n return $output;\n }",
"function checkCell($datum, $stunde, $adr_id)\n {\n //echo $datum.\" \".$stunde.\"<br>\";\n return $this->app->DB->SelectArr(\"SELECT aufgabe,adresse,prio\n FROM aufgabe\n WHERE DATE(startdatum) = '$datum'\n AND HOUR(TIME(startzeit)) <= $stunde \n AND HOUR(TIME(startzeit)) + stunden >= $stunde\n AND (adresse = $adr_id OR adresse = 0)\n OR \n ((DATE_SUB('$datum', INTERVAL MOD(DATEDIFF('$datum',DATE_FORMAT(startdatum, '%Y:%m:%d')),intervall_tage) day)='$datum'\n AND DATE_SUB('$datum', INTERVAL MOD(DATEDIFF('$datum',DATE_FORMAT(startdatum, '%Y:%m:%d')),intervall_tage) day)\n > abgeschlossen_am\n AND intervall_tage>0 AND (adresse=$adr_id OR adresse=0))\n AND HOUR(TIME(startzeit)) <= $stunde AND HOUR(TIME(startzeit)) + stunden >= $stunde) \n LIMIT 1\");\n }",
"protected function get_wind( ) {\n// Format is dddssKT where ddd = degrees from North, ss = speed, KT for knots,\n// or dddssGggKT where G stands for gust and gg = gust speed. (ss or gg can be a 3-digit number.)\n// KT can be replaced with MPH for meters per second or KMH for kilometers per hour.\n\n if (preg_match('#^([0-9G]{5,10}|VRB[0-9]{2,3})(KT|MPS|KMH)$#',$this->current_group_text,$pieces)) {\n $this->wxInfo['ITEMS'][$this->tend]['CODE_WIND'] = $this->current_group_text;\n $this->current_group_text = $pieces[1];\n $unit = $pieces[2];\n if ($this->current_group_text == '00000') {\n $this->wxInfo['ITEMS'][$this->tend]['WIND_SPEED'] = '0'; // no wind\n }\n else {\n preg_match('#([0-9]{3}|VRB)([0-9]{2,3})G?([0-9]{2,3})?#',$this->current_group_text,$pieces);\n if ($pieces[1] == 'VRB') {\n $direction = 'VAR';\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION_TEXT'] = $direction;\n }\n else {\n $angle = (integer) $pieces[1];\n $compass = array('N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW');\n $direction = $compass[round($angle / 22.5) % 16];\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION'] = round($angle / 22.5)*22.5;\n $this->wxInfo['ITEMS'][$this->tend]['WIND_DIRECTION_TEXT'] = $direction;\n// $this->wxInfo['WIND_DIRECTION_TEXT'] =round($angle / 22.5);\n }\n\n if (isset($pieces[3]) && trim($pieces[3])!='') $this->wxInfo['ITEMS'][$this->tend]['WIND_GUST'] = $this->convertSpeed($pieces[3], $unit);\n $this->wxInfo['ITEMS'][$this->tend]['WIND_SPEED'] = $this->convertSpeed($pieces[2], $unit);\n }\n $this->current_ptr++;\n }\n $this->current_group++;\n }",
"private function calculateConnections() {\n $map = array();\n $whiteRecheck = array();\n for ($row=0; $row < $this->matrix->getSize(); $row++) {\n for ($col=0; $col < $this->matrix->getSize(); $col++) {\n $map[$row][$col][5] = $this->isDarkInt($row, $col);\n $map[$row][$col][0] = 0;\n $map[$row][$col][4] = $this->isDarkInt($row, $col - 1);\n $map[$row][$col][6] = $this->isDarkInt($row, $col + 1);\n $map[$row][$col][8] = $this->isDarkInt($row - 1, $col);\n $map[$row][$col][2] = $this->isDarkInt($row + 1, $col);\n $map[$row][$col][7] = $this->isDarkInt($row - 1, $col - 1);\n $map[$row][$col][9] = $this->isDarkInt($row - 1, $col + 1);\n $map[$row][$col][1] = $this->isDarkInt($row + 1, $col - 1);\n $map[$row][$col][3] = $this->isDarkInt($row + 1, $col + 1);\n if (!$map[$row][$col][5]) {\n $fullCount = $map[$row][$col][1] + $map[$row][$col][2] + $map[$row][$col][3] + $map[$row][$col][4]\n + $map[$row][$col][6] + $map[$row][$col][7] + $map[$row][$col][8] + $map[$row][$col][9];\n $soloCount = $map[$row][$col][2] + $map[$row][$col][4] + $map[$row][$col][6] + $map[$row][$col][8];\n $map[$row][$col][7] = 0;\n $map[$row][$col][9] = 0;\n $map[$row][$col][1] = 0;\n $map[$row][$col][3] = 0;\n if ($this->isDarkInt($row, $col - 1) && $this->isDarkInt($row - 1, $col)) {\n $map[$row][$col][7] = 1;\n }\n if ($this->isDarkInt($row, $col + 1) && $this->isDarkInt($row - 1, $col)) {\n $map[$row][$col][9] = 1;\n }\n if ($this->isDarkInt($row, $col - 1) && $this->isDarkInt($row + 1, $col)) {\n $map[$row][$col][1] = 1;\n }\n if ($this->isDarkInt($row, $col + 1) && $this->isDarkInt($row + 1, $col)) {\n $map[$row][$col][3] = 1;\n }\n if ($fullCount >= 5) {\n $whiteRecheck[]=array('row' => $row, 'col' => $col);\n }\n if ($soloCount >= 4) {\n $map[$row][$col][0] = 1;\n }\n }\n }\n }\n foreach ($whiteRecheck as $key => $cw) {\n $row = $cw['row'];\n $col = $cw['col'];\n if (isset($map[$row + 1][$col - 1]) && !$map[$row + 1][$col - 1][5] && isset($map[$row + 1][$col - 1]) && $map[$row + 1][$col - 1][0]) {\n $map[$row][$col][1] = 0;\n $map[$row][$col - 1][3] = 0;\n $map[$row + 1][$col][7] = 0;\n $map[$row + 1][$col - 1][9] = 0;\n }\n if (isset($map[$row + 1][$col + 1]) && !$map[$row + 1][$col + 1][5] && isset($map[$row + 1][$col + 1]) && $map[$row + 1][$col + 1][0]) {\n $map[$row][$col][3] = 0;\n $map[$row][$col + 1][1] = 0;\n $map[$row + 1][$col][9] = 0;\n $map[$row + 1][$col + 1][7] = 0;\n }\n }\n return $map;\n }",
"function dumpXYLayout($exclude=array())\r\n {\r\n $x=array();\r\n $y=array();\r\n $pos=array();\r\n //Iterates through controls calling show for all of them\r\n\r\n reset($this->_control->controls->items);\r\n while (list($k,$v)=each($this->_control->controls->items))\r\n {\r\n $dump=false;\r\n\r\n if( $v->Visible && !$v->IsLayer )\r\n {\r\n if( $this->_control->methodExists('getActiveLayer') )\r\n {\r\n $dump = ( (string)$v->Layer == (string)$this->_control->Activelayer );\r\n }\r\n else\r\n {\r\n $dump = true;\r\n }\r\n }\r\n\r\n if ($dump)\r\n {\r\n $left=$v->Left;\r\n $top=$v->Top;\r\n $aw=$v->Width;\r\n $ah=$v->Height;\r\n\r\n $x[]=$left;\r\n $x[]=$left+$aw;\r\n $y[]=$top;\r\n $y[]=$top+$ah;\r\n\r\n $pos[$left][$top]=$v;\r\n }\r\n }\r\n\r\n $width=$this->_control->Width;\r\n $height=$this->_control->Height;\r\n\r\n $x[]=$width;\r\n $y[]=$height;\r\n\r\n sort($x);\r\n sort($y);\r\n\r\n\r\n //Dumps the inner controls\r\n if ($this->_control->controls->count()>=1)\r\n {\r\n $widths=array();\r\n reset($x);\r\n if ($x[0]!=0) $widths[]=$x[0];\r\n while (list($k,$v)=each($x))\r\n {\r\n if ($k<count($x)-1)\r\n {\r\n if ($x[$k+1]-$v!=0) $widths[]=$x[$k+1]-$v;\r\n }\r\n else $widths[]=\"\";\r\n }\r\n\r\n $heights=array();\r\n reset($y);\r\n if ($y[0]!=0) $heights[]=$y[0];\r\n while (list($k,$v)=each($y))\r\n {\r\n if ($k<count($y)-1)\r\n {\r\n if ($y[$k+1]-$v!=0) $heights[]=$y[$k+1]-$v;\r\n }\r\n else $heights[]=\"\";\r\n }\r\n\r\n\r\n $y=0;\r\n reset($heights);\r\n\r\n while (list($hk,$hv)=each($heights))\r\n {\r\n if ($hv!=\"\")\r\n {\r\n\r\n }\r\n else continue;\r\n\r\n\r\n $rspan=false;\r\n\r\n $x=0;\r\n reset($widths);\r\n\r\n ob_start();\r\n while (list($k,$v)=each($widths))\r\n {\r\n $cs=1;\r\n $rs=1;\r\n\r\n\r\n if (isset($pos[$x][$y]))\r\n {\r\n if ((!is_object($pos[$x][$y])) && ($pos[$x][$y]==-1))\r\n {\r\n $x+=$v;\r\n continue;\r\n }\r\n }\r\n\r\n if (isset($pos[$x][$y]))\r\n {\r\n $control=$pos[$x][$y];\r\n }\r\n else $control=null;\r\n\r\n $w=0;\r\n\r\n if (is_object($control))\r\n {\r\n $w=$control->Width;\r\n $h=$control->Height;\r\n\r\n $tv=0;\r\n $th=0;\r\n\r\n $also=array();\r\n\r\n for ($kkk=$hk;$kkk<count($heights);$kkk++)\r\n {\r\n if ($heights[$kkk]!='')\r\n {\r\n $tv+=$heights[$kkk];\r\n if ($h>$tv)\r\n {\r\n $rs++;\r\n $pos[$x][$y+$tv]=-1;\r\n $also[]=$y+$tv;\r\n }\r\n else break;\r\n }\r\n }\r\n\r\n for ($ppp=$k;$ppp<count($widths);$ppp++)\r\n {\r\n if ($widths[$ppp]!='')\r\n {\r\n $th+=$widths[$ppp];\r\n\r\n if ($w>$th)\r\n {\r\n $cs++;\r\n $pos[$x+$th][$y]=-1;\r\n\r\n reset($also);\r\n while(list($ak,$av)=each($also))\r\n {\r\n $pos[$x+$th][$av]=-1;\r\n }\r\n }\r\n else break;\r\n }\r\n }\r\n }\r\n\r\n\r\n $width=\"\";\r\n if ($v!=\"\")\r\n {\r\n $zv=round(($v*100)/$this->_control->Width,2);\r\n $zv.=\"%\";\r\n $width=\" width=\\\"$v\\\" \";\r\n }\r\n\r\n if ($rs!=1)\r\n {\r\n $rspan=true;\r\n $rs=\" rowspan=\\\"$rs\\\" \";\r\n }\r\n else $rs=\"\";\r\n\r\n if ($cs!=1)\r\n {\r\n $cs=\" colspan=\\\"$cs\\\" \";\r\n $width=\"\";\r\n }\r\n else $cs=\"\";\r\n\r\n $hh=\"\";\r\n\r\n echo \"<td $width $hh $rs $cs valign=\\\"top\\\">\";\r\n\r\n if (is_object($control))\r\n {\r\n echo \"<div id=\\\"\".$control->Name.\"_outer\\\">\\n\";\r\n $control->show();\r\n echo \"\\n</div>\\n\";\r\n }\r\n else\r\n {\r\n if ($this->_usepixeltrans) echo \"<img src=\\\"rpcl/images/pixel_trans.gif\\\" width=\\\"1\\\" height=\\\"1\\\">\";\r\n }\r\n\r\n echo \"</td>\\n\";\r\n $x+=$v;\r\n }\r\n $trow=ob_get_contents();\r\n ob_end_clean();\r\n if ($hv!=\"\")\r\n {\r\n $zhv=round(($hv*100)/$this->_control->Height,2);\r\n $zhv.=\"%\";\r\n echo \"<tr height=\\\"$hv\\\">\";\r\n }\r\n echo $trow;\r\n echo \"</tr>\\n\";\r\n $y+=$hv;\r\n }\r\n }\r\n else\r\n {\r\n echo \"<tr><td>\";\r\n if ($this->_usepixeltrans) echo \"<img src=\\\"rpcl/images/pixel_trans.gif\\\" width=\\\"1\\\" height=\\\"1\\\">\";\r\n echo \"</td></tr>\";\r\n }\r\n\r\n reset($this->_control->controls->items);\r\n while (list($k,$v)=each($this->_control->controls->items))\r\n {\r\n if (($v->Visible) && ($v->IsLayer))\r\n {\r\n echo \"<div id=\\\"\".$v->Name.\"_outer\\\">\\n\";\r\n $v->show();\r\n echo \"\\n</div>\\n\";\r\n }\r\n }\r\n }",
"function get_trees($rows, $right, $down) {\n $trees = 0;\n $position = 0;\n echo \"Slope: $right, $down\\n\";\n // Intentionally skip row 0 since our first check is on row 1\n for($i=1;$i<count($rows);$i++) {\n $position += $right;\n if($position > 30) $position -= 31;\n if(substr_compare($rows[$i], \"#\", $position, 1) === 0) {\n $trees++;\n }\n }\n echo \"Trees: $trees\\n\";\n return $trees;\n}",
"private function extractRule($rule)\n\t{\n\t\t$ruleSegments = array();\n\t\t$ruleOperators = array();\n\t\t$ruleLen = strlen($rule);\n\t\t// index of proceed\n\t\t$iop = 0;\n\n\t\t// scan the rule string char by char $ios index of scanned\n\t\tfor ($ios = 0;$ios<$ruleLen;$ios++)\n\t\t{\n\t\t\tswitch ($rule[$ios])\n\t\t\t{\n\t\t\t\tcase '&':\n\t\t\t\tcase '|':\n\t\t\t\t\tif ($iop<$ios)\n\t\t\t\t\t{\n\t\t\t\t\t\t$ruleSegments[] = trim(substr($rule,$iop,$ios-$iop));\n\t\t\t\t\t\t$iop = $ios+1;\n\t\t\t\t\t}\n\t\t\t\t\t$ruleOperators[] = $rule[$ios];\n\t\t\t\tbreak;\n\n\t\t\t\tcase '(':\n\t\t\t\t\t$nestedBracketCount = 0;\n\t\t\t\t\tfor ($j = $ios+1;$j<$ruleLen;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch ($rule[$j])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase ')':\n\t\t\t\t\t\t\t\tif (0 === $nestedBracketCount)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$breaketEnd = $j;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$nestedBracketCount--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '(':\n\t\t\t\t\t\t\t\t$nestedBracketCount++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($ruleLen === $j)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrow new AgsInvalidParamsException(__CLASS__.'::'.__FUNCTION__,array('invalidRule'=>$rule));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// push entire content of the outtest breaket but itself into segments\n\t\t\t\t\t$ruleSegments[] = trim(substr($rule,$ios+1,$breaketEnd-$ios-1));\n\t\t\t\t\t// move ios to breaket end\n\t\t\t\t\t$ios = $breaketEnd;\n\t\t\t\t\t// +2 cuz the ')' and the operater after ')'\n\t\t\t\t\t$iop = $ios+2;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// reached string end\n\t\t\t// 抵达访问控制规则末端\n\t\t\tif ((($ruleLen-1 === $ios) && ($iop < $ruleLen))\n\t\t\t\t// the rest of first OR operator will be put in $this->_nextRule\n\t\t\t\t// so OR may be either the last orperator or not exist\n\t\t\t\t// 如果遇到 OR 操作符,那么控制规则剩下的部分都会放进 $this->_nextRule\n\t\t\t\t// 所以OR操作符要么是最后一个操作符要么不存在\n\t\t\t\t|| ('|' === $rule[$ios]))\n\t\t\t{\n\t\t\t\t$ruleSegments[] = trim(substr($rule,$iop));\n\t\t\t\t// leave scan loop\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$segCount = count($ruleSegments);\n\t\t// the leaf node of rules tree,has one and only one executable rule\n\t\t// 规则树的末端节点,有且只有一条可执行的规则\n\t\tif (1 === $segCount)\n\t\t{\n\t\t\t$this->_rule = current($ruleSegments);\n\t\t}\n\t\t// or split down into child\n\t\t// 否则继续分解\n\t\telse\n\t\t{\n\t\t\t// if the last operator is OR,the last rule should be proceed later\n\t\t\t// or all rules should be put in children\n\t\t\t// 如果最后一个操作符是OR,最后一条规则后面再处理\n\t\t\t// 否则所有的规则都放进子节点\n\t\t\tfor ($i = 0; $i < (('|' === end($ruleOperators))?($segCount-1):$segCount); $i++)\n\t\t\t{\n\t\t\t\t$this->_childRules[] = new AgsAccessRule(array_shift($ruleSegments));\n\t\t\t}\n\n\t\t\t// if still segment remain,it must be the OR rule\n\t\t\t// 如果还有规则段剩下,必然是那条OR规则了\n\t\t\tif (count($ruleSegments))\n\t\t\t{\n\t\t\t\t$this->_nextRule = new AgsAccessRule(array_pop($ruleSegments));\n\t\t\t}\n\t\t}\n\t}",
"protected function dnd()\n\t{\n\t\t$source_id = (int)array_pop(explode(\"_\", $_REQUEST[\"il_hform_source\"]));\n\t\tif($_REQUEST[\"il_hform_target\"] != \"droparea_end\")\n\t\t{\n\t\t\t$target_id = (int)array_pop(explode(\"_\", $_REQUEST[\"il_hform_target\"]));\n\t\t\t$pos = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = $this->object->getSurveyPages();\n\t\t\t$page = $page[$this->current_page-1];\n\t\t\t$last = array_pop($page);\n\t\t\t$target_id = (int)$last[\"question_id\"];\n\t\t\t$pos = 1;\n\t\t}\n\t\tif($source_id != $target_id)\n\t\t{\n\t\t\t$this->object->moveQuestions(array($source_id), $target_id, $pos);\n\t\t}\n\t}",
"public function getDddCell()\n {\n return $this->dddCell;\n }",
"function degree_to_compass_point($d){\r\n $dp = $d + 11.25;\r\n $dp = $dp % 360;\r\n $dp = floor($dp / 22.5) ;\r\n $points = array(\"N\",\"NNE\",\"NE\",\"ENE\",\"E\",\"ESE\",\"SE\",\"SSE\",\"S\",\"SSW\",\"SW\",\"WSW\",\"W\",\"WNW\",\"NW\",\"NNW\",\"N\");\r\n $dir = $points[$dp];\r\n return $dir;\r\n }",
"public function get_directions();",
"private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}",
"function readDIMAPv2($filePath) {\n\n libxml_use_internal_errors(true);\n\n $doc = new DOMDocument();\n $doc->loadXML(file_get_contents($filePath));\n \n $errors = libxml_get_errors();\n\n $isFirst = 1;\n $footprint = 'POLYGON((';\n \n $spectralMode = $doc->getElementsByTagname('Processing_Information')->item(0)->getElementsByTagname('Product_Settings')->item(0)->getElementsByTagname('SPECTRAL_PROCESSING')->item(0)->nodeValue;\n $vertices = $doc->getElementsByTagname('Dataset_Extent')->item(0)->getElementsByTagname('Vertex');\n foreach($vertices as $vertex) {\n $lon = trim($vertex->getElementsByTagName('LON')->item(0)->nodeValue);\n $lat = trim($vertex->getElementsByTagName('LAT')->item(0)->nodeValue);\n if ($isFirst === 1) {\n $lon1 = $lon;\n $lat1 = $lat;\n $isFirst = 0;\n }\n $footprint .= ((float) $lon) . ' ' . ((float) $lat) . ',';\n \n }\n $footprint .= ((float) $lon1) . ' ' . ((float) $lat1) . '))';\n \n // Only process first scene\n $scene = $doc->getElementsByTagname('Source_Identification')->item(0);\n $sceneInfo = $scene->getElementsByTagname('Strip_Source')->item(0);\n $time = $sceneInfo->getElementsByTagname('IMAGING_DATE')->item(0)->nodeValue . 'T' . $sceneInfo->getElementsByTagname('IMAGING_TIME')->item(0)->nodeValue;\n $mission = $sceneInfo->getElementsByTagname('MISSION')->item(0)->nodeValue;\n \n // CNES (SPOT) or DMC ?\n $parentIdentifier = \"urn:ogc:def:EOP:PHR:\" . $sceneInfo->getElementsByTagname('MISSION_INDEX')->item(0)->nodeValue; \n \n return array(\n 'identifier' => $parentIdentifier . ':' . correctIdentifier($scene->getElementsByTagname('SOURCE_ID')->item(0)->nodeValue . $spectralMode),\n 'parentidentifier' => $parentIdentifier,\n 'startdate' => $time,\n 'enddate' => $time,\n 'platform' => $mission . ($sceneInfo->getElementsByTagname('MISSION_INDEX')->item(0) ? ' ' . $sceneInfo->getElementsByTagname('MISSION_INDEX')->item(0)->nodeValue : ''),\n 'instrument' => $sceneInfo->getElementsByTagname('INSTRUMENT')->item(0)->nodeValue . ($sceneInfo->getElementsByTagname('INSTRUMENT_INDEX')->item(0) ? ' ' . $sceneInfo->getElementsByTagname('INSTRUMENT_INDEX')->item(0)->nodeValue : ''),\n 'footprint' => $footprint\n );\n\n}",
"private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}",
"public function buscarDetalle_monitor($co_operacion_bd) {\r\n \t$query = \"SELECT \tc011t.* \r\n\t\t\t\t FROM \tc011t_detalle_monitor as c011t \r\n\t\t\t\t WHERE c011t.co_operacion_bd = '\".$co_operacion_bd.\"'\";\r\n\t$r = $this->pdo->_query($query);\r\n\treturn $r;\r\n }"
] | [
"0.5899118",
"0.56649816",
"0.4798595",
"0.47244754",
"0.46880904",
"0.44520092",
"0.44377184",
"0.4396466",
"0.4352825",
"0.43178967",
"0.4293009",
"0.42834938",
"0.42795387",
"0.42675465",
"0.42646158",
"0.4247529",
"0.42226622",
"0.41896406",
"0.41839698",
"0.41805312",
"0.41794956",
"0.41782758",
"0.41424805",
"0.41176647",
"0.4080732",
"0.40792006",
"0.40697154",
"0.4064492",
"0.40586406",
"0.4016376"
] | 0.66016585 | 0 |
This function create and returns an object Auth using an object Session, including an array of restriction messages. | static function getAuth() {
return new Auth(Session::getInstance(),
["restriction_msg" => "Vous n'avez pas le droit d'accéder à cette page.",
"restriction_msg_assembly" => "Vous n'avez pas le droit d'accéder à cette page si vous n'êtes pas connecté."]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _createSession(){\n return $this->_session = new Session();\n }",
"function auth_create($id, $data = null)\n {\n $lc_auth = auth_prerequisite();\n $auth = auth_get();\n\n if (!$auth) {\n $session = is_object($data) ? $data : auth_getUserInfo($id);\n if (isset($session)) {\n $fieldRole = $lc_auth['fields']['role'];\n\n $session->sessId = session_id();\n $session->timestamp = time();\n $session->token = strtoupper(_randomCode(20));\n $session->permissions = auth_permissions($session->$fieldRole);\n\n auth_set($session);\n\n return $session;\n }\n } else {\n return $auth;\n }\n\n return false;\n }",
"public static function Auth()\n\t{\n\t\treturn self::$auth = new Auth();\n\t}",
"public function newSession();",
"public static function getFromSession(){\n\t\t$user = new User();\n\t\t\n\t\tif(isset($_SESSION[User::SESSION]) && (int)$_SESSION[User::SESSION]['id_user'] > 0)\n\t\t{\n\t\t\t$user->setData($_SESSION[User::SESSION]);\n\t\t}\n\t\treturn $user;\n\t}",
"public function getSession();",
"public static function instance() {\n\t\tglobal $_SESSION;\n\t\t\n\t\tif (isset($_SESSION['puserauth'])) {\n\t\t\treturn unserialize($_SESSION['puserauth']);\n\t\t}\n\t\t$user = new PUserAuth();\n\t\t$user->store();\n\t\treturn $user;\n\t}",
"public static function init()\n {\n $authentic = false;\n\n if (($memno = array_get($_SESSION, 'camra_auth_memno', ''))) {\n $authentic = true;\n }\n\n return new static($memno, $authentic);\n }",
"public function getSession() {}",
"protected function auth()\n {\n if ($this->auth === null)\n $this->auth = new AuthModel($this->db);\n return $this->auth;\n }",
"public static function GetSessionAuthorization ();",
"public function __construct()\n {\n $this->auth_model = new authModel();\n session();\n }",
"protected function _initSession()\n\t{\n\t\t$sessionConfig = Zend_Registry::get('config')->session;\n \tZend_Session::setOptions($sessionConfig->toArray());\n\t\t$session = new Zend_Session_Namespace('crm', true);\n\t\treturn $session;\n\t}",
"function auth(): Auth\n{\n return (new Auth);\n}",
"abstract protected function getSession();",
"public function newInstance()\n {\n return new Auth($this->segment);\n }",
"public function createOAuthSession(&$session);",
"function auth_get()\n{\n return session_get(auth_namespace(), true);\n}",
"private function __construct() \n {\n \n\t\t$this->_storage = new Tg_Auth_Storage_Session();\n\t\t$this->_adapter = new Tg_Auth_Adapter_User();\n\t\t$this->_auth = Zend_Auth::getInstance();\n $this->_auth->setStorage($this->_storage);\n }",
"public static function factory($config = array())\n\t{\n\t\treturn new Simple_Auth($config);\n\t}",
"protected function getSessionUser()\n{\n\t$data = $this->app->getSession('pclib.user', $this->realm);\n\tif (!$data) return null;\n\n\tif ($data['sessionHash'] != $this->sessionHash($data)) {\n\t\t$this->log('AUTH_ERROR', 'Authentication failed - invalid session.', $data['ID']);\n\t\tthrow new AuthException(\"Authentication failed. Access denied.\");\n\t}\n\n\t$user = new AuthUser;\n\t$user->values = $data;\n\t$user->auth = $this;\n\treturn $user;\n}",
"protected function get_model_obj(){ return new Session_Model(); }",
"public static function factory($config = array())\n\t{\n\t\treturn new Auth($config);\n\t}",
"function create() \n\t{\n\t\t//If this was called to destroy a session (only works after session started)\n\t\t$this->clear();\n\n\t\t//If there is a class to handle CRUD of the sessions\n\t\tif($this->session_database) \n\t\t{\n if (is_php('5.4'))\n {\n // -- User for php > 5.4 --\n session_set_save_handler($this, TRUE);\n }\n else\n {\n session_set_save_handler(\n array($this, 'open'),\n array($this, 'close'),\n array($this, 'read'),\n array($this, 'write'),\n array($this, 'destroy'),\n array($this, 'gc')\n );\n register_shutdown_function('session_write_close');\n }\n // Create connect to database\n $this->_conn = DbConnection::getInstance();\n\t\t}\n\n\t\t// Start the session!\n\t\tsession_start();\n\n\t\t//Check the session to make sure it is valid\n\t\tif(!$this->check())\n\t\t{\n\t\t\t//Destroy invalid session and create a new one\n\t\t\treturn $this->create();\n\t\t}\n\t}",
"public static function getInstance()\n {\n $session = new Session();\n\n self::$instancia = $session;\n\n return $session;\n }",
"function __construct(){\r\n if(isset($_SESSION['login']) && $_SESSION['login'] == 'true' && isset($_SESSION['username'])){\r\n $this->username = $_SESSION['username'];\r\n $this->login = $_SESSION['login'];\r\n $this->email = $_SESSION['email'];\r\n $this->credential = $_SESSION['credential'];\r\n $this->picture = $_SESSION['picture'];\r\n $this->academy = $_SESSION['fullname'];\r\n }\r\n }",
"function getAuthParameters($params)\n{\n $authParameters = new AuthenticationParameters();\n $authParameters->Reseller = $params['Reseller'];\n $authParameters->Username = $params['Username'];\n $authParameters->Password = $params['Password'];\n\n return $authParameters;\n}",
"public static function getInstance()\n {\n if (null === self::$auth) self::$auth = new self();\n return self::$auth;\n }",
"public function getSession(): object\n {\n return SessionTrait::sessionFromGlobal();\n }",
"public function createAuth($data)\n\t{\n\t\t$auth = $this->map($data);\n\t\t\n\t\t$auth->save();\n\n\t\treturn $auth;\n\t}"
] | [
"0.62225264",
"0.60264546",
"0.5920102",
"0.5856709",
"0.5848983",
"0.5824285",
"0.5777055",
"0.5714125",
"0.56747884",
"0.5668715",
"0.56096697",
"0.55935544",
"0.55799484",
"0.55781305",
"0.5537685",
"0.54991573",
"0.5482576",
"0.54744196",
"0.5450374",
"0.54438305",
"0.54433745",
"0.5429537",
"0.5413858",
"0.5409058",
"0.5392993",
"0.53666204",
"0.5362979",
"0.5357972",
"0.5356408",
"0.53497094"
] | 0.6871365 | 0 |
This function redirect the user to the page indicated by the variable file. | static function redirect($file) {
header("location: $file");
exit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Redirect($file)\n{\n\techo '<script>';\n\techo 'location.href=\"'.$file.'\"';\n\techo '</script>';\n\texit();\n}",
"function redirect($file) {\n $host = $_SERVER['HTTP_HOST'];\n $path = rtrim(dirname($_SERVER[\"PHP_SELF\"]), \"/\\\\\");\n header(\"Location: http://$host$path/$file\");\n exit;\n }",
"function redirect ($page) {\n header (\"Location:\" . site_url ($page));\n }",
"function redirect($scriptFile)\n\t{\n\t\techo \"<script language=\\\"javascript\\\">window.location.href='\" . $scriptFile . \"'</script>\";\n\t}",
"public function redirect($page) {\n header('Location: ./' . $page);\n exit();\n }",
"public static function set($target_file)\r\n\r\n {\r\n header('Location: index.php?page=display&filename=' .$target_file );\r\n \r\n }",
"function redirectTo($page) {\n\t$host = $_SERVER['HTTP_HOST'];\n $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n header(\"Location: http://$host$uri/$page\");\n ob_end_flush();\n exit;\n}",
"public static function go(string $filename)\n\t{\n\t\theader(\"Location: \" . $filename);\n\t\texit;\n\t}",
"function redirect($page) {\r\n header('location: ' . URL_ROOT, '/' . $page);\r\n}",
"function forwardToPage($page) {\n\t\techo \"<script language=\\\"javascript\\\" type=\\\"text/javascript\\\">\n\t\t\tdocument.location.href = \\\"\".$page.\"\\\"</script>\";\n\t}",
"function redirect($page)\n\t{\n\t\t$currentPage = basename($_SERVER['PHP_SELF']);\n\t\t// prevent redirecting away from graphs.php when $.post is accessing\n\t\tif ($currentPage == 'graphs.php' || $currentPage == 'verify.php')\n\t\t{\n\t\t\tif ($_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest')\n\t\t\t{\n\t\t\t\theader('Location: /fp2.0/');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\telse if ($currentPage != $page)\n\t\t{\n\t\t\tif ($page == 'index.php')\n\t\t\t\t$page = ''; // make sure index.php is not included so that the url is shorter\n\t\t\t\n\t\t\tif (!isLoggedIn())\n\t\t\t{\n\t\t\t\theader(\"Location: login.php\");\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if ($currentPage != 'monthlyReport.php' && $currentPage != 'settings.php')\n\t\t\t{\n\t\t\t\theader(\"Location: /fp2.0/\" . $page);\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}",
"function redirect_to_page($path = null) {\n header(\"location:\" . SITE_ADDR . $path);\n}",
"function load( $page = 'limbo_login.php' ) {\n\n $url = 'http://' . $_SERVER[ 'HTTP_HOST' ] . dirname( $_SERVER[ 'PHP_SELF' ] ) ;\n \n $url = rtrim( $url, '/\\\\' ) ;\n \n $url .= '/' . $page ;\n\n header( \"Location: $url\" ) ;\n\n exit() ;\n\n}",
"function RedirectPage($page_name) {\n\t\theader( sprintf('Location: %s', $page_name));\n\t\tdie(\"You don't belong here.\");\n\t}",
"function redirect($page) {\n header(\"Location: \" . $_SERVER['REQUEST_SCHEME'] . \"://\" . $this->getDomain() . $page);\n die();\n }",
"function redirectSomewhere($value) {\n\t\t$this->controller->redirect($value);\n\t}",
"function redirectSomewhere($value) {\r\n\t\t$this->controller->redirect($value);\r\n\t}",
"abstract protected function redirect();",
"function redirect_user ($page) {\n \n // Start defining the URL...\n // URL is http:// plus the host name plus the current directory:\n $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);\n \n // Remove any trailing slashes:\n $url = rtrim($url, '/\\\\');\n \n // Add the page:\n $url .= '/' . $page;\n \n // Redirect the user:\n header(\"Location: $url\");\n exit(); // Quit the script.\n}",
"function loadFile($file) {\n if(file_exists($file)) {\n require_once($file);\n } else {\n redirect('Location:./?p=404', 'Error. Page does not exist.');\n }\n}",
"function RedirectTo($newlocation){\n\t\theader('location:' . $newlocation);\n\t\texit();\n\t}",
"function redirect($page)\n{\n\theader('Location: ' . $page);\n\tdie();\n}",
"private function redirect(){\n\t\tredirect('browse/office_industrial');//default re-route\n\t}",
"public static function redir($page){\n\t\theader(\"Location: $page\"); \n\t}",
"function redirect_to( $path ) {\n\theader( 'Location: ' . SITE_URL . '/' . $path );\n\tdie();\n}",
"public function redirect() {\n\n\t\t// @todo. How to handle https?\n\t\t$domain = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t$data = $this->EE->shortee->get_url($domain,$this->EE->input->get('url',true));\n\n\t\tif(!$data) {\n\t\t\t$loc = $this->EE->config->item('site_url');\n\t\t} else {\n\t\t\t$loc = $data['url'];\n\t\t\t$this->EE->shortee->log_view($data['id'],$_SERVER['REMOTE_ADDR']);\n\t\t}\n\n\t\theader(\"Location: \".$loc, true, 302);\n\t\texit;\n\t}",
"function redirect($page){\n\t\t$domen = strstr($_SERVER['REQUEST_URI'],\"index\", TRUE);\n\t\t$s = ((!empty($_SERVER['HTTPS'])) ? \"s\" : \"\");\n\t\theader(\"Location: http\".$s.\"://\".$_SERVER['SERVER_NAME'].$domen.$page);//\"index.php?page=login\" );\n\t}",
"static function Redirect($filepath, $direct = false)\n\t\t{\n\t\t\t$url = \"\";\n\t\t\tif(!$direct)\n\t\t\t{\n\t\t\t$host = $_SERVER['HTTP_HOST'] ;\n\t\t\t$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\') ;\n\t\t\t\n\t\t\t$url = \"http://\".$host.$uri.\"/\".$filepath;\n\t\t\t//header($url) ;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$url = $filepath;\n\t\t\t}\n\t\t\t\n\t\t\tif(!headers_sent()) \n\t\t\t{\n\t\t header('Location: '.$url);\n\t\t }\n\t\t else\n\t\t {\n\t\t\t\tprintf(\"<script>window.location.replace('%s');</script>\", $url);\n\t\t }\n\t\t}",
"function redirect_to($page)\n{\n header(\"Location: $page\");\n die();\n}",
"function redirect(string $path) {\n header(\"Location: ${path}\");\n exit;\n }"
] | [
"0.69143265",
"0.6794202",
"0.6668645",
"0.6615202",
"0.6575547",
"0.6524543",
"0.64391494",
"0.634676",
"0.62784934",
"0.62628347",
"0.6244644",
"0.6232029",
"0.62046224",
"0.617032",
"0.6133014",
"0.61052847",
"0.610047",
"0.6097736",
"0.6088323",
"0.6081365",
"0.60718685",
"0.6069019",
"0.6066393",
"0.60647714",
"0.60376966",
"0.6033468",
"0.60288304",
"0.6018808",
"0.6015864",
"0.6015607"
] | 0.7128829 | 0 |
Returns the string with the given prefix removed, or the string itself if it doesn't start with the prefix. | function strip_prefix(string $string, string $prefix): string
{
if ('' === $prefix || !starts_with($string, $prefix)) {
return $string;
}
/** @psalm-suppress MissingThrowsDocblock - $offset is within-bounds. */
return slice($string, length($prefix));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function strip_prefix(string $string, string $prefix, Encoding $encoding = Encoding::UTF_8): string\n{\n if ($prefix === $string) {\n return '';\n }\n\n if ('' === $prefix || '' === $string || !starts_with($string, $prefix, $encoding)) {\n return $string;\n }\n\n return slice($string, length($prefix, $encoding), null, $encoding);\n}",
"public static function stripStart($str, $prefix) {\n\t\t$prefixLen = strlen($prefix);\n\t\tif (substr($str, 0, $prefixLen) === $prefix) {\n\t\t\treturn substr($str, $prefixLen);\n\t\t}\n\t\treturn $str;\n\t}",
"protected final function stripPrefix ($string, $prefix) {\n\t\tif ($this->stringStartsWith($string, $prefix))\n\t\t{\n\t\t\treturn substr($string, strlen($prefix));\n\t\t}\n\t\treturn $string;\n\t}",
"public static function removePrefix(string $str, string $prefix): string\n {\n $length = strlen($prefix);\n if (substr($str, 0, $length) === $prefix) { // if start from prefix\n return substr($str, $length);\n } else {\n return $str;\n }\n }",
"public static function removePrefix($string, $prefix = null)\n {\n if (empty($prefix)) {\n $prefix = Yii::$app->controller->db->tablePrefix ?: null;\n }\n\n if (strpos($string, $prefix) === false) {\n return $string;\n }\n\n $position = strpos($string, $prefix) + strlen($prefix);\n\n return substr($string, $position);\n }",
"protected function remove_prefix( $text, $prefix ) {\n\t\tif ( 0 === strpos( $text, $prefix ) ) {\n\t\t\t$text = substr( $text, strlen( $prefix ) );\n\t\t}\n\t\treturn $text;\n\t}",
"private static function removePrefix(string $str, string $prefix): ?string\n {\n if (substr($str, 0, strlen($prefix)) == $prefix) {\n return substr($str, strlen($prefix));\n }\n\n return null;\n }",
"function str_removeFromStart (string $str, string $needle) : string {\n\t$strLen = strlen($str);\n\t$needleLen = strlen($needle);\n\n\tif($strLen >= $needleLen and str_startsWith($str, $needle)){\n\t\treturn substr($str, $needleLen);\n\t}\n\treturn $str;\n}",
"public static function stripPrefix(string $input): string\n {\n if (substr($input, 0, strlen(static::HEX_PREFIX)) == static::HEX_PREFIX) {\n $input = substr($input, strlen(static::HEX_PREFIX));\n }\n\n return $input;\n }",
"public function unprefix($value);",
"public function removeLeft($substring)\n {\n $stringy = static::create($this->str, $this->encoding);\n\n if ($stringy->startsWith($substring)) {\n $substringLength = UTF8::strlen($substring, $stringy->encoding);\n\n return $stringy->substr($substringLength);\n }\n\n return $stringy;\n }",
"public static function removeStart(string $haystack, string $needle): string\n {\n return static::startsWith($haystack, $needle) ? substr($haystack, strlen($needle)) : $haystack;\n }",
"public static function deletePrefix($prefix)\n {\n return self::pipeline(function ($pipe) use ($prefix) {\n $keys = self::keys($prefix);\n foreach ($keys as $key) {\n $pipe->del($key);\n }\n });\n }",
"public function removePathPrefix($path)\n {\n return substr($path, strlen($this->getPathPrefix()));\n }",
"function pkg_remove_prefix(&$pkg_name) {\n\tglobal $g;\n\n\tif (substr($pkg_name, 0, strlen(g_get('pkg_prefix'))) ==\n\t g_get('pkg_prefix')) {\n\t\t$pkg_name = substr($pkg_name, strlen(g_get('pkg_prefix')));\n\t}\n}",
"public static function cleanPrefix($prefixString)\n {\n $prefixString = trim($prefixString);\n if (empty($prefixString)) {\n return null;\n }\n\n $result = preg_replace('/_*$/i', '', strtolower($prefixString)) . '_';\n\n if ($result == '_') {\n return null;\n }\n\n return $result;\n }",
"private function getPathWithoutPrefix( $completePath, $prefix )\n {\n $prefixLength = strlen( $prefix );\n\n if ( strcmp( substr( $completePath, 0, $prefixLength ), $prefix ) == 0 )\n {\n $i = 0;\n // Check next character\n while ( $completePath[$i + $prefixLength] == \"/\" )\n {\n $i++;\n }\n\n $result = substr( $completePath, $prefixLength + $i );\n return $result;\n }\n else\n {\n // No match.\n return $completePath;\n }\n }",
"private function removePrefix($path): string\n {\n $prefix = $this->application->pathPrefix();\n\n if (empty($prefix)) {\n return $path;\n }\n\n return str_replace($prefix, '', $path);\n }",
"protected function stripPrefix(string $table): string {\n $len = strlen($this->px);\n if (strcasecmp(substr($table, 0, $len), $this->px) === 0) {\n $table = substr($table, $len);\n }\n return $table;\n }",
"public static function remove_prefix_name(string $line, string $bo_sung = \"\")\n {\n $line = strtoupper($line);\n\n $line = str_replace(\"MSTR\" . $bo_sung, \"\", $line);\n $line = str_replace(\"MRS\" . $bo_sung, \"\", $line);\n $line = str_replace(\"MR\" . $bo_sung, \"\", $line);\n $line = str_replace(\"MS\" . $bo_sung, \"\", $line);\n $line = str_replace(\"MISS\" . $bo_sung, \"\", $line);\n return trim($line);\n }",
"public function get_option_remove_prefix ( $option ) {\n\n if (strpos( $option, $this->settings_prefix . '_' ) === 0) {\n\n $option = substr($option, strlen($this->settings_prefix) + 1);\n }\n\n return $option;\n }",
"public static function SetCutString($str, $prefix) {\n return substr($str, strlen($prefix), strlen($str));\n }",
"public static function leftStrip($origin, $substring)\n {\n // Lang file common cases: reference string or comment\n if ($substring === ';' || $substring === '#') {\n return trim(mb_substr($origin, 1));\n }\n\n return trim(mb_substr($origin, mb_strlen($substring)));\n }",
"public function clearByPrefix(string $prefix): bool;",
"function ea_archive_title_remove_prefix( $title ) {\n\t$title_pieces = explode( ': ', $title );\n\tif( count( $title_pieces ) > 1 ) {\n\t\tunset( $title_pieces[0] );\n\t\t$title = join( ': ', $title_pieces );\n\t}\n\treturn $title;\n}",
"public function forPrefix(): ?string\n {\n return null;\n }",
"public static function getPrefix()\n\t\t{\n\t\t\treturn substr(self::get(), 0, 2);\n\t\t}",
"private function removePrefixes($query) {\n $splittedQuery = explode(' ', $query);\n $words = array();\n for ($i = 0, $ii = count($splittedQuery); $i < $ii; $i++) {\n $words[] = $this->context->dictionary->stripPrefix($splittedQuery[$i]);\n }\n return join(' ', $words);\n }",
"public function getPrefix()\n\t{\n\t\t\n\t\t$parsed = $this->getAsArray();\n\t\t\n\t\tif( ! empty($parsed) )\n\t\t{\n\t\t\tif( in_array($parsed[0], (array)$this->prefixes) )\n\t\t\t{\n\t\t\t\treturn $parsed[0];\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"function str_remove_first(string $needle, string $object)\n {\n return Str::removeFirst($needle, $object);\n }"
] | [
"0.8110948",
"0.8102732",
"0.80515015",
"0.796179",
"0.7772836",
"0.7643129",
"0.70024735",
"0.6863972",
"0.6680536",
"0.6601046",
"0.65736556",
"0.6561675",
"0.65184146",
"0.6487255",
"0.6484459",
"0.64826554",
"0.6442965",
"0.6424962",
"0.63787746",
"0.6302032",
"0.6215819",
"0.618898",
"0.617687",
"0.6104227",
"0.60826254",
"0.6014097",
"0.5949866",
"0.59354514",
"0.59269303",
"0.587387"
] | 0.81293166 | 0 |
///////////////////////////////////////////////////// Script parsing Run a raw script with a specified stack | protected function runRawScript(&$stack, $raw_script) {
$return = null;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runSubStack() {\n\t$reconId=$_POST['reconId'];\n\t$maxjump=$_POST['maxjump'];\n\t$commit=$_POST['commit'];\n\t$description=$_POST['description'];\n\n\t/* *******************\n\tPART 2: Check for conflicts, if there is an error display the form again\n\t******************** */\n\tif (!$description) createSubStackForm(\"<B>ERROR:</B> Enter a brief description\");\n\tif (!$maxjump) createSubStackForm(\"<B>ERROR:</B> You must specify a maximum jump cutoff\");\n\tif (!$reconId) createSubStackForm(\"<B>ERROR:</B> You must specify a reconId\");\n\n\t/* *******************\n\tPART 3: Create program command\n\t******************** */\n\t$command =\"jumperSubStack.py \";\n\t$command.=\"--description=\\\"$description\\\" \";\n\t$command.=\"--max-jump=$maxjump \";\n\t$command.=\"--refinerunid=$reconId \";\n\t$command.= ($commit=='on') ? \"--commit \" : \"--no-commit \";\n\n\t/* *******************\n\tPART 4: Create header info, i.e., references\n\t******************** */\n\t// Add reference to top of the page\n\t$headinfo .= initModelRef(); // main init model ref\n\n\t/* *******************\n\tPART 5: Show or Run Command\n\t******************** */\n\n\t// submit command\n\t$errors = showOrSubmitCommand($command, $headinfo, 'makestack', $nproc);\n\t// if error display them\n\tif ($errors)\n\t\tcreateSubStackForm($errors);\n\texit;\n}",
"function parse() {\n\t\t$this->errno = 0;\n\t\t$this->errinfo = \"\";\n\t\t\n\t\tif( !$this->flagLoaded ) {\n\t\t\t$this->errno = -3;\n\t\t\treturn false;\n\t\t}\n\t\t$this->flagParsed = false;\n\t\tfor( $i = 0; $i < count($this->script); $i++ ) {\n\t\t\t$this->errinfo = \"Line: $i\";\n\t\t\tif( ($this->script[$i][0] == \"#\") &&\n\t\t\t (!strstr($this->script[$i],\"--[\")) &&\n\t\t\t (!strstr($this->script[$i],\"]--\")) ) {\n\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse if( ($this->script[$i][0] == \"#\") &&\n\t\t\t (strstr($this->script[$i],\"--[\")) &&\n\t\t\t (strstr($this->script[$i],\"]--\")) ) {\n\t\t\t\t\n\t\t\t\t$arg = array();\n\t\t\t\t\n\t\t\t\t$j = $i + 1;\n\t\t\t\t\n\t\t\t\twhile ( ($j < count( $this->script )) &&\n\t\t\t\t ($this->script[$j][0] == \"#\") )\n\t\t\t\t\t$j++;\n\t\t\t\twhile ( ($j < count( $this->script )) &&\n\t\t\t\t (trim($this->script[$j]) ==\"\") )\n\t\t\t\t\t$j++;\n\t\t\t\t\n\t\t\t\tfor( ; ($j < count( $this->script )) && ($this->script[$j][0] != \"#\"); $j++) {\n\t\t\t\t\t$arg[] = $this->script[$j];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor( $j = count($arg) - 1; ($j >= 0) && (trim($arg[$j]) == \"\"); $j-- )\n\t\t\t\t\tunset( $arg[$j] );\n\t\t\t\t\n\t\t\t\t$arg = implode( \"\", $arg );\n\t\t\t\t$command = $this->extractCommand( $this->script[$i] );\n\t\t\t\t\t\t\t\t\n\t\t\t\tif( $command == \"SQL\" )\n\t\t\t\t{\n\t\t\t\t\t$this->sql = array_merge($this->sql, split_sql_file(trim($arg),';'));\n\t\t\t\t\t$this->flagSql = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( (trim($arg) == \"\") && ($command != \"CLOSE\") ) {\n\t\t\t\t\t$this->errno = -4;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $command == \"UNKNOWN\" ) {\n\t\t\t\t\t$this->errno = -5;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->commands[] = array( 'cmd' => $command, 'arg' => $arg );\n\t\t\t}\n\t\t}\n\t\t$this->flagParsed = true;\n\t\t$this->errinfo = \"\";\n\t\treturn true;\n\t}",
"public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n\t{\n\t}",
"public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {\n\t\t$utils = PHPCS_SecurityAudit\\Sniffs\\UtilsFactory::getInstance();\n\t\t$tokens = $phpcsFile->getTokens();\n $closer = $phpcsFile->findNext(T_BACKTICK, $stackPtr + 1, null, false, null, true);\n\t\tif (!$closer) {\n\t\t\treturn;\n\t\t}\n $s = $stackPtr + 1;\n\t\t$s = $phpcsFile->findNext(T_VARIABLE, $s, $closer);\n if ($s) {\n\t\t\t$msg = 'System execution with backticks detected with dynamic parameter';\n\t\t\tif ($utils::is_token_user_input($tokens[$s])) {\n\t\t\t\t$phpcsFile->addError($msg . ' directly from user input', $stackPtr, 'ErrSystemExec');\n\t\t\t} else {\n\t\t\t\t$phpcsFile->addWarning($msg, $stackPtr, 'WarnSystemExec');\n\t\t\t}\n\t\t}\n\n\t}",
"public function parse()\n {\n while($this->token != Instructions::EOF)\n {\n $choice = $this->decode();\n \n $this->instrCount++;\n $this->stats->add_instr();\n \n switch($choice)\n {\n case Instructions::zeroParams:\n $this->parse_zero_fun();\n break;\n case Instructions::oneParamL:\n $this->parse_oneL_fun();\n break;\n case Instructions::oneParamS:\n $this->parse_oneS_fun();\n break;\n case Instructions::oneParamV:\n $this->parse_oneV_fun();\n break;\n case Instructions::twoParamVS:\n $this->parse_twoVS_fun();\n break;\n case Instructions::twoParamVT:\n $this->parse_twoVT_fun();\n break;\n case Instructions::threeParamLSS:\n $this->parse_threeLSS_fun();\n break;\n case Instructions::threeParamVSS:\n $this->parse_threeVSS_fun();\n break;\n \n case Instructions::EOF:\n $this->stats->sub_instr();\n break;\n \n case Instructions::unknownFun:\n fwrite(STDERR, \"Error! Calling undefined function! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(22);\n }\n }\n }",
"public static function fromRawSource(): self\n {\n return new self($_SERVER['argv'], $_SERVER);\n }",
"function sexpcode_parse_sexp($string, $offset, &$defs)\n{\n\n if ($string[$offset] != '{')\n return array(\"\", -1); /* parser fuck-up, not syntax error */\n\n ++$offset;\n $eos = strlen($string);\n global $sexpcode_tags;\n\n\n /* Retrieve the entire function expression first */\n\n $i = $offset;\n $n = 0;\n while ($i < $eos && $string[$i] != ' ' || $n != 0) {\n switch ($string[$i]) {\n case '{':\n ++$n;\n break;\n case '}':\n if (--$n < 0) return array(\"\", -1);\n break;\n }\n ++$i;\n }\n if ($i == $eos) return array(\"\", -1);\n $expr = substr($string, $offset, $i - $offset);\n $offset = $i + 1;\n\n\n /* Bun's special verbatim syntax. */\n\n if (preg_match('/^[^a-zA-Z0-9{}]/', $expr)) {\n $end = strpos($string, \" \" . $expr, $offset);\n\n return $end === false ? array(substr($string, $offset), $eos)\n : array(substr($string,\n $offset,\n $end - $offset),\n $end + strlen($expr) + 2);\n }\n\n\n /* Function definition */\n\n if ($expr == \"define\") {\n $i = $offset;\n while ($i < $eos && $string[$i] !== ' ')\n ++$i;\n if ($i == $eos) return array(\"\", -1);\n\n $alias = substr($string, $offset, $i - $offset);\n\n ++$i;\n $offset = $i;\n $n = 0;\n while ($i < $eos) {\n if ($string[$i] == '{')\n ++$n;\n elseif ($string[$i] == '}') {\n if ($n == 0) break;\n --$n;\n }\n ++$i;\n }\n if ($i == $eos) return array(\"\", -1);\n\n $expr = substr($string, $offset, $i - $offset);\n $offset = $i + 1;\n\n if (($defs[$alias] = sexpcode_get_tags($expr, $defs)) === false)\n return array(\"\", -1);\n\n return array(\"\", $offset);\n }\n\n\n /* And undefinition. */\n\n if ($expr == \"undefine\") {\n $i = $offset;\n while ($i < $eos && $string[$i] !== '}')\n ++$i;\n if ($i == $eos) return array(\"\", -1);\n\n $fun = substr($string, $offset, $i - $offset);\n if (array_key_exists($fun, $defs))\n unset($defs[$fun]);\n\n return array(\"\", $i + 1);\n }\n\n\n /* Regular function expression */\n\n if (($t = sexpcode_get_tags($expr, $defs)) === false)\n return array(\"\", -1);\n list($open, $close, $verbatim, $arity) = $t;\n\n for ($i = 1; $i <= $arity; ++$i) {\n if (($p = sexpcode_next_arg($string, $offset)) === false)\n return array(\"\", -1);\n list($arg, $offset) = $p;\n\n $open = str_replace('%' . $i . '%', $arg, $open);\n }\n\n\n $ret = $open;\n $i = $offset;\n $n = 0;\n\n while ($i < $eos) {\n switch ($string[$i]) {\n case '}':\n if ($n == 0) {\n return array($ret . substr($string,\n $offset,\n $i - $offset) . $close,\n $i + 1);\n } else --$n;\n break;\n\n case '{':\n if (!$verbatim) {\n $ret .= substr($string, $offset, $i - $offset);\n list($p, $i) = sexpcode_parse_sexp($string, $i, $defs);\n\n if ($i < 0) return array(\"\", -1);\n\n $ret .= $p;\n $offset = $i;\n --$i;\n } else ++$n;\n break;\n }\n ++$i;\n }\n\n\n /* User omitted closing braces; close his tags. */\n\n return array($ret . substr($string, $offset) . $close, $eos);\n}",
"function startText($parser,$data)\n\t{\n\t\tunset($parser);\n\n\t\t$parent_tempcode=array_pop($this->tempcode_stack);\n\t\t$parent_tempcode->attach($data);\n\t\tarray_push($this->tempcode_stack,$parent_tempcode);\n\t}",
"public function process(File $phpcsFile, $stackPtr)\r\n {\r\n // nothing to do here and will never be called\r\n }",
"public static function run($script)\n {\n $script = self::openTag($script);\n //\n $script = self::closeTag($script);\n //\n return $script;\n }",
"abstract public function parse(\\SHH\\Parser &$parser);",
"public function compile($stack)\r\n\t{\r\n\t\tif(empty($stack))\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif(is_array($stack) && isset($stack['name']))\r\n\t\t{\r\n\t\t\t$stack = array($stack);\r\n\t\t}\r\n\t\t\r\n\t\t$str = '';\r\n\t\tforeach((Array) $stack as $element)\r\n\t\t{\r\n\t\t\tif(is_string($element))\r\n\t\t\t{\r\n\t\t\t\t$str .= $this->parse_individual($element);\r\n\t\t\t}\r\n\t\t\telseif( ! empty($element))\r\n\t\t\t{\r\n\t\t\t\t$str .= $this->context->render_tag($element['name'], $element['args'], $element['content']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $str;\r\n\t}",
"private function processStack($stack_name)\n {\n foreach ($this->$stack_name as $action)\n {\n array_shift($this->$stack_name);\n\n // stack entry is an object, let's save it\n if (is_object($action) && $action instanceof BaseObject)\n {\n $action->save();\n }\n // stack entry is an sql query, let's execute it\n elseif (is_string($action))\n {\n $con = Propel::getConnection();\n $statement = $con->prepareStatement($action);\n $result = $statement->executeQuery();\n }\n else\n {\n $msg = sprintf('Unable to process %s stack entry: %s', $stack_name, serialize($action));\n throw new Exception($msg);\n }\n\n }\n }",
"public function process(File $phpcsFile, $stackPtr)\n {\n // no variable are in the string from here\n $tokens = $phpcsFile->getTokens();\n $qtString = $tokens[$stackPtr]['content'];\n // makes sure that it is about a double quote string,\n // since variables are not parsed out of double quoted string\n $open_qt_str = substr($qtString, 0, 1);\n\n // clean the enclosing quotes\n $qtString = substr($qtString, 1, strlen($qtString) - 1 - 1);\n\n if (0 === strcmp($open_qt_str, '\"')) {\n $this->processDoubleQuotedString($phpcsFile, $stackPtr, $qtString);\n } else if (0 === strcmp($open_qt_str, \"'\")) {\n $this->processSingleQuotedString($phpcsFile, $stackPtr, $qtString);\n }\n }",
"public function run()\n {\n// $this->parse();\n }",
"public abstract function exec();",
"function parse(){ // parsing template\n\t$loop_count = -1;\n\tif (func_num_args()>= 1){\n\t\t$proc_type = func_get_arg(0);\n\t\t//if (!in_array($proc_type, array(PT_ROOT, PT_IF, PT_FOR, PT_SILENT_IF, PT_SILENT_FOR, PT_FALSE_IF))) system_die('Invalid process type', 'Template->parse');\n\t} else {\n\t\tif ( (PT_COMPILE) && (isset($this->filename)) ) // file parsing\n\t\t{\n\t\t\tif (file_exists($this->filename . '.php'))\n\t\t\t\tif (filemtime($this->filename . '.php') > filemtime($this->filename))\n\t\t\t\t{\n\t\t\t\t\tinclude($this->filename . '.php');\n\t\t\t\t\t$this->result = $r;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t$nesting = 0;\n\t\t\t$tplc = '<?$r=\\'\\';';\n\t\t\tfor ($i=0; $i<count($this->template); $i++)\n\t\t\t{\n\t\t\t\t// process\n\t\t\t\t$line = trim($this->template[$i]);\n\t\t\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\t\t\t$result = array();\n\t\t\t\tif (preg_match(PT_START_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'for ($i' . $nesting . '=0;$i' . $nesting . '<intval(' . $this->get_var_ref($result[3], $nesting) . ');$i' . $nesting . '++){' . \"\\n\";\n\t\t\t\t\t\t$nesting++;\n\t\t\t\t\t}\n\t\t\t\t\telse // this line is IF opening tag\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'if ('.$result[2].'(bool)('.$this->get_var_ref($result[3], $nesting).')){' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t} elseif (preg_match(PT_END_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}' . \"\\n\";\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t\t$nesting--;\n\t\t\t\t} elseif (preg_match(PT_MIDDLE_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}else{' . \"\\n\";\n\t\t\t\t} elseif (preg_match('/<%/', $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$j = 0;\n\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\twhile ($j<strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( ($line[$j] == '<') && ($line[$j+1] == '%') )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_f_value(substr($line, $j), $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t$j += $dw;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tmp_str .= $line[$j];\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t\t$tplc .= '$r.=\"\\\\n\";';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($line, $nesting, $dw) . \".\\\"\\\\n\\\";\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tplc .= '?>';\n\t\t\t\n\t\t\t$fh = fopen($this->filename . '.php', 'wt');\n\t\t\tif ($fh)\n\t\t\t{\n\t\t\t\tfwrite($fh, $tplc);\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t\telse\n\t\t\t\tsystem_die('Cannot save compiled template');\n\t\t\tinclude($this->filename . '.php');\n\t\t\t$this->result = $r;\n\t\t\treturn 0;\n\t\t} // if compile and filename\n\t\t$proc_type = PT_ROOT;\n\t\tunset($this->result);\n\t}\n\tif (func_num_args()> 1){\n\t\t$curr_pos = intval(func_get_arg(1));\n\t\tif (($proc_type == PT_FOR) && (func_num_args() < 3)) system_die('Undefined loop count (FOR process)', 'Template->parse');\n\t\tif (func_num_args()> 2) $loop_count = intval(func_get_arg(2));\n\t}\n\telse\n\t\t$curr_pos = 0;\n\t$succ_mode = false;\n\twhile ($curr_pos < sizeof($this->template)){\n\t\t$line = $this->template[$curr_pos]; // current line\n\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\tif (preg_match(PT_START_TAGS, $line, $result)){ // this line contains one of the START tags\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif ($result[1] == 'FOR'){\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){ // invalid FOR variable\n\t\t\t\t\t$error_msg = 'Invalid FOR statement counter named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type <= PT_FOR) $count = intval($this->get_var_val($result[3]));\n\t\t\t\t\t$this->system_vars['cycle_nesting']++;\n\t\t\t\t\t$nesting_saver = $this->system_vars['cycle_nesting'];\n\t\t\t\t\tif ($proc_type> PT_FOR) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($count == 0) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor ($c = 0; $c < $count; $c++){\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_counters'][$nesting_saver] = $c;\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_nesting'] = $nesting_saver;\n\t\t\t\t\t\t\t\t$last_pos = $this->parse(PT_FOR, $curr_pos + 1, $c); // create visible FOR process in loop\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$curr_pos = $last_pos;\n\t\t\t\t}\n\t\t\t} else { // this line is IF opening tag\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){\n\t\t\t\t\t$error_msg = 'Invalid IF statement variable named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type>PT_FOR) $curr_type = PT_SILENT_IF;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$var = (bool)$this->get_var_val($result[3]);\n\t\t\t\t\t\tif (strlen($result[2])> 0) $var = !$var;\n\t\t\t\t\t\t$curr_type = ($var)?PT_IF:PT_FALSE_IF;\n\t\t\t\t\t}\n\t\t\t\t\tif ($loop_count!=-1) $curr_pos = $this->parse($curr_type, $curr_pos+1, $loop_count); // create new IF process inside the loop\n\t\t\t\t\telse $curr_pos = $this->parse($curr_type, $curr_pos+1); // create new IF process\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(preg_match(PT_END_TAGS, $line, $result)){\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (((($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) && ($result[1] == 'FOR')) || ((($proc_type == PT_IF) || ($proc_type == PT_SILENT_IF) || ($proc_type == PT_FALSE_IF)) && ($result[1] == 'IF'))) {\n\t\t\t\tif (($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) $this->system_vars['cycle_nesting']--; // this one was the end of loop block\n\t\t\t\t$succ_mode = true;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$error_msg = 'Unexpected end of '.$result[1].' statement';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif(preg_match(PT_MIDDLE_TAGS, $line, $result)){ // this line contains one of the MIDDLE tags (ELSE probably)\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (($proc_type == PT_FALSE_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_IF;\n\t\t\t} elseif (($proc_type == PT_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_FALSE_IF;\n\t\t\t} elseif($proc_type != PT_SILENT_IF) { // ELSE inside non IF process or so\n\t\t\t\t$error_msg = 'Unexpected '.$result[1].' statement '.$proc_type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif ($proc_type <= PT_FOR){ // processing of visible contents\n\t\t\tif (!isset($this->result)) $this->result = '';\n\t\t\t\t$matches = array();\n\t\t\t\t$line_is_control = false;\n\n\t\t\t\tif (preg_match_all(PT_COUNTER_TAGS, $line, $matches)){ // We have counter tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[0] as $key => $val){ // process counters\n\t\t\t\t\t\tif ($loop_count >= 0) $replace[$key] = $loop_count + 1;\n\t\t\t\t\t\telse $replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\t\t\t\t// processing variables\n\n\t\t\t\tif (preg_match_all(PT_VARIABLE_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (strlen($matches[4][$key])> 0){ // process array variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]) && is_array($this->vars[$val]) && array_key_exists($matches[4][$key], $this->vars[$val])){\n\t\t\t\t\t\t\t\t\t$replace[$key] = $this->vars[$val][$matches[4][$key]];\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif (isset($this->vars[$val]) && is_object($this->vars[$val])) {\n\t\t\t\t\t\t\t\t \t$_obj = &$this->vars[$val];\n\t\t\t\t\t\t\t\t\t$_name = $matches[4][$key];\n\t\t\t\t\t\t\t\t\t$replace[$key] = $_obj->$_name;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val.$matches[3][$key], 4); // show stupid notice\n\t\t\t\t\t\t\t\t$replace[$key] = ''; // and insert complete emptyness\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else{ // process common variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]))\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($val);\n\t\t\t\t\t\t\telseif (preg_match('/\\\\//', $val))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$v_row = $this->Registry->_internal_get_value($val);\n\t\t\t\t\t\t\t\tif ( ($v_row !== false) && (!$v_row->eof()) ) {\n\t\t\t\t\t\t\t\t\t$out = $v_row->Rows[0]->Fields['value'];\n\t\t\t\t\t\t if ($v_row->Rows[0]->Fields['key_type'] == KEY_TYPE_IMAGE)\n\t\t\t\t\t\t\t\t\t\t$out = $GLOBALS['app']->template_vars['REGISTRY_WEB'] . $v_row->Rows[0]->Fields['id_path'] . '/' . $out;\n\t\t\t\t\t\t\t\t\t$replace[$key] = $out;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing ternary operators\n\n\t\t\t\tif (preg_match_all(PT_TERNARY_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (isset($this->vars[$val])){\n\t\t\t\t\t\t\t$var = (bool)$this->get_var_val($val);\n\t\t\t\t\t\t\tif (strlen($matches[1][$key])> 0) $var = !$var;\n\t\t\t\t\t\t\t$res_num = ($var)?4:6;\n\t\t\t\t\t\t\tif (isset($this->vars[$matches[$res_num][$key]])) {\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($matches[$res_num][$key]);\n\t\t\t\t\t\t\t\tif (strlen($matches[$res_num - 1][$key])> 0) $replace[$key] = htmlspecialchars($replace[$key]); // escape html entries\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($res_var, 1);\n\t\t\t\t\t\t\t\t$result[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // we have tag but haven't got variable\n\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val, 1); // curse them out in debug mode\n\t\t\t\t\t\t\t$replace[$key] = ''; // and insert pretty nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing controls\n\t\t\t\tif (preg_match_all(PT_CONTROL_TAGS, $line, $matches)){ // Yes! This line contains control definition\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[1] as $key => $name){ // go through the matches\n\t\t\t\t\t\tif (strlen($matches[3][$key])> 0) $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name), strtolower($matches[3][$key])); // here is control with id\n\t\t\t\t\t\telse $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name)); // here is control without id\n\t\t\t\t\t\tif (!is_null($tcontrol)){\n\t\t\t\t\t\t\t$tcontrol->parse_vars($matches[5][$key]);\n\t\t\t\t\t\t\tif (!$tcontrol->is_inited)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tcontrol->on_page_init();\n\t\t\t\t\t\t\t\t$tcontrol->is_inited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$replace[$key] = $tcontrol->process($loop_count);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace control statements with control results\n\t\t\t\t}\n\n\t\t\t\t// compress and delete blank lines\n\t\t\t\t$line = preg_replace('/[\\r\\n]*$/', '', trim($line));\n\t\t\t\tif (strlen($line)> 0) $this->result .= $line . \"\\n\";\n\t\t\t}\n\t\t\t$curr_pos++;\n\t\t}\n\n// And what we have here?\n\t\tif (!isset($error_msg) && ($proc_type != PT_ROOT) && !$succ_mode) $error_msg = 'Unexpected end of file'; // invalid template - show error\n\t\tif (isset($error_msg)){\n\t\t\t$error_txt = 'Template parsing error on line '.($curr_pos + 1);\n\t\t\tif (isset($this->filename))\t$error_txt .= ' of file \"'.$this->filename.'\"';\n\t\t\t$error_txt .= ' - '.$error_msg;\n\t\t\tsystem_die($error_txt, 'Template->parse'); // invalid template - show error\n\t\t}\n\t\tif ($proc_type == PT_ROOT)\n\t\t\tif (!isset($this->result))\n\t\t\t\t$this->result = ''; // probably there were one big false IF?\n\t\treturn $curr_pos; // HURRA! HURRA! This one is successfully completed!\n\t}",
"function runkit_lint($code)\n{\n}",
"function parse_args($argv,$argc){\n \n //Checking if help argument is present, if so, prints help\n if($argc == 2 && $argv[1] == \"--help\"){\n echo \"Nápověda pro skript v jazyce php pro provedení lexikální a syntaktické analýzy jazyka .IPPCode21\\n\";\n echo \"Verze php: 7.4.14\\n\";\n echo \"Spuštění skriptu: php parser.php <název souboru>\\n\";\n echo \"Výstup skriptu je xml soubor \\\"out.xml\\\"\\n\";\n echo \"Zobrazení nápovědy: php parser.php --help\\n\";\n exit(0);\n }\n //If argc > 1 (1st arg is program name, implicitly), searching for STATP extension parameters\n //Along with checking for arguments, checking formats and arguments order\n elseif($argc > 1){\n //Number of --stat parameters (must be at least 0)\n $n_of_stat = -1; \n //Array of permissions, it's size will be equal to number of --stat output files\n $permissions_array = array();\n //Allowed parameters (excluding --statp which is checked separately)\n $allowed_params = array(\"--loc\",\"--comments\",\"--labels\",\"--jumps\",\"--fwjumps\",\"--backjumps\",\n \"--badjumps\");\n \n //Used_filenames needs to be stored for latter repetition check. (There can't be 2\n // stat argument with same file name ) \n $used_filenames = array();\n for($i = 1; $i < $argc; $i = $i + 1)\n {\n //If --stat parameter with correct file name is present\n if(preg_match(\"/\\A--stats=.*\\z/\",$argv[$i])){\n $n_of_stat += 1; //increase number of --stat parameter\n $file_name = substr($argv[$i],8); //extract filename from parameter\n \n //If filename is used return File output error\n if (in_array($file_name,$used_filenames)){\n exit(ErrNums::FILE_OUTPUT_ERROR);\n }\n\n //If not open file and include it's name in used_filename array\n $file = fopen($file_name,'w');\n $used_filenames[$n_of_stat] = $file_name;\n \n //If file opening wasn't successful return File output error\n if(!$file){\n exit(ErrNums::FILE_OUTPUT_ERROR);\n }\n\n //Adding new Statistic permission to permission array (more in scripts/statistics.php)\n //Saving output file to permission array\n //Defining order array, which defines order of parameters (needed for correct output)\n $permissions_array[$n_of_stat] = new StatisticsPermissions();\n $permissions_array[$n_of_stat]->file = $file;\n $permissions_array[$n_of_stat]->order = array();\n }\n /*If argument isn't --stat, then it must be one of allowed_parameters\n If it is,argument is pushed to order array. If not, returns MISSING_PARAMETERS err */\n elseif (in_array($argv[$i],$allowed_params) && $n_of_stat >= 0){\n array_push($permissions_array[$n_of_stat]->order,$argv[$i]);\n }\n else{\n exit(ErrNums::MISSING_PARAMETERS);\n }\n }\n return $permissions_array;\n }\n}",
"function testParse()\n{\n global $tmpFiles1;\n global $tmpFiles2;\n global $parseFile;\n global $src;\n global $rc;\n global $html;\n global $failedParse;\n global $passedParse;\n\n # create body of html\n $body = $html->createElement(\"body\");\n $h = $html->createElement(\"h1\", \"This is script for testing parse.php and interpret.py scripts\");\n $body->appendChild($h);\n $p = $html->createElement(\"p\", \"Testing parse.php\");\n $body->appendChild($p);\n\n # find path to .rc files\n $tmp = explode(\"/\", explode(\".rc\", $rc[0], -1)[0]);\n $rcPath = explode($tmp[count($tmp)-1], $rc[0]);\n\n # create table\n $table = $html->createElement(\"table\");\n $tableAttribute = $html->createAttribute(\"style\");\n $tableAttribute->value = \"width:50%\";\n $table->appendChild($tableAttribute);\n $tr = $html->createElement(\"tr\");\n $th = $html->createElement(\"th\", \"Test name\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Test result\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"RC\");\n $tr->appendChild($th);\n $th = $html->createElement(\"th\", \"Expected RC\");\n $tr->appendChild($th);\n $table->appendChild($tr);\n $body->appendChild($table);\n\n exec(\"make\");\n foreach ($src as $source) {\n $sourceName = explode(\".src\", $source, -1);\n exec(\"./$parseFile < $source > $sourceName[0].tmp 2> /dev/null\",$output, $returnCode);\n\n # find test name\n $testName = explode(\"/\", $sourceName[0]);\n\n # create .rc file if it does not exist\n $rcFile = getRC($testName[count($testName)-1]);\n if ( $rcFile === null) {\n file_put_contents($rcPath[0].$testName[count($testName)-1].'.rc', 0);\n $rc[] = $rcPath[0].$testName[count($testName)-1].'.rc';\n }\n\n # check return code value\n if ($returnCode > 0) {\n $tr = $html->createElement(\"tr\");\n $td = $html->createElement(\"td\", $testName[count($testName)-1]);\n $tr->appendChild($td);\n\n $tmpRC = trim(file_get_contents($rcFile));\n if (intval($tmpRC) !== $returnCode) {\n $td = failedTableData();\n $failedParse++;\n } else {\n $td = successTableData();\n $passedParse++;\n }\n $tr->appendChild($td);\n $td = $html->createElement(\"td\", $returnCode);\n $tr->appendChild($td);\n $td = $html->createElement(\"td\", $tmpRC);\n $tr->appendChild($td);\n $tmpFiles1[] = $sourceName[0].'.tmp';\n } else {\n $tmpFiles2[] = $sourceName[0].'.tmp';\n }\n\n $table->appendChild($tr);\n }\n $body->appendChild($table);\n\n return $body;\n}",
"public function process( File $phpcsFile, $stackPtr ) {\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\t$next = $phpcsFile->findNext( Tokens::$emptyTokens, $stackPtr + 1, null, true );\n\t\tif ( false === $next ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( T_FUNCTION === $tokens[ $next ]['code'] ) {\n\t\t\t$name = $tokens[ $phpcsFile->findNext( [ T_WHITESPACE ], $next + 1, null, true ) ]['content'];\n\t\t} else {\n\t\t\t$name = $tokens[ $phpcsFile->findNext( [ T_VARIABLE ], $next ) ]['content'];\n\t\t}\n\t\t$this->handleError( $phpcsFile, $stackPtr, 'Found', $name );\n\t}",
"protected function processVariableInString(File $phpcsFile, $stackPtr)\n {\n\n }",
"public function testPreparseCode()\n\t{\n\t\tforeach ($this->bbPreparse_tests as $testcase)\n\t\t{\n\t\t\t$test = $testcase[0];\n\t\t\t$expected = $testcase[1];\n\n\t\t\tpreparsecode($test);\n\n\t\t\t$this->assertEquals($expected, $test);\n\t\t}\n\t}",
"function execute( string $contents ): string;",
"function test363() : int {\n return ast\\parse_code(22, []);\n}",
"static private function phrase($html,$stack=array(),$current=null,$final=null){\n\t\t//echo var_export($stack);\n\t\tif(!is_null($final)&&sizeof($stack)==0){\n\t\t\treturn $final;\n\t\t}\n\t\tif (is_null($current)){\n\t\t\t$data=preg_match_r(\"/\\s*<!--\\s*(?<meta>.*)\\s*-->(?<next>.*)/Ai\",$html);\n\t\t\tif(sizeof($data)!=0){\n\t\t\t\t$html=$data[\"next\"];\n\t\t\t}\n\t\t}\n\t\tif(sizeof($stack)>=1){\n\t\t\tforeach(range(sizeof($stack)-1,0,-1) as $count){// do a callback to see if there are things that are unexpected :)\n\t\t\t\t$type_to_look_for_end_of=$stack[$count];\n\t\t\t\t$end_check=preg_match_r(\"/(?<inner_content>[^<]*)\\s*<\\s*\\/\\s*\".$type_to_look_for_end_of.\"\\s*>(?<next>.*)/siA\", $html);\n\t\t\t\tif(sizeof($end_check)>=1){\n\t\t\t\t\t//$inner_content=preg_split(\"/\\s*<\\s*\\/\\s*\".$type_to_look_for_end_of.\"\\s*>/\", $html,1)[0];//$end_check[\"inner_content\"];//@TODO apply secondary callback here\n\t\t\t\t\t$html=$end_check[\"next\"];\n\t\t\t\t\t//$current->add_content_string($inner_content);\n\t\t\t\t\t//go up x layer in tree and recall base val\n\t\t\t\t\t$current=$current->get_parents();//[$count];\n\t\t\t\t\t$current=$current[sizeof($current)-1-$count];\n\t\t\t\t\t$current->flatten();\n\t\t\t\t\t$stack=array_slice($stack,0,$count);//remove item from stack\n\t\t\t\t\treturn array($html,$stack,$current,$final);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$self_close_check=preg_match_r(\"/(?<inner_content>[^<]*)<\\s*\\/\\s*(?<end>\\w+)\\s*>/A\",$html);\n\t\t\tif(sizeof($self_close_check)>=1){\n\t\t\t\tif($stack[sizeof($stack)-2]==$self_close_check[\"end\"]){\n\t\t\t\t\t$inner_content=$self_close_check[\"inner_content\"];\n\t\t\t\t\t$current->add_content_string($inner_content);\n\t\t\t\t\t$current->self_closing=true;\n\t\t\t\t\t//go up 1 layer in tree and recall base\n\t\t\t\t\t$current=$current->get_parent();\n\t\t\t\t\tarray_pop($stack);//remove item from stack\n\t\t\t\t\treturn array($html,$stack,$current,$final);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//add check for tag stack close\n\t\t$first_match_group=preg_match_r(\"/(?<before>([^<]*(<!--)*)*)<\\s*(?<type>\\w+)\\s*(?<next>.*)/siA\",$html);\n\t\t$before=$first_match_group[\"before\"];\n\t\t$type=$first_match_group[\"type\"];\n\t\t$next=$first_match_group[\"next\"];\n\t\t/*\n\t\tArray indexes:\n\t\t[\"before\"]: string that appears before the '<' of a HTML tag.\n\t\t[\"type\"]: the type of the html tag in question\n\t\t[\"next\"]: following the type (including atributes)\n\t\tREGEX /(?<before>.+)<\\s{0,}(?<type>\\w+)\\s+(?<next>.+)/si\n\t\t\"(?<before>.*)\": set index 'before' for returnd array to all string charicters that are not a \"<\" charicter.(can be noting)\n\t\t\"<\": look for opening less than symbol.\n\t\t\"\\s{0,}\": look for any whitspace between the count of 0 and infinity\n\t\t\"(?<type>\\w+)\" collect a string of non punctual charicters\n\t\t\"\\s+\":expect whitespace charicters after the fact\n\t\t\"(?<next>.*)\" Captures everything after the type\n\t\t\"/siA\" 's' dot matches newline , i case insensitive, 'A' matches only at the start of string.\n\t\tSee: http://www.phpliveregex.com/p/erB\n\t\t*/\n\t\t$attr_to_add=array();\n\t\t$fail_safe=0;\n\t\twhile(true){//infinite loop\n\t\t\t$fail_safe++;\n\t\t\tif($fail_safe>50){\n\t\t\t\n\t\t\t\tthrow new Exception(\"Failed: to phrase html (malformed attributes) NOTE ALL SELF CLOSING TAGS MUST HAVE A '/>'\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\t$end_of_tag_check=preg_match_r(\"/\\s*((?<not_self_closing>>)|(?<self_closing>(\\/\\s*>)))(?<next>.*)/siA\",$next);\n\t\t\tif(sizeof($end_of_tag_check)>=1){// handle self closing if ending found\n\t\t\t\t\n\t\t\t\t$self_closing=$end_of_tag_check[\"self_closing\"];\n\t\t\t\t$not_self_closing=$end_of_tag_check[\"not_self_closing\"];\n\t\t\t\tif($self_closing!=\"\"){\n\t\t\t\t\t$self_closing=true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\n\t\t\t\t\t$self_closing=false;\n\t\t\t\t}\n\t\t\t\t$next=$end_of_tag_check[\"next\"];\n\t\t\t\tbreak;\n\t\t\t}\n\t\n\t\t\t$attr_data=preg_match_r(\"/\\s*(?<attr>(?:\\w|-|_)+)\\s*=\\s*(?<val>(?:\\\"(?:[^\\\"\\\\]|\\\\.)*\\\"|'(?:[^'\\\\]|\\\\.)*')\\s*)?(?<next>.*)/siA\", $next);#/\\s*(?<attr>(\\w|-|_)+)\\s*(=\\s*(?<val>(\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*')\\s*)?(?<next>.*)/siA\n\t\t\t$attr_name=$attr_data[\"attr\"];\n\t\t\t$attr_val=\"\";\n\t\t\tif( isset($attr_data[\"val\"])){\n\t\t\t\t$attr_val=trim($attr_data[\"val\"],\"'\\\"\");\n\t\t\t}\n\t\t\t$next=$attr_data[\"next\"];\n\t\t\t$attr_to_add=array_merge($attr_to_add,array($attr_name=>$attr_val));\n\t\t}\n\t\tif($type===\"script\"||$type===\"style\"){\n\t\t\t$this->handle_extream_case($html);\n\t\t}\n\t\tif (is_null($final)){//if the final form of the tree is not set\n\t\t\t$final= new elem($type,\"\",$attr_to_add,false,$self_closing);//construct it\n\t\t\t$final->overide_master();\n\t\t\t$current=$final;//set current to it\n\t\t}\n\t\telse{\n\t\t\t$current=$current->add_content($type,\"\",$attr_to_add,false,$self_closing);//add elem obj to constructing tree and go up 1 level.\n\t\n\t\t}\n\t\t$current->insert_before($before);//dump before_data before it\n\t\tif($current->is_selfclosing()){\n\t\t\t$current=$current->get_parent();\n\t\t}\n\t\telse{\n\t\t\tarray_push($stack,$type);//add item to the stack\n\t\t}\n\t\treturn array($next,$stack,$current,$final);\n\t}",
"function runParser($filePath) {\n fileParser($filePath);\n\n fileNumberAdder();\n\n formatPrinter();\n}",
"protected function _script($tree) {\n\t\t\n\t\t\t$content = array();\n\n\t\t\tif (is_string($tree)) {\n\t\t\t\t$tree = addslashes($tree);\n\t\t\t\treturn \"\\$_text[] = \\\"{$tree}\\\";\";\n\t\t\t}\n\n\t\t\tif (count($tree['children'] > 0)) {\n\t\t\t\tforeach ($tree['children'] as $child) {\n\t\t\t\t\t$content[] = $this->_script($child);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($tree['parent'])) {\n\n\t\t\t\treturn $this->_implementation->handle($tree, implode($content));\n\t\t\t}\n\n\t\t\treturn implode($content);\n\t\t}",
"abstract public function execute($sourcecode, $language, $input, $files=null, $params=null);",
"function evaluate_postfix($tokens, array $vars = array()) \n {\n\n //if we didn't recieve any tokens \n if ($tokens == false) \n return false;\n\n //create a new stack, which we'll use to evaluate the \"postfix\" expression\n $stack = new mathscript_stack();\n\n //for each token in the postfix string\n foreach ($tokens as $token)\n {\n \n //if the token is an array, it represents a function; evaluate it\n if (is_array($token) && !array_key_exists('string', $token)) \n { \n //get the function name, and the amount of arguments specified\n $function_name = $token[MATHSCRIPT_FUNCTION_NAME];\n $arg_count = $token[MATHSCRIPT_ARGUMENT_COUNT];\n\n //handle constructed functions, which are written in PHP for use by the scripted language\n if ($this->extensions->function_exists($function_name))\n {\n //start a new array, which will hold the function arguments\n $args = array();\n\n //for($i = $arg_count - 1; $i >= 0 ; --$i)\n for($i = 0; $i < $arg_count; ++$i)\n {\n //pop the top element off the stack\n list($reference, $top) = $stack->pop();\n\n //if this function expects pass-by-refernce, the pass it a reference to the object\n if($this->extensions->function_argument_by_reference($function_name, $i))\n {\n //Note the lack of a check for existence. This allows us to _create_ variables by reference.\n \n //if our reference was supplied as a literal, use it as a pointer\n if(is_null($reference))\n $args[$i] =& $top;\n else\n $args[$i] =& $reference;\n }\n //add the new element to the arguments array\n else\n {\n //if we're trying to operate on an undefined variable, raise an error\n if(is_null($top))\n return $this->trigger_undefined_variable($reference);\n\n //otherwise, pass in the variable\n $args[$i] = $top;\n }\n\n }\n\n //Call the constructed function with the given arguments, and retrieve the results.\n $result = $this->extensions->call($function_name, array_reverse($args));\n\n //if the result of the given function was false, something went wrong internally\n //TODO: replace with exception?\n if($result === false)\n return $this->trigger('internal error in function '.$function_name);\n\n //push the result onto the stack\n $stack->push(array(MATHSCRIPT_TYPE_RESULT, $result));\n \n }\n //otherwise if this is a user (runtime) defined function, handle it \n elseif (array_key_exists($function_name, $this->user_functions)) \n {\n //extract the expected amount of function arguments\n $expected_args = count($this->user_functions[$function_name][MATHSCRIPT_ARGUMENTS]);\n\n //start a new associative array, which will map the argument _name_ to the given argument\n $args = array();\n \n //for each argument provided\n for ($i = $expected_args - 1; $i >= 0; $i--) \n {\n //pull a single argument from the top of the stack\n list($reference, $top) = $stack->pop();\n\n if(is_null($top))\n return $this->trigger_undefined_variable($reference);\n\n //get the name for the current argument\n $arg_name = $this->user_functions[$function_name][MATHSCRIPT_ARGUMENTS][$i];\n\n //and add the name/value pair to our array\n $args[$arg_name] = $top;\n }\n\n //take a snapshot of the current system state\n $initial_vars = $this->vars;\n\n //merge in the arguments as local variables\n $this->vars = array_merge($this->vars, $args);\n\n //evaluate the given function via recursion\n $result = $this->evaluate_postfix($this->user_functions[$function_name][MATHSCRIPT_FUNCTION_BODY]);\n\n //and discard any modifications to the variable space\n $this->vars = $initial_vars;\n\n //and push the result onto the stack\n $stack->push(array(MATHSCRIPT_TYPE_RESULT, $result));\n }\n }\n\n //handle binary operators\n elseif(!is_array($token) && array_key_exists($token, self::$operators) && self::$operators[$token]['arity'] == 2)\n {\n //pop two operands off the stack\n list($ref2, $op2) = $stack->pop();\n list($ref1, $op1) = $stack->pop();\n\n //if we didn't get an operand, throw an error\n if(is_null($op1))\n return $this->trigger_undefined_variable($ref1);\n if(is_null($op2))\n return $this->trigger_undefined_variable($ref2);\n\n //get the handler for the given operator\n $handler = self::$operators[$token]['handler'];\n\n //call the given handler to perform the operation\n $result = call_user_func($handler, $this, $op1, $op2);\n\n //and push the result onto the stack\n $stack->push(array(MATHSCRIPT_TYPE_RESULT, $result));\n }\n //handle unary operators\n elseif(!is_array($token) && array_key_exists($token, self::$operators) && self::$operators[$token]['arity'] == 1)\n {\n //pop the operand off the stack\n list($ref, $op) = $stack->pop();\n\n //get the handler for the given operator\n $handler = self::$operators[$token]['handler'];\n\n //if the operator is designed for pass-by-reference\n if(self::$operators[$token]['by_reference'])\n {\n //get a reference to the operand\n $arg =& $ref;\n }\n else\n {\n //if we didn't get an operand, throw an error\n if(is_null($op))\n return $this->trigger_undefined_variable($ref);\n\n //set the argument equal to the operand\n $arg = $op;\n }\n\n //call the given handler to perform the operation\n $result = call_user_func($handler, $this, $arg);\n\n //and push the result onto the stack\n $stack->push(array(MATHSCRIPT_TYPE_RESULT, $result));\n }\n \n //handle variables and literals\n else \n {\n //if the token is an array with a \"string\" key, it's a string- push the core string to the stack, directly\n if(is_array($token) && array_key_exists('string', $token))\n $stack->push(array(MATHSCRIPT_TYPE_LITERAL, $token['string']));\n\n //if we've recieved a numeric token, push it directly onto the stack\n elseif (is_numeric($token)) \n $stack->push(array(MATHSCRIPT_TYPE_LITERAL, $token));\n\n //if we've recieved a local variable, push its value onto the stack\n elseif (array_key_exists($token, $vars)) \n $stack->push(array($token, $vars[$token]));\n\n //if we've recieved a global variable, push its value onto the stack\n elseif (array_key_exists($token, $this->vars)) \n $stack->push(array($token, $this->vars[$token]));\n\n //otherwise, we have a variable of unknown value;\n //we'll push it onto the array as having the value null\n else \n $stack->push(array($token, null));\n //return $this->trigger(\"undefined variable '$token'\");\n }\n }\n\n // when we're out of tokens, the stack should have a single element: the final result\n if ($stack->count != 1) \n return $this->trigger('internal error: '.$stack->count.' values were left on the stack after execution.');\n\n //return the final result\n list($reference, $result) = $stack->pop();\n\n return $result;\n }"
] | [
"0.6209875",
"0.5159944",
"0.50516796",
"0.5049321",
"0.49977317",
"0.49415466",
"0.49384597",
"0.49009112",
"0.48638225",
"0.48585474",
"0.4837272",
"0.4830505",
"0.48150834",
"0.48102474",
"0.47752997",
"0.47216263",
"0.47123265",
"0.46674982",
"0.46604148",
"0.46468744",
"0.46399334",
"0.46097842",
"0.46032497",
"0.4600946",
"0.45988652",
"0.4592973",
"0.4581743",
"0.4574606",
"0.456458",
"0.4548668"
] | 0.6518805 | 0 |
Get only master result. | public function getMasterResult()
{
$results = $this->getResults();
return isset($results['original']) ? $results['original'] : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggle_master_view_query_result(): Array {\n $model = $this->current_model;\n\n $master_view = $this->master_view_query_result();\n \n // Get result from grants model if feature model list returns empty\n \n if(method_exists($this->CI->$model,'master_view') &&\n is_array($this->CI->$model->master_view()) && \n count($this->CI->$model->master_view()) > 0 \n ){\n \n $master_view = $this->CI->$model->master_view();\n \n }\n \n return $master_view;\n }",
"public function selectdivisonmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM divisionmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"function getMaster();",
"private static function getMaster() {\n return self::getRandomPDOLB(self::MASTER);\n }",
"function getMaster() {\n\t\tif (null !== $this->_current && $this->_isMaster)\n\t\t\treturn $this->_current;\n\n\t\tif (!empty($this->_masters)) {\n\t\t\t$dsn = reset($this->_masters);\n\t\t\t$db = DatabaseManager::getConnection($dsn);\n\t\t\t\n\t\t\tif ($db->isNull()) {\n\t\t\t\t$this->_setFailed($dsn);\n\t\t\t\treturn $this->getMaster();\n\t\t\t}\n\t\t\t\n\t\t\t$this->_current = $db;\n\t\t\t$this->_isMaster = true;\n\t\t\treturn $this->_current;\n\t\t}\n\n\t\treturn DatabaseManager::getConnection('null://null');\n\t}",
"public function getRequireMaster()\n {\n $value = $this->get(self::REQUIRE_MASTER);\n\n return $value === null ? (bool) $value : $value;\n }",
"function get_master_id(){\r\n\t\t$result=$this->m_master_ambil_paket->get_master_id();\r\n\t\techo $result;\r\n\t}",
"function get_master_id(){\r\n\t\t$result=$this->m_master_jual_rawat->get_master_id();\r\n\t\techo $result;\r\n\t}",
"public function selectstatusmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM statusmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectworktypemaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM worktypemaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectmandalmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM mandalmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function masterAction()\n {\n //====================================================================//\n // Return Dummy Response\n return new JsonResponse(array('result' => 'Ok'));\n }",
"private function searchMaster() {\n $id = intval($_POST['query']);\n $data = $this->system->getDB()->query(\"SELECT * FROM master WHERE id=?\", array($id));\n echo(json_encode($data[0]));\n }",
"public function isMaster();",
"public function getSingleResult()\n {\n }",
"public function selectreligionmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM religionmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function getPrimary();",
"public function selectschememaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM schememaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectpositionmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM positionmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"function master_view_query_result(): Array {\n\n $table = strtolower($this->controller);\n \n $model = $this->current_model;\n\n $select_columns = $this->toggle_master_view_select_columns(); \n\n $lookup_tables = $this->CI->grants->lookup_tables($table);\n \n $master_view_query_result = $this->CI->grants_model->run_master_view_query($table,$select_columns,$lookup_tables);\n \n return $this->CI->grants->update_query_result_for_fields_changed_to_select_type($this->controller,$master_view_query_result);\n \n }",
"function GetMasterMainChannel()\n {\n if ( ! is_superadmin()) {\n $this->db->where('is_superadmin', 0);\n }\n $data = $this->db\n ->order_by('master_mainchannel_code', 'asc')\n ->get('master_mainchannel')\n ->result_array();\n\n return $data;\n }",
"public function selectvillagemaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM villagemaster LEFT JOIN mandalmaster ON villagemaster.mandalid=mandalmaster.mandalid\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"private function has_master(){\n\t\tif($this->master==\"None\"){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"protected function is_master() {\n\t\treturn $this->_config->is_master();\n\t}",
"public function selectlocalitymaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM localitymaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectrecievermaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM letterrecievermaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selecteventmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM eventmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function selectpetitionmaster()\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM petitionmaster\") or die(mysql_error());\n\t\treturn $result;\n\t}",
"public function getMasterConnection()\n {\n return $this->getConnection(self::DEFAULT_MASTER_NODE_ID);\n }",
"function getAllMaster($tabel){\n $db = $this->load->database('mhsc_masterdata', TRUE);\n $query = $db->get($tabel);\n return $query;\n }"
] | [
"0.65682006",
"0.6396339",
"0.63761115",
"0.6277591",
"0.62601995",
"0.6230873",
"0.6190991",
"0.61805916",
"0.6174329",
"0.6169014",
"0.61662894",
"0.6044402",
"0.59527785",
"0.58789414",
"0.58752835",
"0.5868419",
"0.58595896",
"0.5850338",
"0.580162",
"0.5797276",
"0.5795399",
"0.57707125",
"0.5762875",
"0.57620245",
"0.5723853",
"0.57154715",
"0.56867486",
"0.5684626",
"0.56639904",
"0.5656763"
] | 0.7969295 | 0 |
Get the the block container element if this element is part of one. | public function getControlBlockContainer()
{
return $this->getAncestorInstanceOf('FewAgency\FluentForm\AbstractControlBlockContainer');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAnotherBlock()\n {\n $data = $this->_coreRegistry->registry('magictoolbox');\n if ($data) {\n $skip = true;\n foreach ($data['blocks'] as $name => $block) {\n if ($name == 'product.info.media.magiczoomplus') {\n $skip = false;\n continue;\n }\n if ($skip) {\n continue;\n }\n if ($block) {\n return $block;\n }\n }\n }\n return null;\n }",
"public function getBlock()\n {\n return $this->block;\n }",
"public static function getTemplateBlock()\n {\n return self::$templateBlock;\n }",
"function get_block ( $template = false, $block = null ) {\r\n $template = $this->get_blocks ( $template );\r\n\r\n if ( empty( $block ) ) {\r\n return false;\r\n }\r\n\r\n return isset( $template[ $block ] ) ? $template[ $block ] : false;\r\n }",
"public function getContainer()\n {\n //Return container\n return $this->contentListContainer;\n }",
"public function getParentBlock()\n {\n $parentBlock = parent::getParentBlock();\n if ($parentBlock instanceof \\Cart2Quote\\Quotation\\Block\\Quote\\Request\\RequestStrategyContainer) {\n return $parentBlock->getParentBlock();\n }\n\n return $parentBlock;\n }",
"public function getRTERootBlockElement()\n\t{\n\t}",
"protected function getBlock() {\n if (!$this->block) {\n // Create an instance of the block.\n /* @var $block BlockPluginInterface */\n $block_id = $this->blockPluginId();\n $block = $this->blockManager->createInstance($block_id);\n\n $this->block = $block;\n }\n\n return $this->block;\n }",
"public function getContentElement(): ?ContentElementInterface\n {\n return $this->getChildElement(1);\n }",
"public function block($name)\n {\n return $this->blocks()->has($name) ? $this->blocks()->get($name) : null;\n }",
"public function getParent() {\n return $this->mediator_->getContainerForName($this->get('parentName'), $this->getType());\n }",
"public function getBlockByIdentifier($identifier)\n\t{\n\t\tforeach ($this->ContentBlocks as $contentBlock)\n\t\t{\n\t\t\tif ($contentBlock->identifier == $identifier)\n\t\t\t{\n\t\t\t\treturn $contentBlock;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getBlock() : Block {\n // return the private property as-is\n return $this->block;\n }",
"public function getContainerElementName() {\n\t\treturn 'div';\n\t}",
"protected function getBaseContainer(array $element) {\n\t\twhile ($parentUid = intval($element['kbnescefe_parentElement'])) {\n\t\t\t$element = BackendUtility::getRecord('tt_content', $parentUid);\n\t\t}\n\t\treturn $element;\n\t}",
"protected function _getContainer()\n {\n if ($this->_oContainer === null) {\n $this->_oContainer = oxNew('bestitAmazonPay4OxidContainer');\n }\n\n return $this->_oContainer;\n }",
"public function getBlock(){\n\t\n\t\tif( empty($this->_block) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 'b.*, t.*, u.*, m.email AS modified_email, m.username AS modified_username, m.name AS modified_name' );\n\t\t\t\n\t\t\t$query->from( '#__zbrochure_content_blocks AS b' );\n\t\t\t\n\t\t\t$query->join( 'LEFT', '#__users AS u ON u.id = b.content_block_created_by' );\n\t\t\t$query->join( 'LEFT', '#__users AS m ON m.id = b.content_block_modified_by' );\n\t\t\t$query->join( 'LEFT', '#__zbrochure_content_types AS t ON t.content_type_id = b.content_block_type' );\n\t\t\t\n\t\t\t$query->where( 'b.content_block_id = '.$this->_id );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_block = $this->_db->loadObject();\n\t\t\t\n\t\t\t$this->_block->render\t= $this->_getContent();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->_block;\n\t\n\t}",
"public function is_block ()\n {\n return is_a( $this, __NAMESPACE__ . '\\\\Block' );\n }",
"public function getDocBlock(): ?DocBlock\n {\n return $this->docBlock;\n }",
"public function getContainer()\n {\n if ($this->_container != null) {\n return $this->_container;\n }\n\n if ($this->space_id != null) {\n $container = $this->space;\n } elseif ($this->user_id != null) {\n $container = $this->user;\n } else {\n throw new Exception(\"Could not determine container type!\");\n }\n\n $this->_container = $container;\n\n return $this->_container;\n }",
"public function getDocBlock()\n {\n return $this->docBlock;\n }",
"function currentElement()\n {\n return $this->current ? $this->current->parentNode : NULL;\n }",
"public function getWrapperElement()\n {\n return $this->config['wrapper'] ?? 'div';\n }",
"public function getFlexiContainer()\n {\n return isset($this->flexiContainer) ? $this->flexiContainer : null;\n }",
"function getBlock() {\n return $this->records[0];\n }",
"public function getWrapperElement();",
"public function getIsBlock();",
"public function getOriginalBlock()\n {\n $data = $this->_coreRegistry->registry('magictoolbox');\n return is_null($data) ? null : $data['blocks']['product.info.media.image'];\n }",
"public function getParentBlockId(): ?UuidInterface\n {\n return $this->parentBlockId;\n }",
"public function getBlock(): ?DerivationType\n {\n return $this->blockAttr;\n }"
] | [
"0.65993506",
"0.6481887",
"0.62601477",
"0.6202864",
"0.615974",
"0.6153783",
"0.61376804",
"0.6102674",
"0.599154",
"0.5966898",
"0.5940808",
"0.5935668",
"0.59266484",
"0.59188133",
"0.58521175",
"0.5779442",
"0.5757671",
"0.5750264",
"0.5747328",
"0.57429284",
"0.5734372",
"0.5723374",
"0.5698582",
"0.56961066",
"0.56927043",
"0.5681085",
"0.5665811",
"0.5653788",
"0.564063",
"0.563836"
] | 0.69294834 | 0 |
Find out if this element is placed in a horizontally aligned context. | public function isAligned()
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->isAligned();
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function hasAlign() {\n\t\treturn isset($this->options['align']);\n\t}",
"private function hasHeadAlign() {\n\t\treturn isset($this->options['head_align']);\n\t}",
"public function isHorizontal() {\n\t\t$this->direction=\"H\";\n\t}",
"public function getHorizontal() {\r\n return $this->horizontal;\r\n }",
"private function getHorizontalOrientation()\n {\n if ($this->axis_data[1]['a'] == 'y') {\n return true;\n }\n if ($this->axis_data[3]['a'] == 'y') {\n return true;\n }\n\n if ($this->axis_data[0]['a'] == 'x') {\n return true;\n }\n if ($this->axis_data[2]['a'] == 'x') {\n return true;\n }\n\n return false;\n }",
"public function isWide()\n {\n return $this->wide;\n }",
"private function hasNumAlign() {\n\t\treturn isset($this->options['num_align']);\n\t}",
"public function hasWidth()\n {\n return $this->width !== null;\n }",
"public function getIsWidthLgShowed(): bool;",
"public static function isHorizontal($image)\n {\n $width = imagesx($image);\n $height = imagesy($image);\n return $width > $height;\n }",
"public function isInsideHead()\r\n\t{\r\n\t\treturn Anowave_Ec_Model_System_Config_Position::GTM_LOCATION_HEAD == (int) Mage::getStoreConfig('ec/config/code_position');\r\n\t}",
"function hasLayout() ;",
"public function isOrPositionBefore()\n {\n return\n ($this->getIsOnCatalogProductPage() && !$this->getShowOrPosition())\n || ($this->getShowOrPosition()\n && $this->getShowOrPosition() == self::POSITION_BEFORE);\n }",
"public function hasLayout() {}",
"public function hasInlineVector()\n {\n return ($this->hasLinkImage() && $this->LinkImage()->getExtension() == 'svg' && $this->InlineVector);\n }",
"function is_x(){\n\t\tif( $this->axis == 1 ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function getAlign() {}",
"public function getWrapLeftSideBarInWell(): bool\n {\n return $this->wrapLeftSideBarInWell;\n }",
"private function isXAxisOffset()\n {\n foreach ($this->data as $series) {\n if ($series['type'] == 'bar' || $series['type'] == 'stackedbar') {\n return true;\n }\n }\n return false;\n }",
"public function isInline()\n {\n if ($ancestor = $this->getControlBlockContainer()) {\n return $ancestor->isInline();\n }\n\n return false;\n }",
"public function isWrapped()\n {\n return ($this->getWrapperInfo() !== false);\n }",
"public function isNavbarJustify()\r\n\t{\r\n\t\treturn $this->navbarJustify;\r\n\t}",
"public function checkWidthHeigth()\r\n\t{\r\n\t\t$referenceImageSize = getimagesize($this->referenceFile);\r\n\t\t$targetImageSize = getimagesize($this->targetFile);\r\n\t\treturn ((abs($targetImageSize[0] - $referenceImageSize[0])) < $this->pixelTol &&\r\n\t\t\tabs(($targetImageSize[1] - $referenceImageSize[1])) < $this->pixelTol);\r\n\t}",
"public function horizontalLayout() {\n }",
"function getAlign() { return $this->_align; }",
"public function isAllTableSameWidth()\n {\n return $this->sameWide;\n }",
"public function hasLeftChild()\n\t{\n\t\treturn isset($this->leftChild);\n\t}",
"public function setHorizontalAlign($value)\n\t{\n\t\t$this->getStyle()->setHorizontalAlign($value);\n\t}",
"public function isRotated(): bool\n {\n return $this->width !== $this->product->width();\n }",
"public function getPositionXL()\n {\n // Scrutinizer thinks the following could return string. It is wrong.\n return array_search($this->position, self::POSITION_XLREF);\n }"
] | [
"0.6155844",
"0.6120114",
"0.5830942",
"0.57309824",
"0.57006973",
"0.5585999",
"0.5529587",
"0.5518652",
"0.5503483",
"0.5436162",
"0.5325055",
"0.5257028",
"0.52281725",
"0.5196685",
"0.51379114",
"0.5136088",
"0.51226896",
"0.5119517",
"0.5086906",
"0.50308925",
"0.49688643",
"0.49650297",
"0.49615216",
"0.49167153",
"0.49024665",
"0.48498482",
"0.4833202",
"0.4827062",
"0.48034024",
"0.47832724"
] | 0.6797746 | 0 |
Find out if this element is placed in an inline context. | public function isInline()
{
if ($ancestor = $this->getControlBlockContainer()) {
return $ancestor->isInline();
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function is_inline()\r\n\t{\r\n\t\treturn $this->is_inline;\r\n\t}",
"function vcex_vc_is_inline() {\n\tif ( function_exists( 'vc_is_inline' ) ) {\n\t\treturn vc_is_inline();\n\t}\n\treturn false;\n}",
"public function hasInlineVector()\n {\n return ($this->hasLinkImage() && $this->LinkImage()->getExtension() == 'svg' && $this->InlineVector);\n }",
"public function isInline(): bool\n\t{\n\t\treturn $this->disposition === self::DISPOSITION_INLINE;\n\t}",
"public function isInline() : bool\n {\n return $this->getDisposition() == 'inline';\n }",
"public function isInlineImage(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_INLINE_IMAGE );\n\t}",
"public function getInline()\n\t{\n\t\treturn $this->isInlineQuery;\t\n\t}",
"public function inlineImageExists()\n {\n foreach ($this->attachment as $attachment) {\n if ($attachment[6] == 'inline') {\n return true;\n }\n }\n return false;\n }",
"public function InlineImageExists() {\n\t foreach($this->attachment as $attachment) {\n\t if ($attachment[6] == 'inline') {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}",
"public function isPaymentPageModeInline($scopeId = null)\n {\n return $this->getPaymentPageMode($scopeId) === Configuration::PAYMENT_TYPE_INLINE;\n }",
"private static function has_inline($handle)\n\t{\n\t\tglobal $wp_styles;\n\n\t\tif (isset($wp_styles->registered[$handle]->extra['after']))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"public function isContextual(): bool\n {\n return $this->definition->isContextual($this);\n }",
"protected function isPageSliderContext()\n\t{\n\t\treturn $this->request->get('IFRAME') === 'Y';\n\t}",
"protected function get_vc_inline_html() {\n\t\t\treturn false;\n\t\t}",
"public function isEmbargoed();",
"protected function canPerformInlineSearch()\n\t{\n\t\t/* If the data store entry is present, read it first */\n\t\tif( isset( \\IPS\\Data\\Store::i()->safeInlineSearch ) )\n\t\t{\n\t\t\t/* We are over the threshold, return FALSE now */\n\t\t\tif( \\IPS\\Data\\Store::i()->safeInlineSearch == false )\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/* If we haven't checked in 24 hours we should do so again */\n\t\t\t\tif( \\IPS\\Data\\Store::i()->safeInlineSearch > ( time() - ( 60 * 60 * 24 ) ) )\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* Get our member count */\n\t\t$totalMembers = \\IPS\\Db::i()->select( 'COUNT(*)', 'core_members' )->first();\n\n\t\t/* If we have more members than our cutoff, just set a flag as we don't need to recheck this periodically. The total will never materially dip to where we can start performing inline searches again, and worst case scenario the upgrader/support tool would clear the cache anyways. */\n\t\tif( $totalMembers > $this->inlineSearchCutoff )\n\t\t{\n\t\t\t\\IPS\\Data\\Store::i()->safeInlineSearch = false;\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Otherwise we store a timestamp so we can recheck periodically */\n\t\t\t\\IPS\\Data\\Store::i()->safeInlineSearch = time();\n\t\t\treturn TRUE;\n\t\t}\t\n\t}",
"public function hasInfluencedContent();",
"public function inlineImageExists()\n {\n }",
"public function isInlineContent($part)\r\n\t{\r\n\t\t$dis = $this->getPartContentDisposition($part);\r\n\t\tif ($dis)//ture\r\n\t\t{\r\n\t\t\tif ($dis == 'inline' || $dis == 'infile') // Add 'infile' as a hack for some stupid emails\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t\t//maybe need it in the future.\r\n\t\t\t\t// if (isset($part['disposition-filename']) && isset($part['content-name']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \t$filename = end(explode('.', $part['disposition-filename']));\r\n\t\t\t\t// \t$name = end(explode('.', isset($part['content-name']);\r\n\t\t\t\t// \tif ($filename == 'html' || $filename == 'htm' || $name == 'html' || $name == 'htm')))\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// \telse\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else if(isset($part['disposition-filename']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \techo $part['disposition-filename'];\r\n\t\t\t\t// \tif (end(explode('.', $part['disposition-filename'])) == 'htm' || end(explode('.', $part['disposition-filename'])) == 'html' )\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// \telse\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else if (isset($part['content-name']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \tif (end(explode('.', $part['content-name'])) == 'html')\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// \telse\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else\r\n\t\t\t\t// {\r\n\t\t\t\t// \treturn true;\r\n\t\t\t\t// }\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function hasSpanId(){\n return $this->_has(2);\n }",
"public function isCurrentChild(): bool;",
"public function hasAsis()\n {\n return isset($this->asis);\n }",
"public function isAligned()\n {\n if ($ancestor = $this->getControlBlockContainer()) {\n return $ancestor->isAligned();\n }\n\n return false;\n }",
"public function isShowing($in_tag)\n {\n $container = $this->show_area;\n $containee = $in_tag;\n $ret = false;\n $match = \"/^\" . $containee . \"/\";\n if (preg_match($match, $container)) {\n $ret = true;\n }\n\n $match = \"/qcol....form$/\";\n if (!$ret && preg_match($match, $containee)) {\n $ret = true;\n }\n\n $match = \"/pghd....form$/\";\n if (!$ret && preg_match($match, $containee)) {\n $ret = true;\n }\n\n $match = \"/pgft....form$/\";\n if (!$ret && preg_match($match, $containee)) {\n $ret = true;\n }\n\n $match = \"/grph...._/\";\n if (!$ret && preg_match($match, $containee)) {\n $ret = true;\n }\n\n return $ret;\n }",
"public function isWrapped()\n {\n return ($this->getWrapperInfo() !== false);\n }",
"public function hasContext(){\n return $this->_has(2);\n }",
"public function hasContextValue();",
"public function showIn(string $context): bool;",
"public function hasContext()\n\t\t{\n\t\t\treturn null !== $this->context;\n\t\t}",
"public function isRTE() {}"
] | [
"0.7384146",
"0.70733654",
"0.6968481",
"0.6914325",
"0.6851162",
"0.67480165",
"0.6497554",
"0.63016534",
"0.6232524",
"0.57936937",
"0.57405216",
"0.5622722",
"0.55322516",
"0.5500013",
"0.54707915",
"0.5444395",
"0.54324687",
"0.5407346",
"0.53898376",
"0.5381279",
"0.5376551",
"0.53643036",
"0.53631985",
"0.53499454",
"0.53328264",
"0.5327806",
"0.52628434",
"0.52487844",
"0.5246277",
"0.5239341"
] | 0.745781 | 0 |
Sets the Tidy options based on the configuration of Options. | function __setTidyConfig()
{
if($this->_options["IsWord"]){
$this->_tidy_config['word-2000'] = true;
$this->_tidy_config['drop-proprietary-attributes'] = true;
}
else {
$this->_tidy_config['word-2000'] = false;
}
if($this->_options["OutputXHTML"]) {
$this->_options["UseTidy"] = true;
$this->_tidy_config['output-xhtml'] = true;
}
else {
$this->_tidy_config['output-xhtml'] = false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setOptions($options = array()) \n { \n $default = array( \n \"RemoveStyles\" => true, \n \"IsWord\" => true, \n \"UseTidy\" => true, \n \"TidyBefore\" => false, \n \"CleaningMethod\" => array( \n \"tags\" => \"whitelist\", \n \"attributes\" => \"blacklist\" \n ), \n \"OutputXHTML\" => true, \n \"FillEmptyTableCells\" => true, \n \"DropEmptyParas\" => true, \n \"Optimize\" => true, \n \"Compress\" => false, \n \"Encoding\" => \"UTF8\" \n ); \n $new = array_merge_recursive($default, (array)$options); \n\n $this->_options = $new; \n $this->__setTidyConfig(); \n }",
"protected function configureOptions(): void\n {\n }",
"private function set_options()\n\t{\n\t\t$this->dompdf->set_paper(array(0, 0, 325.98, 646.299), 'landscape');\n\t\t$this->dompdf->set_option('isHtml5ParserEnabled', true);\n\t\t$this->dompdf->set_option('isRemoteEnabled', true);\n\t\t$this->dompdf->set_option('chroot', __DIR__ . '/templates');\n\t}",
"abstract public function setOptions($options = array());",
"protected function setOptions() {\n\t\t$this->_options->setHelpText(\"This tool provides a mechanism to run recurring workflow tasks.\");\n\n\t\t$text = \"This option triggers the execution of all known workflows.\\n\";\n\t\t$text.= \"You may filter the execution using option '--workflow'.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_RUN, array('--run', '-r'), Option::TYPE_NO_VALUE, $text, 'value'));\n\n\t\t$text = \"This options provides a way to filter a specific workflow.\";\n\t\t$this->_options->addOption(Option::EasyFactory(self::OPTION_WORKFLOW, array('--workflow', '-w'), Option::TYPE_VALUE, $text, 'value'));\n\t}",
"public function configureOptions();",
"abstract public function setOptions($options);",
"public function setOptions($options)\n {\n //if some arguments are not set grab defaults and merge\n $options = array_merge($this->defaults, $options);\n\n $this->maxTweets = $options['maxTweets'];\n $this->retweets= $options['include_retweets'];\n $this->style = $options['style'];\n $this->replies = $options['include_replies'];\n $this->cacheTime = $options['caching_intervals'];\n $this->displayImages = $options['display_images'];\n }",
"public function setOptions($options){\n\n\t}",
"function setOptions (array $options);",
"public function setOptions($options) {\n\n $this->options = $options;\n }",
"public function setOptions(array $options = array());",
"public function setConfig($options);",
"public function set_options(Array $options) {\n\t\tif (isset($options['tags'])) {\n\t\t $this->tags = array_merge($options['tags'], $this->tags);\n\t }\n\t}",
"public function setOptions($options = []);",
"public function configureOptions(array $options = []) : void;",
"public function setOptions($optionVars);",
"protected function configure(array $options)\n {\n }",
"public function setOptions(array $options): void;",
"public function setOptions(array $options): void;",
"public function configure($options);",
"public function setOptions($options)\n {\n $this->options = apply_filters(\n \"jankx_post_layout_{$this::get_name()}_set_options\",\n wp_parse_args(\n $options,\n $this->options\n ),\n $this\n );\n }",
"public function setOptions($options)\n {\n $this->options = $options;\n }",
"public static function configure(array $options): void\n {\n static::$options = $options;\n }",
"public static function set_options() {\r\n\t\tself::add_option(\"my_option\", \"foo\");\r\n\t}",
"public function setOptions(array $options = [])\n {\n $this->options = [];\n $this->shortcuts = [];\n $this->negations = [];\n $this->addOptions($options);\n }",
"public function setOptions()\n\t{\n\t\tupdate_option($this->optionVar, serialize($this->options));\n\t}",
"private function setOptions($options)\n {\n $this->options = $options;\n }",
"public function configure(array $options)\n {\n }",
"public function withTidy(array $config = [], string $encoding = 'utf8'): self\n\t{\n\t\t$this->tidyConfig = array_merge([\n\t\t\t'clean' => 'yes',\n\t\t\t'output-html' => 'yes',\n\t\t\t'wrap' => 0,\n\t\t], $config);\n\n\t\t$this->tidyEncoding = $encoding;\n\n\t\treturn $this;\n\t}"
] | [
"0.7753073",
"0.65544134",
"0.64637095",
"0.62480843",
"0.6239767",
"0.6185608",
"0.61761826",
"0.604455",
"0.6002066",
"0.59947944",
"0.59359074",
"0.5933925",
"0.59324235",
"0.5923187",
"0.59125334",
"0.5909761",
"0.59046334",
"0.58950865",
"0.58893365",
"0.58893365",
"0.5885772",
"0.588415",
"0.58443046",
"0.58401805",
"0.58237815",
"0.5814185",
"0.5811025",
"0.5786824",
"0.57670474",
"0.5763395"
] | 0.75497925 | 1 |
Removes attributes from html tags that match the provided pattern Example of pattern: "id|on[\w]+" | function removeBlacklistedAttributes($attribs)
{
$this->_html = preg_replace('/[\s]+('.$attribs.')=[\s]*("[^"]*"|\'[^\']*\')/i',"",$this->_html);
$this->_html = preg_replace('/[\s]+('.$attribs.')=[\s]*[^ |^>]*/i',"",$this->_html);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function removeUnallowedHTMLAttributes(string $html): string\n {\n $tidy = new tidy();\n\n $dom = new DOMDocument();\n\n // Normalizes the HTML which reduce the possibility of having an unexpected\n // exception in the DomDocument library because some bad HTML was found.\n // Once the HTML is normalized, we will parse it again.\n $html = $tidy->repairString($html, [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n\n try {\n libxml_use_internal_errors(true);\n // Needs a XML encoding declaration to ensure is treated as UTF-8\n $dom->loadHTML('<?xml encoding=\"utf-8\" ?>'.$html);\n } catch (Exception $e) {\n return '';\n }\n\n $attributes = static::getAttributesNodes($dom);\n\n collect($attributes)\n ->filter(fn ($attribute) => static::isAttributeAllowedForTag($attribute))\n ->each(fn ($node) => $node->parentNode->removeAttribute($node->nodeName));\n\n return $tidy->repairString($dom->saveHTML(), [\n 'output-xhtml' => true,\n 'show-body-only' => true,\n ], 'utf8');\n }",
"function strip_htmltag($str, $all = TRUE)\n{\n\tglobal $_symbol_noexists;\n\tstatic $noexists_pattern;\n\n\tif (! isset($noexists_pattern))\n\t\t$noexists_pattern = '#<span class=\"noexists\">([^<]*)<a[^>]+>' .\n\t\t\tpreg_quote($_symbol_noexists, '#') . '</a></span>#';\n\n\t// Strip Dagnling-Link decoration (Tags and \"$_symbol_noexists\")\n\t$str = preg_replace($noexists_pattern, '$1', $str);\n\n\tif ($all) {\n\t\t// All other HTML tags\n\t\treturn preg_replace('#<[^>]+>#', '', $str);\n\t} else {\n\t\t// All other anchor-tags only\n\t\treturn preg_replace('#<a[^>]+>|</a>#i', '', $str);\n\t}\n}",
"public static function cleanTagsWithoutAttributes(array $tags, string $html): string {\n\t\t$empty_tags = implode('|', ArrayTools::preg_quote($tags, '|'));\n\t\treturn preg_replace('|<(' . $empty_tags . ')>([^<>]*)</\\1>|i', '$2', $html);\n\t}",
"function oh_remove_type_attr($tag, $handle) {\n return preg_replace( \"/ type=['\\\"]text\\/(javascript|css)['\\\"]/\", '', $tag );\n}",
"private function _filter_attributes($str) {\n\t\t$out = '';\n\n\t\tif (preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches)) {\n\t\t\tforeach ($matches [0] as $match) {\n\t\t\t\t$out .= preg_replace('#/\\*.*?\\*/#s', '', $match);\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}",
"public static function purifyHtmlEventAttributes($value)\n\t{\n\t\tif (preg_match('#<([^><]+?)([^a-z_\\\\-]on\\\\w*|xmlns)(\\\\s*=\\\\s*[^><]*)([>]*)#i', $value) || preg_match('/\\\\b(' . static::$htmlEventAttributes . ')\\\\s*=/i', $value) || preg_match('/javascript:[\\w\\.]+\\(/i', $value)) {\n\t\t\t\\App\\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');\n\t\t\tthrow new Exceptions\\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $value, 406);\n\t\t}\n\t}",
"function DOM_delete_empty_attributes() {\r\n\t\t$query = '//' . ReTidy::get_html_namespace() . '*[@*=\"\"]';\r\n\t\t$tags_with_empty_attribute = $this->xpath->query($query);\r\n\t\tforeach($tags_with_empty_attribute as $tag) {\r\n\t\t\t$tagName = $tag->nodeName;\r\n\t\t\t$array_attributes = DTD::getAttributesForElementByType($tagName, \"#IMPLIED\");\r\n\t\t\tforeach($tag->attributes as $attribute) {\r\n\t\t\t\tif(strlen($attribute->nodeValue) === 0) {\r\n\t\t\t\t\tforeach($array_attributes as $attribute2){\r\n\t\t\t\t\t\tif($attribute->nodeName === $attribute2) {\r\n\t\t\t\t\t\t\t$attribute->nodeValue = \"XXX9o9stripme9o9XXX\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}",
"function filterAttr($attrSet) {\t\n\t\t$newSet = array();\n\t\t// process attributes\n\t\tfor ($i = 0; $i <count($attrSet); $i++) {\n\t\t\t// skip blank spaces in tag\n\t\t\tif (!$attrSet[$i]) continue;\n\t\t\t// split into attr name and value\n\t\t\t$attrSubSet = explode('=', trim($attrSet[$i]));\n\t\t\tlist($attrSubSet[0]) = explode(' ', $attrSubSet[0]);\n\t\t\t// removes all \"non-regular\" attr names AND also attr blacklisted\n\t\t\t//////\n\t\t\t///// NEEDS FIX!!! eregi zu preg_match umgeschrieben... stimmt das noch??? ////\n\t\t\t/////\n\t\t\tif ((!preg_match(\"^[a-z]*$\",$attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) \n\t\t\t\tcontinue;\n\t\t\t// xss attr value filtering\n\t\t\tif ($attrSubSet[1]) {\n\t\t\t\t// strips unicode, hex, etc\n\t\t\t\t$attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]);\n\t\t\t\t// strip normal newline within attr value\n\t\t\t\t$attrSubSet[1] = preg_replace('/\\s+/', '', $attrSubSet[1]);\n\t\t\t\t// strip double quotes\n\t\t\t\t$attrSubSet[1] = str_replace('\"', '', $attrSubSet[1]);\n\t\t\t\t// [requested feature] convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value)\n\t\t\t\tif ((substr($attrSubSet[1], 0, 1) == \"'\") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == \"'\"))\n\t\t\t\t\t$attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2));\n\t\t\t\t// strip slashes\n\t\t\t\t$attrSubSet[1] = stripslashes($attrSubSet[1]);\n\t\t\t}\n\t\t\t// auto strip attr's with \"javascript:\n\t\t\tif (\t((strpos(strtolower($attrSubSet[1]), 'expression') !== false) &&\t(strtolower($attrSubSet[0]) == 'style')) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'javascript:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'behaviour:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'vbscript:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'mocha:') !== false) ||\n\t\t\t\t\t(strpos(strtolower($attrSubSet[1]), 'livescript:') !== false) \n\t\t\t) continue;\n\n\t\t\t// if matches user defined array\n\t\t\t$attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray);\n\t\t\t// keep this attr on condition\n\t\t\tif ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) {\n\t\t\t\t// attr has value\n\t\t\t\tif ($attrSubSet[1]) $newSet[] = $attrSubSet[0] . '=\"' . $attrSubSet[1] . '\"';\n\t\t\t\t// attr has decimal zero as value\n\t\t\t\telse if ($attrSubSet[1] == \"0\") $newSet[] = $attrSubSet[0] . '=\"0\"';\n\t\t\t\t// reformat single attributes to XHTML\n\t\t\t\telse $newSet[] = $attrSubSet[0] . '=\"' . $attrSubSet[0] . '\"';\n\t\t\t}\t\n\t\t}\n\t\treturn $newSet;\n\t}",
"function remove_html_tag_news($data){\n\treturn preg_replace('/ style=\".*?\"/i', '$1', strip_tags($data, '<i><a><b><u><div><hr>'));\n}",
"function removeAttributesFromTag($tag, $attributes)\n {\n $filter = '(//' . $tag . ')';\n $elements = $this->xpath->query($filter);\n foreach ($elements as $index => $element) {\n $tag = $element->tagName;\n foreach ($attributes as $attr) {\n if ($element->hasAttribute($attr)) {\n $element->removeAttribute($attr);\n }\n }\n }\n }",
"function lessie_process_html_tag(&$vars) {\r\n $el = &$vars['element'];\r\n\r\n // Remove type=\"...\" and CDATA prefix/suffix.\r\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\r\n\r\n // Remove media=\"all\" but leave others unaffected.\r\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\r\n unset($el['#attributes']['media']);\r\n }\r\n}",
"private function _filter_attributes($str)\n {\n $out = '';\n\n if (preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches))\n {\n foreach ($matches[0] as $match)\n {\n $out .= preg_replace(\"#/\\*.*?\\*/#s\", '', $match);\n }\n }\n\n return $out;\n }",
"private function _remove_evil_attributes($str, $is_image)\n {\n // All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns\n //$evil_attributes = array('on\\w*', 'style', 'xmlns', 'formaction');\n $evil_attributes = array('on\\w*', 'xmlns', 'formaction');\n\n if ($is_image === true)\n {\n /*\n * Adobe Photoshop puts XML metadata into JFIF images,\n * including namespacing, so we have to allow this for images.\n */\n unset($evil_attributes[array_search('xmlns', $evil_attributes)]);\n }\n\n do {\n $count = 0;\n $attribs = array();\n\n // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes)\n preg_match_all('/('.implode('|', $evil_attributes).')\\s*=\\s*(\\042|\\047)([^\\\\2]*?)(\\\\2)/is', $str, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $attr)\n {\n $attribs[] = preg_quote($attr[0], '/');\n }\n\n // find occurrences of illegal attribute strings without quotes\n preg_match_all('/('.implode('|', $evil_attributes).')\\s*=\\s*([^\\s>]*)/is', $str, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $attr)\n {\n $attribs[] = preg_quote($attr[0], '/');\n }\n\n // replace illegal attribute strings that are inside an html tag\n if (count($attribs) > 0)\n {\n $str = preg_replace('/(<?)(\\/?[^><]+?)([^A-Za-z<>\\-])(.*?)('.implode('|', $attribs).')(.*?)([\\s><]?)([><]*)/i', '$1$2 $4$6$7$8', $str, -1, $count);\n }\n\n } while ($count);\n\n return $str;\n }",
"protected function _filter_attributes($str)\n\t{\n\t\t$out = '';\n\t\tif (preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches))\n\t\t{\n\t\t\tforeach ($matches[0] as $match)\n\t\t\t{\n\t\t\t\t$out .= preg_replace('#/\\*.*?\\*/#s', '', $match);\n\t\t\t}\n\t\t}\n\n\t\treturn $out;\n\t}",
"function <%= functionPrefix %>_remove_type_attr($tag, $handle) {\n return preg_replace( \"/type=['\\\"]text\\/(javascript|css)['\\\"]/\", '', $tag );\n}",
"protected function filter_attributes()\n\t{\n\t\t$filter = array_flip(array('type', 'split', 'align'));\n\t\t\n\t\t$attrs = $this->manager->attrs();\n\t\t\n\t\t$this->btn_attrs = array_diff_key($attrs, $filter);\n\t\t$this->manager->attrs(array_intersect_key($attrs, $filter));\n\t}",
"function strip_only($str, $tags) {\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str);\n return $str;\n}",
"function strip_att_htmlN($string) \r\n {\r\n\t$desenho = array( '@');\r\n\t#Será retornado o seguinte no lugar delas, caso ache alguma palavra bloqueada\r\n\t$substituir_pore = array('');\r\n\t#Rodando a string e procurando pelas palavras proibidas\r\n\tfor($e=0;$e < sizeof($desenho); $e++) {\r\n\t\t\t$string = str_replace($desenho[$e], $substituir_pore[$e], $string);\r\n\t\t\t \r\n\t\t\t\r\n\t}\r\n\r\n\treturn $string; \r\n }",
"function strip_selected_tags($str, $tags = \"\", $stripContent = false)\n {\n preg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n foreach ($allTags[1] as $tag){\n if ($stripContent) {\n $str = preg_replace(\"/<\".$tag.\"[^>]*>.*<\\/\".$tag.\">/iU\",\"\",$str);\n }\n $str = preg_replace(\"/<\\/?\".$tag.\"[^>]*>/iU\",\"\",$str);\n }\n return $str;\n }",
"function remove_img_attr ($html)\n{\n return preg_replace('/(width|height)=\"\\d+\"\\s/', \"\", $html);\n}",
"public function removeAttributes()\n\t{\n\t\tforeach ($this->argsArray(func_get_args()) as $a) {\n\t\t\t$this->removed_attrs[] = $a;\n\t\t}\n\t}",
"function fett_process_html_tag(&$vars) {\n if (theme_get_setting('fett_html_tags')) {\n $el = &$vars['element'];\n\n // Remove type=\"...\" and CDATA prefix/suffix.\n unset($el['#attributes']['type'], $el['#value_prefix'], $el['#value_suffix']);\n\n // Remove media=\"all\" but leave others unaffected.\n if (isset($el['#attributes']['media']) && $el['#attributes']['media'] === 'all') {\n unset($el['#attributes']['media']);\n }\n }\n}",
"function wpmantis_strip_only($str, $tags, $stripContent = false)\n{\n $content = '';\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) {\n if ($stripContent)\n $content = '(.+</'.$tag.'[^>]*>|)';\n $str = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $str);\n }\n return $str;\n}",
"function clean_inside_tags($txt,$tags){\n\t\t\t$txt =removeemptytags($txt);\n\t\t\tpreg_match_all(\"/<([^>]+)>/i\",$tags,$allTags,PREG_PATTERN_ORDER);\n\t\t\n\t\t\tforeach ($allTags[1] as $tag){\n\t\t\t\t$txt = preg_replace(\"/<\".$tag.\"[^>]*>/i\",\"<\".$tag.\">\",$txt);\n\t\t\t}\n\t\t\treturn $txt;\n\t\t}",
"function wp_list_categories_remove_title_attributes($output) {\n $output = preg_replace('` title=\"(.+)\"`', '', $output);\n return $output;\n}",
"public function removeAttribute($name, $content)\r\n\t{\r\n\t\t$pattern = '/@' . $name . ' ([^\"\\[\\]\\n\\r]*[^*\\[\\]\\s])/';\r\n\t\t$content = preg_replace($pattern, \"\", $content);\r\n\r\n\t\t$pattern = '/@' . $name . ':\"([^@]*)\"/';\r\n\t\t$content = preg_replace($pattern, \"\", $content);\r\n\r\n\t\t$pattern = '/@' . $name . ':([^\"\\s][^\"\\s]*)/';\r\n\t\t$content = preg_replace($pattern, \"\", $content);\r\n\r\n\t\treturn $content;\r\n\t}",
"protected static function removeEvilAttributes($str, $is_image)\n {\n $evil_attributes = ['on\\w*', 'style', 'xmlns', 'formaction', 'form', 'xlink:href', 'FSCommand', 'seekSegmentTime'];\n\n if ($is_image === true) {\n unset($evil_attributes[array_search('xmlns', $evil_attributes)]);\n }\n\n do {\n $count = $temp_count = 0;\n\n $str = preg_replace('/(<[^>]+)(?<!\\w)('.implode('|', $evil_attributes).')\\s*=\\s*(\\042|\\047)([^\\\\2]*?)(\\\\2)/is', '$1[removed]', $str, -1, $temp_count);\n $count += $temp_count;\n\n $str = preg_replace('/(<[^>]+)(?<!\\w)('.implode('|', $evil_attributes).')\\s*=\\s*([^\\s>]*)/is', '$1[removed]', $str, -1, $temp_count);\n $count += $temp_count;\n } while ($count);\n\n return $str;\n }",
"function strips_all_tags( $html )\n\t{\n\t\t$search = [\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments including CDATA\n\t\t];\n\t\t$result = preg_replace( $search, '', $html );\n\n\t\treturn $result;\n\t}",
"protected function _filterAttributes($str) {\n $out = '';\n \n if(preg_match_all('#\\s*[a-z\\-]+\\s*=\\s*(\\042|\\047)([^\\\\1]*?)\\\\1#is', $str, $matches)) {\n foreach($matches[0] as $match) {\n $out .= preg_replace('#/\\*.*?\\*/#s', '', $match);\n }\n }\n \n return $out;\n }"
] | [
"0.5939265",
"0.5924926",
"0.57694834",
"0.5744616",
"0.5660727",
"0.56411314",
"0.5618329",
"0.5615616",
"0.5602336",
"0.5594623",
"0.5572615",
"0.55611455",
"0.5544675",
"0.55132604",
"0.55105466",
"0.5482235",
"0.54742277",
"0.54584867",
"0.54467577",
"0.5440193",
"0.53907895",
"0.53891325",
"0.5377687",
"0.53731066",
"0.53646487",
"0.53580004",
"0.5324073",
"0.5323511",
"0.5317911",
"0.53101397"
] | 0.6185785 | 0 |
Uses the Tidy Configuration to run Tidy's cleanRepair method, if available. | function tidyClean()
{
if(!class_exists('tidy')){
if(function_exists('tidy_parse_string')){
tidy_set_encoding("{$this->_options["Encoding"]}");
foreach($this->_tidy_config as $k => $v) {
tidy_setopt($k, $v);
}
tidy_parse_string($this->_html);
tidy_clean_repair();
$this->_html = tidy_get_output();
}
else {
error_log("Tidy is not supported on this platform. Basic Cleaning is applied.");
}
}
else {
$tidy = new tidy;
$tidy -> parseString($this->_html, $this->_tidy_config, "{$this->_options["Encoding"]}");
$tidy -> cleanRepair();
$this -> html = $tidy;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cleanRepair() {}",
"function tidy_clean_repair(tidy $object) {}",
"function __setTidyConfig() \n { \n if($this->_options[\"IsWord\"]){ \n $this->_tidy_config['word-2000'] = true; \n $this->_tidy_config['drop-proprietary-attributes'] = true; \n } \n else { \n $this->_tidy_config['word-2000'] = false; \n } \n if($this->_options[\"OutputXHTML\"]) { \n $this->_options[\"UseTidy\"] = true; \n $this->_tidy_config['output-xhtml'] = true; \n } \n else { \n $this->_tidy_config['output-xhtml'] = false; \n } \n }",
"function tidy_repair_file($filename, $config = null, $encoding = null, $use_include_path = false) {}",
"public function _tidy_cleanup_callback($text = '')\n {\n if ( ! class_exists('tidy') || ! extension_loaded('tidy')) {\n return $text;\n }\n $tidy_default_config = [\n 'alt-text' => '',\n 'output-xhtml' => true,\n ];\n $tidy = new tidy();\n $tidy->parseString($text, $this->_TIDY_CONFIG ?: $tidy_default_config, conf('charset'));\n $tidy->cleanRepair();\n return $tidy;\n }",
"private function htmltidy_php() {\r\n\t\t$this->logMsg(\"=== htmltidy_php ===\");\r\n\t\tif(!is_callable('tidy_parse_string')) {\r\n\t\t\t$this->logMsg('tidy_parse_string() is not callable! Maybe the tidy extension is not installed.');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t// added (2011-06-29)\r\n\t\tif($this->WET === \"WET\" || $this->config['WET'] === \"WET\") {\r\n\t\t\t$this->config['htmltidy']['anchor-as-name'] = 0;\r\n\t\t}\r\n\t\tReTidy::set_HTML5();\r\n\t\t//ReTidy::tidy_comments();\r\n\t\tReTidy::encode_character_entities_in_comments();\r\n\t\t$tidy = tidy_parse_string($this->code, $this->config['htmltidy'], $this->config['htmltidy']['input-encoding']);\r\n\t\t//var_dump($tidy); // tidy error reporting\r\n\t\tif(!$tidy) {\r\n\t\t\t$this->logMsg('tidy_parse_string() failed!');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(!$tidy->cleanRepair()) {\r\n\t\t\t$this->logMsg('$tidy->cleanRepair() failed!');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->logMsg('Status: '. $tidy->getStatus() . \"\\nErrors: \" . tidy_error_count($tidy) . \"\\nWarnings: \" . tidy_warning_count($tidy));\r\n\t\tif($this->config['show_tidy_errors']) {\r\n\t\t\t$this->logMsg(\"--- Error buffer --- \\n\" . $tidy->errorBuffer . \"\\n --- Error buffer end ---\");\r\n\t\t}\r\n\t\t$this->code = tidy_get_output($tidy);\r\n\t\tif(!$this->code) {\r\n\t\t\t$this->logMsg('Warning! HTML Tidy output is empty.');\r\n\t\t}\r\n\t\t// perhaps we should just say if not utf8?\r\n\t\tif(($this->config['encoding'] === \"iso-8859-1\" ||\r\n\t\t$this->config['encoding'] === \"us-ascii\" ||\r\n\t\t$this->config['encoding'] === \"windows-1252\") && $this->config['do_not_encode_character_entities'] !== true) {\r\n\t\t\tReTidy::encode_character_entities();\r\n\t\t}\r\n\t\t// HTML5 specific fix (tidy and basically everything else do not support HTML5)\r\n\t\t//var_dump($this->config['HTML5']);\r\n\t\t//var_dump($this->config);\r\n\t\t//var_dump(ReTidy::get_HTML5());\r\n\t\tif(ReTidy::get_HTML5()) {\r\n\t\t\t//print(\"here--4300--2\");\r\n\t\t\t$this->code = ReTidy::str_replace_first('<meta />', '<meta charset=\"' . $this->config['encoding'] . '\" />', $this->code);\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"function cleanup($html, $options = null) \n { \n if(isset($options) && is_array($options)){ \n $this->setOptions($options); \n } \n $this->_html = \"{$html}\"; \n\n if($this->_options['UseTidy'] && $this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n\n // Remove escape slashes \n $this->_html = stripslashes($this -> _html); \n\n if($this->_options['CleaningMethod']['tags'] == \"whitelist\"){ \n // Trim everything before body tag, leaving possible body attributes \n if(preg_match(\"/<body/i\", \"{$this -> _html}\")){ \n $this -> html = stristr($this -> _html, \"<body\"); \n } \n\n // strip tags, still leaving attributes, second variable is allowed tags \n $this->_html = strip_tags($this->_html, $this->_tag_whitelist); \n } \n\n if($this->_options['RemoveStyles']){ \n // Remove class and style attributes \n $this->removeBlacklistedAttributes(\"class|style\"); \n } \n\n if($this->_options['IsWord']){ \n $this->removeBlacklistedAttributes(\"lang|[ovwxp]:\\w+\"); \n } \n\n if($this->_options['CleaningMethod']['attributes'] == \"blacklist\"){ \n if(!empty ($this->_attrib_blacklist)){ \n $this->removeBlacklistedAttributes($this->_attrib_blacklist); \n } \n } \n\n if($this->_options['Optimize']){ \n $repl = 1; \n while($repl){ \n $repl = 0; \n foreach($this->_cleanup_tags as $tag){ \n // Strip empty inline tags \n $this -> _html = preg_replace(\"/<($tag)[^>]*>[\\s]*([( )]*)[\\s]*<\\/($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n\n // Merge inline tags \n $this -> _html = preg_replace(\"/<\\/($tag)[^>]*>[\\s]*([( )]*)[\\s]*<($tag)>/i\",\"\\\\2\", $this -> _html,-1,$count); \n $repl += $count; \n } \n } \n\n // Drop empty paragraph tags \n if($this->_options['DropEmptyParas']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[( )]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n // Trim extra spaces only if tidy is not set to indent \n if(!$this->_tidy_config['indent']){ \n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/i',\"\\\\1 \\\\2\", $this -> _html); \n\n // Trim extra spaces before tags \n $this -> _html = preg_replace('/[\\n|\\r|\\r\\n|][\\n|\\r|\\r\\n|]+</i',\"<\", $this -> _html); \n } \n } \n\n if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){ \n $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\\s]*[( )]*[\\s]*<\\/(p|h[1-6]{1})>/i',\"\\r\\n\", $this -> _html); \n } \n\n if($this->_options['FillEmptyTableCells']) { \n $this -> _html = preg_replace(\"/<td([^>]*)>[\\s]*<\\/td>/i\", \"<td\\\\1> </td>\", $this -> _html); \n } \n\n if($this->_options['Compress']){ \n // Trim spaces after tags \n $this -> _html = preg_replace('/>[\\s]+/',\">\", $this -> _html); \n\n // Trim spaces before end tags \n $this -> _html = preg_replace('/[\\s]+<\\//',\"</\", $this -> _html); \n\n // Trim spaces before tags \n $this -> _html = preg_replace('/[\\s]+</',\"<\", $this -> _html); \n\n // Trim extra spaces between words \n $this -> _html = preg_replace('/([^<>])[\\s]+([^<>])/',\"\\\\1 \\\\2\", $this -> _html); \n } \n\n if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){ \n $this->tidyClean(); \n } \n return $this->output(\"{$this->_html}\"); \n }",
"public static function additionalCleaning() {\n \n }",
"private function executeTidy($page){\n\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_tidier_error','error_pid = '.intval($page['uid']));\n\t\t\n\t\t// build the command\n\t\t$search =array(\n\t\t\t'###TEMP_RESULT###',\n\t\t\t'###TEMP_FILE###', \n\t\t\t'###TIDY_ACCESS###',\n\t\t);\n\t\t$replace = array(\n\t\t\t$this->tempFilename($page['uid'], 'result'),\n\t\t\t$this->tempFilename($page['uid'], 'file'),\n\t\t\t(intval($this->conf['tidyAccess']) > 0 ? intval($this->conf['tidyAccess']) : 2),\n\t\t);\n\t\t$cmd = str_replace($search, $replace, $this->conf['tidyCommand']);\n\t\t\n\t\t// this has to be cleaned up, some error handling!\n\t\t// get content\n\t\t$content = t3lib_div::getURL($this->getDomain() . '/?id='.intval($page['uid']));\n\t\tfile_put_contents($this->tempFilename($page['uid'], 'file'), $content);\n\t\t\n\t\t// exec tidy\n\t\texec($cmd);\n\t\t\n\t\t// parse tidy \n\t\t$this->parseTidy($page);\n\t\t// remove html file\n\t\t@unlink($this->tempFilename($page['uid'], 'file'));\n\t\t\n\t\t\n\t}",
"public function process($html, $url, $smart_tidy=true) {\r\n\t\t$this->reset();\r\n\t\t\r\n\t\t// extract host name\r\n\t\t$host = @parse_url($url, PHP_URL_HOST);\r\n\t\tif (!($this->config = SiteConfig::build($host))) {\r\n\t\t\t// no match, so use defaults\r\n\t\t\t$this->config = new SiteConfig();\r\n\t\t}\r\n\t\t// store copy of config in our static cache array in case we need to process another URL\r\n\t\tSiteConfig::add_to_cache($host, $this->config);\r\n\t\t\r\n\t\t// use tidy (if it exists)?\r\n\t\t// This fixes problems with some sites which would otherwise\r\n\t\t// trouble DOMDocument's HTML parsing. (Although sometimes it\r\n\t\t// makes matters worse, which is why you can override it in site config files.)\r\n\t\t$tidied = false;\r\n\t\tif ($this->config->tidy && function_exists('tidy_parse_string') && $smart_tidy) {\r\n\t\t\t$this->debug('Using Tidy');\r\n\t\t\t$tidy = tidy_parse_string($html, self::$tidy_config, 'UTF8');\r\n\t\t\tif (tidy_clean_repair($tidy)) {\r\n\t\t\t\t$original_html = $html;\r\n\t\t\t\t$tidied = true;\r\n\t\t\t\t$html = $tidy->value;\r\n\t\t\t}\r\n\t\t\tunset($tidy);\r\n\t\t}\r\n\t\t\r\n\t\t// load and parse html\r\n\t\t$this->readability = new Readability($html, $url);\t\t\r\n\t\t\r\n\t\t// we use xpath to find elements in the given HTML document\r\n\t\t// see http://en.wikipedia.org/wiki/XPath_1.0\r\n\t\t$xpath = new DOMXPath($this->readability->dom);\r\n\r\n\t\t// strip elements (using xpath expressions)\r\n\t\tforeach ($this->config->strip as $pattern) {\r\n\t\t\t$elems = @$xpath->query($pattern, $this->readability->dom);\r\n\t\t\t// check for matches\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Stripping '.$elems->length.' elements (strip)');\r\n\t\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// strip elements (using id and class attribute values)\r\n\t\tforeach ($this->config->strip_id_or_class as $string) {\r\n\t\t\t$string = strtr($string, array(\"'\"=>'', '\"'=>''));\r\n\t\t\t$elems = @$xpath->query(\"//*[contains(@class, '$string') or contains(@id, '$string')]\", $this->readability->dom);\r\n\t\t\t// check for matches\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Stripping '.$elems->length.' elements (strip_id_or_class)');\r\n\t\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// strip images (using src attribute values)\r\n\t\tforeach ($this->config->strip_image_src as $string) {\r\n\t\t\t$string = strtr($string, array(\"'\"=>'', '\"'=>''));\r\n\t\t\t$elems = @$xpath->query(\"//img[contains(@src, '$string')]\", $this->readability->dom);\r\n\t\t\t// check for matches\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Stripping '.$elems->length.' image elements');\r\n\t\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// strip elements using Readability.com and Instapaper.com ignore class names\r\n\t\t// .entry-unrelated and .instapaper_ignore\r\n\t\t// See https://www.readability.com/publishers/guidelines/#view-plainGuidelines\r\n\t\t// and http://blog.instapaper.com/post/730281947\r\n\t\t$elems = @$xpath->query(\"//*[contains(concat(' ',normalize-space(@class),' '),' entry-unrelated ') or contains(concat(' ',normalize-space(@class),' '),' instapaper_ignore ')]\", $this->readability->dom);\r\n\t\t// check for matches\r\n\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t$this->debug('Stripping '.$elems->length.' .entry-unrelated,.instapaper_ignore elements');\r\n\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// strip elements that contain style=\"display: none;\"\r\n\t\t$elems = @$xpath->query(\"//*[contains(@style,'display:none')]\", $this->readability->dom);\r\n\t\t// check for matches\r\n\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t$this->debug('Stripping '.$elems->length.' elements with inline display:none style');\r\n\t\t\tfor ($i=$elems->length-1; $i >= 0; $i--) {\r\n\t\t\t\t$elems->item($i)->parentNode->removeChild($elems->item($i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// try to get title\r\n\t\tforeach ($this->config->title as $pattern) {\r\n\t\t\t$elems = @$xpath->evaluate($pattern, $this->readability->dom);\r\n\t\t\tif (is_string($elems)) {\r\n\t\t\t\t$this->debug('Title expression evaluated as string');\r\n\t\t\t\t$this->title = trim($elems);\r\n\t\t\t\tbreak;\r\n\t\t\t} elseif ($elems instanceof DOMNodeList && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Title matched');\r\n\t\t\t\t$this->title = $elems->item(0)->textContent;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// try to get body\r\n\t\tforeach ($this->config->body as $pattern) {\r\n\t\t\t$elems = @$xpath->query($pattern, $this->readability->dom);\r\n\t\t\t// check for matches\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('Body matched');\r\n\t\t\t\tif ($elems->length == 1) {\t\t\t\t\r\n\t\t\t\t\t$this->body = $elems->item(0);\r\n\t\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t\t$this->readability->prepArticle($this->body);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->body = $this->readability->dom->createElement('div');\r\n\t\t\t\t\t$this->debug($elems->length.' body elems found');\r\n\t\t\t\t\tforeach ($elems as $elem) {\r\n\t\t\t\t\t\t$isDescendant = false;\r\n\t\t\t\t\t\tforeach ($this->body->childNodes as $parent) {\r\n\t\t\t\t\t\t\tif ($this->isDescendant($parent, $elem)) {\r\n\t\t\t\t\t\t\t\t$isDescendant = true;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($isDescendant) {\r\n\t\t\t\t\t\t\t$this->debug('Element is child of another body element, skipping.');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t\t\t\t$this->readability->prepArticle($elem);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this->debug('Element added to body');\r\n\t\t\t\t\t\t\t$this->body->appendChild($elem);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// auto detect?\r\n\t\t$detect_title = $detect_body = false;\r\n\t\t// detect title?\r\n\t\tif (!isset($this->title)) {\r\n\t\t\tif (empty($this->config->title) || (!empty($this->config->title) && $this->config->autodetect_on_failure)) {\r\n\t\t\t\t$detect_title = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// detect body?\r\n\t\tif (!isset($this->body)) {\r\n\t\t\tif (empty($this->config->body) || (!empty($this->config->body) && $this->config->autodetect_on_failure)) {\r\n\t\t\t\t$detect_body = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// check for hNews\r\n\t\tif ($detect_title || $detect_body) {\r\n\t\t\t// check for hentry\r\n\t\t\t$elems = @$xpath->query(\"//*[contains(concat(' ',normalize-space(@class),' '),' hentry ')]\", $this->readability->dom);\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('hNews: found hentry');\r\n\t\t\t\t$hentry = $elems->item(0);\r\n\t\t\t\t\r\n\t\t\t\tif ($detect_title) {\r\n\t\t\t\t\t// check for entry-title\r\n\t\t\t\t\t$elems = @$xpath->query(\".//*[contains(concat(' ',normalize-space(@class),' '),' entry-title ')]\", $hentry);\r\n\t\t\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t\t\t$this->debug('hNews: found entry-title');\r\n\t\t\t\t\t\t$this->title = $elems->item(0)->textContent;\r\n\t\t\t\t\t\t$detect_title = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// check for entry-content.\r\n\t\t\t\t// according to hAtom spec, if there are multiple elements marked entry-content,\r\n\t\t\t\t// we include all of these in the order they appear - see http://microformats.org/wiki/hatom#Entry_Content\r\n\t\t\t\tif ($detect_body) {\r\n\t\t\t\t\t$elems = @$xpath->query(\".//*[contains(concat(' ',normalize-space(@class),' '),' entry-content ')]\", $hentry);\r\n\t\t\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t\t\t$this->debug('hNews: found entry-content');\r\n\t\t\t\t\t\tif ($elems->length == 1) {\r\n\t\t\t\t\t\t\t// what if it's empty? (some sites misuse hNews - place their content outside an empty entry-content element)\r\n\t\t\t\t\t\t\t$e = $elems->item(0);\r\n\t\t\t\t\t\t\tif (($e->tagName == 'img') || (trim($e->textContent) != '')) {\r\n\t\t\t\t\t\t\t\t$this->body = $elems->item(0);\r\n\t\t\t\t\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\t\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t\t\t\t\t$this->readability->prepArticle($this->body);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$detect_body = false;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$this->debug('hNews: skipping entry-content - appears not to contain content');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunset($e);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->body = $this->readability->dom->createElement('div');\r\n\t\t\t\t\t\t\t$this->debug($elems->length.' entry-content elems found');\r\n\t\t\t\t\t\t\tforeach ($elems as $elem) {\r\n\t\t\t\t\t\t\t\t$isDescendant = false;\r\n\t\t\t\t\t\t\t\tforeach ($this->body->childNodes as $parent) {\r\n\t\t\t\t\t\t\t\t\tif ($this->isDescendant($parent, $elem)) {\r\n\t\t\t\t\t\t\t\t\t\t$isDescendant = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif ($isDescendant) {\r\n\t\t\t\t\t\t\t\t\t$this->debug('Element is child of another body element, skipping.');\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\t\t\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t\t\t\t\t\t$this->readability->prepArticle($elem);\r\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->debug('Element added to body');\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$this->body->appendChild($elem);\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$detect_body = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// check for elements marked with instapaper_title\r\n\t\tif ($detect_title) {\r\n\t\t\t// check for instapaper_title\r\n\t\t\t$elems = @$xpath->query(\"//*[contains(concat(' ',normalize-space(@class),' '),' instapaper_title ')]\", $this->readability->dom);\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('title found (.instapaper_title)');\r\n\t\t\t\t$this->title = $elems->item(0)->textContent;\r\n\t\t\t\t$detect_title = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// check for elements marked with instapaper_body\r\n\t\tif ($detect_body) {\r\n\t\t\t$elems = @$xpath->query(\"//*[contains(concat(' ',normalize-space(@class),' '),' instapaper_body ')]\", $this->readability->dom);\r\n\t\t\tif ($elems && $elems->length > 0) {\r\n\t\t\t\t$this->debug('body found (.instapaper_body)');\r\n\t\t\t\t$this->body = $elems->item(0);\r\n\t\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\t\tif ($this->config->prune) {\r\n\t\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t\t$this->readability->prepArticle($this->body);\r\n\t\t\t\t}\r\n\t\t\t\t$detect_body = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// still missing title or body, so we detect using Readability\r\n\t\tif ($detect_title || $detect_body) {\r\n\t\t\t$this->debug('Using Readability');\r\n\t\t\t// clone body if we're only using Readability for title (otherwise it may interfere with body element)\r\n\t\t\tif (isset($this->body)) $this->body = $this->body->cloneNode(true);\r\n\t\t\t$success = $this->readability->init();\r\n\t\t}\r\n\t\tif ($detect_title) {\r\n\t\t\t$this->debug('Detecting title');\r\n\t\t\t$this->title = $this->readability->getTitle()->textContent;\r\n\t\t}\r\n\t\tif ($detect_body && $success) {\r\n\t\t\t$this->debug('Detecting body');\r\n\t\t\t$this->body = $this->readability->getContent();\r\n\t\t\tif ($this->body->childNodes->length == 1 && $this->body->firstChild->nodeType === XML_ELEMENT_NODE) {\r\n\t\t\t\t$this->body = $this->body->firstChild;\r\n\t\t\t}\r\n\t\t\t// prune (clean up elements that may not be content)\r\n\t\t\tif ($this->config->prune) {\r\n\t\t\t\t$this->debug('Pruning content');\r\n\t\t\t\t$this->readability->prepArticle($this->body);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($this->body)) {\r\n\t\t\t// remove scripts\r\n\t\t\t$this->readability->removeScripts($this->body);\r\n\t\t\t$this->success = true;\r\n\t\t}\r\n\t\t\r\n\t\t// if we've had no success and we've used tidy, there's a chance\r\n\t\t// that tidy has messed up. So let's try again without tidy...\r\n\t\tif (!$this->success && $tidied && $smart_tidy) {\r\n\t\t\t$this->debug('Trying again without tidy');\r\n\t\t\t$this->process($original_html, $url, false);\r\n\t\t}\r\n\r\n\t\treturn $this->success;\r\n\t}",
"public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('admincp.component_controller_maintain_reparser_clean')) ? eval($sPlugin) : false);\n\t}",
"public function markClean();",
"function MaintainCleanCache()\n{\n\tglobal $context, $txt;\n\n\t// Just wipe the whole cache directory!\n\tclean_cache();\n\tclean_cache('js');\n\tclean_cache('css');\n\n\t$context['maintenance_finished'] = $txt['maintain_cache'];\n}",
"public function isClean();",
"public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('mobiletemplate.component_controller_admincp_managestyles_clean')) ? eval($sPlugin) : false);\n\t}",
"public function clean() {\n\t\tglobal $warnings;\n\n\t\t// it's not at CBW\n\t\tif ($this->location != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as being at HQ\";\n\t\t\t$this->location = 1;\n\t\t}\n\t\t// it had beer in it\n\t\tif ($this->beer != 0) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as empty\";\n\t\t\t$this->beer = 0;\n\t\t}\n\t\t// it's not dirty\n\t\tif ($this->status != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as dirty\";\n\t\t}\n\n\t\t$this->status = 2;\n\t\t$this->update();\n\t}",
"protected function _clean()\n {\n if ($this->_defaultOptions['clean'] === FALSE) {\n return;\n }\n\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'remove unused markers',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $this->_cleanMarkers('loop');\n $this->_cleanMarkers('optional');\n\n $this->DISPLAY = preg_replace(\n $this->_contentMarkers,\n '',\n $this->DISPLAY\n );\n }",
"abstract function clean ();",
"public static function clean()\n\t{\n\t}",
"public function clean() {}",
"public function doXHTML_cleaning() {}",
"public function cleanup()\n {\n if ($this->catalogRule != '-') {\n $this->deleteAllCatalogRule->run();\n }\n }",
"public function clean()\n {\n (($sPlugin = Phpfox_Plugin::get('donation.component_controller_index_clean')) ? eval($sPlugin) : false);\n }",
"public function withTidy(array $config = [], string $encoding = 'utf8'): self\n\t{\n\t\t$this->tidyConfig = array_merge([\n\t\t\t'clean' => 'yes',\n\t\t\t'output-html' => 'yes',\n\t\t\t'wrap' => 0,\n\t\t], $config);\n\n\t\t$this->tidyEncoding = $encoding;\n\n\t\treturn $this;\n\t}",
"protected function parentCleanup() {\n }",
"public function cleanup() {\n\t\t$this->status = new WPSEO_Import_Status( 'cleanup', false );\n\n\t\tif ( ! $this->detect_helper() ) {\n\t\t\treturn $this->status;\n\t\t}\n\n\t\t$this->wpdb->query( \"DELETE FROM {$this->wpdb->postmeta} WHERE meta_key LIKE '_aioseop_%'\" );\n\n\t\treturn $this->status->set_status( true );\n\t}",
"function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }",
"public function cleanup() {\n\n\t\t$fs = new \\Symfony\\Component\\Filesystem\\Filesystem();\n\n\t\t$challange_dir = EE_ROOT_DIR . '/services/nginx-proxy/html/.well-known';\n\t\t$challange_rule_file = EE_ROOT_DIR . '/services/nginx-proxy/vhost.d/default';\n\t\tif ( $fs->exists( $challange_rule_file ) ) {\n\t\t\t$fs->remove( $challange_rule_file );\n\t\t}\n\t\tif ( $fs->exists( $challange_dir ) ) {\n\t\t\t$fs->remove( $challange_dir );\n\t\t}\n\t}",
"abstract public function clean();",
"public function cleanUp() {}"
] | [
"0.69163716",
"0.6459631",
"0.5992639",
"0.5587093",
"0.5527182",
"0.5481099",
"0.54701006",
"0.54606694",
"0.54170126",
"0.5328901",
"0.51956946",
"0.51528555",
"0.50111246",
"0.50066435",
"0.48950356",
"0.48489368",
"0.48452532",
"0.48368126",
"0.48112518",
"0.47943094",
"0.47892353",
"0.47765455",
"0.47687688",
"0.47499746",
"0.47267494",
"0.47146657",
"0.4708404",
"0.47060272",
"0.4701051",
"0.46971104"
] | 0.7230275 | 0 |
Cleans the provided html snippet based on the configuation options | function cleanup($html, $options = null)
{
if(isset($options) && is_array($options)){
$this->setOptions($options);
}
$this->_html = "{$html}";
if($this->_options['UseTidy'] && $this->_options['TidyBefore']){
$this->tidyClean();
}
// Remove escape slashes
$this->_html = stripslashes($this -> _html);
if($this->_options['CleaningMethod']['tags'] == "whitelist"){
// Trim everything before body tag, leaving possible body attributes
if(preg_match("/<body/i", "{$this -> _html}")){
$this -> html = stristr($this -> _html, "<body");
}
// strip tags, still leaving attributes, second variable is allowed tags
$this->_html = strip_tags($this->_html, $this->_tag_whitelist);
}
if($this->_options['RemoveStyles']){
// Remove class and style attributes
$this->removeBlacklistedAttributes("class|style");
}
if($this->_options['IsWord']){
$this->removeBlacklistedAttributes("lang|[ovwxp]:\w+");
}
if($this->_options['CleaningMethod']['attributes'] == "blacklist"){
if(!empty ($this->_attrib_blacklist)){
$this->removeBlacklistedAttributes($this->_attrib_blacklist);
}
}
if($this->_options['Optimize']){
$repl = 1;
while($repl){
$repl = 0;
foreach($this->_cleanup_tags as $tag){
// Strip empty inline tags
$this -> _html = preg_replace("/<($tag)[^>]*>[\s]*([( )]*)[\s]*<\/($tag)>/i","\\2", $this -> _html,-1,$count);
$repl += $count;
// Merge inline tags
$this -> _html = preg_replace("/<\/($tag)[^>]*>[\s]*([( )]*)[\s]*<($tag)>/i","\\2", $this -> _html,-1,$count);
$repl += $count;
}
}
// Drop empty paragraph tags
if($this->_options['DropEmptyParas']){
$this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\s]*[( )]*[\s]*<\/(p|h[1-6]{1})>/i',"\r\n", $this -> _html);
}
// Trim extra spaces only if tidy is not set to indent
if(!$this->_tidy_config['indent']){
// Trim extra spaces between words
$this -> _html = preg_replace('/([^<>])[\s]+([^<>])/i',"\\1 \\2", $this -> _html);
// Trim extra spaces before tags
$this -> _html = preg_replace('/[\n|\r|\r\n|][\n|\r|\r\n|]+</i',"<", $this -> _html);
}
}
if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){
$this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\s]*[( )]*[\s]*<\/(p|h[1-6]{1})>/i',"\r\n", $this -> _html);
}
if($this->_options['FillEmptyTableCells']) {
$this -> _html = preg_replace("/<td([^>]*)>[\s]*<\/td>/i", "<td\\1> </td>", $this -> _html);
}
if($this->_options['Compress']){
// Trim spaces after tags
$this -> _html = preg_replace('/>[\s]+/',">", $this -> _html);
// Trim spaces before end tags
$this -> _html = preg_replace('/[\s]+<\//',"</", $this -> _html);
// Trim spaces before tags
$this -> _html = preg_replace('/[\s]+</',"<", $this -> _html);
// Trim extra spaces between words
$this -> _html = preg_replace('/([^<>])[\s]+([^<>])/',"\\1 \\2", $this -> _html);
}
if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){
$this->tidyClean();
}
return $this->output("{$this->_html}");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function cleanHTML($content);",
"protected function parseHtml() {\r\n\t\tif (is_array($this->cfg->html))\r\n\t\t\t$this->cfg->html = utils::render($this->cfg->html);\r\n\t}",
"function tidyClean() \n { \n if(!class_exists('tidy')){ \n if(function_exists('tidy_parse_string')){ \n tidy_set_encoding(\"{$this->_options[\"Encoding\"]}\"); \n foreach($this->_tidy_config as $k => $v) { \n tidy_setopt($k, $v); \n } \n tidy_parse_string($this->_html); \n tidy_clean_repair(); \n $this->_html = tidy_get_output(); \n } \n else { \n error_log(\"Tidy is not supported on this platform. Basic Cleaning is applied.\"); \n } \n } \n else { \n $tidy = new tidy; \n $tidy -> parseString($this->_html, $this->_tidy_config, \"{$this->_options[\"Encoding\"]}\"); \n $tidy -> cleanRepair(); \n $this -> html = $tidy; \n } \n }",
"function wpstart_sanitize_html($input)\n {\n return wp_kses_post(force_balance_tags($input));\n }",
"function emarking_clean_question_html($html)\n{\n $question = get_string('question', 'mod_quiz');\n $html = preg_replace('/[\\n\\r]/', '', $html);\n $html = preg_replace('/<div class=\"state\">(.*?)<\\/div>/', '', $html);\n $html = preg_replace('/<div class=\"grade\">(.*?)<\\/div>/', '', $html);\n $html = preg_replace('/<div class=\"questionflag\">(.*?)<\\/div>/', '', $html);\n $html = preg_replace('/<h4 class=\"accesshide\">(.*?)<\\/h4>/', '', $html);\n $html = preg_replace('/<input type=\"hidden\"(.*?)>/', '', $html);\n $html = preg_replace('/<input type=\"radio\"(.*?)>/', '<input type=\"radio\">', $html);\n $html = preg_replace('/checked=\"checked\"/', '', $html);\n $html = preg_replace('/alt=\"[^\"]*\"/', '', $html);\n $html = preg_replace('/title=\"[^\"]*\"/', '', $html);\n $html = preg_replace('/class=\"texrender\"/', '', $html);\n $html = preg_replace('/<script type=\"math\\/tex\">(.*?)<\\/script>/', '', $html);\n $html = preg_replace('/class\\s*=\\s*\"(.*?)\"/', '', $html);\n $html = preg_replace('/style\\s*=\\s*\"(.*?)\"/', '', $html);\n $html = preg_replace('/<span\\s*>/', '', $html);\n $html = preg_replace('/<\\/span>/', '', $html);\n $html = preg_replace('/<label(.*?)>/', '', $html);\n $html = preg_replace('/<\\/label>/', '', $html);\n $html = preg_replace('/<a\\s+href\\s*=\\s*\"(.*?)\">(.*?)<\\/a>/', '$2', $html);\n $html = preg_replace('/id\\s*=\\s*\"(.*?)\"/', '', $html);\n $html = preg_replace('/<br>/', '', $html);\n $html = preg_replace('/<p(\\s*?)>/', '', $html);\n $html = preg_replace('/(<div\\s*>)+/', '<div>', $html);\n $html = preg_replace('/(<\\/div>)+/', '</div>', $html);\n $html = preg_replace('/<div>Sele(.*?)<\\/div>/', '', $html);\n $html = preg_replace('/<div(.*?)><h3(.*?)>'.$question.'\\s+(.*?)<\\/h3><\\/div>/', '<br/><p><b>$3</b></p>', $html);\n $html = preg_replace('/<tbody\\s*>/', '', $html);\n $html = preg_replace('/<\\/tbody>/', '', $html);\n $html = preg_replace('/<td(.*?)>(.*?)<\\/p><\\/td>/', '<td style=\"text-align:center;\" align=\"center\">$2</td>', $html);\n $html = preg_replace('/frame=\"border\"/', '', $html);\n $html = preg_replace('/border=\"\\d+\"/', 'border=\"1\"', $html);\n $html = preg_replace('/<table(.*?)>/', '<br/><table$1>', $html);\n $html = preg_replace('/<table(.*?)>/', '<br/><table$1>', $html);\n $html = preg_replace('/<div>(<input.*?)<\\/div>/', '<br/>$1', $html);\n return $html;\n}",
"function cmh_validate_options($input) {\r\n\t // strip html from textboxes\r\n\t$input['textarea_one'] = wp_filter_nohtml_kses($input['textarea_one']); // Sanitize textarea input (strip html tags, and escape characters)\r\n\t$input['txt_one'] = wp_filter_nohtml_kses($input['txt_one']); // Sanitize textbox input (strip html tags, and escape characters)\r\n\treturn $input;\r\n}",
"function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }",
"protected function allow_html() {\n\t\tremove_filter( 'pre_term_description', 'wp_filter_kses' );\n\t\tremove_filter( 'term_description', 'wp_kses_data' );\n\n\t\tadd_filter( 'pre_term_description', 'wp_filter_post_kses' );\n\t}",
"public function doXHTML_cleaning() {}",
"public static function sanitizeHtml($raw_html)\n {\n try {\n $cache_dir = fn_get_cache_path(false) . 'html_purifier/';\n if (!is_dir($cache_dir)) {\n fn_mkdir($cache_dir);\n }\n\n $config_instance = \\HTMLPurifier_Config::createDefault();\n $config_instance->set('HTML.DefinitionID', PRODUCT_NAME . '_' . PRODUCT_VERSION);\n $config_instance->set('HTML.DefinitionRev', 1);\n $config_instance->set('Cache.SerializerPath', $cache_dir);\n $config_instance->set('Cache.SerializerPermissions', DEFAULT_DIR_PERMISSIONS);\n $config_instance->set('HTML.AllowedAttributes', [\n // general tags\n '*.class' => true,\n '*.id' => true,\n '*.href' => true,\n '*.target' => true,\n '*.style' => true,\n '*.title' => true,\n // img tags\n 'img.src' => true,\n 'img.width' => true,\n 'img.height' => true,\n 'img.alt' => true,\n // block placeholders in WYSIWYG\n 'hr.data-ca-object-key' => true,\n 'hr.data-ca-block-name' => true,\n ]);\n\n $config_instance->autoFinalize = false;\n\n /**\n * Allows to configure HTMLPurifier before it purifies given HTML.\n *\n * @param \\HTMLPurifier_Config $config_instance Instance of HTMLPurifier_Config\n * @param string $raw_html HTML to be purified\n */\n fn_set_hook('sanitize_html', $config_instance, $raw_html);\n\n /** @var \\HTMLPurifier_HTMLDefinition $html_definition */\n if ($html_definition = $config_instance->maybeGetRawHTMLDefinition()) {\n $html_definition->addAttribute('a',\n 'target',\n new \\HTMLPurifier_AttrDef_Enum(\n array('_blank', '_self', '_target', '_top')\n ));\n\n $html_definition->addAttribute('hr',\n 'data-ca-object-key',\n new \\HTMLPurifier_AttrDef_Text()\n );\n\n $html_definition->addAttribute('hr',\n 'data-ca-block-name',\n new \\HTMLPurifier_AttrDef_Text()\n );\n }\n\n $purifier_instance = \\HTMLPurifier::instance($config_instance);\n\n $html_purify = $purifier_instance->purify($raw_html);\n\n return html_entity_decode($html_purify, ENT_QUOTES, 'UTF-8');\n\n } catch (\\Exception $e) {\n throw new DeveloperException($e->getMessage());\n }\n }",
"function clean_html($html)\r\n{\r\n\t$html = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/is', \"\", $html);\r\n\t$html = preg_replace('/<style\\b[^>]*>(.*?)<\\/style>/is', \"\", $html);\r\n\t$html = preg_replace('/<link \\b[^>]*>(.*?)/is', \"\", $html);\r\n\r\n\treturn $html;\r\n}",
"protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }",
"protected function cleanHTML(string $html) : string\n {\n // $html = str_replace(\"\\n\", '', $html);\n for($i = 0; $i < 3; $i++) {\n $html = str_replace($this->prefixHTML, '', $html);\n $html = str_replace($this->postfixHTML, '', $html);\n $html = str_replace('<?xml version=\"1.0\" standalone=\"yes\"?>', '', $html);\n //remove white space\n $html = preg_replace('/\\s+/', ' ', $html);\n // $html = str_replace('> <', '><', $html);\n }\n\n return $html;\n }",
"function acf_allow_unfiltered_html()\n{\n}",
"protected function cleanHTML($html)\n\t{\n\t\t$html = trim($html);\n\t\t// remove multiple tabs\n\t\t$html = preg_replace('/\\t/',\"\",$html);\n\t\t// remove multiple line breaks\n\t\t$html = preg_replace('/(\\n|\\r){2,}/',\"\\n\",$html);\n\t\t// set all paths to absolute\n\t\t$html = preg_replace_callback('/((?:src|href|action)=[\\'\\\"])([^\\'\\\"]*)([\\'\\\"])/',function($matches){\n\t\t\tif ( (preg_match('/^\\/[^\\/]/',$matches[2])) && (!preg_match('/^https?/',$matches[2])) )\n\t\t\t{\n\t\t\t\t$matches[2] = Director::absoluteURL($matches[2]);\n\t\t\t}\n\t\t\treturn $matches[1].$matches[2].$matches[3];\n\t\t},$html);\n\t\treturn $html;\n\t}",
"function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }",
"public static function cleanHTMLStr($html)\n {\n require_once __DIR__ . '/../../Libs/vendor/ezyang/htmlpurifier/library/HTMLPurifier.auto.php';\n $config = HTMLPurifier_Config::createDefault();\n $config->loadArray([\n 'Cache.DefinitionImpl' => null,\n 'Core.Encoding' => 'UTF-8',\n 'HTML.Allowed' => 'strong,em,a[href|title|target|rel|class|style],ul[style],ol[style],li[style],br,span[class|style]',\n 'Attr.AllowedFrameTargets' => array('_blank', '_self'),\n 'CSS.AllowTricky' => true,\n 'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding,padding-left,padding-right,color,background-color,text-align,display',\n 'AutoFormat.RemoveEmpty' => true\n ]);\n $purifier = new HTMLPurifier($config);\n return $purifier->purify($html);\n }",
"private static function clearHTML($html)\n {\n return preg_replace(array(\n '/\\s+/',\n '/[\\t\\n\\r]+/',\n '/<!--.*?-->/s',\n '/>\\s*</',\n '/;\\s*(\\\"|\\')/',\n '/<\\/\\s+/',\n '/\\s+\\/>/',\n '/<\\s+/',\n '/\\s+>/'\n ), array(\n ' ',\n ' ',\n '',\n '><',\n '${1}',\n '</',\n '/>',\n '<',\n '>'\n ), $html);\n }",
"function wpec_validate_options($input) {\n\n\t// Check our textbox option field contains no HTML tags - if so strip them out\n\t//$input['text_string'] = wp_filter_nohtml_kses($input['text_string']);\n\n return $input;\n}",
"function strips_tags( $html, $disallowed_tag = 'script|style|noframes|select|option', $allowed_tag = '' )\n\t{\n\t\t//prep the string\n\t\t$html = ' ' . $html;\n\n\t\t//initialize keep tag logic\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\t$k = explode( '|', $allowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '<' . $k[ $i ], '[{(' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '</' . $k[ $i ], '[{(/' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\t\t//begin removal\n\t\t//remove comment blocks\n\t\twhile ( stripos( $html, '<!--' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<!--' );\n\t\t\t$pos[ 2 ] = stripos( $html, '-->', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 3;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//remove tags with content between them\n\t\tif ( strlen( $disallowed_tag ) > 0 )\n\t\t{\n\t\t\t$e = explode( '|', $disallowed_tag );\n\t\t\tfor ( $i = 0; $i < count( $e ); $i++ )\n\t\t\t{\n\t\t\t\twhile ( stripos( $html, '<' . $e[ $i ] ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$len[ 1 ] = strlen( '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 1 ] = stripos( $html, '<' . $e[ $i ] );\n\t\t\t\t\t$pos[ 2 ] = stripos( $html, $e[ $i ] . '>', $pos[ 1 ] + $len[ 1 ] );\n\t\t\t\t\t$len[ 2 ] = $pos[ 2 ] - $pos[ 1 ] + $len[ 1 ];\n\t\t\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 2 ] );\n\t\t\t\t\t$html = str_replace( $x, '', $html );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//remove remaining tags\n\t\twhile ( stripos( $html, '<' ) > 0 )\n\t\t{\n\t\t\t$pos[ 1 ] = stripos( $html, '<' );\n\t\t\t$pos[ 2 ] = stripos( $html, '>', $pos[ 1 ] );\n\t\t\t$len[ 1 ] = $pos[ 2 ] - $pos[ 1 ] + 1;\n\t\t\t$x = substr( $html, $pos[ 1 ], $len[ 1 ] );\n\t\t\t$html = str_replace( $x, '', $html );\n\t\t}\n\t\t//finalize keep tag\n\t\tif ( strlen( $allowed_tag ) > 0 )\n\t\t{\n\t\t\tfor ( $i = 0; $i < count( $k ); $i++ )\n\t\t\t{\n\t\t\t\t$html = str_replace( '[{(' . $k[ $i ], '<' . $k[ $i ], $html );\n\t\t\t\t$html = str_replace( '[{(/' . $k[ $i ], '</' . $k[ $i ], $html );\n\t\t\t}\n\t\t}\n\n\t\treturn trim( $html );\n\t}",
"function sanitize(\n $html,\n $tags_to_remove = ['script', 'iframe', 'input', 'form'],\n $attributes_to_keep = ['title', 'href', 'src'],\n $text_to_keep = []\n) {\n $htmlContent = str_get_html($html);\n\n foreach ($htmlContent->find('*') as $element) {\n if (in_array($element->tag, $text_to_keep)) {\n $element->outertext = $element->plaintext;\n } elseif (in_array($element->tag, $tags_to_remove)) {\n $element->outertext = '';\n } else {\n foreach ($element->getAllAttributes() as $attributeName => $attribute) {\n if (!in_array($attributeName, $attributes_to_keep)) {\n $element->removeAttribute($attributeName);\n }\n }\n }\n }\n\n return $htmlContent;\n}",
"function theme_options_validate( $input ) {\n\n\t// Say our text option must be safe text with no HTML tags\n\t$input['sometext'] = wp_filter_nohtml_kses( $input['sometext'] );\n\n\n\n\treturn $input;\n}",
"function cleanHtml($name) {\n\t\tif (isset($this->getvars[$name])){\n\t\t\treturn (string)strip_tags(urldecode($this->getvars[$name]));\n\t\t} else {\n\t\t\treturn (string)@strip_tags(urldecode($this->postvars[$name]));\n\t\t}\n\t}",
"public function sanitize()\n {\n parent::sanitize();\n\n foreach ($this->_cleanData as $key => $value) {\n $this->_cleanData[$key] = strip_tags($value);\n }\n }",
"public function cropHtmlWorksWithLinebreaks() {}",
"function qa_sanitize_html($html, $linksnewwindow = false, $storage = false)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\trequire_once 'vendor/htmLawed.php';\n\n\tglobal $qa_sanitize_html_newwindow;\n\n\t$qa_sanitize_html_newwindow = $linksnewwindow;\n\n\t$safe = htmLawed($html, array(\n\t\t'safe' => 1,\n\t\t'elements' => '*+embed+object-form',\n\t\t'schemes' => 'href: aim, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, telnet; *:file, http, https; style: !; classid:clsid',\n\t\t'keep_bad' => 0,\n\t\t'anti_link_spam' => array('/.*/', ''),\n\t\t'hook_tag' => 'qa_sanitize_html_hook_tag',\n\t));\n\n\treturn $safe;\n}",
"function wp_filter_nohtml_kses($data)\n {\n }",
"function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}",
"public function tidyHtml(string $html): string\n {\n // some point.\n return $html;\n }",
"public function cropHtmlWorksWithComplexContent() {}"
] | [
"0.65628284",
"0.63438624",
"0.61977494",
"0.61653143",
"0.6090394",
"0.6088692",
"0.6066914",
"0.6052629",
"0.6049276",
"0.6041285",
"0.6014014",
"0.6011197",
"0.59926075",
"0.59078074",
"0.5880054",
"0.58725715",
"0.58725107",
"0.5853894",
"0.5809442",
"0.57934916",
"0.5785562",
"0.57794607",
"0.5760954",
"0.5758369",
"0.57369876",
"0.5732307",
"0.56953645",
"0.56539714",
"0.5652284",
"0.5639041"
] | 0.7351366 | 0 |
include "./include/stat_func_tool.php"; ////////////// get label of province tumbon mooban /////////////////// | function get_label($ccaattmm){
$lst_ampor = getListAA(substr($ccaattmm,0,2));
$lst_tumbon = getListTT(substr($ccaattmm,0,4));
$lst_mooban = getListMM(substr($ccaattmm,0,6));
$arr_aa = explode("|", $lst_ampor);
$arr_tt = explode("|", $lst_tumbon);
$arr_mm = explode("|", $lst_mooban);
/// sel ampor
for($i=0; $i<(count($arr_aa)-3) ;$i+=2){
if(substr($arr_aa[$i+2],2,2)==substr($ccaattmm,2,2)){
echo str_replace('ท้องถิ่น','',$arr_aa[$i+3])." ";
}
}
/// sel tumbon
for($i=0; $i<(count($arr_tt)-3) ;$i+=2){
if(substr($arr_tt[$i+2],4,2)==substr($ccaattmm,4,2)){
echo " ตำบล".$arr_tt[$i+3]." ";
}
}
/// sel mooban
for($i=0; $i<(count($arr_mm)-3) ;$i+=2){
if(substr($arr_mm[$i+2],6,2)==substr($ccaattmm,6,2)){
echo " หมู่".$arr_mm[$i+3];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetLabel();",
"public function get_label();",
"public function get_label();",
"function getLabel(): string;",
"function get_label($ccaattmm){\n\t\t\t$lst_ampor = getListAA(substr($ccaattmm,0,2));\n\t\t\t$lst_tumbon = getListTT(substr($ccaattmm,0,4));\n\t\t\t$lst_mooban = getListMM(substr($ccaattmm,0,6));\n\t\t\t$arr_aa = explode(\"|\", $lst_ampor);\n\t\t\t$arr_tt = explode(\"|\", $lst_tumbon);\n\t\t\t$arr_mm = explode(\"|\", $lst_mooban);\n\t\t\t$label;\n\n\t\t\t/// sel ampor\n\t\t\tfor($i=0; $i<(count($arr_aa)-3) ;$i+=2){\n\t\t\t\tif(substr($arr_aa[$i+2],2,2)==substr($ccaattmm,2,2)){\n\t\t\t\t\t$label = str_replace('ท้องถิ่น','',$arr_aa[$i+3]).\" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/// sel tumbon\n\t\t\tfor($i=0; $i<(count($arr_tt)-3) ;$i+=2){\n\t\t\t\tif(substr($arr_tt[$i+2],4,2)==substr($ccaattmm,4,2)){\n\t\t\t\t\t$label .= \" ตำบล\".$arr_tt[$i+3].\" \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/// sel mooban\n\t\t\tfor($i=0; $i<(count($arr_mm)-3) ;$i+=2){\n\t\t\t\tif(substr($arr_mm[$i+2],6,2)==substr($ccaattmm,6,2)){\n\t\t\t\t\t$label .= \" หมู่\".$arr_mm[$i+3];\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $label;\n\t\t}",
"abstract public function getLabel();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function label();",
"public function getLabel(): string;",
"public function getLabel(): string;",
"function wpsl_labels() {\n\n $labels = array(\n 'search',\n 'search_btn',\n 'preloader',\n 'radius',\n 'no_results',\n 'results',\n 'more',\n 'directions',\n 'no_directions',\n 'back',\n 'street_view',\n 'zoom_here',\n 'error',\n 'phone',\n 'fax',\n 'email',\n 'url',\n 'hours',\n 'start',\n 'limit',\n 'category',\n 'category_default'\n );\n\n return $labels;\n}",
"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();"
] | [
"0.65225047",
"0.6519477",
"0.6519477",
"0.64948946",
"0.6446904",
"0.6252001",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.62290317",
"0.61410403",
"0.61410403",
"0.6139777",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511",
"0.6118511"
] | 0.6562518 | 0 |
Operation metadata for suggesting Trials. Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; | public function getGenericMetadata()
{
return $this->generic_metadata;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setGenericMetadata($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AIPlatform\\V1\\GenericOperationMetadata::class);\n $this->generic_metadata = $var;\n\n return $this;\n }",
"private function getDefaultOperationDescriptor()\n {\n return [\n 'additionalArgumentMethods' => [\n 'getProject',\n ],\n 'getOperationMethod' => 'get',\n 'cancelOperationMethod' => null,\n 'deleteOperationMethod' => 'delete',\n 'operationErrorCodeMethod' => 'getHttpErrorStatusCode',\n 'operationErrorMessageMethod' => 'getHttpErrorMessage',\n 'operationNameMethod' => 'getName',\n 'operationStatusMethod' => 'getStatus',\n 'operationStatusDoneValue' => \\Google\\Cloud\\Compute\\V1\\Operation\\Status::DONE,\n ];\n }",
"abstract public function signRequestHeaders(\n\t\t$httpVerb = Microsoft_Http_Client::GET,\n\t\t$path = '/',\n\t\t$query = array(),\n\t\t$headers = null,\n\t\t$forTableStorage = false,\n\t\t$resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN,\n\t\t$requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ,\n\t\t$rawData = null\n\t);",
"public function getSyncMetadata() {}",
"function getOperationInfo() {\n return userpoints_get_info($this->getOperation());\n }",
"public function signRequestHeaders(\n\t\t$httpVerb = Microsoft_Http_Client::GET,\n\t\t$path = '/',\n\t\t$queryString = '',\n\t\t$headers = null,\n\t\t$forTableStorage = false,\n\t\t$resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN,\n\t\t$requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ,\n\t\t$rawData = null\n\t) {\n\t\t// http://github.com/sriramk/winazurestorage/blob/214010a2f8931bac9c96dfeb337d56fe084ca63b/winazurestorage.py\n\n\t\t// Table storage?\n\t\tif ($forTableStorage) {\n\t\t\tthrow new Microsoft_WindowsAzure_Credentials_Exception('The Windows Azure SDK for PHP does not support SharedKey authentication on table storage. Use SharedKeyLite authentication instead.');\n\t\t}\n\t\t\n\t\t// Determine path\n\t\tif ($this->_usePathStyleUri) {\n\t\t\t$path = substr($path, strpos($path, '/'));\n\t\t}\n\n\t\t// Determine query\n\t\t$queryString = $this->_prepareQueryStringForSigning($queryString);\n\t\n\t\t// Canonicalized headers\n\t\t$canonicalizedHeaders = array();\n\t\t\n\t\t// Request date\n\t\t$requestDate = '';\n\t\tif (isset($headers[Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date'])) {\n\t\t $requestDate = $headers[Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date'];\n\t\t} else {\n\t\t $requestDate = gmdate('D, d M Y H:i:s', time()) . ' GMT'; // RFC 1123\n\t\t $canonicalizedHeaders[] = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date:' . $requestDate;\n\t\t}\n\t\t\n\t\t// Build canonicalized headers\n\t\tif (!is_null($headers)) {\n\t\t\tforeach ($headers as $header => $value) {\n\t\t\t\tif (is_bool($value)) {\n\t\t\t\t\t$value = $value === true ? 'True' : 'False';\n\t\t\t\t}\n\n\t\t\t\t$headers[$header] = $value;\n\t\t\t\tif (substr($header, 0, strlen(Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER)) == Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER) {\n\t\t\t\t $canonicalizedHeaders[] = strtolower($header) . ':' . $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($canonicalizedHeaders);\n\n\t\t// Build canonicalized resource string\n\t\t$canonicalizedResource = '/' . $this->_accountName;\n\t\tif ($this->_usePathStyleUri) {\n\t\t\t$canonicalizedResource .= '/' . $this->_accountName;\n\t\t}\n\t\t$canonicalizedResource .= $path;\n\t\tif ($queryString !== '') {\n\t\t $queryStringItems = $this->_makeArrayOfQueryString($queryString);\n\t\t foreach ($queryStringItems as $key => $value) {\n\t\t \t$canonicalizedResource .= \"\\n\" . strtolower($key) . ':' . urldecode($value);\n\t\t }\n\t\t}\n\t\t\n\t\t// Content-Length header\n\t\t$contentLength = '';\n\t\tif (strtoupper($httpVerb) != Microsoft_Http_Client::GET\n\t\t\t && strtoupper($httpVerb) != Microsoft_Http_Client::DELETE\n\t\t\t && strtoupper($httpVerb) != Microsoft_Http_Client::HEAD) {\n\t\t\t$contentLength = 0;\n\t\t\t\n\t\t\tif (!is_null($rawData)) {\n\t\t\t\t$contentLength = strlen($rawData);\n\t\t\t}\n\t\t}\n\n\t\t// Create string to sign \n\t\t$stringToSign = array();\n\t\t$stringToSign[] = strtoupper($httpVerb); \t\t\t\t\t\t\t\t\t// VERB\n \t$stringToSign[] = $this->_issetOr($headers, 'Content-Encoding', '');\t\t// Content-Encoding\n \t$stringToSign[] = $this->_issetOr($headers, 'Content-Language', '');\t\t// Content-Language\n \t$stringToSign[] = $contentLength; \t\t\t\t\t\t\t\t\t\t\t// Content-Length\n \t$stringToSign[] = $this->_issetOr($headers, 'Content-MD5', '');\t\t\t\t// Content-MD5\n \t$stringToSign[] = $this->_issetOr($headers, 'Content-Type', '');\t\t\t// Content-Type\n \t$stringToSign[] = \"\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Date\n \t$stringToSign[] = $this->_issetOr($headers, 'If-Modified-Since', '');\t\t// If-Modified-Since\n \t$stringToSign[] = $this->_issetOr($headers, 'If-Match', '');\t\t\t\t// If-Match\n \t$stringToSign[] = $this->_issetOr($headers, 'If-None-Match', '');\t\t\t// If-None-Match\n \t$stringToSign[] = $this->_issetOr($headers, 'If-Unmodified-Since', '');\t\t// If-Unmodified-Since\n \t$stringToSign[] = $this->_issetOr($headers, 'Range', '');\t\t\t\t\t// Range\n \t\n \tif (!$forTableStorage && count($canonicalizedHeaders) > 0) {\n \t\t$stringToSign[] = implode(\"\\n\", $canonicalizedHeaders); // Canonicalized headers\n \t}\n \t\t\n \t$stringToSign[] = $canonicalizedResource;\t\t \t\t\t// Canonicalized resource\n \t$stringToSign = implode(\"\\n\", $stringToSign);\n \t$signString = base64_encode(hash_hmac('sha256', $stringToSign, $this->_accountKey, true));\n\n \t// Sign request\n \t$headers[Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date'] = $requestDate;\n \t$headers['Authorization'] = 'SharedKey ' . $this->_accountName . ':' . $signString;\n \t\n \t// Return headers\n \treturn $headers;\n\t}",
"public function getAddMetadata()\n {\n return $this->readOneof(3);\n }",
"function getCorrOperationDescription(array $operation) {\n\treturn corrOperationTypes($operation['type']);\n}",
"public function getMetadata()\n {\n $this->getFtpMetadata();\n\n parent::getMetadata();\n\n /**\n * Discovery creates an array of Files and Directories based on Path\n */\n if ($this->exists === true) {\n $this->discovery($this->path);\n }\n\n $this->getSize();\n\n return;\n }",
"public function getMetadata() {}",
"public function getMetadata() {}",
"public function getMetadata();",
"public function getMetadata();",
"public function getMetadata();",
"public function metadata()\r\n\t{\r\n return array(\"nit\" => array(),\r\n \"nombre\" => array(),\r\n \"telefono\" => array(),\r\n \"direccion\" => array(),\r\n \"correo\" => array());\r\n }",
"function add_metadata_taxonomies() {\n\t/*\n\tEducational use: http://schema.org/educationalUse e.g. http://purl.org/dcx/lrmi-vocabs/edUse/instruction\nEducational audience: http://schema.org/EducationalAudience e.g. http://purl.org/dcx/lrmi-vocabs/educationalAudienceRole/student\nInteractivity type: http://schema.org/interactivityType e.g. http://purl.org/dcx/lrmi-vocabs/interactivityType/expositive (active, expositive, or mixed)\nProficiency level: http://schema.org/proficiencyLevel (Beginner, Expert)\n\t*/\n\tadd_educational_use();\n\tadd_educational_audience();\n\tadd_interactivity_type();\n\tadd_proficiency_level();\n}",
"abstract protected function getTableMetadata(string $name, string $type, bool $refresh);",
"public function getOperationInfo()\n {\n $value = $this->get(self::OPERATIONINFO);\n return $value === null ? (string)$value : $value;\n }",
"public function syncMetadata() {}",
"public function getOperations()\r\n {\r\n return $this->operations;\r\n }",
"public function testUpdateMetadata1UsingPUT()\n {\n }",
"protected function getAdvancedMultiIndexSuggestResultsRequest($suggest)\n {\n // verify the required parameter 'suggest' is set\n if ($suggest === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $suggest when calling getAdvancedMultiIndexSuggestResults'\n );\n }\n\n $resourcePath = '/indexes/suggest';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($suggest)) {\n $_tempBody = $suggest;\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 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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listsgenericGenericput($generic_id)\r\n {\r\n $input = Request::all();\r\n $generic = Generic::findOrFail($generic_id);\r\n $generic->update(['name' => $input['name']]);\r\n if($generic->save()){\r\n return response()->json(['msg' => 'Updated generic']);\r\n }else{\r\n return response('Oops, seems like there was a problem updating the generic');\r\n }\r\n }",
"protected function getRouteInfo(RestServiceEntity $metadata, array $config)\n {\n $routeName = $metadata->routeName;\n if (\n ! $routeName\n || ! isset($config['router']['routes'][$routeName]['options']['route'])\n ) {\n return;\n }\n $metadata->exchangeArray([\n 'route_match' => $config['router']['routes'][$routeName]['options']['route'],\n ]);\n }",
"public function getOperations()\n {\n return $this->operations;\n }",
"public function getOperationContext();",
"public function getOperation();",
"public function getOperationParams()\n {\n return $this->operation_params;\n }",
"public function getOperationType()\n {\n return OP_TABLES;\n }",
"public function testGetMetadata1UsingGET()\n {\n }"
] | [
"0.63990295",
"0.4166838",
"0.41522458",
"0.41314238",
"0.41055712",
"0.40080577",
"0.39407963",
"0.39168134",
"0.39081725",
"0.3898466",
"0.3898466",
"0.3848293",
"0.3848293",
"0.3848293",
"0.38397527",
"0.3832415",
"0.38169038",
"0.37977087",
"0.37752447",
"0.3773832",
"0.37517574",
"0.37516302",
"0.374959",
"0.3703395",
"0.3690272",
"0.36786267",
"0.36644274",
"0.3652615",
"0.36325788",
"0.36229053"
] | 0.48028782 | 1 |
Operation metadata for suggesting Trials. Generated from protobuf field .google.cloud.aiplatform.v1.GenericOperationMetadata generic_metadata = 1; | public function setGenericMetadata($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\GenericOperationMetadata::class);
$this->generic_metadata = $var;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGenericMetadata()\n {\n return $this->generic_metadata;\n }",
"private function getDefaultOperationDescriptor()\n {\n return [\n 'additionalArgumentMethods' => [\n 'getProject',\n ],\n 'getOperationMethod' => 'get',\n 'cancelOperationMethod' => null,\n 'deleteOperationMethod' => 'delete',\n 'operationErrorCodeMethod' => 'getHttpErrorStatusCode',\n 'operationErrorMessageMethod' => 'getHttpErrorMessage',\n 'operationNameMethod' => 'getName',\n 'operationStatusMethod' => 'getStatus',\n 'operationStatusDoneValue' => \\Google\\Cloud\\Compute\\V1\\Operation\\Status::DONE,\n ];\n }",
"abstract public function signRequestHeaders(\n\t\t$httpVerb = Microsoft_Http_Client::GET,\n\t\t$path = '/',\n\t\t$query = array(),\n\t\t$headers = null,\n\t\t$forTableStorage = false,\n\t\t$resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN,\n\t\t$requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ,\n\t\t$rawData = null\n\t);",
"public function getSyncMetadata() {}",
"function getOperationInfo() {\n return userpoints_get_info($this->getOperation());\n }",
"public function signRequestHeaders(\n\t\t$httpVerb = Microsoft_Http_Client::GET,\n\t\t$path = '/',\n\t\t$queryString = '',\n\t\t$headers = null,\n\t\t$forTableStorage = false,\n\t\t$resourceType = Microsoft_WindowsAzure_Storage::RESOURCE_UNKNOWN,\n\t\t$requiredPermission = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ,\n\t\t$rawData = null\n\t) {\n\t\t// http://github.com/sriramk/winazurestorage/blob/214010a2f8931bac9c96dfeb337d56fe084ca63b/winazurestorage.py\n\n\t\t// Table storage?\n\t\tif ($forTableStorage) {\n\t\t\tthrow new Microsoft_WindowsAzure_Credentials_Exception('The Windows Azure SDK for PHP does not support SharedKey authentication on table storage. Use SharedKeyLite authentication instead.');\n\t\t}\n\t\t\n\t\t// Determine path\n\t\tif ($this->_usePathStyleUri) {\n\t\t\t$path = substr($path, strpos($path, '/'));\n\t\t}\n\n\t\t// Determine query\n\t\t$queryString = $this->_prepareQueryStringForSigning($queryString);\n\t\n\t\t// Canonicalized headers\n\t\t$canonicalizedHeaders = array();\n\t\t\n\t\t// Request date\n\t\t$requestDate = '';\n\t\tif (isset($headers[Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date'])) {\n\t\t $requestDate = $headers[Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date'];\n\t\t} else {\n\t\t $requestDate = gmdate('D, d M Y H:i:s', time()) . ' GMT'; // RFC 1123\n\t\t $canonicalizedHeaders[] = Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date:' . $requestDate;\n\t\t}\n\t\t\n\t\t// Build canonicalized headers\n\t\tif (!is_null($headers)) {\n\t\t\tforeach ($headers as $header => $value) {\n\t\t\t\tif (is_bool($value)) {\n\t\t\t\t\t$value = $value === true ? 'True' : 'False';\n\t\t\t\t}\n\n\t\t\t\t$headers[$header] = $value;\n\t\t\t\tif (substr($header, 0, strlen(Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER)) == Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER) {\n\t\t\t\t $canonicalizedHeaders[] = strtolower($header) . ':' . $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($canonicalizedHeaders);\n\n\t\t// Build canonicalized resource string\n\t\t$canonicalizedResource = '/' . $this->_accountName;\n\t\tif ($this->_usePathStyleUri) {\n\t\t\t$canonicalizedResource .= '/' . $this->_accountName;\n\t\t}\n\t\t$canonicalizedResource .= $path;\n\t\tif ($queryString !== '') {\n\t\t $queryStringItems = $this->_makeArrayOfQueryString($queryString);\n\t\t foreach ($queryStringItems as $key => $value) {\n\t\t \t$canonicalizedResource .= \"\\n\" . strtolower($key) . ':' . urldecode($value);\n\t\t }\n\t\t}\n\t\t\n\t\t// Content-Length header\n\t\t$contentLength = '';\n\t\tif (strtoupper($httpVerb) != Microsoft_Http_Client::GET\n\t\t\t && strtoupper($httpVerb) != Microsoft_Http_Client::DELETE\n\t\t\t && strtoupper($httpVerb) != Microsoft_Http_Client::HEAD) {\n\t\t\t$contentLength = 0;\n\t\t\t\n\t\t\tif (!is_null($rawData)) {\n\t\t\t\t$contentLength = strlen($rawData);\n\t\t\t}\n\t\t}\n\n\t\t// Create string to sign \n\t\t$stringToSign = array();\n\t\t$stringToSign[] = strtoupper($httpVerb); \t\t\t\t\t\t\t\t\t// VERB\n \t$stringToSign[] = $this->_issetOr($headers, 'Content-Encoding', '');\t\t// Content-Encoding\n \t$stringToSign[] = $this->_issetOr($headers, 'Content-Language', '');\t\t// Content-Language\n \t$stringToSign[] = $contentLength; \t\t\t\t\t\t\t\t\t\t\t// Content-Length\n \t$stringToSign[] = $this->_issetOr($headers, 'Content-MD5', '');\t\t\t\t// Content-MD5\n \t$stringToSign[] = $this->_issetOr($headers, 'Content-Type', '');\t\t\t// Content-Type\n \t$stringToSign[] = \"\";\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Date\n \t$stringToSign[] = $this->_issetOr($headers, 'If-Modified-Since', '');\t\t// If-Modified-Since\n \t$stringToSign[] = $this->_issetOr($headers, 'If-Match', '');\t\t\t\t// If-Match\n \t$stringToSign[] = $this->_issetOr($headers, 'If-None-Match', '');\t\t\t// If-None-Match\n \t$stringToSign[] = $this->_issetOr($headers, 'If-Unmodified-Since', '');\t\t// If-Unmodified-Since\n \t$stringToSign[] = $this->_issetOr($headers, 'Range', '');\t\t\t\t\t// Range\n \t\n \tif (!$forTableStorage && count($canonicalizedHeaders) > 0) {\n \t\t$stringToSign[] = implode(\"\\n\", $canonicalizedHeaders); // Canonicalized headers\n \t}\n \t\t\n \t$stringToSign[] = $canonicalizedResource;\t\t \t\t\t// Canonicalized resource\n \t$stringToSign = implode(\"\\n\", $stringToSign);\n \t$signString = base64_encode(hash_hmac('sha256', $stringToSign, $this->_accountKey, true));\n\n \t// Sign request\n \t$headers[Microsoft_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date'] = $requestDate;\n \t$headers['Authorization'] = 'SharedKey ' . $this->_accountName . ':' . $signString;\n \t\n \t// Return headers\n \treturn $headers;\n\t}",
"public function getAddMetadata()\n {\n return $this->readOneof(3);\n }",
"function getCorrOperationDescription(array $operation) {\n\treturn corrOperationTypes($operation['type']);\n}",
"public function getMetadata()\n {\n $this->getFtpMetadata();\n\n parent::getMetadata();\n\n /**\n * Discovery creates an array of Files and Directories based on Path\n */\n if ($this->exists === true) {\n $this->discovery($this->path);\n }\n\n $this->getSize();\n\n return;\n }",
"public function getMetadata() {}",
"public function getMetadata() {}",
"public function getMetadata();",
"public function getMetadata();",
"public function getMetadata();",
"public function metadata()\r\n\t{\r\n return array(\"nit\" => array(),\r\n \"nombre\" => array(),\r\n \"telefono\" => array(),\r\n \"direccion\" => array(),\r\n \"correo\" => array());\r\n }",
"function add_metadata_taxonomies() {\n\t/*\n\tEducational use: http://schema.org/educationalUse e.g. http://purl.org/dcx/lrmi-vocabs/edUse/instruction\nEducational audience: http://schema.org/EducationalAudience e.g. http://purl.org/dcx/lrmi-vocabs/educationalAudienceRole/student\nInteractivity type: http://schema.org/interactivityType e.g. http://purl.org/dcx/lrmi-vocabs/interactivityType/expositive (active, expositive, or mixed)\nProficiency level: http://schema.org/proficiencyLevel (Beginner, Expert)\n\t*/\n\tadd_educational_use();\n\tadd_educational_audience();\n\tadd_interactivity_type();\n\tadd_proficiency_level();\n}",
"abstract protected function getTableMetadata(string $name, string $type, bool $refresh);",
"public function getOperationInfo()\n {\n $value = $this->get(self::OPERATIONINFO);\n return $value === null ? (string)$value : $value;\n }",
"public function syncMetadata() {}",
"public function getOperations()\r\n {\r\n return $this->operations;\r\n }",
"public function testUpdateMetadata1UsingPUT()\n {\n }",
"protected function getAdvancedMultiIndexSuggestResultsRequest($suggest)\n {\n // verify the required parameter 'suggest' is set\n if ($suggest === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $suggest when calling getAdvancedMultiIndexSuggestResults'\n );\n }\n\n $resourcePath = '/indexes/suggest';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($suggest)) {\n $_tempBody = $suggest;\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 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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listsgenericGenericput($generic_id)\r\n {\r\n $input = Request::all();\r\n $generic = Generic::findOrFail($generic_id);\r\n $generic->update(['name' => $input['name']]);\r\n if($generic->save()){\r\n return response()->json(['msg' => 'Updated generic']);\r\n }else{\r\n return response('Oops, seems like there was a problem updating the generic');\r\n }\r\n }",
"protected function getRouteInfo(RestServiceEntity $metadata, array $config)\n {\n $routeName = $metadata->routeName;\n if (\n ! $routeName\n || ! isset($config['router']['routes'][$routeName]['options']['route'])\n ) {\n return;\n }\n $metadata->exchangeArray([\n 'route_match' => $config['router']['routes'][$routeName]['options']['route'],\n ]);\n }",
"public function getOperations()\n {\n return $this->operations;\n }",
"public function getOperationContext();",
"public function getOperation();",
"public function getOperationParams()\n {\n return $this->operation_params;\n }",
"public function getOperationType()\n {\n return OP_TABLES;\n }",
"public function testGetMetadata1UsingGET()\n {\n }"
] | [
"0.4805241",
"0.41680086",
"0.41534734",
"0.41330716",
"0.41056505",
"0.40094134",
"0.39423403",
"0.39165655",
"0.39105156",
"0.39003325",
"0.39003325",
"0.3850425",
"0.3850425",
"0.3850425",
"0.3840812",
"0.38329694",
"0.38173684",
"0.37985247",
"0.3776517",
"0.37754166",
"0.37535396",
"0.3753352",
"0.37497663",
"0.37048745",
"0.3691842",
"0.36798817",
"0.36653596",
"0.3653514",
"0.36316976",
"0.36246464"
] | 0.6402459 | 0 |
The name of the Study that the Trial belongs to. Generated from protobuf field string study = 2; | public function getStudy()
{
return $this->study;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setStudy($var)\n {\n GPBUtil::checkString($var, True);\n $this->study = $var;\n\n return $this;\n }",
"public function getStudy() {\n return $this->study;\n }",
"public function study($study)\n {\n return $this->setProperty('study', $study);\n }",
"public function getStudyNameAttribute() : array\n {\n return array_map(fn (Study $study) : string => $study->study(), $this->studies);\n }",
"public function hasStudyName() {\n return $this->_has(9);\n }",
"public function getStudyNameList() {\n return $this->_get(9);\n }",
"function getId() {\n\t\treturn $this->getData('studyId');\n\t}",
"public function addStudyName(\\obiba\\mica\\LocalizedStringDto $value) {\n return $this->_add(9, $value);\n }",
"public function getConceptName(): string\n {\n return \\ucfirst($this->toString());\n }",
"public function get_samples_origin() {\n return 'course';\n }",
"function getStudyInfo($connection, $idStudy){\n\t$query = \"SELECT * FROM vStudyWithTypeNames WHERE idStudy =\".$idStudy;\n\treturn fetchRowFromDBOnID($connection, $query, $idStudy, \"study\");\n}",
"function study() {\n $this->studied = true;\n $this->_readframe();\n }",
"public function get_study_types()\n\t{\n\t\treturn $this->study_types;\n\t}",
"private function parseStudyInformation()\n {\n //\"FEEIT B-RK den [term 3, year 3]\"\n //\"ICSM FEEIT, ext FIIT\" //teacher\n\n if (str_contains($this->study_information, 'FEEIT I')) {\n $this->study_level = 2;\n $this->rank = substr($this->study_information, -2, 1) + 3;\n } elseif (str_contains($this->study_information, 'FEEIT B')) {\n $this->study_level = 1;\n $this->rank = substr($this->study_information, -2, 1);\n }\n }",
"public function getStudentName()\n {\n return $this->workStudent->first_name . \" \" . $this->workStudent->last_name;\n }",
"public function getTestName()\n {\n return $this->getField(5)[1];\n }",
"public function addStudy($study) {\n $this->study[] = $study;\n return $this;\n }",
"public function get_name()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['title'];\r\n }",
"function track_name($tr) {\n switch ($tr) {\n case 'tr0': return 'Paper Presentation';\n case 'trp': return 'Poster Session';\n case 'trl': return 'Lightning Talk';\n case 'trw': return 'Workshop';\n case 'tri': return 'Installation';\n case 'tro': return 'Miscellaneous';\n case 'trm': return 'Concert';\n case 'trmS': return 'Sound Night';\n default: return '';\n }\n }",
"function get_name($substance)\r\n {\r\n $data = $this->get_data($substance->pubchem);\r\n\r\n if(!$data)\r\n {\r\n return false;\r\n }\r\n\r\n return $data->name;\r\n }",
"public function hasStudyAcronym() {\n return $this->_has(10);\n }",
"public function setTrial($var)\n {\n GPBUtil::checkString($var, True);\n $this->trial = $var;\n\n return $this;\n }",
"public function getName(): string {\n\t\treturn $this->lFactory->get('spreed')->t('Talk');\n\t}",
"public static function participantName(string $project, string $conversation, string $participant): string\n {\n return self::getPathTemplate('participant')->render([\n 'project' => $project,\n 'conversation' => $conversation,\n 'participant' => $participant,\n ]);\n }",
"public function hasStudyId() {\n return $this->_has(1);\n }",
"public function caseStudyID($value = null)\n \t{\n \t\tif ($value != null) $this->caseStudyID = $value;\n \t\telse return $this->caseStudyID;\n \t}",
"public function getName() {\n return $this->getTreatmentName();\n }",
"public function subtitle()\n {\n return $this->resource->getName();\n }",
"public function subject()\n {\n return $this->belongsTo(StudySubject::class, 'subject_id');\n }",
"public function getName()\r\n {\r\n return $this->vest() ? $this->vest()->prefix.$this->is_name.'『'.$this->vest()->tuan.$this->vest()->suffix.'』'.$this->vest()->remark : '';\r\n }"
] | [
"0.6861962",
"0.6792853",
"0.623606",
"0.5847146",
"0.5812718",
"0.5683688",
"0.55522424",
"0.5541581",
"0.5491312",
"0.5356669",
"0.5351869",
"0.5297596",
"0.5206098",
"0.5153492",
"0.51351804",
"0.513271",
"0.50789213",
"0.5077319",
"0.50191617",
"0.49935588",
"0.48870632",
"0.48690754",
"0.48672998",
"0.48607492",
"0.48522422",
"0.48219538",
"0.47741356",
"0.47665668",
"0.47356227",
"0.4719677"
] | 0.6801605 | 1 |
The name of the Study that the Trial belongs to. Generated from protobuf field string study = 2; | public function setStudy($var)
{
GPBUtil::checkString($var, True);
$this->study = $var;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStudy()\n {\n return $this->study;\n }",
"public function getStudy() {\n return $this->study;\n }",
"public function study($study)\n {\n return $this->setProperty('study', $study);\n }",
"public function getStudyNameAttribute() : array\n {\n return array_map(fn (Study $study) : string => $study->study(), $this->studies);\n }",
"public function hasStudyName() {\n return $this->_has(9);\n }",
"public function getStudyNameList() {\n return $this->_get(9);\n }",
"function getId() {\n\t\treturn $this->getData('studyId');\n\t}",
"public function addStudyName(\\obiba\\mica\\LocalizedStringDto $value) {\n return $this->_add(9, $value);\n }",
"public function getConceptName(): string\n {\n return \\ucfirst($this->toString());\n }",
"public function get_samples_origin() {\n return 'course';\n }",
"function getStudyInfo($connection, $idStudy){\n\t$query = \"SELECT * FROM vStudyWithTypeNames WHERE idStudy =\".$idStudy;\n\treturn fetchRowFromDBOnID($connection, $query, $idStudy, \"study\");\n}",
"function study() {\n $this->studied = true;\n $this->_readframe();\n }",
"public function get_study_types()\n\t{\n\t\treturn $this->study_types;\n\t}",
"private function parseStudyInformation()\n {\n //\"FEEIT B-RK den [term 3, year 3]\"\n //\"ICSM FEEIT, ext FIIT\" //teacher\n\n if (str_contains($this->study_information, 'FEEIT I')) {\n $this->study_level = 2;\n $this->rank = substr($this->study_information, -2, 1) + 3;\n } elseif (str_contains($this->study_information, 'FEEIT B')) {\n $this->study_level = 1;\n $this->rank = substr($this->study_information, -2, 1);\n }\n }",
"public function getStudentName()\n {\n return $this->workStudent->first_name . \" \" . $this->workStudent->last_name;\n }",
"public function getTestName()\n {\n return $this->getField(5)[1];\n }",
"public function addStudy($study) {\n $this->study[] = $study;\n return $this;\n }",
"public function get_name()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['title'];\r\n }",
"function track_name($tr) {\n switch ($tr) {\n case 'tr0': return 'Paper Presentation';\n case 'trp': return 'Poster Session';\n case 'trl': return 'Lightning Talk';\n case 'trw': return 'Workshop';\n case 'tri': return 'Installation';\n case 'tro': return 'Miscellaneous';\n case 'trm': return 'Concert';\n case 'trmS': return 'Sound Night';\n default: return '';\n }\n }",
"function get_name($substance)\r\n {\r\n $data = $this->get_data($substance->pubchem);\r\n\r\n if(!$data)\r\n {\r\n return false;\r\n }\r\n\r\n return $data->name;\r\n }",
"public function hasStudyAcronym() {\n return $this->_has(10);\n }",
"public function setTrial($var)\n {\n GPBUtil::checkString($var, True);\n $this->trial = $var;\n\n return $this;\n }",
"public function getName(): string {\n\t\treturn $this->lFactory->get('spreed')->t('Talk');\n\t}",
"public static function participantName(string $project, string $conversation, string $participant): string\n {\n return self::getPathTemplate('participant')->render([\n 'project' => $project,\n 'conversation' => $conversation,\n 'participant' => $participant,\n ]);\n }",
"public function hasStudyId() {\n return $this->_has(1);\n }",
"public function caseStudyID($value = null)\n \t{\n \t\tif ($value != null) $this->caseStudyID = $value;\n \t\telse return $this->caseStudyID;\n \t}",
"public function getName() {\n return $this->getTreatmentName();\n }",
"public function subtitle()\n {\n return $this->resource->getName();\n }",
"public function subject()\n {\n return $this->belongsTo(StudySubject::class, 'subject_id');\n }",
"public function getName()\r\n {\r\n return $this->vest() ? $this->vest()->prefix.$this->is_name.'『'.$this->vest()->tuan.$this->vest()->suffix.'』'.$this->vest()->remark : '';\r\n }"
] | [
"0.6801654",
"0.67929095",
"0.62360054",
"0.5846423",
"0.58127",
"0.56817496",
"0.55520034",
"0.5541691",
"0.54908645",
"0.5356461",
"0.5350699",
"0.52990466",
"0.5205343",
"0.5152842",
"0.5133147",
"0.5130118",
"0.50790954",
"0.50769526",
"0.50185114",
"0.4992704",
"0.48871762",
"0.48690242",
"0.48662072",
"0.48606122",
"0.48527884",
"0.48218647",
"0.47730416",
"0.4765997",
"0.47351173",
"0.47180712"
] | 0.68623024 | 0 |
The Trial name. Generated from protobuf field string trial = 3; | public function setTrial($var)
{
GPBUtil::checkString($var, True);
$this->trial = $var;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTrial()\n {\n return $this->trial;\n }",
"public function getTrial()\n {\n return $this->trial;\n }",
"public function setTrial($var)\n {\n GPBUtil::checkBool($var);\n $this->trial = $var;\n }",
"public function getTestName()\n {\n return $this->getField(5)[1];\n }",
"static public function get_name_string() {\n return get_string(self::NAME_CODE_STRING, 'gradereport_progress');\n }",
"public static function getTubeName();",
"public function getName(){\n return $this->game->get_current_turn()->ReturnName();\n }",
"public function getName(): string {\n\t\treturn $this->lFactory->get('spreed')->t('Talk');\n\t}",
"public static function participantName(string $project, string $conversation, string $participant): string\n {\n return self::getPathTemplate('participant')->render([\n 'project' => $project,\n 'conversation' => $conversation,\n 'participant' => $participant,\n ]);\n }",
"function track_name($tr) {\n switch ($tr) {\n case 'tr0': return 'Paper Presentation';\n case 'trp': return 'Poster Session';\n case 'trl': return 'Lightning Talk';\n case 'trw': return 'Workshop';\n case 'tri': return 'Installation';\n case 'tro': return 'Miscellaneous';\n case 'trm': return 'Concert';\n case 'trmS': return 'Sound Night';\n default: return '';\n }\n }",
"protected function getNewProjectName() {\n\t\tdo {\n\t\t\t$t_name = $this->getName() . '_' . rand();\n\t\t\t$t_id = $this->client->mc_project_get_id_from_name( $this->userName, $this->password, $t_name );\n\t\t} while( $t_id != 0 );\n\t\treturn $t_name;\n\t}",
"public function getName()\n {\n return \"The Proving Grounds\";\n }",
"public function message()\n {\n return 'Only 1 unique exercise name per user.';\n }",
"public function getName(): string\n {\n return $this->requireString('name');\n }",
"public function getParticipantLabel()\n\t{\n\t\treturn $this->getContext()->getParticipantLabel();\n\t}",
"public function getTskName()\n {\n return $this->tsk_name;\n }",
"public function getName()\n {\n \treturn \"payfort Check Status\";\n }",
"public function getName()\n {\n return 'simplethings_formextra_validation';\n }",
"protected function getTypeNameAttribute()\n {\n return trans('action_plan.goals.'.$this->type.'.label');\n }",
"public function getName(): string\n {\n return $this->fqsen->getName();\n }",
"public function getName()\n {\n return $this->str_name;\n }",
"public function get_name() : string\n {\n return $this->additional['name'] ?? '';\n }",
"public function getName()\r\n {\r\n return $this->vest() ? $this->vest()->prefix.$this->is_name.'『'.$this->vest()->tuan.$this->vest()->suffix.'』'.$this->vest()->remark : '';\r\n }",
"public static function participantName($project, $conversation, $participant)\n {\n return self::getParticipantNameTemplate()->render([\n 'project' => $project,\n 'conversation' => $conversation,\n 'participant' => $participant,\n ]);\n }",
"public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }",
"function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}",
"public function getName()\n \n {\n $letters = range('A', 'Z');\n $number = str_pad(rand(1, 999), 3, '0', STR_PAD_LEFT);\n $name = array_rand($letters, 2);\n $newName = $letters[$name[0]] . $letters[$name[1]] . $number;\n $usedNaes = array_unique(explode( \" \", $newName));\n $newName = array_unique($usedNaes);\n \n\n return (implode($newName));\n }",
"public function getNameTran(){\n $qwery = 'name_'.app()->getLocale();\n return $this->$qwery;\n }",
"public function getNameT()\n {\n return $this->name_t;\n }",
"public function getTrialSignupHostAndScheme(): string\n {\n return $this->getIntegrationSetup()->getTrialSignupHostAndScheme();\n }"
] | [
"0.6639841",
"0.6639841",
"0.6050458",
"0.5678793",
"0.5526156",
"0.54142904",
"0.53614044",
"0.5352728",
"0.5341378",
"0.532781",
"0.5312134",
"0.5179343",
"0.5170307",
"0.51256025",
"0.509686",
"0.50585043",
"0.5036341",
"0.50358063",
"0.50311935",
"0.5025439",
"0.5022599",
"0.5015472",
"0.50150985",
"0.5011198",
"0.5010554",
"0.49917504",
"0.49860337",
"0.49846134",
"0.49827743",
"0.49510872"
] | 0.69583505 | 0 |
Adds an array of events to the search index. | public function indexEvents(array $events, array $context = []): void; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_event(array $event) {\n if (empty($event['type']) or\n empty($event['name']) or\n empty($event['data'])) {\n return (false);\n }\n $this->__results[] =\n array('type' => $event['type'],\n 'name' => $event['name'],\n 'data' => $event['data']);\n return (true);\n }",
"public function addEvent($event){\n $this->events[]=$event;\n }",
"function theme_intranet_haarlem_search_events($options = array()){\n\t$defaults = array(\t'past_events' \t\t=> false,\n\t\t\t\t\t\t'count' \t\t\t=> false,\n\t\t\t\t\t\t'offset' \t\t\t=> 0,\n\t\t\t\t\t\t'limit'\t\t\t\t=> EVENT_MANAGER_SEARCH_LIST_LIMIT,\n\t\t\t\t\t\t'container_guid'\t=> null,\n\t\t\t\t\t\t'query'\t\t\t\t=> false,\n\t\t\t\t\t\t'meattending'\t\t=> false,\n\t\t\t\t\t\t'owning'\t\t\t=> false,\n\t\t\t\t\t\t'friendsattending' \t=> false,\n\t\t\t\t\t\t'region'\t\t\t=> null,\n\t\t\t\t\t\t'latitude'\t\t\t=> null,\n\t\t\t\t\t\t'longitude'\t\t\t=> null,\n\t\t\t\t\t\t'distance'\t\t\t=> null,\n\t\t\t\t\t\t'event_type'\t\t=> false,\n\t\t\t\t\t\t'past_events'\t\t=> false,\n\t\t\t\t\t\t'search_type'\t\t=> \"list\"\n\t\t\t\t\t\t\n\t);\n\t\n\t$options = array_merge($defaults, $options);\n\t\n\t$entities_options = array(\n\t\t'type' \t\t\t=> 'object',\n\t\t'subtype' \t\t=> 'event',\n\t\t'offset' \t\t=> $options['offset'],\n\t\t'limit' \t\t=> $options['limit'],\n\t\t'joins' => array(),\n\t\t'wheres' => array(),\n\t\t'order_by_metadata' => array(\"name\" => 'start_day', \"direction\" => 'ASC', \"as\" => \"integer\")\n\t);\n\t\n\tif (isset($options['entities_options'])) {\n\t\t$entities_options = array_merge($entities_options, $options['entities_options']);\n\t}\n\t\n\tif($options[\"container_guid\"]){\n\t\t// limit for a group\n\t\t$entities_options['container_guid'] = $options['container_guid'];\n\t}\n\t\n\tif($options['query']) {\n\t\t$entities_options[\"joins\"][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"objects_entity oe ON e.guid = oe.guid\";\n\t\t$entities_options['wheres'][] = event_manager_search_get_where_sql('oe', array('title', 'description'), $options, false);\n\t}\n\t\t\t\t\n\tif(!empty($options['start_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['start_day'], 'operand' => '>=');\n\t}\n\t\n\tif(!empty($options['end_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['end_day'], 'operand' => '<=');\n\t}\n\t\n\tif(!$options['past_events']) {\n\t\t// only show from current day or newer\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => mktime(0, 0, 1), 'operand' => '>=');\n\t}\n\t\n\tif($options['meattending']) {\n\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_r ON e.guid = e_r.guid_one\";\n\t\t\n\t\t$entities_options['wheres'][] = \"e_r.guid_two = \" . elgg_get_logged_in_user_guid();\n\t\t$entities_options['wheres'][] = \"e_r.relationship = '\" . EVENT_MANAGER_RELATION_ATTENDING . \"'\";\n\t}\n\t\n\tif($options['owning']) {\n\t\t$entities_options['owner_guids'] = array(elgg_get_logged_in_user_guid());\n\t}\n\t\n\tif($options[\"region\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'region', 'value' => $options[\"region\"]);\n\t}\n\t\n\tif($options[\"event_type\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'event_type', 'value' => $options[\"event_type\"]);\n\t}\n\t\n\tif($options['friendsattending']){\n\t\t$friends_guids = array();\n\t\t\n\t\tif($friends = elgg_get_logged_in_user_entity()->getFriends(\"\", false)) {\n\t\t\tforeach($friends as $user) {\n\t\t\t\t$friends_guids[] = $user->getGUID();\n\t\t\t}\n\t\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_ra ON e.guid = e_ra.guid_one\";\n\t\t\t$entities_options['wheres'][] = \"(e_ra.guid_two IN (\" . implode(\", \", $friends_guids) . \"))\";\n\t\t} else\t{\n\t\t\t// return no result\n\t\t\t$entities_options['joins'] = array();\n\t\t\t$entities_options['wheres'] = array(\"(1=0)\");\n\t\t}\n\t}\n\t\n\tif(($options[\"search_type\"] == \"onthemap\") && !empty($options['latitude']) && !empty($options['longitude']) && !empty($options['distance'])){\n\t\t$entities_options[\"latitude\"] = $options['latitude'];\n\t\t$entities_options[\"longitude\"] = $options['longitude'];\n\t\t$entities_options[\"distance\"] = $options['distance'];\n\t\t$entities = elgg_get_entities_from_location($entities_options);\n\t\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_location($entities_options);\n\t\t\n\t} else {\n\t\t\n\t\t$entities = elgg_get_entities_from_metadata($entities_options);\n\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_metadata($entities_options);\n\t}\n\t\n\t$result = array(\n\t\t\"entities\" \t=> $entities,\n\t\t\"count\" \t=> $count_entities\n\t\t);\n\t\t\n\treturn $result;\n}",
"protected function _registerEvent(Mage_Index_Model_Event $event)\n {\n $event->addNewData(self::EVENT_MATCH_RESULT_KEY, TRUE);\n switch ($event->getEntity()) {\n case Mage_Catalog_Model_Product::ENTITY:\n $this->_registerCatalogProductEvent($event);\n break;\n case Mage_Catalog_Model_Category::ENTITY:\n $this->_registerCatalogCategoryEvent($event);\n break;\n case Mage_Catalog_Model_Convert_Adapter_Product::ENTITY:\n $event->addNewData('algoliasearch_reindex_all', TRUE);\n break;\n case Mage_Core_Model_Config_Data::ENTITY:\n $stores = TRUE;\n if ($event->getDataObject()->getScope() == 'stores') {\n $stores = array($event->getDataObject()->getScopeId());\n } else if ($event->getDataObject()->getScope() == 'websites') {\n $stores = Mage::app()->getWebsite($event->getDataObject()->getScopeId())->getStoreIds();\n }\n if (in_array($event->getDataObject()->getPath(), $this->_relatedConfigSettingsUpdate)) {\n $event->addNewData('algoliasearch_update_settings', $stores);\n } else if (in_array($event->getDataObject()->getPath(), $this->_relatedConfigSettingsReindex)) {\n $event->addNewData('algoliasearch_reindex_all', $stores);\n }\n break;\n case Mage_Core_Model_Store::ENTITY:\n case Mage_Catalog_Model_Resource_Eav_Attribute::ENTITY:\n case Mage_Core_Model_Store_Group::ENTITY:\n $event->addNewData('algoliasearch_reindex_all', TRUE);\n break;\n }\n }",
"private function add_events()\r\n {\r\n $events = $this->events;\r\n foreach ($events as $time => $items)\r\n {\r\n $column = date('H', $time) / $this->hour_step + 1;\r\n foreach ($items as $item)\r\n {\r\n $content = $item['content'];\r\n $row = $item['index'] + 1;\r\n \r\n $cell_content = $this->getCellContents($row, $column);\r\n $cell_content .= $content;\r\n $this->setCellContents($row, $column, $cell_content);\r\n }\r\n }\r\n \r\n }",
"public function register(SearchEvent $event)\n {\n $this->searchEvent = $event;\n $event->addModule($this, static::$elasticType);\n }",
"public function indexAction() {\n\t\t// TODO Auto-generated IndexController::indexAction() default action\n\t\t\n\t\t\n\t\t$data = $this->table->fetchAllEvents($paginated = true, $page = $this->_request->page, $countPerPage = 3, $asArray = false);\n\t\t$this->view->data = $data;\n\t\t\n\t\t$this->view->form = new Events_Form_Search();\n\t}",
"function add_eventoni_to_search()\n{\n\tif(is_search())\n\t{\n\t\t$results = eventoni_fetch('&wt='.urlencode(get_search_query()));\n\t\tif( $results['total'] <= 0 )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\techo '<div class=\"events-container\">';\n\t\techo '<img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/logo.png\" />';\n\t\t$counter = 0;\n\t\tforeach($results['xml'] as $event)\n\t\t{\n\t\t\t$counter++;\n\t\t\t$datetime = strtotime($event->start_date.' '.$event->start_time);\n\t\t\t$hours = getdate($datetime);\n\t\t\t$hour = $hours['hours'];\n\t\t\t$tageszeit = '';\n\t\t\tif( $hour < 6 ){\n\t\t\t\t$tageszeit = 'nachts';\n\t\t\t} else if( $hour < 12 ){\n\t\t\t\t$tageszeit = 'morgens';\n\t\t\t} else if( $hour < 14 ){\n\t\t\t\t$tageszeit = 'mittags';\n\t\t\t} else if( $hour < 18 ){\n\t\t\t\t$tageszeit = 'nachmittags';\n\t\t\t} else if( $hour < 22 ){\n\t\t\t\t$tageszeit = 'abends';\n\t\t\t} else {\n\t\t\t\t$tageszeit = 'nachts';\n\t\t\t}\n\t\t\techo ' <div class=\"event-item\">';\n\t\t\techo '<a class=\"event-item-link\" href=\"'.$event->permalink.'\">';\n\t\t\tif(isset($event->media_list->media->thumbnail_url)) {\n\t\t\t\techo '<img width=\"60px\" height\"60px\" align=\"left\" src=\"'.$event->media_list->media->thumbnail_url.'\"/>';\n\t\t\t} else {\n\t\t\t\techo '<img width=\"60px\" height\"60px\" align=\"left\" src=\"http://static.eventoni.com/images/image-blank.png\"/>';\n\t\t\t}\n\t\t\techo '</a>';\n\t\t\techo '\t <div class=\"event-item-content\">';\n\t\t\techo '\t\t<div class=\"event-item-content-date\">'.date( \"d.m.Y\", $datetime ).', '.date( \"H:i \\U\\h\\\\r\", $datetime ).'</div>';\n\t\t\techo '\t\t<div class=\"event-item-content-city\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/my_location.png\"/> '.$event->location->city.'</div>';\n\t\t\techo '\t </div>';\n\t\t\techo '\t <div class=\"event-item-content-name\"><b><a class=\"event-item-link\" href=\"'.$event->permalink.'\">'.$event->title.'</a></b></div>';\n\t\t\techo '\t <div style=\"float:right;\"><a class=\"facebook_link\" href=\"http://www.facebook.com/sharer.php?u='.$event->permalink.'&t=Dieses Event musst Du gesehen haben: \" target=\"_blank\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/facebook.png\" /></a></div>';\n\t\t\techo '\t <div style=\"float:right;\"><a class=\"twitter_link\" href=\"http://twitter.com/home?status=Dieses Event musst Du gesehen haben: '.$event->permalink.'\" target=\"_blank\"><img src=\"'.get_bloginfo('wpurl').'/wp-content/plugins/eventoni-events/img/twitter.png\" /></a></div>';\n\t\t\techo ' </div>';\n\t\t\tif( $counter >= 3 ){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\techo '</div>';\n\t}\n}",
"public function searchEvents(Message $request, ParsedQuery $parsedQuery, Message $response, array $curies = [], array $context = []): void;",
"public function setEvents(array $events)\n\t{\n\t\t$this->events = $events;\n\t}",
"public function setEvents(array $events)\n {\n $this->events = $events;\n return $this;\n }",
"public function setEvents(array $events)\n {\n $this->events = $events;\n return $this;\n }",
"public function setEvents(array $events) {\n $this->_events = $events;\n return $this;\n }",
"public function actionIndex()\n {\n Yii::$app->cache->gc(true);\n $searchModel = new EventSearchForm();\n\n $query = Event::find()->where(['>=', 'UNIX_TIMESTAMP(end_date)', time()]);\n\n $query = $query->joinWith('user');\n\n $pagination = new Pagination([\n 'defaultPageSize' => 10,\n 'totalCount' => $query->count(),\n ]);\n\n $goa = new GoaBaseApi();\n\n if (Yii::$app->cache->get('goabase') == NULL) { //if not in cache load from api\n //list of goa parties, Type: ArrayList with Events\n $goaParties = $goa->getParties();\n Yii::$app->cache->set('goabase', $goaParties, 300);\n } else { //load from cache\n $goaParties = Yii::$app->cache->get('goabase');\n }\n // Event List ordered by date\n $eventList = $query->orderBy('start_date')->all();\n\n // Daten für die Autovervollständiung\n foreach($eventList as $eventName)\n array_push($searchModel->eventNameList, $eventName->name);\n\n //-----Add GoaParties to eventList--------\n $goaId = $query->count();\n\n //append goaparties to eventList (intern parties)\n for ($i=0 ; $i < count($goaParties) ; $i++) {\n $eventList[$goaId] = $goaParties[$i];\n ++$goaId;\n }\n\n // Sort Event List\n $eventList = $this->sortEventList($eventList);\n\n // Top Events\n $topList = $query->orderBy(['clicks' => SORT_DESC])->limit(3)->all();\n\n // New Events\n $newList = $query->orderBy(['creation_date' => SORT_DESC])->limit(3)->all();\n\n return $this->render('index', ['searchModel' => $searchModel,\n 'eventList' => $eventList,\n 'pagination' => $pagination, 'topList' => $topList, 'newList' => $newList]);\n }",
"public function addInstructorsToEvents(array $events);",
"public function searchEventLogs($request)\n {\n return $this->start()->uri(\"/api/system/event-log/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"public function indexSolrDocs(){\n\t\t$solrDocArray = $this->solrDocArray;\n\t\tif(is_array($solrDocArray)){\n\t\t\t$solr = new Apache_Solr_Service('localhost', 8983, '/solr');\n\t\t\t\n\t\t\tif ($solr->ping()) { // if we can ping the solr server...\n\t\t\t\ttry{\n\t\t\t\t\t$updateResponse = $solr->addDocuments($solrDocArray);\n\t\t\t\t\t$solr->commit();\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t$errors = $this->errors;\n\t\t\t\t\t$errors[] = $e->getMessage(); \n\t\t\t\t\t$this->errors = $errors;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t$errors = $this->errors;\n\t\t\t$errors[] = $this->errors = \"Solr Down: failed to respond to ping.\"; \n\t\t\t$this->errors = $errors;\n\t\t\t}\n\t\t\t\n\t\t}//yes, we do have docs to add\n\t\t\n }",
"public function run()\n {\n $events = [\n [\n \"Bitcorn Harvest #3\",\n \"2,625,000 Bitcorn - What a lovely day in Autumn it will be!\",\n \"https://bitcorn.org/storage/events/fNg2Fz6NmAPe2JCr7f15ikr3ADJJsozGny0moJqC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2018-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #4\",\n \"2,625,000 Bitcorn - Last harvest at this level. Halvening soon!\",\n \"https://bitcorn.org/storage/events/EGcAKsTaubN9nFqsCTUQOvSuSQPDAvt4vC4VkuOF.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #5\",\n \"1,312,500 Bitcorn - Harvesting has become back breaking work...\",\n \"https://bitcorn.org/storage/events/Wjmuakz7IvVHce4jBUbvIviG4ObTqWv4sR6TfN6Q.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #6\",\n \"1,312,500 Bitcorn - Remember 2018? Pepperidge Farms remembers...\",\n \"https://bitcorn.org/storage/events/ABZtytBwKBj0YvmqcvORZ9iZsIe9MUSuTXWd6CKC.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #7\",\n \"1,312,500 Bitcorn - Spooktacular harvest everyone! See you soon in 2020...\",\n \"https://bitcorn.org/storage/events/a9JmkLquKviuAC7emrkfe9IY0PUtZuVeu0Uzycld.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2019-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #8\",\n \"1,312,500 Bitcorn - BURRRR... I thought the future would be warmer!\",\n \"https://bitcorn.org/storage/events/14xL5Ta2roxBRtFi0uis9Qzzy3gHsktnx56lzk3o.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #9\",\n \"787,500 Bitcorn - Ooph! Someone check the BITCORNSILO we're running low!?\",\n \"https://bitcorn.org/storage/events/uAJ2L3c6azRYyTyI5FANZj4Nl4JiTrGmGrx8QRZo.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-04-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #10\",\n \"787,500 Bitcorn - If this keeps up we're going to run out of corn!\",\n \"https://bitcorn.org/storage/events/ksxx5ho2VLUYtZZjTbhmvB0ufYbnWVMnVI2VULrI.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #11\",\n \"787,500 Bitcorn - Autumn corn tastes better with 11 herbs and spices.\",\n \"https://bitcorn.org/storage/events/ka3t2sCKOMCmWQMgd891dXxd83Ket5If8tpJF6fN.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2020-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #12\",\n \"787,500 Bitcorn - Final halvening is now on the horizon. This is fine...\",\n \"https://bitcorn.org/storage/events/3wRU6wNaUqVP6proNvYwqAMVL70cPSyn0w34rN1n.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-01-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #13\",\n \"525,000 Bitcorn - It's a good thing that my coop is alpha... #SQUADGOALS\",\n \"https://bitcorn.org/storage/events/eh3evSat3inAoQ4dSRnba0ffUoIVR8Au24xwY4Cj.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-04-10 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #14\",\n \"525,000 Bitcorn - Extreme heat and over-farming is taking its toll...\",\n \"https://bitcorn.org/storage/events/qgGOigYkbkjOMR5kGVpytXZGE0blXddsHd18wIV5.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-07-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #15\",\n \"525,000 Bitcorn - Denial begins to set in about who will win #BRAGGING rights.\",\n \"https://bitcorn.org/storage/events/7CyP2gfcWq1Lr37IxLnD2xEQAN5Jv9VjmyPtViVa.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2021-10-01 00:00:00\"\n ],\n [\n \"Bitcorn Harvest #16\",\n \"525,000 Bitcorn - The roots of all BITCORN CROPS are tapped dry. Sad!\",\n \"https://bitcorn.org/storage/events/knIRPINIE4RZyr0DEIx46q5y5nvyaEZNgX6rPkf0.jpeg\",\n \"https://bitcorns.com/almanac\",\n \"2022-01-01 00:00:00\"\n ]\n ];\n\n foreach($events as $event)\n {\n Event::create([\n 'name' => $event[0],\n 'description' => $event[1],\n 'image_url' => $event[2],\n 'event_url' => $event[3],\n 'scheduled_at' => $event[4],\n ]);\n }\n }",
"public function get_events($args = [])\n {\n global $db, $system;\n /* initialize arguments */\n $user_id = !isset($args['user_id']) ? null : $args['user_id'];\n $offset = !isset($args['offset']) ? 0 : $args['offset'];\n $get_all = !isset($args['get_all']) ? false : true;\n $suggested = !isset($args['suggested']) ? false : true;\n $random = !isset($args['random']) ? false : true;\n $managed = !isset($args['managed']) ? false : true;\n $filter = !isset($args['filter']) ? \"admin\" : $args['filter'];\n $results = !isset($args['results']) ? $system['max_results_even'] : $args['results'];\n /* initialize vars */\n $events = [];\n $offset *= $results;\n /* get suggested events */\n if ($suggested) {\n $where_statement = \"\";\n /* make a list from joined events */\n $events_ids = $this->get_events_ids();\n if ($events_ids) {\n $events_list = implode(',', $events_ids);\n $where_statement .= \"AND event_id NOT IN (\" . $events_list . \") \";\n }\n $sort_statement = ($random) ? \" ORDER BY RAND() \" : \" ORDER BY event_id DESC \";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_events = $db->query(\"SELECT * FROM `events` WHERE event_privacy != 'secret' \" . $where_statement . $sort_statement . $limit_statement) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"taget\" all events who admin */\n } elseif ($managed) {\n $get_events = $db->query(sprintf(\"SELECT * FROM `events` WHERE event_admin = %s ORDER BY event_id DESC\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n /* get the \"viewer\" events who (going|interested|invited|admin) */\n } elseif ($user_id == null) {\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n switch ($filter) {\n case 'going':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_going = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'interested':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_interested = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n case 'invited':\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE events_members.is_invited = '1' AND events_members.user_id = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n\n default:\n $get_events = $db->query(sprintf(\"SELECT * FROM `events` WHERE event_admin = %s ORDER BY event_id DESC \" . $limit_statement, secure($this->_data['user_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n break;\n }\n /* get the \"target\" events */\n } else {\n /* get the target user's privacy */\n $get_privacy = $db->query(sprintf(\"SELECT user_privacy_events FROM users WHERE user_id = %s\", secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n $privacy = $get_privacy->fetch_assoc();\n /* check the target user's privacy */\n if (!$this->check_privacy($privacy['user_privacy_events'], $user_id)) {\n return $events;\n }\n /* if the viewer not the target exclude secret groups */\n $where_statement = ($this->_data['user_id'] == $user_id) ? \"\" : \"AND `events`.event_privacy != 'secret'\";\n $limit_statement = ($get_all) ? \"\" : sprintf(\"LIMIT %s, %s\", secure($offset, 'int', false), secure($results, 'int', false));\n $get_events = $db->query(sprintf(\"SELECT `events`.* FROM `events` INNER JOIN events_members ON `events`.event_id = events_members.event_id WHERE (events_members.is_going = '1' OR events_members.is_interested = '1') AND events_members.user_id = %s \" . $where_statement . \" ORDER BY event_id DESC \" . $limit_statement, secure($user_id, 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n }\n if ($get_events->num_rows > 0) {\n while ($event = $get_events->fetch_assoc()) {\n $event['event_picture'] = get_picture($event['event_cover'], 'event');\n /* check if the viewer joined the event */\n $event['i_joined'] = $this->check_event_membership($this->_data['user_id'], $event['event_id']);;\n $events[] = $event;\n }\n }\n return $events;\n }",
"public function add(array $entry);",
"public function addCriteria(array $criteria);",
"protected function addIndex()\n {\n $sitemapIndexHeader = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n . ($this->includeGeneratorInfo ? $this::$generatorInfo : '')\n . '<sitemapindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"'\n . ' xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9'\n . ' http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd\"'\n . ' xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">'\n . '</sitemapindex>';\n $this->indexes[] = [\n 'xml' => new \\SimpleXMLElement($sitemapIndexHeader),\n 'filename' => '',\n ];\n }",
"public function listAction()\r\n\t{\r\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\r\n\t\t$this -> view -> business = $business = Engine_Api::_() -> core() -> getSubject();\r\n\t\t$this -> view -> form = $form = new Ynbusinesspages_Form_Event_Search;\r\n\t\t$val = $this -> _getAllParams();\r\n\t\t// Populate form data\r\n\t\tif (!$form -> isValid($val))\r\n\t\t{\r\n\t\t\t$form -> populate($defaultValues);\r\n\t\t\t$this -> view -> formValues = $values = array();\r\n\t\t\t$this -> view -> message = \"The search value is not valid !\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$values = $form -> getValues();\r\n\t\t$values['business_id'] = $business -> getIdentity();\r\n\t\t// Prepare data\r\n\t\t$this -> view -> formValues = $values = array_merge($values, $_GET);\r\n\t\t\r\n\t\t// Check create event authorization\r\n\t\t$this -> view -> canCreate = $business -> isAllowed('event_create');\r\n\t\t//Get data\r\n\t\t$this -> view -> paginator = $paginator = Engine_Api::_()->getDbTable('mappings', 'ynbusinesspages') -> getEventsPaginator($values);\r\n\t\t$paginator -> setCurrentPageNumber($this -> _getParam('page'));\r\n\t}",
"public function addSearchIndex($key, SearchIndex $value)\n {\n return parent::add($key, $value);\n }",
"public function getEvents(array $filters = array());",
"public function add($sportevents)\n {\n $count = 0;\n\n $sportevents = Collection::wrap($sportevents)->map(function ($sportevent) use (&$count) {\n $sportevent = $sportevent instanceof Closure ? CallQueuedClosure::create($sportevent) : $sportevent;\n\n if (is_array($sportevent)) {\n $count += count($sportevent);\n\n return with($this->prepareBatchedChain($sportevent), function ($chain) {\n return $chain->first()->chain($chain->slice(1)->values()->all());\n });\n } else {\n $sportevent->withBatchId($this->id);\n\n $count++;\n }\n\n return $sportevent;\n });\n\n $this->repository->transaction(function () use ($sportevents, $count) {\n $this->repository->incrementTotalsportevents($this->id, $count);\n\n $this->queue->connection($this->options['connection'] ?? null)->bulk(\n $sportevents->all(),\n $data = '',\n $this->options['queue'] ?? null\n );\n });\n\n return $this->fresh();\n }",
"private function installActions()\n {\n $actions = array(\n array(\n 'class' => RETS_RABBIT_V2_NAME,\n 'method' => 'run_search'\n ),\n );\n\n ee()->db->insert_batch('actions', $actions);\n }",
"function addEvent($event) {\n Event::addEvent($event);\n }",
"public function AddEventHandler(&$array, $evt, $code)\n {\n if(isset($array[$evt]))\n $array[$evt] .= ';' . $code;\n else\n $array[$evt] = $code;\n }",
"public function index() {\n\t\tSearch::index($this->table)->insert(\n\t\t\t$this['slug'],\n\t\t\t[\n\t\t\t\t'title'\t\t=> $this['title'],\n\t\t\t\t'text'\t\t=> $this['text'],\n\t\t\t\t'category'\t=> $this->category->name,\n\t\t\t],\n\t\t\t[\n\t\t\t\t'_type'\t\t=> $this->table,\n\t\t\t]\n\t\t);\n\t}"
] | [
"0.6150777",
"0.5819724",
"0.56906074",
"0.5678503",
"0.56622005",
"0.5488365",
"0.5414868",
"0.5350852",
"0.53371793",
"0.52402157",
"0.5176392",
"0.5176392",
"0.51722205",
"0.51677614",
"0.51594925",
"0.51197886",
"0.5102104",
"0.5085425",
"0.5073141",
"0.506427",
"0.50496644",
"0.5033039",
"0.5009517",
"0.50078434",
"0.5001113",
"0.49916083",
"0.4973717",
"0.49644884",
"0.49449292",
"0.49415436"
] | 0.599336 | 1 |
Deletes an array events by their identifiers (the "event_id" field on the event). | public function deleteEvents(array $eventIds, array $context = []): void; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete(array $ids);",
"function deleteItems($itemids) {\r\n $event = new mosEventCal_Event();\r\n\tforeach($itemids AS $itemid) {\r\n\t $event->delete($itemid);\t\r\n\t}\r\n}",
"public function delete(array $ids)\n {\n\n }",
"public function delete($ids){\n \n $filter = $this->primaryFilter; \n $ids = ! is_array($ids) ? array($ids) : $ids;\n \n foreach ($ids as $id) {\n $id = $filter($id);\n if ($id) {\n $this->db->where($this->primary_key, $id)->limit(1)->delete($this->table_name);\n }\n }\n }",
"public function massDeleteAction()\r\n\t{\r\n\t\tif($eventIds = $this->getRequest()->getParam('event_ids')){\r\n\t\t\ttry{\r\n\t\t\t\tforeach ($eventIds as $eventId) {\r\n\t\t\t\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\t\t\t\t\t$eventModel->delete();\r\n\t\t\t\t}\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your events(%d) have been deleted\", count($eventIds)));\r\n\t\t\t} catch(Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t}\r\n\t\t} else{\r\n\t\t\tMage::getSingleton('adminhtml/session')->addError('select some events');\r\n\t\t}\r\n\t\t$this->_redirect('*/*/index');\r\n\t}",
"public function deleteFoodsFromEvent($event, $data){\r\n $rowsSQL = array();\r\n\r\n $toBind = array();\r\n\r\n foreach($data as $arrayIndex => $row){\r\n $params = array();\r\n foreach($row as $columnName => $columnValue){\r\n $param = \":\" . $columnName . $arrayIndex;\r\n $params[] = $param;\r\n $toBind[$param] = $columnValue;\r\n }\r\n $rowsSQL[] = \"(\" . implode(\", \", $params) . \")\";\r\n }\r\n\r\n $sql = \"DELETE FROM `food_event` WHERE `event` =\". $event .\" AND food IN (\" . implode(\", \", $rowsSQL) . \")\";\r\n\r\n $stmt = $this->db->prepare($sql);\r\n //Bind our values.\r\n foreach($toBind as $param => $val){\r\n $stmt->bindValue($param, $val);\r\n }\r\n //Execute our statement (i.e. insert the data).\r\n $stmt->execute();\r\n }",
"public function deleteEvents($events)\n {\n $data = array (\n 'token' => $this->apiToken,\n 'content' => 'event',\n 'action' => 'delete',\n 'returnFormat' => 'json',\n );\n \n $data['events'] = $this->processEventsArgument($events, $required = true);\n \n $result = $this->connection->callWithArray($data);\n \n $this->processNonExportResult($result);\n \n return (integer) $result;\n }",
"public function undelete(array $ids);",
"public function deleteAllEvent($event_id)\r\r\n {\r\r\n $where = $this->getAdapter()->quoteInto('event_id = ?', $event_id);\r\r\n $this->delete($where);\r\r\n }",
"public function remove($ids);",
"function deleteIds ($ids) {\r\n $this->delete($this->tableName, $this->_id . ' in (' . implode(',', $ids) . ')');\r\n }",
"public function massDestroy(Request $request)\n {\n if (! Gate::allows('event_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Event::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }",
"public function __deleteEvents() {\n $_deleteEventCodes_ = array(\n 'wk_pa_add_column_menu',\n 'wk_pa_addJs_product',\n 'wk_pa_product_model_delete',\n 'wk_pricealert_account_view',\n 'wk_pricealert_header',\n 'wk_pricealert_addJs_add',\n 'wk_pricealert_addJs_edit',\n 'wk_pa_product_model_update',\n 'wk_pa_product_model_add',\n );\n\n foreach ($_deleteEventCodes_ as $_DE_code) {\n $this->helper_event->deleteEventByCode($_DE_code);\n }\n }",
"public function delete(){\r\n $id=$_POST['del_row'];\r\n $id=implode(',',$id);\r\n $this->Events_Model->delete($this->table,$id);\r\n}",
"public function deleteItems(array $keys);",
"function attendance_delete_calendar_events($sessionsids) {\n global $DB;\n $caleventsids = attendance_existing_calendar_events_ids($sessionsids);\n if ($caleventsids) {\n $DB->delete_records_list('event', 'id', $caleventsids);\n }\n\n $sessions = $DB->get_recordset_list('attendance_sessions', 'id', $sessionsids);\n foreach ($sessions as $session) {\n $session->caleventid = 0;\n $DB->update_record('attendance_sessions', $session);\n }\n}",
"public function deleteByFileIds()\n\t{\n\t\tif ( isset( \\IPS\\Request::i()->fileIds ) )\n\t\t{\n\t\t\t$ids = \\IPS\\Request::i()->fileIds;\n\t\t\t\n\t\t\tif ( ! \\is_array( $ids ) )\n\t\t\t{\n\t\t\t\t$try = json_decode( $ids, TRUE );\n\t\t\t\t\n\t\t\t\tif ( ! \\is_array( $try ) )\n\t\t\t\t{\n\t\t\t\t\t$ids = array( $ids );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ids = $try;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( \\count( $ids ) )\n\t\t\t{\n\t\t\t\t\\IPS\\cms\\Media::deleteByFileIds( $ids );\n\t\t\t}\n\t\t}\n\t}",
"public function deleteByIds(array $ids)\n {\n try {\n $data = $this->model->whereIn('id', $ids)->delete();\n \n if ($data) {\n return [\n 'message' => 'Data is deleted successfully',\n 'payload' => $data,\n 'status' => CoreConstants::STATUS_CODE_SUCCESS\n ];\n } else {\n return [\n 'message' => 'Nothing to Delete',\n 'payload' => null,\n 'status' => CoreConstants::STATUS_CODE_ERROR\n ];\n }\n } catch (\\Throwable $th) {\n Log::error($th->getMessage());\n return [\n 'message' => 'Something went wrong',\n 'payload' => $th->getMessage(),\n 'status' => CoreConstants::STATUS_CODE_ERROR\n ];\n }\n }",
"public function bulk_delete(Request $request){\n $this->isAuthorize();\n\n // Delete the Data\n $userID = $this->request->session()->get('userID');\n $ids = $request->ids;\n DB::table(\"apt_time_slots\")->where('userID','=',$userID)->whereIn('id',explode(\",\",$ids))->delete();\n return response()->json(['success'=>\"Deleted successfully.\"]);\n }",
"public function destroySelected(Request $request)\n {\n foreach ($request->ids as $id) {\n // find that record\n $event = EventBackend::find($id);\n\n // delete english images or files\n\n // delete arabic images or files\n\n if (count($event->media) > 0) {\n $event->media()->delete(); // delete english & arabic youtube links\n }\n\n if (count($event->hashtags) > 0) {\n $event->hashtags()->detach(); // delete hashtags\n }\n\n if (count($event->categories) > 0) {\n $event->categories()->detach(); // delete categories\n }\n\n $event->delete(); // delete events\n }\n\n if (\\Lang::getLocale() == 'en') {\n Session::flash('success', 'Event deleted successfully!');\n } else {\n Session::flash('success', ' تم مسح الحدث بنجاح');\n }\n\n return response()->json(['success', 'event deleted!']);\n }",
"protected function entityDeleteMultiple($ids) {\n waywire_video_delete_multiple($ids);\n }",
"public function deleteMultipleById(array $ids) : int\n {\n }",
"public function deleteMany($ids)\n {\n $placeholders = array_fill(0, count($ids), \"?\");\n $placeholders = implode(\", \", $placeholders);\n\n $sql = \"DELETE FROM `%s` WHERE `%s` IN (%s)\";\n $this->_sql[] = sprintf($sql, $this->_table, $this->_key, $placeholders);\n $parameters = array();\n foreach ($ids as $id) {\n $parameters[] = array($this->_key => $id);\n }\n $this->_parameters[] = $this->parameterize($parameters);\n return $this->run();\n }",
"public function deleteChked(Request $request)\n {\n $ids=$request->allids;\n $users=User::find($ids);\n foreach($users as $user)\n {\n $user->events()->where('user_id', $user->id)->detach();\n\n }\n\n }",
"public function deleteLineItems(array $ids);",
"function delete_events($event_id) {\n\tglobal $cxn;\n\n\t$errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"DELETE FROM events\n\t\t\t\tWHERE eID = ?\";\n\t\t\t\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\n\t\t$stmt->bind_param(\"i\", $event_id);\n\t\t$stmt->execute();\n\t\t\n\t\t// Check and delete users from this event\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error deleting events , event id: \" . $event_id;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\tif ($errArr[ERR_AFFECTED_ROWS]==0) { \n\t $errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t}\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn $errArr;\n}",
"public function deleteUserNotificationByIds(array $ids);",
"function delete_list( $ids = array()) {\n \t\t\n \t\t// where clause\n\t\t$this->db->where_in( $this->primary_key, $id );\n\n\t\t// delete the record\n\t\treturn $this->db->delete( $this->table_name );\n \t}",
"public function deleteEvent($id) {\r\n$array = array('event_id' => $id);\r\n$success = $this->db->delete('events', $array);\r\nreturn $success;\r\n}",
"public function deleteItems(array $keys)\n {\n }"
] | [
"0.7017683",
"0.69400126",
"0.677669",
"0.6579054",
"0.6548128",
"0.65366983",
"0.64679104",
"0.6464421",
"0.64289457",
"0.63672334",
"0.6338343",
"0.62950206",
"0.61640596",
"0.61266243",
"0.60348094",
"0.602979",
"0.6000051",
"0.59990793",
"0.59835464",
"0.5943345",
"0.5921986",
"0.58847386",
"0.5867438",
"0.58662695",
"0.58634514",
"0.58633995",
"0.5854368",
"0.584552",
"0.5813635",
"0.5811524"
] | 0.705966 | 0 |
Executes a search request and populates the provided response object with the events found, total, time_taken, etc. | public function searchEvents(Message $request, ParsedQuery $parsedQuery, Message $response, array $curies = [], array $context = []): void; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function run($request) {\n\n\t\t$ef = new EventApi;\n\n\t\t$query_attributes = array(\n\t\t\t'category' => 6, \n\t\t\t'location' => 363,\n\t\t\t'modified_since' => date('Y-m-d h:i:s', strtotime('-30 days')),\n\t\t\t'created_since' => date('Y-m-d h:i:s', strtotime('-30 days'))\n\t\t\t); \n\n\t\t$results = $ef->get_dataset($query_attributes); \n\n\t\techo count($results) . ' results returned'; \n\n\t\tforeach ($results as $result) {\n\t\t\techo '<p>' . $result['name'] . ' / ' . $result['location_summary'] . '</p>';\n\t\t}\n\n\t}",
"public function search($request, $response)\n {\n }",
"public function search($request) {\n // Prepare Google search request parameters\n $query = urlencode(\"{$_SERVER['HTTP_HOST']} {$_GET['q']}\");\n $offset = isset($_GET['start']) ? (int)$_GET['start'] : '0';\n $response = file_get_contents(sprintf(self::GOOGLE_SEARCH_URL, $query, $offset));\n \n // Decode JSON response and prepare view content\n $response = json_decode($response);\n $searchResults = $pages = array();\n\n // Build list of search results\n foreach($response->responseData->results as $result)\n $searchResults[] = sprintf(self::SEARCH_RESULT, $result->unescapedUrl, $result->titleNoFormatting, $result->titleNoFormatting, $result->content);\n\n // Prepare pagination options\n $resultsCount = isset($response->responseData->cursor->estimatedResultCount) ? $response->responseData->cursor->estimatedResultCount : 0;\n $currentPageIndex = $response->responseData->cursor->currentPageIndex;\n\n if($resultsCount) {\n // Previous pagination option\n if($currentPageIndex > 0) {\n $page = $response->responseData->cursor->pages[$currentPageIndex - 1];\n $url = sprintf(self::SITE_SEARCH_URL, urlencode($_GET['q']), $page->start);\n $pages[] = sprintf(self::PAGINATION_LINK, $url, '<< Previous', '<< Previous');\n\n } else {\n $pages[] = sprintf(self::PAGINATION_ACTIVE, '<< Previous');\n }\n\n // Page pagination option\n foreach($response->responseData->cursor->pages as $index => $page) {\n if($currentPageIndex == $index) {\n $pages[] = sprintf(self::PAGINATION_ACTIVE, $page->label);\n\n } else {\n $url = sprintf(self::SITE_SEARCH_URL, urlencode($_GET['q']), $page->start);\n $pages[] = sprintf(self::PAGINATION_LINK, $url, $page->label, $page->label);\n }\n }\n\n // Next pagination option\n if($currentPageIndex < 7 && count($response->responseData->cursor->pages) > 1) {\n $page = $response->responseData->cursor->pages[$currentPageIndex + 1];\n $url = sprintf(self::SITE_SEARCH_URL, urlencode($_GET['q']), $page->start);\n $pages[] = sprintf(self::PAGINATION_LINK, $url, 'Next >>', 'Next >>');\n\n } else {\n $pages[] = sprintf(self::PAGINATION_ACTIVE, 'Next >>');\n }\n }\n\n return $this->customise(array(\n 'Title' => 'Search Results',\n 'SearchQuery' => Convert::raw2xml($_GET['q']),\n 'ResultsCount' => $resultsCount,\n 'MoreResultsUrl' => $response->responseData->cursor->moreResultsUrl,\n 'SearchResults' => implode(\"\\r\\n\", $searchResults),\n 'Pagination' => implode(\"\\r\\n\", $pages),\n ))->renderWith(array('SearchPage', 'Page'));\n }",
"public function searchEventLogs($request)\n {\n return $this->start()->uri(\"/api/system/event-log/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"function ap_search_results($data){\n $args = array(\n 'post_status'=>'publish',\n 'post_type'=> array('post', 'page'),\n 's' => sanitize_text_field($data['term'])\n);\n\t$main_query = new \\WP_Query($args);\n\t$event_query = tribe_get_events(array(\n\t\t\t\t\t'start_date' => date( 'Y-m-d H:i:s' ),\n\t\t\t\t\t's' => sanitize_text_field($data['term']),\n\n\t));\n\n\t $results = array(\n\t\t'pages' => array(),\n\t\t'posts' => array(),\n\t\t'events' => array()\n\t );\n\n\tforeach ($event_query as $event){\n\t\tarray_push($results['events'], array(\n\t\t\t\t'title' => $event->post_title,\n\t\t\t\t'permalink' => get_permalink($event->ID),\n\t\t\t\t'day' => tribe_get_start_date($event->ID, false, 'j'),\n\t\t\t\t'month' => tribe_get_start_date($event->ID, false, 'M')\n\t\t\t));\n\t}\n\n\twhile($main_query ->have_posts()) {\n\t\t$main_query -> the_post();\n\n\t\tif(get_post_type() == 'page'){\n\t\t\tarray_push($results['pages'], array(\n\t\t\t\t'title' => get_the_title(),\n\t\t\t\t'permalink' => get_the_permalink()\n\t\t\t));\n\t\t }\n\t\tif(get_post_type() == 'post'){\n\t\t\tarray_push($results['posts'], array(\n\t\t\t\t'title' => get_the_title(),\n\t\t\t\t'permalink' => get_the_permalink(),\n\t\t\t\t'postType' => get_post_type(),\n\t\t\t\t'publishDate' => get_the_date()\n\t\t\t));\n\t\t }\n\t }\n\n\t return $results;\n }",
"protected function callData()\n {\n $type = $this->getSearchType();\n $searchString = $this->getSearchQuery();\n $response = $this->connector->call('GET', 'search/'.$type.'?query='.$searchString.'&limit=100', \"\", 10);\n $responseCode = (int) $response->getStatusCode();\n if ($responseCode !== 200) {\n throw new Exception('Invalid response from Search Data');\n }\n $responseJson = $response->getBody()->getContents();\n return $responseJson;\n }",
"public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}",
"public function doSearch() {\n\t\tif (isset($this->request->post['date_start'])) {\n\t\t\t$this->load->model('extension/payment/hoolah');\n\t\t\t$result = $this->model_extension_payment_hoolah->searchHoolahTransaction($this->request->post);\n\t\t\t\n\t\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t\t$this->response->setOutput(json_encode($result));\n\t\t} else {\n\t\t\t$response['error'] = true;\n\t\t\t$response['error_msg'] = 'Enter a start date';\n\t\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t\t$this->response->setOutput(json_encode($response));\n\t\t}\n\t}",
"public function listAction()\r\n\t{\r\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\r\n\t\t$this -> view -> business = $business = Engine_Api::_() -> core() -> getSubject();\r\n\t\t$this -> view -> form = $form = new Ynbusinesspages_Form_Event_Search;\r\n\t\t$val = $this -> _getAllParams();\r\n\t\t// Populate form data\r\n\t\tif (!$form -> isValid($val))\r\n\t\t{\r\n\t\t\t$form -> populate($defaultValues);\r\n\t\t\t$this -> view -> formValues = $values = array();\r\n\t\t\t$this -> view -> message = \"The search value is not valid !\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$values = $form -> getValues();\r\n\t\t$values['business_id'] = $business -> getIdentity();\r\n\t\t// Prepare data\r\n\t\t$this -> view -> formValues = $values = array_merge($values, $_GET);\r\n\t\t\r\n\t\t// Check create event authorization\r\n\t\t$this -> view -> canCreate = $business -> isAllowed('event_create');\r\n\t\t//Get data\r\n\t\t$this -> view -> paginator = $paginator = Engine_Api::_()->getDbTable('mappings', 'ynbusinesspages') -> getEventsPaginator($values);\r\n\t\t$paginator -> setCurrentPageNumber($this -> _getParam('page'));\r\n\t}",
"public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_Calendar_SearchEvents_Execution($this->session, $this, $inputs, $async, $store_results);\n }",
"protected function wrapResults($outputs)\n {\n return new Google_Calendar_SearchEvents_Results($outputs);\n }",
"public function search()\n {\n return $this->call('GET', $this->endpoint);\n }",
"function searchEvent(){\r\n\t\tif(!isset($_POST['submitted'])){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$formvars = array();\r\n\r\n\t\tif(!$this->ValidateSearchSubmission()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$this->CollectSearchSubmission($formvars);\r\n\t\t\r\n\t\tif(!$this->searchEventHelper($formvars)){\r\n\t\t\t//$this->HandleError(\"Did not Find any Results by 2 \" . $formvars['eventSearch']);\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\t$result = $this->searchEventHelper($formvars);\r\n\t\t}\r\n\r\n\t\treturn $result;\r\n\t}",
"public function onRefreshEvents()\n {\n $startTime = post('startTime');\n $endTime = post('endTime');\n $timeZone = post('timeZone');\n\n $data = [\n 'startTime' => $startTime,\n 'endTime' => $endTime,\n 'timeZone' => $timeZone\n ];\n\n if ($this->isFilteredByDateRange()){\n $startTime = 0;\n $endTime = 0;\n }\n\n return Response::json($this->getRecords($startTime, $endTime));\n }",
"function theme_intranet_haarlem_search_events($options = array()){\n\t$defaults = array(\t'past_events' \t\t=> false,\n\t\t\t\t\t\t'count' \t\t\t=> false,\n\t\t\t\t\t\t'offset' \t\t\t=> 0,\n\t\t\t\t\t\t'limit'\t\t\t\t=> EVENT_MANAGER_SEARCH_LIST_LIMIT,\n\t\t\t\t\t\t'container_guid'\t=> null,\n\t\t\t\t\t\t'query'\t\t\t\t=> false,\n\t\t\t\t\t\t'meattending'\t\t=> false,\n\t\t\t\t\t\t'owning'\t\t\t=> false,\n\t\t\t\t\t\t'friendsattending' \t=> false,\n\t\t\t\t\t\t'region'\t\t\t=> null,\n\t\t\t\t\t\t'latitude'\t\t\t=> null,\n\t\t\t\t\t\t'longitude'\t\t\t=> null,\n\t\t\t\t\t\t'distance'\t\t\t=> null,\n\t\t\t\t\t\t'event_type'\t\t=> false,\n\t\t\t\t\t\t'past_events'\t\t=> false,\n\t\t\t\t\t\t'search_type'\t\t=> \"list\"\n\t\t\t\t\t\t\n\t);\n\t\n\t$options = array_merge($defaults, $options);\n\t\n\t$entities_options = array(\n\t\t'type' \t\t\t=> 'object',\n\t\t'subtype' \t\t=> 'event',\n\t\t'offset' \t\t=> $options['offset'],\n\t\t'limit' \t\t=> $options['limit'],\n\t\t'joins' => array(),\n\t\t'wheres' => array(),\n\t\t'order_by_metadata' => array(\"name\" => 'start_day', \"direction\" => 'ASC', \"as\" => \"integer\")\n\t);\n\t\n\tif (isset($options['entities_options'])) {\n\t\t$entities_options = array_merge($entities_options, $options['entities_options']);\n\t}\n\t\n\tif($options[\"container_guid\"]){\n\t\t// limit for a group\n\t\t$entities_options['container_guid'] = $options['container_guid'];\n\t}\n\t\n\tif($options['query']) {\n\t\t$entities_options[\"joins\"][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"objects_entity oe ON e.guid = oe.guid\";\n\t\t$entities_options['wheres'][] = event_manager_search_get_where_sql('oe', array('title', 'description'), $options, false);\n\t}\n\t\t\t\t\n\tif(!empty($options['start_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['start_day'], 'operand' => '>=');\n\t}\n\t\n\tif(!empty($options['end_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['end_day'], 'operand' => '<=');\n\t}\n\t\n\tif(!$options['past_events']) {\n\t\t// only show from current day or newer\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => mktime(0, 0, 1), 'operand' => '>=');\n\t}\n\t\n\tif($options['meattending']) {\n\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_r ON e.guid = e_r.guid_one\";\n\t\t\n\t\t$entities_options['wheres'][] = \"e_r.guid_two = \" . elgg_get_logged_in_user_guid();\n\t\t$entities_options['wheres'][] = \"e_r.relationship = '\" . EVENT_MANAGER_RELATION_ATTENDING . \"'\";\n\t}\n\t\n\tif($options['owning']) {\n\t\t$entities_options['owner_guids'] = array(elgg_get_logged_in_user_guid());\n\t}\n\t\n\tif($options[\"region\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'region', 'value' => $options[\"region\"]);\n\t}\n\t\n\tif($options[\"event_type\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'event_type', 'value' => $options[\"event_type\"]);\n\t}\n\t\n\tif($options['friendsattending']){\n\t\t$friends_guids = array();\n\t\t\n\t\tif($friends = elgg_get_logged_in_user_entity()->getFriends(\"\", false)) {\n\t\t\tforeach($friends as $user) {\n\t\t\t\t$friends_guids[] = $user->getGUID();\n\t\t\t}\n\t\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_ra ON e.guid = e_ra.guid_one\";\n\t\t\t$entities_options['wheres'][] = \"(e_ra.guid_two IN (\" . implode(\", \", $friends_guids) . \"))\";\n\t\t} else\t{\n\t\t\t// return no result\n\t\t\t$entities_options['joins'] = array();\n\t\t\t$entities_options['wheres'] = array(\"(1=0)\");\n\t\t}\n\t}\n\t\n\tif(($options[\"search_type\"] == \"onthemap\") && !empty($options['latitude']) && !empty($options['longitude']) && !empty($options['distance'])){\n\t\t$entities_options[\"latitude\"] = $options['latitude'];\n\t\t$entities_options[\"longitude\"] = $options['longitude'];\n\t\t$entities_options[\"distance\"] = $options['distance'];\n\t\t$entities = elgg_get_entities_from_location($entities_options);\n\t\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_location($entities_options);\n\t\t\n\t} else {\n\t\t\n\t\t$entities = elgg_get_entities_from_metadata($entities_options);\n\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_metadata($entities_options);\n\t}\n\t\n\t$result = array(\n\t\t\"entities\" \t=> $entities,\n\t\t\"count\" \t=> $count_entities\n\t\t);\n\t\t\n\treturn $result;\n}",
"public function search()\n {\n $domains = Configure::read('AccessControlAllowOrigin');\n $this->response->cors($this->request)\n ->allowOrigin($domains)\n ->allowMethods(['GET'])\n ->allowHeaders(['X-CSRF-Token'])\n ->maxAge(300)\n ->build();\n\n $version = '2-2';\n if (!empty($this->request->query['version'])) {\n $version = $this->request->query['version'];\n }\n if (empty($this->request->query['lang'])) {\n throw new BadRequestException();\n }\n $lang = $this->request->query['lang'];\n\n $page = 1;\n if (!empty($this->request->query['page'])) {\n $page = $this->request->query['page'];\n }\n $page = max($page, 1);\n\n if (count(array_filter(explode(' ', $this->request->query['q']))) === 1) {\n $this->request->query['q'] .= '~';\n }\n\n $options = [\n 'query' => $this->request->query('q'),\n 'page' => $page,\n ];\n $this->loadModel('Search', 'Elastic');\n $results = $this->Search->search($lang, $version, $options);\n\n $this->viewBuilder()->className('Json');\n $this->set('results', $results);\n $this->set('_serialize', 'results');\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 }",
"public function search(Request $request, Response $response)\n {\n $query = $request->getQueryParam('q', NULL);\n $media = $request->getQueryParam('media', RESMedia::IMAGE);\n $limit = intval($request->getQueryParam('limit', 10));\n $offset = intval($request->getQueryParam('offset', 0));\n $audiences = $request->getQueryParam('for', NULL);\n\n $result = $this->client->search($query, $media, $limit, $offset, $audiences);\n\n // for each item in the results, construct a URI pointing at the search\n // service API, in the form\n // http://<search service domain and port>/proxy?uri=<topic URI>\n // (where the piece before the querystring is derived\n // from the endpoints for this Controller)\n $baseApiUri = $this->endpoints['proxy'];\n\n foreach($result['items'] as $index => $item)\n {\n $querystring = 'uri=' . urlencode($item['topic_uri']) . '&media=' . urlencode($media);\n $item['api_uri'] = $baseApiUri . '?' . $querystring;\n $result['items'][$index] = $item;\n }\n\n return $response->withJson($result);\n }",
"public function parseSearchResponse($response, SearchApiQueryInterface $query) {\n\n $search_result = array('results' => array());\n\n $search_result['result count'] = $response['hits']['total'];\n\n // Parse results.\n if (!empty($response['hits']['hits'])) {\n foreach ($response['hits']['hits'] as $result) {\n $id = $result['_id'];\n\n $search_result['results'][$id] = array(\n 'id' => $result['_id'],\n 'score' => $result['_score'],\n 'fields' => isset($result['_source']) ? $result['_source'] : array(),\n );\n\n foreach ($result as $key => $value) {\n if (!in_array($key, array('_id', '_score', '_source'))) {\n $search_result['results'][$id][$key] = $value;\n }\n }\n }\n }\n\n $search_result['search_api_facets'] = $this->parseSearchFacets($response, $query);\n\n // Check for spellcheck suggestions.\n if (module_exists('search_api_spellcheck') && $query->getOption('search_api_spellcheck')) {\n $search_result['search_api_spellcheck'] = new SearchApiSpellcheckElasticsearch($response);\n }\n\n return $search_result;\n }",
"public function Search($request,$responce)\n {\n $arr = [];\n\n //Select db and get all data from collection\n $db = $this->mongo->selectDB(\"test\");\n\n $collection = $db->test;\n $cursor = $collection->find();\n if(!empty($cursor)) {\n $array = iterator_to_array($cursor);\n foreach ($array as $value) {\n $params[\"index\"] = \"test\";\n $params[\"type\"] = \"test_type\";\n $params[\"id\"] = $value[\"_id\"];\n $arr[] = $this->elastic->get($params);\n }\n\n }\n\n //Create users zakaz data\n $userdata = [];\n $data = [];\n foreach ($arr as $value)\n {\n $userdata[] = [\n \"data\" => $value[\"_source\"],\n \"id\" => $value[\"_id\"],\n ];\n $udata[] = $value[\"_source\"];\n }\n\n //Compare user zakaz data and search string\n // put result in array and show it\n $search = [];\n $time_start = $request->getParam(\"year\").\"-\".$request->getParam(\"month\").\"-\".$request->getParam(\"day\").\" 00:00:00\";\n $time_end = $request->getParam(\"year\").\"-\".$request->getParam(\"month\").\"-\".$request->getParam(\"day\").\" 23:59:59\";\n foreach ($userdata as $data)\n {\n if(strcasecmp($request->getParam(\"search\"), $data[\"id\"]) == 0 ||\n stripos($request->getParam(\"search\"),$data[\"data\"][\"name\"]) !==false ||\n stripos($request->getParam(\"search\"),$data[\"data\"][\"surname\"]) !==false ||\n stripos($request->getParam(\"search\"),$data[\"data\"][\"email\"]) !==false ||\n $request->getParam(\"price_from\")<=$data[\"data\"][\"price\"] && $data[\"data\"][\"price\"]<=$request->getParam(\"price_to\") ||\n strtotime($time_start)<=strtotime($data[\"data\"][\"date\"]) && strtotime($data[\"data\"][\"date\"])<=strtotime($time_end)\n )\n {\n $search[] = $data[\"data\"];\n }\n\n\n }\n\n\n return $this->view->render($responce,\"app.twig\",[\"search\" => $search,\"zakaz\" => $udata]);\n\n }",
"public function search() {\n\t\tif(isset($_GET['query'])) $this->query_str = $_GET['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t$cache = new Cache($this->query_str);\n\t\t//check if the result is cached\n\t\t\n\t\tif($cache->allow_cache()) {\n\t\t\t$raw = $cache->load_cache();\n\t\t\tif($raw === false) $raw = null;\n\t\t}\n\n\t\tif($raw === null) {\n\t\t\t//check if jar exists\n\t\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar search ' . escapeshellarg($this->query_str));\n\t\t\telse return;\n\n\t\t\t//only save into cached when the escaped string equal to input string\n\t\t\tif($raw !== null && count($raw) > 0 && $cache->allow_cache()) \n\t\t\t\t$cache->save_cache($raw);\n\t\t}\n\n\t\t$this->results = json_decode($raw);\n\n\t\t$this->end_time = microtime(true);\n\t}",
"public function index()\n {\n $filters = request()->only('date', 'region');\n\n $events = $this->event\n ->when(isset($filters['date']), function ($query) use ($filters) {\n return $query->whereDate('date', $filters['date']);\n })\n ->when(isset($filters['region']), function ($query) use ($filters) {\n return $query->where('place', 'LIKE', \"%{$filters['region']}%\");\n })\n ->paginate(10);\n\n return response()->json([\n 'error' => false,\n 'message' => '',\n 'data' => [\n 'current_page' => $events->currentPage(),\n 'last_page' => $events->lastPage(),\n 'per_page' => $events->perPage(),\n 'path' => $events->path(),\n 'data' => new EventCollection($events)\n ]\n ], 200);\n }",
"protected function handleGetFiltered() {\n\t\t\tif ($this->verifyRequest('GET') && $this->verifyParams()) {\n\t\t\t\textract($this->getResultParams());\n\t\t\t\t\n\t\t\t\t$strFilterBy = $this->objUrl->getFilter('by');\n\t\t\t\t$mxdFilter = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(3));\n\t\t\t\t\n\t\t\t\tif ($strFilterBy == 'username') {\n\t\t\t\t\tAppLoader::includeUtility('DataHelper');\n\t\t\t\t\t$mxdFilter = DataHelper::getUserIdByUsername($mxdFilter);\n\t\t\t\t\t$strFilterBy = 'userid';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($strFilterBy == 'userid') {\n\t\t\t\t\t$blnCached = $this->loadFromCache($strNamespace = sprintf(AppConfig::get('UserEventNamespace'), $mxdFilter));\n\t\t\t\t} else {\n\t\t\t\t\t$blnCached = $this->loadFromCache();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (empty($blnCached)) {\n\t\t\t\t\t$objUserEvent = $this->initModel();\n\t\t\t\t\tswitch ($strFilterBy) {\n\t\t\t\t\t\tcase 'userid':\n\t\t\t\t\t\t\t$blnResult = $objUserEvent->loadByUserId($mxdFilter, $arrFilters, false);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($blnResult) {\n\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\tif ($objUserEvent->count()) {\n\t\t\t\t\t\t\t$this->arrResult = array(\n\t\t\t\t\t\t\t\t'events' => $this->formatEvents($objUserEvent),\n\t\t\t\t\t\t\t\t'total' => $objUserEvent->count()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->arrResult = array(\n\t\t\t\t\t\t\t\t'events' => array(),\n\t\t\t\t\t\t\t\t'total' => 0\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset($blnCached)) { \n\t\t\t\t\t\t\tif (isset($strNamespace)) {\n\t\t\t\t\t\t\t\t$this->saveToCache($this->intCacheExpire, $strNamespace);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->saveToCache($this->intCacheExpire);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error loading the event data'));\n\t\t\t\t\t\t$this->error();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}",
"public function parse(){\n\t\t$this->_data = array();\n\t\n\t\ttry{\n\t\t\tparent::parse();\n\t\t\t\n\t\t\tif(!empty($this->_response)){\n\t\t\t\tif($this->_request['method'] == 'GetEvents'){\n\t\t\t\t\tif(is_array($this->_response->GetEventsResult->Event)){\n\t\t\t\t\t\tforeach($this->_response->GetEventsResult->Event as $event){\n\t\t\t\t\t\t\t$this->_data[] = $event;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(is_object($this->_response->GetEventsResult->Event)){\n\t\t\t\t\t\t$this->_data = $this->_response->GetEventsResult->Event;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->_data = null;\n\t\t\t\t\t}\n\t\t\t\t}else if($this->_request['method'] == 'SearchEvents'){\n\t\t\t\t\tif(is_array($this->_response->SearchEventsResult->Event)){\n\t\t\t\t\t\tforeach($this->_response->SearchEventsResult->Event as $event){\n\t\t\t\t\t\t\t$this->_data[] = $event;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(is_object($this->_response->SearchEventsResult->Event)){\n\t\t\t\t\t\t$this->_data = $this->_response->SearchEventsResult->Event;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->_data = null;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(!empty($this->_response->GetCountryByIDResult)){\n\t\t\t\t\t\t$this->_data = $this->_response->GetCountryByIDResult;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->_data = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t}catch(TNException $e){\n\t\t\t$err = $this->debug($e->getMessage());\n\t\t\techo $err;\n\t\t}\n\t\n\t\treturn $this;\n\t}",
"protected function wrapResults($outputs)\n {\n return new Google_Calendar_GetAllEvents_Results($outputs);\n }",
"function _callback_search_result(&$result, Request $request, Template $page, $query, $offset, $limit, $count) {\n\t\tif (0 == $offset) {\n\t\t\t// Match for username\n\t\t\tif (preg_match('/^\\s*([\\w\\-]*[a-z][\\w\\-]*)\\s*$/', $query, $m))\n\t\t\t\t$user = $this->resolveLogin($m[1]);\n\t\t\t// Match for email\n\t\t\telse if (preg_match('/^\\s*([\\w\\-\\.]+@[\\w\\-\\.]+)\\s*$/', $query, $m))\n\t\t\t\t$user = $this->resolveEmail($m[1]);\n\t\t\t// Match for number\n\t\t\telse if (preg_match('/^\\s*(\\d+)\\s*$/', $query)) {\n\t\t\t\t$collection = $this->findUsers($query);\n\t\t\t\tif (count($users = $collection->getContents(0, 1)))\n\t\t\t\t\t$user = $users[key($users)];\n\t\t\t\t$count = $collection->getCount();\n\t\t\t}\n\t\t\t\t\n\t\t\tif (isset($user)) {\n\t\t\t\t$summary = clone $page;\n\t\t\t\t$summary->assign('user', $user);\n\t\t\t\t$summary->assign('count', isset($count) ? $count : 1);\n\t\t\t\t$summary->assign('request', $request);\n\t\t\t\t$result .= $summary->fetch(tpl_design_path('module/user/summary_search_result.tpl'));\n\t\t\t}\n\t\t}\n\t}",
"protected function wrapResults($outputs)\n {\n return new Google_Calendar_GetEvent_Results($outputs);\n }",
"public function search(Request $request){\n $fromDate = $request->input('from_date','');\n $toDate = $request->input('to_date','');\n $group = $request->input('group','');\n $action = $request->input('action','');\n $pageSize = $request->input('page_size',10);\n //\n $result = UserAuditLogic::Instance()\n ->search($fromDate, $toDate, \"\", $group, $action, \"\", \"\", $pageSize);\n //\n $returnModel = ReturnModel::Instance();\n $returnModel->status = \"200\";\n $returnModel->data = $result;\n return json_encode($returnModel);\n }",
"private function rest_search() {\n\t\t// return json elements here\n\t}",
"public static function get_entries_by_search_returns() {\n return new external_single_structure(array(\n 'count' => new external_value(PARAM_INT, 'The total number of records matching the request.'),\n 'entries' => new external_multiple_structure(\n self::get_entry_return_structure()\n ),\n 'ratinginfo' => \\core_rating\\external\\util::external_ratings_structure(),\n 'warnings' => new external_warnings()\n ));\n }"
] | [
"0.6132697",
"0.6092422",
"0.5712649",
"0.566634",
"0.56584215",
"0.5634493",
"0.56007993",
"0.5557639",
"0.5522946",
"0.551089",
"0.5505492",
"0.5501669",
"0.54963607",
"0.5492992",
"0.5457747",
"0.54550695",
"0.54383665",
"0.5420487",
"0.5419508",
"0.5415758",
"0.537435",
"0.53615224",
"0.53244567",
"0.53201365",
"0.53112763",
"0.52773225",
"0.5275597",
"0.5269466",
"0.5254369",
"0.5248434"
] | 0.6725314 | 0 |
Returns Customer_Company objects of all employees of this company | public function getEmployees() {
if ( is_null($this->_employees) ){
$customers = $this->getTable()->getEmployees();
$objects = new splObjectStorage();
foreach ($customers AS $customer) {
try {
$ccust = new Yourdelivery_Model_Customer_Company($customer->customerId, $this->getId());
if ($ccust->isDeleted()) {
continue;
}
} catch (Yourdelivery_Exception_Database_Inconsistency $e) {
continue;
}
$objects->attach($ccust);
}
$this->_employees = $objects;
}
return $this->_employees;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCompanyEmployees();",
"public static function getEnterpriseCompanies(){\n $result = db::get(\"SELECT uid_empresa FROM \". TABLE_EMPRESA .\" WHERE is_enterprise = 1 ORDER BY nombre\", \"*\", 0, \"empresa\");\n return new ArrayObjectList($result);\n }",
"public static function all() {\n\n $db = Zend_Registry::get('dbAdapter');\n $result = $db->query('select id from companys')->fetchAll();\n $companys = new SplObjectStorage();\n foreach ($result as $c) {\n try {\n $company = new Yourdelivery_Model_Company($c['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $companys->attach($company);\n }\n return $companys;\n }",
"public function allCompanies()\n {\n return Company::all();\n }",
"public static function employees(Company $company): array\n {\n // number of employees in total\n $totalNumberOfEmployees = $company->employees()->notLocked()->count();\n\n // 10 random employees\n $tenRandomEmployeesCollection = collect([]);\n $allEmployees = $company->employees()\n ->notLocked()\n ->with('picture')\n ->inRandomOrder()\n ->take(10)\n ->get();\n\n foreach ($allEmployees as $employee) {\n $tenRandomEmployeesCollection->push([\n 'id' => $employee->id,\n 'name' => $employee->name,\n 'avatar' => ImageHelper::getAvatar($employee, 32),\n 'url' => route('employees.show', [\n 'company' => $company,\n 'employee' => $employee,\n ]),\n ]);\n }\n\n // ten random employees\n\n // number of employees hired in the current year\n $employeesHiredInTheCurrentYear = $company->employees()\n ->notLocked()\n ->whereYear('hired_at', (string) Carbon::now()->year)\n ->count();\n\n return [\n 'employees_hired_in_the_current_year' => $employeesHiredInTheCurrentYear,\n 'ten_random_employees' => $tenRandomEmployeesCollection,\n 'number_of_employees_left' => $totalNumberOfEmployees - $tenRandomEmployeesCollection->count(),\n 'view_all_url' => route('employees.index', [\n 'company' => $company,\n ]),\n ];\n }",
"public static function FilterByEmployees() {\n\t\t\t\n\t\t\t$sql = \"SELECT Code,Employee_Name FROM employees\";\n\t\t\t$statement = Database::$db->prepare($sql);\n\t\t\t$statement->execute();\n\t\t\t$employees1 = [];\n\t\t\twhile($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t$employees1[] = new Employee($row['Code']);\n\t\t\t}\n\t\t\treturn $employees1;\n\t\t}",
"public function getAllEmployees();",
"public function getEmployees() {\n\n /* Fetch all included employee IDs */\n $employeeIDs = $this->getIncludedEmployeeIDs();\n\n\n /* Set orWhereIn variables */\n array_push($this->whereIn, [\n 'column' => 'employee_id',\n 'array' => $employeeIDs\n ]);\n }",
"public static function DisplayAll() {\n\t\t\t\n\t\t\t$sql = \"SELECT * FROM employees \";\n\t\t\t$statement = Database::$db->prepare($sql);\n\t\t\t$statement->execute();\n\t\t\t$employees = [];\n\t\t\twhile($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t$employees[] = new Employee($row['Code']);\n\t\t\t}\n\t\t\treturn $employees;\n\t\t}",
"public function getCompaniesReport() : CompaniesReport\n\t{\n\t\t$response = $this->execute('Empresa');\n\t\t\n\t\t$companiesByArea = [];\n\t\tforeach($response['e'] as $areaPool){\n\t\t\t$i = $areaPool['a'];\n\t\t\tforeach($areaPool['e'] as $company){\n\t\t\t\t$companiesByArea[$i][]=new Company(\n\t\t\t\t\t$company['a'],\n\t\t\t\t\t$company['c'],\n\t\t\t\t\t$company['n']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn new CompaniesReport($response['hr'],$companiesByArea);\n\t}",
"public function companies(): Collection\n {\n return Company::all();\n }",
"public function employees()\n {\n $response = $this->client->get('employees');\n\n return collect($response->json('collection'))->mapInto(Employee::class);\n }",
"public function getAllEmployees() \n {\n $employees = Employees::getEmployees();\n\n foreach($employees as $key => $employee){\n $newArrayEmployees[$key] = $this->generateEmployeeData($employee);\n }\n\n sort($newArrayEmployees);\n\n return $newArrayEmployees;\n }",
"function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}",
"public static function getEmployees($conn) {\r\n\r\n \r\n // set static database connection\r\n $dbc = $conn->getdbc();\r\n\r\n // for now (or permanently) directly include SQL here\r\n $sql_showEmployees = \"SELECT * FROM employees\";\r\n\r\n\r\n if ($result = $dbc->query($sql_showEmployees)) {\r\n\r\n $employees = [];\r\n\r\n while ($row = $result->fetch()) {\r\n\r\n $employees[] = Employee::create($conn, $row['id'], $row['fname'], $row['lname'], $row['email']);\r\n }\r\n // return users array\r\n return $employees;\r\n } else {\r\n\r\n echo \"<p> Could not run query </p>\";\r\n }\r\n }",
"public function getEmployee()\n\t{\n\t\t$arr = $this->queryToDbObj->getEmployeeList();\n\n\t\treturn $arr;\n\t}",
"public function getAllEmployees() {\n\t\t$em = $this->getEntityManager();\n\t\t$employees = $em->createQueryBuilder()\n\t\t\t->select('e.employeeID,e.userName')\n\t\t\t->from('Employee', 'e')\n\t\t\t->orderBy('e.employeeID')\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\t\t\n\t\t$response = array(\n\t\t\t\"employees\" => $employees\n\t\t);\n\t\t\n\t\treturn $this->respond($response);\n\t}",
"public function employees()\n {\n return $this->users->where('account_type', 'Employee');\n }",
"public function Employees()\n {\n $this->_Employees->ClearAllOptions();\n return $this->_Employees;\n }",
"public static function allEmployeesEmail($companyId = null) {\n if (is_null($companyId)) {\n return array();\n }\n\n $db = Zend_Registry::get('dbAdapter');\n return $db->query('select c.email from customers c inner join customer_company cc on c.id=cc.customerId where c.deleted=0 and cc.companyId=' . $companyId . ' order by c.email')->fetchAll();\n }",
"public function getAllEmployers();",
"public function getCompany() {\n return Companies::findById($this->company_id);\n }",
"public function selectAll() {\r\n $query = \"SELECT * FROM \" . EmpleoDAO::EMPLEO_TABLE;\r\n $result = mysqli_query($this->conn, $query);\r\n $empleos = array();\r\n while ($empleoBD = mysqli_fetch_array($result)) {\r\n\r\n $empleo = new Empleo();\r\n $empleo->setId($empleoBD[\"idJob\"]);\r\n $empleo->setPosition($empleoBD[\"position\"]);\r\n $empleo->setCompany($empleoBD[\"company\"]);\r\n $empleo->setLogo($empleoBD[\"logo\"]);\r\n $empleo->setDescription($empleoBD[\"description\"]);\r\n $empleo->setSalary($empleoBD[\"salary\"]);\r\n\r\n array_push($empleos, $empleo);\r\n }\r\n return $empleos;\r\n }",
"public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }",
"public function getAdmins() {\n $a = new SplObjectStorage();\n $admins = $this->getTable()->getAdmins();\n foreach ($admins as $admin) {\n try {\n $customer = new Yourdelivery_Model_Customer_Company($admin['id'], $this->getId());\n $a->attach($customer);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n }\n return $a;\n }",
"public function getCompaniesToSuspend() {\n return $this->createQuery('c')\n ->select('c.*')\n ->from('Companies_Model_Company c')\n ->where('c.status = ?', Companies_Model_Company::STATUS_EXPIRED)\n ->addWhere('c.payment_date IS NOT NULL AND ADDDATE(c.payment_date, 8) < NOW()')\n ->execute();\n }",
"public static function vehicles_employees_crits(){\n\t\treturn array('(company_name'=>CRM_ContactsCommon::get_main_company(),'|related_companies'=>array(CRM_ContactsCommon::get_main_company()));\n }",
"public function getCompanyWithUsers();",
"function exeGetAllEmployees() {\n $exeGetAllEmployees = $this->db->query(\"SELECT *\n FROM employees\n WHERE status >= 0\n ORDER BY firstname ASC, lastname ASC\");\n \n return $exeGetAllEmployees->result_array();\n }",
"public function getEmployees()\n {\n return $this->hasMany(Employee::className(), ['Emp_tumbol' => 'id']);\n }"
] | [
"0.80659366",
"0.7450481",
"0.72915214",
"0.69716215",
"0.69016933",
"0.6851105",
"0.6811749",
"0.6801597",
"0.67012745",
"0.6626089",
"0.6619283",
"0.65692306",
"0.6564905",
"0.65477973",
"0.6546318",
"0.6536029",
"0.65336025",
"0.6453452",
"0.6442147",
"0.64110345",
"0.638719",
"0.63721645",
"0.6364135",
"0.62932247",
"0.6231704",
"0.6227918",
"0.6223712",
"0.6204367",
"0.6180595",
"0.61646205"
] | 0.85140556 | 0 |
Returns count of employees | public function getEmployeesCount() {
return $this->getTable()->getEmployeesCount();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function countEmployee(){\n\t\t\t\t\t return count($this->listeEmployee());\n\t\t\t\t\t }",
"public function getAllDataEmployees(){\n\t\t\t$this->db->select('*')->from('tbl_employees');\n\t\t\treturn $this->db->count_all_results();\n\t\t}",
"function get_all_empresas_count()\n {\n $this->db->from('empresas');\n return $this->db->count_all_results();\n }",
"public function getNumberOfEmployees(): ?int;",
"public function employees() \r\n\t{\r\n\t\t$query = \"SELECT count(id_radnik) as Zaposlenih FROM \" . $this->table;\r\n\r\n\t\t$stmt = $this->conn->prepare($query);\r\n\t\t$stmt->execute();\r\n\r\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\t$zaposlenih = $row['Zaposlenih'];\r\n\t\treturn $zaposlenih;\r\n\t}",
"public function filteredDataEmployees(){\n\t\t\t$this->ajaxEmployeeList();\n\t\t\t$query = $this->db->get();\n\t\t\treturn $query->num_rows();\n\t\t}",
"public function countByEmpID($emp_id){\n return $this->count('emp_id=:emp_id', array(':emp_id' => $emp_id));\n }",
"function count_all(){\n\t $this->db->count_all($this->tbl_Employeeinfo);\n\t \n return $this->db->count_all($this->tbl_Employeeinfo);\n }",
"function getEmpCount(){\n\t\t$con = connect();\t\t\n\t\t$sql = \"SELECT count(*) FROM employee\"; //count emp from view\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchColumn();\n\t\techo $result;\n\t}",
"function getNrEmployeesBranch($username){\n\n global $db;\n\n $stmt=$db->prepare('SELECT count(*) as nrEmployees from employee\n WHERE employee_branch_id=(\n SELECT client_branch\n FROM client\n JOIN\n (\n SELECT client_id AS client\n FROM person\n JOIN\n client ON client_id = person_id\n WHERE username = ?\n )\n ON client_id = client)');\n \n $stmt->execute(array($username));\n return $stmt->fetch();\n }",
"function assign_subordinate_count($employee) {\n\t$count = 0;\n\t//Get subordinate employees of current employee\n\t$employees = $employee->getSubordinates();\n\t//Add to count\n\t$count += count($employees);\n\t//Recursively add all subordinate employees number of employees to current employees count\n\tforeach($employees AS $emp) {\n\t\t$count += assign_subordinate_count($emp);\n\t}\n\t//Update number of subordinate employees for this employee\n\t$employee->setNumSubordinates($count);\n\t//Destroy the subordinates attribute so returned data will be flat array/chop off multidimensional array\n\t$employee->destroySubordinates();\n\treturn $count;\n}",
"function exeGetTotalEmp() { \n $exeGetTotalEmp = $this->db->query(\"SELECT *\n FROM employees\n WHERE status = 1\n ORDER BY firstname ASC, lastname ASC\");\n \n return $exeGetTotalEmp->num_rows(); \n }",
"public function nbEmprunt()\n\t\t{\n\t\treturn $this->lesEmprunts->count();\n\t\t}",
"public static function getEmployeeShiftsCounts($employee_id){\n return DB::table('table_employee_shifts')\n ->join('table_employees', 'table_employee_shifts.employee_id', '=', 'table_employees.employee_id')\n ->join('table_shifts', 'table_employee_shifts.shift_id', '=', 'table_shifts.shift_id')\n ->where(['table_employee_shifts.employee_id' => $employee_id])\n ->count();\n }",
"function TotalEmployee() {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT \n\t\t\" . $db_table_prefix . \"users.id, \" . $db_table_prefix . \"user_permission_matches.permission_id\n\t\tFROM \" . $db_table_prefix . \"users LEFT JOIN \" . $db_table_prefix . \"user_permission_matches ON \n\t\t\" . $db_table_prefix . \"users.id = \" . $db_table_prefix . \"user_permission_matches.user_id where \" . $db_table_prefix . \"user_permission_matches.permission_id = '1'\");\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n return $num_returns;\n}",
"public function countEntities(): int;",
"public static function getCount(){\n \t$sql = \"SELECT COUNT(*) as count FROM yy_hospital\";\n \t$res = self::getDb()->query($sql)->fetchAll();\n \t$count = $res[0]['count'];\n \treturn $count;\n }",
"function vcn_get_career_count() {\t\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry(), 'ignoreworktype' => 'Y'), 'json');\r\n\treturn count($data);\r\n}",
"function getUsersCount() {\n $company_id = $this->getId(); \n \treturn Users::count(\"company_id LIKE $company_id\");\n }",
"public function countEm()\n {\n $qb = $this->createQueryBuilder('g');\n $qb->select('count(g.id) AS counter');\n $query = $qb->getQuery();\n return $query->getSingleScalarResult();\n }",
"public function employeesStefan(Request $request)\n {\n $employees = Employees::getEmployeesStefan();\n\n foreach($employees as $employee){\n print_r($employee->cn[0].', '.$employee->department[0].', '.$employee->title[0].', '.$employee->streetaddress[0].', '.$employee->l[0]);\n echo '<br>';\n }\n\n echo '<hr>';\n print_r('TOTAL: '.count($employees));\n\n die();\n }",
"public function employees_head_count()\n\t{\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$date = date('Y');\n \t $query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-01%'\");\n\t\t$row1 = $query->num_rows();\n\t\t$Return['january'] = $row1;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-02%'\");\n\t\t$row2 = $query->num_rows();\n\t\t$Return['february'] = $row2;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-03%'\");\n\t\t$row3 = $query->num_rows();\n\t\t$Return['march'] = $row3;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-04%'\");\n\t\t$row4 = $query->num_rows();\n\t\t$Return['april'] = $row4;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-05%'\");\n\t\t$row5 = $query->num_rows();\n\t\t$Return['may'] = $row5;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-06%'\");\n\t\t$row6 = $query->num_rows();\n\t\t$Return['june'] = $row6;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-07%'\");\n\t\t$row7 = $query->num_rows();\n\t\t$Return['july'] = $row7;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-08%'\");\n\t\t$row8 = $query->num_rows();\n\t\t$Return['august'] = $row8;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-09%'\");\n\t\t$row9 = $query->num_rows();\n\t\t$Return['september'] = $row9;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-10%'\");\n\t\t$row10 = $query->num_rows();\n\t\t$Return['october'] = $row10;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-11%'\");\n\t\t$row11 = $query->num_rows();\n\t\t$Return['november'] = $row11;\n\t\t\n\t\t$query = $this->db->query(\"SELECT * from xin_employees WHERE created_at like '%\".$date.\"-12%'\");\n\t\t$row12 = $query->num_rows();\n\t\t$Return['december'] = $row12;\n\t\t\n\t\t$Return['current_year'] = date('Y');\n\t\t$this->output($Return);\n\t\texit;\n\t}",
"public function getCount()\n {\n if (null === $this->count) {\n $qb = clone $this->getQueryBuilder();\n $query = $qb->addSelect('count(e.id) as total_count');\n $result = $query->getQuery()->execute();\n $this->count = $result[0]['total_count'];\n }\n return $this->count;\n }",
"public function total() {\n $totEmployees = Employee::count();\n\n return response()->json([$totEmployees]);\n }",
"public function verCantidadEmpresas()\n {\n $query = \"SELECT COUNT(*) as cantidad_empresa FROM empresa\";\n $stmt = $this->conexion->prepare($query);\n if (!$stmt->execute()) {\n $stmt->closeCursor();\n return 0;\n } else {\n $cantidad = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $cantidad;\n }\n }",
"function erp_hr_count_departments() {\n\n return \\WeDevs\\ERP\\HRM\\Models\\Department::count();\n}",
"public function getAllEmployees();",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();"
] | [
"0.83989877",
"0.7367075",
"0.72336376",
"0.72261834",
"0.7167031",
"0.7027701",
"0.699077",
"0.69037336",
"0.6776866",
"0.6690841",
"0.6654862",
"0.6573313",
"0.6515685",
"0.64769894",
"0.642788",
"0.63113743",
"0.62977064",
"0.62742156",
"0.6230173",
"0.621434",
"0.6199207",
"0.6179927",
"0.6175081",
"0.6151251",
"0.6147487",
"0.61371815",
"0.61119366",
"0.6102614",
"0.6102614",
"0.6102614"
] | 0.8466051 | 0 |
Returns the billing contact object if this company | public function getBillingContact() {
try {
return new Yourdelivery_Model_Contact($this->getBillingContactId());
} catch (Yourdelivery_Exception_Database_Inconsistency $e) {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getContact() {\n try {\n return new Yourdelivery_Model_Contact($this->getContactId());\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n return null;\n }\n }",
"public function getContact()\n {\n return isset($this->contact) ? $this->contact : null;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function getBilling()\n {\n return isset($this->billing) ? $this->billing : null;\n }",
"public function getContact()\n {\n return $this->contact;\n }",
"public function contact()\n {\n return $this->hasOne(OrderContact::class);\n }",
"public function getBilling()\n {\n return $this->billing;\n }",
"public function getBilling()\n {\n return $this->billing;\n }",
"public function getAddressBilling()\n {\n return $this->addressBilling;\n }",
"public function billing_address() {\n if(is_null($this->billing_address)){\n $this->billing_address = new Address($this->billing_address_id);\n }\n return $this->billing_address;\n }",
"public function getBillingCompany()\n {\n return $this->getParameter('billingCompany');\n }",
"public function getBillingReference()\n {\n return $this->billingReference;\n }",
"public function getBillingReference()\n {\n return $this->billingReference;\n }",
"public function getBillingAddress()\n {\n if (is_null($this->billingAddress)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_BILLING_ADDRESS);\n if (is_null($data)) {\n return null;\n }\n\n $this->billingAddress = BaseAddressModel::of($data);\n }\n\n return $this->billingAddress;\n }",
"public function getBillingAddress(){\n return $this->_getData(self::BILLING_ADDRESS);\n }",
"public function getBillingDetails()\n {\n return $this->_billing;\n }",
"public function getBillingCustomized() {\n $customized = new Yourdelivery_Model_Billing_Customized();\n $cid = $this->getTable()->getBillingCustomized();\n if ($cid === false) {\n $customized->setMode('comp');\n } else {\n $customized->load($cid['id']);\n }\n\n $customized->setCompany($this);\n $customized->setRefId($this->getId());\n\n return $customized;\n }",
"public function billingCustomer()\n {\n $customer = new Customer();\n $this->setBilling($customer);\n\n return $customer;\n }",
"public function getCompany()\n {\n return isset($this->company) ? $this->company : null;\n }",
"public function getCompany()\n {\n return $this->getParameter('billingCompany');\n }",
"function getContact()\n\t{\n\t\treturn $this->Info['Contact'];\n\t}",
"protected function buildContactObject()\n {\n return new Contact();\n }",
"public function getBillingAddress();",
"public function getBillingAddress();",
"public function getBillingAddress() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->billingAddress;\r\n\t}",
"public function getBillingAddress(): ?Address\n {\n return $this->billingAddress;\n }",
"public function getContact()\n {\n $userId = Yii::$app->user->id;\n\n if ($userId == $this->author_id) {\n return $this->recipient;\n } elseif ($userId == $this->recipient_id) {\n return $this->author;\n }\n\n }",
"public function billing_address()\n {\n return $this->hasOne(AddressProxy::modelClass(), 'saas_subscription_recurring_profile_id');\n }"
] | [
"0.6930654",
"0.6894252",
"0.6823665",
"0.6823665",
"0.6823665",
"0.68114996",
"0.6693355",
"0.66731006",
"0.6621222",
"0.6621222",
"0.6559425",
"0.6542592",
"0.64734906",
"0.64569074",
"0.64569074",
"0.6341582",
"0.632374",
"0.63229895",
"0.62913233",
"0.6269803",
"0.6246155",
"0.61843467",
"0.616345",
"0.61393",
"0.61288065",
"0.61288065",
"0.612202",
"0.61133504",
"0.6075762",
"0.6074257"
] | 0.8246131 | 0 |
returns all budget objects of this company | public function getBudgets() {
$table = new Yourdelivery_Model_DbTable_Company_Budgets();
$all = $table->fetchAll('companyId = ' . $this->getId());
$obj = new splObjectStorage();
foreach ($all AS $budget) {
try {
$budget = new Yourdelivery_Model_Budget($budget->id);
} catch (Yourdelivery_Exception_Database_Inconsistency $e) {
continue;
}
$obj->attach($budget);
}
return $obj;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findAll() {\n $sql = \"SELECT * FROM budget\";\n $result = $this->db->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $budget = array();\n foreach ($result as $row) {\n $budgetID = $row['id'];\n $budget[$budgetID] = $this->buildBudget($row);\n }\n return $budget;\n }",
"public function budgets()\n {\n return $this->hasMany(Budget::class);\n }",
"public function allCompanies()\n {\n return Company::all();\n }",
"public function companies(): Collection\n {\n return Company::all();\n }",
"public static function all() {\n\n $db = Zend_Registry::get('dbAdapter');\n $result = $db->query('select id from companys')->fetchAll();\n $companys = new SplObjectStorage();\n foreach ($result as $c) {\n try {\n $company = new Yourdelivery_Model_Company($c['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $companys->attach($company);\n }\n return $companys;\n }",
"public function getGlBudgets()\n {\n return $this->hasMany(GlBudget::className(), ['account_id' => 'account_id']);\n }",
"public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }",
"public function budgets() : HasMany\n {\n return $this->hasMany('App\\Budget');\n }",
"public function getProductBudgets()\n {\n return $this->productBudgets;\n }",
"public function cycleBudgets()\n {\n return $this->hasMany(CycleBudget::class);\n }",
"public static function getBudgetWithAllProperties()\n {\n $budget = new FakeBudget();\n $budget->setBudgetId(-1);\n $budget->setName('Test Budget');\n\n $money = new FakeMoney();\n $money->setMicroAmount(50000000);\n $budget->setAmount($money);\n\n return $budget;\n }",
"public function cargarbodegas()\n {\n \treturn Cont_Bodega::all();\n }",
"public function getBuildingsWithBudgets()\n {\n $buildings_budgets = $this->find('all', [\n 'contain' => ['Budgets' =>\n function ($q) {\n return $q\n ->select(['id', 'building_id']);\n }],\n 'conditions' => ['Buildings.softland_id IS NOT NULL', 'Buildings.omit' => false]\n ]);\n $buildingsWithBudget = array();\n foreach ($buildings_budgets as $buildings_budget) {\n if (!empty($buildings_budget['budget'])) {\n $buildingsWithBudget[$buildings_budget['softland_id']]['budget_id'] = $buildings_budget['budget']['id'];\n $buildingsWithBudget[$buildings_budget['softland_id']]['active'] = $buildings_budget['active'];\n }\n }\n return $buildingsWithBudget;\n }",
"public function getBillings($filter = null) {\n $billingTable = new Yourdelivery_Model_DbTable_Billing();\n $all = $billingTable->fetchAll('mode=\"company\" AND refId=\"' . $this->getId() . '\"');\n $storage = new splObjectStorage();\n foreach ($all AS $bill) {\n try {\n $bill = new Yourdelivery_Model_Billing($bill->id);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $storage->attach($bill);\n }\n return $storage;\n }",
"public function companyBillings($request)\n {\n if (Auth::user()->type != 'company') {\n throw new \\Exception('Unauthorized viewing of billing accounts.');\n }\n\n $data = [\n 'company_id' => Auth::user()->company->id,\n ]; \n\n $with = ['billable' => function($sub_query) { \n $sub_query->select('id', 'title', 'reference_id', 'price', 'incentive_per_share');\n \n }];\n \n $billings = $this->jobChoiceRepository->billing()->whereWhereMonthAndYear(\n $data, \n 'created_at', \n $request->month,\n $request->year,\n $with \n );\n \n // Fixed tax percentage\n $tax_percentage = Billing::VARIABLES['tax_percentage'];\n // Sub total amount of bills\n $sub_total_amount = $billings->sum('billable.incentive_per_share');\n // Result to be returned\n $result['billings'] = $billings; \n $result['sub_total_amount'] = $sub_total_amount;\n $result['consumption_tax_fee'] = $sub_total_amount * $tax_percentage;\n $result['total_amount_fee'] = $sub_total_amount + ($sub_total_amount * $tax_percentage);\n \n return $result;\n }",
"function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}",
"public function index()\n {\n $budgets = Budget::where(\"user_id\", \"=\", Auth::user()->id)->paginate(\n Config::get(\"constants.pagination.per_page\")\n );\n return BudgetResource::collection($budgets);\n }",
"public function getContracts()\n {\n return $this->hasMany(Contracts::className(), ['company_id' => 'id']);\n }",
"public function getAvailableCompanies()\n {\n return $this->createQuery('c')\n ->select('c.*')\n ->addSelect(\n \"(SELECT ROUND(AVG(r.rating), 2)\n FROM Companies_Model_Review r\n WHERE r.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND r.company_id = c.id) as rating\"\n )\n ->addSelect(\"(SELECT COUNT(rc.id)\n FROM Companies_Model_Review rc\n WHERE rc.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND rc.company_id = c.id) as review_count\")\n ->whereIn('c.status', Companies_Model_Company::getActiveStatuses())\n ->orderBy('rating DESC')\n ->execute();\n }",
"public function getAllForCustonObj() {\n $query = $this->db->query(\"SELECT * FROM $this->table ORDER BY shortname;\");\n $this->allcpny = $query->custom_result_object('entity\\Company');\n // print \"<pre>\";\n // print_r($this->cpny);\n // print \"</pre>\";\n // exit();\n return $this->allcpny;\n }",
"public function getCompaniesToSuspend() {\n return $this->createQuery('c')\n ->select('c.*')\n ->from('Companies_Model_Company c')\n ->where('c.status = ?', Companies_Model_Company::STATUS_EXPIRED)\n ->addWhere('c.payment_date IS NOT NULL AND ADDDATE(c.payment_date, 8) < NOW()')\n ->execute();\n }",
"public function getAll($companyId)\n {\n return\n DB::table('company_bank_accs')\n ->select(\n 'company_id as companyId',\n 'bank_id as bankId',\n 'acc_number as accNumber',\n 'acc_name as accName'\n )\n ->where([\n ['company_id', $companyId]\n ])\n ->get();\n }",
"public function getDoctorCashBacks()\n {\n try {\n return $this\n ->cash\n ->join('doctor_income', 'doctor_income.request_id', 'cash_back.id')\n ->where('doctor_income.account_id', auth()->user()->account_id)\n ->select(\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%b')) as month_name\"),\n DB::raw('SUM(doctor_income.income) as doctor_income'),\n DB::raw('SUM(cash_back.seena_cash) as seena_income'),\n DB::raw('SUM(cash_back.patient_cash) as patient_income'),\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%m')) as month\"),\n DB::raw(\"(DATE_FORMAT(doctor_income.created_at,'%Y')) as year\")\n )\n ->groupBy('month', 'year')\n ->orderBy('year', 'desc')\n ->orderBy('month', 'desc')\n ->get();\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return new Collection();\n }\n }",
"public static function fetch_all_in_a_list()\n\t{\n\t return Company::orderBy( 'name' )->lists( 'name' , 'id' );\n\n\t}",
"public function viewBudget()\n {\n $result = Budget::paginate(50);\n return view('data.list_budget', ['budget' => $result]);\n }",
"public function all(): array\n {\n return Billingo::get('bank_accounts');\n }",
"public function getAllBusinesses() {\n\t\t$em = $this->getEntityManager();\n\t\t$businesses = $em->createQueryBuilder()\n\t\t\t->select('b.businessID,b.costCenter,b.name')\n\t\t\t->from('Business', 'b')\n\t\t\t->orderBy('b.name')\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\t\t\n\t\t$response = array(\n\t\t\t\"businesses\" => $businesses\n\t\t);\n\t\t\n\t\treturn $this->respond($response);\n\t}",
"public function all()\n {\n return $this->atividadeComercialRepository->all();\n }",
"public static function getAll() {\n self::checkConnection();\n $sql = \"SELECT p.*, (p.start_date+p.duration) AS end_date, (p.goal - COALESCE(SUM(d.amount), 0)) AS rem FROM project p LEFT JOIN donation d ON d.project_id = p.id GROUP BY p.id ORDER BY end_date DESC, rem DESC;\"; //coalesce similar with isnull;\n if(isset($_GET['_category'])) {\n $category_id = $_GET['_category'];\n settype($category_id, 'integer');\n $sql = sprintf(\"SELECT p.*,(p.start_date+p.duration) AS end_date, (p.goal - COALESCE(SUM(d.amount), 0)) AS rem FROM project p LEFT JOIN donation d ON d.project_id = p.id WHERE p.id IN (SELECT c.project_id FROM project_category c WHERE c.category_id = %d) GROUP BY p.id ORDER BY end_date DESC, rem DESC;\", $category_id);\n }\n $results = self::$connection->execute($sql);\n $projects = array();\n foreach ($results as $project_arr) {\n array_push($projects, new Project($project_arr));\n }\n return $projects;\n }",
"public function getBudgetsByAddressId($addressId) {\n $nnTable = new Yourdelivery_Model_DbTable_Company_Location();\n $all = $nnTable->fetchAll('locationId = \"' . $addressId . '\"');\n $collector = new SplObjectStorage();\n foreach ($all AS $budget) {\n try {\n $budget = new Yourdelivery_Model_Budget($budget->id);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $collector->attach($budget);\n }\n return $collector;\n }"
] | [
"0.80036753",
"0.69953966",
"0.68506557",
"0.67112535",
"0.65952253",
"0.64342594",
"0.6264919",
"0.6158434",
"0.60893327",
"0.60579413",
"0.60140085",
"0.59997874",
"0.59993225",
"0.5892793",
"0.58861786",
"0.58673936",
"0.58306706",
"0.5820295",
"0.5809164",
"0.58073443",
"0.5776085",
"0.57415384",
"0.57374954",
"0.573621",
"0.5727508",
"0.5719525",
"0.5661433",
"0.56612104",
"0.5645164",
"0.5642133"
] | 0.83090556 | 0 |
return all admins of this company | public function getAdmins() {
$a = new SplObjectStorage();
$admins = $this->getTable()->getAdmins();
foreach ($admins as $admin) {
try {
$customer = new Yourdelivery_Model_Customer_Company($admin['id'], $this->getId());
$a->attach($customer);
} catch (Yourdelivery_Exception_Database_Inconsistency $e) {
continue;
}
}
return $a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get_admins();",
"public static function admins()\n {\n return User::all()->where('idpapel', 1)->where('stusuario', 'ati')->toArray();\n }",
"public function getAdmins()\n {\n $query = $this->newQuery();\n $query->where('admin', true);\n\n return $this->doQuery($query, false, false);\n }",
"public static function getAllAdmins()\n\t{\n\t\t$admins = self::where('users_role',UserRole::ADMIN_ROLE_ID)->get();\n\t\treturn $admins;\n\t}",
"function findAllAdministrators() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM admins;'));\r\n\r\n\t}",
"public function admins()\n {\n return $this->newQuery('getUsers', ['type' => 'AdminUsers']);\n }",
"public function findAllAdmin() {\n\t\t\t$result = $this->createQuery()->execute();\n\t\t\treturn $result;\n\t\t}",
"public function admins()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_ADMIN)->get();\n }",
"static function getAllAdmin()\n {\n\n $con=Database::getConnection();\n $req=$con->prepare('SELECT * FROM admin a, partners p WHERE a.idPart=p._idPart');\n $req->execute(array());\n return $req->fetchAll();\n }",
"public function getAdmins()\n {\n $admins = Admin::all();\n return view('view_admins', compact('admins'));\n }",
"public function getAdmins()\n {\n $role = Role::where('name', 'admin')->first();\n return $role->users;\n }",
"public function getAdmins()\n\t{\n\t\t$query = <<<QUERY\nSELECT\n\t*\nFROM\n\tplayer\nWHERE\n\trole LIKE '%admin%'\nQUERY;\n\n\t\treturn $this->database->query( $query, 'Get admins from player table' );\n\t}",
"function find_all_admins() {\r\n\t\tglobal $db;\r\n\t\t\r\n\t\t$query = \"SELECT * \";\r\n\t\t$query .= \"FROM admins \";\r\n\t\t$query .= \"ORDER BY username ASC\";\r\n\t\t$admins_set = mysqli_query($db, $query);\r\n\t\tconfirm_query($db);\r\n\t\treturn $admins_set;\r\n\t}",
"public function admins()\n {\n return $this->belongsToMany(Config::get('guardian.admin_user'), Config::get('guardian.role_admin_user_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.admin_user_foreign_key'));\n }",
"function find_all_admins() {\n\t\tglobal $connection;\n\n\t\t$query = \"SELECT * FROM admins ORDER BY username ASC\";\n\t\t$admin_list = mysqli_query($connection, $query);\n\t\tconfirm_query($admin_list);\n\t\treturn $admin_list;\n\t}",
"public function index()\n {\n return Admins::all();\n }",
"public static function getAdminsList()\n {\n $data_to_load = [];\n if(DatabaseManager::fetchInto(\"main\", $data_to_load, \"SELECT * FROM `admin_users`\") === false)\n Status::message(Status::ERROR, \"Couldn't retrieve `admin_users` from DB\");\n \n Status::message(Status::SUCCESS, $data_to_load);\n }",
"function getAdminList() {\n $dbConnect = getDbConnection();\n\n $query = 'SELECT * FROM admins';\n $statement = $dbConnect->prepare($query);\n\n $statement->execute();\n $resultSet = $statement->get_result();\n\n $statement->close();\n $dbConnect->close();\n\n return $resultSet;\n }",
"public function indexAdmin ()\n {\n $listOfUsers = $this->userRequest->usersIndexForAdmin();\n return $listOfUsers;\n }",
"public function &getListaAdmins() {\n $admins = array();\n $query = \"select * from admins\";\n \n $mysqli = Db::getInstance()->connectDb();\n if (!isset($mysqli)) {\n error_log(\"[getListaAdmins] impossibile inizializzare il database\");\n $mysqli->close();\n return $admins;\n }\n $result = $mysqli->query($query);\n if ($mysqli->errno > 0) {\n error_log(\"[getListaAdmins] impossibile eseguire la query\");\n $mysqli->close();\n return $admins;\n }\n\n while ($row = $result->fetch_array()) {\n $admins[] = self::creaAdminDaArray($row);\n }\n\n $mysqli->close();\n return $admins;\n }",
"public function admins() {\n $data = array();\n // verify user has priviledges\n if($this->User->isLoggedIn() && $this->User->isAdmin()) {\n $flash = null;\n \n if (isset($_POST['delete_admin'])) {\n if ($this->User->removeAdminRights($_POST['user_id'])) {\n $flash = \"Admin user removed\";\n }\n }\n \n if (isset($_POST['email'])) {\n $user_id = $this->User->getByEmail($_POST['email']);\n if(isset($user_id['id'])) {\n if($this->User->bestowAdminRights($user_id['id'])) {\n $flash = \"{$_POST['email']} added as an admin.\";\n }\n }\n }\n \n // fetch admin users\n $users = $this->User->getAdmins();\n \n //set the title\n $data = array(\n 'users' => $users,\n 'flash' => $flash,\n 'title' => 'Manage Admin Users'\n );\n \n } else {\n header(\"Location: \".app::site_url(array('users','login')));\n exit(0);\n }\n return $data;\n }",
"public function getWebsitesAdmin()\n {\n $res = $this->searchAdmin();\n if ($res) {\n array_push($this->site_ids, array('access' => 'admin', 'ids' => array()));\n if ($res['count'] > 0) {\n foreach ($res as $r) {\n if (is_array($r)) {\n array_push($site_ids[1]['ids'], $this->getSiteId($r[strtolower($this->to_get_admin)][0]));\n }\n }\n }\n }\n }",
"private function get_siteadmins() {\n global $DB;\n $sql = \"SELECT rgt.userid, rgt.gmail\n FROM mdl_repository_gdrive_tokens rgt\n JOIN mdl_config cfg\n ON cfg.name = 'siteadmins'\n WHERE find_in_set(rgt.userid, cfg.value) > 0;\";\n $siteadmins = $DB->get_records_sql($sql);\n return $siteadmins;\n }",
"private function get_admins_info() {\n $stm=$this->uSup->get_com_admins_to_notify_about_requests(\"user_id\",$this->company_id);\n\n $q_user_id=\"(1=0 \";\n /** @noinspection PhpUndefinedMethodInspection */\n while($admin=$stm->fetch(PDO::FETCH_OBJ)) {\n $q_user_id.=\" OR u235_users.user_id='\".$admin->user_id.\"' \";\n }\n $q_user_id.=\")\";\n try {\n /** @noinspection PhpUndefinedMethodInspection */\n $stm=$this->uFunc->pdo(\"uAuth\")->prepare(\"SELECT DISTINCT\n firstname,\n secondname,\n email\n FROM\n u235_users\n JOIN \n u235_usersinfo\n ON\n u235_users.user_id=u235_usersinfo.user_id AND\n u235_usersinfo.status=u235_users.status\n WHERE\n \" .$q_user_id. \" AND \n u235_users.status='active' AND\n u235_usersinfo.site_id=:site_id\n \");\n $site_id=site_id;\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('120'/*.$e->getMessage()*/);}\n\n return $stm;\n }",
"function adminUserList()\n {\n $arrClms = array(\n 'pkAdminID',\n 'AdminUserName',\n 'AdminCountry',\n 'AdminRegion'\n );\n $varWhr = \"AdminType = 'user-admin'\";\n $varOrderBy = 'AdminUserName ASC ';\n $arrRes = $this->select(TABLE_ADMIN, $arrClms, $varWhr);\n //pre($arrRes);\n return $arrRes;\n }",
"function get_super_admins()\n {\n }",
"public function getProjectAdminList() {\n\t\treturn $this->getProjectDao()->getProjectAdminList();\n\t}",
"public function admins()\n {\n return $this->hasMany(\\App\\User::class, 'partner_user', 'partner_id', 'user_id');\n }",
"public function getPlatformAdmins()\n {\n return $this->repository->createQueryBuilder('u')\n ->where('u.roles LIKE :role_super_admin')\n ->orWhere('u.roles LIKE :role_admin')\n ->setParameters(['role_super_admin' => '%ROLE_SUPER_ADMIN%', 'role_admin' => '%ROLE_ADMIN%'])\n ->getQuery()\n ->getResult();\n }",
"public static function get_admin_users(){\n \n global $db;\n \n $query = \"SELECT * FROM users \";\n $query .= \"WHERE user_role = 'admin'\";\n \n $result = User::makeQuery($query);\n \n return $result;\n }"
] | [
"0.77995116",
"0.771568",
"0.76979196",
"0.76258594",
"0.7536488",
"0.74002284",
"0.7244273",
"0.72357184",
"0.7123914",
"0.70668447",
"0.70222193",
"0.70147294",
"0.7008521",
"0.6975748",
"0.69615585",
"0.69482386",
"0.69318366",
"0.69177365",
"0.6878754",
"0.68160784",
"0.6813556",
"0.67553765",
"0.668204",
"0.66749626",
"0.6667275",
"0.666597",
"0.66650504",
"0.6645494",
"0.6643664",
"0.66328865"
] | 0.7827995 | 0 |
returns all addresses of this company as RowSet | public function getAddresses() {
$table = new Yourdelivery_Model_DbTable_Locations();
return $table->fetchAll('companyId = ' . $this->getId());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findAll()\n {\n return $this->em->getRepository(Address::class)->findAll();\n }",
"public function getCompanyAddresses(Company $company)\n {\n $builder = $company->addresses()->getQuery();\n\n $resource = $this->datatable->setQueryBuilder($builder);\n\n return $resource->getResponse();\n }",
"public function addresses()\n {\n return $this->morphMany(config('contactable.models.address', Address::class), 'addressable')\n ->orderBy('position', 'asc');\n }",
"public function getAddresses()\n {\n return $this->addresses;\n }",
"public function getAddresses()\n {\n return $this->addresses;\n }",
"public function get_addresses() {\n\t\treturn $this->addresses;\n\t}",
"private function getAddresses()\n\t{\n\t\t\n\t\t$userID = $this->session->userID;\n\t\t$addresses = $this->dbConnection->prepareRecordSet(\"SELECT * FROM b_user_address WHERE user_id = ? AND record_status = 'A'\", $userID);\n\n\t\treturn $addresses;\n\t\t\n\t}",
"private function getAddresses()\n {\n $doctrine = $this->getDoctrine();\n\n /** @var \\Doctrine\\ORM\\QueryBuilder $qb */\n $qb = $doctrine\n ->getRepository('BadcowAddressBundle:BaseAddress')\n ->createQueryBuilder('a');\n\n $qb->add('where', $qb->expr()->orX(\n $qb->expr()->isNull('a.latitude'),\n $qb->expr()->isNull('a.longitude')\n ));\n\n return $qb->getQuery()->getResult();\n }",
"public function addresses()\n {\n return $this->hasMany('App\\Address')->where('is_editable', '=', true);\n }",
"public function addresses() {\n return $this->hasMany(Models\\Address::class);\n }",
"public function addresses()\n {\n return $this->hasMany(Address::class);\n }",
"public function addresses()\n {\n return $this->hasMany(Address::class);\n }",
"public function addresses()\n {\n return $this->hasMany(Address::class);\n }",
"public function addresses()\n {\n return $this->hasMany(\"FJR\\models\\AddressModel\", \"customer_id\");\n }",
"private function _getAddresses()\n\t {\n\t\t$hashes = [];\n\t\t$rows = $this->_db->exec(\"SELECT `city`, `address` FROM `addresses` WHERE `phone` = '\" . $this->phone . \"'\");\n\t\twhile($row = $rows->getRow())\n\t\t {\n\t\t\t$address = $row[\"city\"] . \", \" . $row[\"address\"];\n\t\t\t$sliced = new AddressSlicer($address);\n\n\t\t\tif ($sliced->valid() === true && isset($hashes[$sliced->hash]) === false)\n\t\t\t {\n\t\t\t\t$hashes[$sliced->hash] = $address;\n\t\t\t } //end if\n\n\t\t } //end while\n\n\t\treturn count($hashes);\n\t }",
"public function addresses()\n {\n return $this->hasMany('App\\Models\\Address', 'organization_id');\n }",
"public function getContactAddresses()\n {\n return clone $this->contactAddresses;\n }",
"public function getAddress() {\n\t\t//return $this->findParentRow(new Model_DbTable_Address());\n\t\tif ($this->_address) { } else {\n\t\t\tforeach ($this->_rowset->getLoadRows(new Model_DbTable_Address(), 'address') as $row) {\n\t\t\t\tif ($row->id == $this->idAddress) {\n\t\t\t\t\t$this->_address = $row;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t }\n\t return $this->_address;\n\t}",
"public function getAddresses() {\n\n\t\t$query = \"SELECT id, cap, street, name, city FROM agrishop__addresses WHERE profile_id = ? ;\";\n\n\t\t$options = [ 'types' => ['i'], 'params' => [Session::get('id')] ];\n\n\t\treturn $this->db->directQuery($query, $options) ?: [];\n\n\t}",
"function &getAll( )\n {\n $db =& eZDB::globalDatabase();\n $address_array = 0;\n \n $db->array_query( $address_array, \"SELECT * FROM eZAddress_Address\" );\n \n return $address_array;\n }",
"public function ShipmentFrom_AddressList() {\n\t\treturn $this->db->get_results(\n\t\t\t\"SELECT * FROM wp_azlabs_address\", \n\t\t\tARRAY_A\n\t\t);\n\t}",
"public function getAddresses(){\n\t\t/* DIRECCIONES */\n\t\tglobal $dbh;\n\t\t$data = $dbh->query(\"SELECT * FROM direccion WHERE idCliente=?;\",array($this->id));\n\t\tif( $data!==false ){\n\t\t\tforeach( $data as $k=>$v ){\n\t\t\t\t$zona = $v['idZona'];\n\t\t\t\t$tmp = $dbh->query(\"SELECT c.nombre as comuna, p.nombre as ciudad, r.nombre as region FROM zona c LEFT JOIN zona p ON c.padre=p.id LEFT JOIN zona r ON p.padre=r.id WHERE c.id=?;\",array($zona));\n\t\t\t\t$data[$k] = array_merge($data[$k],$tmp[0]);\n\t\t\t}\n\t\t\t$this->data['direcciones'] = $data;\n\t\t\treturn $data;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getAllRecipientAddresses()\n {\n }",
"public function index()\n {\n $result = parent::index();\n $customer = $this->simiObjectManager->get('Magento\\Customer\\Model\\Session')->getCustomer();\n $addresses = $result['addresses'];\n foreach ($addresses as $index => $address) {\n $addressModel = $this->loadAddressWithId($address['entity_id']);\n $addresses[$index] = array_merge($address, $this->simiObjectManager\n ->get('Simi\\Simiconnector\\Helper\\Address')->getAddressDetail($addressModel, $customer));\n }\n $result['addresses'] = $addresses;\n return $result;\n }",
"function getAddresses()\r\n\t{\r\n\t\t// connect to the database\r\n\t\t//$this->dbsetup();\r\n\t\t\r\n\t\t$query = \"SELECT address FROM \" . $this->table . \" WHERE latitude = '0' AND longitude = '0'\";\r\n\t\t\r\n\t\t$result = mysql_query($query);\r\n\t\t\r\n\t\treturn $result;\r\n\t}",
"public function getAddressBooks();",
"public function addresses()\n {\n return $this->hasMany('App\\Address');\n }",
"public function addresses()\n {\n return $this->hasMany(UserAddress::class);\n }",
"public function getBillingAddresses()\n {\n return $this->morphMany(Address::class, 'addressable', ['type' => Address::TYPE_BILLING]);\n }",
"public function fetchAll(){\n $addresses = $this->addressMapper->fetchAll();\n\n $response = array('data' =>array());\n foreach($addresses as $address){\n $response['data'][] = array(\n $line[] = $address->getNom(),\n $line[] = $address->getDescription(),\n $line[] = $address->getAdresse(),\n $line[] = $address->getUrl(),\n $line[] = '<a href=\"#\" data-id=\"' . $address->getId() . '\" data-action=\"edit\"><i class=\"glyphicon glyphicon-pencil\"></i></a>' .\n ' <a href=\"#\" data-id=\"' . $address->getId() . '\" data-action=\"delete\"><i class=\"glyphicon glyphicon-remove-circle\"></i></a>'\n );\n }\n return json_encode($response); \n }"
] | [
"0.6976132",
"0.69164824",
"0.6807836",
"0.67456234",
"0.67456234",
"0.67003393",
"0.6654495",
"0.6609099",
"0.65740657",
"0.6525917",
"0.65118945",
"0.65118945",
"0.65118945",
"0.64756763",
"0.64585054",
"0.6455332",
"0.639679",
"0.6394862",
"0.63578767",
"0.6319674",
"0.62877107",
"0.6210491",
"0.6150103",
"0.6107063",
"0.6086482",
"0.6047504",
"0.60057473",
"0.5958789",
"0.59173495",
"0.59019166"
] | 0.7773257 | 0 |
get locations associated to this company | public function getLocations(){
$table = new Yourdelivery_Model_DbTable_Locations();
$locationRows = $table->fetchAll(sprintf('companyId = %d AND deleted = 0' , $this->getId()));
$locations = new SplObjectStorage();
foreach($locationRows as $locationRow){
try{
$loc = new Yourdelivery_Model_Location($locationRow['id']);
$locations->attach($loc);
}catch(Yourdelivery_Exception_Database_Inconsistency $e){
$this->logger->err(sprintf('Could not create location #', $locationRow['id']));
continue;
}
}
return $locations;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAddresses() {\n $table = new Yourdelivery_Model_DbTable_Locations();\n return $table->fetchAll('companyId = ' . $this->getId());\n }",
"function erp_company_get_locations() {\n global $wpdb;\n\n $cache_key = 'erp_company-location';\n $locations = wp_cache_get( $cache_key, 'wp-erp' );\n\n if ( false === $locations ) {\n $locations = $wpdb->get_results( \"SELECT * FROM {$wpdb->prefix}erp_company_locations\" );\n wp_cache_set( $cache_key, $locations, 'wp-erp' );\n }\n\n return $locations;\n}",
"function findAllLocations() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM locations;'));\r\n\r\n\t}",
"public function getLocations()\n {\n return $this->locations;\n }",
"public function getLocations()\n {\n return isset($this->Locations) ? $this->Locations : null;\n }",
"public function getHotelLocation()\n {\n return $this->select('city')->groupBy('city')->orderBy('city', 'ASC')->findAll();\n }",
"public function getAllLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.locations');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('f.*, u.full_name, u.user_name, u.country_iso')\n\t\t\t\t->from(Phpfox::getT('gmap'), 'f')\t\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.user_id = f.user_id')\t\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\t$aOutput = array();\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\tforeach($aRows as $aRow)\n\t\t{\n\t\t\t$aOutput[$aRow['country_iso']][] = $aRow;\n\t\t}\n\t\treturn $aOutput;\n\t}",
"public function companyOfUser(){\n\n $company = Auth::user()->companies;\n $location = Location::where('id', Auth::user()->company_location)->get();\n \n foreach($company as $c){\n $c['locations'] = $location;\n }\n\n return $company;\n }",
"public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }",
"public function get_locations() {\n $this->db->select('*');\n $this->db->from('locations');\n $query = $this->db->get();\n $query_result = $query->result();\n\n return $query_result;\n }",
"public function getLocations(){\n\n return response()->json( $this->locations );\n\n }",
"public function getAll()\n {\n return $this->apiRequest('application/locations');\n }",
"public function getLocations()\n {\n return $this->tpLocations;\n }",
"public static function getCampaignLocations()\n {\n return self::$db->fetchAll(\n 'SELECT banner_location_id AS value, description AS text FROM website.banner_location'\n );\n }",
"public static function getLocations(): array\n {\n return static::$locations;\n }",
"public function locations()\n {\n $data = $this->request('POST', 'api/v1/date/locations');\n return $data;\n }",
"private function get_cities_origin() {\n $t_location = get_transient('wcis_location');\n return $t_location['cities'];\n }",
"public function get_location()\r\n\t\t{\r\n\t\t\t$retArr = $this->obj->getBasics();\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}",
"public function findAllWithLocations()\n {\n $query = $this->createQuery();\n $fieldName = ((bool)ConfigurationUtility::getExtensionConfiguration()['enableFilterCategories']) ? 'filter_categories' : 'categories';\n $query->statement('\n SELECT DISTINCT\n sys_category.*\n FROM\n sys_category\n JOIN\n sys_category_record_mm\n ON sys_category_record_mm.uid_local = sys_category.uid\n WHERE\n sys_category_record_mm.tablenames = \"tx_locationmanager_domain_model_location\" AND\n sys_category_record_mm.fieldname = \"' . $fieldName . '\"\n GROUP BY\n sys_category.uid\n ');\n return $query->execute();\n }",
"public function getPlaces();",
"public static function get( ) {\n\t\t$StaffLocations = Client::request('staff/location');\n\t\t$StaffLocations = $StaffLocations['resultList'];\n\n\t\treturn array_map( function($StaffLocation){\n\n\t\t\treturn new StaffLocation($StaffLocation);\n\n\t\t}, $StaffLocations);\n\t}",
"public function all_locations() {\n\t\t// Globals\n\t\tglobal $wpdb;\n\t\t\n\t\t// Load the location from the db\n\t\t$sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_locations` ORDER BY `location` ASC;\";\n\t\t$sqlret = $wpdb->get_results( $sql, ARRAY_A );\n\t\t\n\t\t// Set the return array\n\t\t$return = new StdClass();\n\t\t\n\t\t// Loop through each result and process\n\t\tforeach( $sqlret as $location ) {\n\t\t\t// Group IDs are stored as an array. Make sure it is actually an array.\n\t\t\t$location['groups'] = rpids_unserialize( $location['groups'] );\n\t\t\t\n\t\t\t// Add location info to an array\n\t\t\t$return->$location['id'] = new StdClass();\n\t\t\t$return->$location['id']->id = $location['id'];\n\t\t\t$return->$location['id']->name = $location['location'];\n\t\t\t$return->$location['id']->groups = (object) $location['groups'];\n\t\t\t$return->$location['id']->weather_id = $location['weather_id'];\n\t\t\t$return->$location['id']->layout_id = $location['layout_id'];\n\t\t}\n\t\t\n\t\t// Return everything as an object\n\t\treturn $return;\n\t}",
"public function getAllLocations() {\n\t\t$query = $this->db->select(\"\n\t\t\tRoom.RoomID,\n\t\t\tRoomAbbr,\n\t\t\tRoomName,\n\t\t\tBuildingAbbr,\n\t\t\tRoom.IsApproved,\n\t\t\tBuilding.MapURL,\n\t\t\tOperators\")->\n\t\tfrom('Room')->\n\t\tjoin('Building', 'Building.BuildingID = Room.BuildingID')->\n\t\tjoin(\"\n\t\t\t(SELECT r.RoomID, GROUP_CONCAT(CONCAT(UserFname, ' ', UserLname)) AS Operators\n\t\t\tFROM User u\n\t\t\t\tJOIN UserRole ur ON u.UserID = ur.UserID\n\t\t\t\tJOIN UserRoom urm ON ur.UserRoleID = urm.UserRoleID\n\t\t\t\tJOIN Room r ON r.RoomID = urm.RoomID\n\t\t\tGROUP BY r.RoomID) AS other\", 'other.RoomID = Room.RoomID', 'left')->\n\t\tget();\n\n\t\treturn $query->result_array();\n\t}",
"public function locations($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'locations', $_query);\r\n }",
"public function getAllLocation($admin = false)\n {\n if ($admin) {\n return $this->deliveryLocation->all();\n }\n return $this->deliveryLocation->where('status', 1)->get();\n\n }",
"public function getAllCountriesLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.countries');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('fc.country_iso, c.name, c.phrase_var_name, fc.*, COUNT(u.user_id) as total_people')\n\t\t\t\t->from(Phpfox::getT('gmap_countries'), 'fc')\t\t\n\t\t\t\t->join(Phpfox::getT('country'), 'c', 'fc.country_iso = c.country_iso')\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.country_iso = fc.country_iso')\n\t\t\t\t->join(Phpfox::getT('gmap'), 'f', 'u.user_id = f.user_id')\n\t\t\t\t->group('u.country_iso')\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\t{\n\t\t\tforeach($aRows as $key => $aRow)\n\t\t\t{\n\t\t\t\tif(isset($aRow['phrase_var_name']) && $aRow['phrase_var_name'] != '')\n\t\t\t\t{\n\t\t\t\t\t$aRows[$key]['name'] = Phpfox::getPhrase($aRow['phrase_var_name']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$aRows = $this->sortByProperty($aRows, 'name');\n\t\t}\n\t\t\n\t\treturn $aRows;\n\t}",
"public function getall()\r\n {\r\n $locations = array();\r\n $count = 0;\r\n \r\n foreach($this->all() as $location)\r\n {\r\n $location = (array)$location;\r\n \r\n $locations[] = array('id' => $location['id'], 'name' => $location['name'],\r\n 'caption' => $location['caption'], 'description' => $location['description'],\r\n 'address' => $location['address'],\r\n 'contact' => $location['contact'],\r\n 'image1' => $location['image1'], 'image2' => $location['image2'],\r\n 'image3' => $location['image3'], 'image4' => $location['image4']);\r\n $count++;\r\n \r\n }\r\n \r\n if ($count > 0)\r\n {\r\n return $locations;\r\n }\r\n else\r\n {\r\n return null;\r\n } \r\n }",
"public function locations()\n {\n return $this->hasMany(Location::class, 'project_id');\n }",
"public function location(): array\n {\n return $this->location;\n }",
"public function locations()\n {\n return $this->hasMany(Location::class);\n }"
] | [
"0.73204905",
"0.7269763",
"0.715325",
"0.7091369",
"0.69753784",
"0.68884516",
"0.6781724",
"0.6735656",
"0.6646941",
"0.6572236",
"0.64921284",
"0.64795774",
"0.6343667",
"0.63180554",
"0.6298667",
"0.6285085",
"0.6283854",
"0.62782335",
"0.62691855",
"0.62336695",
"0.6228775",
"0.6209962",
"0.6169471",
"0.6168867",
"0.6111737",
"0.61095774",
"0.6107768",
"0.61034596",
"0.6078168",
"0.6076685"
] | 0.7332577 | 0 |
gets all Budgets that are related to a given address | public function getBudgetsByAddressId($addressId) {
$nnTable = new Yourdelivery_Model_DbTable_Company_Location();
$all = $nnTable->fetchAll('locationId = "' . $addressId . '"');
$collector = new SplObjectStorage();
foreach ($all AS $budget) {
try {
$budget = new Yourdelivery_Model_Budget($budget->id);
} catch (Yourdelivery_Exception_Database_Inconsistency $e) {
continue;
}
$collector->attach($budget);
}
return $collector;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAddressBooks();",
"public function getAddressBooks()\n {\n $response = $this->request('GET', 'addressbooks');\n\n return new Types\\AddressBook($response['addressBook']);\n }",
"public function findAll()\n {\n return $this->em->getRepository(Address::class)->findAll();\n }",
"public function getActiveAddressBooks();",
"function getAddressBalances($address=null, $asset_list=null){\n global $counterparty;\n $balances = array();\n // Break asset list up into chunks of 500 (API calls with more than 500 assets fail)\n $asset_list = array_chunk($asset_list, 500);\n foreach($asset_list as $assets){\n // Lookup any balance for this address and asset\n $filters = array(array('field' => 'address', 'op' => '==', 'value' => $address),\n array('field' => 'asset', 'op' => 'IN', 'value' => $assets));\n $data = $counterparty->execute('get_balances', array('filters' => $filters, 'filterop' => \"AND\"));\n if(count($data)){\n $balances = array_merge($balances, $data);\n }\n }\n return $balances;\n}",
"private function getAddresses()\n {\n $doctrine = $this->getDoctrine();\n\n /** @var \\Doctrine\\ORM\\QueryBuilder $qb */\n $qb = $doctrine\n ->getRepository('BadcowAddressBundle:BaseAddress')\n ->createQueryBuilder('a');\n\n $qb->add('where', $qb->expr()->orX(\n $qb->expr()->isNull('a.latitude'),\n $qb->expr()->isNull('a.longitude')\n ));\n\n return $qb->getQuery()->getResult();\n }",
"function getBusinessAddresses($userId) {\r\n $sql = $this->db->prepare(\"SELECT addressid, postal FROM BUSINESS JOIN USER ON USER.businessID=BUSINESS.businessID WHERE UserID=:user_id\");\r\n $sql->execute(array('user_id' => $userId));\r\n $result = $sql->fetch(PDO::FETCH_ASSOC);\r\n return $result;\r\n }",
"public function addresses()\n {\n return $this->hasMany('App\\Address');\n }",
"public function getBillingAddresses()\n {\n return $this->morphMany(Address::class, 'addressable', ['type' => Address::TYPE_BILLING]);\n }",
"public function addresses() {\n return $this->hasMany(Models\\Address::class);\n }",
"public function getAddressesByAccount($account);",
"public function getAll($person_id){\n $SQL = 'SELECT * FROM address_information JOIN country ON address_information.country_code = country.country_code WHERE person_id=:person_id';\n $STMT = self::$_connection->prepare($SQL);\n $STMT->execute(['person_id'=>$person_id]);\n $STMT->setFetchMode(\\PDO::FETCH_CLASS,'app\\\\models\\\\Address');\n return $STMT->fetchAll();//returns an array of all the records\n }",
"public function addresses()\n {\n return $this->hasMany(Address::class);\n }",
"public function addresses()\n {\n return $this->hasMany(Address::class);\n }",
"public function addresses()\n {\n return $this->hasMany(Address::class);\n }",
"public function addresses()\n {\n return $this->hasMany('App\\Models\\Address', 'organization_id');\n }",
"public function getBalances($address, $as_satoshis=false) {\n $result = $this->newAPIRequest('GET', '/balances/'.$address);\n $key = ($as_satoshis ? 'balancesSat' : 'balances');\n return $result[$key];\n }",
"public function getAddresses() {\n $table = new Yourdelivery_Model_DbTable_Locations();\n return $table->fetchAll('companyId = ' . $this->getId());\n }",
"public function ShipmentFrom_AddressList() {\n\t\treturn $this->db->get_results(\n\t\t\t\"SELECT * FROM wp_azlabs_address\", \n\t\t\tARRAY_A\n\t\t);\n\t}",
"public function findAll() {\n $sql = \"SELECT * FROM budget\";\n $result = $this->db->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $budget = array();\n foreach ($result as $row) {\n $budgetID = $row['id'];\n $budget[$budgetID] = $this->buildBudget($row);\n }\n return $budget;\n }",
"public function addresses()\n {\n return $this->hasMany('App\\Address')->where('is_editable', '=', true);\n }",
"private function getAddresses()\n\t{\n\t\t\n\t\t$userID = $this->session->userID;\n\t\t$addresses = $this->dbConnection->prepareRecordSet(\"SELECT * FROM b_user_address WHERE user_id = ? AND record_status = 'A'\", $userID);\n\n\t\treturn $addresses;\n\t\t\n\t}",
"public function address()\n {\n return $this->hasMany(Address::class, 'u_id', 'u_id')->orderBy('id');\n }",
"public function addresses()\n {\n return $this->hasMany(\"FJR\\models\\AddressModel\", \"customer_id\");\n }",
"function GetBusinesses()\n\t{\n\t\t$result = $this->sendRequest(\"GetBusinesses\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function getAddresses() {\n\n\t\t$query = \"SELECT id, cap, street, name, city FROM agrishop__addresses WHERE profile_id = ? ;\";\n\n\t\t$options = [ 'types' => ['i'], 'params' => [Session::get('id')] ];\n\n\t\treturn $this->db->directQuery($query, $options) ?: [];\n\n\t}",
"function getSubscribedAddressBooks() {\n $principalUriExploded = explode('/', $this->addressBookInfo['principaluri']);\n $path = 'addressbooks/' . $principalUriExploded[2] . '/' . $this->addressBookInfo['uri'];\n $id = $this->addressBookInfo['id'];\n\n $result = array_merge(\n $this->carddavBackend->getSharedAddressBooksBySource($id),\n $this->carddavBackend->getSubscriptionsBySource($path)\n );\n\n return $result;\n }",
"public function getFiltersAddresses()\n {\n return $this->hasMany(FilterAddress::className(), ['address_id' => 'id']);\n }",
"public function getaddressesbyaccount($account = ''){\n return $this->bitcoin->getaddressesbyaccount($account);\n }",
"public function budgets()\n {\n return $this->hasMany(Budget::class);\n }"
] | [
"0.6640048",
"0.61151385",
"0.5981912",
"0.59783477",
"0.58681965",
"0.5790016",
"0.5787011",
"0.57290065",
"0.5691443",
"0.56606495",
"0.56505084",
"0.5641255",
"0.56365776",
"0.56365776",
"0.56365776",
"0.56357634",
"0.56304324",
"0.5625829",
"0.5591508",
"0.5568026",
"0.5567595",
"0.55484253",
"0.5508672",
"0.5417676",
"0.53508425",
"0.5348092",
"0.5342372",
"0.53312314",
"0.5297519",
"0.5294861"
] | 0.6850676 | 0 |
gets all Billings of the Company filtered by $filter | public function getBillings($filter = null) {
$billingTable = new Yourdelivery_Model_DbTable_Billing();
$all = $billingTable->fetchAll('mode="company" AND refId="' . $this->getId() . '"');
$storage = new splObjectStorage();
foreach ($all AS $bill) {
try {
$bill = new Yourdelivery_Model_Billing($bill->id);
} catch (Yourdelivery_Exception_Database_Inconsistency $e) {
continue;
}
$storage->attach($bill);
}
return $storage;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function companyBillings($request)\n {\n if (Auth::user()->type != 'company') {\n throw new \\Exception('Unauthorized viewing of billing accounts.');\n }\n\n $data = [\n 'company_id' => Auth::user()->company->id,\n ]; \n\n $with = ['billable' => function($sub_query) { \n $sub_query->select('id', 'title', 'reference_id', 'price', 'incentive_per_share');\n \n }];\n \n $billings = $this->jobChoiceRepository->billing()->whereWhereMonthAndYear(\n $data, \n 'created_at', \n $request->month,\n $request->year,\n $with \n );\n \n // Fixed tax percentage\n $tax_percentage = Billing::VARIABLES['tax_percentage'];\n // Sub total amount of bills\n $sub_total_amount = $billings->sum('billable.incentive_per_share');\n // Result to be returned\n $result['billings'] = $billings; \n $result['sub_total_amount'] = $sub_total_amount;\n $result['consumption_tax_fee'] = $sub_total_amount * $tax_percentage;\n $result['total_amount_fee'] = $sub_total_amount + ($sub_total_amount * $tax_percentage);\n \n return $result;\n }",
"public function getBorrowings();",
"public function index(Request $request, BillCollectionFilter $filter)\n {\n// $bill_collection = BillCollection::filter($filter)\n// ->join('customer')\n// ->paginate($request->per_page);\n// return response()->json($bill_collection);\n\n $bill_collection = BillCollection::filter($filter)\n ->join('customers', 'customers.id', '=', 'bill_collections.customer_id')\n ->join('areas', 'areas.id', '=', 'customers.area_id')\n ->join('users', 'users.id', '=', 'bill_collections.user_id')\n ->select(\n 'bill_collections.id',\n 'bill_collections.customer_id',\n 'customers.code',\n 'customers.name',\n 'customers.phone',\n 'areas.name as area',\n 'customers.shared',\n 'customers.ppoe',\n 'customers.bandwidth',\n 'bill_collections.no_of_months',\n 'bill_collections.created_at',\n 'users.name as collector',\n 'bill_collections.total',\n 'bill_collections.discount',\n 'bill_collections.due_on',\n 'bill_collections.latest',\n 'bill_collections.lat',\n 'bill_collections.lon',\n DB::raw('(bill_collections.total - bill_collections.discount) as grand_total')\n )\n ->orderBy('created_at', 'desc')\n ->paginate($request->per_page);\n return response()->json($bill_collection);\n }",
"public function index(Request $request)\n {\n $input = $request->all();\n $bills = Bill::with(['booking'])->get();\n $billStatus = Bill::status();\n $billType = Bill::type();\n $billPaymentType = Bill::paymentType();\n\n if (count($input) > 0) {\n $billQuery = Bill::where('id', '>', 0);\n\n if (!empty($input['unique_number_filter'])) {\n $billQuery = $billQuery->where('unique_number', 'like', '%' . $input['unique_number_filter'] . '%');\n }\n\n if (!empty($input['booking_number_filter'])) {\n $billQuery = $billQuery->whereHas('booking', function ($q) use ($input) {\n $q->where('booking_number', 'like', '%' . $input['booking_number_filter'] . '%');\n });\n }\n\n if (!empty($input['type_filter'])) {\n $billQuery = $billQuery->where('type', $input['type_filter']);\n }\n\n if (!empty($input['amount_filter'])) {\n $billQuery = $billQuery->where('amount', 'like', '%' . $input['amount_filter'] . '%');\n }\n\n if (!empty($input['payment_type_filter'])) {\n $billQuery = $billQuery->where('payment_type', $input['payment_type_filter']);\n }\n\n if (!empty($input['status_filter'])) {\n $billQuery = $billQuery->where('status', $input['status_filter']);\n }\n\n if (!empty($input['start_date_filter'])) {\n $startDateFormatted = \\DateTime::createFromFormat('d/m/Y', $input['start_date_filter'])->format('Y-m-d');\n $billQuery = $billQuery->where('start_date', '>=', $startDateFormatted);\n }\n if (!empty($input['end_date_filter'])) {\n $endDateFormatted = \\DateTime::createFromFormat('d/m/Y', $input['end_date_filter'])->format('Y-m-d');\n $billQuery = $billQuery->where('start_date', '<=', $endDateFormatted);\n }\n\n if (!empty($input['author_id_filter'])) {\n $billQuery = $billQuery->whereHas('author', function ($q) use ($input) {\n $q->where('name', 'like', '%' . $input['author_id_filter'] . '%');\n });\n }\n\n $bills = $billQuery->get();\n\n $exportedFile = Excel::create(trans('bill::bills.title.export'), function ($excel) use (\n $bills,\n $billStatus,\n $billType,\n $billPaymentType\n ) {\n $excel->sheet(trans('bill::bills.title.export'), function ($sheet) use (\n $bills,\n $billStatus,\n $billType,\n $billPaymentType\n ) {\n $sheet->loadView('bill::admin.bills.export', array('bills' => $bills,\n 'status' => $billStatus,\n 'type' => $billType,\n 'paymentType' => $billPaymentType));\n });\n })->export('xls');\n\n return $exportedFile;\n }\n\n return view('bill::admin.bills.index', compact('bills', 'billStatus', 'billType', 'billPaymentType'));\n }",
"public function display_pending_bills()\n {\n // Check for an active session else redirect\n $this->app->check_active_session(2);\n\n // Load library\n $this->load->library('datatables');\n\n $columns = [\n 'bill_id' => function($value, $row, $num)\n {\n return $num++;\n },\n 'hospital_number' => null,\n 'patient_name' => function($value)\n {\n return ucwords($value);\n },\n 'patient_phone' => null,\n 'patient_type' => null,\n 'bill_debit' => function($value)\n {\n return number_format($value, 2);\n },\n 'receipt_number' => null,\n 'bill_date' => function($value)\n {\n return time_format($value, 'DD MMM. YYYY');\n },\n null => function($value)\n {\n $actions = '<a href=\"' . site_url('cashier/billing/') . $this->security->encrypt_id($value['bill_id']) . '\" class=\"btn btn-default btn-xs\">Pay Bill</a> ';\n\n return $actions;\n }\n ];\n\n $this->datatables->render_advance(\n $columns,\n 'SELECT {TOTAL_ROWS} *\n FROM bills\n WHERE {SEARCH_COLUMN} AND bill_status = 0\n ORDER BY {ORDER_COLUMN} {ORDER_DIR} {LIMIT_ROWS}'\n );\n }",
"public function getBills()\n {\n return $this->hasMany(Bill::className(), ['cust_id' => 'id']);\n }",
"public function bills()\n {\n return $this->hasMany(Bill::class, 'bil_booking');\n }",
"public function getBudgets() {\n $table = new Yourdelivery_Model_DbTable_Company_Budgets();\n $all = $table->fetchAll('companyId = ' . $this->getId());\n $obj = new splObjectStorage();\n foreach ($all AS $budget) {\n try {\n $budget = new Yourdelivery_Model_Budget($budget->id);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $obj->attach($budget);\n }\n return $obj;\n }",
"protected function billed()\n {\n return $this->builder->where('billed', true);\n }",
"public function filterMyBookingsAction()\n {\n $request = Request::createFromGlobals();\n $data = array();\n $data2 = array();\n $fromDate = $request->request->get('fromDay', '');\n $toDate = $request->request->get('toDay', '');\n $accountId = $request->request->get('accountId', '');\n $userId = $request->request->get('userId', '');\n $currencyCode = $request->request->get('currencyCode', '');\n $types = $request->request->get('types', '');\n $pg_start_page = $request->request->get('start', '');\n \n if(!$pg_start_page)\n $pg_start_page = 1;\n \n $commonCode = $this->commonCode();\n $countItem = $commonCode['countItem'];\n \n if($fromDate){\n $fromDate = new \\DateTime($fromDate);\n $fromDate = $fromDate->format('Y-m-d');\n }\n if($toDate){\n $toDate = new \\DateTime($toDate);\n $toDate = $toDate->format('Y-m-d');\n }\n $class = $commonCode['class'];\n $pg_limit_records = $commonCode['pg_limit_records'];\n $page = $pg_start_page;\n $count = $commonCode['count'];\n $pagination = '';\n $pg_start_page = ( $pg_start_page * $pg_limit_records ) - $pg_limit_records;\n $modules = $commonCode['modules'];\n $accountId = $commonCode['accountId'];\n if(!$userId){\n $userId = $commonCode['userId'];\n }\n $parameters['accountId'] = $accountId;\n $parameters['userId'] = $userId;\n $status = $commonCode['status'];\n $data2['preferredAccountCurrency'] = $commonCode['preferredAccountCurrency'];\n $data2['hotelModuleId'] = $commonCode['hotelModuleId'];\n $data2['flightModuleId'] = $commonCode['flightModuleId'];\n $data2['dealModuleId'] = $commonCode['dealModuleId'];\n $data2['approvedStatus'] = $commonCode['approvedStatus'];\n $data2['accountId'] = $accountId;\n $data2['modules'] = $modules;\n $params = array(\n 'accountId' => $accountId,\n 'userId' => $userId,\n 'currencyCode' => $currencyCode,\n 'fromDate' => $fromDate,\n 'toDate' => $toDate,\n 'types' => $types,\n 'status' => $status,\n 'start' => $pg_start_page,\n 'limit' => $pg_limit_records\n );\n $approvalFlow = $this->get('CorpoApprovalFlowServices')->getAllApprovalFlowList($params);\n \n $params['count']= 1;\n $countApprovalFlowList = $this->get('CorpoApprovalFlowServices')->getAllApprovalFlowList($params);\n if($countApprovalFlowList){\n $countItem = $countApprovalFlowList;\n $pagination = $this->getRelatedDiscoverPagination($countItem, $pg_limit_records, $page,$count ,$class );\n }\n \n $data2['allApprovalFlowList'] = $approvalFlow;\n $data['allApprovalFlow'] = $this->render('@Corporate/corporate/corporate-my-bookingsInfo.twig', $data2)->getContent();\n \n if($pagination){\n $data['pagination'] = $pagination;\n }\n\n $res = new Response(json_encode($data));\n $res->headers->set('Content-Type', 'application/json');\n\n return $res;\n }",
"public function searchCostBill() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n $criteria = new CDbCriteria;\n $criteria->order = 'id DESC';\n $criteria->compare('id', $this->id);\n $criteria->compare('bill_no', $this->bill_no, true);\n // $criteria->compare('bill_date', $this->bill_date, true);\n $criteria->compare('bill_from_date', $this->bill_from_date, true);\n $criteria->compare('bill_to_date', $this->bill_to_date, true);\n $criteria->compare('customer_id', $this->customer_id);\n // $criteria->compare('purchase_order_id', $this->purchase_order_id);\n $criteria->compare('item_id', $this->item_id);\n $criteria->compare('bill_type', $this->bill_type, true);\n $criteria->compare('print_type', $this->print_type, true);\n $criteria->compare('added_on', $this->added_on, true);\n $criteria->compare('particulars', $this->particulars, true);\n $criteria->condition=\"bill_type='cost_bill'\";\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function get_blasts() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/blasts.json\");\n }",
"function get_customerbookings($custID, $shipID, $filter = false, $filterable = false, $interval = '', $loginID = '', $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$q = (new QueryBuilder())->table('bookingc');\n\t\t$q->where('custid', $custID);\n\n\t\tif (!empty($shipID)) {\n\t\t\t$q->where('shiptoid', $shipID);\n\t\t}\n\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep']) {\n\t\t\t$q->where('salesrep', DplusWire::wire('user')->salespersonid);\n\t\t}\n\t\t$q->generate_filters($filter, $filterable);\n\n\t\tswitch ($interval) {\n\t\t\tcase 'month':\n\t\t\t\t$q->field($q->expr(\"CAST(CONCAT(YEAR(bookdate), LPAD(MONTH(bookdate), 2, '0'), '01') AS UNSIGNED) as bookdate\"));\n\t\t\t\t$q->field('SUM(amount) as amount');\n\t\t\t\t$q->group('YEAR(bookdate), MONTH(bookdate)');\n\t\t\t\tbreak;\n\t\t\tcase 'day':\n\t\t\t\t$q->field('bookingc.*');\n\t\t\t\t$q->field('SUM(amount) as amount');\n\t\t\t\t$q->group('bookdate');\n\t\t\t\tbreak;\n\t\t}\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t}",
"function wpbs_get_bookings($args = array(), $count = false)\n{\n\n $bookings = wp_booking_system()->db['bookings']->get_bookings($args, $count);\n\n /**\n * Add a filter hook just before returning\n *\n * @param array $bookings\n * @param array $args\n * @param bool $count\n *\n */\n return apply_filters('wpbs_get_bookings', $bookings, $args, $count);\n\n}",
"public function allCompanies()\n {\n return Company::all();\n }",
"public function room_bill_item()\n {\n return $this->hasManyThrough(BillItem::class, 'App\\Bill', 'bil_booking', 'bili_bill', 'book_id', 'bil_id')->whereHas('resource', function($query) {\n $query->where('rs_type', '=', 1);\n });\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $form = $this->createForm(BillingclassFilterType::class);\n if (!is_null($response = $this->saveFilter($form, 'billingclass', 'admin_billingclass'))) {\n return $response;\n }\n $qb = $em->getRepository('AppBundle:Billingclass')->createQueryBuilder('b');\n $paginator = $this->filter($form, $qb, 'billingclass');\n \n return array(\n 'form' => $form->createView(),\n 'paginator' => $paginator,\n );\n }",
"function get_billed_job() {\n\t\t// exit;\n\t\t$this->job_card_model->_table = 'view_service_billing_jobs';\n\t\t$where['jobcard_group'] = $this->input->get('jobcard_group');\n\n\t\tsearch_params();\n\t\t$rows = $this->job_card_model->find_all($where);\n\t\t$total = count($rows);\n\n\t\tforeach ($rows as $key => $value) {\n\t\t\t$rows[$key]->has_billed = 1;\n\t\t\t$rows[$key]->cost = $rows[$key]->price;\n\t\t}\n\t\t\n\t\t$this->job_card_model->_table = 'view_service_billing_outsideworks';\n\t\t$ow_rows = $this->job_card_model->findAll($where);\n\n\t\tforeach ($ow_rows as $key => $value) {\n\t\t\t$k = $total+$key;\n\t\t\t$rows[$k]['id'] = $value->id;\n\t\t\t$rows[$k]['job_id'] = $value->job_id;\n\t\t\t$rows[$k]['job'] = $value->job;\n\t\t\t$rows[$k]['job_description'] = $value->job_description;\n\t\t\t// $rows[$k]['min_price'] = $value->id;\n\t\t\t// $rows[$k]['customer_price'] = $value->amount + $value->taxes;\n\t\t\t$rows[$k]['cost'] = $value->price;\n\t\t\t$rows[$k]['discount_amount'] = $value->discount_amount;\n\t\t\t$rows[$k]['discount_percentage'] = $value->discount_percentage;\n\t\t\t$rows[$k]['margin_percentage'] = $value->margin_percentage;\n\t\t\t$rows[$k]['final_amount'] = $value->final_amount;\n\t\t\t// $rows[$k]['status'] = '';\n\t\t\t$rows[$k]['ow'] = true;\n\t\t\t$rows[$k]['has_billed'] = 1;\n\t\t}\n\t\t$total += count($ow_rows);\n\n\n\n\t\techo json_encode(array('total' => $total, 'rows' => $rows));\n\t}",
"public function showbill(Request $request) {\n try {\n $param = $request->all();\n if (!isset($param[\"RentalOID\"]) || !$param[\"RentalOID\"]) {\n $rtn = array(\n \"total\" => 0,\n \"data\" => [],\n );\n return response()->json(compact('rtn'));\n }\n $search = $request->get(\"search\");\n $order = $request->get(\"order\");\n $limit = $request->get(\"limit\");\n if ($search && isset($search[\"value\"]) && $search[\"value\"]) {\n $search = $search[\"value\"];\n } else {\n $search = \"\";\n }\n if ($order && isset($order[\"0\"]) && $order[\"0\"]) {\n $column = $order[\"0\"][\"column\"];\n $dir = $order[\"0\"][\"dir\"];\n }\n\n $rentalBill = Rental::showbill($param[\"RentalOID\"], $search, $order, $dir, $limit);\n\n $rtn = array(\n \"total\" => $rentalBill->total(),\n \"data\" => $rentalBill->items(),\n );\n return response()->json(compact('rtn'));\n\n return response()->json(compact('rentalBill'));\n } catch (Exception $ex) {\n Log::error($ex);\n return response()->json(['error' => trans('messages.systemError')], 411);\n }\n }",
"public function allBoons() {\n\n // retrieve all Boons\n $boonModel = new Boon();\n $boonList = $boonModel->findAllBoons(); // array of objects\n\n // Send the datas to the view\n $this->show('boons', [\n 'boonList' => $boonList\n ]);\n }",
"public function getBillingItem($id)\n {\n// foreach ($table_order as $order) {\n// $arr = Order::where(['OID' => $order->OID, 'is_cancelled' => 0])->get();\n $sql = 'select * from order_descriptions where OID in (select oid from tbl_order where tbl_id=\"' . $id . '\" and is_cancelled=0 and IsBill=0)';\n $bills = DB::select($sql);\n return view('bill.partial_bill_item')->with(['bills' => $bills]);\n }",
"protected function billable()\n {\n return $this->builder->where('billable', true);\n }",
"public function getAllCompanyByPage($filter, $page = 1, $page_size = 20, $orderby = '') {\n $regulatorToCompanyModel = new Model_Jiafuyun_RegulatorToCustomer();\n// $companyModel = new Model_Zhianbao_Company();\n $companyModel = new Model_Jiafuyun_Company();\n $rs = $regulatorToCompanyModel->getAll ( '*', $filter, $page, $page_size, $orderby );\n foreach ( $rs as $key => $value){\n $rs[$key]['create_time'] = strtotime($value['create_time']) == 0 ? '-': $value['create_time'];\n $rs[$key]['last_modify'] = strtotime($value['last_modify']) == 0 ? '-': $value['last_modify'];\n $companyInfo = $companyModel->get($value['company_id']);\n $rs[$key]['company_info'] = $companyInfo;\n }\n return $rs;\n }",
"function getBillsByUser($userID, $filterDest=\"any\") {\n\t$db = connectDB();\n $sql = <<<SQL\n \tSELECT billID, startDate, destination, description, cost, isPaid, userID\n \tFROM bills\n\t\tWHERE userID = ?\nSQL;\n\n\tif ($filterDest != \"any\") {\n\t\t$sql .= \" AND destination = ?\";\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param(\"ss\", $userID, $filterDest);\n\n\t} else {\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param(\"s\", $userID);\n\t}\n\n\n\t$stmt->execute();\n\n\t$res = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);\n\n\t$stmt->close();\n\t$db->close();\n\treturn $res;\n}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $agency = $this->getUser()->getAgency();\n $maincompany = $this->getUser()->getMaincompany();\n $type = $agency->getType();\n // $all = $em->getRepository('NvCargaBundle:Bill')->findBy(['canceled'=>FALSE, 'maincompany'=> $maincompany])\n $all = $em->getRepository('NvCargaBundle:Bill')->createQueryBuilder('b')\n ->where('b.status != :status')\n ->andwhere('b.maincompany = :maincompany')\n ->setParameters(array('maincompany' => $maincompany, 'status' => 'ANULADA'))\n ->orderBy('b.number', 'DESC')\n ->setMaxResults(500)\n ->getQuery()\n ->getResult();\n if ($type == \"MASTER\") {\n $entities = $all;\n } else {\n $entities = [];\n foreach ($all as $entity) {\n $guide = $entity->getGuides()->last();\n if ($guide->getAgency() === $agency()) {\n $entities[] = $entity;\n }\n }\n }\n return array(\n 'entities' => $entities,\n );\n\n }",
"public function getAllBusinesses() {\n\t\t$em = $this->getEntityManager();\n\t\t$businesses = $em->createQueryBuilder()\n\t\t\t->select('b.businessID,b.costCenter,b.name')\n\t\t\t->from('Business', 'b')\n\t\t\t->orderBy('b.name')\n\t\t\t->getQuery()\n\t\t\t->getResult();\n\t\t\n\t\t$response = array(\n\t\t\t\"businesses\" => $businesses\n\t\t);\n\t\t\n\t\treturn $this->respond($response);\n\t}",
"public static function getReportBillSalesByCustomer($company_id, $branch_id = null, $time_start, $time_end) {\n $bills = self::selectRaw('customer_id, sum(total) as sum, sum(base_price_total) as base_total')\n ->where('company_id', $company_id)\n ->where('customer_id','!=', 0);\n if(!empty($branch_id)) {\n $bills = $bills->where('branch_id', $branch_id);\n }\n $bills = $bills->where('status', '=', self::ACTIVE)->whereNull('deleted_at')\n ->whereBetween('sale_date', array($time_start, $time_end))\n ->groupBy(DB::raw('customer_id'))\n ->orderBy('sum','DESC')\n ->limit(10)\n ->get();\n return $bills;\n }",
"public function searchIncrementalBill() {\n // should not be searched.\n $criteria = new CDbCriteria;\n $criteria->order = 'id DESC';\n $criteria->compare('id', $this->id);\n $criteria->compare('bill_no', $this->bill_no, true);\n // $criteria->compare('bill_date', $this->bill_date, true);\n $criteria->compare('bill_from_date', $this->bill_from_date, true);\n $criteria->compare('bill_to_date', $this->bill_to_date, true);\n $criteria->compare('customer_id', $this->customer_id);\n // $criteria->compare('purchase_order_id', $this->purchase_order_id);\n $criteria->compare('item_id', $this->item_id);\n $criteria->compare('bill_type', $this->bill_type, true);\n $criteria->compare('print_type', $this->print_type, true);\n $criteria->compare('added_on', $this->added_on, true);\n $criteria->compare('particulars', $this->particulars, true);\n $criteria->condition=\"bill_type='incremental_bill'\";\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }",
"public function getBans(User_Model_Row_Account $account, $filter = null) {\n\t\t\n\t}",
"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}"
] | [
"0.71305776",
"0.65136105",
"0.61629456",
"0.61071646",
"0.6101719",
"0.5972914",
"0.5969841",
"0.5923577",
"0.58913356",
"0.5872776",
"0.58487344",
"0.58283657",
"0.57602173",
"0.57503307",
"0.55982226",
"0.55793315",
"0.5564691",
"0.5559925",
"0.5559049",
"0.55503607",
"0.5545811",
"0.55343145",
"0.551965",
"0.55139786",
"0.5494404",
"0.54846394",
"0.548233",
"0.54522175",
"0.54407287",
"0.5437619"
] | 0.7499952 | 0 |
get all costcenters assigned to company | public function getCostcenters() {
return $this->getDepartments(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allCompanies()\n {\n\n $companies = $this->core_companies;\n\n $items = [];\n foreach ($companies as $company) {\n\n $companyItem = new CompanyCardItem();\n $companyItem->id = $company->id;\n $companyItem->name = $company->name;\n //$companyItem->amount = $catalog->amount;\n $companyItem->title = $company->title;\n if (\\Dash\\count($company->photo))\n $companyItem->image = '/uploaz/eyuf/UserCompany/photo/' . $company->id . '/' . $company->photo[0];\n $companyItem->url = ZUrl::to([\n 'customer/markets/show',\n 'id' => $company->id\n ]);\n $companyItem->distence = \"12km\";\n //$companyItem->image = $catalog->price;\n //$companyItem->price = $catalog->price_old;\n //$companyItem->currency = \"$\";\n //$companyItem->cart_amount = 0;\n\n $items[] = $companyItem;\n }\n return $items;\n }",
"public function getAllForCustonObj() {\n $query = $this->db->query(\"SELECT * FROM $this->table ORDER BY shortname;\");\n $this->allcpny = $query->custom_result_object('entity\\Company');\n // print \"<pre>\";\n // print_r($this->cpny);\n // print \"</pre>\";\n // exit();\n return $this->allcpny;\n }",
"function Companies(){\n\t\t\t\treturn $this->companies;\n\t\t\t}",
"public function costCenterAllocated($years)\n {\n $entityManager = $this->getEntityManager();\n\n // Get the current open year\n $year = $years->findOneBy(['is_open' => true, 'is_current' => true]);\n\n $dql = 'SELECT c \n FROM App\\Entity\\CostCenter c, App\\Entity\\ParamCostCenter p \n WHERE c.id = p.costcenter AND p.year = ' . $year;\n $query = $entityManager->createQuery($dql);\n var_dump($query->execute());\n die;\n return $query->execute();\n }",
"public function allCompanies()\n {\n return Company::all();\n }",
"public function companies(): Collection\n {\n return Company::all();\n }",
"public function listarCentro()\r\n {\r\n $sql = \"SELECT * FROM Centro\";\r\n $resultado = $this-> conex-> consultaRetorno($sql);\r\n return $resultado;\r\n }",
"public function get_centroCosto(){\n\t\t\t\n\t\t\ttry { \n\t\t\t\tglobal $conn;\n\t\t\t\t$sql=\"SELECT distinct AREA.COD_CC2, AREA.NOM_CC2 \n\t\t\t\t\t\tFROM CENTROCOSTO2 AREA, EMPLEADOS_BASIC EPL, EMPLEADOS_GRAL GRAL\n\t\t\t\t\t\tWHERE EPL.COD_EPL = GRAL.COD_EPL\n\t\t\t\t\t\tAND EPL.COD_CC2=AREA.COD_CC2\n\t\t\t\t\t\tand AREA.estado='A'\n\t\t\t\t\t\tand EPL.estado='A'\n\t\t\t\t\t\torder by nom_cc2 asc\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\twhile($fila=$rs->FetchRow()){\n\t\t\t\t\t$this->lista[]=array(\"codigo\" => $fila[\"COD_CC2\"],\n\t\t\t\t\t\t\t\t\t\t \"area\"\t => utf8_encode($fila[\"NOM_CC2\"]));\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn $this->lista;\n\t\t\t\t\n\t\t\t}catch (exception $e) { \n\n\t\t\t var_dump($e); \n\n\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t} \n\t\t\t\n\t\t\t\n\t\t}",
"public function scopeCostCenters($query)\n\t{\n\t\treturn $query->where('cost_center', 1);\n\t}",
"public function getSalesCenterAndCommodity(Request $request) {\n $client = Client::find($request->client_id);\n if (!empty($client)) {\n /* check user access level */\n if(Auth::check() && Auth::user()->hasAccessLevels('salescenter')) {\n $salesCenters = getAllSalesCenter();\n } else {\n $salesCenters = $client->salesCenters()->orderBy('name')->get();\n }\n $commodity = $client->commodity()->orderBy('name')->get();\n\n return response()->json([\n \"status\" => true,\n \"data\" => [\n 'sales_centers' => $salesCenters,\n 'commodity' => $commodity\n ]\n ]);\n } else {\n $salesCenters = getAllSalesCenter();\n $commodity = Commodity::orderBy('name')->get();\n return response()->json([\n\n \"status\" => true,\n \"data\" => [\n 'sales_centers' => $salesCenters,\n 'commodity' => $commodity\n ]\n ]);\n }\n }",
"public function get_cargosCentroCosto($centro_costo,$cargos){\n\t\t\t\n\t\t\t\n\t\t\ttry { \n\t\t\t\tglobal $conn;\n\t\t\t\t$sql=\"select cod_epl, rtrim(nom_epl)+' '+rtrim(ape_epl) as nombres from empleados_basic where cod_car='\".$cargos.\"' and cod_cc2 ='\".$centro_costo.\"' and estado='A'\";\n\n\t\t\t\t\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\twhile($fila=$rs->FetchRow()){\n\t\t\t\t\t$this->lista[]=array(\"codigo\" => $fila[\"cod_epl\"],\n\t\t\t\t\t\t\t\t\t\t \"nombres\"=> utf8_encode($fila[\"nombres\"]));\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn $this->lista;\n\t\t\t\t\n\t\t\t}catch (exception $e) { \n\n\t\t\t var_dump($e); \n\n\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t} \n\t\t}",
"public function getAvailableCompanies()\n {\n return $this->createQuery('c')\n ->select('c.*')\n ->addSelect(\n \"(SELECT ROUND(AVG(r.rating), 2)\n FROM Companies_Model_Review r\n WHERE r.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND r.company_id = c.id) as rating\"\n )\n ->addSelect(\"(SELECT COUNT(rc.id)\n FROM Companies_Model_Review rc\n WHERE rc.status = '\" . Companies_Model_Review::STATUS_PUBLISHED . \"'\n AND rc.company_id = c.id) as review_count\")\n ->whereIn('c.status', Companies_Model_Company::getActiveStatuses())\n ->orderBy('rating DESC')\n ->execute();\n }",
"public function getOriginCompanies () {\n $corp = $this->perteneceCorporacion();\n\n if ($corp) {\n return new ArrayObjectList([$corp, $this]);\n }\n\n return new ArrayObjectList([$this]);\n }",
"public function getCompany();",
"public function getCompanyWithUsers();",
"public function getContracts()\n {\n return $this->hasMany(Contracts::className(), ['company_id' => 'id']);\n }",
"public static function all() {\n\n $db = Zend_Registry::get('dbAdapter');\n $result = $db->query('select id from companys')->fetchAll();\n $companys = new SplObjectStorage();\n foreach ($result as $c) {\n try {\n $company = new Yourdelivery_Model_Company($c['id']);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n continue;\n }\n $companys->attach($company);\n }\n return $companys;\n }",
"public function testGetCentersList()\n {\n if ($this->only_priority_tests) {\n $this->markTestSkipped(\"Running only priority tests.\");\n }\n\n $this->load('/centers?city_id=1');\n $data = json_decode($this->response->getContent());\n\n $this->assertEquals($data->status, 'success');\n $search_for = 'Ashadeep';\n $found = false;\n foreach ($data->data->centers as $key => $info) {\n if ($info->name == $search_for) {\n $found = true;\n break;\n }\n }\n $this->assertTrue($found);\n $this->assertEquals(count($data->data->centers), 8);\n $this->response->assertStatus(200);\n }",
"public function getCompany() {\n return Companies::findById($this->company_id);\n }",
"public function sitemapCompanies(){\n $links = array();\n $models = ORM::factory('CatalogCompany')->where('enable','=','1')->find_all();\n foreach($models as $model)\n $links[] = $model->getUri();\n return $links;\n }",
"public function getFreeCompanies() { return $this->FreeCompanies; }",
"public function getCompany() {}",
"public function getEmployeesByCostCenter($costCenter) {\n\t\t$em = $this->getEntityManager();\n\t\t$employees = $em->getRepository('Employee')->findByCostCenter($costCenter);\n\t\t\n\t\tforeach ($employees as &$employee) {\n\t\t\t$metaData = $em->getRepository('MetaData')->findBy(array(\n\t\t\t\t'type' => 'employee',\n\t\t\t\t'typeID' => $employee->getEmployeeID()\n\t\t\t), array(\n\t\t\t\t'valueOrder' => 'ASC'\n\t\t\t));\n\t\t\t$employee->meta_data = $metaData;\n\t\t}\n\t\t\n\t\treturn $this->respond($employees);\n\t}",
"public function getCompanyEmployees();",
"public static function getEnterpriseCompanies(){\n $result = db::get(\"SELECT uid_empresa FROM \". TABLE_EMPRESA .\" WHERE is_enterprise = 1 ORDER BY nombre\", \"*\", 0, \"empresa\");\n return new ArrayObjectList($result);\n }",
"public function getCompaniesCrmSearchUrl()\n {\n $type = 'company' ;\n return $this->getEntitiesCrmSearchUrl( $type ) ;\n }",
"public function getCompanies($document)\n {\n $docs = $this->clienteRepository->getCompanies($document);\n\n return $this->ok($docs);\n }",
"public function obtenerCentroCotizacions($count = false){\n if( $count ){\n $sql = \"SELECT count(uid_elemento) FROM \". TABLE_CENTRO_COTIZACION .\" WHERE uid_elemento = {$this->getUID()} AND uid_modulo = {$this->getModuleId()}\";\n return $this->db->query($sql, 0, 0);\n } else {\n $sql = \"SELECT uid_centrocotizacion FROM \". TABLE_CENTRO_COTIZACION .\" WHERE uid_elemento = {$this->getUID()} AND uid_modulo = {$this->getModuleId()}\";\n $items = $this->db->query($sql, \"*\", 0, \"centrocotizacion\");\n return new ArrayObjectList($items);\n }\n }",
"function getCostAccountCompany(){\n\treturn campo('config_system','id','1','cost_account_company');\n}",
"function getCostAccountCompany(){\n\treturn campo('config_system','id','1','cost_account_company');\n}"
] | [
"0.6078663",
"0.60649323",
"0.6006163",
"0.5973317",
"0.597003",
"0.5969973",
"0.57983834",
"0.5781345",
"0.57776815",
"0.57615197",
"0.5721366",
"0.56990105",
"0.5654105",
"0.56503934",
"0.56401664",
"0.5624275",
"0.55778736",
"0.55733246",
"0.5542282",
"0.5516759",
"0.5501126",
"0.5492277",
"0.5448659",
"0.5444308",
"0.54324055",
"0.5383851",
"0.5377069",
"0.5367695",
"0.5360515",
"0.5360515"
] | 0.73927546 | 0 |
check wether this company has a department or not | public function hasDepartments() {
$deps = $this->getDepartments();
if ($deps->count() > 0) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasDepartment() {\n return $this->_has(2);\n }",
"public static function isDepartment( $did ) {\n\t\t$db = JFactory::getDbo();\n\t\t$query = \"SELECT COUNT(*) FROM `#__obhelpdesk3_departments` WHERE id=\" . $did . \" AND published = 1\";\n\t\t$db->setQuery( $query );\n\t\tif ( $db->loadResult() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function hasDepartment($department) {\n\t\t$hasDepartment = ConstructionDepartmentQuery::create()->filterByConstruction($this)->filterByDepartment($department)->count();\n\t\tif ($hasDepartment > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function getDepartment() { \n if(!$this->department || !$this->department->department)\n return false;\n\n return $this->department->department;\n }",
"function verify_dept($dept) {\n if ($dept != \"Techie\" || $dept != \"IT\" || $dept != \"NOC\" || $dept != \"Marketing\") {\n return \"<span>*Invalid Department</span>\";\n } else {\n return $dept;\n }\n }",
"private function verify_department(){\n $active_department_id = $request->session()->get('active_dept_id',1) ; \n $department = Department::find($active_department_id);\n }",
"private function check_item_department_required($field, $value) {\n if( $field ) {\n if( $value == \"\" || empty($value) ) {\n return false;\n }\n }\n return true;\n }",
"public function checkPersonnelDepartment($staffId)\n {\n $hFunction = new \\Hfunction();\n $modelStaffWorkDepartment = new QcStaffWorkDepartment();\n $result = $this->infoActivityOfStaff($staffId);\n $resultStatus = false;\n if ($hFunction->checkCount($result)) {\n if ($modelStaffWorkDepartment->checkPersonnelDepartment($result->workId())) $resultStatus = true;\n }\n return $resultStatus;\n }",
"function get_department(){\n $this->_db2->where(\"DeleteFlag\",\"A\");\n return $this->_db2->get($this->_tblorg);\n }",
"public function checkDesignDepartment($staffId)\n {\n $hFunction = new \\Hfunction();\n $modelStaffWorkDepartment = new QcStaffWorkDepartment();\n $result = $this->infoActivityOfStaff($staffId);\n $resultStatus = false;\n if ($hFunction->checkCount($result)) {\n if ($modelStaffWorkDepartment->checkDesignDepartment($result->workId())) $resultStatus = true;\n }\n return $resultStatus;\n }",
"public function checkManageDepartment($staffId)\n {\n $hFunction = new \\Hfunction();\n $modelStaffWorkDepartment = new QcStaffWorkDepartment();\n $result = $this->infoActivityOfStaff($staffId);\n $resultStatus = false;\n if ($hFunction->checkCount($result)) {\n if ($modelStaffWorkDepartment->checkManageDepartment($result->workId())) $resultStatus = true;\n }\n return $resultStatus;\n }",
"public function testGetDepartmentWithRestrictionCheck()\n\t{\n\t\t// manually set phonelistRestrict on if its off;\n\t\t/** @var SystemConfigRepository $systemConfigRepo */\n\t\t$systemConfigRepo = self::$em->getRepository(SystemConfig::class);\n\t\t$currentPhonelistRestrictState = self::$originalPhonelistRestrictState;\n\t\tif (!$currentPhonelistRestrictState) {\n\t\t\t/** @var SystemConfig $dorEmployeeRestrict */\n\t\t\t$dorEmployeeRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t\t$dorEmployeeRestrict->setValue('yes');\n\t\t\tself::$em->flush();\n\t\t\tself::$em->refresh($dorEmployeeRestrict);\n\t\t}\n\n\t\t//The office to get departments from\n\t\t$officeId = 55;\n\n\t\t//The department to get details from\n\t\t$departmentId = 56;\n\n\t\t$headers = array(\n\t\t\t 'HTTP_AUTHORIZATION' => HttpHeader::BEARER.' '.self::$token,\n\t\t);\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\t Request::METHOD_GET,\n\t\t\t '/api/v1/offices/'.$officeId.'/departments'.'/'.$departmentId,\n\t\t\t array(),\n\t\t\t array(),\n\t\t\t $headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$department = json_decode($response->getContent(), true);\n\t\t$department = $department['data'];\n\n\t\t//Test that a office has at minimum the below values\n\t\t$this->assertArrayHasKey('id', $department);\n\t\t$this->assertArrayHasKey('name', $department);\n\t\t$this->assertArrayHasKey('children', $department);\n\n\t\t//Test that a child has at minimum the below values\n\t\t$children = $department['children'];\n\t\t$this->assertTrue(sizeof($children) > 0);\n\n\t\t//Test if exactly x departments are returned\n\t\t$this->assertTrue(2 === count($children));\n\n\t\tforeach ($children as $child) {\n\t\t\t$this->assertArrayHasKey('id', $child);\n\t\t\t$this->assertArrayHasKey('name', $child);\n\t\t\t$this->assertArrayHasKey('children', $child);\n\t\t}\n\n\t\t// manually set phonelistRestrict off if its on;\n\t\t$dorEmployeeRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t$dorEmployeeRestrict->setValue('no');\n\t\tself::$em->flush();\n\t\tself::$em->refresh($dorEmployeeRestrict);\n\t\t$currentPhonelistRestrictState = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT)->getNormalizedValue();\n\n\t\t// HTTP client\n\t\t$client = static::createClient();\n\t\t$client->request(\n\t\t\tRequest::METHOD_GET,\n\t\t\t'/api/v1/offices/'.$officeId.'/departments'.'/'.$departmentId,\n\t\t\tarray(),\n\t\t\tarray(),\n\t\t\t$headers\n\t\t);\n\n\t\t/** @var Response $response */\n\t\t$response = $client->getResponse();\n\n\t\t// Test if response is OK\n\t\t$this->assertSame(Response::HTTP_OK, $response->getStatusCode());\n\n\t\t// Test that response is not empty\n\t\t$this->assertNotEmpty($response->getContent());\n\n\t\t// Test if Content-Type is valid application/json\n\t\t$this->assertSame(HttpHeader::APPLICATION_JSON, $response->headers->get(HttpHeader::CONTENT_TYPE));\n\n\t\t//Deserialize response\n\t\t$department = json_decode($response->getContent(), true);\n\t\t$department = $department['data'];\n\n\t\t//Test that a office has at minimum the below values\n\t\t$this->assertArrayHasKey('id', $department);\n\t\t$this->assertArrayHasKey('name', $department);\n\t\t$this->assertArrayHasKey('children', $department);\n\n\t\t//Test that a child has at minimum the below values\n\t\t$children = $department['children'];\n\t\t$this->assertTrue(sizeof($children) > 0);\n\n\t\t//Test if exactly x departments are returned\n\t\t$this->assertTrue(3 === count($children));\n\n\t\tforeach ($children as $child) {\n\t\t\t$this->assertArrayHasKey('id', $child);\n\t\t\t$this->assertArrayHasKey('name', $child);\n\t\t\t$this->assertArrayHasKey('children', $child);\n\t\t}\n\n\t\t// return phonelist restrict to original state\n\t\tif ($currentPhonelistRestrictState !== self::$originalPhonelistRestrictState) {\n\t\t\t$dorEmployeeRestrict = $systemConfigRepo->findOneByKey(SystemConfigKey::DOR_PHONELIST_RESTRICT);\n\t\t\t$dorEmployeeRestrict->setValue('yes');\n\t\t\tself::$em->flush();\n\t\t\tself::$em->refresh($dorEmployeeRestrict);\n\t\t}\n\t}",
"function fndepartmentCount() {\n\t\t$this->db->select(\"count(*) as selectCount\");\n\t\t$vResult = $this->db->get(t_department)->result();\n\t\tif($vResult) {\n\t\t\treturn $vResult[0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getCompany() {\n if(!$this->department || !$this->department->department || !$this->department->department->division || !$this->department->department->division->company)\n return false;\n\n return $this->department->department->division->company;\n }",
"public function getDepartment(){\r\n\t return $this->_department;\r\n\t}",
"public function existeDepartamento($dep) {\n $c=\"select * from departamentos where nom_dep=:n\";\n $stmt=parent::$conexion->prepare($c);\n try{\n $stmt->execute([\n ':n'=>$dep\n ]);\n }catch(PDOException $ex){\n die(\"Error al comprobar existencia del departamento: \". $ex->getMessage());\n }\n $fila=$stmt->fetch(PDO::FETCH_OBJ);\n return ($fila==null) ? false : true;\n }",
"public function get_department() \n {\n return $this->department;\n }",
"function getDepartment($code){\n\n\tglobal $DB;\n\t\n\tif($DB->query(\"SELECT code FROM department WHERE code = :code\", array(\n\t':code' => $code))){\n\t\treturn true;\n\t}\n\t\n\telse{\n\t\treturn false;\n\t}\n}",
"private function isCompanyRequired()\n {\n return $this->eavConfig->getAttribute('customer_address', 'company')->getIsRequired();\n }",
"public function dept_add_person_for_department(){\n $outputs = array();\n $empl_id = isset($_REQUEST['empl_id'])?$_REQUEST['empl_id']:null;\n $dept_id = isset($_REQUEST['dept_id'])?$_REQUEST['dept_id']:null;\n if(empty($empl_id) or empty($dept_id)){\n $outputs['code'] = 500;\n $outputs['msg'] = 'empty info';\n return $outputs;\n }\n //check exists\n $d_empl = D('TbHrCard')->findOneByEmplId($empl_id);\n $d_dept = D($this->name_dept)->gainSimpleOneDept($dept_id);\n if(empty($d_empl) or empty($d_dept)){\n $outputs['code'] = 500;\n $outputs['msg'] = 'not exists';\n return $outputs;\n }\n\n $status = D($this->name_dept)->addEmployeeToDepartment($empl_id,$dept_id);\n return $outputs;\n }",
"public function getDepartment()\n {\n return $this->department;\n }",
"public function hasCompanyInfo()\n {\n $result = false;\n if ($this->getField('company') != '' && $this->getField('companyzipcode') != '') {\n $result = true;\n }\n return $result;\n }",
"private function dataHasDeposit()\n {\n return array_key_exists('deposit', $this->data);\n }",
"public function checkIfDepartmentHODExist(Request $request)\n {\n\t\t$data = $request->post();\n\t\treturn new Response(User::where([['department','=',$data['department']],['designation','=',$data['designation']],['id','!=',$data['id']]])->count());\n }",
"public function checkBusinessDepartment($staffId)\n {\n $hFunction = new \\Hfunction();\n $modelStaffWorkDepartment = new QcStaffWorkDepartment();\n $result = $this->infoActivityOfStaff($staffId);\n $resultStatus = false;\n if ($hFunction->checkCount($result)) {\n if ($modelStaffWorkDepartment->checkBusinessDepartment($result->workId())) $resultStatus = true;\n }\n return $resultStatus;\n }",
"public static function isExternalDepartment( $did ) {\n\t\t$db = JFactory::getDbo();\n\t\t$query = \"SELECT `external_link` FROM `#__obhelpdesk3_departments` WHERE id=\" . $did . \"\";\n\t\t$db->setQuery( $query );\n\t\tif ( $external_link = $db->loadResult() ) {\n\t\t\treturn $external_link;\n\t\t}\n\n\t\treturn false;\n\t}",
"private function check_department_user(int $department_id, int $user_id): bool\n {\n // Dus in dit geval gebruik je straks ['count'] in PHP (in plaats van ['COUNT(*)'])\n $sql = 'SELECT COUNT(*) AS count\n FROM department_user\n WHERE department_id = :department_id\n AND user_id = :user_id';\n\n $statement = $this->statement_execute($sql, [\n 'department_id' => $department_id,\n 'user_id' => $user_id\n ]);\n\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n\n // Als de count meer dan 0 is (1 of meer, dus) komt de combinatie voor; dan moet hij true zijn!\n return $result['count'] > 0;\n }",
"public function validateHasAppartements() {\n return $this->cart->items()->where( 'class', Appartement::class )->count() > 0;\n }",
"public function getDepartmentId()\n {\n $id = $this->getData('department_id');\n $department = $this->departmentFactory->create()->load($id);\n if (!$department) {\n return false;\n }\n\n return $id;\n }",
"private function hasValidDepartment($memberof)\n {\n foreach ($memberof as $group) {\n $matches = [];\n preg_match(\"/CN=([\\w\\s]+),/\", $group, $matches);\n if (array_key_exists(1, $matches) && array_key_exists($matches[1], $this->ldap_groups)) {\n return true;\n }\n }\n return false;\n }"
] | [
"0.8229404",
"0.71779704",
"0.7162054",
"0.68531704",
"0.6614436",
"0.6569807",
"0.6490656",
"0.622401",
"0.619329",
"0.61737955",
"0.6143337",
"0.61390656",
"0.6112664",
"0.6096192",
"0.60876095",
"0.6084",
"0.60730517",
"0.6058022",
"0.5984729",
"0.5965847",
"0.59422064",
"0.59324074",
"0.5922408",
"0.5907738",
"0.59016836",
"0.5886684",
"0.58678424",
"0.58608305",
"0.58428776",
"0.58071315"
] | 0.74014276 | 1 |
get restaurants, having restriction on this company any company assigned to restaurant is only allowed to order | public function getRestaurantRestrictions() {
return $this->getTable()->getRestaurantRestrictions();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNotApprovedRestaurants() {\n\t\t$query = \"SELECT * FROM restaurant WHERE approved = 1\";\n\t\t$rest_list;\n\t\t$result = $this->mysqli->query($query);\n\t\t$i = 0;\n\t\twhile ($row = $result->fetch_object()) {\n\t\t\t$restaurant = new Restaurant();\n\t\t\t$restaurant->setId($row->id);\n\t\t\t$restaurant->setName($row->name);\n\t\t\t$restaurant->setLatitude($row->latitude);\n\t\t\t$restaurant->setLongitude($row->longitude);\n\t\t\t$restaurant->setWebsite($row->website);\n\t\t\t$restaurant->setCity($row->city);\n\t\t\t$restaurant->setFax($row->fax);\n\t\t\t$restaurant->setHas_breakfast($row->hasbreakfast);\n\t\t\t$restaurant->setHas_dinner($row->hasdinner);\n\t\t\t$restaurant->setHas_lunch($row->haslunch);\n\t\t\t$restaurant->setHittaURL($row->hittaURL);\n\t\t\t$restaurant->setMail_city($row->mailcity);\n\t\t\t$restaurant->setPhone($row->phone);\n\t\t\t$restaurant->setStreet($row->street);\n\t\t\t$restaurant->setType($row->type_name);\n\t\t\t$restaurant->setZip($row->zipcode);\n\t\t\t$rest_list[$i];\n\t\t\t$i++;\n\t\t}\n\t\treturn $rest_list;\n\t}",
"public function getRestaurants(){\n \n $result = self::where([\n \"status\" => \"Active\"\n ])\n ->select([\"id\",\"name\",\"has_gst\"])\n ->orderBy(\"name\")\n ->get();\n \n return $result;\n }",
"public function allRestaurants()\n {\n $compQuery = Company::where([\n 'active' => 1,\n 'companytype_id' => 1, // restaurants\n ])->get();\n\n $companies = new collection();\n\n foreach ($compQuery as $company) {\n $companies->push([\n 'id' => $company->id,\n 'area_id' => $company->area_id,\n 'name' => $company->name,\n 'slug' => $company->slug,\n 'rating' => intval($company->rating),\n 'description' => $company->description,\n 'address' => $company->address,\n 'image' => Front::myMediaUrl($company, 'company_image', 'banner'),\n ]);\n }\n // dd($companies);\n\n $pageConfigs = [\n 'newsletter' => true,\n 'breadcrumb' => true,\n 'title' => 'Abboda Restaurants',\n ];\n return view('pages.restaturants', [\n 'pageConfigs' => $pageConfigs,\n 'companies' => $companies->toArray(),\n ]);\n }",
"private function findRestaurandsInCommon()\n {\n $dbHandler = Lib\\DbHandler::getDbHandler();\n\n $allRestaurantIDs = array();\n $userlist = $dbHandler->getUsers();\n\n $restaurants = $dbHandler->getRestaurants();\n foreach ($restaurants as $restaurant) {\n $allRestaurantIDs[] = $restaurant->getId();\n }\n foreach ($userlist as $user) {\n $restaurants = $user->getPreferedRestaurantIds();\n $restaurantID = array();\n foreach ($restaurants as $restaurant) {\n $restaurantID[] = $restaurant[\"Id\"];\n\n }\n $allRestaurantIDs = array_intersect($restaurantID,$allRestaurantIDs);\n }\n return $allRestaurantIDs;\n }",
"function fetch_all_active_restaurants_of_user($restaurant_creator)\n\t{\n\t\treturn $this->db->select('*')\n\t\t\t\t\t\t->from($this->table)\n\t\t\t\t\t\t->where(array(\n\t\t\t\t\t\t\t'restaurant_status' => 1,\n\t\t\t\t\t\t\t'restaurant_creator' => $restaurant_creator,\n\t\t\t\t\t\t))\n\t\t\t\t\t\t->get()\n\t\t\t\t\t\t->result_array();\n\t}",
"function fetch_all_restaurants_of_user($restaurant_creator)\n\t{\n\t\treturn $this->db->select('*')\n\t\t\t\t\t\t->from($this->table)\n\t\t\t\t\t\t->where(array(\n\t\t\t\t\t\t\t'restaurant_creator' => $restaurant_creator,\n\t\t\t\t\t\t))\n\t\t\t\t\t\t->get()\n\t\t\t\t\t\t->result_array();\n\t}",
"public function get_target_restaurant_list () {\n\t\t$restaurantList = $this->get_param('post.restaurant_list');\n\t\t$grouponRestaurantList = $this->get_param('post.groupon_restaurant_list');\n\n\t\t$this->get_restaurant_list($restaurantList, $grouponRestaurantList);\n\t}",
"public function getAllCompanyRecruitment()\n {\n return \\App\\Recruitment::getAllCompanyRecruitments(\\Auth::id());\n }",
"public function afficherRestaurant(){\r\n\t\t$sql=\"SElECT * From restaurant\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}",
"public function getRestaurantsAssociations() {\n return $this->getTable()->getRestaurantsAssociations();\n }",
"public function getRestaurant()\n {\n $restaurant = Restaurant::getOneBy(array('_id' => $this->restaurant));\n return $restaurant;\n }",
"public function getRecurringOrders();",
"public function restaurant()\n {\n return $this->restaurant;\n }",
"public function Restaurants()\n {\n return $this->belongsToMany('App\\Model\\Restaurants', 'restaurant_cuisines', 'restaurant_id', 'cuisine_id');\n }",
"public function getAllRestaurants() {\n return view('pages.test.restaurants', ['restaurants'=>Restaurant::all()]);\n }",
"public function getCompanyWithUsers();",
"public function getrestaurant()\n\t{\t\t\n\t\t$this->db->select(\"res.*,ht.hotal_name\");\n\t\t$this->db->from(RESTAURANT.\" as res\");\n\t\t$this->db->join(Hotal.\" as ht\", \"ht.id = res.hotal_id\");\n\t\t$this->db->where(\"res.is_deleted='0'\");\n\t\t$this->db->order_by(\"res.id\",\"DESC\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\t\n\t}",
"function getHotelsPerTripOrganizer(Request $request)\n {\n $oUser=Auth::user();\n if ($oUser->role=='admin'){\n\n $aActiveTrips = Trip::where('is_active', true)->get();\n\n $aHotels = Hotel::get();\n\n if ($request->post('selectedActiveTrip') == null) {\n $iTripId = Trip::where('is_active', true)->first();\n } else {\n $iTripId = Trip::where('trip_id', $request->post('selectedActiveTrip'))->select('trip_id')->first();\n }\n $aHotelsid = HotelsPerTrip::whereIn('trip_id', $iTripId)->select('hotel_id')->get();\n\n $aHotelsPerTrip = HotelsPerTrip::whereIn('hotels.hotel_id', $aHotelsid)\n ->where('trip_id', $iTripId->trip_id)\n ->join('hotels', 'hotels_per_trips.hotel_id', '=', 'hotels.hotel_id')\n ->orderBy('hotel_start_date', 'asc')\n ->get();\n\n return view('organiser.HotelsAndRooms.hotels',\n [\n 'aHotelsPerTrip' => $aHotelsPerTrip,\n 'aHotels' => $aHotels,\n 'aActiveTrips' => $aActiveTrips,\n 'iTripId' => $iTripId\n ]);\n }\n else {\n foreach ($oUser->traveller->travellersPerTrip as $travellersPerTrip) {\n $is_organizer = $travellersPerTrip->is_organizer;\n if ($is_organizer) {\n $travellerId = $oUser->traveller->traveller_id;\n $aIsOrganizerOfTrip = TravellersPerTrip::where('traveller_id', $travellerId)->where('is_organizer', true)->select('trip_id')->get();\n\n if ($request->post('selectedActiveTrip') == null) {\n $iTripId = Trip::where('is_active', true)->whereIn('trip_id', $aIsOrganizerOfTrip)->first();\n } else {\n $iTripId = Trip::where('trip_id', $request->post('selectedActiveTrip'))->select('trip_id')->first();\n }\n $aHotelsid = HotelsPerTrip::whereIn('trip_id', $iTripId)->select('hotel_id')->get();\n\n $aHotelsPerTrip = HotelsPerTrip::whereIn('hotels.hotel_id', $aHotelsid)\n ->where('trip_id', $iTripId->trip_id)\n ->join('hotels', 'hotels_per_trips.hotel_id', '=', 'hotels.hotel_id')\n ->orderBy('hotel_start_date', 'asc')\n ->get();\n\n\n $aActiveTrips = Trip::where('is_active', true)->whereIn('trip_id', $aIsOrganizerOfTrip)->get();\n\n $aHotels = Hotel::get();\n\n return view('organiser.HotelsAndRooms.hotels',\n [\n 'aHotelsPerTrip' => $aHotelsPerTrip,\n 'aHotels' => $aHotels,\n 'aActiveTrips' => $aActiveTrips,\n 'iTripId' => $iTripId\n ]);\n }\n }\n return $this->getHotelsPerTripUser();\n }\n }",
"public function reservations()\n {\n return $this->hasMany('App\\Reservation', 'restaurant_id');\n }",
"public function getRestaurant()\n {\n return $this->hasOne(Restaurant::className(), ['restaurantId' => 'restaurantId']);\n }",
"function fetch_all_restaurants($limit, $start, $query)\n {\n $search = $query['search'];\n $restaurant_creator = $query['restaurant_creator'];\n\t\t$this->db->select('*')->from($this->table);\n // if client search something\n if(!empty($search)) $this->db->like('restaurant_name', $search);\n if(!empty($restaurant_creator)) $this->db->where('restaurant_creator', $restaurant_creator);\n\t\t$query = $this->db->limit($limit, $start)->get()->result_array();\n\t\t\n\t\tforeach ($query as $key => $restaurant) {\n\t\t\t// this metho dfetch all tags of a restaurant\n\t\t\t$tags = $this->tag_model->fetch_all_tags_of_restaurant($restaurant['restaurant_id']);\n $query[$key]['tags'] = $this->global_model->belong_to_many('restaurant_tags', 'tags', 'restaurant_id', $restaurant['restaurant_id'], 'tag_id');\n\n\t\t\t// this metho dfetch all tags of a restaurant\n\t\t\t$categories = $this->global_model->has_many('categories', 'restaurant_id', $restaurant['restaurant_id']);\n\t\t\t$query[$key]['categories'] = $categories;\n\n\t\t\t// this method fetch all tags of a restaurant\n\t\t\t$ratings = $this->global_model->with('ratings', 'restaurant_id', $restaurant['restaurant_id']);\n\t\t\t$query[$key]['rating'] = '';\n\t\t\t// total rows\n\t\t\t$totalRows = count($ratings);\n\t\t\t// sum of rating points\n\t\t\t$sumOfRating = 0;\n\t\t\tforeach ($ratings as $rating) {\n\t\t\t\t$sumOfRating += $rating['rating'];\n\t\t\t}\n\t\t\t// if restaurant has rating\n\t\t\tif ($totalRows != 0) {\n\t\t\t\t// average of rating\n\t\t\t\t$query[$key]['totalRated'] = $totalRows;\n\t\t\t\t$query[$key]['rating'] = number_format($sumOfRating / $totalRows, 1, '.', '');\n\t\t\t}\n\n\t\t\t// this method fetch restaurant creator info\n\t\t\t$user = $this->global_model->with('users', 'id', $restaurant['restaurant_creator']);\n\t\t\t$query[$key]['creator'] = $user;\n\n\t\t}\n\n\t\t// return data from server\n\t\treturn $query;\n\t}",
"public static function getAdditionalCommissions($restaurantId) {\n $db = Zend_Registry::get('dbAdapter');\n\n $result = array();\n\n try{\n $sql = 'select * from restaurant_commission rc where rc.restaurantId = '. $restaurantId . ' order by rc.from';\n $result = $db->fetchAll($sql);\n }\n catch ( Zend_Db_Statement_Exception $e ){\n return null;\n }\n\n return $result;\n }",
"private function getAllApplicants() {\n $applicants = DB::table('crew')\n ->leftJoin('crewfasttrack', 'crewfasttrack.APPLICANTNO', '=', 'crew.APPLICANTNO')\n ->leftJoin('fasttrack', 'fasttrack.fasttrack', '=', 'crewfasttrack.FASTTRACKCODE')\n ->leftJoin('crewscholar', 'crewscholar.APPLICANTNO', '=', 'crew.APPLICANTNO')\n ->leftJoin('scholar', 'scholar.SCHOLASTICCODE', '=', 'crewscholar.SCHOLASTICCODE')\n ->leftJoin('crewchange', function ($join) {\n $join->on('crewchange.APPLICANTNO', '=', 'crew.APPLICANTNO')\n ->where('crewchange.DATEEMB', DB::raw(\"(select max(crewchange.DATEEMB) from crewchange where crewchange.APPLICANTNO = crew.APPLICANTNO )\"))\n ->groupby('crewchange.APPLICANTNO');\n })\n ->leftJoin('rank', 'rank.RANKCODE', '=', 'crewchange.RANKCODE')\n ->leftJoin('vessel', function ($join) {\n $join->on('vessel.VESSELCODE', '=', 'crewchange.VESSELCODE')\n ->whereDate('crewchange.DATEEMB', '<', Carbon::now())\n ->whereDate('crewchange.DATEDISEMB', '>', Carbon::now());\n })\n ->select('crew.APPLICANTNO', 'crew.CREWCODE', 'crew.FNAME', 'crew.GNAME', 'crew.MNAME', 'crew.STATUS', \n 'crew.UTILITY', 'scholar.DESCRIPTION', 'fasttrack.FASTTRACK', 'rank.RANK', 'vessel.VESSEL')->paginate(15);\n return $applicants;\n }",
"function fetch_some_restaurants($restaurant_name)\n\t{\n\t\treturn $this->db->select('*')\n\t\t\t\t\t\t->from($this->table)\n\t\t\t\t\t\t->like('restaurant_name', $restaurant_name)\n\t\t\t\t\t\t->limit(5)\n\t\t\t\t\t\t->get()\n\t\t\t\t\t\t->result_array();\n\t}",
"public function index()\n {\n return Reservation::with('customer','paypal_payments')->Where('status','Check in')->orWhere('status','Reserved')->get();\n }",
"private function approvedByRole()\n {\n $pending = \\ApprovalSequence\\Models\\Entity::Where('entity_id', $this[$this->primaryKey])->get();\n $approvers = $pending->map(function ($item) {\n return $item->approver->role_id;\n });\n //to avoid duplication\n return $approvers->unique();\n }",
"public function getRestrictions() \n {\n return $this->_restrictions; \n }",
"public function GuideExpensesRestaurants()\n {\n return $this->hasMany('App\\Models\\GuideExpensesRestaurants',\"restaurant_id\");\n }",
"public function fetch_restaurant_on_condition($query)\n {\n $this->db->select('*')->from('restaurants');\n \n if (isset($query['restaurant_id']) && !empty($query['restaurant_id'])) {\n $this->db->where('restaurant_id', $query['restaurant_id']);\n }\n\n if (isset($query['restaurant_creator']) && !empty($query['restaurant_creator'])) {\n $this->db->where('restaurant_creator', $query['restaurant_creator']);\n\t\t}\n\t\t\n\t\tif (isset($query['restaurant_slug']) && !empty($query['restaurant_slug'])) {\n $this->db->where('restaurant_slug', $query['restaurant_slug']);\n }\n\n $query = $this->db->get()->result_array();\n // with restaurant info\n foreach ($query as $key => $restaurant) {\n // this metho dfetch all tags of a restaurant\n\t\t\t$tags = $this->tag_model->fetch_all_tags_of_restaurant($restaurant['restaurant_id']);\n $query[$key]['tags'] = $this->global_model->belong_to_many('restaurant_tags', 'tags', 'restaurant_id', $restaurant['restaurant_id'], 'tag_id');\n\n\t\t\t// this metho dfetch all tags of a restaurant\n\t\t\t$categories = $this->global_model->has_many('categories', 'restaurant_id', $restaurant['restaurant_id']);\n\t\t\t$query[$key]['categories'] = $categories;\n\n\t\t\t// this metho dfetch all tags of a restaurant\n\t\t\t$ratings = $this->global_model->with('ratings', 'restaurant_id', $restaurant['restaurant_id']);\n\t\t\t$query[$key]['rating'] = '';\n\t\t\t// total rows\n\t\t\t$totalRows = count($ratings);\n\t\t\t// sum of rating points\n\t\t\t$sumOfRating = 0;\n\t\t\tforeach ($ratings as $rating) {\n\t\t\t\t$sumOfRating += $rating['rating'];\n\t\t\t}\n\t\t\t// if restaurant has rating\n\t\t\tif ($totalRows != 0) {\n\t\t\t\t// average of rating\n\t\t\t\t$query[$key]['totalRated'] = $totalRows;\n\t\t\t\t$query[$key]['rating'] = number_format($sumOfRating / $totalRows, 1, '.', '');\n\t\t\t}\n\n\t\t\t// this method fetch restaurant creator info\n\t\t\t$user = $this->global_model->with('users', 'id', $restaurant['restaurant_creator']);\n\t\t\t$query[$key]['creator'] = $user;\n }\n return $query;\n }",
"public static function getAvailableContractors(): array\n {\n $contractorsQuery = ContractorOccupation::find()->select('DISTINCT(contractor_id)');\n\n return self::find()\n ->select('*')\n ->addSelect([\n 'COUNT(task.contractor_id) AS doneTaskCount',\n 'COUNT(review.task_id) AS reviewCount',\n 'AVG(review.rating) AS rating'\n ])\n ->rightJoin(['occupation' => $contractorsQuery], 'user.id = occupation.contractor_id')\n ->leftJoin('task', 'task.contractor_id = user.id')\n ->leftJoin('review', 'task.id = review.task_id')\n\n ->andWhere(['task.state_id' => Task::STATE_DONE])\n ->andWhere(['user.hide_profile' => false])\n ->groupBy('user.id')\n ->orderBy('user.datetime_created ASC')\n ->all();\n }"
] | [
"0.696992",
"0.6287122",
"0.6181779",
"0.6047981",
"0.6011092",
"0.59179544",
"0.58538026",
"0.5671452",
"0.5619524",
"0.5612831",
"0.5478126",
"0.5408447",
"0.5402133",
"0.5388593",
"0.53553134",
"0.5297504",
"0.5294551",
"0.5285207",
"0.52418315",
"0.5188748",
"0.5183477",
"0.5170611",
"0.51704574",
"0.51618284",
"0.51544493",
"0.5151464",
"0.51475155",
"0.514517",
"0.51431257",
"0.5115906"
] | 0.6609882 | 1 |
remove restriction relationship with this restaurant | public function removeRestaurantRestriction($restId) {
return $this->getTable()->removeRestaurantRestriction($restId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isRemoveFromRelationship();",
"public function forceDeleted(Remission $remission)\n {\n //\n }",
"public function clearSolicitacaoResgatesRelatedBySolicitanteId()\n\t{\n\t\t$this->collSolicitacaoResgatesRelatedBySolicitanteId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function destroy(Restaurant $restaurant)\n {\n //\n }",
"public function removeIsolated()\n {\n $isolated_types = $this->type->doesntHave('movies')->get();\n\n foreach ($isolated_types as $type) {\n $this->delete($type->id);\n }\n }",
"public function clearSolicitacaoResgatesRelatedByAprovadorId()\n\t{\n\t\t$this->collSolicitacaoResgatesRelatedByAprovadorId = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"protected function removeAllRelationships($type){\n // dettach all\n $response = $this->resourceService()->reattach($this->getId(), $type, [\n []\n ]);\n // add to relationships\n $this->relationships[$type] = new LaravelCollection([]);\n // update cache\n $this->cacheSelf();\n }",
"public function removeUsageRights() {}",
"public function actionRevoke()\n\t{\n\t\t// We only allow deletion via POST request\n\t\tif( Yii::app()->request->isPostRequest===true )\n\t\t{\n\t\t\t$model = $this->loadModel();\n\t\t\t$childName = $this->getChildName();\n\n\t\t\tif( $childName!==null && $model->hasChild($childName)===true )\n\t\t\t\t$model->removeChild($childName);\n\n\t\t\t// if AJAX request, we should not redirect the browser\n\t\t\tif( isset($_POST['ajax'])===false )\n\t\t\t\t$this->redirect(array('authItem/permissions'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new CHttpException(400, Rights::t('core', 'Invalid request. Please do not repeat this request again.'));\n\t\t}\n\t}",
"public function clearPartnerssRelatedByPatientId()\n {\n $this->collPartnerssRelatedByPatientId = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function clearPartnerssRelatedByAgentId()\n {\n $this->collPartnerssRelatedByAgentId = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function actionDeleteUserRestriction($id) {\n $model = UserRestriction::findOne($id);\n if ($model && $model->delete())\n return ['result' => true];\n else\n return ['result' => false];\n }",
"public function clearAssignedPrayersRelatedByAgentId()\n {\n $this->collAssignedPrayersRelatedByAgentId = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function deleted(Remission $remission)\n {\n //\n }",
"public function clearAssignedPrayersRelatedByPatientId()\n {\n $this->collAssignedPrayersRelatedByPatientId = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function destroy(Rental $rental)\n {\n //\n }",
"abstract public function mass_remove();",
"public function getRestaurantRestrictions() {\n return $this->getTable()->getRestaurantRestrictions();\n }",
"public function delete() {\n// 'missionServiceUsers' => array(self::HAS_MANY, 'MissionServiceUser', 'id_service_user'),\n// //'serviceUserConditions' => array(self::MANY_MANY, 'Condition', 'tbl_service_user_condition(id_service_user, id_condition)'),\n// 'serviceUserConditions' => array(self::HAS_MANY, 'ServiceUserCondition', 'id_service_user'),\n\n\n parent::delete();\n }",
"public function deleteResidence($residence) {\n\t\t\n\t\t$where = $this->quoteInto('id = ? ', $residence->id);\n $this->delete($where);\n\t}",
"public function delete()\n {\n $this->abilities()->detach();\n parent::delete();\n }",
"public function destroy(Request $request, $id)\n {\n $restriction = Restriction::findOrFail($id);\n\n if($restriction->delete()) {\n\n $restrictionExclusion = new RestrictionExclusion();\n $restrictionExclusion->people_id = Auth::user()->id;\n $restrictionExclusion->restriction_id = $id;\n $restrictionExclusion->description = $request->description;\n $restrictionExclusion->save();\n\n $this->addFlash('Restrição removida com sucesso!', 'success');\n } else {\n $this->addFlash('Erro ao remover restrição!', 'danger');\n }\n\n return redirect()->route('restricoes.index');\n }",
"public function destroy($id) {\n $recette = Recette::find($id);\n //on supprime les relations de la recette\n $recette->ingredients()->detach();\n //peu importe si la recette fait partie d'un planning utilisateur\n $recette->plannings()->detach();\n $recette->delete();\n return redirect('recettes');\n }",
"public function unlinkRelationship(RelationshipInterface $relationship)\n\t{\n\t\t$relationship->setNode();\n\t\t$relationship->setOtherNode();\n\t}",
"public function unfriend() {\n $existed_relation_status = $this->get_relation_by_status(\"F\");\n if($existed_relation_status) {\n $this->delete_relation(\"F\");\n\n $relation = new UserRelation();\n $relation->set_property(\"from\", $this->to);\n $relation->set_property(\"to\", $this->from);\n\n $relation->delete_relation(\"F\");\n return true;\n }\n\n return false;\n }",
"public function removeRelation(RelationInterface $relation);",
"public function clearRelationCache();",
"public function removeAction()\n {\n if ( $this->_hasParam('razaoSocialTomador') == false )\n {\n $this->_redirect('clientes/list');\n }\n \t\t$modelo = new Application_Model_Clientes();\n $razaoSocialTomador = $this->_getParam('razaoSocialTomador');\n $modelo->removeByRazaoSocial($razaoSocialTomador);\n\n// $cnte = $modelo->removeByRazaoSocial($razaoSocialTomador);\n\t\t$this->_redirect('clientes/list');\n // action body\n }",
"function delete ($relationshipName)\n {\n if ($relationship = $this->get ( $relationshipName ))\n {\n $this->removeFieldsFromUndeployedLayouts ( $relationship ) ;\n unset ( $this->relationships [ $relationshipName ] ) ;\n }\n }",
"public static function delete_reset_specific_ip_restrictions($restriction = FALSE)\n {\n global /* Need global database object. */ $wpdb;\n\n do_action(\"ws_plugin__s2member_before_delete_reset_specific_ip_restrictions\", get_defined_vars());\n\n $prefix /* s2Member Transient prefix for all IP Restrictions. */ = \"s2m_ipr_\";\n $transient_entries = $prefix.md5(\"s2member_ip_restrictions_\".(string)$restriction.\"_entries\");\n $transient_security_breach = $prefix.md5(\"s2member_ip_restrictions_\".(string)$restriction.\"_security_breach\");\n\n $wpdb->query(\"DELETE FROM `\".$wpdb->options.\"` WHERE `option_name` LIKE '%\".esc_sql(c_ws_plugin__s2member_utils_strings::like_escape($transient_entries)).\"'\");\n $wpdb->query(\"DELETE FROM `\".$wpdb->options.\"` WHERE `option_name` LIKE '%\".esc_sql(c_ws_plugin__s2member_utils_strings::like_escape($transient_security_breach)).\"'\");\n\n do_action(\"ws_plugin__s2member_after_delete_reset_specific_ip_restrictions\", get_defined_vars());\n\n return apply_filters(\"ws_plugin__s2member_delete_reset_specific_ip_restrictions\", true, get_defined_vars());\n }"
] | [
"0.64327925",
"0.57864064",
"0.56470966",
"0.5631549",
"0.56004405",
"0.55966175",
"0.5472318",
"0.54350007",
"0.5413572",
"0.5368477",
"0.53367895",
"0.5331748",
"0.53108424",
"0.5308024",
"0.5305767",
"0.5303304",
"0.5297125",
"0.52759314",
"0.5268652",
"0.52540505",
"0.5251384",
"0.5243506",
"0.5228632",
"0.52110076",
"0.5172141",
"0.51657724",
"0.5155019",
"0.5146287",
"0.51454544",
"0.5131379"
] | 0.60813874 | 1 |
Get Access Token From A text file | public function getToken()
{
$accessToken = null;
if (file_exists($_SERVER['DOCUMENT_ROOT'].$this->tokenFile)) {
$accessToken = unserialize(file_get_contents($_SERVER['DOCUMENT_ROOT'].$this->tokenFile));
}
return json_decode($accessToken);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ReadTokenFile()\n {\n if ($this->getTokenUsePickupFile()) {\n $fname = $this->getTokenPickupFile();\n $fh = fopen($fname, \"r\");\n $this->_props['RequestToken'] = trim(fread($fh, filesize($fname)));\n fclose($fh);\n }\n }",
"function getToken(): string {\n //return $this->_c['inseeToken'];\n if ($this->inseeToken)\n return $this->inseeToken;\n if (($contents = @file_get_contents(__DIR__.'/inseetoken.json')) === false) {\n $this->inseeToken = $this->generateToken(); // génération d'un nouveau token\n return $this->inseeToken;\n }\n $contents = json_decode($contents, true);\n \n $mtime = filemtime(__DIR__.'/inseetoken.json');\n //echo \"fichier modifié le \",date(DATE_ATOM, $mtime),\"<br>\\n\";\n //echo \"fichier modififié il y a \",time()-$mtime,\" secondes<br>\\n\";\n if (time() - $mtime < $contents['expires_in'] - 3600) { // vérification que le token est encore valide\n if (!isset($contents['access_token']))\n throw new Exception(\"Erreur access_token absent du fichier inseetoken.json\");\n $this->inseeToken = $contents['access_token'];\n }\n else {\n $this->inseeToken = $this->generateToken(); // génération d'un nouveau token\n }\n return $this->inseeToken;\n }",
"public function readToken() {}",
"private function getAccessToken(): string\n {\n try {\n $token = Storage::disk('local')->get(self::ALIGO_ACCESS_TOKEN_FILE);\n } catch (\\Exception $exception) {\n $token = null;\n }\n\n if (empty($token)) {\n try {\n $response = $this->call('/akv10/token/create/10/y');\n $data = json_decode((string) $response->getBody(), false);\n } catch (\\Throwable $exception) {\n throw CouldNotSendNotification::serviceRespondedWithAnError($exception);\n }\n Storage::disk('local')->put(self::ALIGO_ACCESS_TOKEN_FILE, $data->token);\n\n return $data->token;\n }\n\n return $token;\n }",
"abstract public function url_access_token();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"public function getToken();",
"private function _get_access_token() {\n return $this->_http->request( \n 'POST', 'https://oauth.api.189.cn/emp/oauth2/v3/access_token',\n http_build_query( array(\n 'grant_type' => 'client_credentials',\n 'app_id' => C( 'SMS_189_KEY' ),\n 'app_secret' => C( 'SMS_189_SECRET' )\n ) ) );\n\n }",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"function get_access_token()\r\n {\r\n $script_location = $this->script_location.'Soundcloud_get_token.py';\r\n $params = $this->sc_client_id.\" \".$this->sc_secret.\" \".$this->sc_user.\" \".$this->sc_pass;\r\n //Execute python script and save results\r\n exec(\"python \\\"\".$script_location.\"\\\" \".$params, $result);\r\n return $result;\r\n }",
"private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }",
"function get_credentials_from_file($file = VAR_FOLDER . DS . '.account')\n{\n $credentials = array(\n 'email' => null,\n 'password' => null\n );\n $lines = file_to_lines($file);\n if ($lines && count($lines) >= 2) {\n $credentials['email'] = $lines[0];\n $credentials['password'] = $lines[1];\n }\n return $credentials;\n}",
"function getAppAccesToken($app_id, $app_secret){\n $token_url = \"https://graph.facebook.com/oauth/access_token?\" . \n \"client_id=\" . $app_id . \n \"&client_secret=\" . $app_secret . \n \"&grant_type=client_credentials\"; \n $reponse = file_get_contents($token_url);\n \n $param = null;\n parse_str($reponse,$param);\n \n return $param['access_token'];\n }",
"public function getAccessToken($access_token);",
"function open_tokens_file($tokenFilePath)\n{\n global $tokenFile;\n\n if (file_exists($tokenFilePath))\n {\n $tokenFile = simplexml_load_file($tokenFilePath);\n }\n else\n {\n throw new Exception('Error: Cannot connect to tokens database!');\n }\n\n\n if (!$tokenFile)\n {\n throw new Exception('Error: Cannot open tokens database!');\n }\n}",
"function read($token);",
"public function get_access_token()\n\t\t{\n\t\t\tif(isset($_COOKIE['bing_access_token']))\n\t\t\t\treturn $_COOKIE['bing_access_token'];\n\t\t\n\t\t\t// Get a 10-minute access token for Microsoft Translator API.\n\t\t\t$url = 'https://datamarket.accesscontrol.windows.net/v2/OAuth2-13';\n\t\t\t$postParams = 'grant_type=client_credentials&client_id='.urlencode($this->clientID).\n\t\t\t'&client_secret='.urlencode($this->clientSecret).'&scope=http://api.microsofttranslator.com';\n\t\t\t\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url); \n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\t\t$rsp = curl_exec($ch); \n\t\t\t$rsp = json_decode($rsp);\n\t\t\t$access_token = $rsp->access_token;\n\t\t\t\n\t\t\tsetcookie('bing_access_token', $access_token, $rsp->expires_in);\n\t\t\t\n\t\t\treturn $access_token;\n\t\t}",
"public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }",
"public function getToken(): string;",
"public function getToken(): string;",
"public function getToken(): string;",
"public function getToken(): string;",
"public function getToken()\n\t{\n\t\treturn $this->getOption('accesstoken');\n\t}",
"private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}"
] | [
"0.72512627",
"0.6779216",
"0.6668294",
"0.65947384",
"0.6391276",
"0.63574797",
"0.63574797",
"0.63574797",
"0.63574797",
"0.6272261",
"0.6230864",
"0.6230864",
"0.6230864",
"0.6230864",
"0.6230864",
"0.6214809",
"0.6214547",
"0.6204841",
"0.61824656",
"0.6182268",
"0.6179494",
"0.6168348",
"0.6051909",
"0.6047205",
"0.60344464",
"0.60344464",
"0.60344464",
"0.60344464",
"0.5993231",
"0.5987178"
] | 0.69147575 | 1 |
Save Access Token to a text file | public function saveAccessToken($accessToken)
{
file_put_contents($_SERVER['DOCUMENT_ROOT'].$this->tokenFile, serialize($accessToken));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function WriteTokenFile()\n {\n if ($this->getTokenUsePickupFile()) {\n $fname = $this->getTokenPickupFile();\n $fh = fopen($fname, \"w+\");\n fwrite($fh, $this->_props['RequestToken']);\n fclose($fh);\n }\n }",
"public function saveAccessToken($accessToken);",
"private function saveData() {\n // Create a new object with relevant information\n $data = new stdClass();\n $data->accessToken = $this->accessToken;\n $data->expirationDate = $this->expirationDate;\n $data->refreshToken = $this->refreshToken;\n\n // And save it to disk (will automatically create the file for us)\n file_put_contents(DATA_FILE, json_encode($data));\n }",
"public function saveAccessToken($accessToken)\n {\n // This should write more than one byte as such any falsey value is a problem\n if (file_put_contents('./wpOauthToken', serialize($accessToken))) {\n return true;\n }else{\n return false;\n }\n }",
"public function saveAccessToken($accessToken)\n {\n session()->put('drive-access-token', $accessToken);\n }",
"public function saveAccessTokenToDB($accessToken);",
"function write_new_token($tokenId)\n{\n global $tokenFile;\n global $tokenFilePath;\n\n // write new tokenId to tokens file\n $tokenFile->tokenId = $tokenId;\n\n //Format XML to save indented tree rather than one line\n $dom = new DOMDocument('1.0');\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($tokenFile->asXML());\n $dom->save($tokenFilePath);\n}",
"function getToken(): string {\n //return $this->_c['inseeToken'];\n if ($this->inseeToken)\n return $this->inseeToken;\n if (($contents = @file_get_contents(__DIR__.'/inseetoken.json')) === false) {\n $this->inseeToken = $this->generateToken(); // génération d'un nouveau token\n return $this->inseeToken;\n }\n $contents = json_decode($contents, true);\n \n $mtime = filemtime(__DIR__.'/inseetoken.json');\n //echo \"fichier modifié le \",date(DATE_ATOM, $mtime),\"<br>\\n\";\n //echo \"fichier modififié il y a \",time()-$mtime,\" secondes<br>\\n\";\n if (time() - $mtime < $contents['expires_in'] - 3600) { // vérification que le token est encore valide\n if (!isset($contents['access_token']))\n throw new Exception(\"Erreur access_token absent du fichier inseetoken.json\");\n $this->inseeToken = $contents['access_token'];\n }\n else {\n $this->inseeToken = $this->generateToken(); // génération d'un nouveau token\n }\n return $this->inseeToken;\n }",
"protected function store_access_token($token) {\n global $SESSION;\n $SESSION->{self::SESSIONKEY} = $token;\n }",
"public function storeAccessToken(AccessToken $token):static;",
"private static function storeAccessToken(array $accessToken, string $credentialsPath): void\n {\n // Store the credentials to disk.\n if (!file_exists(dirname($credentialsPath))) {\n mkdir(dirname($credentialsPath), 0700, true);\n }\n file_put_contents($credentialsPath, json_encode($accessToken));\n }",
"private function StoreAccessToken($access_token)\n\t{\n\t\t$_SESSION['OAUTH']['OAUTH_ACCESS_TOKEN'][$this->access_token_url] = $access_token;\n\t}",
"private function fetchAccessToken()\n\t{\n\t\tif (file_exists($this->refreshToken))\n\t\t{\n\t\t\t$parameters = array(\n\t\t\t\t'refresh_token' => file_get_contents($this->refreshToken),\n\t\t\t\t'client_id' => $this->googleClientId,\n\t\t\t\t'client_secret' => $this->googleClientSecret,\n\t\t\t\t'grant_type' => 'refresh_token'\n\t\t\t);\n\n\t\t\t$response = $this->makeRequest($parameters);\n\n\t\t\tif (isset($response->access_token))\n\t\t\t{\n\n\t\t\t\tfile_put_contents($this->accessToken, $response->access_token);\n\t\t\t}\n\t\t}\n\t}",
"function saveToken($token) {\r\n\t\t$_SESSION['token'] = $token;\r\n\t}",
"function ReadTokenFile()\n {\n if ($this->getTokenUsePickupFile()) {\n $fname = $this->getTokenPickupFile();\n $fh = fopen($fname, \"r\");\n $this->_props['RequestToken'] = trim(fread($fh, filesize($fname)));\n fclose($fh);\n }\n }",
"function fbComments_storeAccessToken() {\n\tfbComments_log('In ' . __FUNCTION__ . '()');\n\tglobal $fbc_options;\n\n\tif (!$fbc_options['accessToken']) {\n\t\t$accessToken = fbComments_getUrl(\"https://graph.facebook.com/oauth/access_token?type=client_cred&client_id={$fbc_options['appId']}&client_secret={$fbc_options['appSecret']}\");\n\t\tfbComments_log(\" got an access token of [$accessToken]\");\n\t\tif (strpos($accessToken,'<div class=\"error\">') == 0) { $accessToken = substr($accessToken, 13); }\n\t\telse { echo '<hr />didnt find accesstoken line 161 comments-core<hr />'; $accessToken = ''; }\n\t\tif ($accessToken != '') {\n\t\t\tfbComments_log(\" Storing an access token of $accessToken\");\n\t\t\t$fbc_options['accessToken'] = $accessToken;\n\t\t\tupdate_option('fbComments', $fbc_options);\n\t\t} else {\n\t\t\tfbComments_log(' FAILED to obtain an access token');\n\t\t}\n\t}\n}",
"public function addToTxtFile($auth_code);",
"public function save()\n {\n $data = $this->read_file();\n\n if (( ! $data))\n {\n $data = array();\n }\n\n $data[$this->id] = array(\n 'id' => $this->id,\n 'email' => $this->email,\n 'firstname' => $this->firstname,\n 'lastname' => $this->lastname,\n 'password' => $this->password,\n 'token' => $this->token,\n 'logins' => $this->logins,\n );\n\n $this->write_file($data);\n }",
"protected function createToken()\n {\n if ($this->client->getRefreshToken()) {\n $this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());\n } else {\n // Request authorization from the user.\n $authUrl = $this->client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $this->client->fetchAccessTokenWithAuthCode($authCode);\n $this->client->setAccessToken($accessToken);\n\n // Check to see if there was an error.\n if (array_key_exists('error', $accessToken)) {\n throw new Exception(join(', ', $accessToken));\n }\n }\n // Save the token to a file.\n if (!file_exists(dirname($this->token))) {\n mkdir(dirname($this->token), 0700, true);\n }\n file_put_contents($this->token, json_encode($this->client->getAccessToken()));\n }",
"private function getAccessToken(): string\n {\n try {\n $token = Storage::disk('local')->get(self::ALIGO_ACCESS_TOKEN_FILE);\n } catch (\\Exception $exception) {\n $token = null;\n }\n\n if (empty($token)) {\n try {\n $response = $this->call('/akv10/token/create/10/y');\n $data = json_decode((string) $response->getBody(), false);\n } catch (\\Throwable $exception) {\n throw CouldNotSendNotification::serviceRespondedWithAnError($exception);\n }\n Storage::disk('local')->put(self::ALIGO_ACCESS_TOKEN_FILE, $data->token);\n\n return $data->token;\n }\n\n return $token;\n }",
"function create_token($filename = '.token')\n{\n try {\n $dir = VAR_FOLDER . DS;\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n $file = fopen($dir . DS . $filename, \"w\");\n fwrite($file, bin2hex(random_bytes(32)) . \"\\n\");\n fclose($file);\n } catch (Exception $e) {\n throw new Exception($e->getMessage(), $e->getCode());\n }\n}",
"private function save_refresh_token() {\n global $DB, $USER;\n\n $newdata = new stdClass();\n $newdata->refreshtokenid = $this->client->getRefreshToken();\n $newdata->gmail = $this->get_user_info()->email;\n\n if (!is_null($newdata->refreshtokenid) && !is_null($newdata->gmail)) {\n $rectoken = $DB->get_record('repository_gdrive_tokens', array ('userid' => $USER->id));\n if ($rectoken) {\n $newdata->id = $rectoken->id;\n if ($newdata->gmail === $rectoken->gmail) {\n unset($newdata->gmail);\n }\n $DB->update_record('repository_gdrive_tokens', $newdata);\n } else {\n $newdata->userid = $USER->id;\n $newdata->gmail_active = 1;\n $DB->insert_record('repository_gdrive_tokens', $newdata);\n }\n }\n\n $event = \\repository_googledrive\\event\\repository_gdrive_tokens_created::create_from_userid($USER->id);\n $event->trigger();\n }",
"function login_details(){\n $filename = '../logs/logs.txt';\n $format = \"%m/%d/%Y %H:%M \";\n $time = strftime($format, filectime($filename));\n $name = isset($_POST['username'])?$_POST['username']:'null';\n $string = strtolower($name).' Logged in at '.$time. \"\\n\";\n file_put_contents($filename, $string, FILE_APPEND | LOCK_EX);\n}",
"abstract public function url_access_token();",
"public function generateAccessToken()\n {\n $this->access_token = Yii::$app->security->generateRandomString() . '_' . time();\n }",
"public function testBasicTest()\r\n {\r\n $client = new LoginClient();\r\n\r\n $result = $client->getToken('您的帳號', '您的密碼');\r\n\r\n// echo $result['access_token'];\r\n if (!empty($result['access_token'])) {\r\n // save token to local\r\n file_put_contents(\"token.txt\", $result['access_token']);\r\n }\r\n var_dump($result);\r\n }",
"protected function access_token() {\r\n\r\n\t\t$this->tmhOAuth->config['user_token'] = $_SESSION['oauth']['oauth_token'];\r\n\t\t$this->tmhOAuth->config['user_secret'] = $_SESSION['oauth']['oauth_token_secret'];\r\n\r\n\t\t$code = $this->tmhOAuth->request(\r\n\t\t\t'POST',\r\n\t\t\t$this->tmhOAuth->url('oauth/access_token', ''),\r\n\t\t\tarray(\r\n\t\t\t\t'oauth_verifier' => $_REQUEST['oauth_verifier']\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif ($code == 200) {\r\n\t\t\t$token = $this->tmhOAuth->extract_params($this->tmhOAuth->response['response']);\r\n\t\t\t$this->conf->TwitterOAuthToken = $token['oauth_token'];\r\n\t\t\t$this->conf->TwitterOAuthSecret = $token['oauth_token_secret'];\r\n\t\t\t$this->conf->TwitterUsername = $token['screen_name'];\r\n\t\t\t$this->conf->write();\r\n\t\t\tunset($_SESSION['oauth']);\r\n\t\t\theader('Location: ' . SocialHelper::php_self());\r\n\t\t} else {\r\n\t\t\t$this->addError();\r\n\t\t}\r\n\t}",
"public function save_access_token($api_id, $token_name, $hash) {\n\t\t$data = array(\n\t\t\t'api_id' => sanitize_text_field($api_id),\n\t\t\t'token_name' => sanitize_text_field($token_name),\n\t\t\t'hash' => sanitize_text_field($hash),\n\t\t\t);\n\n\t\t// check if token already exists\n\t\t$tokens = $this->get_access_tokens();\n\n\t\t$key = false;\n\t\tif (count($tokens)) {\n\t\t\t$ids = wp_list_pluck($tokens, 'hash');\n\t\t\t$key = array_search($hash, $ids);\n\t\t}\n\n\t\t// this is a new token\n\t\tif ($key === false) {\n\t\t\t$tokens[] = $data;\n\t\t}\n\t\t// this is an existing token\n\t\telse {\n\t\t\t$tokens[$key] = $data;\n\t\t}\n\n\t\t// re-index array and update key in user meta storage\n\t\tupdate_user_meta($this->user->ID, self::META_TYK_ACCESS_TOKENS_KEY, array_values($tokens));\n\t}",
"function SaveInfo()\r\n\t{\r\n\t\t//Access is not stored in files, just directories.\r\n\t\tif (is_file($this->path)) unset($this->info['access']);\r\n\t\t$info = $this->dir.'/.'.$this->filename;\r\n\t\t$fp = fopen($info, 'w+');\r\n\t\tfwrite($fp, serialize($this->info));\r\n\t\tfclose($fp);\r\n\t}",
"public function setaccess_token($value);"
] | [
"0.773946",
"0.6335817",
"0.6212518",
"0.6045753",
"0.5930729",
"0.58840746",
"0.58693653",
"0.58662856",
"0.58635217",
"0.5844006",
"0.58256173",
"0.5773556",
"0.5768012",
"0.5749106",
"0.57348484",
"0.5732757",
"0.5728807",
"0.57190937",
"0.5716746",
"0.56892526",
"0.56399244",
"0.5632181",
"0.55117357",
"0.54210347",
"0.53911895",
"0.5378303",
"0.5375917",
"0.5368671",
"0.5367459",
"0.5324414"
] | 0.7467016 | 1 |
Allows you to download advertiser information by specifying the Application Status ID for the Application Status that you want to get the List of Merchants for. Application status options: approved approval extended wait temp removed temp rejected perm removed perm rejected self removed | public function merchantByAppStatus($status)
{
$this->setHeader(self::HEADER_TYPE_BEARER);
$this->setLink(self::MERCHANT_BY_APP_STATUS.'/'.$status);
$curl = new Curl;
$response = $curl->get($this->getLink(), '', $this->getHeader());
$xmlData = new SimpleXMLElement(XMLHelper::tidy($response));
return $xmlData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_all_ads($status = \"active\")\t{\n\n\t}",
"public function merchant()\n {\n $this->setHeader(self::HEADER_TYPE_BEARER);\n $link = Rakuten::BASE_API_URL.'/'.self::API_NAME_ADVERTISER_SEARCH.'/'.self::API_VERSION;\n\n\n $curl = new Curl;\n $response = $curl->get($link, '', $this->getHeader());\n\n $xmlData = new SimpleXMLElement(XMLHelper::tidy($response));\n\n return $xmlData;\n }",
"public function adminListWithdrawal($status)\n {\n $withdrawals = Withdrawal::select([\n 'code',\n 'amount',\n 'status',\n 'created_at',\n \"user_id\",\n 'completed_at',\n ])->with([\n 'user:id,code,first_name,last_name,email,profile_image',\n 'user.withdrawalBank:id,user_id,bank_code,account_name,account_number'\n ])\n ->where('status', $status)\n ->latest()\n ->paginate(10);\n $response['status'] = \"success\";\n $response['withdrawals'] = $withdrawals;\n return response()->json($response, Response::HTTP_OK);\n }",
"public function retrieveConsents()\n {\n return $this->start()->uri(\"/api/consent\")\n ->get()\n ->go();\n }",
"public function listAction(){\n\n $listAdverts = $this\n ->getDoctrine()\n ->getManager()\n ->getRepository('OCPlatformBundle:Advert')\n ->getAdvertWithApplications()\n ;\n\n foreach ($listAdverts as $advert) {\n // Ne déclenche pas de requête : les candidatures sont déjà chargées !\n // Vous pourriez faire une boucle dessus pour les afficher toutes\n $advert->getApplications();\n }\n }",
"public function testMerchantsOneResponseStatus()\n\t{\n\t\tfor ($i = 0; $i < count($this->lightMerchantsIds); $i++) { \n\t\t\t$this->client->request('GET', \"/merchants/{$this->lightMerchantsIds[$i]}/$this->from/$this->to\");\n\t\t\t\n\t\t\tif ($this->lightMerchantsIds[$i] == -1) {\n\t\t\t\t$this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());\n\t\t\t} else {\n\t\t\t\t$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());\n\t\t\t}\t\n\t\t}\n\t}",
"public function get_bl_customers(){\r\n\t\t//ClientId: ed4d82fc-b6d7-4518-a292-abad6eadb9fb\r\n\t\t//ClientSecret: d8a11026-4a8c-4650-b159-32c791e7a1b9\r\n\r\n\t\t$post_data = array(\r\n\t\t\t\"grant_type\"=>\"client_credentials\",\r\n\t\t\t\"scope\"=>\"\",\r\n\t\t\t\"client_id\"=>\"ed4d82fc-b6d7-4518-a292-abad6eadb9fb\",\r\n\t\t\t\"client_secret\"=>\"d8a11026-4a8c-4650-b159-32c791e7a1b9\"\r\n\t\t);\r\n\r\n\t\t$this->call_bl_api_auth($post_data);\r\n\t\t//$result = CallAPI(\"POST\",\"https://apigateway.blinfo.se/auth/oauth/v2/token\")\r\n\t}",
"function printToolAdmin() {\r\n $criteria = array('status' => Appeal::$STATUS_AWAITING_ADMIN);\r\n return printAppealList($criteria);\r\n}",
"public function getReferralAccounts () \n {\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/referral/accounts';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ClickSendSDK'\n );\n\n //set HTTP basic auth parameters\n Request::auth(Configuration::$username, Configuration::$key);\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n //Error handling using HTTP status codes\n if ($response->code == 400) {\n throw new APIException('BAD_REQUEST', 400, $response->body);\n }\n\n else if ($response->code == 401) {\n throw new APIException('UNAUTHORIZED', 401, $response->body);\n }\n\n else if ($response->code == 403) {\n throw new APIException('FORBIDDEN', 403, $response->body);\n }\n\n else if ($response->code == 404) {\n throw new APIException('NOT_FOUND', 404, $response->body);\n }\n\n else if ($response->code == 405) {\n throw new APIException('METHOD_NOT_FOUND', 405, $response->body);\n }\n\n else if ($response->code == 429) {\n throw new APIException('TOO_MANY_REQUESTS', 429, $response->body);\n }\n\n else if ($response->code == 500) {\n throw new APIException('INTERNAL_SERVER_ERROR', 500, $response->body);\n }\n\n else if (($response->code < 200) || ($response->code > 206)) { //[200,206] = HTTP OK\n throw new APIException(\"HTTP Response Not OK\", $response->code, $response->body);\n }\n\n return $response->body;\n }",
"public function getAnApplicant($application_id);",
"public function bookingActive()\n\t{\n\t\t$ch = new Curl();\n\t\t\n\t\t$this->headers['Authorization'] = 'Bearer ' . $this->authToken;\n\t\t\n\t\t$data = [];\n\t\t\n\t\treturn $ch->get(GojekID::BASE_ENDPOINT . Action::bookingActive, $data, $this->headers)->getResponse();\n\t}",
"public function getData(){\n\t\t$url = $this->host . \"/rest/v1/leads.json?access_token=\" . $this->getToken()\n\t\t\t\t\t\t. \"&filterType=\" . $this->filterType . \"&filterValues=\" . $this::csvString($this->filterValues);\n\t\t\n\t\tif (isset($this->batchSize)){\n\t\t\t$url = $url . \"&batchSize=\" . $this->batchSize;\n\t\t}\n\t\tif (isset($this->nextPageToken)){\n\t\t\t$url = $url . \"&nextPageToken=\" . $this->nextPageToken;\n\t\t}\n\t\tif(isset($this->fields)){\n\t\t\t$url = $url . \"&fields=\" . $this::csvString($this->fields);\n\t\t}\n\t\t\n\t\t//debug\n\t\t//echo '<p>url after = ' . $url . '</p>';\n\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json',));\n\t\t$response = curl_exec($ch);\n\t\treturn $response;\n\t}",
"function olc_cfg_pull_down_customers_status_list($customers_status_id, $key = '') {\n\t$name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');\n\treturn olc_draw_pull_down_menu($name, olc_get_customers_statuses(), $customers_status_id);\n}",
"function _getActiveVendors() {\n $this->resetResponse();\n if ($this->ci->session->userdata('user_id') != null) {\n $archived = $this->ci->input->post('archived', true);\n\n $result = $this->model->getActiveVendors('*', array(\"person_type\" => Globals::PERSON_TYPE_VENDOR, \"person_archived\" => $archived))->result();\n\n if ($result) {\n $this->_status = true;\n $this->_message = '';\n $this->_rdata = $result;\n\n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('no_records_found');\n }\n \n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('invalid_user');\n \n }\n\n return $this->getResponse();\n }",
"public function index()\n {\n //\n $absents = AbsentApplication::whereIn('user_id',\n User::whereIn('id',\n ProjectUser::whereIn('project_id',\n Project::where('managed',\n Auth::user()->id)->get()->pluck('id'))\n ->get()->pluck('user_id'))\n ->get()->pluck('id'))\n ->where('state', AbsentApplication::getAbsentWaitting())->get();\n\n\n return response()->json([\n 'absents' => $absents,\n ], 200);\n }",
"public function applicants() {\n\t\t// Utility variables\n\t\t$db = Helium::db();\n\t\t$app = 'Applicant'; // change to BetterApplicant for optimization\n\n\t\t// Here's how this works:\n\t\t// 1. Read filter from query string\n\t\t// If there is no filter, apply default filter\n\t\t// 2. Display applicants based on params[view]\n\t\t// view=stats or view=list\n\t\t// If there is no view param, apply default view.\n\n\t\t// Filtering\n\t\t// Final product: $constraints\n\n\t\t// Filter by chapter\n\t\t// This can only be used by national admin\n\t\tif ($this->user->capable_of('national_admin')) {\n\t\t\tif ($this->params['chapter_id'] && $this->params['chapter_id'] != 1) {\n\t\t\t\t$constraints[] = 'chapter_id=' . $this->params['chapter_id'];\n\t\t\t\t$chapter = Chapter::find($this->params['chapter_id']);\n\t\t\t}\n\t\t}\n\t\t// Otherwise, only list applicants from user's chapter\n\t\telse {\n\t\t\t$constraints[] = 'chapter_id=' . $this->user->chapter_id;\n\t\t\t$chapter = $this->user->chapter;\n\t\t}\n\n\t\t// Filter by stage\n\t\t$current_stage = $this->params['stage'] ? $this->params['stage'] : 'active';\n\t\tswitch ($current_stage) {\n\t\t\tcase 'incomplete':\n\t\t\t\t$constraints[] = 'confirmed=0 AND finalized=0 AND expires_on > NOW()';\n\t\t\t\tbreak;\n\t\t\tcase 'expired':\n\t\t\t\t$constraints[] = 'confirmed=0 AND finalized=0 AND expires_on < NOW()';\n\t\t\t\tbreak;\n\t\t\tcase 'confirmed':\n\t\t\t\t$constraints[] = 'confirmed=1';\n\t\t\t\tbreak;\n\t\t\tcase 'finalized':\n\t\t\t\t$constraints[] = 'finalized=1';\n\t\t\t\tbreak;\n\t\t\tcase 'not_yet_confirmed':\n\t\t\t\t$constraints[] = 'expires_on <= NOW() AND confirmed=0 AND finalized=1';\n\t\t\t\tbreak;\n\t\t\tcase 'active':\n\t\t\tcase 'selection_1':\n\t\t\t\t$constraints[] = 'expires_on > NOW() OR finalized=1';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Specific filters -- through a custom search query\n\t\t$filter = $this->params['filter'];\n\t\tif (is_array($filter)) {\n\t\t\t$current_stage = 'search';\n\t\t\t$search_title = array();\n\n\t\t\t// Filter by school\n\t\t\tif ($filter['school_name']) {\n\t\t\t\t$constraints[] = \"sanitized_high_school_name='\" . $filter['school_name'] . \"'\";\n\t\t\t\t$search_title[] = $filter['school_name'];\n\t\t\t\tunset($filter['school_name']);\n\t\t\t}\n\n\t\t\t// Filter by name\n\t\t\tif ($filter['name']) {\n\t\t\t\t$constraints[] = $db->prepare(\"`sanitized_full_name` LIKE '%%%s%%'\", str_replace(' ', '%', $this->params['name']));\n\t\t\t\t$search_title = $filter['name'];\n\t\t\t\tunset($filter['name']);\n\t\t\t}\n\n\t\t\t// For other filters, merge them into constraints\n\t\t\tforeach ($filter as $k => $v) {\n\t\t\t\t$constraints[$k] = $v;\n\t\t\t}\n\t\t}\n\n\t\t// View selection\n\t\t$view = $this->params['view'];\n\t\t$acceptable_views = array('list', 'stats');\n\t\tif (!$view && !in_array($view, $acceptable_views)) {\n\t\t\t$view = 'list';\n\t\t}\n\n\t\tswitch ($view) {\n\t\t\tcase 'list':\n\t\t\t\t// List-specific magic here: pagination, etc.\n\t\t\t\t$applicants = $app::find('chapter_id=5');\n\t\t\t\tforeach ($constraints as $constraint) {\n\t\t\t\t\t$applicants->narrow('(' . $constraint . ')');\n\t\t\t\t}\n\t\t\t\t// -- Pagination --\n\t\t\t\t$batch_length = 100;\n\t\t\t\t$applicants->set_batch_length($batch_length);\n\t\t\t\tif (!$this->params['page'])\n\t\t\t\t\t$this->params['page'] = 1;\n\t\t\t\t$page = $this->params['page'];\n\t\t\t\t$count_all = $applicants->count_all();\n\t\t\t\t$applicants->set_batch_number($page);\n\t\t\t\t$first = (($page - 1) * $batch_length) + 1;\n\t\t\t\t$last = ($first + $batch_length - 1) > $count_all ? $count_all : ($first + $batch_length - 1);\n\n\t\t\t\t// Applicants is now ready for listing.\n\t\t\t\t$this['applicants'] = $applicants;\n\t\t\t\t$this['chapter'] = $chapter;\n\t\t\t\t$this['total_pages'] = $applicants->get_number_of_batches();\n\t\t\t\t$this['current_page'] = $page;\n\t\t\t\t$this['first'] = $first;\n\t\t\t\t$this['last'] = $last;\n\t\t\t\t$this['count_all'] = $count_all;\n\t\t\t\t$this['search_title'] = $search_title;\n\t\t\t\t$this['current_stage'] = $this->params['stage'];\n\t\t\t\tbreak;\n\t\t\tcase 'stats':\n\t\t\t\t$stats = array(\n\t\t\t\t\t'sex' => array(\n\t\t\t\t\t\t'type' => 'pie',\n\t\t\t\t\t\t'field' => 'sex',\n\t\t\t\t\t\t'partition' => 'applicant_personal_details',\n\t\t\t\t\t),\n\t\t\t\t\t'school' => array(\n\t\t\t\t\t\t'type' => 'pie',\n\t\t\t\t\t\t'field' => 'sanitized_high_school_name',\n\t\t\t\t\t\t'partition' => 'applicant_personal_details',\n\t\t\t\t\t),\n\t\t\t\t\t'chapter' => array(\n\t\t\t\t\t\t'type' => 'pie',\n\t\t\t\t\t\t'field' => 'chapter_id',\n\t\t\t\t\t\t'base_query' => \"SELECT COUNT(*) AS rows, %s AS chapter_id, chapter_name AS value FROM applicants INNER JOIN chapters %s ON chapter_id=chapters.id WHERE %s AND (applicants.expires_on > NOW() or applicants.finalized=1) GROUP BY %s ORDER BY rows DESC\",\n\t\t\t\t\t),\n\t\t\t\t\t'province' => array(\n\t\t\t\t\t\t'type' => 'pie',\n\t\t\t\t\t\t'field' => 'applicant_address_province',\n\t\t\t\t\t\t'partition' => 'applicant_contact_info',\n\t\t\t\t\t),\n\t\t\t\t\t'city' => array(\n\t\t\t\t\t\t'type' => 'pie',\n\t\t\t\t\t\t'field' => \"CONCAT(applicant_address_city, ', ', applicant_address_province)\",\n\t\t\t\t\t\t'partition' => 'applicant_contact_info',\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\tif ($constraints)\n\t\t\t\t\t$constraint_string = implode(' AND ', $constraints);\n\t\t\t\telse\n\t\t\t\t\t$constraint_string = '1';\n\t\t\t\t\n\t\t\t\tforeach ($stats as $key => $group) {\n\t\t\t\t\tunset($type, $field, $partition, $base_query, $join_string);\n\t\t\t\t\textract($group);\n\t\t\t\t\tif (!$base_query)\n\t\t\t\t\t\t$base_query = \"SELECT COUNT(*) AS rows, %s AS value FROM applicants %s WHERE %s AND (applicants.expires_on > NOW() or applicants.finalized=1) GROUP BY %s ORDER BY rows DESC\";\n\n\t\t\t\t\tif ($partition)\n\t\t\t\t\t\t$join_string = $db->prepare(\"INNER JOIN `%s` ON `%s`.applicant_id = applicants.id\", $partition, $partition);\n\n\t\t\t\t\t$the_query = sprintf($base_query, $field, $join_string, $constraint_string, $field);\n\t\t\t\t\t$results = $db->get_results($the_query);\n\t\t\t\t\t\n\t\t\t\t\t$series = array();\n\t\t\t\t\t$total = 0;\n\t\t\t\t\tif (is_array($results)) {\n\t\t\t\t\t\tforeach ($results as $row) {\n\t\t\t\t\t\t\t$rows = $row->rows;\n\t\t\t\t\t\t\t$value = $row->value;\n\t\t\t\t\t\t\t$value = trim($value); // perhaps more trimming could be in order\n\n\t\t\t\t\t\t\tif ($series[$value])\n\t\t\t\t\t\t\t\t$series[$value] += $rows;\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$series[$value] = $rows;\n\n\t\t\t\t\t\t\t$total += $rows;\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$stats[$key]['data'] = compact('series', 'total');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// country preferences - special stats\n\t\t\t\t/*\n\t\t\t\t$countries = $db->get_col(\"SELECT country_preference_1, COUNT(*) AS rows FROM applicant_program_choices WHERE country_preference_1 IS NOT NULL AND country_preference_1 != '' GROUP BY country_preference_1 ORDER BY rows DESC\");\n\t\t\t\t$country_stats = array();\n\t\t\t\tforeach ($countries as $country) {\n\t\t\t\t\t$numbers = array();\n\t\t\t\t\tfor ($i = 1; $i <= 10; $i++) {\n\t\t\t\t\t\t$cq = \"SELECT COUNT(*) FROM applicant_program_choices INNER JOIN applicants ON applicants.id=applicant_program_choices.applicant_id WHERE country_preference_$i='$country' AND $constraint_string\";\n\t\t\t\t\t\t$numbers[$i] = $db->get_var($cq);\n\t\t\t\t\t}\n\t\t\t\t\t$country_stats[$country] = $numbers;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t$total_afs = $db->get_var(\"SELECT COUNT(*) FROM applicant_program_choices INNER JOIN applicants ON applicants.id=applicant_program_choices.applicant_id WHERE program_afs='1' AND $constraint_string\");\n\t\t\t\t\n\t\t\t\t// other countries - special stats\n\t\t\t\t$other_countries = $db->get_col(\"SELECT country_preference_other FROM applicant_program_choices INNER JOIN applicants ON applicants.id=applicant_program_choices.applicant_id WHERE country_preference_other != 'N/A' AND country_preference_other != 'NA' AND $constraint_string\");\n\t\t\t\t$split_pattern = \"/[,;\\/&]+|\\s+(dan|and)\\s+/i\";\n\t\t\t\t\n\t\t\t\t$country_cases = array();\n\t\t\t\t$other_countries_series = array();\n\t\t\t\t$other_countries_total = 0;\n\t\t\t\t\n\t\t\t\t$country_normalization_patterns = array(\n\t\t\t\t\t'/london|inggris|britania raya|england|uk/i' => 'United Kingdom',\n\t\t\t\t\t'/\\s+\\(.*\\)/' => '',\n\t\t\t\t\t'/korea( selatan)?|south korea/i' => 'South Korea',\n\t\t\t\t\t'/kanada/i' => 'Canada',\n\t\t\t\t\t'/singapura/i' => 'Singapore',\n\t\t\t\t\t'/spanyol/i' => 'Spain',\n\t\t\t\t\t'/^arab( saudi)?$/i' => 'Saudi Arabia',\n\t\t\t\t\t'/turki/i' => 'Turkey',\n\t\t\t\t\t'/rusia/i' => 'Russia',\n\t\t\t\t\t'/^(republik rakyat )?ch?ina$|^rrc$/i' => \"China, People's Republic of\",\n\t\t\t\t\t'/selandia baru|nz/i' => 'New Zealand'\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tforeach ($other_countries as $list_of_countries) {\n\t\t\t\t\t$split_countries = preg_split($split_pattern, $list_of_countries);\n\t\t\t\t\tforeach ($split_countries as $country_name) {\n\t\t\t\t\t\t$country_name = trim($country_name, ' -');\n\t\t\t\t\t\tif (!$country_name)\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t$country_name = preg_replace(array_keys($country_normalization_patterns), array_values($country_normalization_patterns), $country_name);\n\n\t\t\t\t\t\t$lowercased = strtolower($country_name);\n\t\t\t\t\t\tif ($proper_case = $country_cases[$lowercased]) {\n\t\t\t\t\t\t\t$other_countries_series[$proper_case]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$country_cases[$lowercased]\t= $country_name;\n\t\t\t\t\t\t\t$other_countries_series[$country_name] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$other_countries_total++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$stats['other_countries'] = array(\n\t\t\t\t\t'type' => 'bar',\n\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t'series' => $other_countries_series,\n\t\t\t\t\t\t'total' => $total_afs\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\t$this['stats'] = $stats;\n\t\t\t\t$this['country_stats'] = $country_stats;\n\t\t\t\t$this['total_afs'] = $total_afs;\n\t\t\t\t$this['chapter'] = $chapter;\n\t\t\t\t$this['search_title'] = $search_title;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this['current_stage'] = $current_stage;\n\t\t$this['view'] = $view;\n\t\t$this['search_title'] = $search_title ? implode(', ', $search_title) : '';\n\t}",
"function _vendorCompanyList(){\n $this->resetResponse();\n if ($this->ci->session->userdata('user_id') != null) {\n $archived = $this->ci->input->post('archived', true);\n\n $result = $this->model->getVendorCompany('*', array(\"person_type\" => Globals::PERSON_TYPE_VENDOR))->result();\n if ($result) {\n $this->_status = true;\n $this->_message = '';\n $this->_rdata = $result;\n\n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('no_records_found');\n }\n \n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('invalid_user');\n \n }\n\n return $this->getResponse();\n }",
"function query_campaigns($status = 'SENT')\n\t{\n\t\t$xml = $this->load_url('campaigns?status=' . urlencode($status));\n\n\t\tif(!$xml):\n\t\t\treturn false;\n\t\tendif;\n\n\t\t// parse into nicer array\n\t\t$campaigns = array();\n\t\t$_campaigns = (isset($xml['feed']['entry'])) ? $xml['feed']['entry'] : false;\n\n\t\tif(is_array($_campaigns)):\n\t\t\tif(isset($_campaigns[0]['link_attr']['href'])):\n\t\t\t\tforeach($_campaigns as $k => $v):\n\t\t\t\t\t$id = $this->get_id_from_link($v['link_attr']['href']);\n\t\t\t\t\t$campaign = $v['content']['Campaign'];\n\t\t\t\t\t$campaign['id'] = $id;\n\t\t\t\t\t$campaigns[] = $campaign;\n\t\t\t\tendforeach;\n\t\t\telse:\n\t\t\t\t$id = $this->get_id_from_link($_campaigns['link_attr']['href']);\n\t\t\t\t$campaign = $_campaigns['content']['Campaign'];\n\t\t\t\t$campaign['id'] = $id;\n\t\t\t\t$campaigns[] = $campaign;\n\t\t\tendif;\n\t\tendif;\n\n\t\treturn $campaigns;\n\t}",
"public function getMerchants()\n {\n $obj = new stdClass();\n\n // Must be in specific order for checksum --\n $obj->Timestamp = $this->getTimeStamp();\n $obj->SessionID = $this->getSessionID();\n $obj->PinCode = $this->getPinCode();\n $obj->UserAgent = $this->getUserAgent();\n // -----------------------------------------\n // Generate Checksum\n $obj->Checksum = $this->generateChecksum($obj);\n\n // Ask for getMerchants and get response\n $result = $this->client->getMerChants($obj);\n $result = $result->GetMerchantsResult;\n $merchants = isset($result->Merchants->Merchant) ? $result->Merchants->Merchant : null;\n\n $obj->Timestamp = $result->Timestamp;\n\n if (!is_null($merchants)) {\n // Assign all properties of the Merchants object as property of mainObject\n $obj = $this->parseForChecksum($obj, $merchants, true, array(\"MerchantID\", \"Description\", \"TestMode\"));\n }\n\n // Unset properties for new Checksum\n unset($obj->Checksum);\n\n // Verify response data by making a new Checksum\n $Checksum = $this->generateChecksum($obj);\n\n // Compare Checksums\n if ($result->Checksum != $Checksum)\n throw new Exception('Data could not be verified');\n\n return (array) $merchants;\n }",
"public function getPromotedapplicantInfobyApplicationId($id) {\n\n\n $result = $this->db->get_where($this->_admissionpromotedapplicant, array('applicationId' => $id));\n $result_info = $result->result_array();\n if (!empty($result_info)) {\n return $result_info[0];\n }\n }",
"function printCheckuserNeeded() {\r\n $criteria = array('status' => Appeal::$STATUS_AWAITING_CHECKUSER);\r\n return printAppealList($criteria);\r\n}",
"public function getDownloadsList($customerId);",
"public function show($id)\n {\n $leads = Leads::find($id);\n $status = new status;\n $data = $status->all();\n $sales_persons = Helpers::getUsersArrayByRole('Sales');\n $leads['statusid'] = $data;\n $users = User::all()->toArray();\n $leads['users'] = $users;\n $brands = Brand::all()->toArray();\n $leads['brands'] = $brands;\n $leads['selected_products_array'] = json_decode($leads['selected_product']);\n $leads['products_array'] = [];\n $leads['recordings'] = CallRecording::where('lead_id', $leads->id)->get()->toArray();\n $leads['customers'] = Customer::all();\n $tasks = Task::where('model_type', 'leads')->where('model_id', $id)->get()->toArray();\n // $approval_replies = Reply::where('model', 'Approval Lead')->get();\n // $internal_replies = Reply::where('model', 'Internal Lead')->get();\n $reply_categories = ReplyCategory::all();\n\n $leads['multi_brand'] = is_array(json_decode($leads['multi_brand'], true)) ? json_decode($leads['multi_brand'], true) : [];\n // $selected_categories = is_array(json_decode( $leads['multi_category'],true)) ? json_decode( $leads['multi_category'] ,true) : [] ;\n $data['category_select'] = Category::attr(['name' => 'multi_category', 'class' => 'form-control', 'id' => 'multi_category'])\n ->selected($leads->multi_category)\n ->renderAsDropdown();\n $leads['remark'] = $leads->remark;\n\n $messages = Message::all()->where('moduleid', '=', $leads['id'])->where('moduletype', '=', 'leads')->sortByDesc(\"created_at\")->take(10)->toArray();\n $leads['messages'] = $messages;\n\n if (!empty($leads['selected_products_array'])) {\n foreach ($leads['selected_products_array'] as $product_id) {\n $skuOrName = $this->getProductNameSkuById($product_id);\n\n $data['products_array'][$product_id] = $skuOrName;\n }\n }\n\n $users_array = Helpers::getUserArray(User::all());\n\n $selected_categories = $leads['multi_category'];\n return view('leads.show', compact('leads', 'id', 'data', 'tasks', 'sales_persons', 'selected_categories', 'users_array', 'reply_categories'));\n }",
"public function offer_reports_get()\n {\n $this->verify_request(); \n $data = $this->Offer_model->offer_reports();\n $status = parent::HTTP_OK;\n $response = ['status' => $status, 'data' => $data];\n $this->response($response, $status);\n }",
"public function getVendorData()\n {\n $ven = MasterVendor::latest()->get();\n return response([\n 'success' => true,\n 'message' => 'List All Vendor',\n 'data' => $ven\n ], 200);\n\n }",
"public function index()\n {\n // $merchants = User::role('merchant')->get();\n $merchants = Merchant::all();\n\n return new MerchantIndexResponse($merchants);\n }",
"public function getAllApplicants();",
"public function getOffer($id = 0)\n\t{\n\t\t$offer=Offers::where('id',$id)->where('status',1)->get();\t\t\n\t\t\n\t\t/*$arr = str_split('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');\n\t\t$offer->code = '';\n\t\tfor($i = 0; $i <= 8; $i++)\n\t\t{\n\t\t\t$offer->code .= $arr[array_rand($arr)];\n\t\t}*/\n\t\t\n\t\t$offer=OffersResource::collection($offer);\n\t\treturn $this->apiDataResponse($offer);\n\t}",
"abstract protected function getStatusesInfos();",
"public function testMerchantsAllResponseStatus()\n\t{\n\t\t$this->client->request('GET', \"/merchants/$this->from/$this->to\");\n\t\t$this->assertSame(Response::HTTP_OK, $this->client->getResponse()->getStatusCode());\n\n\t\t$this->client->request('GET', \"/merchants/$this->wrongFrom/$this->wrongTo\");\n\t\t$this->assertSame(Response::HTTP_NOT_FOUND, $this->client->getResponse()->getStatusCode());\n\t}"
] | [
"0.53869826",
"0.5303477",
"0.5282215",
"0.52747905",
"0.5157121",
"0.507684",
"0.5073884",
"0.50166917",
"0.5013608",
"0.48790282",
"0.4876594",
"0.48608246",
"0.48524415",
"0.48471943",
"0.48466998",
"0.48274335",
"0.48246792",
"0.48224527",
"0.48127168",
"0.4798077",
"0.47903225",
"0.47734806",
"0.47711253",
"0.47652185",
"0.47544575",
"0.4729348",
"0.47274315",
"0.47014502",
"0.46910354",
"0.46855205"
] | 0.61909103 | 0 |
Provides you the available banner links. To obtain specific banner links, you can filter this request using these parameters: MID, Category, Size, Start Date, and End Date. | public function bannerLinks(
$merchantId = -1,
$categoryId = -1,
$startDate = null,
$endDate = null,
$size = -1,
$campaignId = -1,
$page = 1
) {
$startD = (isset($startDate)) ? str_replace('-', '', $startDate) : null;
$endD = (isset($endDate)) ? str_replace('-', '', $endDate) : null;
$this->setParameter(0, $merchantId);
$this->setParameter(1, $categoryId);
$this->setParameter(2, $startD);
$this->setParameter(3, $endD);
$this->setParameter(4, $size);
$this->setParameter(5, $campaignId);
$this->setParameter(6, $page);
$this->setHeader(self::HEADER_TYPE_BEARER);
$this->setLink(self::BANNER_LINKS.'/'.$this->getParameter());
$curl = new Curl;
$response = $curl->get($this->getLink(), '', $this->getHeader());
$xmlData = new SimpleXMLElement(XMLHelper::tidy($response));
return $xmlData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLinksList()\n {\n $sql = 'SELECT bwl.*, bwll.`title`, bwll.`url`\n FROM `'._DB_PREFIX_.'bwcatbanner_link` bwl\n LEFT JOIN `'._DB_PREFIX_.'bwcatbanner_link_lang` bwll\n ON (bwl.`id_item` = bwll.`id_item`)\n WHERE bwl.`id_shop` = '.(int)Context::getContext()->shop->id.'\n AND bwll.`id_lang` = '.(int)Context::getContext()->language->id;\n\n return Db::getInstance()->executeS($sql);\n }",
"function getbanners()\n\t\t{\n\t\t\t$banners = $this->manage_content->getValue('banner_info','*');\n\t\t\techo '<div id=\"add_space\">';\n\t\t\tforeach($banners as $banner)\n\t\t\t{\n\t\t\t\tif($banner['banner_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$banner['banner_link'].'\">';\n\t\t\t\t\techo '<div class=\"add_section\"><img src=\"images/'.$banner['banner_image'].'\" style=\"height:'.$banner['banner_height'].'px;width:'.$banner['banner_width'].'px;float:left;\"/></div></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</div>';\n\t\t}",
"public static function GetBanners()\n\t{\n\t\t$output = '';\n\t\t\n\t\t$sql = 'SELECT\n\t\t\t\t\tb.id, b.image_file, b.link_url, b.priority_order,\n\t\t\t\t\tbd.image_text\n\t\t\t\tFROM '.TABLE_BANNERS.' b\n\t\t\t\t\tLEFT OUTER JOIN '.TABLE_BANNERS_DESCRIPTION.' bd ON b.id = bd.banner_id\n\t\t\t\tWHERE b.is_active = 1 AND b.image_file != \\'\\' AND bd.language_id = \\''.encode_text(Application::Get('lang')).'\\' \n\t\t\t\tORDER BY RAND() ASC';\n\t\t$result = database_query($sql, DATA_AND_ROWS, FIRST_ROW_ONLY);\n\t\tif($result[1] > 0){\n\t\t\t$image = '<img src=\"'.APPHP_BASE.'images/banners/'.$result[0]['image_file'].'\" width=\"723px\" height=\"140px\" alt=\"banner\" />';\t\n\t\t\tif($result[0]['link_url'] != '' && $result[0]['link_url'] != 'http://'){\n\t\t\t\t$output .= '<a href=\"'.$result[0]['link_url'].'\" title=\"'.$result[0]['image_text'].'\">'.$image.'</a>';\n\t\t\t}else{\n\t\t\t\t$output .= $image;\n\t\t\t}\t\t\t\n\t\t}\n\t return $output;\n\t}",
"public function get_links()\n {\n }",
"public function listing($stat='',$start=0)\n\t{\n\t\t\n\t\t\n\n\t\t/*-------------------------------------------------------------\n\t\t \tBreadcrumb Setup Start\n\t\t -------------------------------------------------------------*/\t\t\n\t\t$link = breadcrumb();\t\t\n\t\t$data['breadcrumb'] = $link;\n /*-------------------------------------------------------------\n\t\t \tBanner Based on Campaign Id\n\t\t -------------------------------------------------------------*/\n $data['sel_camp'] = 0;\n $data['sel_stat'] = $stat;\n\t\t/*--------------------------------------------------------------\n\t\t \tPagination Config Setup\n\t\t ---------------------------------------------------------------*/\n\t\t \n\t\t$limit = $this->page_limit;\t\n if($stat=='active')\n {\n $status = 0;\n $where_arr = array('ox_banners.status'=>$status); \n}\n elseif($stat=='inactive')\n {\n $status = 1;\n $where_arr = array('ox_banners.status'=>$status);\n\t\t\t\n }\n else\n {\n $stat = 'all';\n $where_arr = array();\n }\n \n \n\t\t$list_data = $this->mod_banner->get_banners($where_arr);\n\t\t\n\t\t//echo $this->db->last_query();exit;\n\t\t\n\t\t/*--------------------------------------------------------------------------\n \t* Get Reports for each banners based on selected Campaigns and Advertiser\n \t* -------------------------------------------------------------------------*/\n\n\n\t\t$search_arr = array();\n\t\t$search_arr['from_date'] =\t$this->mod_statistics->get_start_date();\n\t\t$search_arr['to_date'] =\tdate(\"Y/m/d\");\n\t\t$search_arr['search_type'] =\t\"all\";\n\t\t\n\t\t$data['stat_data'] = $this->mod_statistics->get_statistics_for_banners($search_arr);\n\t\t\n\t\t/* Total Banners Count */\t\n\t\t/*$data['tot_list'] = $list_data;\n\t\t\t\t\n\t\t$config['per_page'] \t= $limit;\n\t\t$config['base_url'] \t= site_url(\"admin/inventory_banners/listing/\".$stat);\n $config['uri_segment'] \t= 5; \n\t\t$config['total_rows'] \t= count($list_data);\n\t\t$config['next_link'] \t= $this->lang->line(\"pagination_next_link\");\n\t\t$config['prev_link'] \t= $this->lang->line(\"pagination_prev_link\");\t\t\n\t\t$config['last_link'] \t= $this->lang->line(\"pagination_last_link\");\t\t\n\t\t$config['first_link'] \t= $this->lang->line(\"pagination_first_link\");\n\t\t$this->pagination->initialize($config);*/\t\t\n\t\t$page_data = $this->mod_banner->get_banners($where_arr);\n\t\t$data['banner_list']\t=\t$page_data;\n\t\t\t\t\t\n\t\t/*-------------------------------------------------------------\n\t\t \tPage Title showed at the content section of page\n\t\t -------------------------------------------------------------*/\n\t\t$data['page_title'] \t= $this->lang->line('label_inventory_banner_page_title');\t\t\n\t\t\n\t\t/*-------------------------------------------------------------\n\t\t \tTotal Counts for Active and Inactive Banners\n\t\t--------------------------------------------------------------*/ \n\t\t \n $where_tot = array();\n $where_act = array('ox_banners.status'=>0);\n\t\t$where_inact = array('ox_banners.status'=>1);\n\t\t\n\t\t\n\t\t$tot_data = $this->mod_banner->get_banners($where_tot);\n\t\tif($tot_data!=FALSE)\n\t\t{\n\t\t\t$data['tot_data'] = count($tot_data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['tot_data'] = 0;\n\t\t}\n\t\t\n\t\t$active_data = $this->mod_banner->get_banners($where_act);\n\t\tif($active_data!=FALSE)\n\t\t{\n\t\t\t$data['active_data'] = count($active_data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['active_data'] = 0;\n\t\t}\n\t\t\n\t\t$inactive_data = $this->mod_banner->get_banners($where_inact);\n\n\t\tif($inactive_data!=FALSE)\n\t\t{\n\t\t\t$data['inactive_data'] = count($inactive_data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['inactive_data'] = 0;\n\t\t}\n\t\t\n\n\t\t/*-------------------------------------------------------------\n\t\t \tEmbed current page content into template layout\n\t\t -------------------------------------------------------------*/\n\t\t$data['page_content']\t= $this->load->view(\"admin/banners/list\",$data,true);\n\t\t$this->load->view('page_layout',$data);\n\t\n\t}",
"public function getLinkInfo()\n {\n return array(\n 'PageURL' => $this->curlInfo['url'],\n 'page_title' => $this->getPageTitle(),\n 'description' => trim((isset($this->collected['metaData']['description'])) ? $this->collected['metaData']['description'] : Standards::$default),\n 'content_language' => $this->getLanguage(),\n 'external_links' => $this->countLinks('external'),\n 'internal_links' => $this->countLinks('internal'),\n 'no_follow_links' => $this->countLinks('no-follow'),\n 'follow_links' => ($this->countLinks('external') + $this->countLinks('internal') - $this->countLinks('no-follow')),\n 'h1' => $this->collected['headingsCount']['h1'],\n 'h2' => $this->collected['headingsCount']['h2'],\n 'h3' => $this->collected['headingsCount']['h3'],\n 'h4' => $this->collected['headingsCount']['h4'],\n 'h5' => $this->collected['headingsCount']['h5'],\n 'h6' => $this->collected['headingsCount']['h6'],\n 'http_code' => $this->curlInfo['http_code'],\n 'charset' => $this->getCharset(),\n 'server_config' => implode(';', $this->getServerConfig()),\n\n // fetched by others:\n # 'load_time' => Standards::$default,\n # 'page_weight' => Standards::$default,\n # 'indexed_bing' => Standards::$default,\n # 'indexed_google' => Standards::$default,\n );\n }",
"public function getLinksList(){\n return $this->_get(9);\n }",
"public function getLinks()\n\t{\n\t\t$data = $this->curl->curlGetReq($this->baseURL);\n\t\t$query = \"//a/@href\";\n\t\t$links = $this->curl->getDOMData($data,$query);\n\t\t\n\n\t\t//var_dump($links[0]);\n\n\t\tforeach ($links as $link)\n\t\t{\n\t\t\t\n\t\t\tif($link->value == \"/calendar\")\n\t\t\t{\n\t\t\t\t$this->calendarLink = $this->baseURL. str_replace(\"/\", \"\", $link->value).\"/\";\n\t\t\t\t\n\t\t\t}\n\t\t\tif($link->value == \"/cinema\")\n\t\t\t{\n\t\t\t\t$this->cinemaLink = $this->baseURL. str_replace(\"/\", \"\", $link->value).\"/\";\n\t\t\t}\n\t\t\tif($link->value == \"/dinner\")\n\t\t\t{\n\t\t\t\t$this->dinnerLink = $this->baseURL. str_replace(\"/\", \"\", $link->value).\"/\";\n\t\t\t\t$this->dinnerLoginLink = $this->dinnerLink.\"login\";\n\t\t\t}\n\n\t\t\n\t\t\n\t\t}\n\t}",
"function get_links($category = -1, $before = '', $after = '<br />', $between = ' ', $show_images = \\true, $orderby = 'name', $show_description = \\true, $show_rating = \\false, $limit = -1, $show_updated = 1, $display = \\true)\n {\n }",
"public function get_allBanners($where_banner)\t\n\t{\n\t\t$query = $this->db->get_where('announcement',$where_banner);\n\n\t\t$result = $query->result_array();\n\n\t\tif(!empty($result))\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t}",
"public function getLinks()\n {\n $url = Yii::$app->getRequest()->getAbsoluteUrl();\n // change $url_cut_point if you have more prefix in the url of restful api\n $url_cut_point = 5;\n $url_slice = array_slice(preg_split(\"#[?/]#\", $url), 0, $url_cut_point);\n $link = implode('/', $url_slice).'/'.$this->id;\n\n return [ Link::REL_SELF => $link ];\n }",
"public function index()\n {\n return $this->bannerService->index();\n }",
"public function get_banners($offset = 0, $limit = LIST_LIMIT) {\n $this->db->limit($limit, $offset);\n $query = $this->db->get('banners');\n return $query->result_array();\n }",
"public function getListBanner()\n {\n\n $BannerModel = new Banner();\n $Banners = $BannerModel->getListBanner();\n $this->data['newss'] = $Banners;\n\n return view('admin.banner_list', $this->data);\n }",
"function getAllLinks(){\r\n return $this->link_arry;\r\n }",
"public function getBanners($perPage = 20, array $filter = array(), array $sort = array(), $paginate = true);",
"protected function getBannerItems()\n {\n $self = $this;\n\n return Cache::remember(\n 'home_banner_items',\n config('kosher.cache_expiration_time'),\n function () use ($self) {\n $recipes = Recipe::banner()->with('categories')->get();\n $articles = Article::banner()->published()->with('category')->get();\n $shows = Show::banner()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n\n if (0 == $banner->count()) {\n $recipes = Recipe::featured()->with('categories')->get();\n $articles = Article::featured()->published()->with('category')->get();\n $shows = Show::featured()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n }\n\n if (0 == $banner->count()) {\n $banner = Recipe::published()\n ->with('categories')\n ->take(config('kosher.pagination.home_banner_items'))\n ->get();\n $self->mergeReceivedRecipes($banner);\n } else {\n $recipes = collect();\n foreach ($banner as $item) {\n if ($item->isRecipe()) {\n $recipes->push($item);\n }\n }\n $self->mergeReceivedRecipes($recipes);\n }\n\n return $banner;\n }\n );\n }",
"public function index()\n {\n \n if(isset( $_GET['search']) && $_GET['search']!='' ){\n $searched= $_GET['search'];\n $banners=Banner::where('content', 'like',\"%{$searched}%\")\n ->latest()->paginate(2);\n \n }else{\n $banners=Banner::latest()->paginate(2);\n\n }\n return BannerResource::collection($banners);\n }",
"public function getBannersArhived($searchText = NULL) {\n return $this->where('archive', 1)\n ->orderBy('id', 'DESC')\n ->paginate(10);\n }",
"public function gp_qry_all_banner($website_id)\n {\n $sql = \"Select \n B.PK_BANNER\n ,B.C_DEFAULT\n ,B.C_FILE_NAME\n ,BC.FK_CATEGORY\n From t_ps_banner B\n Right Join t_ps_banner_category BC \n On BC.FK_BANNER=B.PK_BANNER\n Where B.FK_WEBSITE=$website_id\n And B.C_STATUS=1\n Order By C_DEFAULT Desc, BC.FK_CATEGORY Asc\";\n \n return $this->db->GetAll($sql);\n }",
"public function index()\n {\n $imageNameDB = DB::table('banners')->where('banner_id', 17)->select('link')->get()[0]->link;\n return response()->json($imageNameDB);\n }",
"public function banners()\n {\n $banners = DB::table('banners')->latest('created_at')->limit(5)->get();\n\n return response()->json($banners);\n }",
"function getDynamicAds()\n\t\t{\n\t\t\t$dynamicBanner_1 = $this->manage_content->getValue_where('banner_info','banner_image','id',5);\n\t\t\t$dynamicBanner_2 = $this->manage_content->getValue_where('banner_info','banner_image','id',6);\n\t\t\t//print_r($dynamicBanner[0]['banner_image']);\n\t\t\t//get dynamic banner 1\n\t\t\tif($dynamicBanner_1[0]['banner_image'] == 'NULL')\n\t\t\t{\n\t\t\t\techo '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<div class=\"dynamic_banner\">'.$dynamicBanner_1[0]['banner_image'].'</div>';\n\t\t\t}\n\t\t\t//get the dynamic banner 2\n\t\t\tif($dynamicBanner_2[0]['banner_image'] == 'NULL')\n\t\t\t{\n\t\t\t\techo '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<div class=\"dynamic_banner\">'.$dynamicBanner_2[0]['banner_image'].'</div>';\n\t\t\t}\n\t\t}",
"public function index()\n {\n // Varibales\n $title = '';\n $created_at = '';\n $last_update = '';\n $orderby = '';\n $sort = '';\n\n $list_banners = Banners::leftJoin('banners_trans as trans', 'banners.id', '=', 'trans.tid')\n ->select('banners.*', 'trans.lang', 'trans.title', 'trans.link', 'trans.created_at', 'trans.updated_at')->where('trans.lang', '=', Lang::getlocale());\n\n if(!empty($_GET['title'])){\n $title = $_GET['title'];\n $list_banners->where('trans.title', 'like', '%'.$title.'%'); \n }\n if(!empty($_GET['created_at'])){\n $created_at = $_GET['created_at'];\n $list_banners->where('trans.created_at', '>=', ''.$created_at.' 00:00:00')->where('trans.created_at', '<=', ''.$created_at.' 23:59:59'); \n }\n if(!empty($_GET['last_update'])){\n $last_update = $_GET['last_update'];\n $list_banners->where('trans.updated_at', '>=', ''.$last_update.' 00:00:00')->where('trans.updated_at', '<=', ''.$last_update.' 23:59:59'); \n }\n if(!empty($_GET['orderby']) && !empty($_GET['sort'])){\n $orderby = $_GET['orderby'];\n $sort = $_GET['sort'];\n $list_banners->orderBy($orderby, $sort); \n }\n \n $banners = $list_banners->paginate(10);\n // add to pagination other fields\n $banners->appends(['title' => $title, 'created_at' => $created_at,\n 'last_update' => $last_update, 'orderby' => $orderby, 'sort' => $sort]);\n\n return view('backend.banners.index', compact('banners'));\n }",
"public function homepagebanner()\n\t {\n\t\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t$sql = \"Select * FROM custom_productbanner where status=1 order by productbanner_id asc\";\n\t\t$result1 = $connection->fetchAll($sql);\t\n\n if(!empty($result1))\n\t\t{\t\t\t\n\t\t\t\n\t\tforeach ($result1 as $data) {\n\t\t$banner_id=$data['productbanner_id'];\n $image_name=$data['name'];\n\t\t$image_background=$data['background'];\n\t\t$image_caption=$data['imagecaption'];\n\t\t$result[]=array('homepagebanner'=>array(array('Id'=>$banner_id,'Image Name'=>$image_name,'img'=>'http://localhost/markateplace/pub/media/Gridpart4/background/image'.$image_background.'','Image Caption'=>$image_caption)));\t\n\t\t\t\n\t\t}\t\t\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"error\"));\n\t\t\t\n\t\t}\n\n\t\t\t\t\n\t return $result; \n\t\n\t }",
"function links() {\n return array(\n\n );\n }",
"private function getLinks($limit) {\r\n \r\n /*\r\n * Base links are always returned\r\n */\r\n $links = $this->getBaseLinks();\r\n \r\n /*\r\n * Start page cannot be lower than 1\r\n */\r\n if ($this->paging['startPage'] > 1) {\r\n \r\n /*\r\n * Previous URL is the previous URL from the self URL\r\n * \r\n */\r\n $links[] = $this->getLink('previous', '_previousCollectionLink', array(\r\n 'startPage' => max($this->paging['startPage'] - 1, 1),\r\n 'count' => $limit));\r\n \r\n /*\r\n * First URL is the first search URL i.e. with startPage = 1\r\n */\r\n $links[] = $this->getLink('first', '_firstCollectionLink', array(\r\n 'startPage' => 1,\r\n 'count' => $limit)\r\n );\r\n }\r\n\r\n /*\r\n * Theorically, startPage cannot be greater than the one from lastURL\r\n * ...but since we use a count estimate it is not possible to know the \r\n * real last page. So always set a nextPage !\r\n */\r\n if (count($this->restoFeatures) >= $limit) {\r\n \r\n /*\r\n * Next URL is the next search URL from the self URL\r\n */\r\n $links[] = $this->getLink('next', '_nextCollectionLink', array(\r\n 'startPage' => $this->paging['nextPage'],\r\n 'count' => $limit)\r\n );\r\n\r\n /*\r\n * Last URL has the highest startIndex\r\n */\r\n $links[] = $this->getLink('last', '_lastCollectionLink', array(\r\n 'startPage' => max($this->paging['totalPage'], 1),\r\n 'count' => $limit)\r\n );\r\n }\r\n \r\n return $links;\r\n \r\n }",
"public function getBanner($seriesId);",
"public function get_links() {\n\t\t$context = $this->context_memoizer->for_current_page();\n\n\t\treturn $context->presentation->breadcrumbs;\n\t}",
"function _nbabanner_get_banners($randomise = false)\n{\n $banners = nbacontent_get_vocabulary('nbabanner', true);\n \n $filteredBanners = array_filter($banners, function($ele) {\n return $ele->nbabanner_link_live['und'][0]['value'] == 1;\n });\n \n if ($randomise === true) {\n shuffle($filteredBanners);\n }\n \n return $filteredBanners;\n}"
] | [
"0.64956653",
"0.60217077",
"0.5885171",
"0.585809",
"0.57196116",
"0.56638443",
"0.56369996",
"0.5607769",
"0.5594403",
"0.5577562",
"0.5576287",
"0.55581164",
"0.5554815",
"0.5552081",
"0.55503386",
"0.5505732",
"0.54941005",
"0.54884547",
"0.5484968",
"0.5431221",
"0.54280394",
"0.54130614",
"0.5394517",
"0.53802794",
"0.535659",
"0.5342417",
"0.532128",
"0.5292062",
"0.52868694",
"0.52829075"
] | 0.70739037 | 0 |
Provides you the available advanced reports. To obtain specific reports, you can filter this by add $nid & $mid. | public function advancedReports(
$reportId,
$startDate,
$endDate,
$nid = null,
$mid = null
)
{
$startD = (isset($startDate)) ? str_replace('-', '', $startDate) : null;
$endD = (isset($endDate)) ? str_replace('-', '', $endDate) : null;
$this->setHeader(self::HEADER_TYPE_BEARER);
$this->setParameter(0, 'token='.self::SECURITY_TOKEN);
$this->setParameter(1, 'reportid='.$reportId);
$this->setParameter(2, 'bdate='.$startD);
$this->setParameter(3, 'edate='.$endD);
$params = implode('&', $this->params);
$this->setLink('?'.$params, self::API_NAME_ADVANCED_REPORT);
$curl = new Curl;
$response = $curl->get($this->getLink(), '', $this->getHeader());
$xmlData = new SimpleXMLElement(XMLHelper::tidy($response));
return $xmlData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function get_reports( $args = array() );",
"function getReport() ;",
"public function getReport() {}",
"public function getReport() {}",
"public function reportListing()\n {\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$_GET['rid'].\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\tparent:: reportListing($objRs);\n }",
"public function get_reports() {\n $data['results'] = $this->Report_Model->get_membership_payments();\n // print_r($data['results']);\n $this->render('list', $data);\n }",
"public function getReports()\n {\n return RoadDamageReport::where('roaddamage_id', $this->id)->get();\n }",
"public function offer_reports_get()\n {\n $this->verify_request(); \n $data = $this->Offer_model->offer_reports();\n $status = parent::HTTP_OK;\n $response = ['status' => $status, 'data' => $data];\n $this->response($response, $status);\n }",
"public function analyticreport() {\n\n global $base_url;\n $results = \\Drupal::database()->select('short_links', 's')\n ->fields('s', ['id', 'long_url', 'identifier', 'short_url'])\n ->orderBy('s.id', 'DESC')\n ->execute();\n $header = [\n t('Sr.no'), t('Web URL'), t('Identifier'), t('Short URL'), t('Show Details'),\n ];\n $rows = [];\n $sr_no = 0;\n foreach ($results as $result) {\n $sr_no += 1;\n $id = $result->id;\n $long_url = $result->long_url;\n $identifier = $result->identifier;\n $short_url = $result->short_url;\n $rows[] = [\n $sr_no,\n $long_url,\n $identifier,\n $short_url,\n [\n 'data' => new FormattableMarkup('<a href=\":link\">@name</a>', [':link' => $base_url . '/show-detail/' . $identifier, '@name' => 'Details']),\n ],\n ];\n }\n return [\n '#theme' => 'table',\n '#header' => $header,\n '#rows' => $rows,\n ];\n }",
"abstract public function extractReportDatas();",
"public function withBasicReport()\n {\n return $this->basicReport();\n }",
"public function withBasicReport()\n {\n return $this->basicReport();\n }",
"public function getReports()\n {\n return $this->_getChildrenByName('report');\n }",
"public function actionIndex()\n {\n\t\t\t\t\t\tif(!PermissionUtils::checkModuleActionPermission(\"Reports\",PermissionUtils::VIEW_ALL)){\n\t\t\t\tthrow new ForbiddenHttpException('You are not allowed to perform this action.');\n }\n $dataProvider = new ActiveDataProvider([\n 'query' => Reports::find(),\n ]);\n $model = new Reports();\n\n //we do pagination her \n\n\t\t if (isset($_REQUEST['Reports']) && !isset($_REQUEST['generateReport'])) {\n\t\t\t\t\t $model->reportID = $_REQUEST['Reports']['reportID'];\n return $this->render('index', [\n 'model' => $model, 'selectedReportID' => $_REQUEST['Reports']['reportID'],\n ]);\n exit;\n }\n\n\n\t\t\t\n\t\t\t\n\n if (isset($_REQUEST['Reports']) && isset($_REQUEST['generateReport'])) {\n //get values\n $reportID = $_REQUEST['Reports']['reportID'];\n if (strcmp($reportID, '') == 0 || $reportID == null) {\n // $response['REASON'] = 'Please select a report.';\n Yii::$app->session->addFlash('error', 'Please select a report.');\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n\t\t\t'model'=>$model\n ]); exit();\n }\t\t\n\t\t\t \n /*\n\t\t Set correct reporttype Filter\n\t\t $admin =1 \n\t\t client = 2\n\t\t \n\t\t */\n\t\t$cond= ['reportID' => (int) $reportID, 'reportTypeID' => 1];\n\t\tif(yii::$app->user->identity->clientID != Yii::$app->params['ADMIN_CLIENT_ID'])\n\t\t\t$cond['reportTypeID']= 2 ;\n\t\t\n\t\t \t$model =Reports::findOne($cond);\n\t\t\t\n\t\t\tif(!$model or $model==null)\n\t\t\t{\n\t\t\t\t $model = new Reports();\n\n\t\t\t\t\n\t Yii::$app->session->addFlash('error', 'Please select a report.');\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n\t\t\t'model'=>$model\n ]); exit();\n }\t\n\t\t\t\n $reportQuery = $model->reportQuery;\n \n $postData = $_REQUEST;\n unset($postData['Reports']);\n\t\t\tunset($postData['_csrf-backend']);\n unset($postData['generateReport']);\n\t\t\t/*IF not Admin, set the clientID to always be defined\n\t\t\t*/\n\t\tif(yii::$app->user->identity->clientID != Yii::$app->params['ADMIN_CLIENT_ID'])\n\t\t\t$postData['clientID'] = yii::$app->user->identity->clientID ;\n\t\t\n $queryStuff = $this->formulateFinalQuery($reportQuery, $postData);\n $formattedQuery = $queryStuff['finalQuery'];\n $params = $queryStuff['finalQueryParams'];\n// $formattedQuery = $this->formulateFinalQuery($reportQuery, $postData);\n // $rows = $this->getRowCount($formattedQuery, $params);\n $reportName = $model->reportName;\n $reportTitle = $model->reportName;\n if (isset($_REQUEST['dateFrom'])) {\n $reportName.=\": From date: \" . $_REQUEST['dateFrom'] . \"\";\n $reportTitle.= \" From date <span class='emTitle'>\" . $_REQUEST['dateFrom'] . \"</span>\";\n }\n\n if (isset($_REQUEST['dateTo'])) {\n $reportName.=\": to date: \" . $_REQUEST['dateTo'] . \"\";\n $reportTitle.= \": to date <span class='emTitle'>\" . $_REQUEST['dateTo'] . \"</span>\";\n }\n\t\t\t\n\t\t\t$connection = \\Yii::$app->db;\n$count = $connection->createCommand( \"select count(*)as x from ($formattedQuery) as n\")\n ->bindValues($params)->queryScalar();\n\n\n\t\t\t\t\n\t\t\t\t$dataProvider = new SqlDataProvider([\n\t\t\t\t'key' => 'id',\n 'sql' =>$formattedQuery,\n 'params' => $params,\n 'totalCount' => $count,\n 'pagination' => [\n 'pageSize' => 100,\n ],\n]);\n \t\t\treturn $this->render('index', [\n \t'model'=>$model,\n\t\t\t 'sql' =>$formattedQuery,\n 'params' => json_encode($params),\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'header' => $reportName,\n 'title' => $reportTitle,\n\t\t\t'id' => 'transactionReport' . $model->reportID,\n\t\t\t'columns'=>explode(\",\", $model->reportOutputColumns)\n ]);\n\t\t\n exit();\n\n\t\t\t\n\t\t\t\n\t\t }\n\n return $this->render('index', [\n \t'model'=>$model\n ]);\n }",
"public static function getReports ($m, \n\t\t\t$n, \n\t\t\tShortDate $startDate, \n\t\t\tShortDate $endDate) {\n\t\t$GLOBALS[\"logger\"]->debug('getReports');\n\t\t// Basic where clause; get the head of each chain, signified by a null MASTER_ID\n\t\t$whereClause = \"master_id IS NULL\";\n\t\tif ($startDate) {\n\t\t\t$whereClause .= \" AND date >= timestamp '\" . $startDate->toDateTime('start') . \"'\";\n\t\t}\n\t\tif ($endDate) {\n\t\t\t$whereClause .= \" AND date <= timestamp '\" . $endDate->toDateTime('end') . \"'\";\n\t\t}\n\t\t$selstmt = \"SELECT * \" .\n\t\t\t\"FROM \" .\n\t\t\tself::REPORT_TABLE .\n\t\t\t\" WHERE \" .\n\t\t\t$whereClause .\n\t\t\t\" ORDER BY date DESC\";\n\t\tif ($m >= 0 && $n >= 0)\n\t\t\t$selstmt .= \" LIMIT $m, $n \";\n\t\t$GLOBALS[\"logger\"]->debug('selstmt = ' . $selstmt);\n\t\t$resultSet = ORM::for_table(self::REPORT_TABLE)->\n\t\t\traw_query($selstmt)->\n\t\t\tfind_many();\n\t\treturn self::getReports1 ($resultSet, $m, $n);\n\t}",
"public function showHodReport()\n {\n $data = [];\n $query = \"\";\n\n if (!empty($_POST['academic_year'])) {\n $query .= \" academic_id = ? \";\n $this->acd_year = $this->verifyInput($_POST['academic_year']);\n $data[] = $this->acd_year;\n }\n if (!empty($_POST['year'])) {\n $query .= \" AND c.s_class_id = ? \";\n $this->year = $this->verifyInput($_POST['year']);\n $data[] = $this->year;\n }\n if (!empty($_POST['div'])) {\n $query .= \" AND c.div_id = ? \";\n $this->s_div = $this->verifyInput($_POST['div']);\n $data[] = $this->s_div;\n }\n if (!empty($_POST['sem_id']) || !empty($_POST['sem'])) {\n $query .= \" AND c.sem_id = ?\";\n $this->sem = isset($_POST['sem_id']) ? $this->verifyInput($_POST['sem_id']) : $this->verifyInput($_POST['sem']);\n $data[] = $this->sem;\n }\n if (!empty($_POST['class'])) {\n $query .= \" AND c.class_id = ? \";\n $this->class = $this->verifyInput($_POST['class']);\n $data[] = $this->class;\n }\n if ($_SESSION['role_id'] == 0) {\n if (isset($_POST['dept']) && !empty($_POST['dept'])) {\n $query .= \" AND c.dept_id = ? \";\n $this->dept = $this->verifyInput($_POST['dept']);\n $data[] = $this->dept;\n }\n } else if ($_SESSION['role_id'] == 1) {\n if (isset($_SESSION['dept'])) {\n $query .= \" AND c.dept_id = ? \";\n $this->dept = $this->verifyInput($_SESSION['dept']);\n $data[] = $this->dept;\n }\n } else {\n $query .= \" AND c.dept_id = ? \";\n $this->dept = $this->verifyInput($_SESSION['dept']);\n $data[] = $this->dept;\n }\n\n $result = $this->getStudentByDeptDivisionAndYear([$this->dept, $this->year, $this->s_div]);\n if (!$result) return json_encode(array(\"error\" => \"nostudent\"));\n\n if ((!empty($_POST['from-date']) && !empty($_POST['till-date'])) || ($_POST['from-date'] != \"\" && $_POST['till-date'] != \"\")) {\n $query .= \" AND DATE(date_time) >= DATE(?) AND DATE(date_time) <= DATE(?) \";\n $this->from_date = $this->verifyInput($_POST['from-date']);\n $this->till_date = $this->verifyInput($_POST['till-date']);\n $data[] = date('Y-m-d', strtotime($this->from_date));\n $data[] = date('Y-m-d', strtotime($this->till_date));\n\n $result = $this->getAttendanceByDate(\"date_time >= DATE(?) AND date_time <= DATE(?)\", [$this->dept, $this->year, $this->s_div, date('Y-m-d', strtotime($this->from_date)), date('Y-m-d', strtotime($this->till_date))]);\n\n if (!$result) return (array(\"error\" => \"noattend\"));\n } else if (!empty($_POST['from-date']) || $_POST['from-date'] != \"\") {\n $query .= \" AND DATE(date_time) >= DATE(?) \";\n $this->from_date = $this->verifyInput($_POST['from-date']);\n $data[] = date('Y-m-d', strtotime($this->from_date));\n $from_data = $this->getAttendanceByDate(\"DATE(date_time) >= DATE(?)\", [$this->dept, $this->year, $this->s_div, date('Y-m-d', strtotime($this->from_date))]);\n if (!$from_data) return (array(\"error\" => \"noattend\"));\n } else if (!empty($_POST['till-date']) || $_POST['till-date'] != \"\") {\n $query .= \" AND DATE(date_time) <= DATE(?) \";\n $this->till_date = $this->verifyInput($_POST['till-date']);\n $data[] = date('Y-m-d', strtotime($this->till_date));\n\n $till_data = $this->getAttendanceByDate(\"date_time <= DATE(?)\", [$this->dept, $this->year, $this->s_div, $this->sem_id, date('Y-m-d', strtotime($this->till_date))]);\n if (!$till_data) return (array(\"error\" => \"noattend\"));\n }\n\n $result = $this->getClassByYearDivisionAcademicAndDept([$_POST['academic_year'], $this->class, $this->s_div, $this->dept]);\n if (!$result) json_encode(array(\"error\" => \"noclass\"));\n else {\n //var_dump($_POST);\n //var_dump($query);\n $result = $this->getHodReportYearWise($query, $data);\n // if(empty($_POST['class_id'])){\n // $result = $this->getHodReportYearWise($query,$data);\n // }else{\n // $result[\"each_total\"], \"total\" => $result['total'], \"lectures\" =>$result['total_lectures']\n // } \n if (isset($result['e'])) return json_encode(array(\"error\" => \"notfound\"));\n return json_encode(array(\"error\" => \"none\", \"data\" => $result['report'], \"lectures\" => $result['lectures']));\n // if($from == 1 && $till == 1){\n // $query .= \" AND date_time >= DATE(?) AND date_time <= DATE(?) \";\n // $getTotal = $this->getReportTotalClassWise([(int)$this->class,$_POST['form-date'],$_POST['till-date']]);\n // }else if($from == 1 && $till == 0){\n // $query .= \" AND date_time >= DATE(?) \";\n // $getTotal = $this->getReportTotalClassWise([(int)$this->class,$_POST['form-date'], '9999-12-31']);\n // }else if($from = 0 && $till == 1){\n // $query .= \" AND date_time <= DATE(?) \";\n // $getTotal = $this->getReportTotalClassWise([(int)$this->class,'0000-00-00',$_POST['till-date']]);\n // }else{\n // $getTotal = $this->getReportTotalClassWise([(int)$this->class]);\n // }\n\n //return json_encode(array(\"error\" => \"none\",\"data\" => $result,\"total\" => $getTotal));\n }\n }",
"public function getReports()\n {\n return $this->reports;\n }",
"public function processReports();",
"abstract public function buildReport();",
"static function get_all_reports($includeDeleted=false)\n {\n global $DB;\n\n static $r;\n\n if(isset($r))\n return $r;\n\n $r = array();\n\n foreach($DB->get_fieldset_select('block_ilp_report','id','1 = 1 ') as $rid)\n {\n $report=static::from_id($rid);\n if(!$report->deleted or $includeDeleted)\n $r[$rid]=$report;\n }\n\n return $r;\n }",
"public function show(Reports $reports)\n {\n //\n }",
"public function APIreports()\n {\n $processed_fields= Processed_field::with('field','tractor')->paginate(15);\n\n return Processed_fieldResource::collection($processed_fields);\n }",
"public function pcAttendance_report() {\n BackendMenu::setContext('Olabs.Oims', 'reports', 'pcattendance_report');\n $this->searchFormWidget = $this->createAttendanceSearchFormWidget();\n $this->pageTitle = 'Petty Contractor Attendance Report';\n $reports = array();\n\n $oimsSetting = \\Olabs\\Oims\\Models\\Settings::instance();\n\n $searchForm = $this->searchFormWidget;\n\n $this->vars['search'] = false;\n $this->vars['msg'] = false;\n $this->vars['searchFormWidget'] = $searchForm;\n $this->vars['reports'] = $reports;\n\n $this->vars['oimsSetting'] = $oimsSetting;\n }",
"function getReportsMenu(){\r\n $level=2;\r\n $hr=new HabilitationReport();\r\n $user=getSessionUser();\r\n //$allowedReport=array();\r\n $allowedCategory=array();\r\n $lst=$hr->getSqlElementsFromCriteria(array('idProfile'=>$user->idProfile, 'allowAccess'=>'1'), false);\r\n $res=array();\r\n $listCateg=SqlList::getList('ReportCategory');\r\n $idMenuReport=SqlElement::getSingleSqlElementFromCriteria('Navigation', array('name'=>'navReports'));\r\n $menuReport=SqlElement::getSingleSqlElementFromCriteria('Menu', array('name'=>'menuReports'));\r\n foreach ($lst as $h) {\r\n $report=$h->idReport;\r\n $nameReport=SqlList::getNameFromId('Report', $report, false);\r\n if (! Module::isReportActive($nameReport)) continue;\r\n //$allowedReport[$report]=$report;\r\n $category=SqlList::getFieldFromId('Report', $report, 'idReportCategory',false);\r\n $allowedCategory[$category]=$category;\r\n }\r\n $c=1;\r\n $lstIdCate=array();\r\n $idReportMenu=$idMenuReport->id.$level.$menuReport->id;\r\n $menuReportKey=$level.'-'.numericFixLengthFormatter($idMenuReport->id,5).'-'.numericFixLengthFormatter($c,5);\r\n $object= array('id'=>$idReportMenu,'name'=>$menuReport->name,'idParent'=>$idMenuReport->id,'idMenu'=>$menuReport->id);\r\n $res[$menuReportKey]=array('level'=>$level,'objectType'=>'reportDirect','object'=>$object);\r\n foreach ($listCateg as $id=>$name) {\r\n if (isset($allowedCategory[$id])) {\r\n $c++;\r\n $cat=new ReportCategory($id);\r\n $lstIdCate[]=$id;\r\n $idReport=$idMenuReport->id.$level.$id;\r\n $key=$level.'-'.numericFixLengthFormatter($idMenuReport->id,5).'-'.numericFixLengthFormatter($c,5);\r\n $obj= array('id'=>$idReport,'name'=>$cat->name,'idParent'=>$idMenuReport->id);\r\n $res[$key]=array('level'=>$level,'objectType'=>'report','object'=>$obj);\r\n }\r\n }\r\n //===================\r\n //=================== lis of all report dependant of this categoryies\r\n\r\n $level++;\r\n $reportDirect= new Report();\r\n $lstCatId=(empty($lstIdCate))?\"0\":\"0\".implode(\",\", $lstIdCate);\r\n $where=\" idReportCategory in (\".$lstCatId.\")\";\r\n $reportList= $reportDirect->getSqlElementsFromCriteria(null,false,$where,\"file\");\r\n $nameFile=SqlList::getList('Report','file');\r\n $lstReportName=array();\r\n $lstNewNavMenu=array();\r\n foreach ($nameFile as $idN=>$nameFile){\r\n $lstReportName[]=substr($nameFile, 0,strpos($nameFile, '.php'));\r\n }\r\n $countNameFil=array_count_values($lstReportName);\r\n foreach ($countNameFil as $name=>$val){\r\n if($val==1)unset($countNameFil[$name]);\r\n else $lstNewNavMenu[]=$name;\r\n }\r\n storReports($reportList,$res, $lstNewNavMenu,$idMenuReport, $level);\r\n return $res;\r\n \r\n}",
"public function reportListing_default()\n {\n\t$defaultreportnames = $this->reportNames(); $rid = $defaultreportnames->fetch_object();\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.report_id=rs.report_id where r.site_id='\" . $_SESSION['site_id'] . \"' and r.report_id='\".$rid->report_id.\"'\";\n\t$objRs = $this->objDatabase->dbQuery($strsql);\n\treturn $objRs;\n }",
"public function reports(){\n $reports = DB::table('reports')->paginate(25);\n $suggestions = DB::table('category_suggestion')->paginate(25);\n $categories = DB::table('categories')->paginate(25);\n return view('admin.reports')->with('reports', $reports)\n ->with('suggestions', $suggestions)\n ->with('categories', $categories);\n }",
"abstract public function getDetailedReportName();",
"public function getWorkReports()\n {\n return $this->postRequest('GetWorkReports');\n }",
"public function show(Generalreport $generalreport)\n {\n //\n }",
"public static function get_form($args, $nid, $response=null) {\n iform_load_helpers(array('report_helper','map_helper'));\n $readAuth = report_helper::get_read_auth($args['website_id'], $args['password']);\n $sharing='reporting';\n $reportOptions = array_merge(\n iform_report_get_report_options($args, $readAuth),\n array(\n 'reportGroup' => 'explore',\n 'rememberParamsReportGroup' => 'explore',\n 'paramsOnly'=>true,\n 'paramsInMapToolbar'=>true,\n 'sharing'=>$sharing,\n 'paramsFormButtonCaption'=>lang::get('Filter'),\n 'rowId' => 'occurrence_id',\n )\n );\n iform_report_apply_explore_user_own_preferences($reportOptions);\n $reportOptions['extraParams']['limit']=3000;\n $r = report_helper::report_grid($reportOptions);\n\n $r .= report_helper::report_map(array(\n 'readAuth' => $readAuth,\n 'dataSource'=>$args['report_name'],\n 'extraParams'=>$reportOptions['extraParams'],\n 'paramDefaults'=>$reportOptions['paramDefaults'],\n 'autoParamsForm'=>false,\n 'reportGroup' => 'explore',\n 'rememberParamsReportGroup' => 'explore',\n 'clickableLayersOutputMode' => 'report',\n 'sharing'=>$sharing,\n 'rowId' => 'occurrence_id',\n 'ajax'=>TRUE\n ));\n $options = array_merge(\n iform_map_get_map_options($args, $readAuth),\n array(\n 'featureIdField' => 'occurrence_id',\n 'clickForSpatialRef'=>false,\n 'reportGroup' => 'explore',\n 'toolbarDiv' => 'top'\n )\n );\n $olOptions = iform_map_get_ol_options($args);\n $r .= map_helper::map_panel($options, $olOptions);\n $downloadOwnDataOnlyInArgs = isset($args['downloadOwnDataOnly']) && $args['downloadOwnDataOnly'];\n $ownDataValueInPost = isset($_POST['explore-ownData']);\n $exploreOwnDataEnabledInPost = $ownDataValueInPost && $_POST['explore-ownData']==='1';\n $reportParamPresetsSetToOwnData = isset($reportOptions['extraParams']['ownData']) && $reportOptions['extraParams']['ownData']==='1';\n $reportParamDefautsSetToOwnData = isset($reportOptions['paramDefaults']['ownData']) && $reportOptions['paramDefaults']['ownData']==='1';\n $allowDownload = !$downloadOwnDataOnlyInArgs\n || $reportParamPresetsSetToOwnData\n || $exploreOwnDataEnabledInPost\n || (!$ownDataValueInPost && $reportParamDefautsSetToOwnData);\n $reportOptions = array_merge(\n $reportOptions,\n array(\n 'id' => 'explore-records',\n 'paramsOnly'=>false,\n 'autoParamsForm'=>false,\n 'downloadLink'=>$allowDownload,\n 'rowClass' => 'certainty{certainty}'\n )\n );\n if (isset($args['includeEditLink']) && $args['includeEditLink'] && !empty($args['includeEditLinkPath']))\n $reportOptions['columns'][] = array(\n 'display' => 'Actions',\n 'actions'=>array(\n array('caption' => 'edit','url'=>url($args['includeEditLinkPath']),'urlParams'=>array('occurrence_id' => '{occurrence_id}'),'visibility_field' => 'belongs_to_user')\n )\n );\n $r .= report_helper::report_grid($reportOptions);\n return $r;\n\n }"
] | [
"0.57960796",
"0.56453884",
"0.55919605",
"0.55919605",
"0.55478764",
"0.546281",
"0.54500854",
"0.5443246",
"0.54071546",
"0.5309802",
"0.53067887",
"0.53067887",
"0.5281823",
"0.5250932",
"0.52440524",
"0.521269",
"0.5179699",
"0.5157947",
"0.51575637",
"0.51534766",
"0.5152844",
"0.5145432",
"0.5130875",
"0.5122369",
"0.5094343",
"0.5089202",
"0.5078691",
"0.5078008",
"0.50739866",
"0.5065703"
] | 0.7193118 | 0 |
Create instance of Headers object from instance of Environment object | public function create(Environment $environment)
{
return new Headers($this->resolveHeaders($environment->getServer()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _initHeaders()\n {\n $headers = new DataHolder();\n\n foreach ($_SERVER as $key => $value)\n {\n if (strpos($key, 'HTTP_') === 0)\n {\n $headers->set(substr($key, 5), $value);\n }\n elseif (in_array($key, array('CONTENT_LENGTH', 'CONTENT_TYPE')))\n {\n $headers->set($key, $value);\n }\n }\n\n $this->set('_headers', $headers);\n }",
"public function populate_headers() {\n // If header is already defined, return it immediately\n if (!empty($this->headers)) {\n return;\n }\n\n // In Apache, you can simply call apache_request_headers()\n if (function_exists('apache_request_headers')) {\n $this->headers = apache_request_headers();\n } else {\n isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE'];\n\n foreach ($_SERVER as $key => $val) {\n if (sscanf($key, 'HTTP_%s', $header) === 1) {\n // take SOME_HEADER and turn it into Some-Header\n $header = str_replace('_', ' ', strtolower($header));\n $header = str_replace(' ', '-', ucwords($header));\n\n $this->headers[$header] = $val;\n $this->header_map[strtolower($header)] = $header;\n }\n }\n }\n\n }",
"public static function getRequestHeaders() {}",
"public function setRequestHeaders($requestHeaders);",
"public static function set_headers()\n {\n }",
"abstract public function SetHeaders();",
"public function getRequestHeaders();",
"protected function createHeaderDriver()\n {\n $determiner = new Determiners\\Header(\n $this->app['config']['localize-middleware']['header']\n );\n\n $determiner->setFallback($this->app['config']['app']['fallback_locale']);\n\n return $determiner;\n }",
"protected function readHeaders()\n {\n $ret = [];\n foreach ($this->environment as $key => $value) {\n # Note: the content-type and content-length headers always come\n # after the `CONTENT_TYPE` and `CONTENT_LENGTH` values in the\n # $_SERVER superglobal; if you use the values for the non `HTTP_...`\n # version, they will just be overwritten by the `HTTP_` version.\n if (strpos($key, \"HTTP_\") === 0) {\n $key = substr($key, 5);\n $key = strtolower($key);\n $key = str_replace(\"_\", \"-\", $key);\n $ret[$key] = $value;\n }\n }\n return $ret;\n }",
"public function setHeaders()\n {\n }",
"public function getHeaders() {}",
"protected function makeHeader()\n {\n }",
"public function getHttpHeaders()\n {\n if ($this->headers === null) {\n $this->headers = new SimpleHeaders();\n $this->headers->setContentType('application/json', 'utf-8');\n //$this->headers->setContentDispositionType(SimpleHeaders::DIPOSITION_ATTACHEMENT);\n }\n\n return $this->headers;\n }",
"protected function setRequestHeaders() \n {\n $headers = [];\n\n foreach ($this->headerManager->get() as $key => $value) {\n $headers[] = $key . ': ' . $value;\n }\n\n $this->optionManager->set('HTTPHEADER', $headers);\n\n return $this;\n }",
"private function __construct(private readonly array $headers)\n {\n // ..\n }",
"private function setHeaderInformation()\n {\n $this->header = new \\stdClass();\n $request \t= \\Yii::$app->request;\n $requestHeaders = $request->getHeaders();\n foreach ($this->headerKey as $key => $value) {\n if ($requestHeaders->offsetExists($value)) {\n $this->header->$value = $requestHeaders->get($value);\n $this->header->status =200;\n } else {\n $this->header->status =500;\n yii::error('Header '.$value.\" is missing\", 'api_request');\n break;\n }\n }\n }",
"public function getHeaders()\n {\n }",
"public function getHeaders()\n {\n }",
"abstract public function getHeaders();",
"public function __construct()\n\t{\n\t\t$this->_headers = function_exists('getallheaders') ? getallheaders() : array();\n\t\tif (!count($this->_headers))\n\t\t{\n\t\t\tforeach($_SERVER as $key => $value)\n\t\t\t{\n\t\t\t\tif (strpos($key, 'HTTP_') === 0)\n\t\t\t\t\t$this->_headers[str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))))] = $value;\n\t\t\t}\n\t\t}\n\t}",
"private function readHeaders() {\n $headers = $this->status->getHeaders();\n\n foreach ($headers as $key => $value) {\n switch ($key) {\n case \"Location\":\n $this->response['location'] = $value[0];\n break;\n\n case \"Content-Type\":\n $this->response['content_type'] = $value[0];\n break;\n\n case \"Content-Length\":\n $this->response['content_length'] = $value[0];\n break;\n\n default:\n break;\n }\n }\n }",
"private function _initializeResponseHeaders()\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTTYPE] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTLENGTH] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_ETAG] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CACHECONTROL] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LASTMODIFIED] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LOCATION] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS_CODE] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS_DESC] = null;\n $this->_dataServiceVersion = null;\n }",
"protected function set_headers()\n\t{\n\t\tif($this->headers_required) { \n\n\t\t\t$this->headers = [\n\t\t\t \n\t\t\t\t'Authorization: '. $_SESSION['token'] .'',\n\t\t\t];\n\n\t\t}\n\n\t}",
"public abstract function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();"
] | [
"0.64663017",
"0.61760974",
"0.6117139",
"0.60135657",
"0.5932401",
"0.588565",
"0.5863152",
"0.5843509",
"0.57841384",
"0.5782216",
"0.576597",
"0.5727603",
"0.57211536",
"0.57118666",
"0.5711274",
"0.5647395",
"0.56083405",
"0.56083405",
"0.56082624",
"0.55858845",
"0.5578869",
"0.5569527",
"0.55642235",
"0.5556961",
"0.5548697",
"0.5548697",
"0.5548697",
"0.5548697",
"0.5548697",
"0.5548697"
] | 0.77983695 | 0 |
Get columns from table use Zend_Db_Adapter | public function getColumnsFromTable()
{
return Zend_Db_Table::getDefaultAdapter()->describeTable($this->_tableName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function get_columns($table);",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function getColumns()\n\t{\n\t\t\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL COLUMNS FROM `$this->table`\"\n ));\n\n return $result;\n\t}",
"private function table_columns(){\n $column = array();\n $query = $this->db->select('column_name')\n ->from('information_schema.columns')\n ->where('table_name', $this::$table_name)\n ->get($this::$table_name)->result_array();\n //return individual table column\n foreach($query as $column_array){\n foreach($column_array as $column_name){\n $column[] = $column_name;\n }\n }\n return $column;\n }",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"public function getColumns();",
"function getColumns() {return $this->_columns;}",
"public function get_columns() {\n\n\t\treturn array(\n\t\t\t'id' \t\t => '%d',\n\t\t\t'name' \t\t => '%s',\n\t\t\t'date_created' \t=> '%s',\n\t\t\t'date_modified' => '%s',\n\t\t\t'status'\t\t=> '%s',\n\t\t\t'ical_hash'\t\t=> '%s'\n\t\t);\n\n\t}",
"function columns($table)\n{\n\treturn $this->drv->columns($table);\n}",
"public abstract function getColumns($table);",
"public function getColumnsList(){\n return $this->_get(3);\n }",
"public function get_columns() {\n\t\treturn array(\n\t\t\t'id' => '%d',\n\t\t\t'user_id' => '%d',\n\t\t\t'username' => '%s',\n\t\t\t'name' => '%s',\n\t\t\t'email' => '%s',\n\t\t\t'product_count' => '%d',\n\t\t\t'sales_count'\t => '%d',\n\t\t\t'sales_value'\t => '%f',\n\t\t\t'status'\t\t => '%s',\n\t\t\t'notes' => '%s',\n\t\t\t'date_created' => '%s',\n\t\t);\n\t}",
"public function getColumns(){\n $rows = array();\n return $rows; \n }",
"public function getTableColumns() { return $this->table->getColumns(); }",
"function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }",
"public function getColumns(): array;",
"public function getTableColumns(){\n\n $show_columns_statement = $this->grammer->compileShowColumns($this);\n return $this->connection->getTableColumns($show_columns_statement);\n\n }",
"protected function getColumns() {\n $driver = $this->connection->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n\n // Calculate the driver class. Why don't they do this for us?\n $class = '\\\\Aura\\\\SqlSchema\\\\' . ucfirst($driver) . 'Schema';\n $schema = new $class($this->connection, new ColumnFactory());\n return array_keys($schema->fetchTableCols($this->table));\n }",
"public function columns($table_name);",
"protected function getTableColumns()\n {\n if (!$this->model->getConnection()->isDoctrineAvailable()) {\n throw new \\Exception(\n 'You need to require doctrine/dbal: ~2.3 in your own composer.json to get database columns. '\n );\n }\n\n $table = $this->model->getConnection()->getTablePrefix().$this->model->getTable();\n /** @var \\Doctrine\\DBAL\\Schema\\MySqlSchemaManager $schema */\n $schema = $this->model->getConnection()->getDoctrineSchemaManager($table);\n\n // custom mapping the types that doctrine/dbal does not support\n $databasePlatform = $schema->getDatabasePlatform();\n\n foreach ($this->doctrineTypeMapping as $doctrineType => $dbTypes) {\n foreach ($dbTypes as $dbType) {\n $databasePlatform->registerDoctrineTypeMapping($dbType, $doctrineType);\n }\n }\n\n $database = null;\n if (strpos($table, '.')) {\n list($database, $table) = explode('.', $table);\n }\n\n return $schema->listTableColumns($table, $database);\n }"
] | [
"0.7227525",
"0.7048627",
"0.7048627",
"0.7048627",
"0.7048627",
"0.7046267",
"0.7046267",
"0.6980839",
"0.6975782",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6910914",
"0.6861104",
"0.6846852",
"0.6839846",
"0.68080914",
"0.6791578",
"0.6791046",
"0.6782598",
"0.677738",
"0.6769422",
"0.67688864",
"0.6758892",
"0.67438143",
"0.6716481"
] | 0.78532004 | 0 |
Compare function NOTE: In theory only $object1 has to implement the Comparable interface but as you cannot know in which order the parameters come i.e. from a sorting algorithm, both are checked. Also it is assumed that $object1>compareTo($object2) == (1) $object2>compareTo($object1) otherwise ComparatorTools may not work properly | public function compare($object1, $object2)
{
if (! $object1 instanceof Comparable) {
throw new ComparatorException('$object1 (type: ' . gettype($object1) . ') does not implement the Comparable interface.');
}
if (! $object2 instanceof Comparable) {
throw new ComparatorException('$object2 (type: ' . gettype($object2) . ') does not implement the Comparable interface.');
}
return $object1->compareTo($object2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function comparator($object1, $object2) {\n\t\t\treturn $object1->amount < $object2->amount; \n\t\t}",
"public function compareTo($object) : int;",
"public /*int*/ function compareTo(/*mixed*/ $object)\n\t{\n\t\tif($this->equals($object))\n\t\t\treturn 0;\n\t\treturn -1;\n\t}",
"public function compare(\\morph\\Object $objectA, \\morph\\Object $objectB)\n {\n $compare = null;\n $propertyA = (float)$objectA->{$this->propertyName};\n $propertyB = (float)$objectB->{$this->propertyName};\n if ($propertyA == $propertyB){\n $compare = 0;\n }else{\n $compare = ($propertyA < $propertyB) ? -1 : 1;\n }\n return $compare;\n }",
"public static function compare($a,$b);",
"public function compareTo($other);",
"protected function compareObjects(object $a, object $b): int\n {\n // see https://github.com/php/php-src/issues/10513\n return strcmp(spl_object_hash($a), spl_object_hash($b));\n }",
"public function compare();",
"function cmp_obj($a, $b)\r\n {\r\n $al = $a->Top;\r\n $bl = $b->Top;\r\n if ($al == $bl) {\r\n return 0;\r\n }\r\n return ($al > $bl) ? +1 : -1;\r\n }",
"function compareObjects(&$ob1, &$ob2) {\n\tprint_pre('o1 == o2 : ' . bool2str($ob1 == $ob2));\n\tprint_pre('o1 != o2 : ' . bool2str($ob1 != $ob2));\n\tprint_pre('o1 === o2 : ' . bool2str($ob1 === $ob2));\n\tprint_pre('o1 !== o2 : ' . bool2str($ob1 !== $ob2));\n}",
"public function compare($priority1, $priority2)\n {\n }",
"function cmp_function($value1, $value2)\n{\n if($value1 == $value2) {\n return 0;\n }\n else if($value1 > $value2) {\n return 1;\n }\n else {\n return -1;\n }\n}",
"function comparator($elem1,$elem2) {\n\n\tif ($elem1->getId() == $elem2->getId()) \n\t\treturn 0;\n\telse \n\t\tif ($elem1->getId() > $elem2->getId())\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn -1;\n\n}",
"abstract protected function _compare($val1, $val2);",
"protected function compare(array $dispatchable1, array $dispatchable2)\n {\n if ($dispatchable1['priority'] === $dispatchable2['priority']) {\n return ($dispatchable1['serial'] > $dispatchable2['serial'] ? -1 : 1);\n }\n\n return ($dispatchable1['priority'] > $dispatchable2['priority'] ? -1 : 1);\n }",
"public function compareDataTo($key, BL_CustomGrid_Object $object)\n {\n $value = $this->getData($key);\n $otherValue = $object->getData($key);\n return ($value > $otherValue ? 1: ($value < $otherValue ? -1 : 0));\n }",
"function cmp($a, $b) {\n $valueA = getCompareValue($a);\n $valueB = getCompareValue($b);\n return $valueA - $valueB;\n }",
"function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}",
"function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}",
"public function scompare($o = null) {}",
"public function compare($o = null, $attrs = array()) {}",
"function cmp($a, $b)\n {\n if ($a->points == $b->points) {\n return 0;\n }\n return ($a->points > $b->points) ? -1 : 1;\n }",
"function compare($d1, $d2)\r\n {\r\n $d1->convertTZ(new Date_TimeZone('UTC'));\r\n $d2->convertTZ(new Date_TimeZone('UTC'));\r\n $dias1 = Data_Calc::dataParaDias($d1->dia, $d1->mes, $d1->ano);\r\n $dias2 = Data_Calc::dataParaDias($d2->dia, $d2->mes, $d2->ano);\r\n if($dias1 < $dias2) return -1;\r\n if($dias1 > $dias2) return 1;\r\n if($d1->hora < $d2->hora) return -1;\r\n if($d1->hora > $d2->hora) return 1;\r\n if($d1->minuto < $d2->minuto) return -1;\r\n if($d1->minuto > $d2->minuto) return 1;\r\n if($d1->segundo < $d2->segundo) return -1;\r\n if($d1->segundo > $d2->segundo) return 1;\r\n return 0;\r\n }",
"private static function compare($a, $b) {\n $ordera = $a->get_order();\n $orderb = $b->get_order();\n if ($ordera > $orderb) {\n return 1;\n }\n if ($ordera < $orderb) {\n return -1;\n }\n $classa = get_class($a);\n $classb = get_class($b);\n if ($classa > $classb) {\n return 1;\n }\n if ($classb < $classa) {\n return -1;\n }\n return 0;\n }",
"public function compare($object,$array) {\n\t\tforeach($object as $property=>$value) {\n\t\t\tif (is_array($value)) {\n\t\t\t\t\tforeach($value as $index=>$nestedObject) {\n\t\t\t\t\t\tif ($nestedObject->id) {\n\t\t\t\t\t\t\t$foundMatch = false;\n\t\t\t\t\t\t\t//order might be different\n\t\t\t\t\t\t\tforeach($array[$property] as $k=>$a) {\n\t\t\t\t\t\t\t\tif ($a['id']==$nestedObject->id) {\n\t\t\t\t\t\t\t\t\t$foundMatch = true;\n\t\t\t\t\t\t\t\t\t$index = $k;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$foundMatch) throw new Exception('failed to find match for object '.$nestedObject->id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->compare($nestedObject,$array[$property][$index]);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif (!is_object($value)){\n\t\t\t\tasrt(strval($array[$property]),strval($value));\n\t\t\t}\n\t\t}\n\t}",
"public function comparator();",
"abstract protected function compare($idA, $idB);",
"public function sortNavObjects($navObject1, $navObject2)\n {\n if ($navObject1->menu_order == $navObject2->menu_order) {\n return 0;\n }\n return $navObject1->menu_order < $navObject2->menu_order ? -1 : 1;\n }",
"public function compareTo($item);",
"function comp($a,$b)\r\n{\r\n\treturn ($a[0] < $b[0]);\r\n}"
] | [
"0.7869542",
"0.73873293",
"0.6969621",
"0.6778731",
"0.6716064",
"0.65809304",
"0.6570545",
"0.6551522",
"0.64861166",
"0.6469694",
"0.639923",
"0.6388334",
"0.6379284",
"0.62946475",
"0.6271855",
"0.6217345",
"0.62134933",
"0.62018955",
"0.62018955",
"0.61652607",
"0.611706",
"0.60866374",
"0.6052081",
"0.59897816",
"0.5980906",
"0.5966543",
"0.5927214",
"0.5919623",
"0.5907169",
"0.5782079"
] | 0.78664535 | 1 |
views the tax edit page | public function postEdit(){
$tax = Tax::find(Input::get('id') );
return View::make('tax.edit')
->with('id', $tax->id)
->with('name', $tax->name)
->with('rate', $tax->rate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function taxupdate() {\n $arr['page'] = 'taxdetail';\n\t\t$arr['active'] = 'other';\n\t\t$arr['productTax'] = $this->setting->getTax('product');\n\t\t$arr['shippingTax'] = $this->setting->getTax('shipping');\n\t\t$this->load->view('vwSettingTax',$arr);\n\t}",
"function tax()\n {\n if (($data['logedUser'] = $this->_admin_pages()))\n { \n \n $manufacturer['content'] = Modules::run('tax/_index'); \n \n $data['header'] = '';\n $data['titelHeader'] = $this->lang->line('tax');\n $data['content'] = Modules::run('ajaxme/ajaxmeAdmintax',$manufacturer);\n \n \n $this->load->view('general',$data);\n \n }\n }",
"public function edit($id)\n {\n $tax = $this->taxRepository->findWithoutFail($id);\n\n\n if (empty($tax)) {\n Flash::error(__('lang.not_found', ['operator' => __('lang.tax')]));\n\n return redirect(route('taxes.index'));\n }\n $customFieldsValues = $tax->customFieldsValues()->with('customField')->get();\n $customFields = $this->customFieldRepository->findByField('custom_field_model', $this->taxRepository->model());\n $hasCustomField = in_array($this->taxRepository->model(), setting('custom_field_models', []));\n if ($hasCustomField) {\n $html = generateCustomField($customFields, $customFieldsValues);\n }\n\n return view('settings.taxes.edit')->with('tax', $tax)->with(\"customFields\", isset($html) ? $html : false);\n }",
"public function edit(IceTax $iceTax)\n {\n //\n }",
"public function edit($id)\n {\n return view('admin::settings.taxes.edit', [\n 'tax' => Tax::find($id),\n 'types' => $this->types\n ]);\n }",
"public function show(Tax $tax)\n {\n\n }",
"function edit()\r\n\t{\r\n\t\tJRequest::setVar('view', 'transactions');\r\n\t\tJRequest::setVar('layout', 'edit');\r\n\t\tparent::display();\r\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function editar_tip($codigo_tip){\n $data['tip_editar'] = $this->model_admin->form_tip($codigo_tip);\n \n $this->load->view('view_librerias');\n $this->load->view('view_form_tips',$data);\n }",
"public function addTax(){\n $data['title'] = \"Add Tax\";\n $this->admin_load('taxes/add_tax',$data); \n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('billing::edit');\n }",
"public function edit()\n {\n return view('billing::edit');\n }",
"public function index(){\n $data['title'] = \"Taxes\";\n $data['records']= $this->TaxModel->get_list('tbltaxes');\n\n $this->admin_load('taxes/tax_list',$data); \n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function postEdit(){\n return view(\"admin.product.edit\" );\n }",
"public function edit() {\n\t\t\t\n\t\t}",
"public function getEdit(){\n return view(\"admin.product.edit\" );\n }",
"function editInfo()\n {\n $this->view->load('frontend/user/editInfo');\n }",
"public function edit()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/edit', $data);\n }",
"public function edit(Tax $tax)\n {\n return view('tax.edit')->with('tax', $tax);\n }",
"public function edit()\n {\n return view(\"web_admin.books.edit\");\n }",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit_book_resault()\n\t{\n\t\t$this->edit_book_model->editBook();\n\t\t$this->load->view('edit_book_resault');\n\t}",
"public function edit($id, Request $request)\n {\n $receipt = Receipt::findOrFail($id);\n $receiptTaxes = ReceiptTax::where('receipt_id', '=', $id)->get();\n\n $periods = \\App\\Models\\Period::where('person_id', '=',\n session('current_person_id'))\n ->orderBy('year', 'asc')->orderBy('period_number', 'asc')->get();\n $receiptTypes = \\App\\Models\\ReceiptType::orderBy('name', 'asc')->get();\n $activities = \\App\\Models\\Activity::orderBy('name', 'asc')->get();\n $zones = \\App\\Models\\Zone::orderBy('name', 'asc')->get();\n $person = \\App\\Models\\Person::find(session('current_person_id'));\n $systemTaxes = \\App\\Models\\SystemTax::orderBy('taxable_iva', 'desc')\n ->orderBy('percent_iva', 'desc')\n ->select('*'\n , \\DB::raw(\"case when apply_to='iva' then 1 else 2 end as iva\"))->get();\n $otherTaxes = \\App\\Models\\OtherTax::orderBy('section', 'asc')\n ->orderBy('name', 'asc')\n ->select('*'\n , \\DB::raw(\"case when section='iva' then 1\n when section='iibb' then 2\n when section='gas' then 3 end as iva\"))->get();\n $tabsOtherTaxes = $otherTaxes;\n $retentionTypes = \\App\\Models\\RetentionType::orderBy('apply_to', 'asc')\n ->orderBy('name', 'asc')->get();\n /*$statesForeigns = \\App\\Models\\State::where('idCountry', 5)->get();\n $immigrationSituations = ImmigrationSituation::all();\n $bloodTypes = \\App\\Traits\\ConstantPeople::getBloodTypes();*/\n $type_id = $receipt->type_id;\n $receiptTaxes = $receiptTaxes->keyBy('tax_id');\n //dd($receiptTaxes);\n //dd($receiptTaxes[3]);\n return view('receipt.form'.$type_id, compact([ 'periods', 'receiptTypes',\n 'activities', 'zones', 'type_id', 'person', 'systemTaxes', 'otherTaxes',\n 'receipt', 'receiptTaxes', 'tabsOtherTaxes', 'retentionTypes'\n ]));\n\n }",
"public function edit($typology) //110\n {\n $this->authorize('edit.typologies');\n\n return view('admin.typologies.edit', compact('typology','supervisions'));\n }",
"public function edit()\n\t{\n\t\t//\n\t}",
"function index()\n {\n $this->_view_edit('view');\n }",
"public function edit($id)\n {\n\n $info=Terms::where('type',10)->where('auth_id',Auth::id())->find($id);\n return view('plugin::coupon.edit',compact('info'));\n \n }"
] | [
"0.76382494",
"0.7034002",
"0.70160884",
"0.69389576",
"0.67746663",
"0.66096514",
"0.64846355",
"0.6437889",
"0.6419488",
"0.641871",
"0.63995886",
"0.63995886",
"0.6371156",
"0.6371156",
"0.63658327",
"0.63194865",
"0.6287405",
"0.6282806",
"0.62676173",
"0.62562585",
"0.625274",
"0.6243929",
"0.62396556",
"0.62256217",
"0.62097853",
"0.620635",
"0.6201926",
"0.6178843",
"0.6176467",
"0.6176454"
] | 0.77472943 | 0 |
Get all bundles defined by this model bundle | public static function allBundles(): Collection; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBundles()\n {\n return $this->bundles;\n }",
"public function getBundles() {\n return $this->getConfig(\"bundles\");\n }",
"public function getBundles()\n {\n return array();\n }",
"public function registerBundles()\n {\n return $this->getBundleInstances(\n $this,\n $this->bundlesToLoad\n );\n }",
"public function bundles() {\n $bundles = $this->user->find(Auth::user()->id)->bundles()->get();\n return view('frontend.bundle.list_bundle', compact('bundles'));\n }",
"private function initializeBundles(): array\n {\n // as this method is not called when the container is loaded from the cache.\n $kernel = $this->getApplication()->getKernel();\n $container = $this->getContainerBuilder($kernel);\n $bundles = $kernel->getBundles();\n foreach ($bundles as $bundle) {\n if ($extension = $bundle->getContainerExtension()) {\n $container->registerExtension($extension);\n }\n }\n\n foreach ($bundles as $bundle) {\n $bundle->build($container);\n }\n\n return $bundles;\n }",
"public function getAvailableBundles() {\n $options = [];\n $entityTypes = $this->getSupportedEntityTypes();\n\n foreach ($entityTypes as $entityType => $entityLabel) {\n $options[$entityLabel][$entityType] = \"$entityLabel (Default)\";\n\n $bundles = $this->entityTypeBundleInfo->getBundleInfo($entityType);\n\n foreach ($bundles as $bundleId => $bundleData) {\n $defaultsId = $entityType . '__' . $bundleId;\n $options[$entityLabel][$defaultsId] = $bundleData['label'];\n }\n }\n\n return $options;\n }",
"protected static function loadFixturesBundles()\n {\n return [\n 'ElcodiCartBundle',\n 'ElcodiCouponBundle',\n 'ElcodiProductBundle',\n 'ElcodiCurrencyBundle',\n ];\n }",
"protected static function loadFixturesBundles()\n {\n return [\n 'ProductBundle',\n ];\n }",
"public function getBundles(ParserInterface $parser): array\n {\n return [\n BundleConfig::create(ApiPlatformBundle::class),\n BundleConfig::create(RichardhjContaoApiBundle::class)\n ->setLoadAfter([ApiPlatformBundle::class, ContaoCoreBundle::class]),\n ];\n }",
"protected function loadFixturesBundles()\n {\n return [\n 'ElcodiUserBundle',\n 'ElcodiCurrencyBundle',\n 'ElcodiAttributeBundle',\n 'ElcodiProductBundle',\n 'ElcodiCurrencyBundle',\n 'ElcodiCartBundle',\n 'ElcodiCouponBundle',\n 'ElcodiRuleBundle',\n ];\n }",
"public function registerBundles(): iterable\n {\n $contents = require $this->getProjectDir().'/config/bundles.php';\n foreach ($contents as $class => $envs) {\n if ($envs[$this->environment] ?? $envs['all'] ?? false) {\n yield new $class();\n }\n }\n }",
"public function isAllBundles() {\n return $this->getConfig(\"all_bundles\");\n }",
"private function _callBundlesConfig(): array\n {\n $contents = require $this->getProjectDir().'/config/bundles.php';\n /**\n * Load the current micro-service extra bundle\n */\n $extra_bundle_file = sprintf('%s/extra.bundles.php' , APPLICATION_LIB_PATH ) ;\n\n ##\n if(file_exists($extra_bundle_file)) {\n ##\n $contents = array_merge($contents , require $extra_bundle_file) ;\n }\n ##\n return $contents;\n }",
"public function discover(): array\n {\n $schemas = $this->loadModelsFromBundles();\n\n return $schemas;\n }",
"protected function loadBundles()\n {\n /**\n * @var $bundle BundleInterface\n */\n foreach (static::$bundles as $bundle) {\n $bundle->init($this);\n }\n }",
"public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }",
"public static function getAll(){\n\t\treturn self::$components;\n\t}",
"public function get_assets_all()\n {\n return $this->assets;\n }",
"function _hps_courses_bundles() {\n $bundles = array(\n 'taxonomy_term' => array(\n 'hps_participant_role' => array(\n 'name' => t(\"HPS Courses Participant Role\"),\n 'description' => t(\"Contains roles of course participants.\"),\n 'machine_name' => 'hps_participant_role',\n ),\n 'hps_person_authority' => array(\n 'name' => t(\"HPS Person Authority\"),\n 'description' => t(\"Contains authority records for people names.\"),\n 'machine_name' => 'hps_person_authority',\n ),\n 'hps_course_item_type' => array(\n 'name' => t(\"HPS Course Item Type\"),\n 'description' => t('Terms describe the type of item associated with '.\n 'a course e.g. official course photo, syllabus etc.'),\n 'machine_name' => 'hps_course_item_type',\n ),\n ),\n );\n return $bundles;\n}",
"protected function getEntities() {\n $query = $this->getStorage()->getQuery();\n $keys = $this->entityType->getKeys();\n\n $query->condition($keys['bundle'], $this->bundle)\n ->sort($keys['id']);\n\n $bundle = $this->entityManager->getStorage($this->entityType->getBundleEntityType())\n ->load($this->bundle);\n\n $pager_settings = $bundle->getPagerSettings();\n if (!empty($pager_settings['page_parameter']) && !empty($pager_settings['page_size_parameter'])) {\n $query->pager($pager_settings['default_limit']);\n }\n\n return $this->getStorage()->getResultEntities($query->execute());\n }",
"public function tags()\n {\n return $this->morphedByMany(Tag::class, 'bundleable');\n }",
"public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }",
"private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }",
"public function getCatalogues()\n {\n return Catalogue::all();\n }",
"public function registerBundles()\n {\n $bundles = [\n ];\n\n return $bundles;\n }",
"public static function getCustomBundleNameList(Controller $controller, Container $container)\n {\n $srcPath = rtrim(dirname($controller->get('kernel')->getRootDir()), '/') . '/src';\n $allBundles = $container->getParameter('kernel.bundles');\n $bundles = array();\n\n // find all bundles in src folder\n foreach ($allBundles as $bundle=>$path)\n {\n $dir = dirname(str_replace('\\\\', '/', $srcPath . '/' . $path));\n\n if (is_dir($dir))\n {\n $bundles[] = $bundle;\n }\n }\n\n asort($bundles);\n\n return $bundles;\n }",
"public function getModels();",
"public function getModels();",
"public static function getBrandsAll()\n {\n $pdo = Database::getPDO();\n $sql = \"SELECT * FROM `\". static::$table .\"` \n WHERE `order` > 0\n ORDER BY `order` ASC \";\n \n $statement = $pdo->query( $sql );\n $modelListFromDatabase = $statement->fetchAll( PDO::FETCH_ASSOC );\n\n // Etape 2 : On vérifie qu'on a des résultats\n if( $modelListFromDatabase === false ) :\n exit( static::$table.\" not found !\" );\n endif;\n \n // Etape 3 : On prépare un tableau d'objets\n $modelsArray = [];\n\n // Etape 4 : On parcours nos résultats pour créer les objets\n // à partir des données récupérées en BDD\n foreach( $modelListFromDatabase as $modelDataFromDatabase ) :\n $model = new static( $modelDataFromDatabase );\n $modelsArray[] = $model;\n endforeach;\n\n // Etape 5 : On renvoi notre tableau d'objets (ici de type Brand)\n return $modelsArray;\n }"
] | [
"0.7814292",
"0.7424124",
"0.72127044",
"0.70319444",
"0.6873059",
"0.67700356",
"0.65892583",
"0.615498",
"0.6125429",
"0.605545",
"0.60269505",
"0.6019808",
"0.5954503",
"0.5900245",
"0.5826973",
"0.58258647",
"0.5781311",
"0.57634705",
"0.56828266",
"0.5678196",
"0.5676123",
"0.56576926",
"0.5585354",
"0.557491",
"0.55655336",
"0.55433446",
"0.55387163",
"0.5531004",
"0.5531004",
"0.5518116"
] | 0.7471644 | 1 |
Retrieve the currencyName property | public function getCurrencyName()
{
return $this->currencyName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function currencyName()\n {\n \treturn $this->currencyName = Currency::getCurrencyCode($this->sellPrices->CurrencyNo)->CurrencyName;\n }",
"public function getCurrency() : string\n {\n return $this->currency;\n }",
"public function getCurrency() : string\n {\n return $this->currency;\n }",
"public function getCurrency(): string;",
"public function getCurrency(): string;",
"public function getCurrency(){\n return $this->currency;\n }",
"public static function currency() {\n\t\treturn self::$currency;\n\t}",
"public function getCurrency();",
"public function getCurrency();",
"protected function get_currency() {\n\t\treturn $this->currency;\n\t}",
"public function getCurrency() {\n\t\treturn $this->currency;\n\t}",
"public function getCurrency()\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return $this->getData(self::CURRENCY);\n }",
"public static function getCurrency(): string\n {\n return static::$currency ?: Config::get('bazar.currencies.default', 'usd');\n }",
"public function getCurrency()\n {\n return \"/V1/directory/currency\";\n }",
"public function getCurrency(): ?string\n {\n return $this->currency;\n }",
"public function getCurrency(): ?string\n {\n return $this->currency;\n }",
"public function getCurrency(): ?string\n {\n return $this->currency;\n }",
"public function getCurrency()\n {\n return isset($this->Currency) ? $this->Currency : null;\n }",
"public function getCurrencyCode();",
"public function getCurrencyCode();",
"public function getCurrencyCode();",
"public function getCurrencyAttribute()\n\t{\n\t\t\n\t\treturn self::getCurrencies()[$this->currency_id] ?? \"-\";\n\t\t\n\t}"
] | [
"0.8412517",
"0.7305462",
"0.7305462",
"0.72835076",
"0.72835076",
"0.6910954",
"0.6910597",
"0.69101375",
"0.69101375",
"0.679487",
"0.67792076",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67703825",
"0.67687756",
"0.67664695",
"0.6690035",
"0.6690035",
"0.6690035",
"0.66525644",
"0.6639715",
"0.6639715",
"0.6639715",
"0.6623813"
] | 0.8499477 | 0 |
Handle the remove issue command. | public function handle(RemoveIssueCommand $command)
{
$issue = $command->issue;
event(new IssueWasRemovedEvent($issue));
$issue->delete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteIssue($args, $request) {\n\t\t$issueId = (int) $request->getUserVar('issueId');\n\t\t$journal = $request->getJournal();\n\t\t$issueDao = DAORegistry::getDAO('IssueDAO');\n\t\t$issue = $issueDao->getById($issueId, $journal->getId());\n\t\tif (!$issue) fatalError('Invalid issue ID!');\n\n\t\t$isBackIssue = $issue->getPublished() > 0 ? true: false;\n\n\t\t// remove all published articles and return original articles to editing queue\n\t\t$articleDao = DAORegistry::getDAO('ArticleDAO');\n\t\t$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');\n\t\t$publishedArticles = $publishedArticleDao->getPublishedArticles($issueId);\n\t\tif (isset($publishedArticles) && !empty($publishedArticles)) {\n\t\t\t// Insert article tombstone if the issue is published\n\t\t\timport('classes.article.ArticleTombstoneManager');\n\t\t\t$articleTombstoneManager = new ArticleTombstoneManager();\n\t\t\tforeach ($publishedArticles as $article) {\n\t\t\t\tif ($isBackIssue) {\n\t\t\t\t\t$articleTombstoneManager->insertArticleTombstone($article, $journal);\n\t\t\t\t}\n\t\t\t\t$articleDao->changeStatus($article->getId(), STATUS_QUEUED);\n\t\t\t\t$publishedArticleDao->deletePublishedArticleById($article->getPublishedArticleId());\n\t\t\t}\n\t\t}\n\n\t\t$issueDao->deleteObject($issue);\n\t\tif ($issue->getCurrent()) {\n\t\t\t$issues = $issueDao->getPublishedIssues($journal->getId());\n\t\t\tif (!$issues->eof()) {\n\t\t\t\t$issue = $issues->next();\n\t\t\t\t$issue->setCurrent(1);\n\t\t\t\t$issueDao->updateObject($issue);\n\t\t\t}\n\t\t}\n\n\t\treturn DAO::getDataChangedEvent($issueId);\n\t}",
"protected function afterRemoving()\n {\n }",
"public function remove() {\n\t\tremove_action($this->controller->getHookName(),array($this,'handle'),$this->priority);\n }",
"public function remove() {}",
"public function remove() {}",
"public function processDelete(): void \n {\n if ($this->delete()) { // The tag is deleted in the database storage.\n auth()->user()->logActivity($this, 'Tags', 'Has deleted an issue tag with the name ' . $this->name);\n flash(\"The ticket tag with the name <strong>{$this->name}</strong> has been deleted in the application.\")->info()->important();\n }\n }",
"public function onRemove();",
"function removeIssueFromAlerts($Issue){\r\n\t\t$user = $_SESSION['userid'];\r\n\t\t$query = \"delete from issuealert where userid='$user' and issueid='$Issue'\";\r\n\t\tmysql_query($query);\r\n\t}",
"public function resolveRemove() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 1) {\r\n\t\t\t$this->status = self::OBSOLETE;\r\n\t\t\tlist($this->from, $this->to) = array($this->to, $this->from);\t// Swaps from and to\r\n\t\t\t$this->direction = 3 - $this->direction;\t// Changes direction: 1 -> 2, 2 -> 1\r\n\t\t}\r\n\t}",
"public function remove() {\n }",
"protected function beforeRemoving()\n {\n }",
"public function doRemove() {\r\n\t\t$host = xn(\"host\");\r\n\t\t\r\n\t\t$ret = $this->_mongo->selectDB(\"admin\")->command(array(\r\n\t\t\t\"removeshard\" => $host\r\n\t\t));\r\n\t\t\r\n\t\t$this->ret = $this->_highlight($ret, \"json\");\r\n\t\t\r\n\t\t$this->display();\r\n\t}",
"protected function _postDelete()\n {\n $this->getResource()->delete();\n\n $this->getIssue()->compileHorizontalPdfs();\n }",
"abstract public function remove();",
"abstract public function remove();",
"abstract public function remove();",
"public function afterRemove()\n\t{}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"public function hookRemove(): void\n {\n $this->say(\"Executing the Plugin's remove hook...\");\n $this->_exec(\"php ./src/hook_remove.php\");\n }",
"public function handleDelete()\n {\n Craft::$app->getDb()->createCommand()\n ->delete(Table::REVISIONS, ['id' => $this->owner->revisionId])\n ->execute();\n }",
"public function postRemove($entity);",
"function remove($iat_id, $add_history = true)\n {\n $iat_id = Misc::escapeInteger($iat_id);\n $usr_id = Auth::getUserID();\n $stmt = \"SELECT\n iat_iss_id\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment\n WHERE\n iat_id=$iat_id\";\n if (Auth::getCurrentRole() < User::getRoleID(\"Manager\")) {\n $stmt .= \" AND\n iat_usr_id=$usr_id\";\n }\n $res = DB_Helper::getInstance()->getOne($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n }\n\n if (empty($res)) {\n return -2;\n }\n\n $issue_id = $res;\n $files = self::getFileList($iat_id);\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment\n WHERE\n iat_id=$iat_id AND\n iat_iss_id=$issue_id\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n }\n foreach ($files as $file) {\n self::removeFile($file['iaf_id']);\n }\n if ($add_history) {\n Issue::markAsUpdated($usr_id);\n // need to save a history entry for this\n History::add($issue_id, $usr_id, History::getTypeID('attachment_removed'), 'Attachment removed by ' . User::getFullName($usr_id));\n }\n return 1;\n }",
"function deleteIssue( $sessionID, $issueID ) {\r\n\t\t//@session_start();\r\n\t\tif( $this->userCanDeleteIssue( $sessionID, $issueID ) ) {\r\n\t\t\t\r\n\t\t\t// delete attached files and references to files in db\r\n\t\t\t$contacts = $this->getIssuesContacts($issueID);\r\n\t\t\tfor($i=0; $i<sizeof($contacts); $i++){\r\n\t\t\t\t$contact = $this->viewContact('', $contacts[$i]);\r\n\t\t\t\tif(!$this->deleteAllFiles($contact['ID'])){\r\n\t\t\t\t\techo 'Error deleting files for contact '.$contact['ID'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t// Michael Thompson * 12/14/2005 * Also delete contacts, watches, xrefs, etc...\r\n\t\t\t$query = \"DELETE FROM issues WHERE ID='\".$issueID.\"'\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\t$query = \"delete from `issuealert` where IssueID ='\".$issueID.\"'\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\t$query = \"delete from `issuewatch` where IssueID ='\".$issueID.\"'\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\t$query = \"DELETE FROM `contacts-users` WHERE ContactID in (select id from contacts where issue = '\".$issueID.\"' )\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t$query = \"DELETE FROM `contacts-students` WHERE ContactID in (select id from contacts where issue = '\".$issueID.\"' )\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t$query = \"delete from contacts where issue='$issueID'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t}\r\n\t}",
"public function removeTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken();\n\n\t\tif (!User::authorise('core.delete', $this->_option))\n\t\t{\n\t\t\tApp::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));\n\t\t}\n\n\t\t// Incoming\n\t\t$ids = Request::getArray('rid', array());\n\t\t$ids = (!is_array($ids) ? array($ids) : $ids);\n\n\t\t$removed = 0;\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$entry = Respondent::oneOrFail(intval($id));\n\n\t\t\t// Delete the entry\n\t\t\tif (!$entry->destroy())\n\t\t\t{\n\t\t\t\tNotify::error($entry->getError());\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Trigger before delete event\n\t\t\t\\Event::trigger('onEventsAfterDeleteRespondent', array($id));\n\n\t\t\t$removed++;\n\t\t}\n\n\t\tif ($removed)\n\t\t{\n\t\t\tNotify::success(Lang::txt('COM_EVENTS_RESPONDENT_REMOVED'));\n\t\t}\n\n\t\t// Output messsage and redirect\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&id[]=' . Request::getInt('event', 0), false)\n\t\t);\n\t}",
"public function remove()\n {\n }",
"abstract public function delete__do_process ();",
"function edithistory_delete_post($pid)\n{\n\tglobal $db, $mybb;\n\t$db->delete_query(\"edithistory\", \"pid='{$pid}'\");\n}"
] | [
"0.63412756",
"0.6070603",
"0.60372996",
"0.5984083",
"0.5983521",
"0.59507513",
"0.59356076",
"0.59081984",
"0.5843781",
"0.5820493",
"0.58113396",
"0.58065546",
"0.57392687",
"0.57363456",
"0.57363456",
"0.57363456",
"0.5726919",
"0.56949914",
"0.56949914",
"0.56949914",
"0.56949914",
"0.56914264",
"0.56604445",
"0.5651862",
"0.56240034",
"0.5610945",
"0.5594373",
"0.55840015",
"0.5561436",
"0.55551165"
] | 0.7258914 | 0 |
register Most Recent Posts settings | function MRPregister_mysettings() {
register_setting( 'most-recent-posts-settings-group', 'most_recent_posts_css' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function register_block_core_latest_posts()\n {\n }",
"function control() {\r\n $options = get_option('ace_widget_recent_posts');\r\n \r\n if ( !is_array($options) )\r\n $options = array('title'=>'',\r\n\t\t 'count' => $this->count,\r\n\t\t 'hierarchical' => $this->hierarchical,\r\n\t\t 'dropdown' => $this->dropdown );\r\n \r\n \r\n if ( !empty($_POST['ace-recent-posts-submit']) ) \r\n {\r\n \r\n\t\t\t$options['title'] = trim(strip_tags(stripslashes($_POST['ace-recent-posts-title'])));\r\n\t\t\t$options['number'] = (int) $_POST['ace-recent-posts-number'];\r\n\t\t\t\r\n\t\t\tif ($options['number'] > 15) $options['number'] = 15;//The limit\r\n\r\n\t\t update_option('ace_widget_recent_posts', $options);\r\n } \r\n\r\n\t\t$title = attribute_escape( $options['title'] );\r\n\t\t$number = (int) $options['number'];\r\n\r\n\r\n?>\r\n\t\t\t<p>\r\n\t\t\t\t<label for=\"recent-posts-title\">\r\n\t\t\t\t\t<?php _e( 'Title:' ); ?>\r\n\t\t\t\t\t<input class=\"widefat\" id=\"recent-posts-title\" name=\"ace-recent-posts-title\" type=\"text\" value=\"<?php echo $title; ?>\" />\r\n\t\t\t\t</label>\r\n\t\t\t</p>\r\n\r\n\t\t\t<p>\r\n\t\t\t\t<label for=\"recent-posts-number\"><?php _e('Number of posts to show:'); ?> <input style=\"width: 25px; text-align: center;\" id=\"recent-posts-number\" name=\"ace-recent-posts-number\" type=\"text\" value=\"<?php echo $number; ?>\" />\r\n\t\t\t\t</label>\r\n\t\t\t\t<br />\r\n\t\t\t\t<small><?php _e('(at most 15)'); ?></small>\r\n\t\t\t</p>\r\n\r\n\t\t\t<input type=\"hidden\" name=\"ace-recent-posts-submit\" value=\"1\" />\r\n<?php\r\n }",
"function most_recent_posts_create_menu()\r\n{\r\n\tadd_menu_page('MRP Overview', 'Most Recent Posts', \t\t'administrator', 'MostRecentPostsSettings', 'MRPOverview', 'http://buildautomate.com/favicon.ico');\r\n\tadd_submenu_page('MostRecentPostsSettings', 'Shortcode', \t\t'Shortcode', \t\t'administrator', 'MRPShortcodes',\t\t'MRPShortcodes');\t\r\n\tadd_submenu_page('MostRecentPostsSettings', 'Registration', \t\t'Registration', \t\t'administrator', 'MRPRegistration',\t\t'MRPRegistration');\t\t\t\r\n\tadd_submenu_page('MostRecentPostsSettings', 'Tech Support', \t\t'Tech Support', \t\t'administrator', 'MRPTechSupport', \t\t'MRPTechSupport');\t\r\n\tadd_submenu_page('MostRecentPostsSettings', 'Help', \t\t'Help', \t\t'administrator', 'MRPHelp',\t\t'MRPHelp');\t\t\t\t\r\n\t\t\t\r\n\t//call register settings function\r\n\tadd_action( 'admin_init', 'MRPregister_mysettings' );\r\n}",
"function sf_build_lastposts()\n{\n\tglobal $wpdb;\n\n\t$forums = sf_get_forums_all(true);\n\tif($forums)\n\t{\n\t\tforeach($forums as $forum)\n\t\t{\n\t\t\tsf_build_forum_index($forum->forum_id);\n\t\t}\n\t}\n\n\t$topics = sf_get_topics_all(true);\n\tif($topics)\n\t{\n\t\tforeach($topics as $topic)\n\t\t{\n\t\t\tsf_build_post_index($topic->topic_id, $topic->topic_slug);\n\t\t}\n\t}\n\treturn;\n}",
"function rwar_latest_posts($limit = 3) {\r\n if( ! Registry::has('rwar_latest_posts')) {\r\n // capture original article if one is set\r\n if($article = Registry::get('article')) {\r\n Registry::set('original_article', $article);\r\n }\r\n }\r\n\r\n if( ! $posts = Registry::get('rwar_latest_posts')) {\r\n $posts = Post::where('status', '=', 'published')->sort('created', 'desc')->take($limit)->get();\r\n\r\n Registry::set('rwar_latest_posts', $posts = new Items($posts));\r\n }\r\n\r\n if($result = $posts->valid()) {\r\n // register single post\r\n Registry::set('article', $posts->current());\r\n\r\n // move to next\r\n $posts->next();\r\n }\r\n else {\r\n // back to the start\r\n $posts->rewind();\r\n\r\n // reset original article\r\n Registry::set('article', Registry::get('original_article'));\r\n\r\n // remove items\r\n Registry::set('rwar_latest_posts', false);\r\n }\r\n\r\n return $result;\r\n}",
"function recent_post_widget() {\r\n\tregister_widget( 'recent_posts' );\r\n}",
"function jk_recent_posts() {\r\n\t\tparent::__construct( false, \"Joeleen's Recent Posts Widget\" );\r\n\t}",
"function RecentPage()\n\t{\n\t\t$this->SetInitialValues();\n\t}",
"public function latestAction() {\n\t\t$node = $this->getPluginNode();\n\t\t$postsSourceNode = $this->getPostsSourceNode($node);\n\n\t\t$this->view->assign('hasPostNodes', $postsSourceNode->hasChildNodes('M12.Plugin.Blog:Post'));\n\t\t$this->view->assign('postNodes', $postsSourceNode->getChildNodes('M12.Plugin.Blog:Post', $this->getPostsLimit($node)));\n\t}",
"public function registerPosts()\n\t{\n\t\t$this->init->registerPosts();\n\t}",
"private function LastPosts(){\n $this->lastrecord = ORM::factory('Posts')->find_all()->count();\n }",
"function moments_qodef_like_latest_posts() {\n\t\treturn moments_qodef_like()->add_like();\n\t}",
"function sp_last_posts($numberOfPosts = 5 , $thumb = true){\n\tglobal $post;\n\t$orig_post = $post;\n\t\n\t$lastPosts = get_posts('numberposts='.$numberOfPosts);\n\tforeach($lastPosts as $post): setup_postdata($post);\n?>\n<li>\n\t<?php if ( $thumb && sp_post_image('sp-small') ) : ?>\n\t<div class=\"post-thumbnail\">\n <a href=\"<?php the_permalink(); ?>\" title=\"<?php printf( __( 'Permalink to %s', 'sptheme' ), the_title_attribute( 'echo=0' ) ); ?>\" rel=\"bookmark\">\n <img src=\"<?php echo sp_post_image('sp-small') ?>\" width=\"110\" height=\"83\" />\n </a>\n </div><!-- post-thumbnail /-->\n <?php endif; ?>\n \n\t<h3><a href=\"<?php the_permalink(); ?>\"><?php the_title();?></a></h3>\n\t<?php //sp_get_score(); ?> <div class=\"entry-meta\"><?php echo sp_posted_on(); ?></div>\n</li>\n<?php endforeach; \n\t$post = $orig_post;\n}",
"function tptn_pop_posts( $daily = false , $widget = false ) {\r\n\tglobal $wpdb, $siteurl, $tableposts, $id;\r\n\tif ($daily) $table_name = $wpdb->prefix . \"top_ten_daily\"; \r\n\t\telse $table_name = $wpdb->prefix . \"top_ten\";\r\n\t$tptn_settings = tptn_read_options();\r\n\t$limit = $tptn_settings['limit'];\r\n\r\n\tif (!$daily) {\r\n\t\t$sql = \"SELECT postnumber, cntaccess as sumCount, ID, post_type, post_status, post_content \";\r\n\t\t$sql .= \"FROM $table_name INNER JOIN \". $wpdb->posts .\" ON postnumber=ID \" ;\r\n\t\tif ($tptn_settings['exclude_pages']) $sql .= \"AND post_type = 'post' \";\r\n\t\t$sql .= \"AND post_status = 'publish' \";\r\n\t\t$sql .= \"ORDER BY sumCount DESC LIMIT $limit\";\r\n\t} else {\r\n\t\t$daily_range = $tptn_settings[daily_range] - 1;\r\n\t\t$current_time = gmdate( 'Y-m-d', ( time() + ( get_option( 'gmt_offset' ) * 3600 ) ) );\r\n\t\t$current_date = strtotime ( '-'.$daily_range. ' DAY' , strtotime ( $current_time ) );\r\n\t\t$current_date = date ( 'Y-m-j' , $current_date );\r\n\t\t\r\n\t\t$sql = \"SELECT postnumber, SUM(cntaccess) as sumCount, dp_date, ID, post_type, post_status, post_content \";\r\n\t\t$sql .= \"FROM $table_name INNER JOIN \". $wpdb->posts .\" ON postnumber=ID \" ;\r\n\t\tif ($tptn_settings['exclude_pages']) $sql .= \"AND post_type = 'post' \";\r\n\t\t$sql .= \"AND post_status = 'publish' AND dp_date >= '$current_date' \";\r\n\t\t$sql .= \"GROUP BY postnumber \";\r\n\t\t$sql .= \"ORDER BY sumCount DESC LIMIT $limit\";\r\n\t}\r\n\t$results = $wpdb->get_results($sql);\r\n\t$output = '';\r\n\r\n\tif (!$widget) {\r\n\t\tif (!$daily) {\r\n\t\t\t$output .= '<div id=\"tptn_related\">'.$tptn_settings['title'];\r\n\t\t} else {\r\n\t\t\t$output .= '<div id=\"tptn_related_daily\">'.$tptn_settings['title_daily'];\r\n\t\t}\r\n\t}\r\n\t\r\n\tif ($results) {\r\n\t\t$output .= $tptn_settings['before_list'];\r\n\t\tforeach ($results as $result) {\r\n\t\t\t$title = trim(stripslashes(get_the_title($result->postnumber)));\r\n\t\t\t$output .= $tptn_settings['before_list_item'];\r\n\r\n\t\t\tif (($tptn_settings['post_thumb_op']=='inline')||($tptn_settings['post_thumb_op']=='thumbs_only')) {\r\n\t\t\t\t$output .= '<a href=\"'.get_permalink($result->postnumber).'\" rel=\"bookmark\">';\r\n\t\t\t\tif ((function_exists('has_post_thumbnail')) && (has_post_thumbnail($result->postnumber))) {\r\n\t\t\t\t\t$output .= get_the_post_thumbnail( $result->postnumber, array($tptn_settings[thumb_width],$tptn_settings[thumb_height]), array('title' => $title,'alt' => $title, 'class' => 'tptn_thumb', 'border' => '0'));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$postimage = get_post_meta($result->postnumber, $tptn_settings[thumb_meta], true);\t// Check \r\n\t\t\t\t\tif ((!$postimage)&&($tptn_settings['scan_images'])) {\r\n\t\t\t\t\t\tpreg_match_all( '|<img.*?src=[\\'\"](.*?)[\\'\"].*?>|i', $result->post_content, $matches );\r\n\t\t\t\t\t\t// any image there?\r\n\t\t\t\t\t\tif( isset( $matches ) && $matches[1][0] ) {\r\n\t\t\t\t\t\t\t$postimage = $matches[1][0]; // we need the first one only!\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!$postimage) $postimage = $tptn_settings[thumb_default];\r\n\t\t\t\t\t$output .= '<img src=\"'.$postimage.'\" alt=\"'.$title.'\" title=\"'.$title.'\" width=\"'.$tptn_settings[thumb_width].'\" height=\"'.$tptn_settings[thumb_height].'\" border=\"0\" class=\"tptn_thumb\" />';\r\n\t\t\t\t}\r\n\t\t\t\t$output .= '</a> ';\r\n\t\t\t}\r\n\t\t\tif (($tptn_settings['post_thumb_op']=='inline')||($tptn_settings['post_thumb_op']=='text_only')) {\r\n\t\t\t\t$output .= '<a href=\"'.get_permalink($result->postnumber).'\" rel=\"bookmark\">'.$title.'</a>';\r\n\t\t\t}\t\t\r\n\t\t\tif ($tptn_settings['show_excerpt']) {\r\n\t\t\t\t$output .= '<span class=\"tptn_excerpt\"> '.tptn_excerpt($result->post_content,$tptn_settings['excerpt_length']).'</span>';\r\n\t\t\t}\r\n\t\t\tif ($tptn_settings['disp_list_count']) $output .= ' ('.$result->sumCount.')';\r\n\t\t\t$output .= $tptn_settings['after_list_item'];\r\n\t\t}\r\n\t\tif ($tptn_settings['show_credit']) $output .= '<li>Popular posts by <a href=\"http://ajaydsouza.com/wordpress/plugins/top-10/\">Top 10 plugin</a></li>';\r\n\t\t$output .= $tptn_settings['after_list'];\r\n\t}\r\n\tif (!$widget) $output .= '</div>';\r\n\r\n\treturn $output;\r\n}",
"function register_top_posts_widget() {\n register_widget('Top_Posts_Widget');\n}",
"function ld_get_latest_posts($limit=30, $poster=0, $page = 1 )\r\n{\r\n\tglobal $bbdb, $bb_last_countable_query;\r\n\r\n\t$page = (int) $page;\r\n\r\n\t$where = 'WHERE post_status = 0';\r\n\r\n\tif ($poster > 0)\r\n\t\t$where .= \" AND poster_id = $poster\";\r\n\r\n\tif ( 1 < $page )\r\n\t\t$limit = ($limit * ($page - 1)) . \", $limit\";\r\n\r\n\t$bb_last_countable_query = \"SELECT post_id,forum_id,topic_id,poster_id,post_title,post_time FROM $bbdb->posts $where ORDER BY post_time DESC LIMIT $limit\";\r\n\r\n\tif ( $ld_latest_posts = $bbdb->get_results($bb_last_countable_query) )\r\n\t\treturn $ld_latest_posts;\r\n\telse\r\n\t\treturn false;\r\n}",
"function portfolio_recent_register_widgets() {\n\tregister_widget( 'blog_recent_post' );\n}",
"function muumuu_recent_posts($how_many, $how_long, $titleOnly, $begin_wrap, $end_wrap, $categories=array()) {\n global $wpdb;\n $counter = 0;\n \n // get a list of blogs in order of most recent update. show only public and nonarchived/spam/mature/deleted\n $blogs = $wpdb->get_col(\"SELECT blog_id FROM $wpdb->blogs WHERE\n public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND\n last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY last_updated DESC\");\n \n if ($blogs) {\n foreach ($blogs as $blog) {\n // we need _posts and _options tables for this to work\n $blogOptionsTable = \"wp_\".$blog.\"_options\";\n $blogPostsTable = \"wp_\".$blog.\"_posts\";\n $termsTable = \"wp_\" . $blog . \"_terms\";\n $taxonomyTable = \"wp_\" . $blog . \"_term_taxonomy\";\n $termRelationshipsTable = \"wp_\" . $blog . \"_term_relationships\";\n \n $categoryWhere = '';\n if (!empty($categories)) {\n $catNames = \"'\" . implode(\"', '\", $categories) . \"'\";\n $query = \"SELECT t.term_id FROM $termsTable AS t INNER JOIN $taxonomyTable AS tt ON tt.term_id = t.term_id INNER JOIN $termRelationshipsTable AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND t.name in ($catNames) AND tr.object_id = p.id\";\n $categoryWhere = \"AND EXISTS (\" . $query . \")\";\n }\n \n $options = $wpdb->get_results(\"SELECT option_value FROM\n $blogOptionsTable WHERE option_name IN ('siteurl','blogname') \n ORDER BY option_name DESC\");\n // we fetch the title and ID for the latest post\n $thispost = $wpdb->get_results(\"SELECT p.ID, p.post_title, p.post_content, p.post_author\n FROM $blogPostsTable as p WHERE p.post_status = 'publish' $categoryWhere\n AND p.post_type = 'post' AND p.post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY p.id DESC LIMIT 0,1\");\n // if it is found put it to the output\n if($thispost) {\n // get permalink by ID. check wp-includes/wpmu-functions.php\n $thispermalink = get_blog_permalink($blog, $thispost[0]->ID);\n\t\t\t\t$fixedcontent = wpautop($thispost[0]->post_content);\n if ($titleOnly == false) {\n\t\t\t\t\t\n\t\t\t\t\techo $begin_wrap.'\t\n\t\t\t\t\t<div class=\"title-post\">\n\t\t\t\t\t\t<h4><a href=\"'.$options[0]->option_value.'\" title=\"Dine '.$options[1]->option_value.'\">'.$options[1]->option_value.'</a></h4>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p><a href=\"'.$thispermalink.'\" rel=\"bookmark\">'.$thispost[0]->post_title.'</a></p>\n\t\t\t\t\t<a class=\"more\" href=\"'.$thispermalink.'\">More...</a>'.$end_wrap;\n $counter++;\n } else {\n\t\n\t\t\t\t\techo $begin_wrap.'\n\t\t\t\t\t\t<div class=\"title-post\">\n\t\t\t\t\t\t\t<h4><a href=\"'.$options[0]->option_value.'\" title=\"Dine '.$options[1]->option_value.'\">'.$options[1]->option_value.'</a></h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<h2><a href=\"'.$thispermalink.'\" rel=\"bookmark\">'.$thispost[0]->post_title.'</a></h2>\n\t\t\t\t\t\t'.$fixedcontent.'\n\t\t\t\t\t\t<p class=\"more\"><a href=\"'.$thispermalink.'\" rel=\"bookmark\" title=\"'.$thispost[0]->post_title.'\">Continue reading...</a></p>\n\t\t\t\t\t\t<div class=\"meta\">\n\t\t\t\t\t\t\t<div class=\"tags\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>'.$end_wrap;\n\t $counter++;\n }\n }\n // don't go over the limit\n if($counter >= $how_many) { \n break; \n }\n }\n }\n}",
"function manynewposts_info()\n{\n return array(\n \"name\" => \"Many New Posts\",\n \"description\" => \"This plugin counts how many new posts have been made after the thread had been view by user.\",\n \"website\" => \"https://github.com/jung3o/Many-New-Posts\",\n \"author\" => \"Jung Oh\",\n \"authorsite\" => \"http://jung3o.com\",\n \"version\" => \"2.0.2\",\n \"compatibility\" => \"18*\",\n );\n}",
"function LatestPosts() {\n\t\treturn Post::get()\n\t\t\t->filter('AuthorID', (int)$this->urlParams['ID'])\n \t\t\t->limit(0,5)\n\t\t\t->sort(\"Created\", \"DESC\")\n\t\t\t->filterByCallback(function($post){\n\t\t\t\treturn $post->canView();\n\t\t\t});\n\t}",
"public function index() {\n\t\t$data['posts'] = $this->post->getLast();\n\t\t$this->set($data);\n\t}",
"function wps_recent_posts() {\r\n echo '<ol>'.\"\\n\";\r\n\t\t global $post;\r\n\t\t $args = array( 'numberposts' => 50, 'post_type' => array('hotel', 'restaurant', 'shop', 'activity', 'itinerary', 'library', 'article'), 'orderby' => 'date', 'order' => 'DESC' );\r\n\t\t $myposts = get_posts( $args );\r\n\t\t\t\tforeach( $myposts as $post ) : setup_postdata($post);\r\n\t\t\t\t\t$destinationstree = destinationstree();\r\n\t\t\t\t\t$dest = $destinationstree['dest'];\r\n\t\t\t\t\t$posttype = get_post_type( $post );\r\n\t\t\t\t\t$postobj = get_post_type_object( $posttype );\r\n\t\t\t\t\t$postobjname = $postobj->labels->singular_name;\r\n\t\t\t\t\techo '<li><h4>'.get_the_title().' | <span class=\"details\"><a href=\"/wp-admin/post.php?post='.$post->ID.'&action=edit\">E</a> | <a target=\"_blank\" href=\"'.get_permalink().'\">V</a> | '.$dest->name.' | '.$postobjname.' | '.get_the_author_meta( 'display_name', $post->post_author ).' | <abbr>'.get_the_date('n/d/y').'</abbr></span></h4></li>'.\"\\n\";\r\n\t\t \t\tendforeach;\r\n echo '</ol>'.\"\\n\";\r\n}",
"function dailypostlimit_activate(){\r\n\tglobal $db, $mybb, $lang;\r\n\r\n\t$lang->load('dailypostlimit');\r\n\r\n\t$dailypostlimit_group = array(\r\n\t\t'name'\t\t=> 'dailypostlimit',\r\n\t\t'title'\t\t=> $lang->setting_group,\r\n\t\t'description'\t=> $lang->setting_group_desc,\r\n\t\t'disporder'\t=> '2',\r\n\t\t'isdefault'\t=> '0',\r\n\t);\r\n\r\n\t$db->insert_query(\"settinggroups\", $dailypostlimit_group);\r\n\t$gid = $db->insert_id();\r\n\r\n\t$dailypostlimit_setting[] = array(\r\n\t\t'name'\t\t=> 'dailypostlimit_enable',\r\n\t\t'title'\t\t=> $lang->setting_enabled,\r\n\t\t'description'\t=> $lang->setting_enabled_desc,\r\n\t\t'optionscode'\t=> 'yesno',\r\n\t\t'value'\t\t=> '0',\r\n\t\t'disporder'\t=> '1',\r\n\t\t'gid'\t\t=> intval($gid),\r\n\t);\r\n\r\n\t$dailypostlimit_setting[] = array(\r\n\t\t'name'\t\t=> 'dailypostlimit_limit',\r\n\t\t'title'\t\t=> $lang->setting_limit,\r\n\t\t'description'\t=> $lang->setting_limit_desc,\r\n\t\t'optionscode'\t=> 'text',\r\n\t\t'value'\t\t=> '',\r\n\t\t'disporder'\t=> '2',\r\n\t\t'gid'\t\t=> intval($gid),\r\n\t);\r\n\r\n\t$dailypostlimit_setting[] = array(\r\n\t\t'name'\t\t=> 'dailypostlimit_min_post',\r\n\t\t'title'\t\t=> $lang->setting_min_post,\r\n\t\t'description'\t=> $lang->setting_min_post_desc,\r\n\t\t'optionscode'\t=> 'text',\r\n\t\t'value'\t\t=> '',\r\n\t\t'disporder'\t=> '3',\r\n\t\t'gid'\t\t=> intval($gid),\r\n\t);\r\n\r\n\t$dailypostlimit_setting[] = array(\r\n\t\t'name'\t\t=> 'dailypostlimit_exclude_user',\r\n\t\t'title'\t\t=> $lang->setting_exclude_user,\r\n\t\t'description'\t=> $lang->setting_exclude_user_desc,\r\n\t\t'optionscode'\t=> 'text',\r\n\t\t'value'\t\t=> '',\r\n\t\t'disporder'\t=> '4',\r\n\t\t'gid'\t\t=> intval($gid),\r\n\t);\r\n\r\n\t$dailypostlimit_setting[] = array(\r\n\t\t'name'\t\t=> 'dailypostlimit_exclude_group',\r\n\t\t'title'\t\t=> $lang->setting_exclude_group,\r\n\t\t'description'\t=> $lang->setting_exclude_group_desc,\r\n\t\t'optionscode'\t=> 'text',\r\n\t\t'value'\t\t=> '',\r\n\t\t'disporder'\t=> '5',\r\n\t\t'gid'\t\t=> intval($gid),\r\n\t);\r\n\r\n\t$dailypostlimit_setting[] = array(\r\n\t\t'name'\t\t=> 'dailypostlimit_exclude_forum',\r\n\t\t'title'\t\t=> $lang->setting_exclude_forum,\r\n\t\t'description'\t=> $lang->setting_exclude_forum_desc,\r\n\t\t'optionscode'\t=> 'text',\r\n\t\t'value'\t\t=> '',\r\n\t\t'disporder'\t=> '6',\r\n\t\t'gid'\t\t=> intval($gid),\r\n\t);\r\n\r\n\t$dailypostlimit_setting[] = array(\r\n\t\t'name'\t\t=> 'dailypostlimit_message',\r\n\t\t'title'\t\t=> $lang->setting_message,\r\n\t\t'description'\t=> $lang->setting_message_desc,\r\n\t\t'optionscode'\t=> 'textarea',\r\n\t\t'value'\t\t=> $lang->setting_message_value,\r\n\t\t'disporder'\t=> '7',\r\n\t\t'gid'\t\t=> intval($gid)\r\n\t);\r\n\r\n\tforeach($dailypostlimit_setting as $setting){\r\n\t\t$db->insert_query(\"settings\", $setting);\r\n\t}\r\n\r\n\trebuild_settings();\r\n}",
"function wpb_load_widget() {\n register_widget( 'recent_post_widget' );\n }",
"public function manage_posts()\n\t{\n\t\t$data['posts'] = $this->common_model->getAllData('blog_post','*','',array('deleted_at' => 'Null'));\n\n\t\t$data['page'] = \"blog/manage_posts\";\n \t$this->template->template_view($data);\t\n\t}",
"public function recent_posts()\r\n\t{\r\n\t\t// Set the current page\r\n\t\t$data['current_page'] = 'recent_posts';\r\n\t\t$data['user'] = $this->user;\r\n\r\n\t\t// Load the popular posts for the user\r\n\t\t$this->db->order_by('created_at', 'DESC');\r\n\t\t$data['recent_posts'] = $this->appdotnet->getUserPosts($this->user['id'], array('include_annotations' => 1) );\r\n\r\n\t\t// Load the page\r\n\t\t$this->load->view('layouts/header', array('page_title' => $this->user['username']));\r\n\t\t$this->load->view('profiles/recent_posts', $data);\r\n\t\t$this->load->view('layouts/footer');\r\n\t}",
"public function mostRecentPostsForSidebar()\n {\n return $this->where(['status' => 'active'])\n ->order(['date_created' => 'DESC'])\n ->limit(10);\n }",
"static function add_recent_only(): void {\r\n self::add_acf_field(self::recent_only, [\r\n 'label' => 'Only show recent articles in these post selectors?',\r\n 'default_value' => 1,\r\n 'message' => '',\r\n 'ui' => 1,\r\n 'type' => 'true_false',\r\n 'instructions' => 'Speeds up article finding, but gives less choice.',\r\n 'required' => 0,\r\n 'conditional_logic' => 0,\r\n 'wrapper' => [\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }",
"function gc_theme_setting_defaults() {\n\n\tif ( function_exists( 'genesis_update_settings' ) ) {\n\n\t\tgenesis_update_settings( array(\n\t\t\t'blog_cat_num' => 5,\n\t\t\t'content_archive' => 'excerpts',\n\t\t\t'content_archive_limit' => 0,\n\t\t\t'content_archive_thumbnail' => 1,\n\t\t\t'posts_nav' => 'numeric',\n\t\t\t'site_layout' => 'content-sidebar',\n\t\t) );\n\n\t}\n\tupdate_option( 'posts_per_page', 5 );\n\n}",
"function posts_on_front() {\n\n\t// Add setting section\n\tadd_settings_section(\n\t\t'custom_setting_section', // $id\n\t\t'Custome Setting Section', // $title\n\t\t'custom_setting_section_callback', // $callback\n\t\t'reading' // $page\n\t);\n\n\t// Add setting field\n\tadd_settings_field(\n\t\t'posts_on_front', // $id\n\t\t'Number of Posts to show on Front Page', // $title\n\t\t'posts_on_front_callback', // $callback\n\t\t'reading', // $page\n\t\t'custom_setting_section', // $section, or use 'default'\n\t\t[] //$args\n\t);\n\n\t// Register fields\n\tregister_setting('reading', 'posts_on_front');\n}"
] | [
"0.6793125",
"0.6424826",
"0.63540393",
"0.6281458",
"0.62611973",
"0.62170917",
"0.6200792",
"0.61863565",
"0.61093587",
"0.60802186",
"0.60503894",
"0.6026789",
"0.59676224",
"0.59476745",
"0.5885122",
"0.58757824",
"0.5873912",
"0.5816651",
"0.5815992",
"0.58115077",
"0.58101845",
"0.5778101",
"0.5736231",
"0.57361424",
"0.5733848",
"0.5723508",
"0.56676656",
"0.56619614",
"0.56617236",
"0.56344515"
] | 0.68615973 | 0 |