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
The generateProvenance() method is used to generate provenance data about various aspects of data declared in a request, and store that provenance in the triple store.
public function generateProvenance(){ $sparql_query = $this->_sparql_prefixes.'prefix globiclogservice: <http://localhost/globicLog/service/> INSERT DATA { GRAPH globiclogservice:'.$this->_component_named_graph.' { gic:'.$this->_component_name.' a gic:ContentProcessingComponent . '; if ( isset($this->_request_array['user']) ){ $sparql_query = $sparql_query.'gic:'.$this->_request_array['user'].' a prov:Person . '; } for ($i=1; $i<=10; $i++){ if ( isset($this->_request_array['contentConsumed'.$i]) ){ $sparql_query = $sparql_query.$this->_request_array['contentConsumed'.$i].' a '.$this->_request_array['contentConsumed'.$i.'Type'].' . '; } } $sparql_query = $sparql_query.'gic:'.$this->_request_array['activity'].' a gic:'.$this->_actual_activity.' ; prov:wasAssociatedWith gic:'.$this->_component_name.' ; '; if ( isset($this->_request_array['user']) ){ $sparql_query = $sparql_query.' prov:wasAssociatedWith gic:'.$this->_request_array['user'].' ; '; } for ($i=1; $i<=10; $i++){ if ( isset($this->_request_array['contentConsumed'.$i]) ){ $sparql_query = $sparql_query.' gic:contentConsumed '.$this->_request_array['contentConsumed'.$i].' ; '; } } $sparql_query = $sparql_query.' prov:startedAtTime "'.date('c', time()).'"^^xsd:dateTime . '; for ($i=1; $i<=10; $i++){ if ( isset($this->_request_array['contentGenerated'.$i]) ){ $sparql_query = $sparql_query.' '.$this->_request_array['contentGenerated'.$i].' a '.$this->_request_array['contentGenerated'.$i.'Type'].' ; gic:contentGeneratedBy gic:'.$this->_request_array['activity'].' ; '; for ($ii=1; $ii<=10; $ii++){ if ( isset($this->_request_array['contentConsumed'.$ii]) ){ $sparql_query = $sparql_query.'prov:wasDerivedFrom '.$this->_request_array['contentConsumed'.$ii].' ; '; } } $sparql_query = $sparql_query.'prov:generatedAtTime "'.date('c', time()).'"^^xsd:dateTime . '; } } $sparql_query = $sparql_query.'} }'; // Create fuseki update file $filepath1 = $_SERVER['DOCUMENT_ROOT']."/globicLog/service/temp/update".$this->_request_array['component_id'].".ru"; $file1 = fopen($filepath1,"w") or exit("Unable to open file!"); fwrite($file1, $sparql_query); fclose($file1); // Execute update query shell_exec('@ECHO OFF & cd C:\DB_Server\jena-fuseki-0.2.7 && ruby s-update --service http://localhost:3030/Test/update --update='.$filepath1); // Delete temp files unlink($filepath1); // Write to activity log $this->activityLog(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\DocumentAI\\V1\\Document\\Provenance::class);\n $this->provenance = $var;\n\n return $this;\n }", "public function getProvenance()\n {\n return $this->provenance;\n }", "public function retrieveProvenance(){\n \n\t$sparql_query = $this->_sparql_prefixes.'prefix globiclogservice: <http://localhost/globicLog/service/>\n\t\nSELECT ?predicate ?object\nWHERE\n{\n GRAPH globiclogservice:'.$this->_component_named_graph.' { '.$this->_request_array['retrieve_data'].' ?predicate ?object }\n}' ;\n\n // Create fuseki query file\n\t$filepath3 = $_SERVER['DOCUMENT_ROOT'].\"/globicLog/service/temp/query\".$this->_request_array['component_id'].\".rq\";\n\t$file3 = fopen($filepath3,\"w\") or exit(\"Unable to open file!\");\n\tfwrite($file3, $sparql_query);\n\tfclose($file3);\n\t\n\t// Execute request query\n\t$results = shell_exec('@ECHO OFF & cd C:\\DB_Server\\jena-fuseki-0.2.7 && ruby s-query --service http://localhost:3030/Test/query --query='.$filepath3);\n\n\t// Delete temp files\n\tunlink($filepath3);\n\t\n\t// Checks to see if the request data is present in triple store, displays error if it is not\n\t$decoded1 = json_decode($results, true);\n\tif ( isset($decoded1[\"results\"][\"bindings\"][0][$decoded1[\"head\"][\"vars\"][0]][\"value\"]) ){\n\t echo $results;\n\t}\n\telse{\n\t $error_message = \"Error in request - REQUEST DATA: '\".$this->_request_array['retrieve_data'].\"' does not exist within the triple store\";\n\t echo $error_message;\n\t $this->errorLog(true, $error_message);\n\t exit();\n\t}\n\t\n\t// Write to activity log\n\t$this->activityLog(false);\n\t\n }", "public function actionCreate() {\n $datasetModel = new \\app\\models\\yiiModels\\YiiDatasetModel();\n $variablesModel = new \\app\\models\\yiiModels\\YiiVariableModel();\n\n $token = Yii::$app->session['access_token'];\n\n // Load existing variables\n $variables = $variablesModel->getInstancesDefinitionsUrisAndLabel($token);\n $this->view->params[\"variables\"] = $this->getVariablesListLabelToShowFromVariableList($variables);\n\n // Load existing provenances\n $provenanceService = new WSProvenanceModel();\n $provenances = $this->mapProvenancesByUri($provenanceService->getAllProvenances($token));\n $this->view->params[\"provenances\"] = $provenances;\n\n //If the form is complete, register data\n if ($datasetModel->load(Yii::$app->request->post())) {\n //Store uploaded CSV file\n $document = UploadedFile::getInstance($datasetModel, 'file');\n $serverFilePath = \\config::path()['documentsUrl'] . \"DatasetFiles/\" . $document->name;\n $document->saveAs($serverFilePath);\n\n //Read CSV file content\n $fileContent = str_getcsv(file_get_contents($serverFilePath), \"\\n\");\n $csvHeaders = str_getcsv(array_shift($fileContent), Yii::$app->params['csvSeparator']);\n unlink($serverFilePath);\n\n //Loaded given variables\n $givenVariables = $datasetModel->variables;\n\n // Check CSV header with variables\n if (array_slice($csvHeaders, 2) === $givenVariables) {\n\n // Get selected or create Provenance URI\n if (!array_key_exists($datasetModel->provenanceUri, $provenances)) {\n $provenanceUri = $this->createProvenance(\n $datasetModel->provenanceUri,\n $datasetModel->provenanceComment\n );\n $datasetModel->provenanceUri = $provenanceUri;\n $provenances = $this->mapProvenancesByUri($provenanceService->getAllProvenances($token));\n $this->view->params[\"provenances\"] = $provenances;\n } else {\n $provenanceUri = $datasetModel->provenanceUri;\n }\n\n // If provenance sucessfully created\n if ($provenanceUri) {\n // Link uploaded documents to provenance URI\n $linkDocuments = true;\n if (is_array($datasetModel->documentsURIs) && is_array($datasetModel->documentsURIs[\"documentURI\"])) {\n $linkDocuments = $this->linkDocumentsToProvenance(\n $provenanceUri,\n $datasetModel->documentsURIs[\"documentURI\"]\n );\n }\n\n $datasetModel->documentsURIs = null;\n\n if ($linkDocuments === true) {\n // Save CSV data linked to provenance URI\n $values = [];\n foreach ($fileContent as $rowStr) {\n $row = str_getcsv($rowStr, Yii::$app->params['csvSeparator']);\n $scientifObjectUri = $row[0];\n $date = $row[1];\n for ($i = 2; $i < count($row); $i++) {\n $values[] = [\n \"provenanceUri\" => $provenanceUri,\n \"objectUri\" => $scientifObjectUri,\n \"variableUri\" => array_search($givenVariables[$i - 2], $variables),\n \"date\" => $date,\n \"value\" => $row[$i]\n ];\n }\n }\n\n $dataService = new WSDataModel();\n $result = $dataService->post($token, \"/\", $values);\n\n // If data successfully saved\n if (is_array($result->metadata->datafiles) && count($result->metadata->datafiles) > 0) {\n $arrayData = $this->csvToArray($fileContent);\n return $this->render('_form_dataset_created', [\n 'model' => $datasetModel,\n 'handsontable' => $this->generateHandsontableDataset($csvHeaders, $arrayData),\n 'insertedDataNumber' => count($arrayData)\n ]);\n } else {\n\n return $this->render('create', [\n 'model' => $datasetModel,\n 'errors' => $result->metadata->status\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $datasetModel,\n 'errors' => [\n Yii::t(\"app/messages\", \"Error while creating linked documents\")\n ]\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $datasetModel,\n 'errors' => [\n Yii::t(\"app/messages\", \"Error while creating provenance\")\n ]\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $datasetModel,\n 'errors' => [\n Yii::t(\"app/messages\", \"CSV file headers does not match selected variables\")\n ]\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $datasetModel,\n ]);\n }\n }", "private function createProvenance($alias, $comment) {\n $provenanceService = new WSProvenanceModel();\n $date = new \\DateTime();\n $provenanceUri = $provenanceService->createProvenance(\n Yii::$app->session['access_token'],\n $alias,\n $comment,\n [\n \"creationDate\" => $date->format(\"Y-m-d\\TH:i:sO\")\n ]\n );\n\n if (is_string($provenanceUri) && $provenanceUri != \"token\") {\n return $provenanceUri;\n } else {\n return false;\n }\n }", "public abstract function generateRequestObject();", "public function proveAll()\n {\n }", "public function generate(): void\n {\n $this->getPersister()->persist($this->getConfig(), $this->collectionObject);\n }", "public function generateProcedures();", "public function generate() {\n\t\t$post = get_post( $this->context->id );\n\t\t$comment_count = get_comment_count( $this->context->id );\n\n\t\t$data = array(\n\t\t\t'@type' => 'Review',\n\t\t\t'@id' => $this->context->canonical . '#product-review',\n\t\t\t'isPartOf' => array( '@id' => $this->context->canonical . Schema_IDs::ARTICLE_HASH ),\n\t\t\t'itemReviewed' => array(\n\t\t\t\t\t'@type' => 'Product',\n\t\t\t\t\t'image' => array(\n\t\t\t\t\t\t'@id' => $this->context->canonical . Schema_IDs::PRIMARY_IMAGE_HASH,\n\t\t\t\t\t),\n\t\t\t\t\t'name' => wp_strip_all_tags( $this->get_review_meta( 'name', get_the_title() ) ),\n\t\t\t\t\t'aggregateRating' => array(\n\t\t\t\t\t\t'@type' => 'AggregateRating',\n\t\t\t\t\t\t'ratingValue' => esc_attr( $this->get_review_meta( 'rating', 1 ) ),\n\t\t\t\t\t\t'reviewCount' => 1\n\t\t\t\t\t)\n\t\t\t),\n\t\t\t'reviewRating' => array(\n\t\t\t\t'@type' => 'Rating',\n\t\t\t\t'ratingValue' => esc_attr( $this->get_review_meta( 'rating', 1 ) ),\n\t\t\t),\n\t\t\t'name' => wp_strip_all_tags( $this->get_review_meta( 'name', get_the_title() ) ),\n\t\t\t'description' => wp_strip_all_tags( $this->get_review_meta( 'summary', get_the_excerpt( $post ) ) ),\n\t\t\t'reviewBody' => wp_kses_post( $this->get_review_meta( 'body', $post->post_content ) ),\n\t\t\t'author' => array(\n\t\t\t\t'@id' => get_author_posts_url( get_the_author_meta( 'ID' ) ),\n\t\t\t\t'name' => get_the_author_meta( 'display_name', $post->post_author ),\n\t\t\t),\n\t\t\t'publisher' => array( '@id' => $this->get_publisher_url() ),\n\t\t\t'datePublished' => mysql2date( DATE_W3C, $post->post_date_gmt, false ),\n\t\t\t'dateModified' => mysql2date( DATE_W3C, $post->post_modified_gmt, false ),\n\t\t\t'commentCount' => $comment_count['approved'],\n\t\t\t'mainEntityOfPage' => $this->context->canonical . Schema_IDs::WEBPAGE_HASH,\n\t\t);\n\t\t$data = apply_filters( 'be_review_schema_data', $data, $this->context );\n\n\t\treturn $data;\n\t}", "public function produce(BaseRequest $request)\n {\n }", "public function saved(Proposal $proposal)\n {\n $this->generateCode($proposal); \n }", "private function linkDocumentsToProvenance($provenanceUri, $documents) {\n $documentModel = new YiiDocumentModel(null, null);\n\n // associated documents update\n foreach ($documents as $documentURI) {\n $documentModel = new YiiDocumentModel(null, null);\n $documentModel->findByURI(Yii::$app->session['access_token'], $documentURI);\n $documentModel->status = \"linked\";\n $concernedItem = new YiiConcernedItemModel();\n $concernedItem->uri = $provenanceUri;\n $concernedItem->rdfType = Yii::$app->params[\"Provenance\"];\n $documentModel->concernedItems = [$concernedItem];\n $dataToSend[] = $documentModel->attributesToArray();\n }\n\n if (isset($dataToSend)) {\n $requestRes = $documentModel->update(Yii::$app->session['access_token'], $dataToSend);\n\n if (is_string($requestRes) && $requestRes === \"token\") {\n return false;\n } else {\n return true;\n }\n } else {\n return true;\n }\n }", "function Participant_Handle_Certificate_Generate()\n {\n $where=$this->Participant_Certificate_Where($this->ItemHash);\n\n $cert=$this->CertificatesObj()->Sql_Select_Hash($where);\n $cert=$this->CertificatesObj()->Certificate_Read($cert);\n\n $latex=$this->CertificatesObj()->Certificate_Generate($cert);\n\n $latex=$this->CertificatesObj()->Certificates_Latex_Ambles_Put($latex);\n $this->CertificatesObj()->Certificate_Set_Generated($cert);\n \n if ($this->CGI_GET(\"Latex\")!=1)\n {\n $this->ShowLatexCode($latex);\n }\n\n return\n $this->Latex_PDF\n (\n $this->CertificatesObj()->Certificate_TexName\n (\n $cert[ \"Friend_Hash\" ][ \"Name\" ]\n ),\n $latex\n );\n }", "public function created(Proposal $proposal)\n {\n $this->generateCode($proposal);\n }", "static function insertAgreement($props) {\n if (!$props) {\n drupal_set_message(t('Insert requested with empty (filtered) data set'), 'error');\n return false;\n }\n if (!isset($props['proposal_id'])) {\n drupal_set_message(t('Insert requested with no proposal set'), 'error');\n return false;\n }\n\n global $user;\n\n $txn = db_transaction();\n try {\n $proposal = objectToArray(Proposal::getInstance()->getProposalById($props['proposal_id']));\n $project = objectToArray(Project::getProjectById($proposal['pid']));\n if (!isset($props['student_id'])) {\n $props['student_id'] = $user->uid;\n }\n if (!isset($props['supervisor_id'])) {\n $props['supervisor_id'] = $proposal['supervisor_id'];\n }\n if (!isset($props['mentor_id'])) {\n $props['mentor_id'] = $project['mentor_id'];\n }\n\n\n $props['project_id'] = $proposal['pid'];\n\n if (!isset($props['description'])) {\n $props['description'] = '';\n }\n if (!isset($props['student_signed'])) {\n $props['student_signed'] = 0;\n }\n if (!isset($props['supervisor_signed'])) {\n $props['supervisor_signed'] = 0;\n }\n if (!isset($props['mentor_signed'])) {\n $props['mentor_signed'] = 0;\n }\n if (!isset($props['student_completed'])) {\n $props['student_completed'] = 0;\n }\n if (!isset($props['supervisor_completed'])) {\n $props['supervisor_completed'] = 0;\n }\n if (!isset($props['mentor_completed'])) {\n $props['mentor_completed'] = 0;\n }\n /*\n if (! testInput($props, array('owner_id', 'org_id', 'inst_id', 'supervisor_id','pid', 'title'))){\n return FALSE;\n }\n */\n try {\n $id = db_insert(tableName(_AGREEMENT_OBJ))->fields($props)->execute();\n } catch (Exception $e) {\n drupal_set_message($e->getMessage(), 'error');\n }\n if ($id) {\n drupal_set_message(t('You have created your agreement: you can continue editing it later.'));\n return $id;\n } else {\n drupal_set_message(t('We could not add your agreement. ') .\n (_DEBUG ? ('<br/>' . getDrupalMessages()) : \"\"), 'error');\n }\n\n return $result;\n } catch (Exception $ex) {\n $txn->rollback();\n drupal_set_message(t('We could not add your agreement.') . (_DEBUG ? $ex->__toString() : ''), 'error');\n }\n return FALSE;\n }", "public function setProofs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::BYTES);\n $this->proofs = $arr;\n\n return $this;\n }", "protected function beforeGenerate()\n {\n }", "public function store(Request $request)\n {\n $data = $request->all();\n //dd($data);\n $policy = new Policy;\n $policy->property_id = $data['p_id'];\n $policy->advance_cancellation = $data['advance_cancellation'];\n $policy->full_pay= $data['full_pay'];\n if ($data['protection']==\"on\"){\n $policy->protection = \"Yes\";\n }else{\n $policy->protection = \"No\";\n }\n $policy->checkin_from = $data['checkin_from'];\n $policy->checkin_to = $data['checkin_to'];\n $policy->checkout_from = $data['checkout_from'];\n $policy->checkout_to = $data['checkout_to'];\n if ($data['children']==\"on\"){\n $policy->children = \"Yes\";\n }else{\n $policy->children = \"No\";\n }\n $policy->pets_allowed = $data['pets_allowed'];\n $policy->pets_fee = $data['pets_fee'];\n $policy->save();\n return redirect()->route('policy.add')->with('alert','Your property has been created successfully. One of our team members will contact you to verify the property before it is activated');\n }", "public function getProofs()\n {\n return $this->proofs;\n }", "protected function generateSignature()\r\n {\r\n $this->signature = hash_hmac('sha256', json_encode($this->content), $this->apiSecretKey);\r\n }", "public function generate()\n\t{\n\t\tfile_put_contents( $this->setPath(), $this->setPostContent() );\n\t}", "public function setEvidence($evidence) {\n $this->evidence = $evidence;\n }", "public function store_product_variation(Request $request){\n $post_parent = $this->find_product_for_supplier($request->post_parent,\\Auth::user()->wordpress_user->ID);\n $post_title_appendix = ' - ';\n $attributes_values = $request->attributes_values;\n $post_excerpt = '';\n \n //attribute is the term_taxonomy_id\n if($attributes_values!=0){\n $taxonomy = TermTaxonomy::where('term_taxonomy_id',$attributes_values)->first();\n $post_excerpt .=str_replace('pa_','',$taxonomy->taxonomy).\": \".$taxonomy->term->name;\n $post_title_appendix .= $taxonomy->term->name;\n // if(next($attributes_values)){\n // $post_title_appendix.=' , ';\n // $post_excerpt.=\"\\n\";\n // }\n }\n\n \n $post_title = $post_parent->post_title .$post_title_appendix;\n $post = Post::create([\n 'post_author'=>\\Auth::user()->wordpress_user->ID,\n 'post_parent'=>$request->post_parent,\n 'post_date'=>now(),\n 'post_date_gmt'=>now(),\n 'post_content'=>'',\n 'post_title'=>$post_title,\n 'post_name'=>str_replace(' ','-',$post_title),\n 'post_status'=>'publish',\n 'comment_status'=>'closed',\n 'ping_status'=>'closed',\n 'post_type'=>'product_variation',\n 'post_excerpt'=>$post_excerpt,\n 'to_ping'=>\"\",\n 'pinged'=>'',\n 'post_content_filtered'=>'',\n 'post_modified'=>now(),\n 'post_modified_gmt'=>now()\n ]);\n $post->update([\n // 'guid'=>General::URL.'/?post_type=product_variation&#038;p='.$post->ID\n 'guid'=>General::URL.'/product'.$post->post_name\n ]);\n //create term relation foreach attribute\n \n if($attributes_values!=0)\n {\n //attribute is the term_taxonomy_id\n $taxonomy = TermTaxonomy::where('term_taxonomy_id',$attributes_values)->first();\n TermRelation::create([\n 'object_id'=>$post->ID,\n 'term_taxonomy_id'=>$taxonomy->term_taxonomy_id,\n 'term_order'=> 0\n ]);\n //\n\n $this->creatPostMeta($post->ID,'attribute_'.$taxonomy->taxonomy,$taxonomy->term->name);\n }\n \n //store option\n $option_name = \"_transient_wc_product_children_\".$post_parent->ID;\n $prices_option_name = \"_transient_wc_var_prices_\".$post_parent->ID;\n $option = Option::where('option_name',$option_name)->first();\n $option_prices = Option::where('option_name',$prices_option_name)->first();\n if($option_prices){\n $options_table_name= \\General::DB_PREFIX.'options';\n \\DB::delete(\"DELETE From \".$options_table_name.\" where option_name = '\".$prices_option_name.\"'\");\n }\n\n $option_value=[];\n //if it's null create new option and this is the first variation in this product\n if(!$option){\n array_push($option_value,(object)[\n \"all\"=>[$post->ID],\n \"visible\"=>[$post->ID]\n ]);\n $option = Option::create([\n 'option_name'=>$option_name,\n 'option_value'=>serialize($option_value)\n ]);\n }\n else{\n\n \n $option_value = unserialize($option->option_value);\n array_push($option_value[0]->all,$post->ID);\n array_push($option_value[0]->visible,$post->ID);\n \\DB::table(\\General::DB_PREFIX.\"options\")\n ->where('option_name',$option_name)\n ->update([\n 'option_value'=>serialize($option_value)\n ]);\n }\n \n return $post;\n\n \n }", "public function run()\n {\n Property::create([\n 'name' => 'One Amerin Residence',\n 'address' => 'No 35, Persisiran Perling 1, Taman Perling',\n 'postcode' => '81200',\n 'city' => 'JB',\n 'state' => 'JHR',\n 'propertytype_id' => 2\n ]);\n\n Property::create([\n 'name' => 'Aliff Avenue Residence',\n 'address' => 'Jalan Tampoi, Kawasan Perindustrian Tampoi',\n 'postcode' => '81200',\n 'city' => 'JB',\n 'state' => 'JHR',\n 'propertytype_id' => 1\n ]);\n\n Property::create([\n 'name' => 'Bora Residence',\n 'address' => '2009, Lebuhraya Sultan Iskandar, Danga Bay',\n 'postcode' => '80200',\n 'city' => 'JB',\n 'state' => 'JHR',\n 'propertytype_id' => 2\n ]);\n }", "public function run()\n {\n $prods = Product::factory(15)\n ->hasAttached(\n Attribute::factory()->count(3),\n function (Product $attr) {\n return ['value' => ProductAttribute::factory()->fakeValue()];\n }\n )\n ->hasAttached(\n Category::factory()->count(5)\n )\n ->hasAttached(\n Provider::factory()->count(5)\n )\n ->hasAttached(\n Store::factory()->has(\n Order::factory()->count(2)\n )->count(5)\n )\n ->create();\n\n }", "public function patientProphylaxispost()\r\n {\r\n $input = Request::all();\r\n $new_patient_prophylaxis = PatientProphylaxis::create($input);\r\n if($new_patient_prophylaxis){\r\n return response()->json(['msg'=> 'added prophylaxis to patient', 'response'=> $new_patient_prophylaxis], 201);\r\n }else{\r\n return response()->json(['msg'=> 'Could not map patient to Prophylaxis'], 400);\r\n }\r\n }", "public function store(NovaRequest $request)\n {\n $note = new Note();\n $note->owner_id = $request->user()->id;\n $note->team_id = $request->user()->current_team_id;\n $note->body = $request->body;\n $note->parent_type = $request->model;\n $note->parent_id = $request->id;\n $note->save();\n }", "public function run()\n {\n factory(App\\ContextPolicy::class, 5)->make()\n ->each(function($contextPolicy){\n $contextPolicy->beacon()->associate(App\\Beacon::all()->random(1));\n\t\t\t\t$contextPolicy->kid()->associate(App\\Kid::find(1));\n $contextPolicy->save();\n });\n }", "public function store(PreturnRequest $request)\n {\n return Preturn::create($request->all());\n }" ]
[ "0.66376007", "0.5804161", "0.57135516", "0.5029811", "0.45754743", "0.43828768", "0.4378052", "0.43102032", "0.42727524", "0.4201761", "0.410786", "0.40948167", "0.4086125", "0.40775073", "0.40610108", "0.40531683", "0.4039586", "0.39950046", "0.3956717", "0.39505962", "0.3894559", "0.38868985", "0.38526076", "0.38432667", "0.384316", "0.3842539", "0.37757525", "0.3763444", "0.37522852", "0.3751986" ]
0.69313943
0
The activityLog() method is used to log when an activity has taken place by the log service. A time stamp is provided along with component ID, request type (POST or GET) any content consumed, any content generated and the data to be retrieved
public function activityLog($registration){ $file = fopen($_SERVER['DOCUMENT_ROOT']."/globicLog/service/logs/Activity_Log.txt", "a"); // Log registration details if($registration == true){ $log = "[".date('c', time())."] | Activity: Register | ComponentID: ".$this->_component_name." | GraphName: ".$this->_component_named_graph.".\n"; } // Log other activity details else { $log = "[".date('c', time())."] | ComponentID = ".$this->_request_array['component_id']." | RequestType = ".$this->_request_array['http_method']." | "; if($this->_request_array['http_method'] == 'POST'){ $log = $log."Activity = ".$this->_actual_activity." | ContentConsumed ="; for ($i=1; $i<=10; $i++){ if ( isset($this->_request_array['contentConsumed'.$i]) ){ $log = $log." ".$this->_request_array['contentConsumed'.$i]; } } $log = $log." | ContentGenerated = "; for ($i=1; $i<=10; $i++){ if ( isset($this->_request_array['contentGenerated'.$i]) ){ $log = $log." ".$this->_request_array['contentGenerated'.$i]; } } $log = $log.".\n"; } else if($this->_request_array['http_method'] == 'GET'){ $log = $log."RetrieveData = ".$this->_request_array['retrieve_data'].".\n"; } } fwrite($file, $log); fclose($file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activity_log() {\n\t\t$this->load->model('user/users_model','users');\n\t\tshow(array(\n\t\t\t'page' => 'activity_log',\n\t\t\t'get' =>$this->users->users_details(),\n\t\t\t'script' => 'user/login',\n\t\t\t'sub_title' => 'Activity Log',\n\t\t\t'view' => 'user/activity_log'\n\t\t));\n\t}", "function _activity_log($patient , $health, $action)\n\t{\n\t\t// To get page url to track activity\n\t\t$page_url = Router::url( $this->here, true );\n\t\t$this->ActivityLog = ClassRegistry::init('ActivityLog');\n\t\t\n\t\t$this->data['ActivityLog']['admin_id'] = $this->Session->read('Admin.id');\n\t\t$this->data['ActivityLog']['patient_id'] = $patient;\n\t\t$this->data['ActivityLog']['health_id'] = $health;\n\t\t$this->data['ActivityLog']['page_url']= $page_url;\n\t\t$this->data['ActivityLog']['action']= $action;\n\t\t$this->data['ActivityLog']['creation'] = date('Y-m-d H:i:s');\n\t\t//print_R($this->data);\n\t\tif($this->ActivityLog->create($this->data))\n\t\t{\n\t\t\tif($this->ActivityLog->save($this->data))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t}", "function get_data_log_activity() {\n\n\t\t$getDataLogActivity = $this->log_activity_model->get_log_using_server_side();\n\n\t\t$data = array();\n\n\t\tforeach ($getDataLogActivity as $field):\n\n\t\t\t$row = array();\n\n\t\t\t$row[] = date_format(date_create($field->time), 'd M Y H:i:s');\n\n\t\t\t$row[] = $field->log;\n\n\t\t\t$row[] = $field->user_fullname;\n\n\t\t\t$row[] = $field->access_name;\n\n\t\t\t$data[] = $row;\n\n\t\tendforeach;\n\n\t\t$output = array(\n\t\t\t\t\t\t\"draw\" => $_POST['draw'],\n \t\t\t\"recordsTotal\" => $this->log_activity_model->count_all_data(),\n \t\t\t\"recordsFiltered\" => $this->log_activity_model->count_filtered(),\n\t\t\t\t\t\t\"data\" => $data\n\t\t\t\t\t);\n\n\t\techo json_encode($output);\n\n\t}", "function getactivityAction()\n {\n if (!$this->_authenticate()) {\n return;\n }\n\n try {\n $request = $this->getRequest();\n $helper = Mage::helper('eyehubspot');\n $multistore = $request->getParam ('multistore', self::IS_MULTISTORE );\n $maxperpage = $request->getParam('maxperpage', self::MAX_CUSTOMER_PERPAGE);\n $maxAssociated = $request->getParam('maxassoc', self::MAX_ASSOC_PRODUCT_LIMIT);\n $start = date('Y-m-d H:i:s', $request->getParam('start', 0));\n $end = date('Y-m-d H:i:s', time() - 300);\n $websiteId = Mage::app()->getWebsite()->getId();\n $store = Mage::app()->getStore();\n $storeId = Mage::app()->getStore()->getId();\n $collection = Mage::getModel('customer/customer')->getCollection();\n $resource = Mage::getSingleton('core/resource');\n $read = $resource->getConnection('core_read');\n $customerData = array();\n\n try {\n // because of limitations in the log areas of magento, we cannot use the\n // standard collection to retreive the results\n $select = $read->select()\n ->from(array('lc' => $resource->getTableName('log/customer')))\n ->joinInner(\n array('lv' => $resource->getTableName('log/visitor')),\n 'lc.visitor_id = lv.visitor_id'\n )\n ->joinInner(\n array('vi' => $resource->getTableName('log/visitor_info')),\n 'lc.visitor_id = vi.visitor_id'\n )\n ->joinInner(\n array('c' => $resource->getTableName('customer/entity')),\n 'c.entity_id = lc.customer_id',\n array('email' => 'email', 'customer_since' => 'created_at')\n )\n ->joinInner(\n array('p' => $resource->getTableName('log/url_info_table')),\n 'p.url_id = lv.last_url_id',\n array('last_url' => 'p.url', 'last_referer' => 'p.referer')\n )\n ->where('lc.customer_id > 0');\n // only add the filter if website id > 0\n if (!($multistore) && $websiteId) {\n \t$select->where(\"c.website_id = '$websiteId'\");\n }\n $select->where(\"lv.last_visit_at >= '$start'\")\n ->where(\"lv.last_visit_at < '$end'\")\n ->order('lv.last_visit_at')\n ->limit($maxperpage);\n\n $collection = $read->fetchAll($select);\n } catch (Exception $e) {\n $this->_outputError(self::ERROR_CODE_UNSUPPORTED_SQL, 'DB Exception on query', $e);\n return;\n }\n\n foreach ($collection as $assoc) {\n $log = new Varien_Object($assoc);\n $customerId = $log->getCustomerId();\n\n // merge and replace older data with newer\n if (isset($customerData[$customerId])) {\n $temp = $customerData[$customerId];\n $log->addData($temp->getData());\n $log->setFirstVisitAt($temp->getFirstVisitAt());\n } else {\n $log->setViewed($helper->getProductViewedList($customerId, $multistore, $maxAssociated));\n $log->setCompare($helper->getProductCompareList($customerId, $multistore, $maxAssociated));\n $log->setWishlist($helper->getProductWishlist($customerId, $multistore, $maxAssociated));\n }\n\n $log->unsetData('session_id');\n $customerData[$customerId] = $log;\n }\n } catch (Exception $e) {\n $this->_outputError(\n self::ERROR_CODE_UNKNOWN_EXCEPTION,\n 'Unknown exception on request',\n $e\n );\n return;\n }\n\n $this->_outputJson(array(\n 'visitors' => $helper->convertAttributeData($customerData),\n 'website' => $websiteId,\n 'store' => $storeId\n ));\n }", "public function actionLog() \n\t{\n\t//\t$path = YiiBase::getPathOfAlias('application.runtime').'/debug.'.time().'.log';\n\t\t$fields = CJSON::decode(file_get_contents('php://input'));\n\t\t$modelClass = $this->modelClass;\n\t\t$model = new $modelClass();\n\t\t$model->error_url = isset($fields['errorUrl']) ? $fields['errorUrl'] : '(none)';\n\t\t$model->app_ident = isset($fields['appId']) ? $fields['appId'] : null;\n\t\t$model->device_ident = isset($fields['deviceId']) ? $fields['deviceId'] : null;\n\t\t$model->session_ident = isset($fields['sessionId']) ? $fields['sessionId'] : null;\n\t\t$model->type_id = isset($fields['typeId']) ? $fields['typeId'] : 0;\n\t\t$model->error_message = isset($fields['errorMessage']) ? $fields['errorMessage'] : null;\n\t\t$model->cause = isset($fields['cause']) ? $fields['cause'] : null;\n\t\t$model->user_id = isset($fields['userId']) ? $fields['userId'] : 0;\n\t\t$stack = isset($fields['stackTrace']) ? $fields['stackTrace'] : array();\n\t\t$model->stacktrace = CJSON::encode($stack);\n\t\t$state = isset($fields['state']) ? $fields['state'] : array();\n\t\t$model->state = CJSON::encode($state);\n\t\tif ($model->save()) {\n\t\t\techo 'ok';\n\t\t}\telse {\n\t\t\tthrow new CException('Could not save trace information: '.CHtml::errorSummary($model));\n\t\t}\n\t}", "public function logActivity(array $data)\n\t{\t\n\t $ext = $this->trigger(self::EventActivityLogAddPre, $this, compact('data'), $this->setXhooks($data));\n\t if($ext->stopped()) return $ext->last(); elseif($ext->last()) $data = $ext->last();\n\t \n\t\t$sql = $this->getSQL($data);\n\t\t$sql['date'] = new \\Zend\\Db\\Sql\\Expression('NOW()');\n\t\t$sql['created_date'] = new \\Zend\\Db\\Sql\\Expression('NOW()');\n\t\t$this->insert('activity_logs', $sql);\n\t\t\n\t\t$ext = $this->trigger(self::EventActivityLogAddPre, $this, compact('data'), $this->setXhooks($data));\n\t\tif($ext->stopped()) return $ext->last(); \n\t}", "public function logAction($action, $params = null, $subject_contact_id = null, $contact_id = null)\n {\n if (!class_exists('waLogModel')) {\n wa('webasyst');\n }\n $log_model = new waLogModel();\n return $log_model->add($action, $params, $subject_contact_id, $contact_id);\n }", "private function _log()\n\t{\n\t\t$log = [\n\t\t\t'url'\t\t\t=> Yii::$app->request->getUrl(),\n\t\t\t'ip'\t\t\t=> Yii::$app->request->getUserIP(),\n\t\t\t'_jsonRequest' \t=> [\n\t\t\t\tself::OBJECT_PARAMS\t=> $this->_jsonRequest,\n\t\t\t\tself::OBJECT_FILES => $this->_filesRequest,\n\t\t\t],\n\t\t\t'_jsonResponse' => $this->_jsonResponse,\n\t\t];\n\n\t\tYii::info($log, 'db_log');\n\t}", "public function log()\n {\n $request = A::getMainApp()->request;\n $response = A::getMainApp()->response;\n\n $log = array(\n 'ip' => CommonHelpers::getIp(),\n 'client_puk' => $request->puk,\n 'query' => $request->fullUri,\n 'module' => $request->module,\n 'action' => $request->action,\n 'params' => serialize($request->params),\n 'response_code' => $response->code,\n 'response_message' => $response->message,\n );\n\n $db = new MainDb();\n return $db->insert('logs', $log);\n }", "public function log($params, $post_data) {\n\t\t$request_url = \"https://trackcmp.net/event\";\n\t\t$post_data[\"actid\"] = $this->track_actid;\n\t\t$post_data[\"key\"] = $this->track_key;\n\t\t$visit_data = array();\n\t\tif ($this->track_email) {\n\t\t\t$visit_data[\"email\"] = $this->track_email;\n\t\t}\n\t\tif (isset($post_data[\"visit\"])) {\n\t\t\t$visit_data = array_merge($visit_data, $post_data[\"visit\"]);\n\t\t}\n\t\tif ($visit_data) {\n\t\t\t$post_data[\"visit\"] = json_encode($visit_data);\n\t\t}\n\t\t$response = parent::curl($request_url, $post_data, \"POST\", \"tracking_log\");\n\t\treturn $response;\n\t}", "function createActivityLog($log_items) {\n $log = new RepositoryUpdateActivityLog();\n return $log->log($this, $this->getCreatedBy(), lang(':total_commits commits added', array('total_commits' => $log_items)));\n }", "public function getLog()\n\t{\n\t\t\n $request = Mage::app()->getRequest();\n\t\t$actionName = $request->getActionName();\n $controllerName = $request->getControllerName();\n $implodedControllerName = implode(' => ', array_map('ucfirst', explode('_', $controllerName)));\n\n\t if ($this->_isLogNeeded($actionName, $implodedControllerName)) {\n\n $entity = end(explode('_', $controllerName));\n $user = Mage::getSingleton('admin/session')->getUser();\n\n\t\t\t$adminlog = Mage::getModel('adminlog/adminlog');\n\t\t\t$dynamicValues = $this->_getDynamicValues($controllerName);\n\t\t\t$currentId = $request->getParam($dynamicValues[0]);\n\t \t$storeId = $request->getParam('store');\n\t\t\t$store = Mage::getModel('core/store')->load($storeId);\n\n\t\t\tif ($user) {\n /* Get the user details */\n \n\t\t\t\t$data['user_id'] = $user->getUserId();\n\t\t\t\t$data['user_email'] = $user->getEmail();\n\t\t\t\t$data['remote_ip'] = Mage::helper('core/http')->getRemoteAddr();\n\t\t\t\t$data['store_name'] = $store->getName() ? $store->getName() : 'All store views';\n\t\t\t\t$data['controller_name'] = $implodedControllerName;\n\t\t\t\t$data['action'] = ucfirst($actionName);\n\t\t\t\t$data['full_path'] = $request->getModulename() . \"/\" . $controllerName . \"/\" . $actionName;\n\t\t\t\t$data['logged_at'] = time();\n\n\t\t\t\t$data['additional_info'] = \"\";\n\t\t\t\tif (!empty($dynamicValues)) {\n\t\t \t\tif (($actionName == \"save\") && ($dynamicValues[1] == \"catalog/product\")) {\n\t\t \t\t\t$product = $request->getParam('product');\n\t\t\t\t\t\t$data['additional_info'] = $dynamicValues[3] . $product['sku'];\n\t\t \t\t} elseif (($actionName == \"save\") && ($dynamicValues[1] == \"customer/customer\")) {\n\t\t\t\t\t\t$account = $request->getParam('account');\n\t\t\t\t\t\t$data['additional_info'] = $dynamicValues[3] . $account['firstname'] . \" \" . $account['lastname'];\n\t\t \t\t} elseif ($actionName == \"save\") {\n\t\t \t\t\t$data['additional_info'] = $dynamicValues[3] . $request->getParam($dynamicValues[4]);\n\t\t \t\t} elseif (($actionName == \"new\")) {\n\t\t \t\t \t$data['additional_info'] = \"Tried to create a new \" . $entity;\n\t\t \t\t} elseif (($actionName == \"duplicate\")) {\n\t\t \t\t\t$productId = $request->getParam('id');\n\t\t \t\t\t$_product = Mage::getModel('catalog/product')->load($productId); \n\t\t\t\t\t\t$data['additional_info'] = \"Duplicated the \" . $entity.\" \".$_product['sku'];\n\t\t \t\t} elseif (($actionName == \"delete\")) {\n\t\t \t\t \t$data['additional_info'] = \"Deleted the \" . $entity;\n\t\t \t\t}\n\n\t\t \t} else {\n\t\t \t\t$data['additional_info'] = str_replace(\" => \", \" \", $implodedControllerName) . \" section was modified.\";\n\t\t \t}\n\n try {\n \t$adminlog->setData($data)->save();\n } catch (Exception $e) {\n \tMage::getSingleton('core/session')->addError($entity . ' saved successfully. However, there occured an error while saving the log.');\n }\n\t\t\t}\n\t\t}\n\t}", "function getBaseLog(){\t\t\n\t\tif(!isset($_REQUEST['appid'])\n\t\t\t||!isset($_REQUEST['event'])\n\t\t\t||!isset($_REQUEST['uid'])) throw new Exception(\"no appid or event or uid\");\n\t\tif(isset($_REQUEST['timestamp']))\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\telse \n\t\t\t$timestamp = $_SERVER['REQUEST_TIME'];\n\t\t$log=$_REQUEST['appid'].\"\\t\".$_REQUEST['uid'].\"\\t\".$_REQUEST['ref'].\n\t\t\t\"\\t\".$_REQUEST['event'].\"\\t\".$_REQUEST['json_var'].\"\\t\".$timestamp.\"\\n\";\n\t\t\n\t\tif ($_REQUEST ['event'] === \"user.visit\") {\n\t\t\t$ip = getIP ();\n\t\t\tif ($ip != false) {\n\t\t\t\t$log = $log . $_REQUEST ['appid'] . \"\\t\" . $_REQUEST ['uid'] . \"\\t\" . '' . \"\\t\" . \"user.update\" . \"\\t\" . '{\"geoip\":\"' . $ip . '\"}' . \"\\t\" . $timestamp . \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $log;\n\t}", "public function saveRequestLog()\r\n {\r\n $_helper = $this->getHelper();\r\n $_helper->log('=====================');\r\n $_helper->log('REQUEST');\r\n $_helper->log($this->getHttpClient()->getLastRequest());\r\n }", "public function describeDcdnDomainCcActivityLog($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->describeDcdnDomainCcActivityLogWithOptions($request, $runtime);\n }", "public function logPerformance()\n {\n Log::info(\n PHP_EOL . 'Performance Statistics:' . PHP_EOL .\n 'Current Route: ' . Request::getRequestUri()\n . PHP_EOL .\n 'Time to create the Response: '\n . $this->getCurrentTimeDifference(Session::get('start.time'), 'ms') . ' ms'\n . PHP_EOL .\n 'Total performed DB Queries: ' . count(DB::getQueryLog())\n . PHP_EOL\n );\n }", "function log_opportunity_activity($opportunity_id,$description, $staffid = null)\n{\n $CI = & get_instance();\n $log = [\n 'description' => $description,\n 'opportunity_id' => $opportunity_id,\n 'date' => date('Y-m-d H:i:s'),\n ];\n if (!DEFINED('CRON')) {\n if ($staffid != null && is_numeric($staffid)) {\n $log['staffid'] = get_staff_full_name($staffid);\n } else {\n if (!is_client_logged_in()) {\n if (is_staff_logged_in()) {\n $log['staffid'] = get_staff_full_name(get_staff_user_id());\n } else {\n $log['staffid'] = null;\n }\n } else {\n $log['staffid'] = get_contact_full_name(get_contact_user_id());\n }\n }\n } else {\n // manually invoked cron\n if (is_staff_logged_in()) {\n $log['staffid'] = get_staff_full_name(get_staff_user_id());\n } else {\n $log['staffid'] = '[CRON]';\n }\n }\n\n $CI->db->insert(db_prefix() . 'activity_log_opportunity', $log);\n \n}", "protected function logActivity($message)\n {\n $this->logMessage = $message;\n $this->isReady = false;\n }", "protected function logActivity($message)\n {\n $this->logMessage = $message;\n $this->isReady = false;\n }", "public function logRequest()\n {\n $requestMethod = $this->getRequestMethod();\n \n if (! in_array($requestMethod, $this->pageRequestMethods)) {\n return;\n }\n \n $data = [\n 'request_uri' => $this->getRequestUri(),\n 'ip_address' => $this->getIpAddress(),\n 'timestamp' => time(),\n 'request_method' => $requestMethod,\n 'blocked' => false,\n 'request_count' => 1\n ];\n \n $this->storage->store($data);\n }", "private function activityLog(array $data)\n {\n $default = [\n 'type' => 1,\n 'rel_route' => 'user.operator.customfield.edit',\n 'section' => 'user.customfield',\n 'user_id' => 1,\n 'user_name' => 'John Doe',\n 'event_name' => 'item_created',\n 'ip' => inet_pton('81.8.12.192'),\n 'created_at' => time(),\n 'updated_at' => time()\n ];\n\n foreach ($data as $k => $row) {\n $data[$k] = $row + $default;\n }\n\n DB::table('activity_log')->insert($data);\n }", "public function saveActivityLog(ActivityLogModel $model)\n {\n $record = new ActivityLogRecord();\n\n $record->title = $model->title;\n $record->elementId = $model->elementId;\n $record->elementType = $model->elementType;\n $record->elementTypeDisplayName = $model->elementTypeDisplayName;\n $record->action = $model->action;\n $record->log = serialize($model->log);\n $record->ip = $model->ip;\n $record->userAgent = $model->userAgent;\n $record->userId = $model->userId;\n $record->siteId = $model->siteId;\n\n $db = Craft::$app->getDb();\n $transaction = $db->beginTransaction();\n\n try {\n // Save the activitylog\n $record->save(false);\n\n // Now that we have a activitylog ID, save it on the model\n if (!$model->id) {\n $model->id = $record->id;\n }\n\n $transaction->commit();\n\n } catch(\\Exception $e) {\n $transaction->rollBack();\n\n Craft::error( Craft::t('activitylog', 'An error occured while saving activity log: {error}', ['error' => print_r($record->getErrors(), true),]), 'activitylog');\n }\n }", "public static function log_action (array $params, $action = null, $module = null) {\n $last_value = function($value){\n $tmp = explode('_', $value);\n return strtolower($tmp[1]);\n };\n $trace = debug_backtrace();\n $call_class = $trace[1];\n $module = (!$module) ? $last_value($call_class['class']) : $module;\n $action = (!$action) ? $last_value($call_class['function']) : $action;\n if(is_array($params)){\n $params = json_encode($params);\n }\n $user = Auth::instance()->get_user();\n $time = time();\n DB::insert('logs', array('user_id', 'module', 'action', 'params', 'date'))\n ->values(array($user->id, $module, $action, $params, $time))->execute();\n }", "abstract protected function getRequestUrlLogData();", "public function logRequest()\n {\n if (\\strpos($this->debug->getInterface(), 'http') !== 0) {\n return;\n }\n $this->debug->alert(\n '%c%s%c %s',\n 'font-weight:bold;',\n $this->debug->request->getMethod(),\n '',\n $this->debug->request->getRequestTarget(),\n $this->debug->meta('level', 'info')\n );\n $this->logRequestHeaders();\n if ($this->debug->getCfg('logRequestInfo.cookies', Debug::CONFIG_DEBUG)) {\n $cookieVals = $this->debug->request->getCookieParams();\n \\ksort($cookieVals, SORT_NATURAL);\n if ($cookieVals) {\n $this->debug->table('$_COOKIE', $cookieVals, $this->debug->meta('redact'));\n }\n }\n $this->logPost();\n $this->logFiles();\n }", "public function actionLogs()\n {\n $searchModel = new ActionLogSearch();\n $pid = Yii::$app->request->queryParams['pid'];\n \n $searchModel->loadUserid(\\Yii::$app->user->id);\n if(is_numeric($pid) && $pid >0){\n //查看项目日志\n $searchModel->loadUserid(null);\n if( !\\Yii::$app->user->can('actionlog_admin') ){ \n //非日志管理员 检查项目id,不属于自己的项目,只列出自己相关日志\n $fid = Procurement::findOne($pid)->userid;\n if($fid!=\\Yii::$app->user->id){\n Yii::$app->getSession()->setFlash('info', \"由于权限设置,只列出该项目与您相关的操作日志!\");\n $searchModel->loadUserid(\\Yii::$app->user->id);\n }\n }\n $searchModel->loadPID($pid);\n }\n if(\\Yii::$app->user->can('actionlog_admin')){\n $searchModel->loadUserid(null);\n }\n \n \n $dataProvider = $searchModel->search(Yii::$app->request->queryParams,true);\n \n return $this->render('logs', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function logActivity(Request $request)\n {\n $dt = doc_activity::where('documents.id',$request->id)\n ->join('documents', 'doc_activity.documents_id', '=', 'documents.id')\n ->join('users', 'doc_activity.users_id', '=', 'users.id')\n ->select('doc_activity.*', 'documents.doc_title', 'users.name', 'users.username')\n ->get();\n // dd($dt);\n return Response::json([\n 'status' => true,\n 'length' => count($dt),\n 'data' => $dt,\n ]);\n }", "function log($event_type=null,$event=null)\r\n\t{\t\r\n\t\tif($this->xsLog)\r\n\t\t{\r\n\t\t\t$this->xsLog->log($event_type,$event,$this->_config);\r\n\t\t}\r\n\t}", "static function toLog($request) {\n //return;\n $params = $request->getParams();\n $serializer = Zend_Serializer::factory('PhpSerialize');\n $db = Zend_Registry::get('db');\n $logStat = Zend_Registry::get('Zend_LogStat');\n $auth = Zend_Auth::getInstance();\n $user_url = $_SERVER['REMOTE_ADDR'];\n //------------------\n // Получим адрес в виде: module/controller/action\n $module = $request->getModuleName();\n $controller = $request->getControllerName();\n $action = $request->getActionName();\n $url_action = \"$module/$controller/$action\";\n\n $arrLogURL = array(\n //----- Модуль=default; Контроллер=user -----\n 'default/user/view', // Открыть сообщение\n 'default/user/videos', // Играть видео\n );\n\n // Определим данные для сохранения в лог\n foreach ($arrLogURL as $urlLog) {\n switch ($urlLog) {\n case 'default/user/view': // Открыть сообщение\n if ($url_action == $urlLog) {\n $urlPost = trim($request->getUserParam('url'));\n $username = trim($request->getUserParam('username'));\n\n $arrStat = array(\n 'author' => $username,\n 'post_url' => $urlPost,\n 'user_url' => $user_url\n );\n if ($auth->hasIdentity()) {\n $identity = $auth->getIdentity();\n $arrStat['user'] = $identity->username;\n }\n\n $serialized = $serializer->serialize($arrStat);\n $logStat->post_open($serialized);\n }\n break;\n case 'default/user/videos': // Открыть сообщение\n if ($url_action == $urlLog && $params['type_action'] == 'play') {\n $clip_id = $params['clip_id'];\n\n $arrStat = array(\n 'clip_id' => $clip_id,\n 'user_url' => $user_url,\n );\n if ($auth->hasIdentity()) {\n $identity = $auth->getIdentity();\n $arrStat['user'] = $identity->username;\n }\n\n $serialized = $serializer->serialize($arrStat);\n $logStat->video_play($serialized);\n }\n break;\n default:\n break;\n }\n }\n }", "public function logRequest()\n {\n $myFile = __DIR__ . \"/../requestslog.txt\";\n $fh = fopen($myFile, 'a') or die(\"can't open file\");\n fwrite($fh, \"\\n\\n---------------------------------------------------------------\\n\");\n fwrite($fh, print_r($this->data, 1));\n fclose($fh);\n }" ]
[ "0.6469414", "0.6173936", "0.59018433", "0.58235806", "0.57498646", "0.56577116", "0.5627081", "0.5600686", "0.5584066", "0.5577462", "0.5376116", "0.5375113", "0.53405756", "0.53381526", "0.53188807", "0.5316734", "0.5315873", "0.5304515", "0.5304515", "0.52955115", "0.52826965", "0.5280199", "0.5249004", "0.5222397", "0.5218832", "0.519702", "0.51679605", "0.516754", "0.5164527", "0.5154542" ]
0.6704154
0
The errorLog() method is used to record any errors from requests to the service. A time stamp is provided along with component ID (if known depends at what stage the error occurs and the actual error message itself.
public function errorLog($comp_found, $errorMessage){ $log = "[".date('c', time())."] | ComponentID = "; if( $comp_found == true ) $log = $log.$this->_request_array['component_id']; else $log = $log."*UNKNOWN*"; $log = $log." | ErrorMessage = ".$errorMessage.".\n"; error_log($log, 3, $_SERVER['DOCUMENT_ROOT']."/globicLog/service/logs/Error_Log.txt"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function getErrorLogMessage();", "protected function _logHapiError()\n {\n if (empty($this->_logHandler)) {\n return;\n }\n\n $result = array();\n foreach ($this->_postData as $key => $value) {\n // I'm converting arguments to their type\n // (prevents passwords from ever getting logged as anything other than 'string')\n if ($key == 'password' && $key == 'secret') {\n $value = '*****';\n }\n $result[] = $key . '=' . $value;\n }\n\n $context = array(\n 'message' => $this->_hapiErrorMessage,\n 'method' => $this->getHapiMethodName(),\n 'version' => $this->_version,\n 'format' => $this->_params['format'],\n 'code' => $this->_hapiErrorCode,\n 'params' => implode(\" \", $result)\n );\n\n $this->_logHandler->addContextVar('hapi_context', $context);\n $this->_logHandler->logHttpContext('hAPI Error', 501, 'hapi_error');\n\n }", "public function logerror($sql) {\n\n //get the last error message from sql \n $msg = $this->DB->last_error();\n\n //store it in our array for access\n $this->logData[\"sql\"] = $sql;\n $this->logData[\"message\"] = $msg;\n $this->logData[\"log_timestamp\"] = date(\"Y-m-d H:i:s\");\n $this->logData[\"ip_address\"] = $_SERVER['REMOTE_ADDR']; \n if (defined(\"USER_ID\")) $this->logData[\"user_id\"] = USER_ID;\n if (defined(\"USER_LOGIN\")) $this->logData[\"user_login\"] = USER_LOGIN;\n if (defined(\"CUR_CHILD\")) $this->logData[\"child_location_id\"] = CUR_CHILD;\n $this->logData[\"post_data\"] = $this->dataToXML($_POST);\n $this->logData[\"get_data\"] = $this->dataToXML($_GET);\n $this->logData[\"category\"] = \"DB_ERROR\";\n $this->logData[\"level\"] = LOGGER_ERROR;\n\n //add it to our stack\n $this->errorStack[] = $this->logData;\n \n $this->logMsg();\n\n if (defined(\"LOG_ERROR_TASK\") && $sql) $this->logToTask();\n \n }", "function logError($message) {\n $this->log->addError($message);\n }", "function logError($error_msg) {\n}", "public function model_error_log(Exception $error_info, $query = null, $params = null)\n {\n $this->alpha_model->model_log_err($error_info, $query = null, $params = null);\n }", "public function error(){\n\t\t$this->iLog(func_get_args(),__FUNCTION__);\n\t}", "function error_log ($message, $message_type = 0, $destination = null, $extra_headers = null) {}", "public static function log_error($error) {\n\t\t$res = DashDonate::api_call('POST', '/error-log', ['error' => json_encode($error)]);\n\t\t// Return response\n\t\treturn $res;\n\t}", "static public function error($sMessage_) { self::__log($sMessage_, self::LOG_ERROR); }", "public function logError($log)\r\n\t{\r\n\t\tif($GLOBALS[\"logDb\"]) echo \"Error: \".$log;\r\n\t\terror_log($log);\r\n\t}", "public function appbuilderErrorLog($log)\n {\n $this->outputToLogger($log, Logger::LEVEL_ERROR, \"ERROR-\");\n }", "private function logResponseError()\r\n {\r\n if (isset($this->result->error)) {\r\n log_message('error', __METHOD__ . ' - ' . __LINE__ .\r\n ': Athena Health Response error: ' .\r\n print_r($this->result->error, true));\r\n $this->error = $this->result->error;\r\n }\r\n if (isset($this->result->body->error)) {\r\n log_message('error', __METHOD__ . ' - ' . __LINE__ .\r\n ': Athena Health Response Body error: ' .\r\n print_r($this->result->body->error, true));\r\n $this->error = $this->result->body->error;\r\n }\r\n if (isset($this->result->body->detailedmessage)) {\r\n log_message('error', __METHOD__ . ' - ' . __LINE__ .\r\n ': Athena Health Response Body detailedmessage: ' .\r\n print_r($this->result->body->detailedmessage, true));\r\n $this->detailedmessage = $this->result->body->detailedmessage;\r\n }\r\n if (isset($this->result->error) || isset($this->result->body->error)) {\r\n log_message('error', __METHOD__ . ' - ' . __LINE__ . ': Full Response: ' .\r\n print_r($this->response, true));\r\n //print_r($this->result);\r\n }\r\n }", "public function actionLog() \n\t{\n\t//\t$path = YiiBase::getPathOfAlias('application.runtime').'/debug.'.time().'.log';\n\t\t$fields = CJSON::decode(file_get_contents('php://input'));\n\t\t$modelClass = $this->modelClass;\n\t\t$model = new $modelClass();\n\t\t$model->error_url = isset($fields['errorUrl']) ? $fields['errorUrl'] : '(none)';\n\t\t$model->app_ident = isset($fields['appId']) ? $fields['appId'] : null;\n\t\t$model->device_ident = isset($fields['deviceId']) ? $fields['deviceId'] : null;\n\t\t$model->session_ident = isset($fields['sessionId']) ? $fields['sessionId'] : null;\n\t\t$model->type_id = isset($fields['typeId']) ? $fields['typeId'] : 0;\n\t\t$model->error_message = isset($fields['errorMessage']) ? $fields['errorMessage'] : null;\n\t\t$model->cause = isset($fields['cause']) ? $fields['cause'] : null;\n\t\t$model->user_id = isset($fields['userId']) ? $fields['userId'] : 0;\n\t\t$stack = isset($fields['stackTrace']) ? $fields['stackTrace'] : array();\n\t\t$model->stacktrace = CJSON::encode($stack);\n\t\t$state = isset($fields['state']) ? $fields['state'] : array();\n\t\t$model->state = CJSON::encode($state);\n\t\tif ($model->save()) {\n\t\t\techo 'ok';\n\t\t}\telse {\n\t\t\tthrow new CException('Could not save trace information: '.CHtml::errorSummary($model));\n\t\t}\n\t}", "function elog($string) { error_log($string.\"\\n\", 3, APP_LOG); }", "public function logerror($sql) \n {\n\n //get the last error message from sql \n $msg = $this->DB->last_error();\n\n $this->log($msg,LOGGER_ERROR,\"DB_ERROR\",$sql);\n\n }", "public function log(\n Throwable $error,\n ServerRequestInterface $request,\n ResponseInterface $response\n ) : void;", "public function logError($str)\n {\n $this->_log(func_get_args(), 'error');\n }", "function _logFailedLogin($steamid) {\n $ip = isset($_SERVER['REMOTE_HOST']) ?\n $_SERVER['REMOTE_HOST'] :\n (isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : '');\n\n if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {\n $ip = array_pop(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']));\n }\n $root = defined('ROOT_DIR') ? ROOT_DIR : (__DIR__ . '/../');\n $filename = $root . '/back/logs/' . date('d-m-y') . '.log';\n $file = new SplFileObject($filename, 'a+');\n $file->fwrite(date('h:i:s') . \" - steamid '{$steamid}' with ip '{$ip}' failed to login.\" . PHP_EOL);\n $file = null;\n}", "public function error($msg, $line, $log = \"Unknown error\") {\n\t\techo \"<h2>An error has occurred</h2>\";\n\t\techo \"<h4>\".$msg.\"</h4>\";\n\t\t$content= file_get_contents('error.log');\n\t\tfile_put_contents(\"error.log\", $content .\"\\n\". $log.\" -> at line \". $line .\" at \".date(\"d-m-Y H:i:s\"));\n\t\texit;\n\t}", "public static function errorLog(string $message, ...$contextData)\n {\n Log::error($message, $contextData);\n }", "public function error($message, $logComponent = null, array $data = [])\n {\n $this\n ->enrichLogDataByComponent($data, $logComponent)\n ->getLogger($logComponent)->error($message, $data);\n }", "public function addErrorHr($log = LOG_SYSTEM) {\n if (Config::config()['user']['debug']['log']) {\n file_put_contents(APP_LOG_PATH . $log . '.log', \"#################### END OF EXECUTION OF http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . \" ####################\\n\", FILE_APPEND | LOCK_EX);\n }\n }", "function takahama_log($logContext) {\n//\terror_log($now.\": \".$logContext.\"\\n\\r\", 3, $_SERVER['DOCUMENT_ROOT'].'/debug.log.txt');\n}", "function __errorLogging($theline = '', $thefunction = '', $thefile = '', $themessage = 'system error')\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n $message_log = \"[FILE: $thefile] [LINE: $theline] [FUNCTION: $thefunction] [MESSAGE: $themessage]\";\n log_message('error', $message_log);\n }", "private function recordErrorLog($e)\n {\n Log::init([\n \"type\" => \"File\",\n \"path\" => Config::get('app.log.path'),\n \"level\" => [\"error\"]\n ]);\n Log::record($e->getMessage(), 'error'); \n }", "public function logError($message)\n\t{\n\t\t$this->log($message, 'error');\n\t}", "private function error_log( $msg ) {\n\t \tif( self::LOGGING )\n\t \t\terror_log( $msg . \"\\n\", 3, $this->logFilePath );\n\t }", "protected function logError() {\n\t\t// check if we need to email\n\t\t// product debugging information\n\t\tthrow new PPI_Exception(\"SQL Error: \" . mysql_error($this->_connection), $this->_queries);\n\t}", "static function logger($context,$msg) {\n list($ms,$ts) = explode(' ',microtime(),2);\n $ts = date('Y-m-d H:i:s',$ts).','.substr($ms,2,static::CLOCK_PRECISION);\n error_log(\"$ts $context: $msg\\n\",3,$GLOBALS['DEBUG_LOGFILE']);\n }" ]
[ "0.6167373", "0.60445637", "0.5915466", "0.5895768", "0.58737016", "0.58379936", "0.58013314", "0.5733328", "0.56846726", "0.56806546", "0.56414974", "0.5612404", "0.5587509", "0.5532905", "0.54858106", "0.54850376", "0.54734457", "0.5472494", "0.5445157", "0.5442428", "0.54101634", "0.53991604", "0.53960466", "0.5384862", "0.5383101", "0.5371203", "0.5357144", "0.53353745", "0.5315085", "0.53094274" ]
0.6714941
0
Sets a new dec
public function setDec($dec) { $this->dec = $dec; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDec() {\n\t\treturn $this->dec_num;\n\t}", "public function set($value) {\n $this->value = number_trim(\\bcadd($value, \"0\", $this->scale));\n }", "public function setCurrency($val)\n {\n $this->_propDict[\"currency\"] = $val;\n return $this;\n }", "public function setCurrency($val)\n {\n $this->_propDict[\"currency\"] = $val;\n return $this;\n }", "public function setDecimal($decimal)\n {\n $this->decimal = $decimal;\n return $this;\n }", "public static function deciliters(): UnitVolume\n\t{\n\t\treturn new static(static::SYMBOL_DECILITERS, new UnitConverterLinear(static::COEFFICIENT_DECILITERS));\n\t}", "public function setNumber($var) {}", "public function setNumber($var) {}", "public function setNumber($var) {}", "public function setNumber($var) {}", "public function setDecimalUnsigned($precision = 10, $fraction = 0)\n {\n $this->datatype = new Datatype\\DtDecimal();\n $this->datatype->setPrecision($precision);\n $this->datatype->setFraction($fraction);\n $this->datatype->setUnsigned(true);\n return $this;\n }", "public function setNumberValue($var) {}", "public function setNum($value, $base = 10) {\n\t\t$this->num = $value;\n\t\t$this->base = $base;\n\t\t$this->dec_num = $this->calc_dec($value);\n\t}", "public function __construct(Debit $debit)\n {\n $this->debit = $debit;\n }", "public function setFormat($separatorDec = ',', $separatorTh = '.' , $size = 2)\n {\n\n $this->separatorDec = $separatorDec;\n $this->separatorTh = $separatorTh;\n $this->size = $size;\n\n }", "protected function setConvertedAmount ()\r\n\t{\r\n\t\t$this->convertedAmount = $this->buyAmount * $this->exchangeRate;\r\n\t}", "function dec(string $field, int|float $value = 1): UpdateInstruction\n{\n return new UpdateInstruction('inc', [$field => -1 * $value]);\n}", "public static function setCurrency($cookie)\n {\n }", "public function setSerialized($serialized)\n {\n $this->_currency = unserialize($serialized);\n\n }", "protected function setValue()\n {\n $value = $this->liveData->units_held * $this->liveData->sell_price;\n if($this->investment->currency->value !== 'GBP') {\n $convertor = new CurrencyConverter($this->investment->currency,'GBP');\n $value = $convertor->convert($value);\n }\n\n // Normalise the output based on knowing what units to expect\n $this->liveData->value = $value / $this->investment->priceUnits;\n }", "protected function _setVolume($val)\n {\n if ((is_integer($val) || is_float($val)) && $val >= 0) {\n $this->setDpProperty('volume', $val);\n }\n }", "function setDecimalEsp($numero){\n\t\t$numero = str_replace(\".\", \",\", $numero);\n\t\treturn $numero;\n\t}", "public function setDecay($decay)\n {\n $payload = '';\n $payload .= pack('v', $decay);\n\n $this->sendRequest(self::FUNCTION_SET_DECAY, $payload);\n }", "function setCarrera($val)\r\n\t { $this->Carrera=$val;}", "public function testSetQuantite() {\n\n $obj = new Stocks();\n\n $obj->setQuantite(10.092018);\n $this->assertEquals(10.092018, $obj->getQuantite());\n }", "public function setCurrencyCode($cur) {\r\n\t\tswitch($cur) {\r\n\t\t\tcase \"USD\":\r\n\t\t\t\t$this->setCurrency(840);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"EUR\":\r\n $this->setCurrency(978);\r\n break;\r\n case \"LBP\":\r\n $this->setCurrency(422);\r\n break;\r\n case \"GBP\":\r\n $this->setCurrency(826);\r\n break;\r\n\t\t\tdefault:\r\n\t\t\t\t$this->setCurrency($cur);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function testSetAndGetBasketCurrency()\n {\n $oBasket = $this->getProxyClass( \"oxBasket\" );\n $oCur = new stdClass();\n $oCur->name = 'testCurrencyName';\n $oCur->desc = 'testDescription';\n\n $oBasket->setBasketCurrency( $oCur );;\n\n $this->assertEquals( $oCur, $oBasket->getBasketCurrency() );\n }", "public function decimals(?int $decimals): self\n {\n $this->assetTransaction->decimals = $decimals;\n\n return $this;\n }", "public function Sumator()\n {\n $this->converter = new Converter();\n }", "function setAmount($amount);" ]
[ "0.5566026", "0.52868134", "0.5259499", "0.5259499", "0.5165878", "0.50777346", "0.50300205", "0.50300205", "0.50300205", "0.50300205", "0.5007755", "0.4993426", "0.49909264", "0.49451438", "0.49146447", "0.48924446", "0.48877302", "0.48797914", "0.4842731", "0.48308143", "0.47993448", "0.47559124", "0.47266647", "0.470961", "0.46947274", "0.4690004", "0.4688813", "0.46885693", "0.46512938", "0.46425146" ]
0.7083243
0
Sets a new stopien
public function setStopien($stopien) { $this->stopien = $stopien; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setStop($val){ return $this->setField('stop',$val); }", "public function setStop($stop) {\n $this->stop = $stop;\n return $this;\n }", "protected function stop() {\n\t$this->_stop = true;\n}", "public function stop()\n {\n $this->mustStop = true;\n }", "function stop() {\r\n $this->_stop = TRUE;\r\n }", "public function setStopwatch(Stopwatch $stopwatch)\n {\n $this->stopwatch = $stopwatch;\n }", "public static function resetStopCounter() \r\n {\r\n self::$stopCounter = null;\r\n }", "protected function _stop()\n {\n $this->core->stop = TRUE;\n }", "protected function stopTime()\n {\n $this->time = $this->getCurrentTime();\n }", "public function __construct($stopType, $commentedOut = false) {\n parent::__construct(\"Stop\", $commentedOut);\n\n $this->stopType = $stopType;\n }", "public function stop()\n {\n }", "public function stop()\n {\n }", "public function stopRecording() {\n\t\t$stopRecording = new stopRecording();\n\t\t$this->stopRecording = sprintf($stopRecording);\n\t}", "public function stop(){\n\t\t$this->running=false;\n\t}", "public function setStopwatch(Stopwatch $stopwatch = null)\n {\n $this->stopwatch = $stopwatch;\n }", "function setFailureAndStop()\n {\n $this->failed = true;\n $this->stop();\n }", "function setFailureAndStop()\n {\n $this->failed = true;\n $this->stop();\n }", "public function setBusStop($value) {\n return $this->set(self::BUS_STOP, $value);\n }", "public function setBusStop($value) {\n return $this->set(self::BUS_STOP, $value);\n }", "protected function stop($sTestId = null){\r\n\t\t\t\r\n\t\t\t$sTestId = ($sTestId === null ? $this->sCurrentTestId : (string)$sTestId);\r\n\t\t\t\t\t\t\r\n\t\t\t$this->aTests[$sTestId][$this->getLastTestIndex($sTestId)][self::KEY_STOP] = microtime(true);\t\t\t\t\r\n\t\t\t\t\r\n\t\t\treturn $this;\r\n\t\t\r\n\t\t}", "public function stop()\n\t{\n\t\t$microstop = explode(' ', microtime());\n\t\t$this->_stop_time = $microstop[0] + $microstop[1];\n\t}", "public function stop($key) \n {\n $this->stop[$key] = microtime(true);\n }", "public function stopTimer()\n {\n }", "public function setStart($var) {}", "public function setStart($var) {}", "public function setStart($var) {}", "public function stop();", "public function stop();", "public function stop();", "public function stop();" ]
[ "0.73120075", "0.6413062", "0.64099526", "0.6264653", "0.62256557", "0.61145556", "0.59069073", "0.58792186", "0.5842915", "0.58161914", "0.5744613", "0.5744613", "0.5739113", "0.57314223", "0.57016194", "0.56649935", "0.56649935", "0.5660122", "0.5660122", "0.55911356", "0.558851", "0.5544517", "0.55352867", "0.5521202", "0.5521202", "0.5521202", "0.5518429", "0.5518429", "0.5518429", "0.5518429" ]
0.68646044
1
Sets a new sekunda
public function setSekunda($sekunda) { $this->sekunda = $sekunda; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setNextSemester() {\n\t\t$date = date ( \"Y/m/d\" ); // gets the current date\n\t\t\n\t\t$dateArray = explode ( \"/\", $date ); // splits the date into year/day/month\n\t\t\n\t\tif (intval ( $dateArray [1] ) >= 8 && intval ( $dateArray [1] < 10 )) { // value for fall\n\t\t\t$this->semester ['year'] = intval ( $dateArray [0] );\n\t\t\t$this->semester ['sem'] = 30;\n\t\t} else if (intval ( $dateArray [1] ) >= 2 && intval ( $dateArray [1] < 8 )) { // value for spring\n\t\t\t$this->semester ['year'] = intval ( $dateArray [0] );\n\t\t\t$this->semester ['sem'] = 20;\n\t\t} else if (intval ( $dateArray [1] ) >= 10 && intval ( $dateArray [1] < 2 )) { // value for winter\n\t\t\t$this->semester ['year'] = intval ( $dateArray [0] );\n\t\t\t$this->semester ['sem'] = 10;\n\t\t}\n\t}", "public function setting()\n {\n $this->checkAuth();\n $dt = $this->request->getQuery('dt');\n if (isset($dt)) {\n // if (preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\", $dt)) {\n if (preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\", $dt)) {\n $date = Date('Y/m/d', strtotime('first day of this month', strtotime($dt)));\n $this->set('currentTime', $date);\n $currentDate = Date('Y/m/d', strtotime($dt));\n $initsdate = Date('Y/m/d', strtotime('first day of this month', strtotime($date)));\n $initedate = Date('Y/m/d', strtotime('last day of this month', strtotime($date)));\n } else {\n $now = new \\DateTime();\n $this->set('currentTime', $now->format('Y-m-d'));\n $currentDate = $now->format('Y-m-d');\n $initsdate = Date('Y/m/d', strtotime('first day of this month', strtotime($now->format('Y-m-d'))));\n $initedate = Date('Y/m/d', strtotime('last day of this month', strtotime($now->format('Y-m-d'))));\n }\n } else {\n $now = new \\DateTime();\n $this->set('currentTime', $now->format('Y-m-d'));\n $initsdate = Date('Y/m/d', strtotime('first day of this month', strtotime($now->format('Y-m-d'))));\n $initedate = Date('Y/m/d', strtotime('last day of this month', strtotime($now->format('Y-m-d'))));\n $currentDate = $now->format('Y-m-d');\n }\n $NurseryScheduleTable = TableRegistry::get('NurserySchedule');\n if ($this->request->is('post')) {\n $data = $this->request->data;\n $queryManage = $NurseryScheduleTable->find();\n $nurseryschedule = $queryManage->select(['id' => 'NurserySchedule.id', 'rid' => 'NurseryReserves.id', 'reserve_date' => 'NurserySchedule.reserve_date', 'approval' => 'NurseryReserves.approval' ])\n ->join(['NurseryReserves' => ['table' => 'nursery_reserves', 'type' => 'LEFT',\n 'conditions' => 'NurseryReserves.reserve_date= NurserySchedule.reserve_date']])\n ->where([\n 'NurserySchedule.reserve_date >=' => $initsdate,\n 'NurserySchedule.reserve_date <= ' => $initedate\n ])\n ->order(['NurserySchedule.reserve_date' => 'DESC']);\n\n $arrayNS = [];\n foreach ($nurseryschedule as $item) {\n if (!isset($arrayNS[$item->id])) {\n $arrayNS[$item->id] = $item;\n }\n }\n\n $validate = true;\n for ($i = 1; $i <= 31; $i++) {\n $day_ = $i < 10?'0' . $i:$i;\n if (isset($data['s_flg_' . $day_]) && $data['s_flg_' . $day_] == 0) {\n if (!isset($data['day_' . $day_])) {\n $validate = false;\n break;\n }\n }\n }\n\n if (!$validate) {\n $this->Flash->error(Configure::read('MESSAGE_NOTIFICATION.MSG_060'));\n } else {\n $updateTransaction = $NurseryScheduleTable->getConnection()->transactional(function () use ($data, $arrayNS, $NurseryScheduleTable, $nurseryschedule, $initsdate) {\n\n try {\n foreach ($nurseryschedule as $item) {\n if (!$item->rid || ($item->rid > 0 && ($item->appvoral != 1 || $item->appvoral != 0 ) )) {\n $day_ = Date('d', strtotime($item->reserve_date));\n if (!isset($data['day_' . $day_])) {\n if (isset($arrayNS[$item->id])) {\n $entity = $NurseryScheduleTable->get($item->id);\n if (isset($entity)) {\n if (!$NurseryScheduleTable->delete($entity, ['atomic' => false])) {\n $NurseryScheduleTable->getConnection()->rollback();\n\n return false;\n } else {\n unset($arrayNS[$item->id]);\n }\n }\n }\n }\n }\n }\n for ($i = 1; $i <= 31; $i++) {\n $day_ = $i < 10 ? '0' . $i : $i;\n if (isset($data['day_' . $day_]) && $data['day_' . $day_] == 0) {\n $entity = $NurseryScheduleTable->newEntity();\n $entity->reserve_date = Date('Y-m', strtotime($initsdate)) . '-' . $day_;\n $limit_date = '';\n $shorttime_flg = 0;\n $Day_Of_Week = date(\"w\", strtotime($entity->reserve_date));\n //$cancel_limit_date = Date('Y-m-d', strtotime('-2 day', strtotime($entity->reserve_date)));\n if ($Day_Of_Week == 1) {\n // 指定されたカレンダーの曜日が月の場合\n $limit_date = Date('Y-m-d', strtotime('-10 day', strtotime($entity->reserve_date)));\n } elseif ($Day_Of_Week > 0) {\n // 指定されたカレンダーの曜日が火・水・木・金・土の場合\n $limit_date = Date('Y-m-d', strtotime('-8 day', strtotime($entity->reserve_date)));\n } else {\n // 指定されたカレンダーの曜日が日の場合\n $limit_date = Date('Y-m-d', strtotime('-9 day', strtotime($entity->reserve_date)));\n }\n if (isset($data['s_flg_' . $day_]) && $data['s_flg_' . $day_] == 0) {\n $shorttime_flg = 1;\n }\n if ($Day_Of_Week == 0) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-4 day', strtotime($entity->reserve_date)));\n } elseif (in_array($Day_Of_Week, [1, 2, 3])) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-5 day', strtotime($entity->reserve_date)));\n } elseif (in_array($Day_Of_Week, [4, 5, 6])) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-3 day', strtotime($entity->reserve_date)));\n }\n\n $entity->limit_date = $limit_date;\n $entity->shorttime_flg = $shorttime_flg;\n $entity->cancel_limit_date = $cancel_limit_date;\n $entity->created_id = $this->LOGINID;\n $entity->created_date = date('Y-m-d H:i:s');\n $entity->modified_id = $this->LOGINID;\n $entity->modified_date = date('Y-m-d H:i:s');\n if (!$NurseryScheduleTable->save($entity, ['atomic' => false])) {\n $NurseryScheduleTable->getConnection()->rollback();\n\n return false;\n }\n } elseif (isset($data['day_' . $day_]) && $data['day_' . $day_] > 0) {\n if (isset($data['s_flg_' . $day_]) && $data['s_flg_' . $day_] == 0) {\n $entity = $NurseryScheduleTable->get($data['day_' . $day_]);\n $cancel_limit_date = $entity->reserve_date;\n $Day_Of_Week = date(\"w\", strtotime($entity->reserve_date));\n if ($Day_Of_Week == 0) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-4 day', strtotime($entity->reserve_date)));\n } elseif (in_array($Day_Of_Week, [1, 2, 3])) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-5 day', strtotime($entity->reserve_date)));\n } elseif (in_array($Day_Of_Week, [4, 5, 6])) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-3 day', strtotime($entity->reserve_date)));\n }\n if (isset($entity)) {\n $entity->shorttime_flg = 1;\n $entity->cancel_limit_date = $cancel_limit_date;\n $entity->modified_id = $this->LOGINID;\n $entity->modified_date = date('Y-m-d H:i:s');\n if (!$NurseryScheduleTable->save($entity, ['atomic' => false])) {\n $NurseryScheduleTable->getConnection()->rollback();\n\n return false;\n }\n }\n } elseif (!isset($data['s_flg_' . $day_])) {\n $entity = $NurseryScheduleTable->get($data['day_' . $day_]);\n $Day_Of_Week = date(\"w\", strtotime($entity->reserve_date));\n if ($Day_Of_Week == 0) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-4 day', strtotime($entity->reserve_date)));\n } elseif (in_array($Day_Of_Week, [1, 2, 3])) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-5 day', strtotime($entity->reserve_date)));\n } elseif (in_array($Day_Of_Week, [4, 5, 6])) {\n $cancel_limit_date = Date('Y-m-d', strtotime('-3 day', strtotime($entity->reserve_date)));\n }\n if (isset($entity)) {\n $entity->shorttime_flg = 0;\n $entity->cancel_limit_date = $cancel_limit_date;\n $entity->modified_id = $this->LOGINID;\n $entity->modified_date = date('Y-m-d H:i:s');\n if (!$NurseryScheduleTable->save($entity, ['atomic' => false])) {\n $NurseryScheduleTable->getConnection()->rollback();\n\n return false;\n }\n }\n }\n }\n }\n } catch (RecordNotFoundException $e) {\n $NurseryScheduleTable->getConnection()->rollback();\n\n return false;\n }\n\n return true;\n });\n if ($updateTransaction) {\n $this->Flash->success(Configure::read('MESSAGE_NOTIFICATION.MSG_028'));\n } else {\n $this->Flash->error(Configure::read('MESSAGE_NOTIFICATION.MSG_031'));\n }\n }\n }\n $queryManage = $NurseryScheduleTable->find();\n $nurseryschedule = $queryManage->select(['id' => 'NurserySchedule.id', 'rid' => 'NurseryReserves.id',\n 'cancel_limit_date' => 'NurserySchedule.cancel_limit_date', 'shorttime_flg' => 'NurserySchedule.shorttime_flg',\n 'reserve_date' => 'NurserySchedule.reserve_date', 'approval' => 'NurseryReserves.approval' ])\n ->join(['NurseryReserves' => ['table' => 'nursery_reserves', 'type' => 'LEFT',\n 'conditions' => 'NurseryReserves.reserve_date = NurserySchedule.reserve_date']])\n ->where([\n 'NurserySchedule.reserve_date >=' => $initsdate,\n 'NurserySchedule.reserve_date <= ' => $initedate])\n\n ->order(['NurserySchedule.reserve_date' => 'DESC']);\n $this->set(compact([ 'nurseryschedule']));\n $this->set(['currentDate', $currentDate]);\n }", "private function createSepaMandate() {\n $mandate = $this->getMandates();\n if ($mandate['count'] > 0) {\n $set = reset($mandate['values']);\n $this->values['id'] = $set['id'];\n }\n\n civicrm_api3('SepaMandate', 'create', $this->values, true);\n }", "function setSchedule()\r\n {\r\n\r\n }", "public function setTime()\n {\n $this->send(\"SETT,\".date(\"H,i\"));\n }", "public function setSeconds($var) {}", "public function setSeconds($var) {}", "function set_date ($valor)\n {\n $this->date = $valor;\n }", "public function setValue($value)\n\t{\n\t\tif (is_array($value)\n && (isset($value['tstart'])\n && isset($value['tend'])\n\t\t\t)\n ) {\n $this->setStart($value['tstart'])\n ->setEnd($value['tend']);\n\n\t\t\tif (isset($value['number'])) {\n\t\t\t\t$this->setNumber($value['number']);\n\t\t\t}\n\n\t\t\tif (isset($value['type'])) {\n\t\t\t\t$this->setType($value['type']);\n\t\t\t}\n } else {\n\t\t\tthrow new Exception('Invalid default timeslot value provided');\n }\n\n\t}", "public function setScheduledDate($ts);", "function setTemporada($stemporada = '')\n {\n $this->stemporada = $stemporada;\n }", "public function setDatetitu($datetitu)\n{\n$this->datetitu = $datetitu;\n\n}", "function _ts_handler($m) {\n\t\t$qnum = $this->qnum;\n\t\t$tsid = $qnum.$this->count;\n\t\t$field = <<<HTML\n<input id=\"$tsid\" name=\"{$this->_set_name()}\" class=\"{$this->_set_class()}\"\n onchange=\"{$this->_set_setter()}\" size=\"20\" />\n<a href=\"javascript:void(0);\" onclick=\"set_timestamp('$qnum',0);\">set to now</a>\nHTML;\n\t\t$this->_ins_field($m[1],$field);\n\t}", "function inicializa(){\n $this->sem=array('Sun'=>1,'Mon'=>2,'Tue'=>3,'Wed'=>4,'Thu'=>5,'Fri'=>6,'Sat'=>7);\n $this->mes=array('1'=>'JANEIRO','2'=>'FEVEREIRO','3'=>'MARÇO','4'=>'ABRIL','5'=>'MAIO','6'=>'JUNHO','7'=>'JULHO','8'=>'AGOSTO','9'=>'SETEMBRO','10'=>'OUTUBRO','11'=>'NOVEMBRO','12'=>'DEZEMBRO');\n }", "public function setValueToday()\r\n\t{\r\n\t\t$this->setValue(date('H:i'));\r\n\t}", "public function setHoraSalida($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->hora_salida !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->hora_salida !== null && $tmpDt = new DateTime($this->hora_salida)) ? $tmpDt->format('H:i:s') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('H:i:s') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->hora_salida = ($dt ? $dt->format('H:i:s') : null);\n\t\t\t\t$this->modifiedColumns[] = SfGuardUserProfilePeer::HORA_SALIDA;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "public function setValue($s) {$this->_value = $s;}", "public function run()\n {\n $settings = new Settings;\n $settings->editing_days = 2;\n $settings->save(); \n }", "private function updated() {\n $this->ultimaActualizacion= new \\DateTime(\"now\");\n }", "public function setCurrentTime($time)\n {\n $this->time = $time;\n }", "private function carregarListaDiasSemana() {\n $diasSemana = ['Domingo' => 'Domingo',\n 'Segunda-feira' => 'Segunda-feira',\n 'Terça-feira' => 'Terça-feira',\n 'Quarta-feira' => 'Quarta-feira',\n 'Quinta-feira' => 'Quinta-feira',\n 'Sexta-feira' => 'Sexta-feira',\n 'Sábado' => 'Sábado'];\n $this->set(compact('diasSemana'));\n }", "private function setValues()\n\t{\n\t\t$this->day = date('d', $this->timestamp);\n\t\t$this->month = date('m', $this->timestamp);\n\t\t$this->year = date('Y', $this->timestamp);\n\t\t$this->hour = date('H', $this->timestamp);\n\t\t$this->minute = date('i', $this->timestamp);\n\t\t$this->second = date('s', $this->timestamp);\n\t\t$this->dateFormat = GlobalConfiguration::get('dateTime.date.format');\n\t\t$this->timeFormat = GlobalConfiguration::get('dateTime.time.format');\n\t}", "public function setChart() {\n $Data = getdate();\n $this->AnoAtual = $Data['year'];\n\n// Insere 0 em todas os indicies da $arrPropostas e $arrContratos\n for ($i = 0, $EntradasAVencer = [], $EntradasPagas = [], $ParcelasAVencer = [], $ParcelasPagas = [], $arrTotalAVencer = [], $arrTotalPago = []; $i < 12; $i++):\n $EntradasAVencer[$i] = 0;\n $EntradasPagas[$i] = 0;\n $ParcelasAVencer[$i] = 0;\n $ParcelasPagas[$i] = 0;\n $arrTotalAVencer[$i] = 0;\n $arrTotalPago[$i] = 0;\n endfor;\n\n $this->EntradasAVencer = $EntradasAVencer;\n $this->EntradasPagas = $EntradasPagas;\n $this->ParcelasAVencer = $ParcelasAVencer;\n $this->ParcelasPagas = $ParcelasPagas;\n $this->arrTotalAVencer = $arrTotalAVencer;\n $this->arrTotalPago = $arrTotalPago;\n }", "public function setSemestreInicio($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->semestre_inicio !== $v) {\n\t\t\t$this->semestre_inicio = $v;\n\t\t\t$this->modifiedColumns[] = TbcursoversaoPeer::SEMESTRE_INICIO;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setSlutdatum($arg) {\n $this->slutdatum = $arg;\n }", "private function setCurrentPoint() {\r\n $last = $this->interval == OPT_TREND_DAY ? explode(' ', $this->end) : array($this->end);\r\n $first = new DateTime($last[0]);\r\n $first->sub(new DateInterval($this->datesub));\r\n $this->currentpoint = $first->format('Y-m-d H:i:s');\r\n }", "public function setValue($value)\r\n\t{\r\n\t\tif (is_null($value)) {\r\n\t\t\t$this->hora = null;\r\n\t\t\t$this->minuto = null;\r\n\t\t} else {\r\n\t\t\t$arr = getdate(strtotime($value));\r\n\t\t\t$this->hora = $arr['hours'];\r\n\t\t\t$this->minuto = $arr['minutes'];\r\n\t\t}\r\n\t}", "function setTime($date){\r\n\r\n\t}", "function setToCurrentWeek() {\n $_SESSION[\"todaydate\"] = date('Ymd');\n $_SESSION[\"mondate\"] = findMonDate($_SESSION[\"todaydate\"]);\n $_POST[\"currentweek\"] = null;\n }", "public function setDay(\\stdClass $data)\n {\n $this->day = Period::createFromJson($data);\n }" ]
[ "0.5679803", "0.56644726", "0.5599799", "0.55676377", "0.5271119", "0.52472323", "0.52472323", "0.5151539", "0.5105221", "0.50696313", "0.5048628", "0.50468826", "0.50451815", "0.49888393", "0.49417657", "0.49222553", "0.49152476", "0.49054497", "0.48912263", "0.48839605", "0.48739982", "0.48593792", "0.4845044", "0.4840863", "0.48373222", "0.4824407", "0.4818372", "0.48172534", "0.4816268", "0.48144415" ]
0.67990726
0
Supersimple AWS CloudFront Invalidation Script Steps: 1. Set your AWS access_key 2. Set your AWS secret_key 3. Set your CloudFront Distribution ID 4. Define the batch of paths to invalidate 5. Run it on the commandline with: php cfinvalidate.php The author disclaims copyright to this source code. Details on what's happening here are in the CloudFront docs: From:
public function invalidate() { $distribution = $this->distribution; $epoch = date('U'); $paths = ''; foreach ($this->invalidatePaths as $path) { $files=CFileHelper::findFiles(realpath($path)); foreach($files as $file) { $file_rel = substr($file, strlen(Yii::getPathOfAlias('webroot'))); $paths .= " <Path>".$file_rel."</Path>\n"; } } $xml = <<<EOT <InvalidationBatch> $paths <CallerReference>{$distribution}{$epoch}</CallerReference> </InvalidationBatch> EOT; /** * You probably don't need to change anything below here. */ $len = strlen($xml); $date = gmdate('D, d M Y G:i:s T'); $sig = base64_encode( hash_hmac('sha1', $date, $this->secretKey, true) ); $msg = "POST /2010-11-01/distribution/{$distribution}/invalidation HTTP/1.0\r\n"; $msg .= "Host: cloudfront.amazonaws.com\r\n"; $msg .= "Date: {$date}\r\n"; $msg .= "Content-Type: text/xml; charset=UTF-8\r\n"; $msg .= "Authorization: AWS {$this->accessKey}:{$sig}\r\n"; $msg .= "Content-Length: {$len}\r\n\r\n"; $msg .= $xml; $fp = fsockopen('ssl://cloudfront.amazonaws.com', 443, $errno, $errstr, 30 ); if (!$fp) { die("Connection failed: {$errno} {$errstr}\n"); } fwrite($fp, $msg); $resp = ''; while(! feof($fp)) { $resp .= fgets($fp, 1024); } fclose($fp); echo $resp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drush_provision_s3_provision_install_validate() {\n if (_provision_s3_enabled()) {\n return d()->service('s3')->install_validate();\n }\n}", "function aws_request($parameters) {\n global $Aserver; //information about AWS servers\n global $locale; //which server to use?\n global $show_url; //show the URL that is send to AWS?\n global $tab; //current tabulation for printing HTML\n global $Amicrotime; //for debugging the time consumption of parts of the script\n global $jaap; //my own debugging flag. When you are running the script it should be false\n global $public_key; //your public key in etc.php\n global $private_key; //your private key in etc.php\n\n if ($jaap) print_array($parameters);\n//echo \"public_key=$public_key<br />\\n\";\n//echo \"private_key=$private_key<br />\\n\";\n //20090623: The signed request version requires these two parameters:\n //$public_key=\"xxxxxx\"; //you have to get this from Amazon on page https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key\n //$private_key=\"xxxxxx\"; //you have to get this from Amazon on page https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key\n //i have to keep my own private_key secret so I can't list it here, sorry\n if (!isset($public_key) or !$public_key or !isset($private_key) or !$private_key) {\n die(\"You don't seem to have a proper etc.php file. So please remove (rename) it and see what this script says.\");\n }\n //this will create the filename for the cache file\n //it should only contain non-static search parameters and not static data for your site\n if ($jaap) echo \"locale=$locale<br />\"; \n $ext=$Aserver[$locale]['ext']; //extension of server, see data.php\n $file_data=$ext;\n ksort($parameters);\n if ($jaap) {\n print_array($parameters);\n }\n foreach ($parameters as $i=>$d) {\n $file_data.='&'.$i.'='.$d;\n }\n if ($jaap) echo \"ext=$ext<br />\"; \n $file=aws_signed_request($ext,$parameters,$public_key,$private_key); //20090804: sign the request\n \n if (isset($show_url) and $show_url) {\n echo $tab.\"<hr />\\n\";\n echo $tab.\"this is because of show_url-flag induced debugging:<br />\\n\";\n echo $tab.\"<p />\\n\";\n echo $tab.\"Request data:<br />\\n\";\n echo $tab.\"$file_data<br />\\n\";\n echo $tab.\"<p />\\n\";\n echo $tab.\"Asking Amazon's XML interface for URL:<br />\\n\";\n echo $tab.\"$file<br />\\n\";\n echo $tab.\"<hr />\\n\";\n }\n \n //do you want to use caching?\n $cache_time=3600; //60s*60m=1h, in seconds how long a cache entry may be used\n //Use 0 for no caching\n //Amazon requires a maximum of one day for most data,\n //but unfortunately only one hour for prices, I think.\n \n $time0=time();\n \n $Amicrotime['cache read'][0]=getmicrotime(); //time before reading cache\n \n $cachedir='cache/'; //directory where to cache things.\n //make sure the script can make this directory or make it yourself and give it the right permissions so the script can read and write in the directory.\n //under Unix: chmod a+rw cache\n //If you don't want the contents of the directory to be accessible via the WWW, put the directory outside of the WWW-pages tree, like in /tmp or a level higher: ../\n \n if (file_exists($cachedir) and is_dir($cachedir)) {\n //Okay: directory already exists\n }\n else {\n if (mkdir($cachedir)) {\n //echo $tab.\"cache directory created<br />\\n\";\n }\n else die(\"can't make cache directory\");\n }\n if (is_readable($cachedir) && is_writable($cachedir)) {\n //Okay: directory is readable and writable by the script\n }\n else {\n die(\"cache directory is not readable and writable\");\n }\n \n if ($jaap) {\n $cache_time=0; //don't cache\n }\n \n //first we clean out the cache\n //(20091105: this can be written more compact using a new dir function...)\n if ($cache_time and $hd=opendir($cachedir)) {\n while ($fn=readdir($hd)) {\n if ($time0-filemtime($cachedir.$fn)>=$cache_time) { //is the file too old?\n if (!($fn=='.' or $fn=='..')) unlink($cachedir.$fn); //remove it\n }\n }\n closedir($hd);\n }\n \n //this is the actual program, it does:\n //- send the request using fopen()\n //- read the returned data into an XML string\n //- convert the XML string into an array\n //- print the array\n \n //$cache_file_name=$cache.md5($file); //determine the name of the cache file for the current request\n $cache_file_name=$cachedir.$file_data; //determine the name of the cache file for the current request\n if ($jaap) echo $tab.\"file_data=$file_data<br />\\n\";\n \n //if ($cache_time and //are we caching?\n // is_readable($cache_file_name) and //file already readable in cache?\n // $hf=fopen($cache_file_name,'r')) { //can it be opened?\n // $A=unserialize(fread($hf,filesize($cache_file_name)));\n // fclose($hf);\n // $Amicrotime['cache'][1]=getmicrotime(); //time after reading cache\n //}\n if ($cache_time and //are we caching?\n file_exists($cache_file_name) and //file already in cache? should be readable\n $filecontents=file_get_contents($cache_file_name)) { //file already in cache?\n //echo $tab.\"filecontents:<pre>\".htmlentities($filecontents).\"</pre><br />\\n\";\n $Amicrotime['cache read'][1]=getmicrotime(); //time after reading cache\n }\n else {\n $Amicrotime['cache read'][1]=getmicrotime(); //time after using cache and requesting AWS\n $Amicrotime['AWS' ][0]=getmicrotime(); //time after using cache and requesting AWS\n //if your provider doesn't allow file_get_contents() on foreign files,\n //uncomment the next lines instead:\n //20080730: Sorry haven't retested the above code lately\n //$session=curl_init($file);\n //curl_setopt($session,CURLOPT_HEADER,false);\n //curl_setopt($session,CURLOPT_RETURNTRANSFER,true);\n //$sfile=curl_exec($session);\n //curl_close($session);\n if ($filecontents=file_get_contents($file)) { //get the file from Amazon, did we succeed?\n $Amicrotime['AWS'][1]=getmicrotime(); //time after getting AWS data\n if ($cache_time) { //are we caching?\n $Amicrotime['cache write'][0]=getmicrotime(); //time before writing to cache\n file_put_contents($cache_file_name,$filecontents); //write the cache file\n $Amicrotime['cache write'][1]=getmicrotime(); //time after writing to cache\n }\n }\n else die(xu(\"can't get data from Amazon\").\".\\n\");\n }\n \n //debug: want to see the XML?\n //you can easily use this debugging tool by adding '&show_xml=1' to the URL of this script\n if (isset($show_xml) and $show_xml) { //print the raw XML for debuggging?\n echo $tab.\"showing the xml:<br />\\n\";\n echo $tab.\"<pre>\\n\";\n echo $tab.htmlentities($filecontents); //print the file\n echo $tab.\"</pre>\\n\";\n echo $tab.\"<hr />\\n\";\n }\n \n $Amicrotime['XML'][0]=getmicrotime(); //time before XML decoding\n \n //decode the XML:\n if ($A=simplexml_load_string($filecontents)); //decode the XML to an object\n else die(\"can't decode the XML data\");\n \n $Amicrotime['XML'][1]=getmicrotime(); //time after XML decoding\n return $A;\n}", "public function validateDestination()\n {\n /// check for bucket existance\n /// check for bucket list-read-write\n /// ? check cloudfront somehow\n }", "function _validateParams(array $request, array $needed) {\n global $KeyPublic, $KeyEncoding, $KeyRevoked;\n\n // add login credentials to be checked always:\n // sid (service provider id)\n // spwd (service provider password)\n array_push($needed, \"sid\", \"spwd\");\n\n // Check if all needed values are existing in the request\n foreach($needed as $param) {\n if (!array_key_exists($param, $request)) {\n _generateError($request, EC_MISSING_PARAMETERS, \n \"Missing mandatory value $param\");\n return false;\n }\n }\n\n // validate encrypted data if needed\n // must be receipt:cs:iv:payload, where iv must be hex encoded and cs\n // must be 2 characters\n // maximum length of all is 15MB\n if (in_array(\"data\", $needed)) {\n if (strlen($request[\"data\"]) > MAX_DATA_SIZE * 1024) {\n _generateError($request, EC_INVALID_SIZE, \n \"Size of data > \".MAX_DATA_SIZE.\"KB\");\n return false;\n }\n $data = explode(\":\", $request[\"data\"]);\n if (count($data) != 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting 4 parts receipt:cs:iv:payload)\");\n return false;\n }\n if (strlen($data[0]) < 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid recipt (expecting 4 characters minimum)\");\n return false;\n }\n if (strlen($data[1]) != 2) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid checksum (expecting 2 characters)\");\n return false;\n }\n if (!validateHEX($data[2])) { // hint: empty string is also not hex!\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting hex iv)\");\n return false;\n }\n if (strlen($data[3]) < 4) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid data encoding (expecting some payload > 4 characters)\");\n return false;\n }\n }\n\n // validate pkey value if needed \n // (only for future ECC implementation)\n /*\n if (in_array(\"pkey\", $needed)) {\n $pkey = $request[\"pkey\"];\n if (!array_key_exists($pkey, $KeyPublic)) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid pkey value\");\n return false;\n }\n if ($KeyRevoked[$pkey] == TRUE) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Revoked pkey\");\n return false;\n }\n }\n */\n\n // validate pid value(s) if needed\n if (in_array(\"pid\", $needed)) {\n $pids = explode(\" \", $request[\"pid\"]);\n foreach ($pids as $pid) {\n if (!validateHEX($pid)) {\n _generateError($request, EC_INVALID_ENCODING, \n \"Invalid pid value (expecting pid to be hex)\");\n return false;\n }\n }\n }\n\n // validate login\n $sql = \"SELECT password FROM provider WHERE providerid=?\";\n $res = GetOneSQLValue($sql, array($request[\"sid\"]));\n if ($res == 0) {\n _generateError($request, EC_INVALID_CREDENTIALS, \n \"Invalid sid (service provider id)\");\n return false;\n }\n $pwd = $res[\"password\"];\n if ($pwd != $request[\"spwd\"]) {\n _generateError($request, EC_INVALID_CREDENTIALS, \n \"Invalid spwd (service provider password)\");\n return false;\n }\n\n return true;\n}", "function aws_signed_request($params, $region = null): string\n{\n \n /*\n Parameters:\n $params - an array of parameters, eg. array(\"Operation\"=>\"ItemLookup\",\n \"ItemId\"=>\"B000X9FLKM\", \"ResponseGroup\"=>\"Small\")\n */\n\n global $config;\n \n // some paramters\n $method = \"GET\";\n $host = \"ecs.amazonaws.\".($region ? $region : awsGetRegion());\n $uri = \"/onca/xml\";\n \n // TODO this hard-coded optin name should be moved to engined.php\n $public_key = $config['amazonaws'.AWS_KEY];\n $private_key = $config['amazonaws'.AWS_SECRET_KEY];\n\n // additional parameters\n $params[\"Service\"] = \"AWSECommerceService\";\n $params[\"AWSAccessKeyId\"] = $public_key;\n\t// Associate tag hack\n\t// TODO check proper associate tag\n\t$params[\"AssociateTag\"] = 'videoDB';\n // GMT timestamp\n $params[\"Timestamp\"] = gmdate(\"Y-m-d\\TH:i:s\\Z\");\n // API version\n $params[\"Version\"] = \"2009-03-31\";\n \n // sort the parameters\n ksort($params);\n \n // create the canonicalized query\n $canonicalized_query = array();\n foreach ($params as $param=>$value)\n {\n $param = str_replace(\"%7E\", \"~\", rawurlencode($param));\n $value = str_replace(\"%7E\", \"~\", rawurlencode($value));\n $canonicalized_query[] = $param.\"=\".$value;\n }\n $canonicalized_query = implode(\"&\", $canonicalized_query);\n \n // create the string to sign\n $string_to_sign = $method.\"\\n\".$host.\"\\n\".$uri.\"\\n\".$canonicalized_query;\n \n // calculate HMAC with SHA256 and base64-encoding\n $signature = base64_encode(hash_hmac(\"sha256\", $string_to_sign, $private_key, True));\n \n // encode the signature for the request\n $signature = str_replace(\"%7E\", \"~\", rawurlencode($signature));\n \n // create request\n $request = \"http://\".$host.$uri.\"?\".$canonicalized_query.\"&Signature=\".$signature;\n \n return $request;\n}", "public function validate() {\n\t\t$gpg = new gnupg();\n\t\t// We assume that the pubkey file that was signed is equal to the uploaded pubkey + a single newline\n\t\t$line_endings = array(\"\\n\", \"\\r\\n\", \"\\r\", \"\"); // Endings to try in order of expected likelihood\n\t\tforeach($line_endings as $line_ending) {\n\t\t\t$info = $gpg->verify($this->public_key->export().$line_ending, $this->signature);\n\t\t\tif(is_array($info)) {\n\t\t\t\t$sig = reset($info);\n\t\t\t\tif($sig['validity'] > 0) break;\n\t\t\t} else {\n\t\t\t\tthrow new InvalidArgumentException(\"Signature doesn't seem valid\");\n\t\t\t}\n\t\t}\n\t\tif($sig['validity'] == 0) {\n\t\t\t#throw new InvalidArgumentException(\"Signature doesn't validate against pubkey\");\n\t\t}\n\t\t$this->fingerprint = $sig['fingerprint'];\n\t\t$this->sign_date = gmdate('Y-m-d H:i:s', $sig['timestamp']);\n\t}", "public function invalidateAll(): void\n {\n // Cache invalidation for ALL records via CDN would be done here\n }", "function verify() {\n parent::verify();\n if ($this->context->type == 'site') {\n // Create the configuration file directory.\n provision_file()->create_dir($this->server->cdn_config_path, dt(\"NginX CDN\"), 0700);\n // Sync the directory to the remote server if needed.\n $this->sync($this->server->cdn_config_path);\n }\n }", "public function invalidate($keys){\n if (!is_array($keys)){\n $keys = array($keys);\n }\n \n $date = gmdate('D, d M Y H:i:s \\G\\M\\T');\n $requestUrl = sprintf('%s/2010-11-01/distribution/%s/invalidation', $this->_serviceUrl, $this->_distributionId);\n \n //Assemble request body\n $body = '<InvalidationBatch>';\n foreach($keys as $key){\n $key = (preg_match('/^\\//', $key)) ? $key : '/' . $key;\n $body .= sprintf('<Path>%s</Path>', $key);\n }\n $body .= sprintf('<CallerReference>%s</CallerReference>', time());\n $body .= '</InvalidationBatch>';\n \n //Make and send request\n $client = new Zend_Http_Client($requestUrl);\n $client->setMethod(Zend_Http_Client::POST);\n $client->setHeaders(array(\n 'Date' => $date,\n 'Authorization' => $this->makeKey($date)\n ));\n $client->setEncType('text/xml');\n $client->setRawData($body);\n \n $response = $client->request();\n \n return ($response->getStatus() === 201);\n }", "function processKeyInsert($params)\n {\n $query = \"insert into SSLKey(id, clientId, startDate, endDate, name, email) values(\\\"\" . $params[\"keyId\"] . \"\\\",\" . \n \"\\\"\" . $params[\"clientId\"] . \"\\\",\" .\n \"\\\"\" . $params[\"startDate\"] . \"\\\",\" .\n \"\\\"\" . $params[\"endDate\"] . \"\\\",\" .\n \"\\\"\" . $params[\"propName\"] . \"\\\",\" . \n \"\\\"\" . $params[\"propEmail\"] . \"\\\")\";\n $result = $this->configDB->query($query);\n $result->freeResult();\n\n // convert date from YYYY-MM-DD [HH:MM:SS] to YYMMDDHHMMSSU \n // @see openssl ca manual page for startdate and enddate parameters\n $startDate = strftime(\"%y%m%d%H%M%S\", strtotime($params[\"startDate\"])) . \"Z\";\n $endDate = strftime(\"%y%m%d%H%M%S\", strtotime($params[\"endDate\"])) . \"Z\";\n\n // create the key file with the CA signature\n exec(SCRIPTSPATH . \"/clientManageKey.sh add \" . $params[\"keyId\"] . \" \" . $params[\"clientId\"] . \" \" . $startDate . \" \" . $endDate);\n\n return array( $params );\n }", "protected function ensureKeys($list, $required) {\n\t\tforeach($required as $require) {\n\t\t\tif(!isset($list[$require])) {\n\t\t\t\tthrow new APIException(\"Invalid API Usage\", APIException::INVALID_API_USAGE);\n\t\t\t}\n\t\t}\n\t}", "private function generateCSP() {\n //foreach($this->policy as $directive) {\n // $key = key($directive);\n // array_unique($directive);\n //}\n $bar = array();\n while($directive = current($this->policy)) {\n $foo = array();\n $key = key($this->policy);\n $new = $this->policy[$key];\n foreach($new as $value) {\n if(! in_array(trim($value), $foo)) {\n $foo[] = trim($value);\n }\n }\n $bar[$key] = $foo;\n next($this->policy);\n }\n\n $this->cspstring = 'default-src ' . implode(' ', $bar['default-src']);\n if(isset($bar['script-src'])) {\n $this->cspstring .= '; script-src ' . implode(' ', $bar['script-src']);\n }\n if(isset($bar['object-src'])) {\n $this->cspstring .= '; object-src ' . implode(' ', $bar['object-src']);\n }\n if(isset($bar['img-src'])) {\n $this->cspstring .= '; img-src ' . implode(' ', $bar['img-src']);\n } else {\n $this->cspstring .= '; img-src *';\n }\n if(isset($bar['media-src'])) {\n $this->cspstring .= '; media-src ' . implode(' ', $bar['media-src']);\n }\n if(isset($bar['child-src'])) {\n $this->cspstring .= '; child-src ' . implode(' ', $bar['child-src']);\n }\n //$this->cspstring .= '; child-src *';\n if(isset($bar['frame-ancestors'])) {\n $this->cspstring .= '; frame-ancestors ' . implode(' ', $bar['frame-ancestors']);\n } else {\n $this->cspstring .= \"; frame-ancestors 'self'\";\n }\n if(isset($bar['font-src'])) {\n $this->cspstring .= '; font-src ' . implode(' ', $bar['font-src']);\n }\n if(isset($bar['connect-src'])) {\n $this->cspstring .= '; connect-src ' . implode(' ', $bar['connect-src']);\n }\n if(isset($bar['form-action'])) {\n $this->cspstring .= '; form-action ' . implode(' ', $bar['form-action']);\n }\n if(isset($bar['style-src'])) {\n $this->cspstring .= '; style-src ' . implode(' ', $bar['style-src']);\n }\n //hack for firefox\n if(isset($bar['frame-src'])) {\n $this->cspstring .= '; frame-src ' . implode(' ', $bar['frame-src']);\n }\n /* I need to study these next three */\n if(isset($bar['plugin-types'])) {\n $this->cspstring .= '; plugin-types ' . implode(' ', $bar['plugin-types']);\n }\n //$this->cspstring .= '; plugin-types *'; // . implode(' ', $bar['plugin-types']);\n if(isset($bar['reflected-xss'])) {\n $this->cspstring .= '; reflected-xss ' . implode(' ', $bar['reflected-xss']);\n }\n if(isset($bar['sandbox'])) {\n $this->cspstring .= '; sandbox ' . implode(' ', $bar['sandbox']);\n }\n /* I do not suggest using below */\n if(isset($bar['report-uri'])) {\n $this->cspstring .= '; report-uri ' . end($bar['report-uri']);\n }\n }", "function wasabi_s3_client_args( $args ) {\n\t\t$args['endpoint'] = 'https://s3.eu-central-1.wasabisys.com';\n\t\t$args['region'] = 'eu-central-1';\n\t\t$args['use_path_style_endpoint'] = true;\n\n\t\treturn $args;\n\t}", "function cservaustin_enqueue_front_scripts()\n{\n wp_enqueue_script('main-script', get_stylesheet_directory_uri() . '/js/main-c-serv-file.js', array('jquery'), (string)rand(), true);\n\n wp_enqueue_script('recaptcha-script', 'https://www.google.com/recaptcha/api.js?render=' . RECAPTCHA_SITE_KEY , array(), null, false);\n wp_localize_script('recaptcha-script', 'recaptcha', array(\n 'siteKey' => RECAPTCHA_SITE_KEY,\n ));\n}", "function validateCache($id) {\n // RG2 should tidy up for itself but\n // 1) delete cache if this is a new version of the API just in case\n // 2) delete cache if associated txt files have changed: probably someone using RG1\n if (!file_exists(KARTAT_DIRECTORY.'/cache')) {\n //rg2log(\"No cache directory\");\n return;\n }\n \n $apitimestamp = filemtime(__FILE__);\n //rg2log(\"API file mod date \".$apitimestamp);\n $cachedirtimestamp = filemtime(CACHE_DIRECTORY.'.');\n //rg2log(\"Cache dir mod date \".$cachedirtimestamp);\n if ($apitimestamp >= $cachedirtimestamp) {\n //rg2log(\"Flush cache: API script file has been updated\");\n @array_map('unlink', glob(CACHE_DIRECTORY.\"*.json\"));\n return;\n }\n // catches events added via RG1 manager, which has been seen to happen\n // delete everything just to be sure\n if (is_file(KARTAT_DIRECTORY.'kisat.txt')) {\n if (filemtime(KARTAT_DIRECTORY.'kisat.txt') >= $cachedirtimestamp) {\n rg2log(\"Flush cache: kisat.txt file has been updated\");\n @array_map('unlink', glob(CACHE_DIRECTORY.\"*.json\"));\n return;\n }\n }\n \n // catches routes added via RG1 to an event with RG2 installed which is conceivable but very unlikely\n // base decision on kilpailijat only which seems reasonable enough\n if ((is_file(CACHE_DIRECTORY.'results_'.$id.'.json')) && is_file(KARTAT_DIRECTORY.'kilpailijat_'.$id.'.txt')) {\n if (filemtime(KARTAT_DIRECTORY.'kilpailijat_'.$id.'.txt') >= filemtime(CACHE_DIRECTORY.'results_'.$id.'.json')) {\n //rg2log(\"Flush cache for event id \".$id);\n @unlink(CACHE_DIRECTORY.\"results_\".$id.\".json\");\n @unlink(CACHE_DIRECTORY.\"courses_\".$id.\".json\");\n @unlink(CACHE_DIRECTORY.\"tracks_\".$id.\".json\");\n @unlink(CACHE_DIRECTORY.\"events.json\");\n @unlink(CACHE_DIRECTORY.\"stats.json\");\n return;\n }\n }\n \n //rg2log(\"Cache OK\");\n}", "public static function validateEmrexSignature($filename_signed, $public_keyfile) {\n \n $filepath_signed = Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix() . $filename_signed;\n\n $signatureValidator = new XmlSignatureValidator();\n $signatureValidator->loadPublicKeyFile($public_keyfile);\n\n $isValid = $signatureValidator->verifyXmlFile($filepath_signed);\n\n return $isValid;\n }", "function eve_api_user_update_api_form_validate($form, &$form_state) {\n $key_id = (int) $form_state['values']['keyID'];\n $v_code = (string) $form_state['values']['vCode'];\n $api_id = (int) $form_state['apiID'];\n\n if (empty($key_id) || empty($v_code) || preg_match('/[^a-z0-9]/i', $v_code) || preg_match('/[^0-9]/', $key_id) || strlen($key_id) > 15 || strlen($v_code) > 64 || strlen($v_code) < 20) {\n form_set_error('keyID', t('Invalid input, please try again.'));\n form_set_error('vCode');\n return;\n }\n\n $result = db_query('SELECT apiID FROM {eve_api_keys} WHERE keyID = :keyID AND vCode =:vCode AND apiID != :apiID', array(\n ':keyID' => $key_id,\n ':vCode' => $v_code,\n ':apiID' => $api_id,\n ));\n\n if ($result->rowCount()) {\n form_set_error('keyID', t('API Key already exists!'));\n form_set_error('vCode');\n return;\n }\n\n $query = array(\n 'keyID' => $key_id,\n 'vCode' => $v_code,\n );\n\n $characters = eve_api_get_api_key_info_api($query);\n\n if (isset($characters['error'])) {\n form_set_error('keyID', t('There was an error with the API.'));\n form_set_error('vCode');\n }\n else {\n $whitelist = array();\n\n if (!empty($characters)) {\n foreach ($characters['characters'] as $character) {\n $whitelist[] = (int) $character['characterID'];\n }\n }\n\n $result = db_query('SELECT characterID FROM {eve_api_whitelist} WHERE characterID IN (:characterIDs)', array(\n ':characterIDs' => $whitelist,\n ));\n\n $allow_expires = variable_get('eve_api_require_expires', FALSE) ? FALSE : !empty($characters['expires']);\n $allow_type = variable_get('eve_api_require_type', TRUE) ? $characters['type'] != 'Account' : FALSE;\n\n if ($result->rowCount()) {\n if ($allow_expires || ($characters['accessMask'] & 8388680) != 8388680) {\n form_set_error('keyID', t('Your account has been whitelisted, please ensure that the \"Type\" drop down box is set to \"Character\", and that the \"No Expiry\" checkbox is ticked. Only (Public Information -> (Characterinfo and FacWarStats), (Private Information) -> (CharacterSheet)) are required.'));\n form_set_error('vCode');\n }\n }\n else {\n if ($allow_expires || $allow_type || ($characters['accessMask'] & variable_get('eve_api_access_mask', 268435455)) != variable_get('eve_api_access_mask', 268435455)) {\n form_set_error('keyID', t('Please ensure that all boxes are highlighted and selected for the API, the \"Character\" drop down box is set to \"All\", the \"Type\" drop down box is set to \"Character\", and that the \"No Expiry\" checkbox is ticked.'));\n form_set_error('vCode');\n }\n }\n }\n}", "function validate()\r\n {\r\n global $app;\r\n if (empty($_REQUEST['authorizenet_cc_owner']))\r\n $app->error('##Credit Card Owner is required##');\r\n if (empty($_REQUEST['authorizenet_cc_number']))\r\n $app->error('##Credit Card Number is required##');\r\n else {\r\n require_once('cc_validation.class.php');\r\n $cc_validation = new cc_validation;\r\n $exp_m = $_REQUEST['authorizenet_cc_expires_Month'];\r\n $exp_y = substr( $_REQUEST['authorizenet_cc_expires_Year'], -2);\r\n $result = $cc_validation->validate($_REQUEST['authorizenet_cc_number'], $exp_m, $exp_y);\r\n $_REQUEST['authorizenet_cc_type'] = $cc_validation->cc_type;\r\n if ($result === -1 || $result === false)\r\n $app->error('##Invalid Credit Card Number##');\r\n }\r\n $exp_ym = $_REQUEST['authorizenet_cc_expires_Year'] . $_REQUEST['authorizenet_cc_expires_Month'];\r\n $now_ym = date('Ym');\r\n if ($exp_ym < $now_ym)\r\n $app->error('##Credit Card Expiration Date cannot be in the past##');\r\n return parent::validate();\r\n }", "function drush_policy_updatedb_validate() {\n // Check for a token in the request. In this case, we require --token=secret.\n if (!drush_get_option('token') == 'secret') {\n drush_log(dt('Per site policy, you must add a secret --token complete this command. See examples/policy.drush.inc. If you are running a version of drush prior to 4.3 and are not sure why you are seeing this message, please see http://drupal.org/node/1024824.'), 'warning');\n drush_set_context('DRUSH_AFFIRMATIVE', FALSE);\n drush_set_context('DRUSH_NEGATIVE', TRUE);\n }\n}", "public function processValidated()\n {\n }", "public function processValidated()\n {\n }", "function run($argc, $argv)\n{\n\t// Get all GPG key IDs and informations\n\t$keys = MAIL_getGpgKeyList(true);\n\n\t// Check, if there are keys\n\tif (is_array($keys))\n\t{\n\t\t// Only use the 1st key\n\t\tforeach ($keys as $privGPGKeyID => $info)\n\t\t{\n\t\t\t$GPGSign = new CGPGSign(CGPGSign::MODE_SAVE);\n\t\t\t\n\t\t\tif (!$GPGSign->hasConfigFile())\n\t\t\t{\n\t\t\t\t$GPGSign->setGPGID($privGPGKeyID);\n\t\t\t\t$GPGSign->exportPublicSignKey();\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t}\n}", "public function invalidate(string $url): void\n {\n // Cache invalidation via CDN would be done here\n }", "function ec_verify($data, $signature, $key)\n{\n $public_key = coin2pem($key);\n\n $signature = base58_decode($signature);\n\n $pkey = openssl_pkey_get_public($public_key);\n\n $res = openssl_verify($data, $signature, $pkey, OPENSSL_ALGO_SHA256);\n\n\n if ($res === 1) {\n return true;\n }\n return false;\n}", "private function check_valid_api() {\n\t\n\t\tglobal $fs_schema;\n\t\t\n\t\t$settings = $fs_schema->data->settings();\n\t\t\n\t\tswitch ( $settings[ 'fs_schema_integration' ] ) {\n\t\t\n\t\t\tcase 'BRP':\n\t\t\t\n\t\t\t\t// ..1.2..\n\t\t\t\tupdate_option( 'fs_schema_valid_key', strpos ( base64_decode ('Li5lYzY1YTVlNTZkZmQ0OTA4YjBhOTI4NDJkOThhMGRiYy4xYTA3ZmNlMWFjMjI0YTY2OWRjYWUwMjQxMmJjZDA4NC42YThhYTRjMWM2ZDg0ZTNmOWQxN2NlZDJhZTViZWM5My4zOTdmZGFlYzAwMGM0ZTMyODJiYzI1ODVkYjVmYTJiZS40OWY0YzhkNmI4OTg0NGEzYmJiMmEzYTgwMDg1NjE4Yi5lODVjMDYzYTI1MjQ0MmNjOTQ1MmIzMTA1MzM1NDkzZC4zZGI2NTQ4ODIxODM0NTEzYjc2MDZkZjBlYTIzZDQ2MS4u'), '.'.$settings[ 'fs_booking_bpi_api_key' ].'.' ) );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\tcase 'PROFIT':\n\t\t\t\n\t\t\t\t// ..1.2..\n\t\t\t\tupdate_option( 'fs_schema_valid_key', strpos ( base64_decode ('Li4xNDM3LjEzODIuMTQ4MC4xMzQyLi4='), '.'.$settings[ 'fs_booking_profit_organization_unit' ].'.' ) );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t}\t\n\t}", "private function _validateRequest()\n {\n // API keys data fetched from config for demo purpose\n // It can be a Model e.g. ApiKeys or any other data source\n // e.g. model implementation\n // $this->loadModel('ApiKeys');\n // to validate apiKey\n // $this->ApiKeys->checkKey($this->apiKey)\n $apiKeys = Configure::read('RESTAPI.APIKEYS');\n if (empty($apiKeys)) {\n $apiKeys = [];\n }\n\n if (is_null($this->apiKey) || !(in_array($this->apiKey, $apiKeys))) {\n $this->autoRender = false;\n echo json_encode(\n [\n 'errors' => [\n 'status' => 401,\n 'title' => 'Missing or invalid key',\n 'detail' => 'Security key is either missing or is invalid'\n ]\n ]\n );\n\n $this->response->withStatus(401);\n exit(0);\n }\n }", "private function check_constraints() {\n\t\t$Err = new ChunkUploadError;\n\t\t$logger = self::$logger;\n\t\t$request = $this->request;\n\n\t\t$size = $index = $blob = null;\n\t\textract($request);\n\n\t\t$size = intval($size);\n\t\tif ($size < 1) {\n\t\t\t# size violation\n\t\t\t$logger->warning(\"Chupload: invalid filesize.\");\n\t\t\treturn $Err::ECST_FSZ_INVALID;\n\t\t}\n\t\t$index = intval($index);\n\t\tif ($index < 0) {\n\t\t\t# index undersized\n\t\t\t$logger->warning(\"Chupload: invalid chunk index.\");\n\t\t\treturn $Err::ECST_CID_UNDERSIZED;\n\t\t}\n\t\tif ($size > $this->max_filesize) {\n\t\t\t# max size violation\n\t\t\t$logger->warning(\"Chupload: max filesize violation.\");\n\t\t\treturn $Err::ECST_FSZ_OVERSIZED;\n\t\t}\n\t\tif ($index * $this->chunk_size > $this->max_filesize) {\n\t\t\t# index oversized\n\t\t\t$logger->warning(\"Chupload: chunk index violation.\");\n\t\t\treturn $Err::ECST_CID_OVERSIZED;\n\t\t}\n\t\t$chunk_path = $blob['tmp_name'];\n\t\tif (filesize($chunk_path) > $this->chunk_size) {\n\t\t\t# chunk oversized\n\t\t\t$logger->warning(\"Chupload: invalid chunk index.\");\n\t\t\t$this->unlink($chunk_path);\n\t\t\treturn $Err::ECST_MCH_OVERSIZED;\n\t\t}\n\n\t\t$max_chunk_float = $size / $this->chunk_size;\n\t\t$max_chunk = floor($max_chunk_float);\n\t\tif ($max_chunk_float == $max_chunk)\n\t\t\t$max_chunk--;\n\t\t$max_chunk = intval($max_chunk);\n\n\t\t$chunk = file_get_contents($chunk_path);\n\n\t\t$basename = $this->get_basename();\n\t\t$tempname = $this->tempdir . '/' . $basename;\n\t\t$destname = $this->destdir . '/' . $basename;\n\n\t\t# always overwrite old file with the same destname, hence\n\t\t# make sure get_basename() guarantee uniqueness\n\t\t// @codeCoverageIgnoreStart\n\t\tif (file_exists($destname) && !$this->unlink($destname))\n\t\t\treturn $Err::EDIO_DELETE_FAIL;\n\t\t// @codeCoverageIgnoreEnd\n\n\t\t$this->chunk_data = [\n\t\t\t'size' => $size,\n\t\t\t'index' => $index,\n\t\t\t'chunk_path' => $chunk_path,\n\t\t\t'max_chunk' => $max_chunk,\n\t\t\t'chunk' => $chunk,\n\t\t\t'basename' => $basename,\n\t\t\t'tempname' => $tempname,\n\t\t\t'destname' => $destname,\n\t\t];\n\n\t\treturn 0;\n\t}", "private function checkValidity()\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $this->urlGCMSend);\r\n curl_setopt($ch, CURLOPT_PORT, $this->GCMPort);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->timeout);\r\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\r\n curl_setopt($ch, CURLOPT_SSLVERSION, 3);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_HEADER, 1);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\r\n 'Content-Type: application/json',\r\n 'Authorization: key=' . $this->api_key)\r\n );\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('registration_ids' => 'ABC')));\r\n $info = curl_getinfo($ch);\r\n curl_close($ch);\r\n if($info['http_code'] == self::HTTP_UNAUTHORIZED)\r\n throw new PushNotificationGCMException(PushNotificationGCMException::API_KEY_BROKEN,\"Please, insert correct api key\");\r\n if($this->debug){\r\n if($info['http_code'] == self::HTTP_OK)\r\n $this->reponseGCM['checkValidity'] = 'API KEY is valid';\r\n }\r\n }", "function certificateCheck($metadata) {\n $doc = new DOMDocument();\n $doc->load($metadata);\n $xpath = new DOMXpath($doc);\n $xpath->registerNameSpace(\"ds\", \"http://www.w3.org/2000/09/xmldsig#\");\n $certificates = $xpath->query(\"//ds:X509Certificate\");\n $certsInfo = array();\n $messages = array();\n\n if($certificates->length > 0) {\n foreach($certificates as $cert) {\n $X509Certificate = \"-----BEGIN CERTIFICATE-----\\n\" . trim ($cert->nodeValue) . \"\\n-----END CERTIFICATE-----\";\n $cert_info = openssl_x509_parse($X509Certificate, true);\n $cert_validTo = date(\"Y-m-d\", $cert_info[\"validTo_time_t\"]);\n $cert_validFor = floor((strtotime($cert_validTo)-time ())/(60*60*24));\n $pub_key = openssl_pkey_get_details(openssl_pkey_get_public($X509Certificate));\n\n array_push($certsInfo, array($cert_validTo, $cert_validFor, $pub_key[\"bits\"]));\n }\n } else {\n array_push($messages, \"No certificate found.\");\n }\n\n $certsResults = array_fill(0, count($certsInfo), array_fill(0, 2, null));\n for($i=0; $i<count($certsInfo); $i++) {\n if($certsInfo[$i][2] < $GLOBALS[\"KEY_SIZE\"]) {\n $certsResults[$i][0] = \"Public key size must be at least \" . $GLOBALS[\"KEY_SIZE\"] . \" bits. Yours is only \" . $certsInfo[$i][2] . \".\";\n }\n\n if($certsInfo[$i][1] < $GLOBALS[\"CERTIFICATE_VALIDITY\"]) {\n $certsResults[$i][1] = \"Certificate must be valid at least for \" . $GLOBALS[\"CERTIFICATE_VALIDITY\"] . \" days. Yours is \" . $certsInfo[$i][1] . \".\";\n }\n }\n\n for($i=0; $i<count($certsResults); $i++) {\n if($i%2 === 0) {\n continue;\n }\n\n if(($certsResults[$i][0] !== null) || ($certsResults[$i][1] !== null)) {\n foreach($certsResults[$i] as $m) {\n array_push($messages, $m);\n }\n }\n\n if($certsResults[$i][0] !== null) {\n foreach($certsResults[$i] as $m) {\n array_push($messages, $m);\n }\n }\n }\n\n list($returncode, $message) = generateResult($messages);\n return array($returncode, $message);\n}", "public static function validate(Client $client, Closure $getRequest, Closure $setRequest)\n {\n // Prepare\n $license = $getRequest();\n if (!is_a($license, LicenseRequest::class))\n throw new Exception('Closure must return an object instance of LicenseRequest.');\n // No need to check if license already expired.\n if ($license->data['has_expired'])\n return false;\n // Validate cached license data\n if (time() < $license->next_check\n && $license->is_valid\n ) {\n return true;\n }\n // Call\n $license->request['domain'] = $_SERVER['SERVER_NAME'];\n $response = $client->call('license_key_validate', $license);\n if (isset($response->error)\n && $response->error === false\n ) {\n $license->data = (array)$response->data;\n $license->touch();\n $setRequest((string)$license);\n return true;\n }\n return false;\n }" ]
[ "0.5206896", "0.50877833", "0.4977804", "0.48527542", "0.47539234", "0.47071034", "0.4480845", "0.4365103", "0.4355663", "0.4331062", "0.4328859", "0.43050367", "0.4285239", "0.42768013", "0.42761776", "0.42751336", "0.42749", "0.42703378", "0.42523858", "0.42259577", "0.42259577", "0.4223333", "0.4212476", "0.41857246", "0.4177065", "0.41736227", "0.41664225", "0.41619533", "0.4145926", "0.41042852" ]
0.6184281
0
Returns engine name list
public function getEngineNames() { return array_keys($this->configurations['engines']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEngines();", "public function getEngines() {\n\n\t\t$engines = array();\n\t\t$this->query('SHOW ENGINES');\n\t\t\n\t\twhile ($r = $this->get()) {\n\t\t\t$engines[$r['Engine']] = $r; \n\t\t}\n\t\t\n\t\treturn $engines;\n\t}", "public function getAvailableEngines() {\n\t\t$engines = $this->getEngines();\n\t\t\n\t\tif (is_array($engines)) {\n\t\t\t$availableEngines = array();\n\t\t\tforeach ($engines as $engineName => $engineData) {\n\t\t\t\t\n\t\t\t\t$engineSupport = strtolower($engineData['Support']);\n\n\t\t\t\tif ($engineSupport == 'yes' || $engineSupport == 'default') {\n\t\t\t\t\t$availableEngines[] = $engineName;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $availableEngines;\n\t\t}\n\t\treturn array();\n\t\t\n\t}", "public function listServiceEngines() { \n $params = array ();\n $params ['param'] = 'all'; \n \n $resXML = $this->makeRequest('com.cisco.unicorn.ui.ListApiServlet', 'getSEs', $params);\n $attribs = $resXML->record->attributes();\n \n $res=array();\n foreach ($attribs as $a => $b) {\n $res[$a]=(string)$b;\n } \n \n return $res;\n }", "static public function getEngines()\n {\n if (sfConfig::get('app_a_get_engines_method'))\n {\n $method = sfConfig::get('app_a_get_engines_method');\n\n return call_user_func($method);\n }\n return sfConfig::get('app_a_engines', array(\n '' => 'Template-Based'));\n }", "abstract protected function engine_name();", "function setup_getEngines($engines_ary)\n{\n\t$engines = array();\n\t\n\tforeach ($engines_ary as $engine => $meta)\n {\n if (engine_get_capability($engine, 'movie')) $engines[$engine] = $meta['name'];\n }\n \n return $engines;\n}", "public function getKnownEngines()\n {\n return array(\n 'webkit' => ['webkit'],\n 'gecko' => ['gecko'],\n 'trident' => ['trident'],\n 'presto' => ['presto'],\n 'khtml' => ['khtml']\n );\n }", "public function getEngineInfo($name = '') {\n\t\t\n\t\t$infos = array();\n\t\t$engineNames = $name ? array($name) : $this->getEngines();\n\t\t$prefix = 'ImageSizerEngine';\n\t\t\n\t\tif($name && stripos($name, $prefix) === 0) {\n\t\t\t$name = str_replace($prefix, '', $name);\n\t\t}\n\t\t\n\t\tforeach($engineNames as $priority => $engineName) {\n\t\t\t$shortName = str_replace($prefix, '', $engineName);\n\t\t\tif($name && $shortName !== $name) continue;\n\t\t\t$engine = $this->getEngine($engineName);\n\t\t\tif(!$engine) continue;\n\t\t\t$info = $engine->getEngineInfo();\n\t\t\t$info['runOrder'] = $priority;\t\n\t\t\t$infos[$shortName] = $info;\n\t\t}\n\t\n\t\t// if one engine requested reduce array to just that engine\n\t\tif($name) $infos = isset($infos[$name]) ? $infos[$name] : array();\n\t\t\n\t\treturn $infos;\n\t}", "public function getManagerNames();", "private function __getEntities() {\n $sql = 'SELECT \"name\" FROM \"entity\"';\n $res = $this->__execSql($sql);\n return array_map(function($v) { return $v['name']; }, $res);\n }", "function getSearchEngines(){\n $searchEngines = array();\n $apiRoot = $this->getApiRoot();\n unset($apiRoot['searchengines']);\n\n foreach($apiRoot as $hashid => $props){\n $searchEngines[] = new SearchEngine($this, $hashid, $props['name']);\n }\n\n return $searchEngines;\n }", "public function EngineList($host)\r\n {\r\n $post_string = '<?xml version=\"1.0\" encoding=\"utf-8\"?><EngineListingRequest session-id='.'\"'.$this->getSessionId().'\"'.'/>';\r\n\r\n $data = $this->call($host, $post_string);\r\n\r\n return $data;\r\n }", "static function engine($engine_name = null) {\n if(is_null($engine_name)) {\n return self::$default_engine;\n } else {\n return array_var(self::$additional_engines, $engine_name);\n } // if\n }", "public function allProviders()\n {\n\n $query = \\DB::select(\"select software from realgamesgames GROUP BY software\");\n return $query;\n }", "public function getEngineResolver ()\n {\n return $this->engines;\n }", "public function getEnginesList($engine_type)\n\t{\n\t\t$engine_type = ucfirst($engine_type);\n\n\t\t// Try to serve cached data first\n\t\tif (isset($this->engine_list[$engine_type]))\n\t\t{\n\t\t\treturn $this->engine_list[$engine_type];\n\t\t}\n\n\t\t// Find absolute path to normal and plugins directories\n\t\t$temp = $this->getEnginePartPaths('engine');\n\t\t$path_list = [];\n\n\t\tforeach ($temp as $path)\n\t\t{\n\t\t\t$path_list[] = $path . '/' . $engine_type;\n\t\t}\n\n\t\t// Initialize the array where we store our data\n\t\t$this->engine_list[$engine_type] = [];\n\n\t\t// Loop for the paths where engines can be found\n\t\tforeach ($path_list as $path)\n\t\t{\n\t\t\tif (!@is_dir($path))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!@is_readable($path))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$di = new DirectoryIterator($path);\n\n\t\t\t/** @var DirectoryIterator $file */\n\t\t\tforeach ($di as $file)\n\t\t\t{\n\t\t\t\tif (!$file->isFile())\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($file->getExtension() !== 'json')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$bare_name = ucfirst($file->getBasename('.json'));\n\n\t\t\t\t// Some hosts copy .json and .php files, renaming them (ie foobar.1.php)\n\t\t\t\t// We need to exclude them, otherwise we'll get a fatal error for declaring the same class twice\n\t\t\t\tif (preg_match('/[^A-Za-z0-9]/', $bare_name))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$information = [];\n\t\t\t\t$parameters = [];\n\n\t\t\t\t$this->parseEngineJSON($file->getRealPath(), $information, $parameters);\n\n\t\t\t\t$this->engine_list[$engine_type][lcfirst($bare_name)] = [\n\t\t\t\t\t'information' => $information,\n\t\t\t\t\t'parameters' => $parameters,\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->engine_list[$engine_type];\n\t}", "public function getEngine();", "public function getEngine();", "public function getEngine();", "public function getSoftwareNames()\n {\n global $wpdb;\n $query = \"\";\n\n $query = \"SELECT soft_id, soft_company, soft_name\n FROM software\n ORDER BY soft_company\";\n \n $results = $wpdb->get_results($query);\n return $results;\n }", "public function getLettersList ()\n {\n $query = $this->_db->select();\n $query->from( 'zanby_event__venues', array('id', 'letter' => new Zend_Db_Expr('UPPER(SUBSTRING(`name`,1,1))')));\n if ( $this->getWhere() )\n $query->where( $this->getWhere() );\n if ( $this->getType() )\n $query->where( 'type = ?', $this->getType() );\n if ( $this->getOwnerId() )\n $query->where( 'owner_id = ?', $this->getOwnerId() );\n if ( $this->getCategory() )\n $query->where( 'category_id = ?', $this->getCategory() );\n $result = $this->_db->fetchPairs( $query );\n $items = array();\n foreach ( $result as $k => $v ) {\n $items[$v][] = $k;\n }\n return $items;\n }", "public function getEngineResolver()\n {\n return $this->engines;\n }", "public function getEngineResolver()\n {\n return $this->engines;\n }", "public function getEngineResolver()\n {\n return $this->engines;\n }", "public function getEngines($forceReload = false) {\n\t\t\n\t\tif(!$forceReload && is_array(self::$knownEngines)) return self::$knownEngines;\n\t\t\n\t\tself::$knownEngines = array();\n\t\t\n\t\t$modules = $this->wire('modules');\n\t\t$engines = $modules->findByPrefix('ImageSizerEngine');\n\t\t$numEngines = count($engines);\n\t\t\n\t\tforeach($engines as $moduleName) {\n\t\t\tif(!$modules->isInstalled($moduleName)) continue;\n\t\t\tif($numEngines > 1) {\n\t\t\t\t$configData = $modules->getConfig($moduleName);\n\t\t\t\t$priority = isset($configData['enginePriority']) ? (int) $configData['enginePriority'] : 0;\n\t\t\t\t// multiply by 10 to ensure two priority 1 engines don't get mixed up with a priority 2 engine\n\t\t\t\t// for instance, two priority 1 engines become 10 and 11, rather than 1 and 2, as a priority 1\n\t\t\t\t// engine incremented to 2 could otherwise be confused with a priority 2 engine\n\t\t\t\t$priority *= 10;\n\t\t\t\twhile(isset(self::$knownEngines[$priority])) {\n\t\t\t\t\t$priority++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$priority = 0;\n\t\t\t}\n\t\t\tself::$knownEngines[$priority] = $moduleName;\n\t\t}\n\t\t\n\t\tif(count(self::$knownEngines) > 1) ksort(self::$knownEngines);\n\t\tself::$knownEngines[] = $this->defaultEngineName;\n\t\t\n\t\treturn self::$knownEngines;\n\t}", "public function getNames() {\n return array_keys($this->commands);\t\n }", "public function getNameList()\n {\n return $this->controlElevator->getElevatorsName();\n }", "public function industrieNames()\n {\n $names = array ( );\n foreach ( $this->industries as $industry )\n $names[] = $industry->name;\n return $names;\n }", "public function getLibrariesInfoName() {\r\n $plugins = $this->getDefinitions();\r\n $libraries = [];\r\n foreach ($plugins as $AweElement) {\r\n $plugin = $this->createInstance($AweElement['id']);\r\n $library = $plugin->getLibraries();\r\n foreach (array_keys($library) as $name) {\r\n $libraries[] = \"{$AweElement['provider']}/{$name}\";\r\n }\r\n }\r\n return $libraries;\r\n }" ]
[ "0.7792482", "0.7663922", "0.68933344", "0.6841262", "0.66734934", "0.651229", "0.64697117", "0.6456671", "0.61312777", "0.61234736", "0.6103348", "0.6075028", "0.6050553", "0.5982121", "0.5885782", "0.58800185", "0.58214474", "0.57881904", "0.57881904", "0.57881904", "0.5763957", "0.5742193", "0.57335734", "0.57335734", "0.57335734", "0.572657", "0.5721234", "0.5714752", "0.5706533", "0.5675039" ]
0.81196344
0
/ Marcelo Aranda 20180828, se agrega insertaInscripcionEvaluacionByInscrito para registrar las evaluaciones
public function insertaInscripcionEvaluacionByInscrito(inscripcion $oInscripcion) { $codActividad = $oInscripcion->getInscCActividad(); $numDictacion = $oInscripcion->getInscNumeroDictacion(); $codTrab = $oInscripcion->getInscCTrabajador(); $aEvaluacionAplicada = EvaluacionAplicadaQuery::create() ->filterByEvapCActividad($codActividad) ->filterByEvapNumeroDictacion($numDictacion) ->find(); $oEvaluacionAplicada = new EvaluacionAplicada(); foreach ($aEvaluacionAplicada as $oEvaluacionAplicada) { $codEvaluacion = $oEvaluacionAplicada->getEvapCEvaluacion(); $numEvaluacion = $oEvaluacionAplicada->getEvapNumeroEvaluacion(); //$tipoEval = $oEvaluacionAplicada->getEvaluacion()->getEvalTEvaluacion(); $oInscripcionEvaluacionAplicada = new InscripcionEvaluacionAplicada(); $oInscripcionEvaluacionAplicada->setInevapCActividad($codActividad); $oInscripcionEvaluacionAplicada->setInevapNumeroDictacion($numDictacion); $oInscripcionEvaluacionAplicada->setInevapCTrabajador($codTrab); $oInscripcionEvaluacionAplicada->setInevapCEvaluacion($codEvaluacion); $oInscripcionEvaluacionAplicada->setInevapNumeroEvaluacion($numEvaluacion); $oInscripcionEvaluacionAplicada->setInevapEInscripcionEvaluacionAplicada(1); //pendiente respuesta //valida si existe registro en INSCRIPCION_EVALUACION_APLICADA if(!$this->existeInscripcionEvaluacionAplicada($oInscripcionEvaluacionAplicada)) { //sino existe se inserta el registro en INSCRIPCION_EVALUACION_APLICADA $oInscripcionEvaluacionAplicada->save(); //llamar a la inserción de RESPUESTA_APLICADA RespuestaAplicadaQuery::create()->insertaRespuestaAplicadaByInscEvalApli($oInscripcionEvaluacionAplicada); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertaEvaluacionA($datos){\n\t\t\t$porcentajes = $datos['porcentajes'];\n\t\t\tforeach($datos['actividades'] as $actividad){\n\t\t\t\t$miQuery = \"INSERT INTO EVALUACION (NOMBRE, PORCENTAJE,CURSO_IDCURSO) VALUES \";\n\t\t\t\t$miQuery .= \" ( '{$actividad}', {$porcentajes[0]}, {$datos['idcurso']})\";\n\t\t\t\t$this->bd_driver->query($miQuery);\n\t\t\t\tif($this->bd_driver->error){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tarray_shift($porcentajes);\n\t\t\t\tif(count($porcentajes) <= 0)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->bd_driver->close();\n\t\t\treturn true;\t\n\t\t}", "function registrarInscripcion() {\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=\".$this->datosInscripcion['retornoPagina'];\n $variable.=\"&opcion=\".$this->datosInscripcion['retornoOpcion'];\n foreach ($this->datosInscripcion['retornoParametros'] as $key => $value)\n {\n $variable.=\"&\".$key.\"=\".$value;\n }\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n\n $resultado_espacio=$this->datosEspacio;\n if(is_array($resultado_espacio))\n {\n $letras=array('OB','OC','EI','EE','CP');\n $numeros=array(1,2,3,4,5);\n $clasificacion=str_replace($letras,$numeros,trim(isset($resultado_espacio['CLASIFICACION'])?$resultado_espacio['CLASIFICACION']:''));\n if ($clasificacion=='')$clasificacion=0;\n $datos['codEstudiante']=$this->datosEstudiante[0]['CODIGO'];\n $datos['codProyectoEstudiante']=$this->datosEstudiante[0]['COD_CARRERA'];\n $datos['codEspacio']=$this->datosInscripcion['codEspacio'];\n $datos['id_grupo']=$this->datosInscripcion['id_grupo'];\n $datos['ano']=$this->ano;\n $datos['periodo']=$this->periodo;\n $datos['creditos']=(isset($resultado_espacio['CREDITOS'])?$resultado_espacio['CREDITOS']:'');\n $datos['htd']=(isset($resultado_espacio['HTD'])?$resultado_espacio['HTD']:'');\n $datos['htc']=(isset($resultado_espacio['HTC'])?$resultado_espacio['HTC']:'');\n $datos['hta']=(isset($resultado_espacio['HTA'])?$resultado_espacio['HTA']:'');\n $datos['CLASIFICACION']=$clasificacion;\n $datos['nivel']=$this->datosInscripcion['nivel'];\n $datos['hor_alternativo']=$this->datosInscripcion['hor_alternativo'];\n foreach ($datos as $key => $value) {\n if($value=='')\n {$datos[$key]='null';}\n }\n\n $resultado_adicionar=$this->insertarRegistroInscripcion($datos);\n if($resultado_adicionar>=1)\n {\n $mensaje=\"Espacio académico adicionado.\";\n $this->actualizarInscripcionesSesion();\n $this->procedimientos->actualizarCupo($datos);\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'1',\n 'descripcion'=>'Adiciona Espacio académico',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$datos['codEspacio'].\", 0, \".$datos['id_grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosInscripcion['carrera'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }else\n {\n $mensaje=\"No se puede adicionar, por favor intente mas tarde.\";\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'50',\n 'descripcion'=>'Conexion Error Oracle adicionar',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$datos['codEspacio'].\",0, \".$datos['id_grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosEstudiante[0]['COD_CARRERA'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }\n }else\n {\n $mensaje=\"No hay datos del espacio. No se puede adicionar.\";\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'50',\n 'descripcion'=>'Error datos espacio adicionar',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$_REQUEST['codEspacio'].\",0, \".$_REQUEST['id_grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosEstudiante[0]['COD_CARRERA'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }\n $this->retornar($pagina,$variable,$variablesRegistro,$mensaje);\n }", "function registrarInscripcion() {\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=\".$this->datosInscripcion['retornoPagina'];\n $variable.=\"&opcion=\".$this->datosInscripcion['retornoOpcion'];\n foreach ($this->datosInscripcion['retornoParametros'] as $key => $value)\n {\n $variable.=\"&\".$key.\"=\".$value;\n }\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n\n $resultado_espacio=$this->datosEspacio;\n if(is_array($resultado_espacio))\n {\n $letras=array('OB','OC','EI','EE','CP');\n $numeros=array(1,2,3,4,5);\n $clasificacion=str_replace($letras,$numeros,trim(isset($resultado_espacio['CLASIFICACION'])?$resultado_espacio['CLASIFICACION']:''));\n $datos['codEstudiante']=$this->datosEstudiante[0]['CODIGO'];\n $datos['codProyectoEstudiante']=$this->datosEstudiante[0]['COD_CARRERA'];\n $datos['codEspacio']=$this->datosInscripcion['codEspacio'];\n $datos['grupo']=$this->datosInscripcion['grupo'];\n $datos['ano']=$this->ano;\n $datos['periodo']=$this->periodo;\n $datos['creditos']=(isset($resultado_espacio['CREDITOS'])?$resultado_espacio['CREDITOS']:'');\n $datos['htd']=(isset($resultado_espacio['HTD'])?$resultado_espacio['HTD']:'');\n $datos['htc']=(isset($resultado_espacio['HTC'])?$resultado_espacio['HTC']:'');\n $datos['hta']=(isset($resultado_espacio['HTA'])?$resultado_espacio['HTA']:'');\n $datos['CLASIFICACION']=$clasificacion;\n\n $resultado_adicionar=$this->insertarRegistroInscripcion($datos);\n if($resultado_adicionar>=1)\n {\n $mensaje=\"Espacio académico adicionado.\";\n $this->actualizarInscripcionesSesion();\n $this->procedimientos->actualizarCupo($datos);\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'1',\n 'descripcion'=>'Adiciona Espacio académico',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$datos['codEspacio'].\", 0, \".$datos['grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosInscripcion['carrera'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }else\n {\n $mensaje=\"No se puede adicionar, por favor intente mas tarde.\";\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'50',\n 'descripcion'=>'Conexion Error Oracle adicionar',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$datos['codEspacio'].\",0, \".$datos['grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosEstudiante[0]['COD_CARRERA'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }\n }else\n {\n $mensaje=\"No hay datos del espacio. No se puede adicionar.\";\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'50',\n 'descripcion'=>'Error datos espacio adicionar',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$_REQUEST['codEspacio'].\",0, \".$_REQUEST['grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosEstudiante[0]['COD_CARRERA'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }\n $this->retornar($pagina,$variable,$variablesRegistro,$mensaje);\n }", "function insertarRegistroInscripcion($datos) {\n $cadena_sql_adicionar=$this->sql->cadena_sql(\"inscribir_espacio\",$datos);\n $resultado_adicionar=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql_adicionar,\"\");\n return $this->totalAfectados($this->configuracion, $this->accesoOracle);\n }", "function insertarRegistroInscripcion($datos) {\n $cadena_sql_adicionar=$this->sql->cadena_sql(\"inscribir_espacio\",$datos);\n $resultado_adicionar=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql_adicionar,\"\");\n return $this->totalAfectados($this->configuracion, $this->accesoOracle);\n }", "function registrar_asignacion_periodo ($datos){\n $secuencia=recuperar_secuencia('asignacion_id_asignacion_seq');\n \n //La secuencia de la tabla asignacion_periodo es: asignacion_periodo_id_asignacion_seq.\n \n $periodo=array(\n 'id_asignacion' => $secuencia,\n 'fecha_inicio' => $datos['fecha_inicio'],\n 'fecha_fin' => $datos['fecha_fin']\n );\n \n $this->dep('datos')->tabla('asignacion_periodo')->nueva_fila($periodo);\n $this->dep('datos')->tabla('asignacion_periodo')->sincronizar();\n $this->dep('datos')->tabla('asignacion_periodo')->resetear();\n \n //En esta seccion se guarda informacion en la tabla esta_formada. Podemos tener varios dias. Su formato es:\n //array( 0 => array(id_solictud, nombre, fecha), ..., )\n $dias=$datos['dias'];\n foreach ($dias as $clave=>$dia){\n \n $dato['nombre']= $dia['nombre'];\n $dato['id_asignacion']=$secuencia;\n $dato['fecha']=$dia['fecha'];\n $this->dep('datos')->tabla('esta_formada')->nueva_fila($dato);\n $this->dep('datos')->tabla('esta_formada')->sincronizar();\n $this->dep('datos')->tabla('esta_formada')->resetear();\n }\n \n }", "public function registrarOcorrencia() {\n\n $oConfiguracoes = (object)parse_ini_file(PATH_IMPORTACAO . \"libs/configuracoes_importacao.ini\",true);\n $iInstituicao = $aConfiguracoes->sistema['instituicao_prefeitura'];\n $this->logBanco( \"Incluindo histórico para a matrícula {$this->iMatricula}.\");\n\n $sMensagemOcorrencia = \"Imóvel ReIncluido pelo recadastramento. Nome do arquivo: {$this->oRegistro->sNomeArquivo}\";\n $sInsertHistocorrencia = \"insert into histocorrencia \";\n $sInsertHistocorrencia .= \" (ar23_sequencial , \";\n $sInsertHistocorrencia .= \" ar23_id_usuario , \";\n $sInsertHistocorrencia .= \" ar23_instit , \";\n $sInsertHistocorrencia .= \" ar23_modulo , \";\n $sInsertHistocorrencia .= \" ar23_id_itensmenu, \";\n $sInsertHistocorrencia .= \" ar23_data , \";\n $sInsertHistocorrencia .= \" ar23_hora , \";\n $sInsertHistocorrencia .= \" ar23_tipo , \";\n $sInsertHistocorrencia .= \" ar23_descricao , \";\n $sInsertHistocorrencia .= \" ar23_ocorrencia) \";\n $sInsertHistocorrencia .= \" values (nextval('histocorrencia_ar23_sequencial_seq'), \";\n $sInsertHistocorrencia .= \" 1, \";\n $sInsertHistocorrencia .= \" {$iInstituicao}, \";\n $sInsertHistocorrencia .= \" 578, \";\n $sInsertHistocorrencia .= \" 1722, \";\n $sInsertHistocorrencia .= \" '{$this->oRegistro->oDataEnvio->getDate()}', \";\n $sInsertHistocorrencia .= \" '00:00', \";\n $sInsertHistocorrencia .= \" 2, \";\n $sInsertHistocorrencia .= \" '$sMensagemOcorrencia.', \";\n $sInsertHistocorrencia .= \" '$sMensagemOcorrencia.') \";\n\n if (pg_query ($sInsertHistocorrencia)) {\n\n $sInsertHistocorrenciaMatric = \"insert into histocorrenciamatric \";\n $sInsertHistocorrenciaMatric .= \" (ar25_sequencial , \";\n $sInsertHistocorrenciaMatric .= \" ar25_matric , \";\n $sInsertHistocorrenciaMatric .= \" ar25_histocorrencia) \";\n $sInsertHistocorrenciaMatric .= \"values (nextval('histocorrenciamatric_ar25_sequencial_seq'),\";\n $sInsertHistocorrenciaMatric .= \" {$this->iMatricula}, \";\n $sInsertHistocorrenciaMatric .= \" currval('histocorrencia_ar23_sequencial_seq')) \";\n\n if (pg_query($sInsertHistocorrenciaMatric)) {\n return true;\n }\n }\n\n $this->logBanco( \"Incluindo histórico de ocorrência para a matrícula {$this->iMatricula}.\" );\n\n return false;\n\n }", "function actualizarInscripcionesSesion() {\n $datosEstudiante=array('codEstudiante'=>$this->datosEstudiante[0]['CODIGO'],\n 'codProyectoEstudiante'=> $this->datosEstudiante[0]['COD_CARRERA'],\n 'ano'=> $this->datosEstudiante[0]['ANO'],\n 'periodo'=> $this->datosEstudiante[0]['PERIODO']);\n $espaciosInscritos=$this->procedimientos->actualizarInscritosSesion($datosEstudiante);\n }", "function actualizarInscripcionesSesion() {\n $datosEstudiante=array('codEstudiante'=>$this->datosEstudiante[0]['CODIGO'],\n 'codProyectoEstudiante'=> $this->datosEstudiante[0]['COD_CARRERA'],\n 'ano'=> $this->datosEstudiante[0]['ANO'],\n 'periodo'=> $this->datosEstudiante[0]['PERIODO']);\n $espaciosInscritos=$this->procedimientos->actualizarInscritosSesion($datosEstudiante);\n }", "function insertaEvaluacionExtra($arreglo){\n\t\t\t$miQuery = \"SELECT IDCURSO FROM CURSO WHERE NRC = {$arreglo['nrc']} AND CICLO_CICLO = '{$arreglo['ciclo']}'\";\n\t\t\t\n\t\t\t$result = $this->bd_driver->query($miQuery);\n\t\t\t\n\t\t\tif($result && $this->bd_driver->affected_rows == 1){\n\t\t\t\t$todo = array();\n\t\t\t\twhile($a = $result->fetch_assoc())//fetch_assoc(MYSQL_NUM) OR MYSQL_ASSOC\n\t\t\t\t\t$todo[] = $a;\n\t\t\t\t\n\t\t\t\t$todo = $todo[0];//idcurso\n\t\t\t\t$query = \"CREATE TABLE {$todo['idcurso']}{$arreglo['actividad']}extra{$arreglo['numExtra']} \";\n\t\t\t\t$query .=\"(ID INT AUTO INCREMENT PRIMARY KEY, \";\n\n\t\t\t\tfor($i = 1; $i <= $_POST['columnas']; $i++){\n\t\t\t\t\t$query .= \"c{$i} FLOAT ,\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$query = substr($query, 0, strlen($query) - 1);\n\t\t\t\t\t\n\t\t\t\t$query .= \")engine=innodb\";\n\n\t\t\t\t$this->bd_driver->query($query);\n\n\t\t\t\tif($this->bd_driver->errno){\n\t\t\t\t\tdie(\"No se pudo crear la tabla\");\n\t\t\t\t}\n\t\t\t\t$status[0] = true;\n\t\t\t}else{\n\t\t\t\t$status[0] = false;\n\t\t\t}\n\t\t\t\n\t\t\t\t$this->bd_driver->close();\n\t\t\t\treturn $status;\n\t\t}", "function newInsc($nom, $prenom, $dateNais, $sexe, $mail, $tel, $rue, $CP, $ville, $glisse, $pointure, $taille, $niveau)\n{\n //connection a la bdd\n $bdd = connectBDD();\n //creation de l'uid\n $id = uuid();\n //creation de la date du jour\n $dateInscription = date(\"Y-m-d\");\n //etatInscription\n $etatInscription = 0;\n //preparation de la requete\n $query = $bdd->prepare('INSERT INTO inscription(`idInscript`, `nom`, `prenom`, `dateNais`, `sexe`, `mail`, `tel`, `rue`, `CP`, `ville`, `glisse`, `pointure`, `taille`, `niveau`, `etatInscription`, `dateInscription`) VALUES (:idInscript,:nom,:prenom,:dateNais,:sexe,:mail,:tel,:rue,:CP,:ville,:glisse,:pointure,:taille,:niveau,:etatInscription,:dateInscription)');\n $query->execute(array(\n 'idInscript' => $id,\n 'nom' => $nom,\n 'prenom' => $prenom,\n 'dateNais' => $dateNais,\n 'sexe' => $sexe,\n 'mail' => $mail,\n 'tel' => $tel,\n 'rue' => $rue,\n 'CP' => $CP,\n 'ville' => $ville,\n 'glisse' => $glisse,\n 'pointure' => $pointure,\n 'taille' => $taille,\n 'niveau' => $niveau,\n 'etatInscription' => $etatInscription,\n 'dateInscription' => $dateInscription\n ));\n}", "public function insert($interescuentavivienda);", "function enregistrer_indice($num_indice, $prix, $enonce, $idEnigme) {\n //INSERT INTO `indice` (`id_indice`, `num_indice`, `prix`, `enonce`, `idEnigme`) VALUES (NULL, '1', '1', 'enonce de l'indice', '7');\n\n $req = Database::get()->prepare_execute_add_up_del(\"INSERT INTO indice (id_indice, num_indice, prix, enonce, idEnigme) VALUES (NULL, :num_indice, :prix, :enonce, :idEnigme)\",\n array(\n 'num_indice' => $num_indice,\n 'prix' => $prix,\n 'enonce' => $enonce,\n 'idEnigme' => $idEnigme\n ));\n return $req;\n}", "public function insert_evaluacion_curso($datos, $data) {\n $resultado = array('result' => null, 'msg' => '', 'data' => null);\n $this->db->trans_begin(); //Definir inicio de transacción\n\n $tabla = $this->config[$data['bloque']][$data['seccion']]['evaluacion']['entidad'];\n $campo = $this->config[$data['bloque']][$data['seccion']]['evaluacion']['pk'];\n $datos->{$campo} = $data['registro'];\n\n $this->db->insert($tabla, $datos); //Inserción de registro\n\n $data_id = $this->db->insert_id(); //Obtener identificador insertado\n\n if ($this->db->trans_status() === FALSE) {\n $this->db->trans_rollback();\n $resultado['result'] = FALSE;\n $resultado['msg'] = $this->string_values['error'];\n } else {\n $this->db->trans_commit();\n $resultado['data']['identificador'] = $data_id;\n $resultado['msg'] = $this->string_values['insercion'];\n $resultado['result'] = TRUE;\n }\n\n return $resultado;\n }", "function insertarDefProyectoSeguimientoActividad(){\n\t\t$this->procedimiento='sp.ft_def_proyecto_seguimiento_actividad_ime';\n\t\t$this->transaccion='SP_PRSEAC_INS';\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_def_proyecto_seguimiento','id_def_proyecto_seguimiento','int4');\n\t\t$this->setParametro('id_def_proyecto_actividad','id_def_proyecto_actividad','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('porcentaje_avance','porcentaje_avance','numeric');\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}", "function insertarRevisarComisionistas(){\n $this->procedimiento='conta.ft_comisionistas_ime';\n $this->transaccion='CONTA_REM_IST';\n $this->tipo_procedimiento='IME';\n\n //Define los parametros para la funcion\n $this->setParametro('id_agencia','id_agencia','int4');\n $this->setParametro('id_periodo','id_periodo','int4');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function insertarSolicitudCompleta()\n {\n $this->objFunc = $this->create('MODSolicitud');\n if ($this->objParam->insertar('id_solicitud')) {\n $this->res = $this->objFunc->insertarSolicitudCompleta($this->objParam);\n } else {\n //$this->res=$this->objFunc->modificarSolicitud($this->objParam);\n //trabajar en la modificacion compelta de solicitud ....\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "function registrar_presentacion($datos_presentacion){\n\n\n\t\t//Se crea un objeto instanciado a la clase conexion\n\t\t$conexión = new Conexion();\n\n\t\t//Se usa el metodo conectar de la clase conexion\n\t\t$cadena_conexion = $conexión->Conectar();\n\n\t\t//Realizamos ek script para insertar un usuario\n\t\t$stmt = $cadena_conexion->prepare(\"INSERT INTO presentacion_producto (nombre,descripcion) VALUES(:nombre,:descripcion)\");\n\n\t\t//Parametros\n\t\t$stmt->bindParam(':nombre',$datos_presentacion[0]);\n\t\t$stmt->bindParam(':descripcion',$datos_presentacion[1]);\n\t\t//si la insercion del usuario se ejecuto entonces...\n\t\tif($stmt->execute()){\n\t\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\n\t}", "function MTD_REGISTRA_ENCUESTA ()\n {\n //TODO: Registrar encuesta\n //----------------------------\n\t //- Inicializa las variables -\n //----------------------------\n $vlf_rb_evaluacion_1=\"\";\n $vlf_rb_importancia_1=\"\";\n $vlf_tb_observaciones_1=\"\";\n \n $vlf_rb_evaluacion_2=\"\";\n $vlf_rb_importancia_2=\"\";\n $vlf_tb_observaciones_2=\"\";\n \n $vlf_rb_evaluacion_3=\"\";\n $vlf_rb_importancia_3=\"\";\n $vlf_tb_observaciones_3=\"\";\n \n $vlf_rb_evaluacion_4=\"\";\n $vlf_rb_importancia_4=\"\";\n $vlf_tb_observaciones_4=\"\";\n \n $vlf_rb_evaluacion_5=\"\";\n $vlf_rb_importancia_5=\"\";\n $vlf_tb_observaciones_5=\"\";\n \n $vlf_rb_evaluacion_6=\"\";\n $vlf_rb_importancia_6=\"\";\n $vlf_tb_observaciones_6=\"\";\n \n $vlf_rb_evaluacion_7=\"\";\n $vlf_rb_importancia_7=\"\";\n $vlf_tb_observaciones_7=\"\";\n \n $vlf_rb_evaluacion_8=\"\";\n $vlf_rb_importancia_8=\"\";\n $vlf_tb_observaciones_8=\"\";\n \n $vlf_rb_evaluacion_9=\"\";\n $vlf_rb_importancia_9=\"\";\n $vlf_tb_observaciones_9=\"\";\n \n $vlf_rb_evaluacion_10=\"\";\n $vlf_rb_importancia_10=\"\";\n $vlf_tb_observaciones_10=\"\";\n \n $vlf_rb_evaluacion_11=\"\";\n $vlf_rb_importancia_11=\"\";\n $vlf_tb_observaciones_11=\"\";\n \n $vlf_rb_evaluacion_12=\"\";\n $vlf_rb_importancia_12=\"\";\n $vlf_tb_observaciones_12=\"\";\n \n $vlf_rb_evaluacion_12=\"\";\n $vlf_rb_importancia_12=\"\";\n $vlf_tb_observaciones_12=\"\";\n \n $vlf_rb_evaluacion_13=\"\";\n $vlf_rb_importancia_13=\"\";\n $vlf_tb_observaciones_13=\"\";\n \n $vlf_rb_evaluacion_14=\"\";\n $vlf_rb_importancia_14=\"\";\n $vlf_tb_observaciones_14=\"\";\n \n $vlf_rb_evaluacion_15=\"\";\n $vlf_rb_importancia_15=\"\";\n $vlf_tb_observaciones_15=\"\";\n \n $vlf_rb_evaluacion_16=\"\";\n $vlf_rb_importancia_16=\"\";\n $vlf_tb_observaciones_16=\"\";\n \n $vlf_rb_evaluacion_17=\"\";\n $vlf_rb_importancia_17=\"\";\n $vlf_tb_observaciones_17=\"\";\n\n $vlf_tb_observaciones_18=\"\";\n //$vlf_tb_observacidescribe respuesta_encuestasones_19=\"\";\n \n $vlf_nombre_empresa=\"\";\n $vlf_nombre_funcionario=\"\";\n $vlf_nombre_sector=\"\";\n $resultado=false;\n //TODO: ASIGNAR EL NUMERO DE CLIENTES\n $vlf_id_cliente=\"50\";\n //----------------------------\n\t //- Asigna las variables -\n //----------------------------\n if (isset($_REQUEST['tb_nombre_empresa']))\n {\n $vlf_nombre_empresa= $_REQUEST['tb_nombre_empresa'];\n }\n \n if (isset($_REQUEST['tb_nombre_funcionario']))\n {\n $vlf_nombre_funcionario= $_REQUEST['tb_nombre_funcionario'];\n }\n \n if (isset($_REQUEST['tb_nombre_sector']))\n {\n $vlf_nombre_sector= $_REQUEST['tb_nombre_sector'];\n }\n if (isset($_REQUEST['rb_evaluacion_1']))\n {\n $vlf_rb_evaluacion_1 = $_REQUEST['rb_evaluacion_1']; \n }\n if (isset($_REQUEST['rb_importancia_1']))\n {\n $vlf_rb_importancia_1 = $_REQUEST['rb_importancia_1']; \n }\n if (isset($_REQUEST['tb_observaciones_1']))\n {\n $vlf_tb_observaciones_1 = $_REQUEST['tb_observaciones_1']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_2']))\n {\n $vlf_rb_evaluacion_2 = $_REQUEST['rb_evaluacion_2']; \n }\n if (isset($_REQUEST['rb_importancia_2']))\n {\n $vlf_rb_importancia_2 = $_REQUEST['rb_importancia_2']; \n }\n if (isset($_REQUEST['tb_observaciones_2']))\n {\n $vlf_tb_observaciones_2 = $_REQUEST['tb_observaciones_2']; \n } \n if (isset($_REQUEST['rb_evaluacion_3']))\n {\n $vlf_rb_evaluacion_3 = $_REQUEST['rb_evaluacion_3']; \n }\n if (isset($_REQUEST['rb_importancia_3']))\n {\n $vlf_rb_importancia_3 = $_REQUEST['rb_importancia_3']; \n }\n if (isset($_REQUEST['tb_observaciones_3']))\n {\n $vlf_tb_observaciones_3 = $_REQUEST['tb_observaciones_3']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_4']))\n {\n $vlf_rb_evaluacion_4 = $_REQUEST['rb_evaluacion_4']; \n }\n if (isset($_REQUEST['rb_importancia_4']))\n {\n $vlf_rb_importancia_4 = $_REQUEST['rb_importancia_4']; \n }\n if (isset($_REQUEST['tb_observaciones_4']))\n {\n $vlf_tb_observaciones_4 = $_REQUEST['tb_observaciones_4']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_5']))\n {\n $vlf_rb_evaluacion_5 = $_REQUEST['rb_evaluacion_5']; \n }\n if (isset($_REQUEST['rb_importancia_5']))\n {\n $vlf_rb_importancia_5 = $_REQUEST['rb_importancia_5']; \n }\n if (isset($_REQUEST['tb_observaciones_5']))\n {\n $vlf_tb_observaciones_5 = $_REQUEST['tb_observaciones_5']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_6']))\n {\n $vlf_rb_evaluacion_6 = $_REQUEST['rb_evaluacion_6']; \n }\n if (isset($_REQUEST['rb_importancia_6']))\n {\n $vlf_rb_importancia_6 = $_REQUEST['rb_importancia_6']; \n }\n if (isset($_REQUEST['tb_observaciones_6']))\n {\n $vlf_tb_observaciones_6 = $_REQUEST['tb_observaciones_6']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_7']))\n {\n $vlf_rb_evaluacion_7 = $_REQUEST['rb_evaluacion_7']; \n }\n if (isset($_REQUEST['rb_importancia_7']))\n {\n $vlf_rb_importancia_7 = $_REQUEST['rb_importancia_7']; \n }\n if (isset($_REQUEST['tb_observaciones_7']))\n {\n $vlf_tb_observaciones_7 = $_REQUEST['tb_observaciones_7']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_8']))\n {\n $vlf_rb_evaluacion_8 = $_REQUEST['rb_evaluacion_8']; \n }\n if (isset($_REQUEST['rb_importancia_8']))\n {\n $vlf_rb_importancia_8 = $_REQUEST['rb_importancia_8']; \n }\n if (isset($_REQUEST['tb_observaciones_8']))\n {\n $vlf_tb_observaciones_8 = $_REQUEST['tb_observaciones_8']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_9']))\n {\n $vlf_rb_evaluacion_9 = $_REQUEST['rb_evaluacion_9']; \n }\n if (isset($_REQUEST['rb_importancia_9']))\n {\n $vlf_rb_importancia_9 = $_REQUEST['rb_importancia_9']; \n }\n if (isset($_REQUEST['tb_observaciones_9']))\n {\n $vlf_tb_observaciones_9 = $_REQUEST['tb_observaciones_9']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_10']))\n {\n $vlf_rb_evaluacion_10 = $_REQUEST['rb_evaluacion_10']; \n }\n if (isset($_REQUEST['rb_importancia_10']))\n {\n $vlf_rb_importancia_10 = $_REQUEST['rb_importancia_10']; \n }\n if (isset($_REQUEST['tb_observaciones_10']))\n {\n $vlf_tb_observaciones_10 = $_REQUEST['tb_observaciones_10']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_11']))\n {\n $vlf_rb_evaluacion_11 = $_REQUEST['rb_evaluacion_11']; \n }\n if (isset($_REQUEST['rb_importancia_11']))\n {\n $vlf_rb_importancia_11 = $_REQUEST['rb_importancia_11']; \n }\n if (isset($_REQUEST['tb_observaciones_11']))\n {\n $vlf_tb_observaciones_11 = $_REQUEST['tb_observaciones_11']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_12']))\n {\n $vlf_rb_evaluacion_12 = $_REQUEST['rb_evaluacion_12']; \n }\n if (isset($_REQUEST['rb_importancia_12']))\n {\n $vlf_rb_importancia_12 = $_REQUEST['rb_importancia_12']; \n }\n if (isset($_REQUEST['tb_observaciones_12']))\n {\n $vlf_tb_observaciones_12 = $_REQUEST['tb_observaciones_12']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_13']))\n {\n $vlf_rb_evaluacion_13 = $_REQUEST['rb_evaluacion_13']; \n }\n if (isset($_REQUEST['rb_importancia_13']))\n {\n $vlf_rb_importancia_13 = $_REQUEST['rb_importancia_13']; \n }\n if (isset($_REQUEST['tb_observaciones_13']))\n {\n $vlf_tb_observaciones_13 = $_REQUEST['tb_observaciones_13']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_14']))\n { \n $vlf_rb_evaluacion_14 = $_REQUEST['rb_evaluacion_14']; \n }\n if (isset($_REQUEST['rb_importancia_14']))\n { \n $vlf_rb_importancia_14 = $_REQUEST['rb_importancia_14']; \n }\n if (isset($_REQUEST['tb_observaciones_14']))\n {\n $vlf_tb_observaciones_14 = $_REQUEST['tb_observaciones_14']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_15']))\n {\n $vlf_rb_evaluacion_15 = $_REQUEST['rb_evaluacion_15']; \n }\n if (isset($_REQUEST['rb_importancia_15']))\n {\n $vlf_rb_importancia_15 = $_REQUEST['rb_importancia_15']; \n }\n if (isset($_REQUEST['tb_observaciones_15']))\n {\n $vlf_tb_observaciones_15 = $_REQUEST['tb_observaciones_15']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_16']))\n {\n $vlf_rb_evaluacion_16 = $_REQUEST['rb_evaluacion_16']; \n }\n if (isset($_REQUEST['rb_importancia_16']))\n {\n $vlf_rb_importancia_16 = $_REQUEST['rb_importancia_16']; \n }\n if (isset($_REQUEST['tb_observaciones_16']))\n { \n $vlf_tb_observaciones_16 = $_REQUEST['tb_observaciones_16']; \n }\n \n if (isset($_REQUEST['rb_evaluacion_17']))\n {\n $vlf_rb_evaluacion_17 = $_REQUEST['rb_evaluacion_17']; \n }\n if (isset($_REQUEST['rb_importancia_17']))\n {\n $vlf_rb_importancia_17 = $_REQUEST['rb_importancia_17']; \n }\n if (isset($_REQUEST['tb_observaciones_17']))\n {\n $vlf_tb_observaciones_17 = $_REQUEST['tb_observaciones_17']; \n }\n \n if (isset($_REQUEST['tb_observaciones_18']))\n {\n $vlf_tb_observaciones_18 = $_REQUEST['tb_observaciones_18']; \n }\n \n if (isset($_REQUEST['tb_observaciones_19']))\n {\n $vlf_tb_observaciones_19 = $_REQUEST['tb_observaciones_19']; \n }\n //------------------------\n\t //- Asigna sentencia sql -\n //------------------------\n $vlf_sql_insert=\"INSERT INTO respuesta_encuestas \n (nombre_empresa,nombre_funcionario,nombre_sector,id_cliente,\n evaluacion1,importancia1,observaciones1,\n\t\tevaluacion2,importancia2,observaciones2,\n\t\tevaluacion3,importancia3,observaciones3,\n\t\tevaluacion4,importancia4,observaciones4,\n\t\tevaluacion5,importancia5,observaciones5,\n\t\tevaluacion6,importancia6,observaciones6,\n\t\tevaluacion7,importancia7,observaciones7,\n\t\tevaluacion8,importancia8,observaciones8,\n\t\tevaluacion9,importancia9,observaciones9,\n\t\tevaluacion10,importancia10,observaciones10,\n\t\tevaluacion11,importancia11,observaciones11,\n\t\tevaluacion12,importancia12,observaciones12,\n\t\tevaluacion13,importancia13,observaciones13,\n\t\tevaluacion14,importancia14,observaciones14,\n\t\tevaluacion15,importancia15,observaciones15,\n\t\tevaluacion16,importancia16,observaciones16,\n\t\tevaluacion17,importancia17,observaciones17,\n\t\tobservaciones18,observaciones19) \n\t\tVALUES\n\t\t('$vlf_nombre_empresa','$vlf_nombre_funcionario','$vlf_nombre_sector','$vlf_id_cliente',\n\t\t'$vlf_rb_evaluacion_1','$vlf_rb_importancia_1','$vlf_tb_observaciones_1',\n '$vlf_rb_evaluacion_2','$vlf_rb_importancia_2','$vlf_tb_observaciones_2',\n '$vlf_rb_evaluacion_3','$vlf_rb_importancia_3','$vlf_tb_observaciones_3',\n '$vlf_rb_evaluacion_4','$vlf_rb_importancia_4','$vlf_tb_observaciones_4',\n '$vlf_rb_evaluacion_5','$vlf_rb_importancia_5','$vlf_tb_observaciones_5',\n '$vlf_rb_evaluacion_6','$vlf_rb_importancia_6','$vlf_tb_observaciones_6',\n '$vlf_rb_evaluacion_7','$vlf_rb_importancia_7','$vlf_tb_observaciones_7',\n '$vlf_rb_evaluacion_8','$vlf_rb_importancia_8','$vlf_tb_observaciones_8',\n '$vlf_rb_evaluacion_9','$vlf_rb_importancia_9','$vlf_tb_observaciones_9',\n '$vlf_rb_evaluacion_10','$vlf_rb_importancia_10','$vlf_tb_observaciones_10',\n '$vlf_rb_evaluacion_11','$vlf_rb_importancia_11','$vlf_tb_observaciones_11',\n '$vlf_rb_evaluacion_12','$vlf_rb_importancia_12','$vlf_tb_observaciones_12',\n '$vlf_rb_evaluacion_13','$vlf_rb_importancia_13','$vlf_tb_observaciones_13',\n '$vlf_rb_evaluacion_14','$vlf_rb_importancia_14','$vlf_tb_observaciones_14',\n '$vlf_rb_evaluacion_15','$vlf_rb_importancia_15','$vlf_tb_observaciones_15',\n '$vlf_rb_evaluacion_16','$vlf_rb_importancia_16','$vlf_tb_observaciones_16',\n '$vlf_rb_evaluacion_17','$vlf_rb_importancia_17','$vlf_tb_observaciones_17',\n '$vlf_tb_observaciones_18','$vlf_tb_observaciones_19')\n\t\t \";\n \n $resultado= FN_RUN_MYSQL_NONQUERY($vlf_sql_insert,$this->vlc_conexion);\n //echo \"SQL ($resultado) $vlf_sql_insert\";\n return $resultado;\n }", "function insertarDosificacionExter(){\n $this->procedimiento='vef.ft_dosificacion_ime';\n $this->transaccion='VF_DOS_INSEX';\n $this->tipo_procedimiento='IME';\n\n //Define los parametros para la funcion\n $this->setParametro('id_sucursal','id_sucursal','int4');\n $this->setParametro('final','final','integer');\n $this->setParametro('tipo','tipo','varchar');\n $this->setParametro('fecha_dosificacion','fecha_dosificacion','date');\n $this->setParametro('nro_siguiente','nro_siguiente','int4');\n $this->setParametro('nroaut','nroaut','varchar');\n $this->setParametro('fecha_inicio_emi','fecha_inicio_emi','date');\n $this->setParametro('fecha_limite','fecha_limite','date');\n $this->setParametro('tipo_generacion','tipo_generacion','varchar');\n $this->setParametro('glosa_impuestos','glosa_impuestos','varchar');\n $this->setParametro('id_activida_economica','id_activida_economica','varchar');\n $this->setParametro('llave','llave','codigo_html');\n $this->setParametro('inicial','inicial','integer');\n $this->setParametro('estado_reg','estado_reg','varchar');\n $this->setParametro('glosa_empresa','glosa_empresa','varchar');\n\n $this->setParametro('nro_tramite','nro_tramite','varchar');\n $this->setParametro('nombre_sistema','nombre_sistema','varchar');\n $this->setParametro('leyenda','leyenda','varchar');\n $this->setParametro('rnd','rnd','varchar');\n\n\t\t\t\t/*Aumentando para dosificaciones de facturacion por exportacion\n\t\t\t\tDev: Ismael Valdivia\n\t\t\t\tFecha Mod: 19/04/2021*/\n\t\t\t\t$this->setParametro('caracteristica','caracteristica','varchar');\n\t\t\t\t$this->setParametro('titulo','titulo','varchar');\n\t\t\t\t$this->setParametro('subtitulo','subtitulo','varchar');\n\t\t\t\t/*************************************************************/\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function registrar_solicitud ($datos, $dia, $fecha_inicio, $fecha_fin){\n \n $anio_lectivo=date('Y', strtotime($fecha_inicio));\n \n $periodos=$this->dep('datos')->tabla('periodo')->get_periodo_calendario($fecha_inicio, $anio_lectivo, $this->s__datos_solcitud['id_sede']);\n \n $id_=$this->obtener_periodo($periodos, $this->s__datos_solcitud['tipo_asignacion']);\n \n if(strcmp($this->s__datos_solcitud['tipo_agente'], \"Organizacion\")==0){\n $apellido=' . ';\n $nro_doc=' - ';\n $tipo_doc=' - ';\n }else{\n $apellido=$this->s__datos_responsable[0]['apellido'];\n $nro_doc=$this->s__datos_responsable[0]['nro_docum'];\n $tipo_doc=$this->s__datos_responsable[0]['tipo_docum'];\n }\n //--Usamos ambos arreglos, $datos y $s__datos_solcitud.\n $asignacion=array(\n 'finalidad' => $datos['finalidad'],\n 'descripcion' => $datos['descripcion'],\n 'hora_inicio' => $datos['hora_inicio'],\n 'hora_fin' => $datos['hora_fin'],\n 'cantidad_alumnos' => $datos['capacidad'],\n 'facultad' => $this->s__datos_solcitud['facultad'],\n 'nro_doc' => $nro_doc,\n 'tipo_doc' => $tipo_doc,\n 'id_aula' => $this->s__datos_solcitud['id_aula'],\n 'modulo' => 1,\n 'tipo_asignacion' => $this->s__datos_solcitud['tipo_asignacion'],\n 'id_periodo' => $id_,\n 'id_responsable_aula' => $this->s__datos_solcitud['id_responsable'],\n 'nombre' => $this->s__datos_responsable[0]['nombre'],\n 'apellido' => $apellido,\n 'legajo' => $this->s__datos_responsable[0]['legajo'],\n );\n \n //Este grupo de funciones se copia tal cual desde la operacion Cargar Asignaciones. En este caso\n //intentamos no alterar sus estructuras.\n $this->registrar_asignacion($asignacion);\n \n //Agregamos a $asignacion datos extra relacionados a un periodo, para no alterar la estructura \n //de esta funcion. $dia tiene el mismo formato retornado por ef_multi_seleccion_check.\n $asignacion['dias']=$dia;\n $asignacion['fecha_inicio']=$fecha_inicio;//$this->s__datos_solcitud['fecha'];\n $asignacion['fecha_fin']=$fecha_fin;//$this->s__datos_solcitud['fecha'];\n \n $this->registrar_asignacion_periodo($asignacion);\n \n //Pasamos la solicitud a estado finalizada. Para ello solamente necesitamos el id_solicitud guardado\n //en la variable s__datos_solcitud. Internamente vamos a utilizar datos_tabla.\n $this->pasar_a_estado_finalizada('ACEPTADA');\n \n //Enviamos una notificacion al interesado.\n //$this->notificar();\n }", "function insertarComisionistas(){\n\t\t$this->procedimiento='conta.ft_comisionistas_ime';\n\t\t$this->transaccion='CONTA_CMS_INS';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n $this->setParametro('nit_comisionista','nit_comisionista','varchar');\n $this->setParametro('nro_contrato','nro_contrato','varchar');\n $this->setParametro('codigo_producto','codigo_producto','varchar');\n $this->setParametro('descripcion_producto','descripcion_producto','varchar');\n $this->setParametro('cantidad_total_entregado','cantidad_total_entregado','numeric');\n $this->setParametro('cantidad_total_vendido','cantidad_total_vendido','numeric');\n $this->setParametro('precio_unitario','precio_unitario','numeric');\n $this->setParametro('monto_total','monto_total','numeric');\n $this->setParametro('monto_total_comision','monto_total_comision','numeric');\n $this->setParametro('id_periodo','id_periodo','int4');\n $this->setParametro('id_depto_conta','id_depto_conta','int4');\n $this->setParametro('estado_reg','estado_reg','varchar');\n\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}", "function registrarAfiliado($idinversionista,$nombres,$apellidos,$dni,$celular,$email,$imagen,$contrasenia){\n $db=new baseDatos();\n try {\n $conexion=$db->conectar();\n $sql='INSERT INTO tb_inversionista( nombres , apellidos , dni , celular ,email, imagen , contrasenia)'.\n ' VALUES( :nombres , :apellidos , :dni , :celular , :email , :imagen , :contrasenia)';\n $sentencia=$conexion->prepare($sql);\n $sentencia->bindParam(':nombres',$nombres);\n $sentencia->bindParam(':apellidos',$apellidos);\n $sentencia->bindParam(':dni',$dni);\n $sentencia->bindParam(':celular',$celular);\n $sentencia->bindParam(':email',$email);\n $sentencia->bindParam(':imagen',$imagen);\n $sentencia->bindParam(':contrasenia',$contrasenia);\n $sentencia->execute();\n $id=$conexion->lastInsertId();\n //insertar inversion inicial sin datos\n $sinversion=new sinversion();\n $sinversion->insertarInversion($id);\n $safiliado=new safiliado();\n $safiliado->registrarAfiliacion($idinversionista,$id,1);\n return $id;\n } catch (PDOException $e) {\n throw $e;\n }\n }", "FUNCTION registrarAvance($id_actividad,$avance_actividad,$dificultad_actividad,$fecha_avance,$porcentaje_avance_actividad, $id_usuario, $id_estatus){\n\t $sql_v_actividad='INSERT INTO v_seguimiento_actividades (id_actividad,avance_actividad,dificultad_actividad,fecha_avance,porcentaje_avance_actividad,id_usuario_registra,id_estatus)VALUES ('.$id_actividad.', '.$avance_actividad.', '.$dificultad_actividad.', '.$fecha_avance.','.$porcentaje_avance_actividad.' ,'.$id_usuario.','.$id_estatus.');';\n\t$result=pg_query($sql_v_actividad) or die();\n\n\treturn true;\n}", "public function __construct(EvaluacionCalidad $evaluacion)\n {\n $this->evaluacion = $evaluacion;\n }", "function salvaHistorico($sit, $id, $usuario){\n $data = date('d/m/y');\n $hora = date ('H:i:s');\n $user = $_SESSION['Usuario'];\n // 0 enviar contabilidade\n if ($sit == 0){\n $this->execute(\"INSERT INTO historicos (projeto_id, usuario_id, ds_historico) VALUES\n ($id, $usuario, 'Estudo de Viabilidade enviado para Classificação Contábil efetuado pelo usuário $user em $data as $hora')\");\n }\n //1 classificar contabilmente\n else if ($sit == 1){\n $this->execute(\"INSERT INTO historicos (projeto_id, usuario_id, ds_historico) VALUES\n ($id, $usuario, 'Estudo de Viabilidade Classificado Contabilmente efetuado pelo usuário $user em $data as $hora')\");\n }\n //2 enviar patrocinador\n else if ($sit == 2){\n $this->execute(\"INSERT INTO historicos (projeto_id, usuario_id, ds_historico) VALUES\n ($id, $usuario, 'Estudo de Viabilidade enviado para Patrocinador efetuado pelo usuário $user em $data as $hora')\");\n }\n //3 aprovar estudo\n else if ($sit == 3){\n $this->execute(\"INSERT INTO historicos (projeto_id, usuario_id, ds_historico) VALUES\n ($id, $usuario, 'Estudo de Viabilidade aprovado pelo usuário $user em $data as $hora')\");\n }\n //4 cancelar classificacao contabil do estudo\n else if ($sit == 4){\n $this->execute(\"INSERT INTO historicos (projeto_id, usuario_id, ds_historico) VALUES\n ($id, $usuario, 'Cancelada a classificação contábil do Estudo de Viabilidade pelo usuário $user em $data as $hora')\");\n }\n //5 reprovar estudo\n else if ($sit == 5){\n $this->execute(\"INSERT INTO historicos (projeto_id, usuario_id, ds_historico) VALUES\n ($id, $usuario, 'Estudo de Viabilidade Reprovado pelo usuário $user em $data as $hora')\");\n }\n }", "public function insert($fertilizante_has_ingrediente);", "function addIter($testoview,$testoedit){\n $db=$this->db;\n $usr=$_SESSION['USER_NAME'];\n \n $today=date('j-m-y'); \n $sql=\"INSERT INTO pe.iter(pratica,data,utente,nota,nota_edit,uidins,tmsins,stampe,immagine) VALUES($this->pratica,'$today','$usr','$testoview','$testoedit',$this->userid,\".time().\",null,'laserjet.gif');\";\n $db->sql_query($sql);\n }", "function InsertarRegistos($idcarca,$id_esc,$ciclo,$clave,$seccion,$aula,$dia,$hi,$hf,$carga_esc,$id_faci){\n $InsertReport = Conexion::conectar()->prepare(\"INSERT INTO `reporte`(`id_esc`, `ciclo`,`id_carga`, `clave_comp`, `seccion`, `aula`, `dia`, `hi`, `hf`,`carga_esc`, `id_faci`) VALUES (?,?,?,?,?,?,?,?,?,?,?)\");\n $InsertReport ->execute(array($id_esc,$ciclo,$idcarca,$clave,$seccion,$aula,$dia,$hi,$hf,$carga_esc,$id_faci));\n }", "public function insert($notificacion){\n $idmensaje=$notificacion->getIdmensaje();\n$fechaMensaje=$notificacion->getFechaMensaje();\n$fundacion_idFundacion=$notificacion->getFundacion_idFundacion()->getIdFundacion();\n$usuario_idUsuario=$notificacion->getUsuario_idUsuario()->getIdUsuario();\n$descripcion=$notificacion->getDescripcion();\n\n try {\n $sql= \"INSERT INTO `notificacion`( `idmensaje`, `fechaMensaje`, `Fundacion_idFundacion`, `Usuario_idUsuario`, `Descripcion`)\"\n .\"VALUES ('$idmensaje','$fechaMensaje','$fundacion_idFundacion','$usuario_idUsuario','$descripcion')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }" ]
[ "0.6407194", "0.6401377", "0.63953", "0.63297814", "0.63297814", "0.596289", "0.5913428", "0.5907069", "0.5907069", "0.58859396", "0.5786654", "0.5760176", "0.57398295", "0.5672449", "0.5625381", "0.5614312", "0.56105614", "0.5600271", "0.5543302", "0.5534036", "0.55265373", "0.55256677", "0.54801154", "0.5471912", "0.54554343", "0.5451461", "0.5450985", "0.5436429", "0.5428666", "0.54264736" ]
0.8000909
0
Function _addCompanyAddressTransaction to add Company Address DB Transactions
private function _addCompanyAddressTransaction($requestAddress) { return DB::transaction(function () use ($requestAddress) { // Add Address data $objAddress = $this->_addressRepository->save($this->_addressTransformer->transformRequestParameters($requestAddress)); // Add company address mapping // $companyAddress['CompanyAddressId'] = Uuid::generate()->string; $companyAddress['CompanyId'] = $requestAddress["company_id"]; $companyAddress['AddressId'] = $objAddress->AddressId; $this->_companyAddressModel->create($companyAddress); return $objAddress; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAddress(Address $address): void;", "abstract public function transactionCommit();", "public function addTransaction($model) {\n\t\t$this->loadMetadata();\n\n\t\t// Just something to trigger transaction load\n\t\t$tService = new Transaction($this->context, 'OcTransaction');\n\t\t$t = new OcTransaction();\n\n\t\t$tModel = array_map(function ($item) {\n\t\t\treturn (is_scalar($item)) ? $item : null;\n\t\t}, $model);\n\n\t\t$curService = new App\\Resource\\Currency($this->context->em, 'OcCurrency');\n\t\t$sService = new App\\Resource\\Store($this->context->em, 'OcStore');\n\n\t\t$reader = new ArrayReader(array($tModel));\n\t\t//$writer = new DoctrineWriter($this->context->em, 'OcTransaction');\n\t\t$writer = new CallbackWriter(\n\t\t\tfunction ($item) use (&$t, &$tService, &$curService, &$sService) {\n\t\t\t\ttry {\n\t\t\t\t\t$t = $tService->writeItem($item); // Set camelize flag to true - input has already been mapped to their camelcase equivalents\n\n\t\t\t\t\t// TODO: Fix writeItem associations\n\t\t\t\t\tif (isset($item['currency_id'])) {\n\t\t\t\t\t\t$cur = $curService->getEntity($item['currency_id'], false);\n\t\t\t\t\t\t$t->setCurrency($cur);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($item['store_id'])) {\n\t\t\t\t\t\tif ($item['store_id'] > 0) {\n\t\t\t\t\t\t\t$s = $sService->getEntity($item['store_id'], false);\n\t\t\t\t\t\t\t$t->setStore($s);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$t->setStoreId(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$date = new DateTime();\n\t\t\t\t\t$t->setDateAdded($date);\n\t\t\t\t\t$t->setDateModified($date);\n\n\t\t\t\t\t$tService->updateEntity($t);\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\t\t\t});\n\n\t\t$workflow = new Workflow($reader);\n\t\tself::addDateConverters($workflow);\n\t\t$workflow->addWriter($writer);\n\t\t$workflow->process();\n\n\t\t$transactionId = $t->getTransactionId();\n\t\tif ($transactionId == null || !($transactionId > 0)) {\n\t\t\tthrow new Exception('Could not create the transaction entity - exiting');\n\t\t}\n\n\t\t$mappings = []; // Clear mappings for var reuse\n\n\t\t// I left a note in the mapDoctrineEntity method regarding nesting\n\t\t$this->mapInvoice($mappings);\n\n\t\t// TODO: If transaction id is false we need to throw an error or exception\n\t\t$model = $model['invoice']; // TODO: Detect type and switch array key accordingly\n\n\t\t// Strip out lines and process separately\n\t\t$lines = $model['lines'];\n\t\tunset($model['lines']);\n\n\t\t$c = null;\n\t\t$cService = null;\n\n\t\tif (isset($model['customer_id'])) {\n\t\t\t$cService = new App\\Resource\\Customer($this->context->em, 'OcCustomer');\n\n\t\t\t$customerId = $model['customer_id'];\n\t\t\t$c = $cService->getEntity($customerId, false);\n\t\t}\n\n\t\t$output = [];\n\n\t\t$i = false;\n\t\t$iService = $this; // We'll need this context\n\t\t$reader = new ArrayReader(array($model));\n\n\t\t$writer = new CallbackWriter(\n\t\t\tfunction ($item) use (&$iService, &$cService, &$t, &$i, &$c, &$lines, &$mappings) {\n\t\t\t\ttry {\n\t\t\t\t\t$i = $iService->writeItem($item, false);\n\n\t\t\t\t\t$i->setTransaction($t);\n\t\t\t\t\t$i->setPaymentMethod('Cash/Credit Card');\n\n\t\t\t\t\t$invoiceNo = $this->createInvoiceNo(true); // Set flag to check against QB as well\n\n\t\t\t\t\tif (empty($invoiceNo)) {\n\t\t\t\t\t\t// Throw an exception! QBO fill f**k up if you don't have an incremented invoice number\n\t\t\t\t\t\t// And to keep consistency between QBO and QC, we want to make sure we're assigning it on our end\n\n\t\t\t\t\t\t/*Reference number for the transaction. If not explicitly provided at create time, this field is populated based on the setting of Preferences:CustomTxnNumber as follows:\n\n\t\t\t\t\t\tIf Preferences:CustomTxnNumber is true a custom value can be provided. If no value is supplied, the resulting DocNumber is null.\n \t\t\t\t\tIf Preferences:CustomTxnNumber is false, resulting DocNumber is system generated by incrementing the last number by 1.\n\n\t\t\t\t\t\tIf Preferences:CustomTxnNumber is false and a value is supplied, that value is stored even if it is a duplicate. Recommended best practice: check the setting of Preferences:CustomTxnNumber before setting DocNumber.\n\t\t\t\t\t\tSort order is ASC by default.*/\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Set the invoice number!\n\t\t\t\t\t\t$i->setInvoiceNo($invoiceNo);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($c)) {\n\t\t\t\t\t\t$i->setCustomer($c);\n\t\t\t\t\t}\n\n\t\t\t\t\t$iService->updateEntity($i);\n\n\t\t\t\t\t$iService->editLines($i, $mappings, $lines, true); // TODO: Last param is a add/edit mode flag - quick fix, see below for details\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\t\t\t});\n\n\t\t$workflow = new Workflow($reader);\n\t\t$workflow->addWriter($writer);\n\t\t$workflow->process();\n\n\t\t/*$converter = new MappingItemConverter();\n\t\t$nestedConverter = new NestedMappingItemConverter('lines');\n\t\tforeach ($mappings as $key => $value) {\n\t\t\t$to = $key;\n\t\t\t$from = $value;\n\n\t\t\tif (is_string($from)) {\n\t\t\t\t$converter->addMapping($from, $to); // TODO: The mappings need to be reversed for this...\n\t\t\t} elseif (is_array($from) && (array_keys($from) !== range(0, count($from) - 1))) {\n\t\t\t\t// Only process associative arrays, we need to use a different converter for sequential arrays\n\t\t\t\t$converter->addMapping($to, array_flip($value));\n\t\t\t} elseif (is_array($from) && (array_keys($from) == range(0, count($from) - 1))) {\n\t\t\t\t$from[0]['orderProductId'] = 'order_product_id'; // TODO: Mappings aren't working right here!!!\n\t\t\t\t$from[0]['orderId'] = 'order_product_id'; // TODO: Mappings aren't working right here!!!\n\n\t\t\t\t//$nestedConverter->addMapping($to, array_flip($from[0]));\n\t\t\t}\n\t\t}\n\n\t\t$workflow->addItemConverter($converter);\n\t\t//$workflow->addItemConverter($nestedConverter);\n\t\t$workflow->process();*/\n\t\t\n\t\treturn $i->getInvoiceId();\n\t}", "public function add_account_from_address($address, $block_hash){\n $address=san($address);\n $block_hash=san($block_hash);\n $sql=OriginSql::getInstance();\n $res=$sql->add('acc',array(\n 'id'=>$address,\n 'public_key'=>'',\n 'block'=>$block_hash,\n 'balance'=>0,\n 'alias'=>NULL\n ));\n if ($res) {\n $this->log('account.inc->add_account_from_address true',0,true);\n return true;\n }else{\n $this->log('account.inc->add_account_from_address false',0,true);\n return false;\n }\n }", "function AddCargo($arryDetails) {\r\n\r\n global $Config;\r\n\r\n extract($arryDetails);\r\n //if($main_state_id>0) $OtherState = '';\r\n //if($main_city_id>0) $OtherCity = '';\r\n //if(empty($Status)) $Status=1;\r\n //$LandlineNumber = trim($Landline1.' '.$Landline2.' '.$Landline3);\r\n\r\n $ipaddress = $_SERVER[\"REMOTE_ADDR\"];\r\n $JoiningDatl = $Config['TodayDate'];\r\n\r\n $strSQLQuery = \"insert into w_cargo(SuppCode,ReleaseDate,ReleaseBy,SalesPersonID,ReleaseTo,CustCode,CustID,CarrierName,TransactionRef,TransportMode,PackageMode,ShipmentNo,PackageLoad,FirstName,LastName,LicenseNo,Address,Mobile,Status)values('\" . addslashes($SuppCode) . \"','\" . addslashes($ReleaseDate) . \"', '\" . addslashes($SalesPerson) . \"','\" . addslashes($SalesPersonID) . \"','\" . addslashes($CustCode) . \"','\" . addslashes($CustID) . \"','\" . addslashes($CustomerName) . \"','\" . addslashes($CarrierName) . \"','\" . addslashes($TransactionRef) . \"','\" . addslashes($TransportMode) . \"','\" . addslashes($PackageMode) . \"', '\" . addslashes($ShipmentNo) . \"','\" . addslashes($PackageLoad) . \"', '\" . addslashes($FirstName) . \"','\" . addslashes($LastName) . \"','\" . addslashes($LicenseNo) . \"','\" . addslashes($Address) . \"','\" . addslashes($Mobile) . \"','\" . $Status . \"' )\";\r\n //echo $strSQLQuery;\r\n //exit;\r\n //(WID,Address,city_id, state_id, ZipCode, country_id)values('\".addslashes($warehouse_name).\"' '\".$main_city_id.\"', '\".$main_state_id.\"','\".addslashes($ZipCode).\"', '\".$country_id.\"' )\";\r\n\r\n $this->query($strSQLQuery, 0);\r\n\r\n\r\n\r\n $WID = $this->lastInsertId();\r\n\r\n if ($WID > 0) {\r\n if (empty($SuppCode)) {\r\n $ReleaseNo = 'RNOOO' . $WID;\r\n $strQuery1 = \"update w_cargo set SuppCode='\" . $ReleaseNo . \"' where cargo_id=\" . $WID;\r\n $this->query($strQuery1, 0);\r\n }\r\n }\r\n\r\n\r\n return $WID;\r\n }", "public function transactions();", "public function addAddressAction() {\n $value = json_decode(file_get_contents('php://input'));\n //$this->check_method('POST');\n $customerid = $value->customerid;\n $country = $value->country;\n $zipcode = $value->zipcode;\n $city = $value->city;\n $telephone = $value->telephone;\n $fax = $value->fax;\n $company = $value->company;\n $street = $value->street;\n $state = $value->state;\n $default_billing = $value->default_billing;\n $default_shipping = $value->default_shipping;\n\n $customer = Mage::getModel('customer/customer')->load($customerid);\n\n $address = Mage::getModel(\"customer/address\");\n $address->setCustomerId($customer->getId())\n ->setFirstname($customer->getFirstname())\n ->setMiddleName($customer->getMiddlename())\n ->setLastname($customer->getLastname())\n ->setCountryId($country)\n ->setPostcode($zipcode)\n ->setCity($city)\n ->setRegion($state)\n ->setTelephone($telephone)\n ->setFax($fax)\n ->setCompany($company)\n ->setStreet($street)\n ->setSaveInAddressBook('1');\n\n if ($default_billing == 'Yes') {\n $address->setIsDefaultBilling('1');\n }\n if ($default_shipping == 'Yes') {\n $address->setIsDefaultShipping('1');\n }\n\n try {\n $address->save();\n $response = array('status' => 1, 'message' => 'Address added successfully!');\n } catch (Exception $e) {\n //Zend_Debug::dump($e->getMessage());\n $response = array('status' => 0, 'message' => $e->getMessage());\n }\n //\t$this->response($this->json( $response), 200);\n $jsonData = $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n }", "public function transactionCommit();", "private static function addToDatabase()\n {\n self::$order->address_id = self::$address->id;\n self::$order->user_id = self::$user->id;\n self::$order->order_date = Carbon::now()->format('Y-m-d h:i:s');\n self::$order->save();\n }", "public function createOrUpdateAddress($addressInput = []);", "public function addAddress($addr) {\n $this->addr = new ECpnyAddr();\n $this->addr = $addr;\n \n /* print \"<pre>\";\n print_r($this->addr);\n print \"</pre>\";\n exit();*/\n \n /**\n * Add address to company\n */\n $this->db->set('company_id', $this->addr->getCompany_id());\n $this->db->set('zipid', $this->addr->getZipid());\n $this->db->set('zipcode', $this->addr->getZipcode());\n $this->db->set('address', $this->addr->getAddress());\n $this->db->set('addr_number', $this->addr->getAddr_number());\n $this->db->set('district', $this->addr->getDistrict());\n $this->db->set('city', $this->addr->getCity());\n $this->db->set('state', $this->addr->getState());\n $this->db->set('reference', $this->addr->getReference());\n \n $result = $this->db->insert($this->addr_table);\n //\n $this->msg->setStatus($result); \n \n if (!$this->msg->getStatus()) { \n $error = $this->db->error(); // Has keys 'code' and 'message'\n $this->msg->setMsgError(' addAddress(): '.' - '.$error['code'].' - '.$error['message']);\n } else {\n $this->msg->setMsgSuccess(\"Empresa Cadastrada com Sucesso!\");\n }\n \n /* \n print \"<pre>\";\n print_r($this->msg);\n print \"</pre>\";\n exit(); \n */ \n //\n return $this->msg;\n }", "private function addAddress($options)\n {\n $billing_address = isset($options['billing_address'])\n ? $options['billing_address']\n : $options['address'];\n\n $this->post['CustomerAddress'] = join(', ', $billing_address);\n\n $this->post['CustomerPostcode'] = $billing_address['zip'];\n }", "public static function create($data = array()){\n $trx = new Transaction();\n $trx->customer_name = $data['customerName'];\n $trx->vehicle_id = $data['vehiclesid'];\n $trx->status = statusWorkOrder::OPEN;\n $trx->payment_state = paymentState::INITIATE;\n $trx->date = date(static::$sqlformat);\n $batch = Batch::getSingleResult(array(\n 'status' => array(batchStatus::UNSETTLED)\n ));\n if ($batch===null) {\n $batch = Batch::create(array());\n }\n $trx->batch_id = $batch->id;\n $trx->save();\n\n\n //define amount variable\n $amountItem=(double)0;\n //add items if available\n if(isset($data['items']) && is_array($data['items'])) {\n foreach($data['items'] as $items) {\n $item_price = ItemPrice::getSingleResult(array('item_id' => $items['item_id']));\n $items['item_price_id']=$item_price->id;\n $trx->transaction_item()->insert($items);\n $itemPrice = (double)Item::find((int)$items['item_id'])->price;\n $amountItem=$amountItem+($itemPrice*$items['quantity']);\n $stock=($item_price->item->stock - $items['quantity']);\n $updatestock = Item::updateStock($item_price->item->id, $stock);\n }\n }\n\n //add service\n $amountService=(double)0;\n $discAmount=(double)0;\n if(isset($data['services']) && is_array($data['services'])) {\n foreach($data['services'] as $service) {\n $trx->transaction_service()->insert($service);\n $servicePrice = (double)Service::find((int)$service['service_formula_id'])->service_formula()->price;\n $amountService=$amountService+$servicePrice;\n }\n $membership = Member::getSingleResult(array(\n 'status' => array(statusType::ACTIVE),\n 'vehicle_id' => $data['vehiclesid'],\n 'is_member' => true\n ));\n if ($membership) {\n $trx->membership_id=$membership->id;\n if (isset($membership->discount)){\n $discAmount = $amountService * ($membership->discount->value / 100);\n }\n }\n }\n\n //add mechanic\n if(isset($data['users']) && is_array($data['users'])) {\n foreach($data['users'] as $user) {\n $trx->user_workorder()->insert($user);\n }\n }\n\n\n //GENERATE WORK ORDER & INVOICE NO\n $woNo = 'C'.$data['customerId'].'V'.$data['vehiclesid'].($trx->id);\n $date = date(static::$yyyymmdd_format, time());\n $invNo = $date.($trx->id);\n $trx->invoice_no= $invNo;\n $trx->workorder_no = $woNo;\n $trx->amount = ($amountItem+$amountService);\n $trx->discount_amount = $discAmount;\n $trx->paid_amount = ($amountItem + $amountService - $discAmount);\n $trx->save();\n return $trx->id;\n }", "function insertPF($objAdd) // melhorar- deletar endereço ou company caso tenha sido inserido\n {\n if($this->verifyInsert()) return false;\n\n // Inserting Address\n if(!$objAdd->insert()) return false;\n\n // AdressId\n $this->addressId = $objAdd->addressId;\n\n // Inserting\n if(!$this->insert()) return false;\n return true;\n }", "abstract public function transactionStart();", "function addAddress($address){\n\t if ($this->db->insert('candidate_address',$address))\n\t\t\t{ \n\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\treturn FALSE;\n\t\t\t}\n }", "public function addAddress($formArray)\n {\n $address = $_POST['address_id'];\n $street = $_POST['street'];\n $Suburb = $_POST['Suburb'];\n $city = $_POST['city'];\n \n $dao = new Dao();\n \n $conn = $dao->openConnection();\n \n $sql = \"INSERT INTO Addresses(`address_id`, `Street`, `Subburb`, `city`,) VALUES ('\" . $title . \"','\" . $description . \"','\" . $url . \"','\" . $category . \"')\";\n $conn->query($sql);\n $dao->closeConnection();\n\n }", "function add_consignee_allocation($amount, $trans_type_from, $trans_no_from,\n\t$trans_type_to, $trans_no_to)\n{\n\t$sql = \"INSERT INTO \".TB_PREF.\"consignee_allocations (\n\t\tamt, date_alloc,\n\t\ttrans_type_from, trans_no_from, trans_no_to, trans_type_to)\n\t\tVALUES ($amount, Now(), \".db_escape($trans_type_from).\", \".db_escape($trans_no_from).\", \".db_escape($trans_no_to)\n\t\t.\", \".db_escape($trans_type_to).\")\";\n\n\tdb_query($sql, \"A consignee allocation could not be added to the database\");\n}", "private function _transaction() {\n\n\t\t// Fix for making microtime floats more accurate.\n\t\tini_set('precision', 16);\n\n\t\t// Add transactionid's to all generated EPP frames with commands\n\t\t$tranId = \"afriEPP-\" . microtime(1) . \"-\" . getmypid();\n\t\t$this->command->appendChild($this->document->createElement('clTRID', $tranId));\n\t}", "function addToAddress($array){\r\n\tglobal $link;\r\n\textract($array);\r\n\t$address = $addressLineOne.\"|line2|\". $addressLineTwo;\r\n\t$zipcode = intval($zipcode);\r\n\t$sql = \"INSERT INTO address (address_line, city, zipcode, state) VALUES (?,?,?,?)\";\r\n\tif(!$stmt = mysqli_prepare($link, $sql)){\r\n\t\treturn false;\r\n\t\texit;\r\n\t}\r\n\tmysqli_stmt_bind_param($stmt, 'ssis', $address, $city, $zipcode, $state);\r\n\tmysqli_stmt_execute($stmt);\r\n\tif(mysqli_stmt_error($stmt)){\r\n\t\t//printf(\"Error:on add name %s.\\n\", mysqli_stmt_error($stmt));\r\n\t}\r\n\tmysqli_stmt_close($stmt);\r\n\treturn mysqli_insert_id($link);\t\t\r\n}", "function addTransaction($from,$to,$amount,$pinCode,$us ,$profit){\n $json = new json();\n $link=@Conection($json);\n $json->result= \"fail\";\n \n\t$sql = \"INSERT INTO `transaction` (`id`, `fromID`, `toID`, `date`, `amount`, `pinCode`, `status`) VALUES (NULL, '$from', '$to', CURRENT_TIMESTAMP, '$amount', '$pinCode', ''), (NULL, '$from', '$us', CURRENT_TIMESTAMP, '$profit', '$pinCode', '');\";\n\n\t$result = mysqli_query($link , $sql ); \n\tif($result){\n\t\t\t $json->result= \"done\"; \n\t\t\t\t\n\t}else\n\t\t$json->error = \"Can not add Transaction $pinCode\"; \n\n $json->datatype = \"addtra\";\n return $json;\n}", "public function importAddresses()\n {\n\n $oImportation = SImportUtils::getImportationObject(\\Config::get('scsys.IMPORTATIONS.ADDRESS'));\n\n $sql = \"SELECT\n id_add,\n bpb_add,\n street,\n street_num_ext,\n street_num_int,\n neighborhood,\n reference,\n locality,\n county,\n state,\n zip_code,\n b_def,\n COALESCE(lc.cty_key, 251) AS cty_key,\n COALESCE(ls.sta_code, 'NA') AS sta_code,\n bba.id_bpb,\n bba.fid_cty_n,\n bba.fid_sta_n,\n bba.b_del,\n bba.ts_new,\n bba.ts_edit,\n bba.ts_del\n FROM\n bpsu_bpb_add AS bba\n LEFT OUTER JOIN\n locu_cty AS lc ON (bba.fid_cty_n = lc.id_cty)\n LEFT OUTER JOIN\n locu_sta AS ls ON (bba.fid_sta_n = ls.id_sta)\n WHERE \".\n \"bba.ts_new > '\".$oImportation->last_importation.\"' OR \".\n \"bba.ts_edit > '\".$oImportation->last_importation.\"' OR \".\n \"bba.ts_del > '\".$oImportation->last_importation.\"';\";\n\n $result = $this->webcon->query($sql);\n // $this->webcon->close();\n\n $lSiieAddresses = array();\n $lWebAddresses = SAddress::get();\n $lBranches = SBranch::get();\n $lWebBranches = array();\n $lCountries = SCountry::get();\n $lWebCountries = array();\n $lStates = SState::get();\n $lWebStates = array();\n $lAddresses = array();\n $lAddressesToWeb = array();\n\n foreach ($lWebAddresses as $key => $value) {\n $lAddresses[($value->external_id).'_'.($value->external_ad_id)] = $value;\n }\n\n foreach ($lBranches as $key => $branch) {\n $lWebBranches[$branch->external_id] = $branch->id_branch;\n }\n\n foreach ($lCountries as $key => $country) {\n $lWebCountries[$country->code] = $country->id_country;\n }\n\n foreach ($lStates as $key => $state) {\n $lWebStates[$state->code] = $state->id_state;\n }\n\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $rowId = $row[\"id_bpb\"].'_'.$row[\"id_add\"];\n if (array_key_exists($rowId, $lAddresses)) {\n if ($row[\"ts_edit\"] > $oImportation->last_importation ||\n $row[\"ts_del\"] > $oImportation->last_importation) {\n\n $lAddresses[$rowId]->name = $row[\"bpb_add\"];\n $lAddresses[$rowId]->street = $row[\"street\"];\n $lAddresses[$rowId]->num_ext = $row[\"street_num_ext\"];\n $lAddresses[$rowId]->num_int = $row[\"street_num_int\"];\n $lAddresses[$rowId]->neighborhood = $row[\"neighborhood\"];\n $lAddresses[$rowId]->reference = $row[\"reference\"];\n $lAddresses[$rowId]->locality = $row[\"locality\"];\n $lAddresses[$rowId]->county = $row[\"county\"];\n $lAddresses[$rowId]->state_name = $row[\"state\"];\n $lAddresses[$rowId]->zip_code = $row[\"zip_code\"];\n $lAddresses[$rowId]->external_id = $row[\"id_bpb\"];\n $lAddresses[$rowId]->external_ad_id = $row[\"id_add\"];\n $lAddresses[$rowId]->is_main = $row[\"b_def\"];\n $lAddresses[$rowId]->branch_id = $lWebBranches[$row[\"id_bpb\"]];\n $lAddresses[$rowId]->country_id = $lWebCountries[$row[\"cty_key\"]];\n $lAddresses[$rowId]->state_id = $lWebStates[$row[\"sta_code\"]];\n $lAddresses[$rowId]->updated_at = $row[\"ts_edit\"] > $row[\"ts_del\"] ? $row[\"ts_edit\"] : $row[\"ts_del\"];\n\n array_push($lAddressesToWeb, $lAddresses[$rowId]);\n }\n }\n else {\n array_push($lAddressesToWeb, SImportAddresses::siieToSiieWeb($row, $lWebBranches, $lWebCountries, $lWebStates));\n }\n }\n }\n else {\n echo \"0 results\";\n }\n\n foreach ($lAddressesToWeb as $key => $oAddress) {\n $oAddress->save();\n }\n\n SImportUtils::saveImportation($oImportation);\n\n return sizeof($lAddressesToWeb);\n }", "abstract protected function _start_transaction();", "public function startTransaction();", "public function addressAction() {\n\n $this->view->assign('comp_nav_employees_top', 'current');\n $this->view->assign('comp_nav_addresses', 'current');\n\n $request = $this->getRequest();\n $locationId = $request->getParam('id', null);\n try {\n $location = new Yourdelivery_Model_Location($locationId);\n if (!is_null($locationId) && !empty($locationId)) {\n if ($location->getCompany()->getId() != $this->session->company->getId()) {\n throw new Yourdelivery_Exception_Database_Inconsistency();\n }\n }\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n $this->error(__('Adresse konnte nicht gefunden werden'));\n $this->_redirect('/company/addresses');\n }\n\n if ($request->isPost()) {\n $post = $request->getPost();\n $this->view->p = $post;\n $addrForm = new Yourdelivery_Form_Company_Address();\n\n if ($addrForm->isValid($post)) {\n if ($addrForm->getValue('cityId') == $location->getCityId() && $addrForm->getValue('plz') != $location->getPlz()) {\n $this->error(__('Plz ungültig!'));\n $this->_redirect('/company/address/id/' . $locationId);\n }\n $location->setData($addrForm->getValues());\n $location->setPlz();\n $location->setCompanyName($this->session->company->getName());\n $location->setCompany($this->session->company);\n $location->save();\n\n // set relation to budgets\n $origBudgets = $location->getBudgets();\n $budgets = array();\n foreach ($addrForm->getValue('budgets') as $budgetId => $budg) {\n try {\n $budget = new Yourdelivery_Model_Budget($budgetId);\n $budget->addLocation($location->getId());\n $budgets[] = $budget->getId();\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n $this->_logger->err(sprintf('Could not create budget #%d', $budgetId));\n continue;\n }\n }\n // remove not selected budgets\n foreach ($origBudgets as $origBudget) {\n if (!in_array($origBudget->getId(), $budgets)) {\n try {\n $budget = new Yourdelivery_Model_Budget($origBudget->getId());\n $budget->removeLocation($location->getId());\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n $this->_logger->err(sprintf('Could not create budget #%d', $budgetId));\n continue;\n }\n }\n }\n\n //if no id is given, we create a new adresse\n //create also a privat adress\n if (is_null($locationId) || empty($locationId)) {\n $paddr = new Yourdelivery_Model_Location();\n $paddr->setData($addrForm->getValues());\n $paddr->setCustomer($this->getCustomer());\n $paddr->setCompanyName($this->getCustomer()->getCompany()->getName());\n $paddr->save();\n $this->success(__('Adresse erfolgreich erstellt!'));\n } else {\n $this->success(__('Adresse erfolgreich bearbeitet!'));\n }\n $this->_redirect('/company/addresses');\n } else {\n $this->error($addrForm->getMessages());\n }\n }\n\n $this->view->address = $location;\n }", "private function addAddress($options)\n {\n if ($address = $options['billing_address'] ?: $options['address']) {\n $this->post->addChild('ZipCode', $address['zip']);\n }\n }", "public function addAddress($bean, $event, $arguments) {\n\t\tglobal $timedate;\n\t\tif($bean->add_address_to_history_c){\n\t\t\t//$GLOBALS['log']->fatal(\"add address to address history\");\n\t\t\t// set current address bit to 0 for earlier address\n\t\t\t$bean->load_relationship(\"leads_dot10_addresses_1\");\n\t\t\t$relatedAddresses = $bean->leads_dot10_addresses_1->getBeans();\n\t\t\t\n\t\t\tforeach ($relatedAddresses as $address) {\n\t\t\t\tif($address->current_address_c){\n\t\t\t\t\t$address->current_address_c = 0;\n\t\t\t\t\t$address->save();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//add this address in address history\n\t\t\t$address_bean = new dot10_addresses();\n\t\t\t$address_bean->first_name = $bean->first_name;\n\t\t\t$address_bean->last_name = $bean->last_name;\n\t\t\t$address_bean->address_c_o = $bean->address_c_o;\n\t\t\t$address_bean->primary_address_street = $bean->primary_address_street;\n\t\t\t$address_bean->primary_address_postalcode = $bean->primary_address_postalcode;\n\t\t\t$address_bean->primary_address_city = $bean->primary_address_city;\n\t\t\tif(!empty($bean->dotb_resident_since_c)){\n\t\t\t\t$date = new DateTime($bean->dotb_resident_since_c);\n\t\t\t\t$address_bean->dotb_resident_since_c = $timedate->asDbDate($date);\n\t\t\t}\n\t\t\t// set current address bit to 1 for thos address\n\t\t\t$address_bean->current_address_c = 1;\n\t\t\t$address_bean->save();\n\t\t\t$bean->load_relationship('leads_dot10_addresses_1');\n\t\t\t$bean->leads_dot10_addresses_1->add($address_bean->id);\n\t\t\t\n\t\t\t$bean->add_address_to_history_c = 0;\n\t\t} else if(($bean->add_address_to_history_c == 0) && \n\t\t\t\t\t($bean->fetched_row['address_c_o'] != $bean->address_c_o ||\n\t\t\t\t\t$bean->fetched_row['primary_address_street'] != $bean->primary_address_street ||\n\t\t\t\t\t$bean->fetched_row['primary_address_postalcode'] != $bean->primary_address_postalcode ||\n\t\t\t\t\t$bean->fetched_row['primary_address_city'] != $bean->primary_address_city || \n\t\t\t\t\t$bean->fetched_row['dotb_resident_since_c'] != $bean->dotb_resident_since_c) && \n\t\t\t\t\t(!empty($bean->address_c_o) || !empty($bean->primary_address_street) ||\n\t\t\t\t\t!empty($bean->primary_address_postalcode) || !empty($bean->primary_address_city) || !empty($bean->dotb_resident_since_c))){\n\t\t\t\n\t\t\t// retrieve the address with current_address_c bit 1 and update it\n\t\t\t$bean->load_relationship(\"leads_dot10_addresses_1\");\n\t\t\t$relatedAddresses = $bean->leads_dot10_addresses_1->getBeans();\n\t\t\t//$GLOBALS['log']->fatal(\"Update address\");\n\t\t\tforeach ($relatedAddresses as $address) {\n\t\t\t\tif($address->current_address_c){\n\t\t\t\t\t$address->address_c_o = $bean->address_c_o;\n\t\t\t\t\t$address->primary_address_street = $bean->primary_address_street;\n\t\t\t\t\t$address->primary_address_postalcode = $bean->primary_address_postalcode;\n\t\t\t\t\t$address->primary_address_city = $bean->primary_address_city;\n\t\t\t\t\t\n\t\t\t\t\t// update residence since for current address\n\t\t\t\t\tif(!empty($bean->dotb_resident_since_c)){\n\t\t\t\t\t\t$date = new DateTime($bean->dotb_resident_since_c);\n\t\t\t\t\t\t$address->dotb_resident_since_c = $timedate->asDbDate($date);\n\t\t\t\t\t}\n\t\t\t\t\t$address->processed = true;\n\t\t\t\t\t$address->save();\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n }", "public function createTransaction($RealTimestamp,$UnitValue,$Description,$Currency,$TaxValue,$TaxPercentage,$AssocAccount){\n $transaction = new Transaction($RealTimestamp,$UnitValue,$Description,$Currency,$TaxValue,$TaxPercentage,$AssocAccount);\n array_push($this->TransactionLog,$transaction);\n }", "function AddAccount($account){\r\n $statement = new InsertStatement(\"account\");\r\n $statement->addParameter(\"user_id\", $account->getUserId());\r\n $statement->addParameter(\"name\", $account->getName());\r\n $statement->addParameter(\"address\", $account->getAddress());\r\n $statement->addParameter(\"state\", $account->getState());\r\n $statement->addParameter(\"city\", $account->getCity());\r\n $statement->addParameter(\"zip\", $account->getZip());\r\n $statement->addParameter(\"folder\", $account->getFolder());\r\n $statement->executeStatement();\r\n }", "public function test_create_company_address()\n {\n $company = Company::factory()->create();\n\n CompanyAddress::unguard();\n\n $companyAddress = CompanyAddress::create([\n 'block' => '123',\n 'street' => '123 Street Name',\n 'unitnumber' => '00-00',\n 'postalcode' => '123456',\n 'buildingtype' => '1',\n 'company_id' => $company->id,\n ]);\n\n CompanyAddress::reguard();\n\n $this->assertEquals($companyAddress->company->name, $company->name);\n $this->assertEquals('123 Street Name', $companyAddress->street);\n }" ]
[ "0.56817406", "0.562103", "0.5612349", "0.55883086", "0.5585522", "0.55318415", "0.5530678", "0.5525799", "0.5515953", "0.55020624", "0.5474395", "0.5382803", "0.5364697", "0.5363417", "0.5361481", "0.53598666", "0.5357946", "0.53555316", "0.535421", "0.53447413", "0.5319096", "0.5318482", "0.53140116", "0.5313289", "0.530954", "0.53022575", "0.5291584", "0.5270975", "0.5253479", "0.5246026" ]
0.72977155
0
Bind is called when the CSI(Client Side Interface) is generated. It should contain all of the basic bindings to the events.
public function bind() { $this->csi->txtSource->onkeypress[] = "rewrite"; $this->csi->txtTodo->onenterpressed[] = "addTodo"; $this->csi->buttons->onclick[] = "showNumber"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function bindOn();", "public abstract function bind();", "protected function bindEvent() {\n $this->bindBaseEvent();\n $this->bindExtraEvent();\n }", "protected function bindBaseEvent() {\n $this->server->on('start', [$this, 'onStart']);\n $this->server->on('shutdown', [$this, 'onShutdown']);\n $this->server->on('managerStart', [$this, 'onManagerStart']);\n $this->server->on('managerStop', [$this, 'onManagerStop']);\n $this->server->on('workerStart', [$this, 'onWorkerStart']);\n $this->server->on('workerStop', [$this, 'onWorkerStop']);\n }", "public function bindServices()\n {\n $this->bind('handler.image', __NAMESPACE__ . \"\\\\RequestHandler\\\\Image\", array(\n\n // the image handler needs the application object\n // to execute actions with dependencies. So we \n // just pass $this to the constructor\n $this,\n\n // the other dependency are the available image formats\n '#image.availableFormats',\n ));\n }", "function exposedBindings();", "public function bind()\n {\n $aeEvents = \\MarkNotes\\Events::getInstance();\n $aeEvents->bind('add.buttons', __CLASS__.'::add');\n return true;\n }", "protected function mapBindings()\n {\n //\n }", "public function bind() {\r\n $listeners = $this->cache->get('app-listeners', function () {\r\n foreach ($this->resolver->getListeners() as $file) {\r\n try {\r\n $binding = $this;\r\n require_once($file);\r\n } catch (\\Throwable $e) {\r\n $this->logger->warn(\"Unable to include $file: \" . $e->getMessage());\r\n }\r\n }\r\n\r\n $listeners = $this->getListeners();\r\n\r\n if ($this->database->isConnected()) {\r\n /** @var ModelEx $eventModel */\r\n if ($eventModel = $this->resolver->getModel('Event', true)) {\r\n try {\r\n foreach ($eventModel::all() as $item) {\r\n $attrs = $item->attributesToArray();\r\n list($class, $func) = @explode('@', $attrs['handler']);\r\n $event = array_merge($attrs, ['event' => $attrs['name'], 'handler' => [sprintf('\\\\%s', ltrim($class, '\\\\')), $func ?? 'index']]);\r\n\r\n $listeners[] = $event;\r\n }\r\n } catch (\\Exception $e) {\r\n }\r\n }\r\n }\r\n\r\n return $listeners;\r\n }, 300);\r\n\r\n foreach ($listeners as $listener) {\r\n $this->dispatcher->listen($listener['event'], $listener['handler'], $listener['priority'] ?? 99, $listener['data'] ?? '');\r\n }\r\n }", "public function register()\n {\n //en el register solo se debe vincular cosas en el contenedor de servicios. Nunca registrar detector de eventos, rutas u otra función.\n //definimos un binding en el que registramos nuestra clase en el service container\n }", "public function register()\n {\n foreach ($this->simpleBindings as $contract => $service) {\n $this->app->bind($contract, $service);\n }\n }", "public function loadGeneratedCSI() {\n /** @var Parameters $params */\n $params = $this->csi->params;\n $bindings = $this->csi->bindings;\n $events = $this->csi->events;\n RequireHelper::requireFilesInDirectory(DIR_TEMP . \"data/\");\n $r = new \\ReflectionClass(\"\\\\\" . get_class($this) . \"GenCSI\");\n $this->csi = $r->newInstanceArgs([$this]);\n $this->csi->params = $params;\n $this->csi->bindings = $bindings;\n $this->csi->events = $events;\n $this->csi->processBindings();\n $this->bind();\n JavascriptGenerator::generateJavascript($this);\n }", "protected function define_data_binding(){\n\t\t\t// placeholder function\n\t\t\t// use bind_action here to define the data binding\n\t\t}", "public function register()\n {\n collect($this->facadesProvides())->each(function ($item, $key) {\n $this->app->bind($key, function () use ($item) {\n return is_callable($item) ? $item() : $item;\n });\n });\n }", "public function onBind(Event $event)\n {\n foreach ($event->getSubject() as $bound) {\n $this->logger->info(\n sprintf(\"Event '%s' bound to '%s@%s'\", $bound, $event[\"exchange\"], $event[\"queue\"])\n );\n }\n }", "private function bindEvent()\n {\n $bindBroadcastResponse = $this->youtube->liveBroadcasts->bind($this->broadcastsResponse['id'], 'id,contentDetails', ['streamId' => $this->streamsResponse['id'],]);\n $this->response['bind_broadcast_response'] = $bindBroadcastResponse;\n }", "protected function bindExtraEvent() {\n $events = $this->conf['swoole']['events'];\n foreach ($events as $event) {\n $this->server->on($event, [$this, 'on' . ucfirst($event)]);\n }\n }", "public function bind()\n {\n $this->setDefaultFormat(TemperatureType::KELVIN); # Change the default format to KELVIN\n\n // Setup necessary api configuration\n $this->setBaseUrl(config('weather.api.openweathermap.base_url'));\n $this->setParameter(\"APPID\",config('weather.api.openweathermap.app_id'));\n \n // Set api parameters or attributes\n $this->setParameter(\"q\",$this->city.','.$this->country);\n }", "public function register()\n {\n\n foreach ($this->repository() as $list){\n $this->app->bind($list['interface'],$list['class']);\n }\n\n\n }", "public function __construct()\n {\n $this->registerBaseBindings();\n }", "protected function registerBaseBindings()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n }", "protected function registerBaseBindings()\n {\n static::setInstance($this);\n $this->instance('app', $this);\n $this->instance(\\Mimicry\\Foundation\\App::class, $this);\n $this->instance(\\Illuminate\\Container\\Container::class, $this);\n $this->singleton(\\Mimicry\\Foundation\\Kernel::class, \\Mimicry\\Foundation\\Kernel::class);\n }", "public function register()\n {\n foreach ($this->services as $interface => $service) {\n App::bind($interface, $service);\n }\n }", "protected function bindMethods(array $binds)\n {\n $self = $this;\n foreach ($binds as $eventName => $methodName) {\n $this->client->on(\n $eventName,\n function () use ($self, $methodName, $eventName) {\n $self->{$methodName}(func_get_args(), $eventName);\n }\n );\n }\n }", "protected function registerBaseBindings()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n\n $this->instance('Illuminate\\Container\\Container', $this);\n }", "public function registerBindings() {\n $this->app->bind(\n 'App\\Repositories\\Backend\\Advertisingpartner\\AdvertisingpartnerContract',\n 'App\\Repositories\\Backend\\Advertisingpartner\\EloquentAdvertisingpartnerRepository'\n );\n $this->app->bind(\n 'App\\Repositories\\Frontend\\Advertisingpartner\\AdvertisingpartnerContract',\n 'App\\Repositories\\Frontend\\Advertisingpartner\\EloquentAdvertisingpartnerRepository'\n );\n }", "public function register()\n {\n //\n $this->app->bind(ProtocolGenerator::class,Protocol::class);\n }", "public function init() {\n $this->csi = new CSI($this);\n $this->load();\n }", "public function register()\n {\n $this->app->bind(\n EventInterface::class,\n LaravelEvents::class\n );\n }", "public function on_client_server_connect(Event &$event) {\n $this->request->setAttribute('result_on_client_server_connect', 'successful call');\n $this->request->setAttribute('result', 'successful call');\n \n echo \"here is connection\\r\\n\";\n \n }" ]
[ "0.6063866", "0.5861281", "0.581578", "0.57107264", "0.5705486", "0.54783726", "0.5447505", "0.53361344", "0.5302459", "0.5186008", "0.5178301", "0.515233", "0.5146982", "0.51231617", "0.5066881", "0.50585115", "0.50341", "0.5020447", "0.49794662", "0.4974687", "0.49593225", "0.4954351", "0.49138412", "0.4885769", "0.48763704", "0.4875825", "0.4860833", "0.48600462", "0.4812927", "0.47860876" ]
0.7203973
0
Rewrites the value of txtSource to the html of lblCopy
public function rewrite($sender, $keyCode) { $this->csi->lblCopy->html = "<b>" . $this->csi->txtSource->value . "</b>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function copy()\n\t{\n\t\treturn $this->render( $this->getView() );\n\t}", "public function _makeLabel()\n {\n return ($this->labelHasAlreadyHtmlSpecialChars) ? $this->labelString : htmlspecialchars($this->labelString);\n }", "public function SetPlainText($src)\n\t\t{\n\t\t\treturn $this->tfn->SetPlainText($this->id, $src);\n\t\t}", "public function render_content() {\n\t\t\t?>\n\t\t\t<label>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<input type=\"url\" <?php $this->link(); ?> value=\"<?php echo esc_url_raw( $this->value() ); ?>\" />\n\t\t\t</label>\n\t\t<?php\n\t\t}", "public function render_content() { ?>\n\t\t\t<label>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<textarea rows=\"5\" style=\"width:100%;\" <?php $this->link(); ?>><?php echo esc_attr( $this->value() ); ?></textarea>\n\t\t\t</label>\n\t\t<?php\n\t\t}", "public function printbshtml(){\n\t\t$bs=BBoostrapHelper::getInstance();\n\t\treturn $bs->formgroup_textarea($this->name,$this->alias,$this->getVal(),'');\n\t\t}", "public function render_content() {\n ?>\n <label>\n <span class=\"customize-control-title\"><?php echo esc_html($this->label); ?></span>\n <textarea rows=\"5\" style=\"width:100%;\" <?php $this->link(); ?>><?php echo esc_textarea($this->value()); ?></textarea>\n </label>\n\n <?php\n }", "function getCopyDialog()\n {\n $str = \"\";\n\n $smarty = get_smarty();\n $smarty->assign(\"cn\", \t set_post($this->cn));\n $smarty->assign(\"description\", set_post($this->description));\n $str = $smarty->fetch(get_template_path(\"paste_generic.tpl\",TRUE,dirname(__FILE__)));\n\n $ret = array();\n $ret['string'] = $str;\n $ret['status'] = \"\";\n return($ret);\n }", "public function doText(){\n\t\treturn $this->_getCopy();\n\t}", "function getHtml()\n {\n foreach($this->arrTarget as $sTarget => $sValue)\n {\n if(!is_array($sValue))\n {\n $this->sHtml = str_replace('{'.$sTarget.'}', $sValue, $this->sHtml);\n unset($this->arrTarget[$sTarget]);\n }\n }\n\n $arrHtml = explode(\"\\n\", $this->sHtml);\n\n // Wow, foreach, foreach, foreach, foreach... Developers, developers, developers...\n foreach($arrHtml as $iLine => $sHtml)\n {\n $sReturn = '';\n foreach($this->arrTarget as $sTarget => $arrValue)\n {\n if(is_array($arrValue))\n {\n foreach($arrValue as $sValue)\n {\n if(preg_match('/\\{' . $sTarget . '\\}/i', $sHtml))\n {\n $sReturn .= str_replace('{'.$sTarget.'}', $sValue, $sHtml);\n $arrHtml[$iLine] = $sReturn;\n }\n }\n }\n }\n }\n\n return $this->sHtml = implode('',$arrHtml);\n }", "function add_final_text($source, $current_node) {\n\t\tif(strlen($source) > 0) {\n\t\t\t$current_node->add_text_node($source);\n\t\t}\n\t}", "private function setHtml($src)\n {\n $src = $this->findAttachments($src);\n $this->html_tpl = $src;\n $this->html = $src;\n }", "private function _getCopy(){\n\t\t$myCopy = false;\n\t\t\n\t\t//Get copy into a string\n\t\t$copy = file_get_contents(__DIR__ . '/includes/copy.txt');\n\t\n\t\t// Break into an array and shuffle\n\t\t$copy = explode('<p>', $copy);\n\t\tshuffle($copy);\n\t\t\n\t\tforeach($copy as $block){\n\t\t\t// Max length reached\n\t\t\tif(strlen($myCopy) >= $this->maxChar && $this->maxChar !== 0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$myCopy .= '<p>'. $block . '</p>'; // Build up the copy string\n\t\t}\n\t\t\n\t\t// If maxChar is set to 0, use total length of the built up copy as the high limit\n\t\t$this->maxChar = ($this->maxChar === 0 ? strlen($myCopy) : $this->maxChar);\n\t\t\n\t\treturn $this->_truncateText($myCopy,rand($this->minChar, $this->maxChar));\n\t}", "public function getHtml()\n\t{\n\t\t$field = $this->getModel();\n\t\treturn '<input type=\"text\" name=\"'.$field->getName().'\" id=\"'.strtolower($field->getName()).'\" maxlength=\"'.$this->getSetup(\"max_length\", 3).'\" size=\"'.$this->getSetup(\"max_size\", 3).'\" value=\"'.$this->getData().'\"/>';\n\t}", "private function processContent()\n {\n $model = $this->owner;\n $source = $model->{$this->sourceAttribute};\n $model->{$this->targetAttribute} = Markdown::process($source);\n }", "public function getContentToPrint() \n{\n\t$this->content=preg_replace('#{form_(.+?)}#si','',$this->content);\n\t$this->content=preg_replace('#{nbd_(.+?)}#si','',$this->content);\n\treturn $this->content;\n}", "function HtmlGetTextBox($inputName,$value,$labelText,$isDisabled=false,$outerHTML='',$helpText='',$innerHTML='') {\n\t\t\treturn '<li><label for=\"' . $inputName . '\">' . $labelText . (!empty($helpText)?' <abbr onclick=\"alert(this.title);\" title=\"' . $helpText . '\">[?]</abbr>':'') . '<br /><input type=\"text\" id=\"' . $inputName . '\" name=\"' . $inputName . '\" value=\"' . $value. '\" ' . ($isDisabled?'disabled=\"disabled\"':'') . ' ' . $innerHTML . ' /></label>' . $outerHTML . '</li>';\t\t\t\n\t\t}", "function display_copyright_element()\n{\n\t?>\n\t\t<input type=\"text\" name=\"copy_right\" id=\"copy_right\" value=\"<?php echo get_option('copy_right'); ?>\" size=\"50\"/>\n \t\n <?php\n}", "public function set_copytext($str) {\n if(is_string($str)) {\n $this->copytext = $str;\n \n return true;\n }\n \n return false;\n }", "public function render_content() {\n\t\t\t?>\n\t\t\t<label>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<textarea class=\"large-text\" cols=\"20\" rows=\"5\" <?php $this->link(); ?>>\n\t\t\t\t\t<?php echo esc_textarea( $this->value() ); ?>\n\t\t\t\t</textarea>\n\t\t\t</label>\n\t\t\t<?php\n\t\t}", "public function getHtmlString () {\n return $this->parser->save();\n }", "function raw_field($label, $text) {\n\treturn '<div class=\"rex-form-row\"><p class=\"rex-form-col-a rex-form-text\"><label>'.\n\t\t\t$label .'</label>'. $text .'</p></div>';\n}", "private function resetFormData()\n {\n $this->viewVar['title'] = htmlspecialchars ( JapaCommonUtil::stripSlashes($this->link_title), ENT_COMPAT, $this->config->getModuleVar('common','charset') );\n $this->viewVar['url'] = htmlspecialchars ( JapaCommonUtil::stripSlashes($this->link_url), ENT_COMPAT, $this->config->getModuleVar('common','charset') );\n }", "private function source($src = '')\n {\n return '<source src=\"'.$src.'\" />';\n }", "function feed_data_source( $post ) {\n\t\n\t$source = get_post_meta($post->ID, '_source', true);\n\t\n\techo '<input type=\"text\" name=\"_source\" value=\"' . $source . '\" class=\"widefat\" />';\n\n}", "function safe_html( $new_value ) {\n\n\t\treturn wp_kses_post( $new_value );\n\n\t}", "public function setTextHtml(string $value)\n {\n $this->textHtml = $value;\n }", "public function getInputHtml()\n {\n return $this->getValue();\n }", "function tlspi_make_text_area() {\n\t\techo '<form method=\"post\" action=\"\">';\n\t\techo '<textarea rows=\"30\" cols=100\" name=\"preview\" wrap=\"physical\">';\n\t\techo 'copy and paste document here...';\n\t\techo '</textarea>';\n\t\techo '<br>';\n\t\techo '<input type =\"submit\" value=\"Preview\" name=\"submit\">';\n\t\techo '<br>';\n\t\techo '</form> <br>';\n}", "function getUrl() {\n return str_replace(' ', '%20', $this->getFieldValue('text_field_1'));\n }" ]
[ "0.55300146", "0.55116516", "0.5298115", "0.51945335", "0.5116131", "0.50681484", "0.5058745", "0.5043097", "0.5032", "0.49906436", "0.49632335", "0.49049982", "0.48888448", "0.48859707", "0.48818463", "0.48702484", "0.4865046", "0.48587477", "0.48514983", "0.4846264", "0.48277387", "0.4779696", "0.4766615", "0.47586387", "0.47584602", "0.475814", "0.47509325", "0.47466728", "0.47368002", "0.4731891" ]
0.6954588
0
Adds todo to the todo list.
public function addTodo($sender) { $this->csi->lblTodos->html .= "<div><b>" . $this->counter . ".: </b>" . $this->csi->txtTodo->value . "</div>"; $this->csi->txtTodo->value = ""; $this->counter++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add() {\n \n if (empty($this->data['Todo']['order'])) {\n // we got bad data so set up an error response and exit\n header('HTTP/1.1 400 Bad Request');\n header('X-Reason: Received an array of records when ' .\n 'expecting just one');\n exit;\n }\n\n $this->Todo->create();\n $this->Todo->save($this->data);\n $id = $this->Todo->id;\n $this->set('json', $this->data['Todo'] + array('id' => (string) $id));\n $this->render(SIMPLE_JSON, 'ajax');\n }", "public function test_todo_can_add_task()\n {\n $user = User::factory()->create();\n $todoPriority = TodoPriority::factory()->create();\n $this->actingAs($user, 'api');\n\n $response = $this->postJson('/api/todo', [\n 'title' => 'password',\n 'description' => 'new-password',\n 'id_user' => $user->id,\n 'id_todo_priority' => $todoPriority->id,\n 'deadline_at' => '2021-03-07',\n 'completed_at' => '',\n ], ['Accept' => 'application/json']);\n\n $response->assertStatus(200);\n }", "public function addTask()\n\t{\n\t\t$this->editTask();\n\t}", "function addTask( $task ){\n $this->tasks[] = $task; \n }", "public function create()\n {\n return view('add_todolist');\n }", "public function addAction(Request $request)\n {\n $params = $request->request->all();\n\n $validator_service = new ValidatorService($this->getValidator());\n $validator_service->validateRequest($params, \"Todo\");\n\n $todo_model = new TodoModel();\n $todo_model->setRedis($this->getRedis());\n $todo_service = new TodoService();\n $todo_service->setTodoModel($todo_model);\n\n $id = $todo_service->add($params['item']);\n\n return $this->app->json(['id' => $id]);\n }", "public function create()\n {\n return view('todo.addtodo');\n }", "public static function TraerTodos()\n {\n \n }", "public function create()\n {\n //\n return view('todo.add');\n }", "public function create()\r\n {\r\n if($this->getSessionHandler()->isLoggedIn())\r\n {\r\n $todo = new todo();\r\n $todo->message = $this->getRequestObject()->getParameter('message');\r\n $todo->isdone = $this->getRequestObject()->getParameter('isdone');\r\n $todo->ownerid = $this->getSessionHandler()->getSessionVariable('id');\r\n $todo->owneremail = $this->getSessionHandler()->getSessionVariable('email');\r\n $todo->createddate = date('Y-m-d h:m:s', strtotime('now'));\r\n $todo->duedate = $this->getRequestObject()->getParameter('duedate');\r\n \r\n //validate\r\n if($todo->validate() !== true)\r\n {\r\n //returns array of error messages\r\n $errors = $todo->validate();\r\n $v = new ValidationView();\r\n $v->injectData(array('messages' => $errors));\r\n echo $v->render();\r\n die(); //halt execution if it's invalid\r\n }\r\n \r\n $id = $todo->save();\r\n header(\"Location: index.php?page=tasks&action=show&id=$id\");\r\n }\r\n else\r\n {\r\n $this->displayMessage('You must login to view this area!');\r\n }\r\n }", "function todo($task = '', $todo_id = '', $swap_with = '') {\n \n if($task == 'add')\n $this->crud_model->add_todo();\n \n if($task == 'reload')\n $this->load->view('backend/todo_body');\n\n if($task == 'reload_incomplete_todo')\n $this->crud_model->get_incomplete_todo();\n \n if($task == 'mark_as_done')\n $this->crud_model->mark_todo_as_done($todo_id);\n \n if($task == 'mark_as_undone')\n $this->crud_model->mark_todo_as_undone($todo_id);\n \n if($task == 'swap')\n $this->crud_model->swap_todo($todo_id, $swap_with);\n \n if($task == 'delete')\n $this->crud_model->delete_todo($todo_id);\n }", "public function add($task): void\n {\n $this->tasks[] = $task;\n }", "public function create(Todo $todo, CreateTodo $request)\n {\n // ユーザーモデルのインスタンスを作成する\n $NewTodo = new Todo();\n // 各カラムに入力された値を代入する\n $NewTodo->user_id = Auth::user()->users();\n $NewTodo->title = $request->title;\n $NewTodo->detail = $request->detail;\n $NewTodo->start_date = $request->start_date;\n $NewTodo->due_date = $request->due_date;\n $NewTodo->status = $request->status;\n\n $NewTodo->save();\n\n // インスタンスの状態をデータベースに書き込む(save()は単なる上書きでなく、差分上書き。差分がなければ更新されない。)\n //$NewTodo->save();\n \n return redirect()->route('todo.index', [\n 'id' => $NewTodo->id,\n ]);\n }", "public function store(Todo $todo, Request $request)\n {\n\n $task = new \\App\\Task;\n $task->todoId = $request->get('id', $todo->todoId);\n $task->taskTitle = $request->get('taskTitle');\n $task->isComplete = $request->get('isComplete');\n\n $task->save();\n \n return back();\n }", "public function add(){}", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n } \n $this->Notes->add($user);\n }", "public function add()\n {\n $str = preg_replace('/ {1,}/','_', $this->Name_of_task);;\n if ($this->validate()) {\n $subject = $this->_subject;\n $subject->Name_of_task = $str;\n $subject->DateTask = $this->date;\n return $subject->addTasks();\n } else\n return false;\n }", "public function add()\r\n {\r\n $note = $this->real_escape_string(trim($_POST['note']));\r\n $this->query('INSERT INTO notes (notes) VALUES (\"'.$note.'\")');\r\n unset($_POST['note']);\r\n }", "function add_td_list()\r\n\t{\r\n\t\t \r\n\t\t$field = array(\r\n\t\t'id'=>time(),\r\n\t\t'uid'=>$_SESSION['id'],\r\n\t\t'type'=>$this->input->post('type'),\r\n\t\t'priority'=>$this->input->post('priority'),\r\n\t\t'title'=>$this->input->post('title'),\r\n \t\t'description'=>$this->input->post('desc'),\r\n\t\t'duedate'=>$this->input->post('duedate')\r\n\t\t);\r\n \t\t$this->db->insert('todo',$field);\r\n\t\tif($this->db->affected_rows() > 0)\r\n\t\t{\r\n \t\t\t return $this->input->post('type');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t return false;\r\n\t\t}\r\n\t}", "public function addTask(){\n global $vues;\n $id_list=Validation::nettoyer_int($_GET['id_list']);\n require_once($vues['taskCreation']);\n }", "public function create()\n {\n return view('todolist.create');\n }", "public function add(Reminder $reminder);", "public function addItem();", "public function add() {\n try {\n $stmt = $this->dbcon->prepare(\"INSERT INTO todos(title) VALUE(:title)\");\n $stmt->bindparam(':title', $this->title);\n $stmt->execute();\n return true;\n } catch(PDOException $e){\n echo $e->getMessage();\n return false;\n }\n }", "public function add() {\n\t\t$this->_add ();\n\t}", "public function show(ToDo $toDo)\n {\n //\n }", "public function formTodo()\n {\n $request = $this->requestStack->getCurrentRequest();\n\n // Create Todo Form\n $todoForm = $this->formFactory\n ->createBuilder()\n ->add('name', null, ['attr' => ['class' => 'form-control', 'placeholder'=> 'Entrer list']])\n ->add('name', null, ['attr' => ['class' => 'form-control', 'placeholder'=> 'Entrer list']])\n ->getForm();\n // Submit Todo Form\n $todoForm->handleRequest($request);\n if ($todoForm->isSubmitted() && $todoForm->isValid()) {\n $getTodoList = $todoForm->getData();\n $this->insert( $getTodoList );\n return [\"submited\"=> new RedirectResponse($this->router->generate('TodoListFetch'))];\n }\n\n return [\"form\"=> $todoForm] ;\n }", "function addItem()\n {\n $this->global['pageTitle'] = \"新增赛事\";\n $this->loadViews(\"newseventadd\", $this->global, NULL);\n }", "public function createTodo()\n {\n \treturn view('createTodos');\n }", "public function store(Request $request)\n {\n Todolist::create([\n 'task' => $request->task,\n ]);\n\n return redirect(route('todolist.index'))->with(['success' => 'ToDoList is added!!!!']);\n }" ]
[ "0.68624383", "0.6412836", "0.626633", "0.6178056", "0.60691875", "0.5999044", "0.5968905", "0.5959296", "0.5946621", "0.59117275", "0.58994144", "0.5740181", "0.5734752", "0.57160985", "0.5663584", "0.5637063", "0.56145", "0.55901974", "0.55794716", "0.5561084", "0.55538154", "0.55442744", "0.55248576", "0.55246025", "0.5510525", "0.5506638", "0.54994184", "0.5457094", "0.5449778", "0.5432029" ]
0.68703526
0
Shows the number of a button to the lblButtons.
public function showNumber($sender) { $this->csi->lblButtons->html = $sender->value; $this->flashMessage("You've successfully clicked on " . $sender->value . " button.", "success"); $sender->value += 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buttonCount($value) {\n return $this->setProperty('buttonCount', $value);\n }", "function IconCount() { return 1;}", "private function inc_labels()\n {\n foreach ($this->labels as &$level)\n ++$level;\n }", "function get_count()\n\t{\n\t\treturn $this->call(\"InputButton.GetCount\");\n\t}", "public function setCounter($label)\n {\n $this->label = $label;\n }", "function add_button($label, $value, $is_checked=HAW_NOTCHECKED)\r\n {\r\n if (!is_string($label) || !is_string($value))\r\n die(\"invalid argument in add_button()\");\r\n\r\n $this->buttons[$this->number_of_buttons][\"label\"] = $label;\r\n $this->buttons[$this->number_of_buttons][\"value\"] = $value;\r\n $this->buttons[$this->number_of_buttons][\"is_checked\"] = $is_checked;\r\n\r\n if ((strlen($this->value) == 0) || ($is_checked == HAW_CHECKED))\r\n $this->value = $value;\r\n\r\n $this->number_of_buttons++;\r\n }", "public function getCounter()\n {\n return $this->label;\n }", "function AddLabel1()\n {\n $this->_COUNTX++;\n if ($this->_COUNTX == $this->_X_Number) {\n // Row full, we start a new one\n $this->_COUNTX=0;\n $this->_COUNTY++;\n if ($this->_COUNTY == $this->_Y_Number) {\n // End of page reached, we start a new one\n $this->_COUNTY=0;\n $this->AddPage();\n }\n }\n }", "public function configureButtons();", "public function printButtons() {\n\t\t$btnText = '';\n\t\tforeach ( $this->buttons as $button ) {\n\t\t\t$class = $button['class'];\n\t\t\t$data = '';\n\t\t\tif ( !empty($button['data']) ) {\n\t\t\t\tforeach ( $button['data'] as $k => $v ) {\n\t\t\t\t\t$data .= sprintf('data-%s=\"%s\" ', $k, $v);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$text = $button['text'];\n\t\t\t// close up the button\n\t\t\t$btnText .= sprintf('<button type=\"button\" class=\"%s\" %s>%s</button>', $class, $data, $text);\n\t\t}\n\t\treturn $btnText;\n\t}", "function attachfile_display_num_label( $mydirname , $params )\n{\n\t// This function only use display static messages,\n\t// so it skip permission check.\n\tattachfile_include_language( $mydirname ) ;\n\techo _MD_ATTACHFILE_LABEL_NUM ;\n}", "public function setButtons();", "function theme_views_slideshow_singleframe_image_count($vss_id, $view, $options) {\n $attributes['class'] = 'views_slideshow_singleframe_image_count views_slideshow_image_count';\n $attributes['id'] = \"views_slideshow_singleframe_image_count_\" . $vss_id;\n $attributes = drupal_attributes($attributes);\n\n $counter = '<span class=\"num\">1</span> ' . t('of') . ' <span class=\"total\">1</span>';\n\n return \"<div$attributes>$counter</div>\";\n}", "public function renderCounter() {\n if($this->wire('adminTheme')->modestaUnpublished == 1) {\n $pages = $this->wire('pages')->find('status=unpublished');\n $counter = 0;\n foreach($pages as $page) {\n if(!$page->is(Page::statusHidden)) {\n $counter++;\n }\n }\n $out = '';\n if($counter > 0) {\n $out .= '<a class=\"counter\">' . $counter .'</a>';\n }\n return $out;\n }\n }", "public function getNumBt() {\n return $this->numBt;\n }", "function tptn_disp_count() {\n\tglobal $wpdb;\n\n\t$id = intval( $_POST['top_ten_id'] );\n\tif ( $id > 0 ) {\n\n\t\t$output = get_tptn_post_count( $id );\n\n\t\techo 'document.write(\"' . $output . '\")';\n\t}\n}", "protected function getNextButtonText() {\n return $this->nextButtonText;\n }", "public function getNumBtRempl() {\n return $this->numBtRempl;\n }", "public function listsCount($conn, $wParam)\n {\n }", "public function count() {\n return count($this->_icons);\n }", "function updateCounter() {\n global $DB;\n\n //update counter view\n $DB->update(\n 'glpi_knowbaseitems', [\n 'view' => new \\QueryExpression($DB->quoteName('view') . ' + 1')\n ], [\n 'id' => $this->getID()\n ]\n );\n }", "protected function print_add_button() {\n echo $this->output->single_button(\n new \\moodle_url(static::get_base_url(), ['action' => self::ACTION_ADD]),\n $this->get_create_button_text()\n );\n }", "function shortcode_insert_button()\n\t\t{\n\t\t\t$this->config['name']\t\t= __('Count Posts', 'avia_framework' );\n\t\t\t$this->config['icon']\t\t= plugin_dir_url(__FILE__) . '../images/ic-template-icon.png';\n\t\t\t$this->config['target']\t\t= 'avia-target-insert';\n\t\t\t$this->config['shortcode'] \t= 'count_posts';\n\t\t\t$this->config['tooltip'] \t= __('Count the number of posts in a given term of a taxonomy', 'avia_framework' );\n\t\t\t$this->config['tinyMCE'] = array('tiny_always'=>true);\n\t\t\t$this->config['preview'] \t= true;\n\t\t}", "function pagBut($page_number, $buttontext) {\n echo \"<a class='btn btn-default' style='margin:5px; !important' href='adminIndex.php?panel=members&page=\" . $page_number . \"'> \" . $buttontext . \" </a>\";\n}", "function show_doc_count_in_tab() {\n\t\tglobal $bp;\n\n\t\t// Get the group slug, which will be the key for the nav item\n\t\tif ( !empty( $bp->groups->current_group->slug ) ) {\n\t\t\t$group_slug = $bp->groups->current_group->slug;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t// This will probably only work on BP 1.3+\n\t\tif ( !empty( $bp->bp_options_nav[$group_slug] ) && !empty( $bp->bp_options_nav[$group_slug][BP_DOCS_SLUG] ) ) {\n\t\t\t$current_tab_name = $bp->bp_options_nav[$group_slug][BP_DOCS_SLUG]['name'];\n\n\t\t\t$doc_count = groups_get_groupmeta( $bp->groups->current_group->id, 'bp-docs-count' );\n\n\t\t\t// For backward compatibility\n\t\t\tif ( '' === $doc_count ) {\n\t\t\t\tBP_Docs_Groups_Integration::update_doc_count();\n\t\t\t\t$doc_count = groups_get_groupmeta( $bp->groups->current_group->id, 'bp-docs-count' );\n\t\t\t}\n\n\t\t\t$bp->bp_options_nav[$group_slug][BP_DOCS_SLUG]['name'] = sprintf( __( '%s <span>%d</span>', 'bp-docs' ), $current_tab_name, $doc_count );\n\t\t}\n\t}", "public function spanCount($count) {\n\t\tif ($count) {\n\t\t\treturn '<a href=\"#\" onclick=\"return dumpToggle(this)\" class=\"dump_count\"> /* ' . $count . ' */ </a><span>';\n\t\t}\n\n\t\treturn $this->span('count', ' /* ' . $count . ' */ ');\n\t}", "public function count_html()\n {\n global $Article_Reaction_DB;\n return '<input hidden id=\"getPosId\" value=\"'. $this->get_post_id() .'\"><span id=\"like_count\">'. $Article_Reaction_DB->get_data($this->get_post_id()) .'</span>'; \n }", "function wmb_the_custom_comment_count() {\n\t$comment_count = wmb_custom_comment_count();\n\t$label = ($comment_count != 1) ? ' Comments' : ' Comment';\n\techo esc_html($comment_count . $label);\n}", "function showNumberOfBookmarks($action, $listingId)\n{\n $bookmark = new Bookmark; \n $linkedevent = new Linkedevent;\n $linkedevent = $bookmark->checkEvent($listingId);\n $count = 0 ;\n\n if (!is_null($linkedevent)) {\n $count = $bookmark->getNumberOfBookmarks(\n array(\n 'linkedevent_id'=> $linkedevent->id,\n 'action'=> $action\n )\n );\n }\n\n return $bookmark->getButtonLabel($action, $count);\n\n}", "function hitcounter(){\n\t\t$hitcounter= $this->model->hitcounter();\n\t\t$songuoionline = $this->model->demsonguoionline();\t\t\t\n\t\techo \"Lượt truy cập: <span>\". str_pad($hitcounter,5,\"0\",0). \" </span>\";\n echo \"Đang online: <span>\". str_pad($songuoionline,5,0,0).\" </span>\"; \n\t}" ]
[ "0.6322887", "0.58140075", "0.566655", "0.56151634", "0.5529728", "0.5507868", "0.5408662", "0.54049164", "0.5388507", "0.5374601", "0.536672", "0.53623044", "0.536225", "0.5342841", "0.5306542", "0.5299632", "0.5284188", "0.5272734", "0.5272007", "0.5196947", "0.51717186", "0.516465", "0.51641953", "0.5157407", "0.51301104", "0.5073374", "0.5069572", "0.5058563", "0.50503266", "0.5036522" ]
0.7037163
0
Deletes the person from the collection.
public function deleteThePerson($sender) { $this->collection->removeFirstWhere("id", $sender->data_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($Person_ID);", "public function destroy(Person $person)\n {\n $person->delete();\n return redirect('/people');\n }", "public function destroy(Person $person)\n {\n //\n }", "public function destroy(Person $person)\n {\n //\n }", "public function destroy(Person $person)\n {\n //\n }", "public function delete()\n {\n if ($this->id == 0)\n return null;\n\n $db = Db::instance();\n $q = sprintf(\"DELETE FROM `%s` WHERE `pkPerson` = %d;\", self::DB_TABLE, $id);\n\n return $db->query($q); //return true if successful, false otherwise\n }", "public function action_personDelete(){\r\n\t\tif ( $this->validateEdit() ){\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\t// 2. usunięcie rekordu\r\n\t\t\t\tgetDB()->delete(\"person\",[\r\n\t\t\t\t\t\"idperson\" => $this->form->id\r\n\t\t\t\t]);\r\n\t\t\t\tgetMessages()->addInfo('Pomyślnie usunięto rekord');\r\n\t\t\t} catch (PDOException $e){\r\n\t\t\t\tgetMessages()->addError('Wystąpił błąd podczas usuwania rekordu');\r\n\t\t\t\tif (getConf()->debug) getMessages()->addError($e->getMessage());\t\t\t\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\t// 3. Przekierowanie na stronę listy osób\r\n\t\tforwardTo('personList');\t\t\r\n\t}", "public function deleted(Personne $personne)\n {\n //\n }", "public function delete(string $collabPersonId);", "public function destroy(People $people)\n {\n //\n }", "public function removePerson($aName)\n {\n \n $aPerson = $this->find(ucfirst ($aName));\n if($aPerson !=null)\n {\n $compareName = ucfirst($aPerson->getName());\n }\n \n \n if($aName == $compareName)\n {\n $personObject = $this->find($aName);\n\t\t\t$key = array_search($personObject, $this->people);\n \n\n unset($this->people[$key]);\n\t\t\t\n\t\t\t//===DATABASE CODE GOES HERE\n\t\t\t\n\t\t\t//Checks if the person object still exists\n if(!$this->find($aName))\n\t\t\t{\n// echo $aName.\" has been removed succesfully.<br/>\";\n\t\t\t}\n }\n else\n {\n echo $aPerson.' does not exist';\n }\n \n }", "public function destroy(Person $person)\n {\n $person->delete();\n return \"Person Deleted Seccussfully\";\n }", "public function destroy(Request $request)\n {\n //\n $person = Person::find($request->personId);\n $person->delete();\n return redirect('/persons')->with('success', 'Person Deleted');\n }", "public function delete_delete(){\n \t\t$id = $this->uri->segment(3);\n \t\t// $r = $this->delete('id');\n \t\t// $this->response($id);\n\t $response = $this->PersonM->delete_person(\n\t $id\n\t );\n\t $this->response($response);\n \t}", "public function destroy($id)\n {\n $person = Person::findOrFail($id);\n $person->delete();\n }", "public function delete($person)\n {\n if(!($person instanceof Person))\n throw new PersonException(\"passed parameter isn't a Person instance\");\n $this->deleteById($person->getIdPerson());\n }", "public function delete( $person) {\n \t\n\t\ttry \n\t\t{ \n\t\t \n\t\t\t \n\t\t\t $this->db->StartTrans();\n\t\t\t \n\t\t\t $persona = $this->getInfo($person);\n\t\t\t \t\t \n\t\t $sql=\"DELETE FROM contact_institutions WHERE pins_persona = '$person'\";\n\t\t $this->db->Execute($sql);\t\t\n\t\t $sql = \"DELETE FROM personas WHERE pers_persona='$person'\";\n\t\t\t $this->db->Execute($sql);\n\t\t\t \n\t\t\t $this->db->CompleteTrans();\n\t\t\t \n\t\t\t return array(\"success\"=> true, 'message'=>\"Se ha eliminado de la base de datos a la persona: \\n\\n\".$persona['nombre']);\n\t\t\t\n\t\t}catch(Exception $e){\n\t\t $this->db->RollbackTrans();\n\t\t\t $this->setError($e->getCode(), $e->getMessage());\n\t\t\t throw new Exception( $e->getMessage() , $e->getCode() );\t\n\t\t}\n\t\t\t\t\n }", "public function destroy(People $people)\n {\n $people->delete();\n\n return redirect()->route('people.index')\n ->with('success','people deleted successfully');\n }", "public function removeParticipantAssociation($person)\n {\n $this->participants->removeElement($person);\n }", "public function delete()\n {\n foreach ($this->points as $point) {\n $point->delete();\n }\n }", "public function deletePersonnage(Personnage $perso)\n {\n $this->_bdd->exec('DELETE FROM personages WHERE id = '.$perso->getId());\n }", "public function destroy(Request $request)\n\t{\n\t\t$people = PersonalPeople::findOrFail($request->input('id'));\n\t\t$account_ledger = AccountLedger::find($people->ledger_id); \n\t\tif($account_ledger != null) {\n\t\t\t$account_ledger->delete();\n\t\t}\n\t\t\n\t\t$people->delete();\n\t\t\n\t\treturn response()->json(['status' => 1, 'message' => 'People'.config('constants.flash.deleted'), 'data' => []]);\n\t}", "public function action_delete() {\n $id = $this->request->param('id');\n if ($id) {\n $personnel = ORM::factory('Personnel', $id);\n $data = array('id' => $personnel->personnel_id);\n $user = ORM::Factory('User', $personnel->user_id);\n if ($personnel->loaded()) {\n try {\n $personnel->delete_status = 1;\n $user->delete_status = 1;\n $personnel->save();\n $user->save();\n $this->_set_msg(' Personnel record was deleted', 'success', $data);\n } catch (Exception $e) {\n $this->_set_msg('Could not delete personnel because this would wipe their history!', 'error', $data);\n }\n }\n $this->redirect($this->request->referrer());\n }\n }", "public function delete()\n { if (is_null($this->id))\n trigger_error(\"Contributor::delete(): Attempt to delete a Contributor object that does not have its ID property set.\", E_USER_ERROR);\n\n // Delete the Reaction\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $st = $conn->prepare(\"DELETE FROM contributor WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }", "function delete() {\r\t\t//Delete the person_section records attached to this section\r\t\t$personSectionClass = DB_DataObject::staticAutoloadTable('person_section');\r\t\t$personSectionObject = new $personSectionClass;\r\t\t$personSectionObject->section_id = $this->id;\r\t\t$personSectionObject->find();\r\t\t//echo '<PRE> Found Person Section Objects'; print_r($personSectionObject); echo '<PRE>'; //Testing Only\r\r\t\twhile ($personSectionObject->fetch()) {\r\t\t\t//echo '<PRE>Section -- Found Person Section Objects'; print_r($personSectionObject); echo '<PRE>'; //Testing Only\r\t\t\t$deleteObject = new $personSectionClass;\r\t\t\t$deleteObject->id = $personSectionObject->id;\r\t\t\t$deleteObject->person_id = $personSectionObject->person_id;\r\t\t\t$deleteObject->section_id = $this->id;\r\t\t\t$deleteObject->price = $personSectionObject->price;\r\t\t\t$deleteObject->delete();\r\t\t}\r\r\t\treturn DB_DataObject::delete(); //Call the parent method\r\t}", "public function deleteObject() {\n\t\t$this->people()->each()->deleteObject();\n\t\t$this->invoices()->each()->deleteObject();\n\t\tparent::deleteObject();\n\t}", "public function deletePerson($request) {\n\n $id = $request['id'];\n $domain = $request['domain'];\n $column = prefixed($domain) . '_id';\n $sql = 'DELETE FROM ' . $domain . ' WHERE '.$column.' = :id';\n //echo $id; //exit\n //echo $column; //exit;\n //echo $domain; //exit;\n //echo $sql; //exit\n\n $statement = $this->pdo->prepare($sql);\n //$statement->bindParam(':column', $column);\n $statement->bindValue(':id', $id);\n $statement->execute();\n return $statement->rowCount();\n\n }", "public function delete()\n {\n EM::instance()->remove($this);\n EM::instance()->flush($this);\n }", "public function delete(Request $request)\n {\n $this->validate($request, [\n \"id\" => \"required|integer\",\n \"personId\" => \"required|integer\"\n ]);\n\n DB::transaction(function () use (&$request) {\n $this->personReferenceDao->delete(\n $request->personId,\n $request->id\n );\n });\n\n $resp = new AppResponse(null, trans('messages.dataDeleted'));\n return $this->renderResponse($resp);\n }", "public function destroy(ModelPersons $modelPersons)\n {\n //\n }" ]
[ "0.7210845", "0.69603777", "0.6814711", "0.6814711", "0.6814711", "0.67429465", "0.6659667", "0.664144", "0.6616485", "0.6435395", "0.6368583", "0.634515", "0.6335444", "0.63267946", "0.6283413", "0.6273011", "0.6272779", "0.6260114", "0.624937", "0.6193334", "0.6140707", "0.6139227", "0.6137354", "0.6091291", "0.6091253", "0.6084399", "0.6082708", "0.60775405", "0.6071959", "0.60605043" ]
0.72930455
0
Sum of all even Fibonacci numbers <= 4 million
function sumFibo($max) { $fi1 = 1; $fi2 = 2; $fi3 = 0; $sum = $fi2; while (1) { // Find the next Fibonacci number $fi3 = $fi1 + $fi2; // Do not continue if the result is bigger than the defined max if ($fi3 > $max) break; // Take only even number if ($fi3 % 2 === 0) { $sum += $fi3; } // Shift the old previous numbers $fi1 = $fi2; $fi2 = $fi3; } return $sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function sumOfFibonacciEvens(int $limit = 4000000): int\n {\n static::checkPositive($limit);\n return array_sum(static::getFibonacciEvens($limit));\n }", "function fibonacci($n) {\n if ($n <= 1) {\n return $n;\n }\n $n1 = 0;\n $n2 = 1;\n for ($i = 2; $i <= $n; $i++) {\n $temp = $n2;\n $n2 = $n1 + $n2;\n $n1 = $temp;\n }\n return $n2;\n}", "function fibonacci($max) {\n $array = array();\n $low = 1;\n $high = 1;\n while ($high < $max) {\n $tmp = $low;\n $low = $high;\n $high = $tmp + $high;\n $array[] = $low;\n }\n return $array;\n}", "function nthFibo2($n) {\n if ($n < 1) {\n return -1;\n }\n $value1 = 1;\n $value2 = 1;\n if ($n <= 2) {\n return 1;\n }\n for ($i=3; $i <= $n; $i++) { \n $result = $value1 + $value2;\n $value1 = $value2;\n $value2 = $result;\n }\n return $result;\n}", "function fib($n)\n{\n if ($n == 0) return 0;\n if ($n < 3) {\n return 1;\n } // if n is smaller than 3 return n (1 or 2)\n else {\n return fib($n - 1) + fib($n - 2);\n }\n /* if the number is 3 or above do 2 sums (n-1) and (n-2)\n and then add the 2 sums together (n-1)+(n-2)\n Example Fibonacci number 4\n (4-1)+(4-2) = 5\n 3 + 2 = 5\n */\n}", "function nthFibo($n) {\n if ($n < 1) {\n return -1;\n }\n $memo[1] = 1;\n $memo[2] = 1;\n if ($n <= 2) {\n return $memo[$n];\n }\n for ($i=3; $i <= $n; $i++) { \n $memo[$i] = $memo[$i-1] + $memo[$i-2];\n }\n return $memo[$n];\n}", "function fibonacci($n){\n /*\n * Notice that in PHP, we do not have to declare our variables, nor must we\n * declare their types. Also see how variables in PHP are prefaced with the\n * dollar sign. Other than that, this is identical to the C version of this function.\n */\n $a = 0;\n $b = 1;\n for ($i = 0; $i < $n; $i++){\n printf(\"%d\\n\",$a);\n $sum = $a+$b;\n $a = $b;\n $b = $sum;\n }\n}", "function fibonacci() {\n\t\n\n\n\n\n }", "function Fibonacci($number){\n if ($number == 0) {\n return 0; \n } else if ($number == 1) {\n return 1; \n } else {\n // Recursive Call to get the upcoming numbers \n return (Fibonacci($number-1) + Fibonacci($number-2)); \n }\n}", "function mi_fibonacci($i){\n\t$inicio = 1;\n\t$siguiente = 1;\n\tfor($f = 0; $f <= $i; $f++){\n\t\t//genera el inicio con el siguiente actual\n\t\t$actual = $siguiente + $inicio;\n\t\t$inicio = $siguiente;\t\t\n\t\tprint \"<br>fibonacci $i $f : $inicio + $siguiente = $actual\";\n\t\t$siguiente = $actual;\n\t}\n\n\treturn($actual);\n}", "function fibonacci($n){\n\n \n if($n == 0){\n \n return 0;\n \n }else if($n == 1){\n \n return 1;\n \n } else {\n \n return (fibonacci($n - 1) + fibonacci($n - 2));\n } \n \n}", "function fib($n)\r\n{\r\n $first =0;\r\n $second=1;\r\n for($i=2;$i<$n;$i++)\r\n {\r\n $third = $first+$second;\r\n\r\n //move\r\n$first=$second;\r\n$second=$third;\r\n\r\n\r\n }\r\n$fib = $third;\r\nreturn $fib;\r\n\r\n\r\n\r\n}", "function fibonacci(int $n): int\n{\n if ($i == 0 || $i == 1) {\n return $n;\n }\n return fibonacci($n-1) + fibonacci($n-2);\n}", "function getFibbonaci($n) {\n $res = [0, 1];\n for ($i = 2; $i < $n; $i++) {\n $res[$i] = ($res[$i - 1] + $res[$i - 2]);\n }\n echo 'Fibbonaci: ' . implode(',', $res);\n}", "function fibonacci_nos_less_than_x(int $x) {\r\n\r\n // Defining variables\r\n $i = 0;\r\n $upper_bound = $x;\r\n $seed_array = array(1, 2);\r\n $array_of_even_terms = array();\r\n\r\n do {\r\n $next_fib_no = $seed_array[$i] + $seed_array[$i + 1];\r\n if($next_fib_no <= $upper_bound) {\r\n $seed_array[] = $next_fib_no;\r\n }\r\n $i++;\r\n } while($next_fib_no <= $upper_bound);\r\n\r\n // Print $seed_array\r\n //echo \"The values of array of Fibonacci numbers less than $upper_bound are: <br>\";\r\n //print_array($seed_array);\r\n return $seed_array;\r\n}", "function fibo($number){\n if($number == 1) return 1;\n if($number == 2) return 1;\n else{\n return fibo($number-1)+fibo($number-2);\n }\n }", "public function isFibonacci($number) {\n\t\treturn $this->isSquare( intval( (5*$number*$number) + 4) ) && $this->isSquare( intval( (5*$number*$number) - 4) );\n\t}", "function problem2(): int\n{\n $maxNumber = 4000000;\n $currNumber = 1;\n $nextNumber = 2;\n $answer = 0;\n\n while ($currNumber <= $maxNumber) {\n $answer += $currNumber % 2 == 0 ? $currNumber : 0;\n [$currNumber, $nextNumber] = [$nextNumber, $currNumber + $nextNumber];\n }\n\n return $answer;\n}", "function printPrimeAndFib($n)\n{\n\t// Using Sieve to generate all primes\n\t// less than or equal to n.\n\t$prime = array_fill(0, $n + 1, true);\n\tfor ($p = 2; $p * $p <= $n; $p++)\n\t{\n\n\t\t// If prime[p] is not changed,\n\t\t// then it is a prime\n\t\tif ($prime[$p] == true)\n\t\t{\n\n\t\t\t// Update all multiples of p\n\t\t\tfor ($i = $p * 2;\n\t\t\t\t$i <= $n; $i += $p)\n\t\t\t\t$prime[$i] = false;\n\t\t}\n\t}\n\n\t// Now traverse through the range\n\t// and print numbers that are both\n\t// prime and Fibonacci.\n\tfor ($i = 2; $i <= $n; $i++)\n\tif ($prime[$i] && (isSquare(5 * $i * $i + 4) > 0 ||\n\t\t\t\t\tisSquare(5 * $i * $i - 4) > 0))\n\t\techo $i . \" \";\n}", "function fib(int $n): array {\n $a = 0;\n $b = 1;\n\n $seq =[];\n\n do {\n $seq[] = $a;\n $nth = $a + $b;\n $a = $b;\n $b = $nth; \n } while($n--);\n\n return $seq;\n}", "public function testFibonacci()\n\t{\n\t\t$valores=array(array(5,3,5),array(4,2,3),array(2,1,1),array(1,0,1),array(0,-1,0),array('',-1,-1));\n \t\tfor ($i=0;$i < count($valores);$i++){ \n\t\t\t$fibo = new procesado($valores[$i][0],0,1);\n\t\t\t$this->AssertEquals(array($valores[$i][1],$valores[$i][2]),$fibo->fibo_test());\n\t\t}\n\t}", "function euler002(int $bound): int\n{\n $previous = 0;\n $current = 1;\n $sum = 0;\n while ($current <= $bound) {\n if ($current % 2 == 0) {\n $sum += $current;\n }\n $tmp = $previous + $current;\n $previous = $current;\n $current = $tmp;\n }\n return $sum;\n}", "function fib() {\n list($i, $j) = [0, 1];\n while ($i != INF) {\n list($i, $j) = [$j, $i + $j];\n yield $i;\n }\n}", "function fibGen($n){\n return $n > 0 ? fibGen($n-1) + fibGen($n-2) : $n;\n}", "function fibv1(int $c): int {\n $prev1 = 0;\n $prev2 = 1;\n\n $y = 0;\n\n if ($c === 1) {\n return 1;\n }\n\n for ($x = 2; $x <= $c; $x++) {\n $y = $prev1 + $prev2;\n $prev1 = $prev2;\n $prev2 = $y;\n }\n return $y;\n}", "function fibonacci(array $num)\n{\n\n $x = current($num); /*0*/\n $y = end($num); /*1*/\n\n $fib=($x+$y);\n array_push($num,$fib);\n\n\n while (sizeof($num) < 10){\n fibonacci($num);\n }\n\n print_r($num);\n exit;\n\n\n}", "function summation($n) {\n\t$sum = 0;\n \tfor ($i = $n; $i >= 0; $i--) { \n \t\t$sum += $i;\n \t}\n \treturn $sum;\n}", "protected static function getFibonacciEvens(int $limit): array\n {\n $n1 = 1;\n $n2 = 2;\n $evens = [2];\n\n while (($new = $n1 + $n2) <= $limit) {\n if ($new % 2 == 0) {\n $evens[] = $new;\n }\n $n1 = $n2;\n $n2 = $new;\n }\n\n return $evens;\n }", "public function testFibonacciSearch()\n {\n $test1 = fibonacciPosition(6); // 8\n $test2 = fibonacciPosition(9); // 34\n $test3 = fibonacciPosition(60); // 1548008755920\n\n $this->assertEquals(8, $test1);\n $this->assertEquals(34, $test2);\n $this->assertEquals(1548008755920, $test3);\n }", "function sum($n) {\n\n $sum = 0;\n for ($i=1;$i <= $n;$i++){\n $sum+=$i;\n }\n\n return $sum;\n}" ]
[ "0.7242724", "0.6964798", "0.68992895", "0.68485063", "0.67926973", "0.67178094", "0.66663086", "0.6568034", "0.6549701", "0.65203094", "0.65145546", "0.6501641", "0.6413371", "0.6403414", "0.6304848", "0.63009953", "0.6299709", "0.625263", "0.62038594", "0.6187433", "0.6063782", "0.6006545", "0.59879434", "0.59826785", "0.5958726", "0.5827635", "0.5789422", "0.57846665", "0.5753458", "0.5685887" ]
0.7993115
0
Handles the submitted form to create a new user along with her empty details and progress. Every new user is automatically assigned the "ROLE_USER" role. On successful registration the user gets automatically logged in.
public function createAction(Request $request){ $form = $this->createForm(new RegistrationType(), new Registration()); $form->handleRequest($request); if ($form->isValid()) { $registration = $form->getData(); /* @var $user User */ $user = $registration->getUser(); $userProgress = new UserProgress(); $user->setProgress($userProgress); $userDetails = new UserDetails(); $user->setDetails($userDetails); // Encode the password of the user $plainPassword = $user->getPassword(); $encoderFactory = $this->container->get('security.encoder_factory'); $encoder = $encoderFactory->getEncoder($user); $encodedPassword = $encoder->encodePassword($plainPassword, $user->getSalt()); $user->setPassword($encodedPassword); $em = $this->getDoctrine()->getManager(); // Assign the "Registered User" role to a new user $role = $em->getRepository('MartonTopCarsBundle:Role')->findOneBy(array('role' => 'ROLE_USER')); $user->addRole($role); $em->persist($user); $em->flush(); // Automatically log in the user after a successful registration $token = new UsernamePasswordToken($user, null, 'secured_area', $user->getRoles()); $this->get('security.context')->setToken($token); $this->get('session')->set('_security_main',serialize($token)); // Set flash message that will appear only once $this->get('session')->getFlashBag()->add( 'notice', 'Welcome, now let the fun begin! :)' ); return $this->redirect($this->generateUrl('marton_topcars_account')); } // If the validation failed, render the form again, this time with errors visible return $this->render( 'MartonTopCarsBundle:Default:Pages/registration.html.twig', array('form' => $form->createView()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function new_user() {\n \n // Check if the session exists and if the login user is admin\n $this->check_session($this->user_role, 1);\n \n // Get new user template\n $this->body = 'admin/new-user';\n $this->admin_layout();\n }", "public function create()\n {\n if((auth()->user()->hasPermissionTo('user_add', 'admin') != true) || (auth()->user()->type ?? '') != 'super_admin')\n return $this->permission_denied('users');\n\n return view('dashboard.users.user.form')\n ->with([\n 'page_title' => $this->page_title,\n 'entity' => $this->entity,\n 'entity_action' => $this->entity_action,\n ]);\n }", "public function create()\n {\n if (!Auth::user()->isAdmin()) {\n return Redirect::route(\"admin.user.edit\", array('id' => Auth::user()->id));\n }\n $role = Config::get('auth.roles');\n $zones = Config::get('auth.zones');\n if (!Auth::user()->isSuperAdmin()) {\n unset($role[User::SUPERADMIN]);\n }\n $this->layout->content = View::make('IpsumAdmin::user.form', compact(\"data\", \"role\", \"zones\"));\n }", "public function createUser(): void\n {\n $insert_result = '';\n\n // If the form have been submitted :\n if (isset($_POST['firstname']) &&\n isset($_POST['lastname']) &&\n isset($_POST['email']) &&\n isset($_POST['birthday']) &&\n isset($_POST['cars'])) {\n // Create the user :\n $usersService = new UsersService();\n $userId = $usersService->setUser(\n null,\n $_POST['firstname'],\n $_POST['lastname'],\n $_POST['email'],\n $_POST['birthday']\n );\n $isOk = true;\n if (!empty($_POST['cars'])) {\n foreach ($_POST['cars'] as $carId) {\n $isOk = $usersService->setUserCar($userId, $carId);\n }\n }\n if ($isOk) {\n $insert_result = 'Utilisateur créé avec succès.';\n } else {\n $insert_result = 'Erreur lors de la création de l\\'utilisateur.';\n }\n }\n\n $carsService = new CarsService();\n $_cars = $carsService->getCars();\n\n require 'views/user/user_create.php';\n }", "public function create() {\n\n $current_user = $this->usermodel->current_user();\n\n if ($this->permission->user_can('create_user', $current_user['id']) === false) {\n return abort(404);\n }\n\n return view('admin.addnewuser',[\n 'current_user' => $current_user,\n 'userpermission' => $this->permission,\n 'notification' => $this->notification->get_header_notification(),\n ]);\n\n }", "public function createAction() {\n $request = $this->getRequest();\n $form = new \\Admin_Form_UserCreate();\n\n if($request->isPost()) {\n if($form->isValid($request->getParams())) {\n $data = $form->getValues();\n\n try {\n $user = UserService::create(array(\n 'username' => $data['username'],\n 'email' => $data['email'],\n 'password' => UserService::encryptPassword($data['password']),\n 'role' => AclRoleService::find($data['role']),\n 'dateCreated' => new DateTime(),\n 'active' => true,\n 'locked' => false,\n ));\n\n UserProfileService::create(array(\n 'user' => $user,\n 'firstName' => $data['firstName'],\n 'lastName' => $data['lastName'],\n 'phone' => $data['phone'],\n 'website' => $data['website'],\n 'timeZone' => TimeZoneService::findOneByName('America/Los_Angeles'),\n ));\n\n UserEditEventService::create(array(\n 'user' => $user,\n 'editor' => $this->_user,\n 'ip' => $this->getRequest()->getServer('REMOTE_ADDR'),\n 'date' => new DateTime(),\n 'description' => 'Creation',\n ));\n\n $this->view->success = 1;\n $this->_helper->sessionMessenger('User created successfully.', 'success');\n return $this->_helper->getHelper('Redirector')->gotoRoute(array(), 'adminUsers');\n } catch(Exception $e) {\n $this->getResponse()->setHttpResponseCode(500);\n $this->view->success = 0;\n $message = ('development' == APPLICATION_ENV ? $e->getMessage() : 'Application error: AUCCA001');\n $this->view->messages()->addMessage($message, 'error');\n Logger::err($e->getMessage());\n }\n } else { // Submitted form data is invalid\n $this->getResponse()->setHttpResponseCode(500);\n $this->view->success = 0;\n }\n }\n\n $this->view->form = $form;\n }", "public function CreateUser()\n {\n \t$userinfo = $this->_doCreateUser();\t\t\n $this->processPostAction();\n }", "public function createUser()\n {\n $validatedData = Validator::make($this->data, [\n 'name' => 'required',\n 'position' => 'required',\n 'nation' => 'required',\n 'region' => 'required',\n 'district' => 'required',\n 'ward' => 'required',\n 'street' => 'required',\n 'address' => 'required',\n 'email' => 'required|email|unique:users',\n 'mobile' => 'required|regex:/^(0)[0-9]{9}$/|not_regex:/[a-z]/',\n 'password' => 'required|confirmed',\n ])->validate();\n\n $validatedData['password'] = bcrypt($validatedData['password']);\n\n User::create($validatedData);\n\n $this->dispatchBrowserEvent('hide-form', ['message' => 'User added successfuly!']);\n }", "public function actionCreate()\n {\n $model = new User();\n $post = Yii::$app->request->post();\n\n $modelForm = new UserForm();\n $modelForm->status = User::STATUS_NEW;\n if ($modelForm->load($post)) {\n if ($model = $modelForm->process()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'modelForm' => $modelForm,\n 'model' => $model,\n ]);\n }", "public function newUserAction()\n {\n return $this->createForm(new UserType());\n }", "public function store(UserCreateForm $request)\n {\n /*if(in_array('1',$request->role_id)){\n $is_super_admin=1;\n }else{\n $is_super_admin=0;\n }*/\n $data = [\n 'name' => $request['name'],\n 'email' => $request['email'],\n 'password' => bcrypt($request['password']),\n 'is_super_admin' => $is_super_admin,\n 'dep_id' => (int)$request['dep_id']\n ];\n try {\n $roles = RoleRepository::getByWhereIn('id', $request['role_id']);\n\n if (empty($roles->toArray())) {\n return $this->errorBackTo(\"用户角色不存在,请刷新页面并选择其他用户角色\");\n }\n\n $user = UserRepository::create($data);\n if ($user) {\n foreach ($roles as $role) {\n $user->attachRole($role);\n }\n return $this->successRoutTo('backend.user.index', '新增用户成功');\n }\n\n }\n catch (\\Exception $e) {\n return $this->errorBackTo(['error' => $e->getMessage()]);\n }\n }", "public function createAction()\n {\n $entity = new User();\n $request = $this->getRequest();\n $form = $this->createForm(new UserType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('user_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('ProjetUserBundle:User:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n\t{\n\t\t$user = new User;\n\n\t\t$roles = Auth::user()->preferredCompany->roles()->lists('name', 'id');\n\t\t$areas = Auth::user()->preferredCompany->areas()->lists('name', 'id');\n\t\t\n\t\t$system_roles = SystemRole::lists('name', 'id');\n\t\t\n\t\t$form_data = array('route' => 'usuarios.store', 'method' => 'POST', 'files' => true);\n\t\treturn View::make('dashboard.pages.user.form', compact(\n\t\t\t 'user', 'form_data', 'roles', 'areas'\n\t\t));\n\t}", "public function addNewCustomerFormSubmit()\n {\n $this->validate([\n 'fieldName' => ['required', 'string', 'max:255'],\n 'fieldNID' => ['nullable', 'numeric', 'unique:users,nid'],\n 'fieldBCN' => ['nullable', 'numeric', 'unique:users,birth_certificate_no'],\n 'fieldPhone' => ['required', 'integer', 'digits:10', 'unique:users,phone'],\n 'fieldEmail' => ['nullable', 'string', 'email', 'max:255', 'unique:users,email'],\n 'fieldAddress' => ['required', 'string', 'max:255']\n ]);\n\n $newUser = User::create([\n 'name' => $this->fieldName,\n 'nid' => $this->fieldNID,\n 'birth_certificate_no' => $this->fieldBCN,\n 'phone' => $this->fieldPhone,\n 'email' => $this->fieldEmail,\n 'address' => $this->fieldAddress,\n 'password' => Hash::make('12345678'),\n ]);\n $newUser->assignRole('Customer');\n\n $this->resetForm();\n $this->emit('customerAddedFromAnywhere', $newUser->id); //call listener to reload product list\n $this->dispatchBrowserEvent('addedFromAnywhere'); // browser event trigger\n session()->flash('success', 'Customer Added Successfully.');\n }", "public function actionCreate()\n {\n $model = new UserCreateForm();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->save()) {\n Yii::$app->session->setFlash('success',Yii::t('backend_controllers_users_create','User {user} created successfuly.', [\n 'user' => $model->username,\n ]));\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function createUserFormAction(Request $request)\n {\n $user = new User();\n /*$user->setLogin('mabidi');\n $user->setPassword('mabidi');\n $user->setEmail('[email protected]');*/\n\n $form = $this->createFormBuilder($user)\n ->add('login', 'text')\n ->add('password', 'password')\n ->add('email', 'email')\n ->add('save', 'submit')\n ->add('saveAndAdd', 'submit')\n ->getForm();\n\n $form->handleRequest($request);\n if ($form->isValid()) {\n $nextAction = $form->get('saveAndAdd')->isClicked()\n ? 'immobilier_manager_createUserForm'\n : 'immobilier_manager_showUser';\n\n return $this->redirect($this->generateUrl($nextAction,array('id'=>'2')));\n }\n return $this->render('ImmobilierManagerBundle:User:new.html.twig', array(\n 'form' => $form->createView(),\n ));\n }", "public function createUserAction()\n { \n \n $iUserType = $this->getRequest()->getParam('id');\n\n $form = $this->createUserForm();\n\n\tif(!$this->getRequest()->isPost())\n\t{\n\t echo \"<h4 id='infusr'>Datos del Usuario</h4>\";\n\t echo $form;\n\t return;\n\t}\n\tif(!$form->isValid($this->_getAllParams()))\n\t{\n\t echo $form;\n\t return;\n\t}\n\n\t$values = $form->getValues();\n\n\tif($values['password'] != $values['verifypassword'])\n\t{\n\techo \"La contraseña no coincide\";\n\techo $form;\n\treturn;\n\t}\n\n\tif(isset($values['user']))\n {\n $image = APPLICATION_PATH.\"/../public/img/usr/\".$form->user->getFileName(null,false);\n } \n\telse \n\t{\n\t $image = '';\n }\n\n\tswitch ($iUserType) \n\t{\n\t case 1:\n\n\t\t$this->sql->insertAdmin($values['cc'],sha1($values['password']),$values['names'],$values['lastnames'],$values['telephone'],$values['movil'],$image);\n\t\tbreak;\n\n\t case 2:\n\n\t\t$this->sql->insertClient($values['cc'],sha1($values['password']),$values['names'],$values['lastnames'],$values['telephone'],$values['movil'],$image);\n\t\tbreak;\n\n\t case 3:\n\n\t\t$this->sql->insertDeveloper($values['cc'],sha1($values['password']),$values['names'],$values['lastnames'],$values['telephone'],$values['movil'],$image);\n\t\tbreak;\n\t}\n $this->_helper->redirector('index', 'index');\n }", "public function create()\n {\n $this->data['titlePage'] = 'New User';\n $breadcrumbs = array();\n $breadcrumbs[] = [ 'title' => 'Home', 'link' => route('admin.home'), 'icon' => 'dashboard' ];\n $breadcrumbs[] = [ 'title' => 'Users', 'link' => route('admin.users.index'), 'icon' => 'user' ];\n $breadcrumbs[] = [ 'title' => $this->data['titlePage'] ];\n $this->data['breadcrumbs'] = $breadcrumbs;\n\n // Get role data\n $roles = Role::getRoleIdName();\n $this->data['roles'] = $roles;\n\n return view(\"admin.user.create\")->with($this->data);\n }", "public function actionCreate()\n {\n $model = new SignupForm();\n if ($model->load(Yii::$app->request->post())) {\n if($model->signup()) {\n $mig = new Migration();\n $user = User::find()->andFilterWhere(['=','username',$model->username])->one();\n $mig->authManager->assign($mig->authManager->getRole('Viewer'), $user->attributes['id']);\n Yii::$app->session->setFlash('success', \"User: \".$model->username.\" created.\");\n echo \"<script>window.history.back();</script>\";\n die;\n }\n else{\n print_r($model->getErrors()['username'][0]);\n $properties = [\n 'disabled' => true,\n ];\n Yii::$app->session->setFlash('danger', \"User not created.\");\n echo \"<script>window.history.back();</script>\";\n die;\n }\n }\n\n\n return $this->renderAjax('signup', [\n 'model' => $model,\n ]);\n }", "public function CreateAgentAction() {\n\n $userManager = $this->get('fos_user.user_manager');\n $userMail = $this->get('fos_user.mailer');\n $formbuilder = $this->createForm(new UserType($userManager->getClass()));\n $formhandler = new RegistrationFormHandler($formbuilder, $this->get('request'), $userManager, $userMail, $this->container->get('fos_user.util.token_generator'));\n\n if ($formhandler->process()) {\n\n return $this->render('Inra2013urzBundle:Registration:save.html.twig', array('Status' => \"Create\"));\n }\n\n return $this->render('Inra2013urzBundle:Registration:register.html.twig', array('form' => $formbuilder->createView()));\n }", "public function newAction()\n {\n $form = new Facepalm_Form_User();\n\n if ($this->getRequest()->isPost()) {\n $post = $this->getRequest()->getPost();\n if ($form->isValid($post)) {\n $newUser = $form->persist();\n\n $this->_helper->getStaticHelper('redirector')\n ->gotoRouteAndExit(\n array(\n 'action' => 'view',\n 'user' => $newUser->username,\n )\n );\n }\n }\n\n $this->view->form = $form;\n }", "public function postCreate()\n\t{\n\t\t$validator = Validator::make(Input::all(), $this->validationRules);\n\n\t\t// If validation fails, we'll exit the operation now.\n\t\tif ($validator->fails())\n\t\t{\n\t\t\t// Ooops.. something went wrong\n\t\t\treturn Redirect::back()->withInput()->withErrors($validator);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t// We need to reverse the UI specific logic for our\n\t\t\t// permissions here before we create the user.\n\t\t\t$permissions = Input::get('permissions', array());\n\t\t\t// $this->decodePermissions($permissions);\n\t\t\tapp('request')->request->set('permissions', $permissions);\n\n\t\t\t// Get the inputs, with some exceptions\n\t\t\t$inputs = Input::except('csrf_token', 'password_confirm', 'groups');\n\n\t\t\t// Was the user created?\n\t\t\tif ($user = Sentry::getUserProvider()->create($inputs))\n\t\t\t{\n\t\t\t\t// Assign the selected groups to this user\n\t\t\t\tforeach (Input::get('groups', array()) as $groupId)\n\t\t\t\t{\n\t\t\t\t\t$group = Sentry::getGroupProvider()->findById($groupId);\n\n\t\t\t\t\t$user->addGroup($group);\n\t\t\t\t}\n\n\t\t\t\t// Prepare the success message\n\t\t\t\t$success = Lang::get('admin/users/message.success.create');\n\n\t\t\t\t// Redirect to the new user page\n\t\t\t\treturn Redirect::route('students', $user->id)->with('success', $success);\n\t\t\t}\n\n\t\t\t// Prepare the error message\n\t\t\t$error = Lang::get('admin/users/message.error.create');\n\n\t\t\t// Redirect to the user creation page\n\t\t\treturn Redirect::route('create/user')->with('error', $error);\n\t\t}\n\t\tcatch (LoginRequiredException $e)\n\t\t{\n\t\t\t$error = Lang::get('admin/users/message.user_login_required');\n\t\t}\n\t\tcatch (PasswordRequiredException $e)\n\t\t{\n\t\t\t$error = Lang::get('admin/users/message.user_password_required');\n\t\t}\n\t\tcatch (UserExistsException $e)\n\t\t{\n\t\t\t$error = Lang::get('admin/users/message.user_exists');\n\t\t}\n\n\t\t// Redirect to the user creation page\n\t\treturn Redirect::route('students', compact('belts', 'users'));\n\t}", "public function createUser()\n\t\t{\n\t\t\t\t\tlog_message('info', \"userCtrl\");\n\t\t\t\t\t$userData = $this->jsonbourne->decodeReqBody(); //get json\n\t\t\t\t\t$resultFromCreateANewUser = $this->userModel->create($userData); // pass arguments as array\n\t\t\t\t\techo count($resultFromCreateANewUser) > 1 ? $this->jsonbourne->forge(0, \"The user has been created\", $resultFromCreateANewUser): $this->jsonbourne->forge(1, \"error in the creation of user\", null);\n\t\t}", "public function newAction()\n {\n if (!$this->isGranted('CREATE', new User())) {\n throw new AccessDeniedException(\"You are not authorized for this page!\");\n }\n $entity = new User();\n $form = $this->createCreateForm($entity)\n ->add('create', 'submit', array('label' => 'c'));\n\n return $this->render(\n 'OjsAdminBundle:AdminUser:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }", "public function actionCreate(){\n if(Yii::app()->user->roles == 'admin'){\n $user = new User;\n $privacy = new Privacy;\n if(isset($_POST['User'])){\n \n $user->attributes = $_POST['User'];\n $user->fullname = $user->name .\" \".$user->lastname;\n \n $transaction = Yii::app()->db->beginTransaction();\n \n try{ \n if($privacy->save()){\n $user->id_privacy = $privacy->id;\n if($user->save()){\n $transaction->commit();\n Yii::app ()->user->setFlash('registered',Yii::t('global','You have successfully created new account.')); \n $user=new User; \n }\n }\n }\n catch (Exception $e){\n $transaction->rollback();\n }\n }\n \n $this->render('create',array(\n\t\t\t'model'=>$user,\n\t\t));\n }\n }", "public function create_user() {\n \n // Verify if session exists and if the user is admin\n $this->if_session_exists($this->user_role,1);\n \n // Check if data was submitted\n if ( $this->input->post() ) {\n \n // Add form validation\n $this->form_validation->set_rules('first_name', 'First Name', 'trim');\n $this->form_validation->set_rules('last_name', 'Last Name', 'trim');\n $this->form_validation->set_rules('username', 'Username', 'trim|required|alpha_dash');\n $this->form_validation->set_rules('password', 'Password', 'trim|required');\n $this->form_validation->set_rules('email', 'Email', 'trim|valid_email|required');\n $this->form_validation->set_rules('role', 'Role', 'integer');\n $this->form_validation->set_rules('sendpass', 'Send Password', 'integer');\n $this->form_validation->set_rules('plan', 'Plan', 'integer');\n \n // Get data\n $first_name = $this->input->post('first_name');\n $last_name = $this->input->post('last_name');\n $username = $this->input->post('username');\n $password = $this->input->post('password');\n $email = $this->input->post('email');\n $role = $this->input->post('role');\n $sendpass = $this->input->post('sendpass');\n $plan = $this->input->post('plan');\n \n // Check form validation\n if ( $this->form_validation->run() == false ) {\n \n display_mess(33);\n \n } else {\n \n // Check if the password has less than six characters\n if ( (strlen($username) < 6) || (strlen($password) < 6) ) {\n \n display_mess(34);\n \n } elseif ( preg_match('/\\s/', $username) || preg_match('/\\s/', $password) ) {\n \n // Check if the username or password contains white spaces\n display_mess(35);\n \n } elseif ( $this->user->check_email($email) ) {\n \n // Check if the email address are present in our database\n display_mess(60);\n \n } elseif ( $this->user->check_username($username) ) {\n \n // Check if the username are present in our database\n display_mess(37);\n \n } else {\n \n if ( $this->user->signup( $first_name, $last_name, $username, $email, $password, 1, $role ) ) {\n \n // The username and password will be send via email\n if ( $sendpass == 1 ) {\n \n $args = [\n '[username]' => $username,\n '[password]' => $password,\n '[site_name]' => $this->config->item('site_name'),\n '[login_address]' => $this->config->item('login_url'),\n '[site_url]' => $this->config->base_url()\n ];\n \n // Get the send-password-new-users notification template\n $template = $this->notifications->get_template('send-password-new-users', $args);\n \n if ( $template ) {\n \n $this->email->from($this->config->item('contact_mail'), $this->config->item('site_name'));\n $this->email->to($email);\n $this->email->subject($template ['title']);\n $this->email->message($template ['body']);\n \n if ( $this->email->send() ) {\n \n display_mess(61);\n \n } else {\n \n display_mess(62);\n \n }\n \n } else {\n \n display_mess(18);\n \n }\n \n } else {\n \n display_mess(63);\n \n }\n \n } else {\n \n display_mess(64);\n \n }\n \n }\n \n }\n \n }\n \n }", "public function create_form() {\n\n\t\treturn $this->render('user-create-form.php', array(\n\t\t\t'page_title' => 'Create Account',\n\t\t));\n\t}", "private function registerUser() {\n $newUser = new \\Model\\User;\n $newUser->setName($this->registerView->getName());\n $newUser->setPassword($this->registerView->getPassword());\n \n try {\n $this->userList->saveNewUser($newUser);\n $this->userSession->destroyUserSession(); // logs out if user wants to register\n $message = \"Registered new user.\";\n } catch (\\Exception $e) {\n $message = $e->getMessage();\n }\n \n $this->msgSession->setMessage($message);\n $this->headerLocation(\"index.php\");\n }", "public function createAction() {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"user\",\n \"action\" => \"index\"\n ));\n }\n\n $user = new BaseUser();\n\n $user->fname = $this->request->getPost(\"fname\");\n $user->lname = $this->request->getPost(\"lname\");\n $user->gender = $this->request->getPost(\"gender\");\n $user->imagelink = $this->request->getPost(\"imagelink\");\n $user->regdate = $this->request->getPost(\"regdate\");\n $user->active = $this->request->getPost(\"active\");\n $user->verified = $this->request->getPost(\"verified\");\n\n\n if (!$user->save()) {\n foreach ($user->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"user\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"user was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"user\",\n \"action\" => \"index\"\n ));\n }", "public function Create () {\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $user = new User(\n $_REQUEST['first_name'],\n $_REQUEST['last_name'],\n $_REQUEST['phone'],\n $_REQUEST['email']\n );\n $user->Create();\n }\n }" ]
[ "0.7594168", "0.7164166", "0.71478796", "0.7130009", "0.7095361", "0.7084597", "0.7076395", "0.70622885", "0.704501", "0.6982233", "0.6973186", "0.6969578", "0.6958704", "0.6950544", "0.694052", "0.69404346", "0.6923981", "0.6916702", "0.69012046", "0.689679", "0.68874705", "0.68837935", "0.68753016", "0.68686324", "0.6843951", "0.68094456", "0.6804956", "0.67567766", "0.6733689", "0.6732275" ]
0.7311681
1
Handles Ajax POST request to permanently delete the user's account. It removes the profile picture of the user, as well as all cars the user suggested. It also logs out the user automatically.
public function deleteAccountAction(Request $request){ /* @var $user User */ $user = $this->get('security.context')->getToken()->getUser(); $fileHelper = $this->get('file_helper'); // Delete the user's profile picture if ($user->getDetails()->getProfilePicturePath() !== 'default.jpg'){ $userProfilePicturePath = $user->getDetails()->getProfilePicturePath(); $imagePath = $this->get('kernel')->getRootDir() . '/../web/bundles/martontopcars/images/avatar/' . $userProfilePicturePath; $fileHelper->removeFile($imagePath); } $suggested_cars = $user->getSuggestedCars(); // Delete all the images the user has uploaded for her suggested cars foreach($suggested_cars as $car){ if (($car->getImage() !== 'default.jpg') and ($car->getImage() !== 'default.png')){ $imagePath = $this->get('kernel')->getRootDir() . '/../web/bundles/martontopcars/images/card_game_suggest/'.$car->getImage(); $fileHelper->removeFile($imagePath); } } // Log the user out $this->get('security.context')->setToken(null); $this->get('request')->getSession()->invalidate(); // Remove the user from the database $em = $this->getDoctrine()->getManager(); $em->remove($user); $em->flush(); return new JsonResponse(array()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteUserAccount()\n {\n if ($this->request->exists('post')) {\n $data = $this->request->getAll();\n if ($data['csrftoken'] && $this->token->validateToken($data['csrftoken'], $data['frm_name'])) {\n if ($this->session->exists(CURRENT_USER_SESSION_NAME) && isset(AuthManager::$currentLoggedInUser)) {\n $user = AuthManager::$currentLoggedInUser;\n $user->id = $user->userID;\n $user->deleted = 1;\n if ($user->save()) {\n if ($user->deleteUserAccount($user)) {\n $this->jsonResponse(['result' => 'success', 'msg' => '']);\n } else {\n $this->jsonResponse(['result' => 'error', 'msg' => FH::showMessage('danger text-center', 'Failed to delete account')]);\n }\n } else {\n $this->jsonResponse(['result' => 'error', 'msg' => FH::showMessage('danger text-center', 'Failed to delete account')]);\n }\n echo json_encode(['ok']);\n } else {\n $this->jsonResponse(['result' => 'error', 'msg' => FH::showMessage('danger text-center', 'Your are not logged in')]);\n }\n }\n }\n }", "public function delete()\n {\n if (array_key_exists('User', $_POST)) {\n $request = new Request();\n return $this->dump($request->setMethod(cUrl::METHOD_DELETE), new JsonResponse($this->makeRequest($request, \"user/delete/{$this->getUserId($_POST['User'])}\")), 'Delete user - response');\n }\n return ($this->show(new Webpage('user/delete', [\n 'form' => [\n 'action' => \"/{$this->getFramework()->getRouter()->getUrl()}\",\n 'data' => [\n 'id' => $this->storage->get(self::SESSION_USER_ID)\n ]\n ]\n ]), 'Delete user'));\n }", "public function delete_user(Request $request, $id){\n if(\\Gate::any(['isSuperAdmin', 'isCompanyCEO'])){\n\n //$json_user = json_encode($user);\n\n if ($request->ajax()){\n //$u_id = $request->input(\"data-uid\"); //take ALL input values into $input, as an assoc.array\n //$u_id = $arr['data-uid'];\n DB::beginTransaction();\n\n try{\n //User needs to be logged out BEFORE he is deleted from the Database.\n //first, make sure user is NOT logged in (or is logged out). Important!\n\n // Logout a specific user (by his/her $id) (found this solution in StackOverflow!)\n\n // 1. get current (currently logged in?) user\n $current_user = Auth::user();\n\n // 2. logout user\n $userToLogout = User::findOrFail($id);\n // \\Session::getHandler()->destroy($userToLogout->session_id); //taken from another answer in the same thread...\n Auth::setUser($userToLogout); //from Laravel API 7.x Docs: \"Set the current user\" Contracts/Auth/Guard/setUser()\n Auth::logout(); //From github/laravel--> seems Auth::logout will just logging out the current user and not the specific one.\n\n $userToLogout->delete();\n\n //after he/she is logged out as above, delete the actual user..!\n // $user = User::findOrFail($id); //was findOrFail($u_id);\n // $user->delete();\n\n // 3. set again current user\n Auth::setUser($current_user);\n\n DB::commit(); //commit the changes\n\n //success, 200 OK.\n return \\Response::json([\n 'success' => true,\n //'errors' => $validator->getMessageBag()->toArray(),\n ], 200);\n\n } catch(\\Exception $e){\n\n DB::rollBack();\n\n //something happened...\n return \\Response::json([\n 'success' => false,\n 'message' => $e->getMessage(),\n //'errors' => $validator->getMessageBag()->toArray(),\n ], 500);\n }\n\n //return \\Response::json();\n }\n\n // return back();\n }\n else\n {\n return abort(403, 'Sorry, you cannot delete users.');\n }\n\n/*\n $authenticatedUser = Auth::user()->user_type(['super_admin', 'company_ceo']);\n\n //$this->authorize('isSuperAdmin', User::class);\n //$user = User::find($id);\n //dd($user);\n\n if ($authenticatedUser){\n\n //$u_id = $request->modal-input-uid-del;\n\n $arr = $request->input();\n $u_id = $arr['data-uid'];\n\n //$user = DB::table('users')->where('id', $uid)->get();\n $user = User::findOrFail($u_id);\n //$user = User::where('id', $id)->first()->get();\n\n $user->delete();\n // $user = User::findOrFail($uid);\n // $user->delete();\n\n //$res = Users::where('id', $u_id)->first()->delete();\n //Session::flash('success', 'Ο χρήστης διαγράφηκε επιτυχώς.');\n\n return response()->json();\n //return back();\n //return view('admin.users.view'); //aka redirect to same page...\n //return redirect('/users_view');\n }\n else\n {\n return abort(403, 'Sorry you cannot view this page');\n }\n */\n }", "public function deletePicture(Request $request, User $user)\n\t{\n\t\tif ($request->ajax()) {\n\t\t\t$profile = $user->getProfile();\n\n\t\t\t$profile->picture = null;\n\n\t\t\t$user->profile()->save($profile);\n\n\t\t\tuserActivity()->log('Removed picture');\n\n\t\t\treturn response(__(\"The operation was successful!\"));\n\t\t} else {\n\t\t\treturn abort(403);\n\t\t}\n\t}", "public function postDeleteAccount()\n {\n $user = Auth::user();\n $user->delete();\n\n // return response()->json([\n // 'success' => true\n // ]);\n return Redirect::route('auth::logout');\n }", "public function deleteAjax(){\n\t\t$id = $this->input->post('id');\n\n\t\t//get deleted user info\n\t\t$userInfo = singleDbTableRow($id);\n\t\t$fullName = user_full_name($userInfo);\n\t\t// add a activity\n\t\tcreate_activity(\"Deleted {$fullName} from Agent\");\n\t\t//Now delete permanently\n\t\t$this->db->where('id', $id)->delete('users');\n\t\treturn true;\n\t}", "public function ajaxDelete(){\n $entity_id = ($this->input->post('entity_id') != '')?$this->input->post('entity_id'):'';\n $this->coupon_model->deleteUser('coupon',$entity_id);\n }", "public function deleteUserAction(): void {\n\n if ( $this->isConnected() ){\n if (isset($_POST['id'])){\n $user = new Users();\n $user->delete([\"id\"=>$_POST['id']]);\n }\n }\n }", "public function delete()\n {\n // Handle ajax request\n if (Request::ajax()) {\n $ids = Input::get('id');\n\n $status = User::destroyUsers($ids);\n\n echo json_encode([\n 'status' => $status\n ]);\n \n }\n }", "static public function ctrDeleteUser(){\n\n\t\tif(isset($_GET[\"userId\"])){\n\n\t\t\t$table =\"users\";\n\t\t\t$data = $_GET[\"userId\"];\n\n\t\t\tif($_GET[\"userPhoto\"] != \"\"){\n\n\t\t\t\tunlink($_GET[\"userPhoto\"]);\t\t\t\t\n\t\t\t\trmdir('views/img/users/'.$_GET[\"username\"]);\n\n\t\t\t}\n\n\t\t\t$answer = UsersModel::mdlDeleteUser($table, $data);\n\n\t\t\tif($answer == \"ok\"){\n\n\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"The user has been succesfully deleted\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Close\"\n\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t \t\n\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\twindow.location = \"users\";\n\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\t\t\n\n\t\t}\n\n\t}", "public function actionDeleteUserPhoto()\n\t{\n\t\t$this->requireAjaxRequest();\n\t\tblx()->userSession->requireLogin();\n\t\t$userId = blx()->request->getRequiredPost('userId');\n\n\t\tif ($userId != blx()->userSession->getUser()->id)\n\t\t{\n\t\t\tblx()->userSession->requirePermission('editUsers');\n\t\t}\n\n\t\t$user = blx()->users->getUserById($userId);\n\t\tblx()->userProfiles->deleteUserPhoto($user);\n\n\t\t$record = UserRecord::model()->findById($user->id);\n\t\t$record->photo = null;\n\t\t$record->save();\n\n\t\t// Since Model still believes it has an image, we make sure that it does not so anymore when it reaches the template.\n\t\t$user->photo = null;\n\t\t$html = blx()->templates->render('users/_edit/_userphoto',\n\t\t\tarray(\n\t\t\t\t'account' => $user\n\t\t\t)\n\t\t);\n\n\t\t$this->returnJson(array('html' => $html));\n\t}", "public function firewallDeleteUser(Request $request) {\n if ($request->ajax()) {\n $user = User::find($request->user_id);\n if ($user == null) {\n return 0;\n } else {\n try{\n FirewallPrivileges::where('user_id', '=', $request->user_id)->delete();\n $data['ID użytkownika'] = $request->user_id;\n $data['Użytkownik'] = $user->first_name.' '.$user->last_name;\n new ActivityRecorder($data,89,3);\n return 1;\n }catch (\\Exception $exception){\n return 0;\n }\n }\n }\n }", "public function deleteUser()\n {\n $user = User::findOrFail($this->userIdBeingRemoved);\n $user->delete();\n $this->dispatchBrowserEvent('hide-delete-modal', ['message' => 'User deleted successfuly!']);\n }", "private function deleteUser(){\n\t\t\tif($this->get_request_method() != \"DELETE\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\t$id = (int)$this->_request['id'];\n\t\t\tif($id > 0){\n\t\t\t\tmysql_query(\"DELETE FROM users WHERE user_id = $id\");\n\t\t\t\t$success = array('status' => \"Success\", \"msg\" => \"Successfully one record deleted.\");\n\t\t\t\t$this->response($this->json($success),200);\n\t\t\t}else\n\t\t\t\t$this->response('',204);\t// If no records \"No Content\" status\n\t\t}", "public function deleteAccount() {\n\n\t\t$login = SessionController::getLogin();\n\t\t$param = array($login);\n\t\t$query = \"SELECT `id` FROM `user` WHERE login = ?\";\n\t\t$id_user = self::request($query, $param)->fetchAll()[0]['id'];\n\t\tunset($param);\n\t\t$param = array($id_user);\n\t\t$query = \"DELETE FROM `infos` WHERE id_user = ?\";\n\t\tself::request($query, $param);\n\t\t$photo = new PhotoModel();\n\t\t$photo->deleteAllImg($id_user);\n\t\tunset($param);\n\t\t$param = array($login);\n\t\t$query = \"DELETE FROM `user` WHERE login = ?\";\n\t\tself::request($query, $param);\n\n }", "function deleteUser()\n\t\t{\n\n\t\t\t\t\t\t\n\t\t\t$userInfo = $this->userInfo();\n\t\t\t\n\t\t\tif (!$userInfo)\n\t\t\t{\n\t\t\t\theader(\"location:index.php\");\n\t\t\t}\n\t\t\telse \n\t\t\t{\t\n\t\t\t\t$therapist_id = (int) $this->value('id');\t\n\t\t\t\t\n\t\t\t\t$queryUpdate = \"UPDATE user SET status = 3 WHERE user_id = \". $therapist_id;\t\t\t\t\t\n\t\t\t\t$this->execute_query($queryUpdate);\t\n\t\t\t\t\n\t\t\t\t$sqlUpdate = \"DELETE FROM therapist_patient WHERE therapist_id = '\".$therapist_id.\"'\";\t\t\t\n\t\t\t\t$result = $this->execute_query($sqlUpdate);\t\t\n\t\t\t\t\n\t\t\t\t/*$strJS = '<script language=\"JavaScript\">\n\t\t\t\t\t\t opener.window.document.location.reload();\n\t\t\t\t\t\t window.close();</script>';*/\n\t\t\t\t$strJS = '<script language=\"JavaScript\">\n\t\t\t\t\t\t opener.window.document.location.href = \"index.php?action=userListing\";\n\t\t\t\t\t\t window.close();</script>';\n\t\t\t\techo $strJS;\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t}\t\t\n\t\t\t\n\t\t}", "public function process_delete_user()\n\t{\n\t\t//Check user is logged or not\n\t $this->is_logged();\n\n\t\t//==== Get Data ====\n\t\t$id_user\t= $this->security->xss_clean(strip_image_tags($this->input->post('f-hidden-id-user'))); \n\t\t\n\t\tif($id_user != '') {\n\t\t\t//==== Delete Data ====\n\t\t\t$this->employee_model->delete_user($id_user);\n \n\t\t\t//Set session flashdata\n\t\t\t$this->session->set_flashdata('message_success', 'Data telah berhasil dihapus.');\n\t\t} \n\t\telse\n\t\t{\n\t\t\t//Set session flashdata\n\t\t\t$this->session->set_flashdata('message_error', 'Terjadi kesalahan, mohon ulangi kembali.');\n\t\t}\n\t\t\n\t\tredirect('daftar-pegawai');\n\t}", "function DeleteUser() {\n\t\tif (!empty($_GET['email']) && !empty($_GET['password'])) {\n\t\t\tif (Authenticate($_GET['email'], $_GET['password'])) {\n\n\t\t\t\tif (!empty($_GET['deleteMe']) && $_GET['deleteMe'] == true) {\n\t\t\t\t\t$conn = GetConnection();\n\t\t\t\t\t// update the users username\n\t\t\t\t\t$stmt = \"DELETE FROM users WHERE email='$_GET[email]'\";\n\t\t\t\t\t$result = $conn->query($stmt) or die('Query failed: ' . mysqli_error($conn));\n\n\t\t\t\t\t//close the connection to the database\n\t\t\t\t\tmysqli_close($conn);\n\t\t\t\t\techo json_encode('User deleted');\n\t\t\t\t} else echo json_encode('Use the deleteMe=true param to delete this user');\n\t\t\t} \n\t\t} else echo json_encode('No username/password param(s) provided, use ?email=x&password=x in url');\n\n\t}", "public function deleteuser(){\r\n\t\tif($this->request->is('post')) {\r\n\t\t\t$id = $this->request->data['User']['id'];\r\n\r\n\t\t\tif($this->User->delete($id)) {\r\n\t\t\t\techo 'Utilisateur supprimée avec succes';\r\n\t\t\t\treturn $this->redirect('/admin');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo 'ko';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function actionDelete(){\n isAdminAjaxRequest();\n issetPostParam('uid');\n $uid = (int)$_POST['uid'];\n $this->_model->query(parse_tbprefix(\"DELETE FROM <sysuser> WHERE uid=$uid\"));\n $this->_model->query(parse_tbprefix(\"UPDATE <post> SET uid=0 WHERE uid=$uid\"));\n exitWithResponse(200, $this->_getAllUsers());\n }", "public function destroy(Request $request)\n {\n $user = User::findOrFail($request->user_id);\n //get the user profile to be removed from the server\n if($user->profile_picture != NULL){\n $this->user_profile_picture_to_delete = $user->profile_picture;\n }\n $delete = $user->delete();\n if($delete){\n \\File::delete(public_path().'/img/user/'.$this->user_profile_picture_to_delete);\n \\File::delete(public_path().'/img/user/thumb_'.$this->user_profile_picture_to_delete);\n return redirect('user')\n ->with('successMessage', \"$user->name has been removed\");\n }\n else{\n return \"Something wrong when removing member\";\n }\n }", "public function destroy()\n {\n $user = auth()->user();\n $user = User::find($user->id);\n $user->forceDelete();\n //redirect()->route('register');\n return response()->json(['code' => '200', 'stats' => 'Your account has been deleted!']);\n }", "public function actionDelete()\n {\n if(Yii::app()->request->isPostRequest)\n {\n // we only allow deletion via POST request\n if($_GET['id']!=1)\n {\n @unlink(Yii::app()->params['avatarPath'].User::model()->findbyPk($_GET['id'])->avatar);\n $this->loadUser()->delete();\n }\n $this->redirect(array('list'));\n }\n else\n throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n }", "public function delete() {\n\t\t$this->set('pageTitle', __('Delete your account'));\n\t\t$this->set('subTitle', __('careful now...'));\n\t\t// Check whether the user account is SourceKettle-managed (if not it's an LDAP\n\t\t// account or similar, so we can't really delete it properly)\n\t\t// TODO this is totally wrong and broken!\n\t\t$this->User->id = $this->Auth->user('id');\n\t\t$this->request->data = $this->User->read();\n\t\t$this->set('external_account', false);\n\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->id = $this->Auth->user('id');\n\n\t\t\t//Now delete the user\n\t\t\tif ($this->User->delete($this->Auth->id)) {\n\t\t\t\t$this->Session->setFlash(__('Account deleted'), 'default', array(), 'success');\n\t\t\t\t$this->log(\"[UsersController.delete] user[\" . $this->Auth->user('id') . \"] deleted\", 'sourcekettle');\n\n\t\t\t\t//Now log them out of the system\n\t\t\t\t$this->Auth->logout();\n\t\t\t\treturn $this->redirect('/');\n\t\t\t}\n\t\t\t// TODO check what projects made this fail\n\t\t\t$this->Session->setFlash(__('Account was not deleted'), 'default', array(), 'error');\n\t\t\treturn $this->redirect(array('action' => 'delete'));\n\t\t} else {\n\t\t\t$user = $this->Auth->user();\n\t\t\t$this->User->id = $user['id'];\n\t\t\t$this->request->data = $this->User->read();\n\t\t\t$this->request->data['User']['password'] = null;\n\t\t}\n\t}", "public function delete_user()\r\n\t\t{\r\n\t\t\t\r\n\t\t\t// TODO: need to take into account the showcase files and data for the user being deleted\r\n\t\t\t$this->removeProfileImage();\r\n\t\t\t\r\n\t\t\t$showcasefiles = glob( $this->upload_path . $this->get_last_insert() . DS . '*' );\r\n\t\t\tif ( ! empty( $showcasefiles ) )\r\n\t\t\t{\r\n\t\t\t\tforeach ( $showcasefiles as $file )\r\n\t\t\t\t{\r\n\t\t\t\t\tunlink( $file );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( is_dir( $this->upload_path . $this->get_last_insert() . DS . $this->upload_directory ) )\r\n\t\t\t{\r\n\t\t\t\trmdir( $this->upload_path . $this->get_last_insert() . DS . $this->upload_directory );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$showcases = Showcase::find_by_user_id( $this->id );\r\n\t\t\t\r\n\t\t\tif ( $showcases )\r\n\t\t\t{\r\n\t\t\t\tforeach ( $showcases as $showcase )\r\n\t\t\t\t{\r\n\t\t\t\t\tComment::deleteAllByCond( [ 'show_id' => $showcase->id ] );\r\n\t\t\t\t\tShowcasePins::deleteAllByCond( [ 'show_id' => $showcase->show_id ] );\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$files = glob( $this->upload_path . $this->get_last_insert() . DS . $showcase->upload_directory . DS . $showcase->id . DS . '*' );\r\n\t\t\t\t\tif ( ! empty( $files ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tforeach ( $files as $file )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tunlink( $file );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$showcaseDirs = glob( $this->upload_path . $this->get_last_insert() . DS . $showcase->upload_directory . DS . '*' );\r\n\t\t\t\t\tif ( ! empty( $showcaseDirs ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tforeach ( $showcaseDirs as $dir )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif ( is_dir( $dir ) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\trmdir( $dir );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( is_dir( $this->upload_path . $this->get_last_insert() . DS . $showcase->upload_directory ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\trmdir( $this->upload_path . $this->get_last_insert() . DS . $showcase->upload_directory );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif ( is_dir( $this->upload_path . $this->get_last_insert() . DS ) )\r\n\t\t\t{\r\n\t\t\t\trmdir( $this->upload_path . $this->get_last_insert() . DS );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$contacts = new Contact();\r\n\t\t\tif ( ! $contacts->deleteAllOfUser( $this->id ) )\r\n\t\t\t{\r\n\t\t\t\t$this->errors[] = \"Could not delete contacts for this user\";\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$showcase = new Showcase();\r\n\t\t\tif ( ! $showcase->deleteAllOfUser( $this->id ) )\r\n\t\t\t{\r\n\t\t\t\t$this->errors[] = \"Could not delete showcase for this user\";\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( $this->delete() )\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t\t}", "public function postDelete()\n {\n $input = $this->input->post(array_keys($this->user->forms('delete')));\n $user = $this->user->find($input[$this->user->primaryKey]);\n if(is_object($user))\n {\n $user->delete();\n set_message('row_has_been_deleted', 'success');\n }\n else\n {\n set_message('row_is_not_found', 'error');\n }\n redirect('/Admin/User/list');\n }", "function removeUser()\n\t\t{\n\n\t\t\t\t\t\t\n\t\t\t$userInfo = $this->userInfo();\n\t\t\t\n\t\t\tif (!$userInfo)\n\t\t\t{\n\t\t\t\theader(\"location:index.php\");\n\t\t\t}\n\t\t\telse \n\t\t\t{\t\n\t\t\t\t$therapist_id = (int) $this->value('id');\t\n\t\t\t\t\n\t\t\t\t$queryUpdate = \"UPDATE user SET status = 3 WHERE user_id = \". $therapist_id;\t\t\t\t\t\n\t\t\t\t$this->execute_query($queryUpdate);\t\t\n\n\t\t\t\t$sqlUpdate = \"DELETE FROM therapist_patient WHERE therapist_id = '\".$therapist_id.\"'\";\t\t\t\n\t\t\t\t$result = $this->execute_query($sqlUpdate);\t\t\t\t\n\t\t\t\t\n\t\t\t\theader(\"location:index.php?action=userListing\");\n\t\t\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t}", "function delete_user_car($db, $user, $car){\n $sql = \"DELETE FROM cars WHERE carid = '$car' AND userid = '$user';\";\n mysqli_query($db, $sql);\n Header(\"location: garage.php\");\n }", "public function deleteUser() {\n\t\t\n\t\t\t$id = $_SESSION[\"id\"];\n\t\t\n\t\t\t# calls model to delete user record\t\n\t\t\t$this->model->deleteUser($id);\n\t\t\t\n\t\t\t# unsets \"logged-in\" indicator from session array\n\t\t\tunset($_SESSION[\"id\"]);\n\t\t\t\n\t\t\t# calls signout method to redirect to home page\n\t\t\t$this->signout();\n\t\t\n\t\t}", "function delete_orphan_users_ajax()\n{\n\tglobal $wpdb; // this is how you get access to the database\n\n\t$user_id = intval($_POST['user_id']);\n\t$user_info = get_userdata($user_id);\n\t$username = $user_info->user_login;\n\t$email = $user_info->user_email;\n\t$user = get_user_by('login', 'deleted');\n\twpmu_delete_user($user_id, $user->ID); // delete user\n\techo $username . \" - \" . $email . \"<br>\";\n\n\twp_die(); // this is required to terminate immediately and return a proper response\n}" ]
[ "0.7484929", "0.6949166", "0.6701123", "0.66796654", "0.66497594", "0.66440153", "0.6627643", "0.65903383", "0.65772676", "0.65492505", "0.652751", "0.65261453", "0.6490818", "0.6490624", "0.645104", "0.6444955", "0.644109", "0.64237833", "0.6423173", "0.6405535", "0.63707757", "0.6360851", "0.6357815", "0.63549757", "0.6323549", "0.6322928", "0.6283668", "0.6263858", "0.62624925", "0.62552553" ]
0.74549556
1
Renders the Account page by creating a form and passing that to the template. All existing fields of the user's details get automatically attached with the form.
public function accountAction(){ /* @var $user User */ $user= $this->get('security.context')->getToken()->getUser(); /* @var $userDetails UserDetails */ $userDetails = $user->getDetails(); // Create Form for editing user details $editForm = $this->createForm(new UserDetailsType(), $userDetails, array( 'action' => $this->generateUrl('marton_topcars_account_update'), )); return $this->render('MartonTopCarsBundle:Default:Pages/account.html.twig', array( 'details_form' => $editForm->createView(), 'user' => $user, 'user_details' => $userDetails )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create_form() {\n\n\t\treturn $this->render('user-create-form.php', array(\n\t\t\t'page_title' => 'Create Account',\n\t\t));\n\t}", "public function getAccountInfoForm()\n {\n $this->data['title'] = trans('stlc.my_account');\n $this->data['user'] = \\Module::user();\n if(\\Module::user() != null) {\n $module = \\Module::where('model',get_class(\\Module::user()))->first();\n if(isset($module->id)) {\n $this->data['crud'] = \\Module::make($module->name);\n $this->data['crud']->fields = collect($this->data['crud']->fields)->where('name',\"!=\",'password');\n if(isset(\\Module::user()->id) && isset(\\Module::user()->id)) {\n $this->data['crud']->row = \\Module::user();\n }\n }\n }\n \n return view(config('stlc.view_path.auth.account.update_info','stlc::auth.account.update_info'), $this->data);\n }", "public function actionCreateAccount()\n {\n $form = new CreateAccountForm();\n\n if($form->load($_POST) && $form->validate()) {\n $this->createAccount($form);\n }\n return $this->render('create-account', [\n 'model'=>$form,\n ]);\n }", "public function create() {\n\t\treturn View::make('accounts.create', array(\t\n\t\t\t'title' => 'Create account',\n\t\t));\n\t}", "public function create()\n { \n $user=$this->currentuser();\n $accounts =$this->useraccounts() ;\n return view('accounts.accountcreate', compact(['user','accounts']));\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->text('account', __('Account'));\n $form->password('pwd', __('Pwd'));\n $form->text('real_name', __('Real name'));\n $form->number('birthday', __('Birthday'));\n $form->text('card_id', __('Card id'));\n $form->text('mark', __('Mark'));\n $form->number('partner_id', __('Partner id'));\n $form->number('group_id', __('Group id'));\n $form->text('nickname', __('Nickname'));\n $form->image('avatar', __('Avatar'));\n $form->mobile('phone', __('Phone'));\n $form->number('add_time', __('Add time'));\n $form->text('add_ip', __('Add ip'));\n $form->number('last_time', __('Last time'));\n $form->text('last_ip', __('Last ip'));\n $form->decimal('now_money', __('Now money'))->default(0.00);\n $form->decimal('brokerage_price', __('Brokerage price'))->default(0.00);\n $form->number('integral', __('Integral'));\n $form->decimal('exp', __('Exp'))->default(0.00);\n $form->number('sign_num', __('Sign num'));\n $form->switch('status', __('Status'))->default(1);\n $form->number('level', __('Level'));\n $form->switch('spread_open', __('Spread open'))->default(1);\n $form->number('spread_uid', __('Spread uid'));\n $form->number('spread_time', __('Spread time'));\n $form->text('user_type', __('User type'));\n $form->switch('is_promoter', __('Is promoter'));\n $form->number('pay_count', __('Pay count'));\n $form->number('spread_count', __('Spread count'));\n $form->number('clean_time', __('Clean time'));\n $form->text('addres', __('Addres'));\n $form->number('adminid', __('Adminid'));\n $form->text('login_type', __('Login type'));\n $form->text('record_phone', __('Record phone'));\n $form->switch('is_money_level', __('Is money level'));\n $form->switch('is_ever_level', __('Is ever level'));\n $form->number('overdue_time', __('Overdue time'));\n $form->text('uniqid', __('Uniqid'));\n $form->number('post_count', __('Post count'));\n $form->number('comment_count', __('Comment count'));\n $form->number('like_total', __('Like total'));\n $form->number('follow_count', __('Follow count'));\n $form->number('fans_count', __('Fans count'));\n $form->text('bbs_roles', __('Bbs roles'));\n\n return $form;\n }", "public function create()\n\t{\n\t\treturn view('account.create');\n\t}", "public function create() {\n\t\t$this->initForm();\n\t\t$this->getStandardValues();\n\t\t$this->tpl->setContent($this->form->getHTML());\n\t}", "public function create()\n {\n $payments = $this->paymentRepository->getPaymentAll();\n return view('shop.admin.useraccount.accountAdd', compact('payments'));\n }", "public function create()\n {\n return $this->view('account.register.form');\n }", "public function actionAccount(){\n\t\t\t// @todo Replace url to Dashboard url\n\t\t\tif(!Yii::app()->user->isGuest){\n\t\t\t\t$this->redirect('/home');\n\t\t\t}\n\n\t\t\t// Create a new Front Login Form model.\n\t\t\t$loginModel=new FrontLoginForm;\n\t\t\t$this->performAjaxValidation($loginModel);\n\n\t\t\t// if it is ajax validation request\n\t\t\tif(isset($_POST['ajax'])) {\n\t\t\t\t//\tvar_dump($_POST['ajax']);die();\n\t\t\t}\n\n\t\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='front-login-form')\n\t\t\t{\n\t\t\t\techo CActiveForm::validate($loginModel);\n\t\t\t\tYii::app()->end();\n\t\t\t}\n\n\t\t\t// collect user input data\n\t\t\tif(isset($_POST['FrontLoginForm']))\n\t\t\t{\n\t\t\t\t$loginModel->attributes=$_POST['FrontLoginForm'];\n\t\t\t\t// validate user input and redirect to the previous page if valid\n\t\t\t\tif($loginModel->validate() && $loginModel->login())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * This means the user has either come here for the first time or is trying to create\n\t\t\t * a new account.\n\t\t\t */\n\t\t\t$credentialsModel = UserApi::populateCredentialsModel(null,'register');\n\t\t\t$profilesModel = UserApi::populateProfilesModel(null,'register');\n\t\t\trequire_once(Yii::app()->params[\"rootDir\"].'/library/facebook/src/facebook.php');\n\t\t\t$facebook = new Facebook(array(\n\t\t 'appId' => Yii::app()->params[\"fbAppId\"],\n\t\t 'secret' => Yii::app()->params[\"fbSecret\"],\n\t\t\t));\n\n\t\t\t$this->performAjaxValidation($profilesModel);\n\n\t\t\t/*\n\t\t\t * Check if the user has reached this page through a widget.\n\t\t\t */\n\t\t\tif(isset($_POST['UserCredentials']) && !isset($_POST['UserProfiles'])) {\n\t\t\t\t$credentialsModel = UserApi::populateCredentialsModel($_POST['UserCredentials'],'register');\n\t\t\t\t$credentialsModel->validate(array('email_id','password','password_confirm'));\n\t\t\t\t$profilesModel = UserApi::populateProfilesModel(null,'register');\n\t\t\t\t//\t$this->render('account',array('credentialsModel'=>$credentialsModel,'profilesModel'=>$profilesModel,'login'=>$loginModel));\n\n\t\t\t} else if(isset($_POST['UserCredentials']) && isset($_POST['UserProfiles'])){\n\t\t\t\t// save here\n\t\t\t\t$credentialsModel = UserApi::populateCredentialsModel($_POST['UserCredentials'],'register');\n\t\t\t\t$credResult = $credentialsModel->validate(array('email_id','password','password_confirm'));\n\n\t\t\t\t$profilesModel = UserApi::populateProfilesModel($_POST['UserProfiles'],'register');\n\t\t\t\t$profResult = $profilesModel->validate(array(\n\t\t\t\t'first_name','last_name','gender',\n\t\t\t\t'address_line1','address_line2',\n\t\t\t\t'country_id','state_id','city_id',\n\t\t\t\t'zip','phone','alt_phone','agree'\n\t\t\t\t));\n\n\t\t\t\tif($credResult && $profResult){\n\t\t\t\t\t$result = true;\n\t\t\t\t\t$models = UserApi::createUser($credentialsModel,$profilesModel);\n\n\t\t\t\t\t// Redirect to thanks page.\n\t\t\t\t\t// @todo link to success page.\n\t\t\t\t\tif($models){\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\t$data[\"user\"] = $models['credential']->id;\n\t\t\t\t\t\tEmailApi::sendEmail($credentialsModel->email_id,\"REGISTRATION.ACTIVATION\",$data);\n\t\t\t\t\t\t$session=new CHttpSession;\n\t\t\t\t\t\t$session->open();\n\t\t\t\t\t\t$session['registration-success']='true';\n\t\t\t\t\t\t$this->redirect(array('/account/thanks','email'=>$models['credential']->email_id));\n\t\t\t\t\t}\n\t\t\t\t\t//\telse\n\t\t\t\t\t//\t\t$this->render('account',array('credentialsModel'=>$credentialsModel,'profilesModel'=>$profilesModel,'login'=>$loginModel));\n\t\t\t\t\t// save())\n\n\t\t\t\t}\n\t\t\t}// else\n\t\t\t$this->render('account',array('credentialsModel'=>$credentialsModel,'profilesModel'=>$profilesModel,'login'=>$loginModel));\n\t\t}", "public function insertUser()\n {\n $template = 'insertUserForm.html.twig';\n $argsArray = [\n 'pageTitle' => 'Create user Form',\n 'username' => $this->usernameFromSession()\n ];\n $html = $this->twig->render($template, $argsArray);\n print $html;\n }", "public function userAction()\n {\n $template = 'userForm.html.twig';\n $argsArray = [\n 'pageTitle' => 'User',\n 'username' => $this->usernameFromSession()\n ];\n $html = $this->twig->render($template, $argsArray);\n print $html;\n }", "public function create()\n {\n return view('admin.account.create');\n }", "public function newAction()\n {\n $entity = new Accounts();\n $form = $this->createForm(new AccountsType(), $entity);\n\n return $this->render('PrayerlabsMyprofileBundle:Accounts:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $account = new Account();\n\n return view('accounts.create', compact(['account']));\n }", "public function create()\n {\n return view('account.create');\n }", "public function create()\n {\n return view('account.create');\n }", "public function create()\n {\n $bankAccounts = Auth::user()->bankAccounts()->get();\n return view('recurring_payment.form', ['mode' => 'create', 'bankAccounts' => $bankAccounts]);\n }", "public function createProfile(){\n return $this->view('account.create-profile');\n }", "public function create() {\n\t\t$this->view->pagetitle = 'Register with Operation Braveheart';\n\t\t// get an array of additional stylesheets\n\t\t$this->view->style = 'register';\n\t\t// get an array of additional JavaScripts\n\t\t$this->view->scripts = $this->model->setScripts(array('jquery.passwordStrength', 'jquery.username-check', 'jquery.register-form-validate'));\n\t\t// set the content heading\n\t\t$this->view->heading = 'Account Registration';\n\t\t// set the large content image\n\t\t$this->view->largeimg = 'register.jpg';\n\t\t$this->view->alt = 'Register with Operation Braveheart';\n\t\t\n\t\t// display the breadcrumbs\n\t\t$nav_array = array(array(\"url\" => URL, \"name\" => \"Home\"),\n\t\t\t\t\t\t array(\"url\" => URL . \"register\", \"name\" => \"Register\")\n\t\t);\n\n\t\t$this->view->crumbs = $this->model->breadcrumbs($nav_array);\n\t\t\n\t\t// get all the post data from the registration form\n\t\t$data['first_name'] = $_POST['first_name'];\n\t\t$data['last_name'] = $_POST['last_name'];\n\t\t$data['email'] = $_POST['email'];\n\t\t$data['interests'] = $_POST['interests'];\n\t\t$data['username'] = $_POST['username'];\n\t\t$data['password'] = $_POST['passwordInput'];\n\t\t$data['newsletter'] = (isset($_POST['newsletter'])) ? $_POST['newsletter'] : 'No';\n\t\t$data['termscheck'] = (isset($_POST['termscheck'])) ? $_POST['termscheck'] : 'No';\n\t\t\n\t\t// A array to store errors\n\t\t$errors = array();\n\t\t// Collection of validators\n\t\t$validators = array();\n\n\t\t$validators[]=new ValidateName($data['first_name'],'Forename');\n\t\t$validators[]=new ValidateName($data['last_name'],'Surname');\n\t\t$validators[]=new ValidateEmails(array($data['email'], $_POST['confemail']));\n\t\t$validators[]=new ValidateUsername($data['username']);\n\t\t$validators[]=new ValidatePasswords(array($data['password'], $_POST['confirmPasswordInput']));\n\t\t$validators[]=new ValidateTerms($data['termscheck']);\n\t\t$validators[]=new ValidateCaptcha($_POST['captchaimg']);\n\n\t\t// Iterate over the validators, validating as we go\n\t\tforeach($validators as $validator) {\n\t\t\tif (!$validator->isValid()) {\n\t\t\t\twhile ( $error = $validator->fetch() ) {\n\t\t\t\t\t $errors[]=$error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t* If there are no errors on the form, call the function to register a new account using the varaibles from the form.\n\t\t* If the new user details are successfully saved in the database, give the user a confirmation message\n\t\t* otherwise display an error for the user.\n\t\t*/\n\t\tif(empty($errors)) {\n\t\t\n\t\t\tswitch($this->model->create($data)) {\n\t\t\t\tcase 1:\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->view->success = 'Account created successfully';\n\t\t\t\t\t$this->view->message = '<p class=\"thanks\">Thank you '.$_POST['first_name'].'! You have successfully registered.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>You will soon be receiving an email with your username and password and details on how to activate your account.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>Once you have activated your account, you will be able to login and post in the forums.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>Thank you for registering and supporting us.</p>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$this->view->success = 'Account created successfully but failed to sign up for newsletter';\n\t\t\t\t\t$this->view->message = '<p class=\"thanks\">Thank you '.$_POST['first_name'].'! You have successfully registered.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>You will soon be receiving an email with your username and password and details on how to activate your account.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>Once you have activated your account, you will be able to login and post in the forums.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>If you would still like to sign up for our newsletter, please use the newsletter signup form.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>Thank you for registering and supporting us.</p>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$this->view->success = 'Account creation failed';\n\t\t\t\t\t$this->view->message = '<p>Please contact the webmaster via the <a href=\"'.URL.'contact\">contact form</a>.<p>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$this->view->success = 'Account created successfully but failed to send email confirmation';\n\t\t\t\t\t$this->view->message = '<p class=\"thanks\">Thank you '.$_POST['first_name'].'! You have successfully registered.<p>\n\t\t\t\t\t\t\t\t\t\t\t<p>We regret that your email confirmation could not be sent.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>Please contact the webmaster via the <a href=\"'.URL.'contact\">contact form<a/> so we can send you your email confirmation.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>Thank you for registering and supporting us.</p>';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t}\n\t\t\t\n\t\t\t//render the html\n\t\t\t$this->view->render('header');\n\t\t\t$this->view->render('register/result');\n\t\t\t$this->view->render('footer');\n\t\t}\n\t\telse {\n\t\t\t// set the errors from failed validation\n\t\t\t$this->view->errors = $errors;\n\t\t\t// set the form data so user doesn't have to re-enter\n\t\t\t$this->view->data = $data;\n\t\t\n\t\t\t//render the html\n\t\t\t$this->view->render('header');\n\t\t\t$this->view->render('register/errors');\n\t\t\t$this->view->render('footer');\n\t\t}\n\t}", "public function actionCreate() {\n $model = new RegisterForm;\n\n // Uncomment the following line if AJAX validation is needed\n $this->performAjaxValidation($model, 'acc-form');\n\n if (isset($_POST['RegisterForm'])) {\n $model->attributes = $_POST['RegisterForm'];\n if ($model->validate()) {\n $user = new Account();\n $user->username = $model->username;\n $user->email = $model->email;\n $user->password = $model->password;\n\n $user->secret_question = $model->secret_question;\n $user->answer_secret_question = trim($model->answer_secret_question);\n\n $user->type = Account::TYPE_REGULAR;\n\n if ($user->save()) {\n $user->sendActivateEmail();\n Yii::app()->user->setFlash('success', Yii::t(Common::generateMessageCategory(__FILE__,__CLASS__), 'Thank you! Your account has been created.'));\n }\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "function create() {\n\t\t\t$ide = new IDE;\n\t\t\tif($ide->isLogged()) $ide->redirect('../account');\n\t\t\t$this->load->helper('form');\n\t\t\tif($_POST) {\n\t\t\t\t$this->load->library('form_validation');\n\t\t\t\t$this->form_validation->set_rules('name', 'Account Name', 'required|min_length[4]|max_length[32]|callback__account_exists|alpha');\n\t\t\t\t$this->form_validation->set_rules('password', 'Password', 'required|matches[repeat]|min_length[4]|max_length[255]');\n\t\t\t\t$this->form_validation->set_rules('email', 'Email', 'required|valid_email');\n\t\t\t\tif($this->form_validation->run() == TRUE) {\n\t\t\t\t\trequire(APPPATH.'config/ide_default.php');\n\t\t\t\t\t$ots = POT::getInstance();\n\t\t\t\t\t$ots->connect(POT::DB_MYSQL, connection());\n\t\t\t\t\t$account = new OTS_Account();\n\t\t\t\t\t$name = $account->createNamed($_POST['name']);\n\t\t\t\t\t$account->setPassword($_POST['password']);\n\t\t\t\t\t$account->setEmail($_POST['email']);\n\t\t\t\t\t$account->setCustomField('premdays', PREMDAYS);\n\t\t\t\t\ttry {\n\t\t\t\t\t\t$account->save();\n\t\t\t\t\t\t$_SESSION['logged'] = 1;\n\t\t\t\t\t\t$_SESSION['name'] = $_POST['name'];\n\t\t\t\t\t\t$ide->redirect('../account');\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {\n\t\t\t\t\t\terror($e->getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#Load view of creating account\n\t\t\t$this->load->view('create');\n\t\t}", "public function activationForm() {\n print $this->render(activationForm);\n }", "public function accounts()\n\t{\n\t\t$this->template->active_section = 'accounts';\n\t\t$section = 'accounts';\n\t\t$data['accounts'] = $this->presets_m->get_accounts();\n\t\t$this->template->build('admin/accounts', $data);\n\t}", "public function createAction(): object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateUser($this->di);\n $form->check();\n\n $page->add(\"anax/v2/article/default\", [\n \"content\" => $form->getHTML(),\n ]);\n\n $page->add(\"start/flash\", [], \"flash\");\n\n return $page->render([\n \"title\" => \"Ny användare\",\n ]);\n }", "public function create()\n {\n if((auth()->user()->hasPermissionTo('user_add', 'admin') != true) || (auth()->user()->type ?? '') != 'super_admin')\n return $this->permission_denied('users');\n\n return view('dashboard.users.user.form')\n ->with([\n 'page_title' => $this->page_title,\n 'entity' => $this->entity,\n 'entity_action' => $this->entity_action,\n ]);\n }", "public function create()\n {\n $title = $this->title;\n $roles = Role::all();\n\n return view('admin.account.user_account.create', compact('title', 'roles'));\n }", "function signup()\n\t{\n\t\t$this->template->view('signup_form');\n\n\t}", "public function create()\n\t{\n\t\t$data = $this->getFormData();\n\n $this->setupAdminLayout('Create Scorecard Template')->content = View::make('admin.templates.create', $data);\n\t}" ]
[ "0.767625", "0.67363375", "0.6704808", "0.65510523", "0.6464315", "0.63655275", "0.6356426", "0.633546", "0.6320246", "0.63105315", "0.6306189", "0.6288124", "0.626444", "0.62611306", "0.6260749", "0.62420523", "0.6239669", "0.6204395", "0.6195049", "0.6177473", "0.61640996", "0.61432546", "0.61352247", "0.61274266", "0.6112252", "0.6110275", "0.609995", "0.60903156", "0.608708", "0.6084364" ]
0.7216643
1
Get the name of the rule
public function getRuleName(): ?string { return $this->get(self::RULE_NAME, NULL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRuleName(): string\n {\n return $this->ruleName;\n }", "public function getRule($ruleName);", "public function getRule($name);", "public function getRuleName($ruleId, $type)\n {\n if ($type === '0') {\n return Mage::getModel('salesrule/rule')->load($ruleId)->getName();\n } else {\n return Mage::getModel('catalogrule/rule')->load($ruleId)->getName();\n }\n }", "protected function getMethodName($rule)\n {\n return 'check' . ucfirst($rule);\n }", "public function getRuleClassName()\n\t{\n\t\tif ($this->ruleName) {\n\t\t\t$rule = Yii::$app->authManager->getRule($this->ruleName);\n\t\t\treturn get_class($rule);\n\t\t}\n\t\treturn null;\n\t}", "public function getAttributeName()\n {\n return 'RuleTextResponseRule';\n }", "public function getRule(): ?string { return $this->get(self::RULE, NULL); }", "public function getRule()\n {\n return $this->rule;\n }", "public function getRule() {\n return $this->rule;\n }", "public function getRule() {\n return $this->rule;\n }", "public function getRule()\n {\n return $this->rule;\n }", "function forms_get_validation_rule(string $rule_name) {\n\treturn elgg_extract($rule_name, forms_get_validation_rules(), false);\n}", "public function getRuleIdentifierHint(string $rule, Context $context): string;", "public function getName()\n {\n return 'elcodi_core_form_types_referral_rule';\n }", "static function getTypeName($nb = 1) {\r\n $asset = self::getItem();\r\n return ($asset == '') \r\n ? 'PluginRulesRule'\r\n : _n('Rule for ', 'Rules for ', $nb, 'rules') . $asset::getTypeName() ;\r\n }", "public function getRuleId()\n {\n return $this->ruleId;\n }", "public function getRouteName();", "public function getRouteName();", "public function getRouteName();", "protected function _get_jquery_rule_name($name)\n\t{\n\t\treturn Arr::get(self::$_rule_map, $name, $name);\n\t}", "protected function getRulesFor($name)\n\t{\n\t\treturn $this->hasRulesFor($name) ? $this->rules[$name] : '';\n\t}", "public function getPluralRule()\n {\n return $this->rule;\n }", "public function getName()\n {\n return $this->action['as'] ?? null;\n }", "public function getName()\n {\n return self::$directions[$this->direction];\n }", "protected function getSanitizeMethodName($rule)\n {\n return 'sanitize' . ucfirst($rule);\n }", "public function getRouteName()\n {\n return $this->routeName;\n }", "public function getCheckName(): string\n {\n return $this->name;\n }", "public function getRouteName()\n\t{\n\t\treturn $this->routeName;\n\t}", "public function getRouteName(): string;" ]
[ "0.87950385", "0.7310383", "0.72932863", "0.7115844", "0.6912512", "0.68978924", "0.6865681", "0.68536055", "0.67898804", "0.6743219", "0.6743219", "0.6700544", "0.6481588", "0.6463077", "0.6445084", "0.64210254", "0.6418845", "0.63744706", "0.63744706", "0.63744706", "0.6305388", "0.63037235", "0.62609833", "0.6213706", "0.62086517", "0.6194596", "0.61130923", "0.61008304", "0.60729253", "0.6066601" ]
0.81069875
1
action shortcodes in title is shortcode exists
public function the_title_filter( $title, $id = null ) { if (has_shortcode( $title, 'lh_personalised_content' )){ $title = do_shortcode($title); } return $title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function yiw_sc_sample_func($atts, $content = null)\n{\n extract(shortcode_atts(array(\n 'class' => 'call-to-action',\n 'title' => null,\n 'incipit' => null,\n 'phone' => null\n ), $atts));\n\n $html = ''; // this is the var to use for the html output of shortcode\n\n return apply_filters( 'yiw_sc_sample_html', $html ); // this must be written for each shortcode\n}", "function hs_create_shortcode($atts) {\n\t\tglobal $myhubspotwp;\n extract( shortcode_atts( array(\n 'id' => null,\n ), $atts ) );\n\t\t$hs_content = do_shortcode($this->hs_display_action('', '', '', '', true, $id));\n \n\t\treturn $hs_content;\n\t}", "function toggle_sc_func($atts, $content = '') {\n $defaultAtts= array(\n 'title' => 'Your toggle title here...'\n );\n \n extract( shortcode_atts( $defaultAtts, $atts ) );\n $currrentShortCode = '<span class=\"tfb-sc-toggle\"><span class=\"tfb-toggle-title\"><span class=\"icon-plus\"></span>&nbsp;' . $atts['title'] . '</span><span class=\"tfb-toggle-content\">' . do_shortcode($content) . '</span></span>';\n \n return $currrentShortCode;\n}", "function bbp_has_shortcode($text = '')\n{\n}", "abstract protected function shortcodeName();", "function initShortCode()\n {\n }", "function accordion_toggle_func( $atts, $content = null ) {\n extract(shortcode_atts(array(\n\t 'title' => '',\n ), $atts));\n global $single_accordion_toggle_array;\n $single_accordion_toggle_array[] = array('title' => $title, 'content' => trim(do_shortcode($content)));\n return $single_accordion_toggle_array;\n}", "function bf_shortcode_show_title( $atts = array() ) {\n\n\t\tif ( isset( $atts['show_title'] ) && $atts['show_title'] == false ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( $atts['hide_title'] ) && $atts['hide_title'] == true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $atts['title'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( bf_get_current_sidebar() && bf_get_current_sidebar() !== 'bs-vc-sidebar-column' ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$result = apply_filters( 'better-framework/shortcodes/title', $atts );\n\n\t\tif ( is_string( $result ) ) {\n\t\t\techo $result; // escaped before\n\t\t}\n\n\t}", "function shortcode() {\r\n\r\n\t\treturn $this->buttons_html();\t\r\n\r\n\t}", "function wporg_shortcode($atts = [], $content = null)\n{\n \n //$content = 'testadd';\n return $content;\n}", "function test_shortcode_added() {\n\t\t$this->assertTrue( shortcode_exists( 'espn' ) );\n\t}", "function sh_has_shortcode( $shortcode = '' ) {\n\tglobal $wp_query;\n\tforeach( $wp_query->posts as $post ) {\n\t\tif ( ! empty( $shortcode ) && stripos($post->post_content, '[' . $shortcode) !== false ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "protected function register_shortcodes() {}", "function add_shortcode( $atts, $content, $name ) {\n\t\t\n\t\tif ( ! $this->validate_shortcode( $atts, $content, $name ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$options = $this->set_options( $atts );\n\n\t\t$post_id = get_the_ID();\n\n\t\tob_start();\n\t\tglobal $oxygen_vsb_css_caching_active;\n\t\techo \"<\".esc_attr($options['tag']).\" id='\" . esc_attr( $options['selector'] ) . \"' class='\" . esc_attr( $options['classes'] ) . \"'>\";\n\n\t\tif(isset($_REQUEST['oxy_preview_revision']) && is_numeric($_REQUEST['oxy_preview_revision'])) {\n\t\t\t$shortcodes = Oxygen_Revisions::get_post_meta_db( $post_id, null, true, null, OBJECT, $_REQUEST['oxy_preview_revision'] )->meta_value;\n\t\t}\n\t\telse if (isset($_REQUEST['xlink']) && $_REQUEST['xlink'] == \"css\" && $_REQUEST['nouniversal'] == \"true\") {\n\t\t\t// set random text so it does not look for template\n\t\t\t$shortcodes = \"no shortcodes\";\n\t\t} \n\t\telse if (isset($oxygen_vsb_css_caching_active) && $oxygen_vsb_css_caching_active===true) {\n\t\t\t$shortcodes = \"no shortcodes\";\n\t\t}\n\t\telse {\n\t\t\t$shortcodes = get_post_meta( $post_id, 'ct_builder_shortcodes', true );\n\t\t\tif( class_exists('Oxygen_Gutenberg') && get_post_meta( $post_id, 'ct_oxygenberg_full_page_block', true ) == '1' ) {\n\t\t\t $post = get_post($post_id);\n\t\t\t $shortcodes = do_blocks( $post->post_content );\n }\n\t\t}\n\n\t\tif(empty(trim($shortcodes))) {\n\n\t\t\t// find the template that has been assigned to innercontent\n\t\t\t$template = ct_get_inner_content_template();\n\n\t\t\tif($template) {\n\t\t\t\t$shortcodes = get_post_meta($template->ID, 'ct_builder_shortcodes', true);\n\t\t\t}\n\n\t\t\tif($shortcodes) {\n echo ct_do_shortcode($shortcodes);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// RENDER default content\n\t\t\t\tif(function_exists('is_woocommerce') && is_woocommerce()) {\n\t\t\t\t\twoocommerce_content();\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t // Use WordPress post content as inner content\n\t\t\t\t // if(!in_the_loop()) {\n\t\t\t while ( have_posts() ) {\n\t\t\t the_post();\n\t\t\t the_content();\n\t\t\t }\n\t\t\t // }\n\t\t\t // else {\n\t\t\t // \tthe_content();\n\t\t\t // }\n\t\t }\n\t\t }\n\n } else {\n\t\t // Use Oxygen designed inner content\n $content .= $shortcodes;\n }\n\n if ( ! empty( $content ) ) {\n\t echo ct_do_shortcode( $content );\n }\n\n echo \"</\".esc_attr($options['tag']).\">\";\n\n\t\treturn ob_get_clean();\n\t}", "function shortcode_menu( $item_output, $item ) {\r\n\tif ( !empty($item->description)) {\r\n\t\t$output = do_shortcode($item->description);\r\n\t\tif ( $output != $item->description )$item_output = $output;\r\n\t}\r\n\treturn $item_output;\r\n}", "public function do_shortcode( $atts, $content = null, $shortcode ) {\n\t\treturn '';\n\t}", "function medpro_section_title_shortcode($atts, $content = null) {\n \n extract( shortcode_atts( array(\n 'theme' => '1',\n 'title' => '',\n 'desc_option' => '2',\n 'desc' => '',\n 'text_align' => 'center',\n ), $atts) ); \n\n\n \n $secton_title_markup = '\n <div class=\"medpro-section-title theme-'.esc_attr($theme).'\" style=\"text-align:'.esc_attr($text_align).'\">\n <h2>'.$title.'</h2>';\n\n if( $desc_option == '1' && !empty($desc) ) {\n $secton_title_markup .= ''.wpautop($desc).'';\n }\n\n $secton_title_markup .= '\n </div>\n ';\n\n\n return $secton_title_markup;\n \n}", "function add_shortcode( $args ) {\n\t\t$shortcodes = get_option( 'elm_testimonials_shortcodes' );\n\t\n\t\t// Check if shortcode does not exist\n\t\tif ( ! $this->get_shortcode( $args['sc_name'] ) ) {\n\t\t\t$index = strtolower( $args['sc_name'] );\n\t\t\t$shortcodes[$index] = $args;\n\t\t\t\n\t\t\tupdate_option( 'elm_testimonials_shortcodes', $shortcodes );\n\t\t\t\n\t\t\treturn $shortcodes[$index];\n\t\t}\n\t}", "private function add_shortcodes()\n {\n }", "function jhm_shorturl_auto_check($content) {\n\t\n\tif(!is_single()) { echo(do_shortcode($content)); return; }\n\t\n\t$_s = jhm_shorturl_settings_load();\n\tif(!empty($_s[\"auto\"])) {\n\t\t$content = $content . str_replace(\"\\'\", \"'\", str_replace('\\\"',\"'\", do_shortcode($_s[\"auto\"])));\n\t} \n\techo(do_shortcode($content));\n}", "function theme_run_shortcode( $content )\n\t{\n\t\tglobal $shortcode_tags;\n\t\t\n\t\t// Backup current registered shortcodes and clear them all out\n\t\t$orig_shortcode_tags = $shortcode_tags;\n\t\tremove_all_shortcodes();\n\t\t\n\t\t\n\t\tadd_shortcode( 'divider', 'divider' );\n\t\tadd_shortcode( 'letter', 'letter' );\n\t\tadd_shortcode( 'alert', 'alert' );\n\t\tadd_shortcode( 'social_icon', 'social_icon' );\n\t\tadd_shortcode( 'toggle', 'toggle' );\n\t\tadd_shortcode( 'accordion', 'accordion' );\n\t\tadd_shortcode( 'tabs_wrap', 'tabs_wrap' );\n\t\tadd_shortcode( 'tab_pane', 'tab_pane' );\n\t\tadd_shortcode( 'icon', 'icon' );\n\t\tadd_shortcode( 'button', 'button' );\n\t\tadd_shortcode( 'row', 'row' );\n\t\tadd_shortcode( 'column', 'column' );\n\t\tadd_shortcode( 'media_wrap', 'media_wrap' );\n\t\tadd_shortcode( 'video', 'video' );\n\t\tadd_shortcode( 'audio', 'audio' );\n\t\tadd_shortcode( 'link_wrap', 'link_wrap' );\n\t\tadd_shortcode( 'aside', 'aside' );\n\t\tadd_shortcode( 'quote', 'quote' );\n\t\tadd_shortcode( 'slide', 'slide' );\n\t\tadd_shortcode( 'project_action', 'project_action' );\n\t\tadd_shortcode( 'call_to_action', 'call_to_action' );\n\t\tadd_shortcode( 'cta_button_wrap', 'cta_button_wrap' );\n\t\tadd_shortcode( 'progress_bar', 'progress_bar' );\n\t\tadd_shortcode( 'testimonial', 'testimonial' );\n\t\tadd_shortcode( 'timeline', 'timeline' );\n\t\tadd_shortcode( 'event', 'event' );\n\t\tadd_shortcode( 'latest_tweets', 'latest_tweets' );\n\t\tadd_shortcode( 'service', 'service' );\n\t\tadd_shortcode( 'process', 'process' );\n\t\tadd_shortcode( 'fun_fact', 'fun_fact' );\n\t\tadd_shortcode( 'client', 'client' );\n\t\tadd_shortcode( 'image', 'image' );\n\t\tadd_shortcode( 'section_title', 'section_title' );\n\t\tadd_shortcode( 'drop_cap', 'drop_cap' );\n\t\tadd_shortcode( 'tagline', 'tagline' );\n\t\tadd_shortcode( 'code_line', 'code_line' );\n\t\tadd_shortcode( 'code_block', 'code_block' );\n\t\tadd_shortcode( 'code_block_prettify', 'code_block_prettify' );\n\t\tadd_shortcode( 'code_block_line_numbers', 'code_block_line_numbers' );\n\t\tadd_shortcode( 'icon_list', 'icon_list' );\n\t\tadd_shortcode( 'list_item', 'list_item' );\n\t\tadd_shortcode( 'portfolio_field', 'portfolio_field' );\n\t\tadd_shortcode( 'inline_lightbox_wrap', 'inline_lightbox_wrap' );\n\t\tadd_shortcode( 'inline_lightbox_image', 'inline_lightbox_image' );\n\t\tadd_shortcode( 'inline_lightbox_iframe', 'inline_lightbox_iframe' );\n\t\tadd_shortcode( 'portfolio_lightbox_image', 'portfolio_lightbox_image' );\n\t\tadd_shortcode( 'portfolio_lightbox_iframe', 'portfolio_lightbox_iframe' );\n\t\tadd_shortcode( 'map', 'map' );\n\t\tadd_shortcode( 'contact_form', 'contact_form' );\n\t\tadd_shortcode( 'portfolio_tags', 'portfolio_tags' );\n\t\tadd_shortcode( 'intro', 'intro' );\n\t\tadd_shortcode( 'rotate_words', 'rotate_words' );\n\t\tadd_shortcode( 'launch_button_wrap', 'launch_button_wrap' );\n\t\t\n\t\t\n\t\t// Do the shortcode ( only the one above is registered )\n\t\t$content = do_shortcode( $content );\n\t\t\n\t\t// Put the original shortcodes back\n\t\t$shortcode_tags = $orig_shortcode_tags;\n\t\t\n\t\treturn $content;\n\t}", "function neudev_shortcode_demo($atts, $content = null)\n{\n return '<div class=\"shortcode-demo\">' . do_shortcode($content) . '</div>'; // do_shortcode allows for nested Shortcodes\n}", "function bienen_shortcode_demo($atts, $content = null)\n{\n return '<div class=\"shortcode-demo\">' . do_shortcode($content) . '</div>'; // do_shortcode allows for nested Shortcodes\n}", "function oxy_shortcode_vc_tab($atts , $content=''){\n\n return do_shortcode($content);\n}", "function woo_toggles_sc( $atts, $content = null){\n\textract(shortcode_atts(array(\n 'title' => '',\n 'icon' => '',\n 'open' => \"false\"\n ), $atts));\n\n\tif($icon == '') {\n \t$return = \"\";\n }\n else{\n \t$return = \"<i class='icon-\".$icon.\"'></i>\";\n }\n \n if($open == \"true\") {\n\t $return2 = \"onacc\";\n }\n else{\n\t $return2 = '';\n }\n \n return '<div class=\"accordionButton '.$return2.'\"><h4>'.$return.''.$title.'</h4></div><div class=\"accordionContent\"><p>'. do_shortcode($content) . '</p></div>';\n}", "public function register_shortcode() {\n add_shortcode( self::SHORTCODE_TAG, array( &$this, 'do_shortcode' ) );\n }", "function cmc_dynamic_title($atts, $content = null){\r\n\t\t \t$atts = shortcode_atts( array(\r\n\t\t\t'id' => '',\r\n\t\t\t), $atts);\r\n\t\t\t$output='';\r\n\t\t\t$desc='';\r\n\t\t$title_txt=$this->cmc_generate_title($position='default');\r\n\t$output='<h1 class=\"cmc-dynamic-title\">'.$title_txt.'</h1>';\r\n\treturn $output;\r\n}", "function wpsp_toggle_shortcode($atts, $content = null) {\n\textract(shortcode_atts(array(\n\t\t'style' => 'one',\t\t\n\t\t'open_index' => 0\n\t), $atts));\n\n\treturn '<div class=\"accordion small ' . $style . ' clearfix toggle\" data-opened=\"' . $open_index . '\">' . return_clean($content) . '</div>';\n}", "function accordions_sc_func($atts, $content = '') {\n $currrentShortCode = '<span class=\"tfb-sc-accordions\">' . do_shortcode($content) . '</span>';\n \n return $currrentShortCode;\n}", "function toggle_content_func( $atts, $content = null ) {\n extract(shortcode_atts(array(\n\t 'title' => '',\n ), $atts));\n $html = '<h4 class=\"slide_toggle\"><a href=\"#\">' .$title. '</a></h4>';\n $html .= '<div class=\"slide_toggle_content\" style=\"display: none;\">'.do_shortcode($content).'</div>';\n return $html;\n}" ]
[ "0.65483993", "0.6371275", "0.6363207", "0.6271362", "0.6250055", "0.6176322", "0.61595684", "0.61175734", "0.6079561", "0.60739225", "0.60224307", "0.5998602", "0.59952533", "0.59776616", "0.5947727", "0.5922668", "0.5862153", "0.5854156", "0.58423895", "0.58245987", "0.58201337", "0.58050305", "0.5803596", "0.57895416", "0.5780862", "0.5767213", "0.5743695", "0.573755", "0.5729348", "0.57274944" ]
0.67018414
0
Retrieve a report for an url return boolean, or report array
public function getAnalysisReportForUrl($url){ $params = array("url"=>$url); $tab = array(); $analysis = $this->analysisLaunch($params); if (isset($analysis["reportId"])){ $sReportId = $analysis["reportId"]; $params = array("reportId"=>$sReportId); $tab = array("status"=>202);//202 = In progress $iRetry = 0; do{ sleep(15); $tab = $this->getAnalysisReport($params); //echo var_dump($tab); $iRetry++; if ($tab["status"] == 200){ return $tab["report"]; exit(); } }while ($iRetry < 5 and $tab["status"] != 200); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function findReportByUrl($url) {\n $query = $this->database->select('sa11y_data', 'd');\n $query->addExpression('max(report_id)', 'id');\n $query->condition('d.url', $url);\n $result = $query->execute()->fetchAll();\n if (isset($result[0])) {\n return $this->getReport($result[0]->id);\n }\n return FALSE;\n }", "public function getReport();", "public function get_report($type) {\n\t\t$type = strtolower('report_accesslog_'.$type);\n\t\t$ref = $this->_get_hash($type);\n\t\tif (isset($this->report[$ref])) {\n\t\t\treturn $this->report[$ref];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function & getReports(& $request_results)\n\t {\n\t $ret = array ();\n\n\t if ($request_results != null) \n\t \tif (isset($request_results[\"report\"])) \n\t \t\t$ret = &$request_results[\"report\"];\n\n\t return $ret;\n\t }", "public function getReports();", "public function getData($service, $url){\n\t\t$data = $this->getSite($service, $url);\n\t\t\n\t\t//been forwarded to a login page\n\t\tif(strpos($data,'hit your daily report limit') > 0){\n\t\t\t$data = $this->getSite($service, $url);\n\t\t}\n\t\treturn $data;\n\t}", "function retrieveReportData ($type, $id, $cv, $date) {\n\t\t\t\n\t\t\t//$url = 'https://mservice-uat.cpf.co.th/Farm/FarmMobileRestService/FarmMobileRestService.svc/json/getreportswstock/123456789,2000020032-0-1-4-36,20170601';\n\t\t\t\n\t\t\t$url = 'https://mservice-uat.cpf.co.th/Farm/FarmMobileRestService/FarmMobileRestService.svc/json/'.$type.'/'.$id.','.$cv.','.$date;\n\t\t\t\n\t\t\terror_log($url.' <<<<<<<<<<<<<<<<<<<<<< LOG PHP PAGE');\n\t\t\t\n\t\t\t$arrContextOptions = array(\n\t\t\t\t\t\t\t\t'ssl' => array(\n\t\t\t\t\t\t\t\t'verify_peer' => false,\n\t\t\t\t\t\t\t\t'verify_peer_name' => false,\n\t\t\t\t\t\t\t\t)); \n\t\t\t$content = file_get_contents($url,false, stream_context_create($arrcontextoptions));\n\t\t\t$result = json_decode($content, true);\n\n\t\t\t//echo json_encode($result['GetReportSWStockResult']);\n\t\t\t\n\t\t\t$valProp = '';\n\t\t\t\n\t\t\tif($type == 'getreportswstock') {\n\t\t\t\t$valProp = 'GetReportSWStockResult';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$valProp = 'GetReportFeedStockResult';\n\t\t\t}\n\t\t\t$ret = json_encode($result[$valProp]);\n\t\t\t\n\t\t\treturn $ret;\n\t\t}", "function check_site_safety($url){\n global $__google_safety_check;\n\n $response = @file_get_contents(\"https://www.google.com/transparencyreport/api/v3/safebrowsing/status?site=\".$url);\n $arr_resp = explode(\",\", $response);\n if(count($arr_resp) > 0)\n $response = $arr_resp[1];\n else\n $response = \"0\";\n $__google_safety_check = $response;\n if(($response == 2) || ($response == 3))\n return 1;\n return 0;\n}", "function hnd_discogs_get_response( $url = null ) {\n\n\tif( !$url )\n\t\treturn;\n\n\t//initialize the session \n\t$ch = curl_init(); \n\n\t//Set the User-Agent Identifier \n\tcurl_setopt($ch, CURLOPT_USERAGENT, 'HandstandRecords/0.1 +http://www.handstandrecords.com'); \n\n\t//Set the URL of the page or file to download. \n\tcurl_setopt($ch, CURLOPT_URL, $url); \n\n\t//Ask cURL to return the contents in a variable instead of simply echoing them \n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\n\t//Execute the curl session \n\t$output = curl_exec($ch); \n\n\t//close the session \n\tcurl_close ($ch); \n\n\t// convert repsonse to array\n\t$response = json_decode( $output );\n\n\t// DUMP\n\t//echo '<hr>' . '<pre>' . print_r( $response, true ) . '</pre>';\n\n\treturn $response;\n}", "public function analysisURL()\r\n\t{\r\n\t\t$stats= array();\r\n\t\tif($this->_isURL()){\r\n\t\t\t$stats['isUrl']= true; // set URL is valid\r\n\t\t\t$p_url = parse_url($this->_url); // parse_url PHP function\r\n\t\t\t\r\n\t\t\t$this->_setHttpRequest();\r\n\t\t\t$stats['DNS'] = $p_url['host'];\r\n\t\t\t$stats['DNS_R'] = $this->_site['STATUS']['url'];\r\n\t\t\t$stats['httpCode']= $this->_site['HTTP_CODE']; // set HTTP status code\r\n\t\t\t$stats['title'] = return_between($this->_siteHtml,\"<title>\",\"</title>\",EXCL); // LIB_parse\r\n\t\t\t// META tags reference: http://www.i18nguy.com/markup/metatags.html \r\n\t\t\t/* get html tag and work well with tags [script,link,style,meta,img,a,....] that tags not support nested such as :\r\n\t\t <div id='1'><div id='2'></div></div>\r\n\t\t\t*/\r\n\t\t\t$meta_tags = parse_array($this->_siteHtml, \"<meta\",\">\"); // LIB_parse\r\n\t\t\tforeach($meta_tags as $k => $element){\r\n\t\t\t\t$goUrl = $this->isRedirect($element);\r\n\t\t\t\tif($goUrl){\r\n\t\t\t\t\t$stats['goUrl'] = $goUrl; // if redirect get that url\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$name = get_attribute($element,'name'); // LIB_parse\r\n\t\t\t\t\t$content = get_attribute($element,'content'); // LIB_parse\r\n\t\t\t\t\tif($name && $content){\r\n\t\t\t\t\t\t$stats['meta'][$name] = $content;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$stats['isUrl']= false;\r\n\t\t}\r\n\t\t//return $stats;\r\n\t\t//================ PRINT REPORT\r\n\t\t$report = \"<table border='1'>\";\r\n\t\tforeach($stats as $k => $val){\r\n\t\t\tif($k == 'meta'){\r\n\t\t\t\t$report .='<tr><td> META </td><td>';\r\n\t\t\t\tforeach($val as $key => $value){\r\n\t\t\t\t\t$report .= '<span style=\"color:red\">'.$key.'</span> = '.$value.'<br/>';\r\n\t\t\t\t}\r\n\t\t\t\t$report .='</td></tr>';\r\n\t\t\t} else \r\n\t\t\t$report .='<tr><td>'.$k.'</td><td>'.$val.'</td></tr>';\r\n\t\t}\r\n\t\t$report .= '</table>';\r\n\t\treturn $report;\r\n\t}", "public function getReportRequest();", "function result_site($url)\n {\n return json_decode(file_get_contents($url));\n }", "function get_report($id)\n {\n return $this->db->get_where('report', array('id' => $id))->row_array();\n }", "private function getData($url)\n\t{\n\t\t$curlId=curl_init($url);\n\t\tcurl_setopt($curlId,CURLOPT_RETURNTRANSFER,1);\t\t\t// get response data not to stdout\n\t\tcurl_setopt($curlId,CURLOPT_FRESH_CONNECT,1);\n\t\t$data=curl_exec($curlId);\n\t\t$header=curl_getinfo($curlId);\n\t\tif($header['http_code']==200)\t\t\t\t\t\t\t// checking... all done good! ;)\n\t\t\treturn $data;\n \treturn false;\n\t}", "public function getReports()\r\n {\r\n if( empty($this->loginTokens) )\r\n {\r\n trigger_error( \"BlackBerryStats::getReports(): Login tokens are empty. Login first!\" );\r\n return;\r\n }\r\n\r\n $response = $this->reqReports();\r\n $result = $this->reqReportsResult($response);\r\n\r\n return $result;\r\n }", "public function getReport($reportName, $format = 'json', $group = '')\n {\n if (! $group){\n $group = $this->group;\n }\n $data = array('key'=>sha1(getenv('WS_KEY')), 'url' => $this->reportUrl,\n 'reportName' => ucwords($reportName), 'group' => $group);\n\n $response = $this->sendRequest($data);\n\n if ($format === 'array'){\n return object_to_array(json_decode($response));\n } else {\n return $response;\n }\n\n }", "public function ReadDataFromURL($url) {\r\n if (@file_get_contents($url)) {\r\n return file_get_contents($url);\r\n } else {\r\n return false;\r\n }\r\n }", "public function getReport($access_token, $student, $standard, $report_type, $group_ids = ''){\n\n $resource= 'reports/' .$report_type;\n $method = self::HTTP_GET;\n $payload = array(\n 'access_token' => $access_token,\n 'group_ids' => $group_ids,\n 'student' => $student,\n 'standard' => $standard\n );\n\n return $this->_makeSnapshotApiRequest($resource, $method, $payload);\n\n }", "function getDataByGetHttp($url)\n\t{\n\t\t// Site is behind a login: use curl instead\n\t\tif (\n\t\t\t$this->params->use_negotiate_authentication\n\t\t\t|| $this->getAuthenticationCredentials()\n\t\t)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$html = JHttpFactory::getHttp()->get($url, null, $this->params->timeout)->body;\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->convertHtmlToObject($html);\n\t}", "abstract public function getByURL( $URL );", "public function getReport($requestParameters = array());", "public function get_check($url, $source = 'cayl') {\n return $this->get_item($url, 'cayl_check');\n }", "function GetReportsTo() {\n GetCILibrary()->load->library(\"session\");\n $GetSessionData = GetCILibrary()->session->all_userdata();\n $ReportsTo = isset($GetSessionData[GetCILibrary()->session->userdata(\"User_Code\")][0]['ReportsTo']) ? $GetSessionData[GetCILibrary()->session->userdata(\"User_Code\")][0]['ReportsTo'] : NULL;\n return $ReportsTo;\n}", "public function downloadReport()\n {\n return $this->userRepository->makeReport();\n }", "private static function DownloadReportFromUrl($url, $headers, $params,\n $path = NULL) {\n /* \n * This method should not be static and instantiation of this class should\n * be allowed so we can \"inject\" CurlUtils, but would break too many things\n * that rely on this method being static.\n */\n $curlUtils = new CurlUtils();\n $ch = $curlUtils->CreateSession($url);\n\n $curlUtils->SetOpt($ch, CURLOPT_POST, TRUE);\n $curlUtils->SetOpt($ch, CURLINFO_HEADER_OUT, TRUE);\n\n $flatHeaders = array();\n foreach($headers as $name => $value) {\n $flatHeaders[] = sprintf('%s: %s', $name, $value);\n }\n $curlUtils->SetOpt($ch, CURLOPT_HTTPHEADER, $flatHeaders);\n\n if (isset($params)) {\n $curlUtils->SetOpt($ch, CURLOPT_POSTFIELDS, $params);\n }\n\n if (isset($path)) {\n $file = fopen($path, 'w');\n $curlUtils->SetOpt($ch, CURLOPT_RETURNTRANSFER, FALSE);\n $curlUtils->SetOpt($ch, CURLOPT_FILE, $file);\n }\n\n $response = $curlUtils->Exec($ch);\n $error = $curlUtils->Error($ch);\n $code = $curlUtils->GetInfo($ch, CURLINFO_HTTP_CODE);\n $downloadSize = $curlUtils->GetInfo($ch, CURLINFO_SIZE_DOWNLOAD);\n $request = $curlUtils->GetInfo($ch, CURLINFO_HEADER_OUT);\n\n $curlUtils->Close($ch);\n if (isset($file)) {\n fclose($file);\n }\n\n $exception = null;\n if ($code != 200) {\n // Get the beginning of the response.\n if (isset($path)) {\n $file = fopen($path, 'r');\n $snippet = fread($file, self::$SNIPPET_LENGTH);\n fclose($file);\n } else {\n $snippet = substr($response, 0, self::$SNIPPET_LENGTH);\n }\n // Create exception.\n $error = self::ParseApiErrorXml($snippet);\n if ($error) {\n $errorMessage = \"Report download failed. Underlying errors are \\n\";\n foreach ($error->ApiError as $apiError) {\n $errorMessage .= sprintf(\"Type = '%s', Trigger = '%s', FieldPath = \" .\n \"'%s'. \", $apiError->type, $apiError->trigger,\n $apiError->fieldPath);\n }\n $exception = new ReportDownloadException($errorMessage, $code); \n } else if (preg_match(self::$ERROR_MESSAGE_REGEX, $snippet, $matches)) {\n $exception = new ReportDownloadException($matches[2], $code);\n } else if (!empty($error)) {\n $exception = new ReportDownloadException($error);\n } else if (isset($code)) {\n $exception =\n new ReportDownloadException('Report download failed.', $code);\n }\n }\n\n self::LogRequest($request, $code, $params, $exception);\n\n if (isset($exception)) {\n throw $exception;\n } else if (isset($path)) {\n return $downloadSize;\n } else {\n return $response;\n }\n }", "private function getResult($bitlyurl, $errors = false )\n\t{\n\t\tif ( $errors ) {\n\t\t\t$tmpFormat = $this->format;\n\t\t\t$this->format = 'json';\n\t\t}\n\n\t\tif ( $this->format == 'json' ) {\n\t\t\t//$results = json_decode(file_get_contents($bitlyurl), true);\n\t\t\t$results = json_decode($this->curl_simple($bitlyurl), true);\n\t\t} else if ( $this->format == 'xml' ) {\n\t\t\t//$xml = file_get_contents($bitlyurl);\n\t\t\t$xml = $this->curl-simple($bitlyurl);\n\t\t\t$results = $this->XML2Array($xml);\n\t\t}\n\n\t\tif ( $errors ) {\n\t\t\t$this->format = $tmpFormat;\n\t\t}\n\n\t\tif ( $results['statusCode'] != 'OK' ) {\n\t\t\t$this->errors = $results;\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( $errors ) {\n\t\t\t// Save everything in the results array\n\t\t\t$this->results = $results['results'];\n\t\t} else {\n\t\t\t// Save the first item in the results array\n\t\t\t$this->results = current($results['results']);\n\t\t}\n\t\treturn true;\n\t}", "function get_data($url){\n\t$ch = curl_init();\n\t$timeout = 5;\n\tcurl_setopt($ch,CURLOPT_URL,$url);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\n\t$data = curl_exec($ch);\n\t$httpheaders = curl_getinfo($ch,CURLINFO_HTTP_CODE);\n\tcurl_close($ch);\n\tif($httpheaders == \"404\"){ return \"noplugin\"; }else{ return $data; }\n}", "public function find_report($report_date)\n\t\t{\n\t\t\tglobal $db , $result;\n\t\t\t$rep_date=date('Y-m-d',strtotime($report_date));\n\t\t\t$query=\"SELECT * FROM report_table WHERE date='\".$rep_date.\"'\";\n\t\t\t$result = $db['master']->getResults($query);\n\t\t\treturn $result; \n\t\t}", "public function report():Array {\n\n\t\treturn $this->report;\n\n\t}", "function get_response( $url ) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n\n // if it returns a 403 it will return no $output\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}" ]
[ "0.7467306", "0.6463205", "0.63694954", "0.63218594", "0.59908074", "0.5938746", "0.58188254", "0.56233287", "0.5582713", "0.55752784", "0.55715144", "0.5553301", "0.55331486", "0.55288106", "0.5500237", "0.5460655", "0.5436336", "0.54324454", "0.5425514", "0.53977764", "0.5394819", "0.53946364", "0.5384804", "0.53796977", "0.53690827", "0.536119", "0.534289", "0.5329908", "0.53209436", "0.53129286" ]
0.714892
1
Returns today's date string value
function wmf_common_date_get_today_string() { $timestamp = time(); return wmf_common_date_format_string($timestamp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function today(): string\n {\n return (new \\DateTimeImmutable('today'))->format('Y-m-d');\n }", "public function getDate(): string\n {\n return \"Today is: \" . date('c');\n }", "protected function today(){\n return date_i18n('Y-m-d', current_time('timestamp'));\n }", "public function dateNow(): string\n {\n return date('d-m-Y');\n }", "public function getTodayDate()\n\t{\n\t\t$this->load->helper('date');\n // get time stamp\n $time = time();\n \n $dateString = \"%Y-%m-%d\";\n return mdate($dateString, $time);\n\t\t\n\t}", "function current_date() {\n return date(\"Y-m-d\");\n }", "public function dateNowFormat(): string\n {\n return date('d-m-Y');\n }", "public function getCurrDate(): string\n {\n return 'datetime(\\'now\\')';\n }", "function getToday(){\n\t$date=date('D');\n\treturn $date;\n}", "public function CurrentDate()\n\t{\n\t\t$day = (integer)$this->day;\n\t\tif ($day<10) $day = '0'.$day;\n\t\t\n\t\t$month = (integer) $this->month;\n\t\tif ($month<10) $month = '0'.$month;\n\t\t\n\t\treturn \"{$this->year}-$month-$day\";\n\t}", "public function get_current_date(){\n\t\treturn date('Y-m-d H:i:s');\n\t}", "public function getToday()\n {\n return $this->today;\n }", "protected function getNow()\n\t{\n\t\treturn date('Y-m-d');\n\t}", "function today() {\r\n return self::returnDate(self::returnMYSQLTimestampFromUNIX(time()));\r\n }", "function getCurrentDate()\n\t{\n\t\treturn date(\"Y-m-d\");\n\t}", "public static function now ()\n\t\t{\n\t\t\treturn date(self::$dtFormat);\n\t\t}", "function currentDate(){\n\t//the date is then returned\n\t$swap = getdate();\n\t$today = \"{$swap['mon']}/{$swap['mday']}/{$swap['year']}\";\n\treturn $today;\n}", "function getNowDate()\n {\n $nowDate = @strftime('%Y-%m-%d %H:%M', time());\n\n return $nowDate;\n }", "function getNowDate()\n {\n $nowDate = @strftime('%Y-%m-%d %H:%M', time());\n\n return $nowDate;\n }", "function getFormattedDate() {\n $today = getdate();\n $day = $today['mday'];\n if ((int)$day < 10) {\n $day = \"0$day\";\n }\n $month = $today['mon'];\n if ((int)$month < 10) {\n $month = \"0$month\";\n }\n $year = $today['year'];\n return \"$day-$month-$year\";\n }", "public function getTodoDate() : string {\n\t\treturn($this->todoDate);\n\t}", "function getNowDate() {\n\t\t$nowDate = @strftime('%Y-%m-%d %H:%M', time());\n\t\treturn $nowDate;\n\t}", "public function getTodayDateWithTime()\n\t{\n\t\t$this->load->helper('date');\n // get time stamp\n $time = time();\n \n $dateString = \"%Y-%m-%d-%h-%i\";\n return mdate($dateString, $time);\n\t\t\n\t}", "public static function now()\n\t{\n\t\treturn self::today() . ' ' . self::time();\n\t}", "public static function getDate() {\r\n return date(\"Y-m-d\");\r\n }", "function get_today($format = 'Y-m-d'){\n return date($format);\n}", "public function now()\n {\n return \"CONVERT( varchar( 19 ), GETDATE(), 120 )\"; // 120 means that we use ODBC canonical\n // format for date output i.e. yyyy-mm-dd hh:mi:ss(24h)\n }", "public function dateNow()\n {\n return date('Y-m-d H:i:s');\n }", "public function getDateString() {\n\t\t\tif ($this->startDate->hasValue()) {\n\t\t\t\tif ($this->endDate->hasValue()) {\n\t\t\t\t\treturn $this->formatDate($this->startDate->value) . \" to \" . $this->formatDate($this->endDate->value);\n\t\t\t\t}\n\t\t\t\treturn $this->formatDate($this->startDate->value);\n\t\t\t} else {\n\t\t\t\treturn \"No date\";\n\t\t\t}\n\t\t}", "public function getDateString() {\n\t\t\tif ($this->startDate->hasValue()) {\n\t\t\t\tif ($this->endDate->hasValue()) {\n\t\t\t\t\treturn $this->formatDate($this->startDate->value) . \" to \" . $this->formatDate($this->endDate->value);\n\t\t\t\t}\n\t\t\t\treturn $this->formatDate($this->startDate->value);\n\t\t\t} else {\n\t\t\t\treturn \"No date\";\n\t\t\t}\n\t\t}" ]
[ "0.8629073", "0.8029052", "0.80143845", "0.793372", "0.7860069", "0.77299386", "0.7680571", "0.7666071", "0.7627377", "0.75641173", "0.75414497", "0.75239265", "0.73663634", "0.7329065", "0.7314871", "0.7262248", "0.722951", "0.72276103", "0.72276103", "0.7224847", "0.72000074", "0.718538", "0.71283036", "0.7078916", "0.70493317", "0.70319", "0.6954932", "0.694082", "0.6918768", "0.6918768" ]
0.838793
1
Convert a unix timestamp to formatted date, in UTC. Ordinarily, you will want to use the preformatted functions below to ensure standardized behavior.
function wmf_common_date_format_using_utc($format, $unixtime) { try { $obj = wmf_common_make_datetime('@' . $unixtime); $formatted = $obj->format($format); } catch (Exception $ex) { watchdog('wmf_common', t('Caught date exception in ' . __METHOD__ . ': ') . $ex->getMessage(), NULL, WATCHDOG_ERROR); return ''; } return $formatted; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFedoraFormattedDateUTC($timestamp = null)\r\n\t{\r\n\t\tif ($timestamp == null) {\r\n\t\t\t//\t\t\t$timestamp = Date_API::getCurrentUnixTimestampGMT();\r\n\t\t}\r\n\t\t$date = new Date($timestamp);\r\n\t\t$date->setTZbyID(Date_API::getPreferredTimezone());\r\n\t\t$date->toUTC();\r\n\r\n\t\treturn $date->format('%Y-%m-%dT%H:%M:%SZ');\r\n\t}", "function wmf_common_date_unix_to_civicrm($unixtime) {\n return wmf_common_date_format_using_utc(\"Y-m-d H:i:s\", $unixtime);\n}", "function format_unix_time($date)\n{\n if (empty($date))\n return \"\";\n\n\n $fmt = get_user_dateformat(DATE_FORMAT_DATETIME);\n\n return strftime($fmt, $date);\n}", "function unixtotime($time){\r\n$unix_timestamp = $time;\r\n$datetime = new DateTime(\"@$unix_timestamp\");\r\n// Display GMT datetime\r\n//echo $datetime->format('d-m-Y H:i:s');\r\n$date_time_format = $datetime->format('Y-m-d H:i:s');\r\n$time_zone_from=\"UTC\";\r\n$time_zone_to='Asia/Singapore';\r\n$display_date = new DateTime($date_time_format, new DateTimeZone($time_zone_from));\r\n// Date time with specific timezone\r\n$display_date->setTimezone(new DateTimeZone($time_zone_to));\r\nreturn $display_date->format('d-m-Y H:i:s');\r\n}", "function simplechat_get_utc_timestamp() {\n $date = new DateTime('now', new DateTimeZone('UTC'));\n return $date->format('U');\n}", "public static function convertFromUTC($timestamp, $timezone, $format = 'Y-m-d H:i:s')\n\t{\n $date = new DateTime($timestamp, new DateTimeZone('UTC'));\n\n $date->setTimezone(new DateTimeZone($timezone));\n\n return $date->format($format);\n }", "function utc_to_tz ($timestamp=0) {\n\tGLOBAL $CURUSER, $tzs;\n\n\tif (method_exists(\"DateTime\", \"setTimezone\")) {\n\t\tif (!$timestamp)\n\t\t\t$timestamp = get_date_time();\n\t\t$date = new DateTime($timestamp, new DateTimeZone(\"UTC\"));\n\n\t\t$date->setTimezone(new DateTimeZone($CURUSER ? $tzs[$CURUSER[\"tzoffset\"]][1] : \"Europe/London\"));\n\t\treturn $date->format('Y-m-d H:i:s');\n\t}\n\tif (!is_numeric($timestamp))\n\t\t$timestamp = sql_timestamp_to_unix_timestamp($timestamp);\n\tif ($timestamp == 0)\n\t\t$timestamp = gmtime();\n\n\t$timestamp = $timestamp + ($CURUSER['tzoffset']*60);\n\tif (date(\"I\")) $timestamp += 3600; // DST Fix\n\treturn date(\"Y-m-d H:i:s\", $timestamp);\n}", "static function normalizeDate($timestamp) {\n\t\t$dateObj = new DateTime();\n\t\t$dateObj->setTimestamp($timestamp);\n\n\t\t$dateObj->setTime(00, 00, 00);\n\n\t\treturn $dateObj->format('U');\n\t}", "function fromunixtime($timestamp)\n {\n switch($this->db_provider)\n {\n case 'mysqli':\n case 'mysql':\n case 'sqlite':\n return sprintf(\"FROM_UNIXTIME(%d)\", $timestamp);\n\n default:\n return date(\"'Y-m-d H:i:s'\", $timestamp);\n }\n }", "public static function convertToUTC($timestamp, $timezone, $format = 'Y-m-d H:i:s')\n {\n \t$date = new DateTime($timestamp, new DateTimeZone($timezone));\n\n $date->setTimezone(new DateTimeZone('UTC'));\n\n return $date->format($format);\n }", "function UTC($yy, $mm, $dd, $hh, $nn, $ss)\n{ return(mktime($hh, $nn, $ss, $mm, $dd, $yy));\n}", "function _unixdate_to_generalizedtime($timestamp = '') {\n if(empty($timestamp)) {\n $timestamp = time();\n }\n $hour = '000000';\n return date(\"Ymd\", $timestamp) . $hour . \"Z\";\n }", "public static function adjust_timestamp( $unix_timestamp, $tzstring ) {\n\t\ttry {\n\t\t\t$local = self::get_timezone( $tzstring );\n\n\t\t\t$datetime = date_create_from_format( 'U', $unix_timestamp )->format( Tribe__Date_Utils::DBDATETIMEFORMAT );\n\n\t\t\t// We prefer format('U') to getTimestamp() here due to our requirement for compatibility with PHP 5.2\n\t\t\treturn date_create_from_format( 'Y-m-d H:i:s', $datetime, $local )->format( 'U' );\n\t\t}\n\t\tcatch( Exception $e ) {\n\t\t\treturn $unix_timestamp;\n\t\t}\n\t}", "function unix2tz($unix, $tz, $format = 'H:i')\n{\n // Unix timestamp is required.\n if (!empty($unix)) {\n // Create dateTime object.\n $dt = new DateTime('@' . $unix);\n\n // Set the timezone.\n $dt->setTimeZone(new DateTimeZone($tz));\n\n // Return formatted time.\n return $dt->format($format);\n\n } else {\n return false;\n }\n}", "public function toUTC() \n {\n $ts = time();\n if ($this->attributes[\"timeStamp\"])\n $ts = static::$nemesis + ((int) $this->attributes[\"timeStamp\"]);\n\n return $ts;\n }", "function getFormattedDate($timestamp, $timezone = FALSE, $dateIsUTC = TRUE)\r\n\t{\r\n\t\tif ($timezone === FALSE) {\r\n\t\t\t$timezone = Date_API::getPreferredTimezone();\r\n\t\t}\r\n\t\t$date = new Date($timestamp);\r\n\t\t// now convert to another timezone and return the date\r\n\t\tif ($dateIsUTC) {\r\n $date->convertTZById($timezone);\r\n } else {\r\n $date->setTZbyID($timezone);\r\n }\r\n\t\treturn $date->format('%a, %d %b %Y, %H:%M:%S ') . $date->tz->getShortName();\r\n\t}", "public function formatDate($timestamp)\n {\n return gmdate(\"Y-m-d\\TH:i:s\\Z\", $timestamp);\n }", "function date2usertime($ts,$date_format='ts')\n\t{\n\t\tif (empty($ts) || $date_format == 'server') return $ts;\n\n\t\treturn egw_time::server2user($ts,$date_format);\n\t}", "function dateToCal($timestamp) {\r\n\treturn date('Ymd\\THis\\Z', $timestamp);\r\n}", "public static function GetFormattedDate($unixTimeStamp){\n if (!is_nan($unixTimeStamp)){\n $date = new \\DateTime(\"@$unixTimeStamp\");\n return $date->format('Y-m-d H:i:s');\n } else {\n return null;\n }\n }", "public static function getUTCDate($format = null, $timestamp = null)\n\t{\n\t\t// init var\n\t\t$format = ($format !== null) ? (string) $format : 'Y-m-d H:i:s';\n\n\t\t// no timestamp given\n\t\tif($timestamp === null) return gmdate($format);\n\n\t\t// timestamp given\n\t\treturn gmdate($format, (int) $timestamp);\n\t}", "function gmt_time( $timestamp, $offset = 'UTC', $unix = FALSE )\n{\n\t// calc gtml 0 stamp\n\t$gmt_zero = $timestamp - (timezones($offset)*3600);\n\t// if unix = TRUE return timestamp\n\tif( $unix == TRUE )\n\t{\n\t\treturn $gmt_zero;\n\t}\n\t// else return date\n\treturn date( 'Y-m-d H:i:s', $gmt_zero );\n}", "function dateOBJ2UT($obj) {\r\n return self::returnUNIXTimestampFromMYSQL(\"{$obj['year']}-{$obj['month']}-{$obj['date']} {$obj['hour']}:{$obj['minute']}:{$obj['second']}\");\r\n }", "function returnMYSQLTimestampFromUNIX($unix_timestamp) {\r\n return date('Y-m-d H:i:s', $unix_timestamp);\r\n }", "function getFedoraFormattedDate($timestamp = null)\r\n\t{\r\n\t\tif ($timestamp == null) {\r\n\t\t\t$timestamp = Date_API::getUnixTimestamp();\r\n\t\t}\r\n\t\t$date = new Date($timestamp);\r\n\r\n\r\n\t\treturn $date->format('%Y-%m-%dT%H:%M:%SZ');\r\n\t}", "function lw_woo_gdpr_gmt_to_local( $timestamp = 0, $format = 'Y/m/d g:i:s' ) {\n\n\t\t// Bail if we don't have a timestamp to check.\n\t\tif ( empty( $timestamp ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fetch our timezone.\n\t\t$savedzone = get_option( 'timezone_string', 'GMT' );\n\n\t\t// Pull my stored time with the UTC code on it.\n\t\t$date_gmt = new DateTime( date( 'Y-m-d H:i:s', $timestamp ), new DateTimeZone( 'GMT' ) );\n\n\t\t// Now set the timezone to return the date.\n\t\t$date_gmt->setTimezone( new DateTimeZone( $savedzone ) );\n\n\t\t// Return it formatted, or the timestamp.\n\t\treturn ! empty( $format ) ? $date_gmt->format( $format ) : $date_gmt->format( 'U' );\n\t}", "function microbot_format_timestamp($ts) {\n return date('F jS, Y \\a\\t g:i a', $ts);\n}", "function wmf_common_date_civicrm_to_unix($date) {\n return DateTime::createFromFormat('Y-m-d H:i:s', $date, new DateTimeZone('UTC'))\n ->getTimestamp();\n}", "public static function getUTC(string $format = self::ATOM): string\n {\n return gmdate($format);\n }", "public static function getLocalDateTimeFromUnixTimestamp($unixt) {\n $timezone = new \\DateTimeZone(self::DEFAULT_TIME_ZONE);\n if (function_exists('wp_timezone')) {\n $timezone = wp_timezone();\n }\n\n try {\n return (new \\DateTime('@' . $unixt))->setTimezone($timezone)->format(self::DATETIME_FORMAT);\n } catch (\\Exception $e) {\n // return as-is in case of an exception\n return $unixt;\n }\n }" ]
[ "0.70660144", "0.6520721", "0.6494428", "0.64854586", "0.63965046", "0.6225736", "0.61443263", "0.6118787", "0.6099131", "0.6088138", "0.6083656", "0.6081718", "0.60744953", "0.6067287", "0.59377944", "0.5924547", "0.58746266", "0.5843762", "0.57927257", "0.57892966", "0.573606", "0.5729338", "0.5719526", "0.5714184", "0.5685058", "0.56803256", "0.56731063", "0.56146294", "0.5599261", "0.5581311" ]
0.7063048
1
This function converts file name ('foldername1/foldername2/foldername3/filename.ext') into HTML link href='foldername1/foldername2/foldername3/file.ext' text='file.ext'
function fnFileName2Link($sFileName){ $sResult = "<a href=# onclick=\"alert('@href')\">@Text</a>"; $sFileName = str_replace("//", "/", $sFileName); LW (__FILE__, __LINE__, "Input sFileName=" . $sFileName); $arrTemp = explode("/", $sFileName); $sTailFileName = $arrTemp[count($arrTemp) - 1]; $sResult = str_replace("@href", $sTailFileName, $sResult); $sResult = str_replace("@Text", $sFileName, $sResult); LW (__FILE__, __LINE__, "sResult =" . $sResult); return $sResult; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnFldrName2Link($sFolderName){\n $sResult = \"<a href=index.php?fldr=@href>@Text</a>\";\n $sFolderName = fnFldrNameChk($sFolderName);\n \n $arrTemp = explode(\"/\", $sFolderName);\n $sTailFolderName = $arrTemp[count($arrTemp) - 2];\n\n $sResult = str_replace(\"@href\", $sFolderName, $sResult);\n $sResult = str_replace(\"@Text\", $sTailFolderName, $sResult);\n return $sResult;\n}", "function make_clickable_path($path) {\n global $langRoot, $base_url, $group_sql;\n\n $cur = $out = '';\n foreach (explode('/', $path) as $component) {\n if (empty($component)) {\n $out = \"<a href='{$base_url}openDir=/'>$langRoot</a>\";\n } else {\n $cur .= rawurlencode(\"/$component\");\n $row = Database::get()->querySingle(\"SELECT filename FROM document\n WHERE path LIKE '%/$component' AND $group_sql\");\n $dirname = $row->filename;\n $out .= \" <span class='fa fa-chevron-right px-2 small-text'></span> <a href='{$base_url}openDir=$cur'>\".q($dirname).\"</a>\";\n }\n }\n return $out;\n}", "function get_url($filename, $path) {\n\t\t$output = '';\n\t\t$url = explode('/', substr(\"$path/$filename\", 1));\n\t\tforeach($url as $item) {\n\t\t\t$item = preg_replace('/^[\\d]+[_|-]/', '', $item);\n\t\t\t$item = str_replace('.md', '', $item);\n\t\t\t$output .= \"/$item\";\n\t\t}\n\t\t$output = $this->base . substr($output, 1);\n\t\t$output = strtolower($output);\n\t\treturn $output;\n\t}", "function james_file_link($variables) {\n\n $file = $variables['file'];\n $icon_directory = $variables['icon_directory'];\n\n $url = file_create_url($file->uri);\n $icon = theme('file_icon', array('file' => $file, 'icon_directory' => $icon_directory));\n\n // Set options as per anchor format described at\n // http://microformats.org/wiki/file-format-examples\n $options = array(\n 'attributes' => array(\n 'type' => $file->filemime . '; length=' . $file->filesize,\n ),\n );\n\n // Use the description as the link text if available.\n if (empty($file->description)) {\n $link_text = $file->filename;\n }\n else {\n $link_text = $file->description;\n $options['attributes']['title'] = check_plain($file->filename);\n }\n\n // return '<span class=\"file\">' . $icon . ' ' . l($link_text, $url, $options) . '</span>';\n return '<span class=\"file\">' . l($link_text, $url, $options) . '</span>';\n}", "function und_file_link($variables) {\n $file = $variables['file'];\n\n $url = file_create_url($file->uri);\n\n $options = array(\n 'attributes' => array(\n 'type' => $file->filemime . '; length=' . $file->filesize,\n ),\n );\n\n if (empty($file->description)) {\n $link_text = $file->filename;\n } else {\n $link_text = $file->description;\n $options['attributes']['title'] = check_plain($file->filename);\n }\n}", "function convert_office_files($text) {\r\n\t$pattern = '/(<a.*href\\s*=\\s*[\\'\"])(.*?)([\\'\"].*a>)/i';\r\n\t$text = preg_replace_callback($pattern, 'modify_link', $text);\r\n\treturn $text;\r\n}", "public function fileLink($filename, $url = array(), $attributes = array()) {\n\t\t$url = array_merge($this->_defaultUrl['file'], $url);\n\t\t$trimmedFile = $this->trimFileName($filename);\n\t\tif (!empty($trimmedFile) && $trimmedFile != $filename) {\n\t\t\t$url = array_merge($url, explode('/', $trimmedFile));\n\t\t\treturn $this->Html->link($trimmedFile, $url, $attributes);\n\t\t}\n\t\treturn $filename;\n\t}", "function link_a($dir,$cont){\r\n return \"<a href=\\\"$dir\\\">$cont</a>\";\r\n }", "function convert_url_to_html($url)\n{\n $url_prefix = \"<a href =\\\"\" . $url . \"\\\" target=\\\"_blank\\\">\";\n $url_suffix = \"</a>\";\n \n $url = $url_prefix . $url . $url_suffix;\n \n return $url;\n}", "function htmlOutput(array $files){\n ?><ul><?php\n foreach($files as $key=>$val){\n ?>\n <li><a target=\"_blank\" class=\"link\" href=\"<?php echo $val['url']; ?>\"><?php echo $val['file']; ?></a></li>\n <?php\n }\n ?></ul><?php\n}", "function makeGoLink($filename, $title=\"Go!\"){\n $html .= \n '<a href=\"'.$_SERVER['APPLICATION_PREPEND'].$filename.'\" '.\n 'title=\"'.$title.'\">'.\n '<img src=\"'.APP_IMAGES_DIR.'bullet_go_arrow.gif\" alt=\"Go!\" />'.\n '</a>';\n return $html;\n }", "public function linkIt(string $item):string\n {\n $link = $this->_path . DIRECTORY_SEPARATOR . $item;\n\n if (is_dir($link . DIRECTORY_SEPARATOR . 'public_html')) :\n $link = $link . DIRECTORY_SEPARATOR . 'public_html';\n endif;\n\n return sprintf(\n \"<a href=\\\"%s\\\" target=\\\"_blank\\\">%s</a>\", \n $link, \n ucfirst($item)\n );\n }", "public static function filenameToUrl($path): string\n {\n $path = str_replace(self::INDEX_ALIAS, '/', $path);\n $path = pathinfo($path);\n $path['filename'] = preg_replace('/__$/', '', $path['filename']);\n $path['filename'] = preg_replace('/__(.+?)$/', '?$1', $path['filename']);\n if($path['dirname'] == '.') $path['dirname'] = '/';\n\n $url = $path['dirname'] . '/' . $path['filename'];\n $url = trim($url, '/');\n if($url == '') $url = '/';\n\n return $url;\n }", "function createDownloadLink($element, $entry_id, $fileName, $displayName) {\n $ele_value = $element->getVar('ele_value');\n if($ele_value[2]) {\n return \"<a href='\".XOOPS_URL.\"/uploads/formulize_\".$element->getVar('id_form').\"_\".$entry_id.\"_\".$element->getVar('ele_id').\"/$fileName' target='_blank'>\".htmlspecialchars(strip_tags($displayName),ENT_QUOTES).\"</a>\"; \n } else {\n return \"<a href='\".XOOPS_URL.\"/modules/formulize/download.php?element=\".$element->getVar('ele_id').\"&entry_id=$entry_id'>\".htmlspecialchars(strip_tags($displayName),ENT_QUOTES).\"</a>\";\n }\n }", "function getFileLinkHTML()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\n\t\tif (!is_object($this->uploaded_file))\n\t\t{\n\t\t\t$tpl = new ilTemplate(\"tpl.link_file.html\", true, true, \"Services/Link\");\n\t\t\t$tpl->setCurrentBlock(\"form\");\n\t\t\t$tpl->setVariable(\"FORM_ACTION\",\n\t\t\t\t$ilCtrl->getFormAction($this, \"saveFileLink\", \"\", true));\n\t\t\t$tpl->setVariable(\"TXT_SELECT_FILE\", $lng->txt(\"cont_select_file\"));\n\t\t\t$tpl->setVariable(\"TXT_SAVE_LINK\", $lng->txt(\"cont_create_link\"));\n\t\t\t$tpl->setVariable(\"CMD_SAVE_LINK\", \"saveFileLink\");\n\t\t\tinclude_once(\"./Services/Form/classes/class.ilFileInputGUI.php\");\n\t\t\t$fi = new ilFileInputGUI(\"\", \"link_file\");\n\t\t\t$fi->setSize(15);\n\t\t\t$tpl->setVariable(\"INPUT\", $fi->getToolbarHTML());\n\t\t\t$tpl->parseCurrentBlock();\n\t\t\treturn $tpl->get();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tpl = new ilTemplate(\"tpl.link_file.html\", true, true, \"Services/Link\");\n\t\t\t$tpl->setCurrentBlock(\"link_js\");\n//\t\t\t$tpl->setVariable(\"LINK_FILE\",\n//\t\t\t\t$this->prepareJavascriptOutput(\"[iln dfile=\\\"\".$this->uploaded_file->getId().\"\\\"] [/iln]\")\n//\t\t\t\t);\n\t\t\t$tpl->setVariable(\"TAG_B\",\n\t\t\t\t'[iln dfile=\\x22'.$this->uploaded_file->getId().'\\x22]');\n\t\t\t$tpl->setVariable(\"TAG_E\",\n\t\t\t\t\"[/iln]\");\n\t\t\t$tpl->setVariable(\"TXT_FILE\",\n\t\t\t\t$this->uploaded_file->getTitle());\n//\t\t\t$tpl->parseCurrentBlock();\n\t\t\treturn $tpl->get();\n\t\t}\t\t\n\t}", "public function link(): string {\n return telegram::fileLink($this->file_id);\n }", "public function getUrl(YaPhpDoc_Token_File $token)\n\t{\n\t\t# Normalize directory separator to \"/\"\n\t\t$name = $token->getFilename();\n\t\tif(DIRECTORY_SEPARATOR != '/')\n\t\t\t$name = str_replace(DIRECTORY_SEPARATOR, '/', $name);\n\t\t\n\t\t# Normalize special characters\n\t\t$name = preg_replace(\n\t\t\tarray('`[^a-zA-Z0-9/]+`', '`\\s+`'),\n\t\t\tarray('_', '-'),\n\t\t\t$name);\n\t\t\n\t\t# Find URL\n\t\tif($name[0] == '/')\n\t\t\treturn 'files'.$name.'.html';\n\t\telse\n\t\t\treturn 'files/'.$name.'.html';\n\t}", "static function get_link($link, $dir, $url){\n \tif(empty($link['url'])) return '#';\n\n \t// proceed\n \t$link_url = trim(str_replace('{{files}}', self::$root . 'content/custom/files', $link['url']));\n\t\t$ext = pathinfo($link_url, PATHINFO_EXTENSION);\n\t\t$ext = !empty($ext);\n\t\t$abs = stripos($link_url, 'http') === 0;\n\n\t\t# add root path if relative url\n\t\tif($link_url[0] !== '/' && !$abs) {\n\t\t\treturn $ext ? self::$root . trim($dir, './') . '/' . $link_url : $url . rtrim($link_url, '/') . '/';\n\n\t\t# Ensure trailing slash for root-relative urls\n\t\t} else if(!$ext && $link_url[0] === '/'){\n\t\t\treturn rtrim($link_url, '/') . '/';\n\n\t\t# Update $url\n\t\t} else {\n\t\t\treturn $link_url;\n\t\t}\n }", "function do_html_URL($url, $name)\r\n\t{\r\n\t // output URL as link and br\r\n?>\r\n <br /><a href=\"<?php echo $url;?>\"><?php echo $name;?></a><br />\r\n<?php\r\n\t}", "function linkToFile($type){\n\tglobal $record, $folder;\n\tif (sizeof(glob(\"$folder/\".$record[\"oid\"].$type.\".*\"))>0){\n\t\treturn '<a href=\"home.php?file='.$type.'\">Current File</a>';\n\t}\n}", "function link_to($path, $name)\r\n\t{\r\n\t\t\r\n\t\t$num_args = func_num_args();\r\n\t\t$print = true;\r\n\r\n\t\tif ($num_args > 2)\r\n\t\t{\r\n\t\t\tif (func_get_arg(2) != false)\r\n\t\t\t{\r\n\t\t\t\t$class = func_get_arg(2);\r\n\r\n\t\t\t\techo '<a href=\"' . ROOT . $path . '\"';\r\n\t\t\t\tif (isset($class)) echo ' class=\"' . $class . '\"';\r\n\t\t\t\techo '>' . $name . '</a>';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$html = '<a href=\"' . ROOT . $path . '\"';\r\n\t\t\t\t$html .= '>' . $name . '</a>';\r\n\r\n\t\t\t\treturn $html;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\techo '<a href=\"' . ROOT . $path . '\"';\r\n\t\t\techo '>' . $name . '</a>';\r\n\t\t}\t\t\r\n\r\n\t\t\r\n\t}", "function path2url($file_path) \n {\n $file_path=str_replace('\\\\','/',$file_path);\n $file_path=str_replace(' ', '%20',$file_path);\n $file_path=str_replace($_SERVER['DOCUMENT_ROOT'],'',$file_path);\n $file_path='http://'.$_SERVER['HTTP_HOST'].'/'.$file_path;\n return $file_path;\n // return $Protocol.$_SERVER['HTTP_HOST'].str_replace($_SERVER['DOCUMENT_ROOT'], '', realpath($file));\n }", "function Installer_url_to_link($text){\n $text = str_replace( \"www\\.\", \"http://www.\", $text );\n // eliminate duplicates after force\n $text = str_replace( \"http://http://www\\.\", \"http://www.\", $text );\n $text = str_replace( \"https://http://www\\.\", \"https://www.\", $text );\n\n // The Regular Expression filter\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n // Check if there is a url in the text\n if(preg_match($reg_exUrl, $text, $url)) {\n // make the urls hyper links\n $text = preg_replace($reg_exUrl, '<a href=\"'.$url[0].'\" onclick=\"window.open(this.href); return false;\">'.$url[0].'</a>', $text);\n } // if no urls in the text just return the text\n return ($text);\n}", "function linkFormat($text){\n\t$formatted_text = str_replace(\"/\",\"-\",str_replace(\" \",\"-\",str_replace(\"'\",\"\",str_replace('\"','',str_replace(\"&\",\"and\",stripslashes($text))))));\n\treturn urlencode($formatted_text);\n}", "function do_html_URL($url, $name) {\r\n?>\r\n <a href=\"<?php echo htmlspecialchars($url); ?>\"><?php echo htmlspecialchars($name); ?></a><br />\r\n<?php\r\n}", "function file_create_url($path) {\n if (strpos($path, variable_get('file_directory_path', 'files')) !== false) {\n $path = trim(substr($path, strlen(variable_get('file_directory_path', 'files'))), '\\\\/');\n }\n switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {\n case FILE_DOWNLOADS_PUBLIC:\n global $base_url;\n return $base_url .'/'. variable_get('file_directory_path', 'files') .'/'. str_replace('\\\\', '/', $path);\n case FILE_DOWNLOADS_PRIVATE:\n return url('system/files', 'file='. $path);\n }\n}", "public function webFileLink($str)\n\t\t{\n\n\t\t}", "function print_project_files() {\n global $g_proj;\n $link1 = '<a class=\"w3-bar-item w3-button w3-round-large w3-hover-shadow';\n $link2 = ' src\" href=\"';\n\n // Ignore subdirectories (can be used for includes in php file)\n $files = lecture_files(PATH_MAIN . PROJECTS_FOLDER[0], true);\n\n foreach ($files as $file) {\n $f = substr($file, 0, -4);\n\n echo $link1 . ($f == $g_proj\n ? ' w3-light-gray w3-border w3-border-light-grey w3-hover-border-blue-grey'\n : '') . $link2 . PATH_WEB .'?'. PROJECTS_FOLDER[1] .'='. $f .'\">'\n . $f .'</a>'. \"\\n\";\n }\n}", "function do_html_URL($url, $name) {\n echo \"<br /><a href='$url' > $name </a><br />\\n\";\n}", "function rootLinks($path){\n\t$id='';\n\t$path=explode('/',$path);\n\tfor ($i=0 ; $i<sizeof($path); $i++) { \n\t\t$id .= $path[$i].'@';\n\t\tif($i==0){\n\t\t\t$path[$i]='<span\" id=\"'.$id.'\">'.$path[$i].'</span>';\n\t\t}else{\n\t\t\t$path[$i]='<a class=\"folder\" id=\"'.$id.'\">'.$path[$i].'</a>';\n\t\t}\n\t}\n\t$pathWithLinks=implode('/', $path);\n\treturn $pathWithLinks;\n}" ]
[ "0.7175321", "0.66876173", "0.658344", "0.65779686", "0.63293046", "0.62574434", "0.62215453", "0.61435544", "0.61062974", "0.60248893", "0.5999972", "0.59918267", "0.59570974", "0.5939296", "0.58266824", "0.57836205", "0.5740251", "0.5729248", "0.5685531", "0.5665319", "0.56395", "0.56158316", "0.5590456", "0.5578726", "0.55737424", "0.5553984", "0.5550023", "0.55327994", "0.5524872", "0.551938" ]
0.7116583
1
This function converts folder name ('foldername1/foldername2/foldername3/') into HTML link href='foldername1/foldername2/foldername3/' text='foldername3'
function fnFldrName2Link($sFolderName){ $sResult = "<a href=index.php?fldr=@href>@Text</a>"; $sFolderName = fnFldrNameChk($sFolderName); $arrTemp = explode("/", $sFolderName); $sTailFolderName = $arrTemp[count($arrTemp) - 2]; $sResult = str_replace("@href", $sFolderName, $sResult); $sResult = str_replace("@Text", $sTailFolderName, $sResult); return $sResult; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rootLinks($path){\n\t$id='';\n\t$path=explode('/',$path);\n\tfor ($i=0 ; $i<sizeof($path); $i++) { \n\t\t$id .= $path[$i].'@';\n\t\tif($i==0){\n\t\t\t$path[$i]='<span\" id=\"'.$id.'\">'.$path[$i].'</span>';\n\t\t}else{\n\t\t\t$path[$i]='<a class=\"folder\" id=\"'.$id.'\">'.$path[$i].'</a>';\n\t\t}\n\t}\n\t$pathWithLinks=implode('/', $path);\n\treturn $pathWithLinks;\n}", "function make_clickable_path($path) {\n global $langRoot, $base_url, $group_sql;\n\n $cur = $out = '';\n foreach (explode('/', $path) as $component) {\n if (empty($component)) {\n $out = \"<a href='{$base_url}openDir=/'>$langRoot</a>\";\n } else {\n $cur .= rawurlencode(\"/$component\");\n $row = Database::get()->querySingle(\"SELECT filename FROM document\n WHERE path LIKE '%/$component' AND $group_sql\");\n $dirname = $row->filename;\n $out .= \" <span class='fa fa-chevron-right px-2 small-text'></span> <a href='{$base_url}openDir=$cur'>\".q($dirname).\"</a>\";\n }\n }\n return $out;\n}", "function link_a($dir,$cont){\r\n return \"<a href=\\\"$dir\\\">$cont</a>\";\r\n }", "public function linkIt(string $item):string\n {\n $link = $this->_path . DIRECTORY_SEPARATOR . $item;\n\n if (is_dir($link . DIRECTORY_SEPARATOR . 'public_html')) :\n $link = $link . DIRECTORY_SEPARATOR . 'public_html';\n endif;\n\n return sprintf(\n \"<a href=\\\"%s\\\" target=\\\"_blank\\\">%s</a>\", \n $link, \n ucfirst($item)\n );\n }", "function fnFileName2Link($sFileName){\n $sResult = \"<a href=# onclick=\\\"alert('@href')\\\">@Text</a>\";\n $sFileName = str_replace(\"//\", \"/\", $sFileName);\n LW (__FILE__, __LINE__, \"Input sFileName=\" . $sFileName);\n\n $arrTemp = explode(\"/\", $sFileName);\n $sTailFileName = $arrTemp[count($arrTemp) - 1];\n\n $sResult = str_replace(\"@href\", $sTailFileName, $sResult);\n $sResult = str_replace(\"@Text\", $sFileName, $sResult);\n LW (__FILE__, __LINE__, \"sResult =\" . $sResult);\n\n return $sResult;\n}", "function convert_url_to_html($url)\n{\n $url_prefix = \"<a href =\\\"\" . $url . \"\\\" target=\\\"_blank\\\">\";\n $url_suffix = \"</a>\";\n \n $url = $url_prefix . $url . $url_suffix;\n \n return $url;\n}", "public function url(): string\n {\n return '/folders/' . $this->folder_id;\n }", "function mbtng_folder_trailingslashit ($folder) {\r\n\tif (mbtng_is_windows())\r\n\t\treturn rtrim($folder, '\\\\').'\\\\';\r\n\telse\r\n\t\treturn trailingslashit($folder);\r\n}", "function getLinkPath($class=\"\") {\n\t\tglobal $dbi;\n\n\t\t$parent = null;\n\t\tif (empty($this->parent)) $parent = new Folder();\n\t\telse $parent = $this->parent;\n\t\tif($this->id!=0) return $parent->getLinkPath($class).\" / <a href=\\\"\".scriptUrl.\"/\".folderFilesAdmin.\"/\".fileFilesIndex.\"?folderId=\".$this->id.\"\\\"\".(!empty($class)?\" class=\\\"$class\\\"\":\"\").\">\".$this->name.\"</a>\";\n\t\telse return \"\";\n\t}", "function breadcrumb($dir, $file = false)\n {\n $pieces = explode(\"/\", $dir);\n $count = count($pieces);\n $folder = $this->get_all_dirs();\n $result = '<a href=\"' . ROOT_DIR . '\">' . TITLE . '</a>';\n $path = '';\n\n for ($idx = 0; $idx < $count; $idx++)\n {\n if (!$folder)\n continue;\n\n foreach ($folder as $key => $val)\n {\n if (!strcasecmp($key, $pieces[$idx]))\n {\n $path .= '/' . $key;\n\n $crumb = util::coalesce(trim($val['caption']), $key);\n if($idx < $count - 1 || $file)\n $crumb = '<a href=\"/' . util::combine(ROOT_DIR, $path) . '/\">' . $crumb . '</a>';\n\n $result .= ' &raquo; ' . $crumb;\n $folder = $val['subs'];\n break;\n }\n }\n }\n\n if($file)\n $result .= ' &raquo; ' . $file;\n\n return $result;\n }", "function link_to($path, $name)\r\n\t{\r\n\t\t\r\n\t\t$num_args = func_num_args();\r\n\t\t$print = true;\r\n\r\n\t\tif ($num_args > 2)\r\n\t\t{\r\n\t\t\tif (func_get_arg(2) != false)\r\n\t\t\t{\r\n\t\t\t\t$class = func_get_arg(2);\r\n\r\n\t\t\t\techo '<a href=\"' . ROOT . $path . '\"';\r\n\t\t\t\tif (isset($class)) echo ' class=\"' . $class . '\"';\r\n\t\t\t\techo '>' . $name . '</a>';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$html = '<a href=\"' . ROOT . $path . '\"';\r\n\t\t\t\t$html .= '>' . $name . '</a>';\r\n\r\n\t\t\t\treturn $html;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\techo '<a href=\"' . ROOT . $path . '\"';\r\n\t\t\techo '>' . $name . '</a>';\r\n\t\t}\t\t\r\n\r\n\t\t\r\n\t}", "protected function buildLinkByGroup($group)\n {\n if(isset($this->groups[$group])){\n $dir = $this->groups[$group];\n }else{\n $dir = '/';\n }\n return \\URL::to($dir);\n }", "function do_html_URL($url, $name)\r\n\t{\r\n\t // output URL as link and br\r\n?>\r\n <br /><a href=\"<?php echo $url;?>\"><?php echo $name;?></a><br />\r\n<?php\r\n\t}", "private static function get_link(string $value) : string {\n if(preg_match('/https?:\\/\\//', $value) == 1) {\n return $value;\n } else {\n //build link\n $url_array = explode(DS, $value);\n $controller_name = ucwords($url_array[0]);\n $action_name = (isset($url_array[1])) ? $url_array[1] : '';\n //check for access\n if(self::has_access($controller_name, $action_name)) {\n return PROJECTROOT.$value;\n }\n return '';\n }\n }", "function make_link($linkName) {\n \n \n\n echo '<div id=\"admin_menu_box\">\n <div class=\"admin_menu_item\">\n <a href=\"' . $linkname . '\">Volunteer Hours</a>\n <div>Enter volunteer hours worked</div>\n </div>';\n\n\n\n}", "function linkify($revision, $path) {\n $items = explode(\"/\",$revision.$path);\n $linked = array();\n $current_dir = \"\";\n \n $delimiter = define(PATH_INFO_THROUGH_QUERY_STRING) && PATH_INFO_THROUGH_QUERY_STRING ? '?' : '&';\n foreach ($items as $key=>$item) {\n if ($key == 0) {\n $linked[$key] = '<a href=\"'.$this->active_repository->getBrowseurl(). $delimiter . 'r='.$revision.'\">'.$revision.'</a>';\n }\n elseif (!isset($items[$key+1])) {\n $linked[$key] = $item;\n }\n else {\n $current_dir .= '/'.$item;\n $linked[$key] = '<a href=\"'.$this->active_repository->getBrowseUrl(). $delimiter . 'path='.$current_dir.'&amp;r='.$revision.'\">'.$item.'</a>';\n }\n }\n \n return \"/\".implode(\"/\", $linked);\n }", "function makeGoLink($filename, $title=\"Go!\"){\n $html .= \n '<a href=\"'.$_SERVER['APPLICATION_PREPEND'].$filename.'\" '.\n 'title=\"'.$title.'\">'.\n '<img src=\"'.APP_IMAGES_DIR.'bullet_go_arrow.gif\" alt=\"Go!\" />'.\n '</a>';\n return $html;\n }", "function portal_linkify($portal, $revision, $path) {\n \t$items = explode(\"/\", $revision.$path);\n \t$linked = array();\n \t$current_dir = \"\";\n \t\n \t$delimiter = define(PATH_INFO_THROUGH_QUERY_STRING) && PATH_INFO_THROUGH_QUERY_STRING ? '?' : '&';\n \tforeach($items as $key => $item) {\n \t\tif($key == 0) {\n \t\t\t$linked[$key] = '<a href=\"'.$this->active_repository->getPortalBrowseUrl($portal).$delimiter.'r='.$revision.'\">'.$revision.'</a>';\n \t\t} elseif(!isset($items[$key + 1])) {\n \t\t\t$linked[$key] = $item;\n \t\t} else {\n \t\t\t$current_dir .= '/'.$item;\n \t\t\t$linked[$key] = '<a href=\"'.$this->active_repository->getPortalBrowseUrl($portal).$delimiter.'path='.$current_dir.'&amp;r='.$revision.'\">'.$item.'</a>';\n \t\t} // if\n \t} // foreach\n \t\n \treturn \"/\".implode(\"/\", $linked);\n }", "function swd($p){\n\t$ps = explode(DIRECTORY_SEPARATOR,$p);\n\t$pu = \"\";\n\tfor($i = 0 ; $i < sizeof($ps)-1 ; $i++){\n\t\t$pz = \"\";\n\t\tfor($j = 0 ; $j <= $i ; $j++) $pz .= $ps[$j].DIRECTORY_SEPARATOR;\n\t\t$pu .= \"<a href=\\\"?d=\".$pz.\"\\\">\".$ps[$i].\" \".DIRECTORY_SEPARATOR.\" </a>\";\n\t}\n\treturn trim($pu);\n}", "function Installer_url_to_link($text){\n $text = str_replace( \"www\\.\", \"http://www.\", $text );\n // eliminate duplicates after force\n $text = str_replace( \"http://http://www\\.\", \"http://www.\", $text );\n $text = str_replace( \"https://http://www\\.\", \"https://www.\", $text );\n\n // The Regular Expression filter\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\n // Check if there is a url in the text\n if(preg_match($reg_exUrl, $text, $url)) {\n // make the urls hyper links\n $text = preg_replace($reg_exUrl, '<a href=\"'.$url[0].'\" onclick=\"window.open(this.href); return false;\">'.$url[0].'</a>', $text);\n } // if no urls in the text just return the text\n return ($text);\n}", "function linkFormat($text){\n\t$formatted_text = str_replace(\"/\",\"-\",str_replace(\" \",\"-\",str_replace(\"'\",\"\",str_replace('\"','',str_replace(\"&\",\"and\",stripslashes($text))))));\n\treturn urlencode($formatted_text);\n}", "public function get_slug_with_link ()\n {\n $slug = $this->get_slug ();\n $slug_with_path = $this->get_slug_with_path ();\n return \"<a href='/$slug_with_path'>$slug</a>\";\n }", "static function get_link($link, $dir, $url){\n \tif(empty($link['url'])) return '#';\n\n \t// proceed\n \t$link_url = trim(str_replace('{{files}}', self::$root . 'content/custom/files', $link['url']));\n\t\t$ext = pathinfo($link_url, PATHINFO_EXTENSION);\n\t\t$ext = !empty($ext);\n\t\t$abs = stripos($link_url, 'http') === 0;\n\n\t\t# add root path if relative url\n\t\tif($link_url[0] !== '/' && !$abs) {\n\t\t\treturn $ext ? self::$root . trim($dir, './') . '/' . $link_url : $url . rtrim($link_url, '/') . '/';\n\n\t\t# Ensure trailing slash for root-relative urls\n\t\t} else if(!$ext && $link_url[0] === '/'){\n\t\t\treturn rtrim($link_url, '/') . '/';\n\n\t\t# Update $url\n\t\t} else {\n\t\t\treturn $link_url;\n\t\t}\n }", "function convert_office_files($text) {\r\n\t$pattern = '/(<a.*href\\s*=\\s*[\\'\"])(.*?)([\\'\"].*a>)/i';\r\n\t$text = preg_replace_callback($pattern, 'modify_link', $text);\r\n\treturn $text;\r\n}", "function htmlOutput(array $files){\n ?><ul><?php\n foreach($files as $key=>$val){\n ?>\n <li><a target=\"_blank\" class=\"link\" href=\"<?php echo $val['url']; ?>\"><?php echo $val['file']; ?></a></li>\n <?php\n }\n ?></ul><?php\n}", "function do_html_URL($url, $name)\n{\n?>\n <br><a href=\"<?php echo $url;?>\"><?php echo $name;?></a><br>\n<?php\n}", "function do_html_URL($url, $name) {\n echo \"<br /><a href='$url' > $name </a><br />\\n\";\n}", "function joinPath() {\n $path = '';\n $arguments = func_get_args();\n $args = array();\n foreach($arguments as $a) if($a !== '') $args[] = $a;//Removes the empty elements\n\n $arg_count = count($args);\n for($i=0; $i<$arg_count; $i++) {\n\t $folder = $args[$i];\n\n\t //Remove the first char if it is a '/' - and its not in the first argument\n\t if($i != 0 and $folder[0] == DIRECTORY_SEPARATOR) $folder = substr($folder,1);\n\n\t //Remove the last char - if its not in the last argument\n\t if($i != $arg_count-1 and substr($folder,-1) == DIRECTORY_SEPARATOR) $folder = substr($folder,0,-1);\n\n\t $path .= $folder;\n\t if($i != $arg_count-1) $path .= DIRECTORY_SEPARATOR; //Add the '/' if its not the last element.\n }\n return $path;\n }", "function href ($link, $text) {\nreturn \"<a class=\\\"charList\\\" href=\\\"$link\\\">$text</a>\";\n}", "function get_url($filename, $path) {\n\t\t$output = '';\n\t\t$url = explode('/', substr(\"$path/$filename\", 1));\n\t\tforeach($url as $item) {\n\t\t\t$item = preg_replace('/^[\\d]+[_|-]/', '', $item);\n\t\t\t$item = str_replace('.md', '', $item);\n\t\t\t$output .= \"/$item\";\n\t\t}\n\t\t$output = $this->base . substr($output, 1);\n\t\t$output = strtolower($output);\n\t\treturn $output;\n\t}" ]
[ "0.662944", "0.6606028", "0.6312175", "0.62288177", "0.60041744", "0.5921931", "0.5785432", "0.57791656", "0.5709357", "0.57086456", "0.5664128", "0.5587628", "0.5568258", "0.5568002", "0.5539478", "0.5504892", "0.54896486", "0.54720926", "0.5467611", "0.5459815", "0.54432184", "0.5414953", "0.5413145", "0.54043597", "0.5380622", "0.5378932", "0.53717583", "0.535872", "0.5358104", "0.5357693" ]
0.7722851
0
Load Theme Global Scripts
function load_theme_scripts() { wp_enqueue_script( 'script', get_template_directory_uri() . '/js/bundle.min.js#asyncload', [], false, true ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFiles() {\n wp_enqueue_style('main.style', get_stylesheet_uri());\n wp_enqueue_script('main.js', get_theme_file_uri('app.js', NULL, '1.0', true));\n}", "function _add_scripts() {\n\t\t\tif (is_admin()) return;\n\t\t\twp_enqueue_script('modernizr', get_stylesheet_directory_uri() .'/bower_components/modernizer/modernizr.js', array(), '2.8.2');\n\t\t\twp_enqueue_script('theme.app', get_stylesheet_directory_uri() .'/js/min/app.min.js', array('jquery','modernizr'), '0.1.0', true);\n\t\t\twp_localize_script('theme.app', 'theme', $this->_add_js_vars()); // Call _add_js_vars() to add PHP variables to frontend\n\t\t}", "function load_theme_script()\n{\n\twp_enqueue_script( 'theme-general-script', get_template_directory_uri() . '/js/general.js', array( 'jquery' ), '', true );\n\n\n}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "function bbp_load_theme_functions()\n{\n}", "private function register_scripts_and_styles() {\n if (is_admin()) {\n $this->load_file(self::slug . '-admin-style', '/css/admin.css');\n $this->load_file( self::slug . '-moment-js', '/js/moment-with-locales.min.js',true );\n \n \n } //is_admin()\n else {\n } // end if/else\n }", "function childtheme_script_manager() {\n // registers modernizr script, childtheme path, no dependency, no version, loads in header\n wp_register_script('modernizr-js', get_stylesheet_directory_uri() . '/js/modernizr.js', false, false, false);\n // registers fitvids script, local childtheme path, yes dependency is jquery, no version, loads in footer\n wp_register_script('fitvids-js', get_stylesheet_directory_uri() . '/js/jquery.fitvids.js', array('jquery'), false, true);\n // registers misc custom script, childtheme path, yes dependency is jquery, no version, loads in footer\n wp_register_script('custom-js', get_stylesheet_directory_uri() . '/js/custom.js', array('jquery'), false, true);\n\n // enqueue the scripts for use in theme\n wp_enqueue_script ('modernizr-js');\n wp_enqueue_script ('fitvids-js');\n wp_enqueue_script ('custom-js');\n\n if ( is_front_page() ) {\n // example of conditional loading, if you only use a script or style on one page, load it conditionally!\n }\n}", "function my_theme_files() {\n\n // Scripts\n wp_enqueue_script(\n 'my_theme_main_scripts',\n get_theme_file_uri(\"/js/scripts-bundled.js\"),\n NULL,\n microtime(),\n true\n );\n \n // Nos permite usar variables en el fichero pasado como primer argumento. Para acceder al root_url en javascript\n wp_localize_script( 'my_theme_main_scripts', 'themeData', array(\n 'root_url' => get_site_url(),\n 'nonce' => wp_create_nonce('wp_rest')\n ));\n // si tuviesemos que cargar jquery\n // wp_enqueue_script(\n // 'my_theme_main_scripts',\n // get_theme_file_uri(\"/js/scripts-bundled.js\"),\n // array('jquery'),\n // 1.0,\n // true\n // );\n\n wp_enqueue_style( 'custom-google-fonts', '//fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i|Roboto:100,300,300i,400,,400i,700,700i');\n\n // Font awesome\n wp_enqueue_style(\n 'font-awesome',\n 'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'\n );\n\n // style.css\n wp_enqueue_style(\n 'my_theme_main_styles',\n get_stylesheet_uri(),\n NULL,\n microtime()\n );\n }", "function theme_scripts() {\n\t// Load Main Script\n\twp_enqueue_script( 'theme-script', get_template_directory_uri() . '/js/main.js', array( 'jquery' ), '', true );\n}", "function symmetri_init_scripts() {\n\n\t\t// Project fonts\n\t\twp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:100,300,400,700|Playfair+Display:400,700');\n\n\t\tif ( ! is_admin() ):\n\n\t\t\t// Project main CSS\n\t\t\twp_enqueue_style( 'main', get_template_directory_uri() . '/css/style.css', null, '1.0', 'all' );\n\n\t\t\t// Handles grid layout\n\t\t\twp_enqueue_script( 'masonry', '//unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js', '', '4.1.1', true );\n\n\t\t\t// Handles cookie notification, grid setup and fixed menu\n\t\t\twp_enqueue_script( 'main', get_template_directory_uri() . '/js/main.js', '', null, true );\n\n\t\tendif;\n\n\t}", "function echotheme_general_javascript()\n{\n\twp_enqueue_script('bootstrap');\n\twp_enqueue_script('general');\n}", "function theme_files(){\n wp_enqueue_script('ajax-js','https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js',NULL,'1.0',true);\n wp_enqueue_script('popper-js','https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js',NULL,'1.0',true);\n wp_enqueue_script('bootstrap-js','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js',NULL,'1,0',true);\n wp_enqueue_script('font-awesome-kit','https://kit.fontawesome.com/dcf3d07c5a.js',NULL,'1.0',true);\n wp_enqueue_script('custom-js',get_theme_file_uri('/assets/js/script.js'),'NULL','1.0',true);\n\n /* Activate Stylesheets */\n wp_enqueue_style('theme_main_styles', get_stylesheet_uri());\n wp_enqueue_style('bootstrap-css','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css');\n wp_enqueue_style('responsive-css', get_template_directory_uri().'/assets/css/responsive.css');\n }", "function echotheme_scripts()\n{\n\t// Bootstrap\n\twp_register_script(\n\t\t'bootstrap',\n\t\tget_template_directory_uri() . '/js/bootstrap.min.js',\n\t\tarray('jquery'),\n\t\tTHEME_VERSION\n\t);\n\t\n\t// Easing\n\twp_register_script(\n\t\t'jquery-easing', \n\t\tget_template_directory_uri() . '/js/jquery.easing.js', \n\t\tarray('jquery'), \n\t\tTHEME_VERSION\n\t);\n\t\n\t// HoverIntent\n\twp_register_script(\n\t\t'hoverintent', \n\t\tget_template_directory_uri() . '/inc/scripts/superfish/js/hoverIntent.js', \n\t\tarray('jquery'),\n\t\tTHEME_VERSION\n\t);\n\t\n\t// Superfish\n\twp_register_script(\n\t\t'superfish', \n\t\tget_template_directory_uri() . '/inc/scripts/superfish/js/superfish.js', \n\t\tarray('hoverintent'),\n\t\tTHEME_VERSION\n\t);\n\t\n\t// Isotope\n\twp_register_script(\n\t\t'isotope', \n\t\tget_template_directory_uri() . '/inc/scripts/isotope/jquery.isotope.min.js', \n\t\tarray('jquery'),\n\t\tTHEME_VERSION\n\t);\n\t\n\t// ShadowBox\n\twp_register_script(\n\t\t'shadowbox', \n\t\tget_template_directory_uri() . '/inc/scripts/shadowbox/shadowbox.js', \n\t\tarray('jquery'),\n\t\tTHEME_VERSION\n\t);\n\t\n\t// General\n\twp_register_script(\n\t\t'general', \n\t\tget_template_directory_uri() . '/js/general.js', \n\t\tarray('jquery'),\n\t\tTHEME_VERSION\n\t);\n}", "function load_tmq_theme_scripts() {\r\n\t\t// register javascripts\r\n\t\twp_register_script('jquery', get_template_directory_uri() . '/js/jquery.min.js', array(), '1.10.2');\r\n\t\twp_register_script('migrate', get_template_directory_uri() . '/js/jquery.migrate.js', array(), '1.0', true);\r\n\t\twp_register_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array(), '3.0.0', true);\r\n\t\twp_register_script('retina', get_template_directory_uri() . '/js/retina-1.1.0.min.js', array(), '1.1.0', true);\r\n\t\twp_deregister_script('flexslider');\r\n\t\twp_register_script('flexslider', get_template_directory_uri() . '/js/jquery.flexslider.js', array(), '0.1', true);\r\n\t\twp_register_script('plugins-scroll', get_template_directory_uri() . '/js/plugins-scroll.js', array(), '0.1', true);\r\n\t\twp_register_script('magnific-popup', get_template_directory_uri() . '/js/jquery.magnific-popup.min.js', array(), '0.1', true);\r\n//child theme edit\r\n// \t\twp_register_script('vertikal_script', get_template_directory_uri() . '/js/script.js', array(), '1.0.1');\r\n\t\twp_register_script('vertikal_script', get_stylesheet_directory_uri() . '/js/script.js', array(), '1.5');\r\n//end child theme edit\r\n\t\twp_register_script('isotope', get_template_directory_uri() . '/js/jquery.isotope.min.js', array(), '1.0', true);\r\n\t\twp_register_script('imagesloaded', get_template_directory_uri() . '/js/jquery.imagesloaded.min.js', array(), '1.0', true);\r\n\t\twp_register_script('style_switcher', get_template_directory_uri() . '/js/style_switcher.js', array(), '1.0', true);\r\n\t\twp_register_script('respond', get_template_directory_uri() . '/js/respond.min.js', array(), '1.0');\r\n\t\twp_register_script('hoverintent', get_template_directory_uri() . '/js/hoverIntent.js', array(), '1.0');\r\n\t\twp_register_script('superfish', get_template_directory_uri() . '/js/superfish.js', array(), '1.0');\r\n\r\n\t\tif (!is_admin()) {\r\n\t\t\t// Enqueue Some of Theme Scripts in the Header\r\n\t\t\twp_enqueue_script('jquery');\r\n\t\t\twp_enqueue_script('vertikal_script');\r\n\t\t\twp_enqueue_script('respond');\r\n\t\t\twp_enqueue_script('hoverintent');\r\n\t\t\twp_enqueue_script('superfish');\r\n\t\t\t\r\n\t\t\t// Footer Scripts\r\n\t\t\twp_enqueue_script('migrate');\r\n\t\t\twp_enqueue_script('bootstrap');\r\n\t\t\twp_enqueue_script('retina');\r\n\t\t\twp_enqueue_script('flexslider');\r\n\t\t\twp_enqueue_script('magnific-popup');\r\n\t\t\twp_enqueue_script('imagesloaded');\r\n\t\t\twp_enqueue_script('isotope');\r\n\t\t\twp_enqueue_script( 'waypoints' );\r\n\t\t\t// We need switcher on demo not your website!\r\n\t\t\tif ( $_SERVER['SERVER_NAME'] == 'preview.themique.com' || $_SERVER['SERVER_NAME'] == 'demo.themique.com' || $_SERVER['SERVER_NAME'] == 'localhost' ) {\r\n\t\t\t\twp_enqueue_script('style_switcher');\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tif ( function_exists( 'ot_get_option' ) ) {\r\n\t\t\t\t// Enqueue plugins-scroll by condition\r\n\t\t\t\t$tmq_scrollbar = ot_get_option( 'tmq_scrollbar' );\r\n\t\t\t\tif ( $tmq_scrollbar == 'on' ) {\r\n\t\t\t\t\twp_enqueue_script('plugins-scroll');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$tmq_ajax_loader = ot_get_option( 'tmq_ajax_loader' );\r\n\t\t\t\tif ( $tmq_ajax_loader == 'on' ) {\r\n\t\t\t\t\ttmq_aws_load_scripts();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twp_localize_script(\r\n\t\t\t\t'bootstrap',\r\n\t\t\t\t'tmq_script_vars', \r\n\t\t\t\tarray( \r\n\t\t\t\t\t'plugins_scroll' \t=> tmq_scrollbartype()\r\n\t\t\t\t)\r\n\t\t\t);\t\t\t\r\n\t\t}\r\n\t}", "function load_my_scripts() {\r\n \t\t// Register AOS CSS\r\n \t\twp_enqueue_style('aos-css', get_template_directory_uri() . '/ux/vendor/aos.css', array(), null, 'screen');\r\n\r\n \t\t// Register Main CSS\r\n \t\twp_enqueue_style('main-css', get_template_directory_uri() . '/ux/css/styles.min.css', array(), null, 'screen');\r\n\r\n\t\t// Register AOS JS\r\n\t\twp_enqueue_script('aos-js', get_template_directory_uri() . '/ux/vendor/aos.js', array(), null, true);\r\n\r\n\t\t// Register Main JS\r\n\t\twp_enqueue_script('main-js', get_template_directory_uri() . '/ux/js/main.min.js', array('jquery'), null, true);\r\n\r\n\t\t// Localize Main JS for Ajax filtering\r\n\t\twp_localize_script('main-js', 'myAjax', array('ajaxURL' => admin_url('admin-ajax.php')));\r\n\t}", "function theme_scripts() {\n wp_deregister_script( 'jquery' );\n \n wp_enqueue_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js', false, '1.11.0', true);\n\n // register scripts\n wp_register_script( 'modernizr', THEME_JS . '/modernizr.min.js', array(), '1.0.0', false );\n wp_register_script( 'app-js', THEME_JS . '/app.min.js', false, '1.0.0', true );\n\n // enqueue scripts\n wp_enqueue_script('modernizr');\n wp_enqueue_script('app-js');\n \n // enqueue css\n wp_enqueue_style('app-css', THEME_CSS . '/app.css');\n \n \n \n /**\n * MAP\n */\n /*\n if ( is_page('tiendas')) {\n // Register the script first.\n wp_register_script( 'map', THEME_JS .'/app/map.js', array('jquery'), false, true);\n\n // Now we can localize the script with our data.\n $settings_array = array( 'icon_url' => THEME_IMG . '/icons/marker.png');\n \n wp_localize_script( 'map', 'settings', $settings_array );\n\n // The script can be enqueued now or later.\n wp_enqueue_script( 'map' );\n }\n */\n\n\n}", "function aihr_scripts() {\n\n\t$theme = wp_get_theme();\n\t$theme_version = $theme['Version'];\n\t \n\t\n\twp_enqueue_style('aihr-style',get_stylesheet_directory_uri() . '/assets/css/custom.css',$theme_version,true);\n\n\twp_enqueue_script('aihr-js-custom',get_stylesheet_directory_uri() . '/assets/js/custom.js',array('jquery'),$theme_version,true );\n\n\n}", "function theme_scripts() {\n\n\t// Load our main stylesheet.\n\twp_enqueue_style( 'Composer-style', get_stylesheet_uri() );\n\n\t// Load theme js\n\twp_enqueue_script( 'Composer-script', get_template_directory_uri() . '/js/composer.js', array( 'jquery' ), false, true );\n}", "function nr_load_scripts() {\n\n wp_dequeue_style('wp-block-library');\n wp_dequeue_style('wp-block-library-theme');\n\n\twp_enqueue_style('main', NR_THEME_URL.'/app.css', false, NR_VERSION);\n\twp_enqueue_style('fonts', 'https://fast.fonts.net/t/1.css?apiType=css&projectid=e0897766-a751-4fd7-89ea-7081fe24868a', false,null);\n\n\twp_deregister_script('jquery');\n\twp_deregister_script('wp-embed');\n\n\twp_register_script('jquery', NR_THEME_URL.'/js/jquery-3.3.1.min.js',null,null,true); \n\twp_enqueue_script('jquery');\n\t\t\t\t\t\t\t\t\t\n\twp_register_script('plugins', NR_THEME_URL.'/js/plugins.js','jquery',NR_VERSION,true); \n\twp_enqueue_script('plugins');\t\n\t\n\twp_register_script('site', NR_THEME_URL.'/js/site.js',array('jquery','plugins'),NR_VERSION,true); \n\twp_enqueue_script('site');\n\t\t\t\n}", "function load() {\n\tadd_action( 'after_setup_theme', __NAMESPACE__ . '\\\\setup' );\n}", "function registerThemeScripts()\n{\n\twp_register_script(\n\t\t'your-script-handle',\n\t\tget_stylesheet_directory_uri().'/assets/ajax.js',\n\t\tarray( 'jquery', ),\n\t\tfilemtime( plugin_dir_path( __FILE__ ).'assets/ajax.js' ),\n\t\tTRUE\n\t);\n}", "function scripts() {\n\n\t\t\t// CSS\n\t\t\t// Load Bootstrap.\n\t\t\twp_register_style( 'bootstrap', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/css/bootstrap.min.css' );\n\t\t\twp_enqueue_style( 'bootstrap' );\n\n\t\t\t//Load Responsive.\n\t\t\twp_register_style( 'responsive', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/css/responsive.css' );\n\t\t\twp_enqueue_style( 'responsive' );\n\n\t\t\t// Load FontAwesome.\n\t\t\twp_register_style( 'fontawesome', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/css/font-awesome.min.css' );\n\t\t\twp_enqueue_style( 'fontawesome' );\n\n\t\t\t// Load Animations\n\t\t\twp_register_style( 'animate', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/css/animate.min.css' );\n\t\t\twp_enqueue_style( 'animate' );\n\n\t\t\t// Load App CSS.\n\t\t\twp_register_style( 'maera-res', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/css/app.css' );\n\t\t\twp_enqueue_style( 'maera-res' );\n\n\t\t\t// Javascript\n\t\t\t// Load Bootstrap.\n\t\t\twp_register_script( 'bootstrap', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/bootstrap.min.js', array( 'jquery' ), time(), false );\n\t\t\twp_enqueue_script( 'bootstrap' );\n\n\t\t\t// Load jQuery UI.\n\t\t\twp_register_script( 'jquery_ui', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/jquery-ui.min.js', array( 'jquery' ), time(), false );\n\t\t\twp_enqueue_script( 'jquery_ui' );\n\n\t\t\t// Isotope\n\t\t\twp_register_script( 'isotope', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/isotope.pkgd.min.js', array( 'jquery' ), time(), false );\n\t\t\twp_enqueue_script( 'isotope' );\n\n\t\t\t// Load App JS\n\t\t\twp_register_script( 'maera-res', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/app.js', array( 'bootstrap' ), time(), false );\n\t\t\twp_enqueue_script( 'maera-res' );\n\n\t\t\t// Load WoW JS\n\t\t\twp_register_script( 'wow', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/wow.min.js', array( 'jquery' ), time(), false );\n\t\t\twp_enqueue_script( 'wow' );\n\n\t\t\t// Isotope Layouts / Conditionals\n\t\t\t$isotope_layout = get_theme_mod( 'isotope_layout', 'masonry' );\n\n\t\t\tswitch ( $isotope_layout ) {\n\n\t\t\t\tcase 'masonryHorizontal':\n\t\t\t\t\twp_register_script( 'masonry-horizontal', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/isotope/masonry-horizontal.js', array( 'jquery' ), time(), false );\n\t\t\t\t\twp_enqueue_script( 'masonry-horizontal' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'fitColumns':\n\t\t\t\t\twp_register_script( 'isotope-fitcolumns', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/isotope/fit-columns.js', array( 'jquery' ), time(), false );\n\t\t\t\t\twp_enqueue_script( 'isotope-fitcolumns' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'cellsByRow':\n\t\t\t\t\twp_register_script( 'isotope-cellsbyrow', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/isotope/cells-by-row.js', array( 'jquery' ), time(), false );\n\t\t\t\t\twp_enqueue_script( 'isotope-cellsbyrow' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'cellsByColumn':\n\t\t\t\t\twp_register_script( 'isotope-cellsbycolumn', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/isotope/cells-by-column.js', array( 'jquery' ), time(), false );\n\t\t\t\t\twp_enqueue_script( 'isotope-cellsbycolumn' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'horizontal':\n\t\t\t\t\twp_register_script( 'isotope-horizontal', trailingslashit( MAERA_RES_SHELL_URL ) . 'assets/js/isotope/horizontal.js', array( 'jquery' ), time(), false );\n\t\t\t\t\twp_enqueue_script( 'isotope-horizontal' );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}", "function theme_scripts() {\n \twp_enqueue_style( 'theme-name-style', get_stylesheet_uri() );\n\n \tif(!is_admin()){\n \t\twp_deregister_script('jquery');\n \t\twp_register_script('jquery', ('https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js'),\n \t\t\tfalse, '1.11.3', true);\n \t}\n\n \twp_enqueue_script('theme_script', get_stylesheet_directory_uri() . '/assets/js/main.js',\n \t\tarray('jquery'), '1.0', true);\n }", "function add_theme_scripts()\n{\n global $assets;\n foreach ($assets['scripts'] as $key => $value) {\n wp_enqueue_script('akkk-'.$key, $value, null, '1', true);\n }\n\n}", "private function register_scripts_and_styles() {\n\n\n\t\t\t$this->load_file( self::slug . '-script', '/js/jquery.gmap.js', true);\n\t\t\t\n\t\t\tif(!is_admin()){\n\t\t\t\n\t\t\t$this->load_file( self::slug . '-map', '/js/map-settings.js', true);\n\t\t\t$this->load_file( self::slug . '-style', '/css/map-style.css' );\n\t\t\t\n\t\t\t}\n\n\t}", "public function theme_scripts() {\n\t\t/* wp_enqueue_script(\n\t\t\t'flexdatalist',\n\t\t\t'https://cdnjs.cloudflare.com/ajax/libs/jquery-flexdatalist/2.2.4/jquery.flexdatalist.min.js',\n\t\t\t[ 'jquery' ],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t); */\n\t\twp_enqueue_script(\n\t\t\t'owl-carousel',\n\t\t\tTHEME_URL . '/assets/owl-carousel/owl.carousel.min.js',\n\t\t\t[ 'jquery' ],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t'handlebars',\n\t\t\tTHEME_URL . '/assets/js/handlebars.js',\n\t\t\t[],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t'jquery-ui',\n\t\t\tTHEME_URL . '/assets/js/jquery-ui.js',\n\t\t\t[ 'jquery' ],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\t\twp_enqueue_script(\n 'simplebar',\n 'https://cdn.jsdelivr.net/npm/[email protected]/dist/simplebar.min.js',\n [],\n 'auto',\n true\n );\n\t\twp_enqueue_script(\n\t\t\t'mcustomscrollbar',\n\t\t\tTHEME_URL . '/assets/js/jquery.mCustomScrollbar.js',\n\t\t\t[ 'jquery' ],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t'navigo',\n\t\t\tTHEME_URL . '/assets/js/navigo.min.js',\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t'submit-feedback',\n\t\t\tTHEME_URL . '/assets/js/submit-feedback.js',\n\t\t\t[ 'jquery' ],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t'submit-contact',\n\t\t\tTHEME_URL . '/assets/js/submit-contact.js',\n\t\t\t[ 'jquery' ],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\t\t// phpcs:ignore -- load in header, after jQuery.\n\t\twp_enqueue_script(\n\t\t\t'tracking',\n\t\t\tTHEME_URL . '/assets/js/tracking.js',\n\t\t\t[ 'jquery' ],\n\t\t\t'auto'\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t'theme',\n\t\t\tTHEME_URL . '/assets/js/theme.js',\n\t\t\t[ 'jquery', 'mediaelement', 'submit-feedback' ],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\t\t/* wp_enqueue_script(\n\t\t\t'search',\n\t\t\tTHEME_URL . '/assets/js/search.js',\n\t\t\t[ 'flexdatalist' ],\n\t\t\t'1.0.0',\n\t\t\ttrue\n\t\t); */\n\t\t$error_messages = [\n\t\t\t'required' => __( 'This field is required. Please be sure to check.', 'asvz' ),\n\t\t\t'email' => __( 'Your E-mail address appears to be invalid. Please be sure to check.', 'asvz' ),\n\t\t\t'number' => __( 'You can enter only numbers in this field.', 'asvz' ),\n\t\t\t'maxLength' => __( 'Maximum {count} characters allowed!', 'asvz' ),\n\t\t\t'minLength' => __( 'Minimum {count} characters allowed!', 'asvz' ),\n\t\t\t'maxChecked' => __( 'Maximum {count} options allowed. Please be sure to check.', 'asvz' ),\n\t\t\t'minChecked' => __( 'Please select minimum {count} options.', 'asvz' ),\n\t\t\t'maxSelected' => __( 'Maximum {count} selection allowed. Please be sure to check.', 'asvz' ),\n\t\t\t'minSelected' => __( 'Minimum {count} selection allowed. Please be sure to check.', 'asvz' ),\n\t\t\t'notEqual' => __( 'Fields do not match. Please be sure to check.', 'asvz' ),\n\t\t\t'different' => __( 'Fields cannot be the same as each other', 'asvz' ),\n\t\t\t'creditCard' => __( 'Invalid credit card number. Please be sure to check.', 'asvz' ),\n\t\t];\n\n\t\t/* $menu_items = [\n\t\t\t'categories' => [\n\t\t\t\t'text' => get_field( 'menu__categories__text', 'option' ),\n\t\t\t\t'icon' => get_field( 'menu__categories__icon', 'option' ),\n\t\t\t],\n\t\t\t'materials' => [\n\t\t\t\t'text' => get_field( 'menu__materials__text', 'option' ),\n\t\t\t\t'icon' => get_field( 'menu__materials__icon', 'option' ),\n\t\t\t],\n\t\t\t'tips' => [\n\t\t\t\t'text' => get_field( 'menu__tips__text', 'option' ),\n\t\t\t\t'icon' => get_field( 'menu__tips__icon', 'option' ),\n\t\t\t],\n\t\t\t'faq' => [\n\t\t\t\t'text' => get_field( 'menu__faq__text', 'option' ),\n\t\t\t\t'icon' => get_field( 'menu__faq__icon', 'option' ),\n\t\t\t],\n\t\t\t'contact' => [\n\t\t\t\t'text' => get_field( 'menu__contact__text', 'option' ),\n\t\t\t\t'icon' => get_field( 'menu__contact__icon', 'option' ),\n\t\t\t],\n\t\t]; */\n\n\t\t/* $type_icons = [\n\t\t\t'category' => get_field( 'type_icon__category', 'option' ),\n\t\t\t'task' => get_field( 'type_icon__task', 'option' ),\n\t\t\t'step' => get_field( 'type_icon__step', 'option' ),\n\t\t\t'material' => get_field( 'type_icon__material', 'option' ),\n\t\t\t'faq' => get_field( 'type_icon__faq', 'option' ),\n\t\t]; */\n\n\t\t/* foreach ( $type_icons as $key => $value ) {\n\t\t\tif ( $type_icons[ $key ] ) {\n\t\t\t\t$type_icons[ $key ] = $type_icons[ $key ]['sizes']['thumbnail'];\n\t\t\t}\n\t\t} */\n\n\t\t$asvz_objects = [\n\t\t\t'themeUrl' => THEME_URL,\n\t\t\t/*'ajaxUrl' => admin_url( 'admin-ajax.php' ),\n\t\t\t'nonces' => [\n\t\t\t\t'submit_feedback' => wp_create_nonce( 'ASVZ_Submit_Feedback' ),\n\t\t\t\t'submit_contact' => wp_create_nonce( 'ASVZ_Submit_Contact' ),\n\t\t\t],\n\t\t\t'categories' => Category::all(),\n\t\t\t'materials' => Material::all(),\n\t\t\t'tasks' => Task::all(),\n\t\t\t'steps' => Step::all(),\n\t\t\t'faqs' => Faq::all(),\n\t\t\t'pages' => [\n\t\t\t\t'welcome' => [\n\t\t\t\t\t'title' => get_field( 'welcome_page__title', 'option' ),\n\t\t\t\t\t'subtitle' => get_field( 'welcome_page__subtitle', 'option' ),\n\t\t\t\t\t'thumbnail' => get_field( 'welcome_page__thumbnail', 'option' ),\n\t\t\t\t\t'description' => get_field( 'welcome_page__description', 'option' ),\n\t\t\t\t\t'cta_button' => [\n\t\t\t\t\t\t'text' => get_field( 'welcome_page__cta_button__text', 'option' ),\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t],\n\t\t\t'feedback_form' => [\n\t\t\t\t'intro' => get_field( 'cleaning_feedback__intro', 'option' ),\n\t\t\t\t'title' => get_field( 'cleaning_feedback__title', 'option' ),\n\t\t\t\t'subtitle' => get_field( 'cleaning_feedback__subtitle', 'option' ),\n\t\t\t\t'placeholder' => get_field( 'cleaning_feedback__placeholder', 'option' ),\n\t\t\t\t'messages' => [\n\t\t\t\t\t'success' => get_field( 'cleaning_feedback__success_message', 'option' ),\n\t\t\t\t],\n\t\t\t],\n\t\t\t'contact_form' => [\n\t\t\t\t'labels' => [\n\t\t\t\t\t'name' => get_field( 'cleaning_contact__label__name', 'option' ),\n\t\t\t\t\t'email' => get_field( 'cleaning_contact__label__email', 'option' ),\n\t\t\t\t\t'subject' => get_field( 'cleaning_contact__label__subject', 'option' ),\n\t\t\t\t\t'body' => get_field( 'cleaning_contact__label__body', 'option' ),\n\t\t\t\t\t'button' => get_field( 'cleaning_contact__label__button', 'option' ),\n\t\t\t\t],\n\t\t\t\t'placeholders' => [\n\t\t\t\t\t'name' => get_field( 'cleaning_contact__placeholder__name', 'option' ),\n\t\t\t\t\t'email' => get_field( 'cleaning_contact__placeholder__email', 'option' ),\n\t\t\t\t\t'subject' => get_field( 'cleaning_contact__placeholder__subject', 'option' ),\n\t\t\t\t\t'body' => get_field( 'cleaning_contact__placeholder__body', 'option' ),\n\t\t\t\t],\n\t\t\t\t'messages' => [\n\t\t\t\t\t'success' => [\n\t\t\t\t\t\t'title' => get_field( 'cleaning_contact__success_message__title', 'option' ),\n\t\t\t\t\t\t'description' => get_field( 'cleaning_contact__success_message__description', 'option' ),\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t],\n\t\t\t'menu_items' => $menu_items,\n\t\t\t'page_titles' => [\n\t\t\t\t'categories' => __( 'Categorieën', 'asvz' ),\n\t\t\t\t'products' => __( 'Producten', 'asvz' ),\n\t\t\t\t'tasks' => __( 'Takenlijst', 'asvz' ),\n\t\t\t\t'tips' => __( 'Tips', 'asvz' ),\n\t\t\t\t'contact' => __( 'Contact', 'asvz' ),\n\t\t\t\t'faq' => __( 'Veelgestelde vragen', 'asvz' ),\n\t\t\t],\n\t\t\t'general_labels' => [\n\t\t\t\t'menu_header' => __( 'Poets!', 'asvz' ),\n\t\t\t\t'powered_by' => __( 'Powered By ASVZ', 'asvz' ),\n\t\t\t\t'search_placeholder' => __( 'Search keyword...', 'asvz' ),\n\t\t\t\t'tips_title' => __( 'Poets tips', 'asvz' ),\n\t\t\t\t'material_needed' => __( 'Bekijk hier wat je allemaal nodig hebt', 'asvz' ),\n\t\t\t\t'menu_header' => __( '', 'asvz' ),\n\t\t\t\t'completed_material' => __( 'Your material is complete!', 'asvz' ),\n\t\t\t],\n\t\t\t'popup' => [\n\t\t\t\t'trigger' => [\n\t\t\t\t\t'tips_icon' => get_field( 'tips_popup__trigger_icon', 'option' ),\n\t\t\t\t\t'wizard_icon' => get_field( 'wizard_popup__trigger_icon', 'option' ),\n\t\t\t\t],\n\t\t\t],\n\t\t\t'type_icons' => $type_icons,*/\n\t\t];\n\n\t\twp_localize_script(\n\t\t\t'theme',\n\t\t\t'asvzObj',\n\t\t\t$asvz_objects\n\t\t);\n\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\t}", "function melissao_scripts() {\n\n wp_enqueue_style(\n 'melissao-style',\n get_template_directory_uri() . '/_assets/styles/global.css',\n array(),\n false,\n 'all and (min-width: 1em)'\n );\n\n wp_enqueue_script(\n 'melissao-script',\n get_template_directory_uri() . '/_assets/scripts/global.js',\n array('jquery'),\n '',\n true\n );\n}", "function custom_theme_scripts()\n{\n\n wp_enqueue_style(\n 'webpack-css',\n get_theme_file_uri('/assets/stylesheets/index.css')\n );\n\n wp_enqueue_script(\n 'webpack-style-js',\n get_theme_file_uri('/assets/javascripts/style.js'),\n array(),\n null,\n true\n );\n\n wp_enqueue_script(\n 'webpack-js',\n get_theme_file_uri('/assets/javascripts/index.js'),\n array(),\n null,\n true\n );\n}", "function theme_scripts_and_styles() {\n\t\t// wp_register_script( 'jquery', get_stylesheet_directory_uri() . '/bower_components/jquery/dist/jquery.min.js', array(), '', 'true' );\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_register_script( 'responsive-slides', get_stylesheet_directory_uri() . '/bower_components/jquery.responsive-slides/jquery.responsive-slides.min.js', array('jquery'), '', true );\n\t\twp_enqueue_script( 'responsive-slides' );\n\t\twp_register_script( 'velocity', get_stylesheet_directory_uri() . '/js/velocity.min.js', array(), '', true );\n\t\twp_enqueue_script( 'velocity' );\n\t\twp_register_script( 'isotope', get_stylesheet_directory_uri() . '/bower_components/isotope/dist/isotope.pkgd.min.js', array('jquery'), '', true );\n\t\twp_enqueue_script( 'isotope' );\n\t\twp_register_script( 'imagesloaded', get_stylesheet_directory_uri() . '/bower_components/imagesloaded/imagesloaded.pkgd.min.js', array('jquery'), '', true );\n\t\twp_enqueue_script( 'imagesloaded' );\n\t\twp_register_script( 'bbq', get_stylesheet_directory_uri() . '/bower_components/jquery.bbq/jquery.ba-bbq.min.js', array('jquery'), '', true );\n\t\twp_enqueue_script( 'bbq' );\n\t\twp_register_script( 'readmore', get_stylesheet_directory_uri() . '/js/readmore.min.js', array('jquery'), '', true );\n\t\twp_enqueue_script( 'readmore' );\n\t\t// register main script\n\t\twp_register_script( 'main-script', get_stylesheet_directory_uri() . '/js/main.js', array('jquery'), '', true );\n\t\twp_enqueue_script( 'main-script' );\n\n\t\twp_register_script( 'front-page-script', get_stylesheet_directory_uri() . '/js/front-page.js', array('jquery'), '', true );\n\t\t// register main stylesheet\n\t\twp_register_style( 'main-css', get_stylesheet_directory_uri() . '/css/style.css', array(), '1.2', 'all' );\n\t\twp_enqueue_style( 'main-css' );\n\n\t\twp_register_style( 'grid-css', get_stylesheet_directory_uri() . '/css/grid.css', array('main-css'), '', 'all' );\n\t\twp_enqueue_style( 'grid-css' );\n\n\t\twp_register_style( 'responsive-slides-css', get_stylesheet_directory_uri() . '/bower_components/jquery.responsive-slides/jquery.responsive-slides.css', array('main-css'), '', 'all' );\n\t\twp_enqueue_style( 'responsive-slides-css' );\n\n\t\t// comment reply script for threaded comments\n\t\tif ( is_front_page()) {\n\t\t\twp_enqueue_script( 'front-page-script' );\n\t\t}\n\n\t}", "static public function scripts() {\n\t\twp_enqueue_script( 'glutton-lib',\n\t\t\tget_stylesheet_directory_uri() . '/static/app/lib.js',\n\t\t\tarray(),\n\t\t\tnull,\n\t\t\ttrue\n\t\t);\n\t\twp_enqueue_script( 'glutton-main',\n\t\t\tget_stylesheet_directory_uri() . '/static/app/app.js',\n\t\t\tarray( 'glutton-lib' ),\n\t\t\tnull,\n\t\t\ttrue\n\t\t);\n\n\t\t$glutton_data = array(\n\t\t\t'revision' => static::revision(),\n\t\t\t'env' => WP_ENV,\n\t\t);\n\t\twp_localize_script( 'glutton-main', 'Glutton', $glutton_data );\n\t}" ]
[ "0.7432257", "0.73783195", "0.7353354", "0.7241894", "0.72290516", "0.7225064", "0.7203435", "0.71928823", "0.7176898", "0.71572274", "0.7124381", "0.7073807", "0.7049397", "0.70477605", "0.7034155", "0.7032133", "0.7002892", "0.7001095", "0.698545", "0.6976421", "0.69320023", "0.69180757", "0.69100016", "0.6903774", "0.6896189", "0.68816316", "0.68644434", "0.6860628", "0.68560594", "0.6855248" ]
0.7508706
0
Load all scripts with async. Check if is IE and load bundle for IE if exists.
function load_async_scripts($url) { if ( strpos( $url, '#asyncload') === false ) { return $url; } else if ( is_admin() ) { return str_replace( '#asyncload', '', $url ); } else { if(function_exists('is_IE') && is_IE()) { $ie_url = str_replace( '.min.', '.ie.', $url ); if(does_url_exists($ie_url)) { $url = $ie_url; } } return str_replace( '#asyncload', '', $url )."' async='async"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function st_async_load_scripts($url)\n{\n if ( strpos( $url, '#asyncscript') === false ){\n return $url;\n }elseif( is_admin() ){\n return str_replace( '#asyncscript', '', $url );\n }\n\treturn str_replace( '#asyncscript', '', $url ).\"' async='async\" . \"' defer='defer\";\n}", "function load_scripts_block_assets() {\n\twp_register_script(\n\t\t'slick_script',\n\t\tget_template_directory_uri() . '/js/plugins/slick.min.js#asyncload',\n\t\t[],\n\t\tfalse,\n\t\ttrue\n\t);\n}", "function wsds_async_scripts( $tag, $handle, $src ) {\n\t$async_scripts = array( \n\t\t'contact-form-7',\n\t\t'bootstrap-js',\n\t\t'vue-js',\n\t\t'main-tether-js',\n\t\t'main-bootstrap-js',\n\t\t'parallax',\n\t\t'owl-js',\n\t);\n if ( in_array( $handle, $async_scripts ) ) {\n return '<script type=\"text/javascript\" src=\"' . $src . '\" async=\"async\"></script>' . \"\\n\";\n }\n return $tag;\n}", "private function loadScripts()\r\n\t{\r\n\t//load jQuery by default unless minimal javascript is used in the page\r\n\t//\r\n\t\t$this->scripts = NULL;\r\n\t\t$this->scripts .= $this->loader->loadScripts('jquery.js');\r\n\t\t$this->scripts .= $this->loader->loadScripts('front.js');\r\n\t\treturn $this->scripts;\r\n\t\t\r\n\t}", "function load_theme_scripts() {\n\t\twp_enqueue_script(\n\t\t'script',\n\t\tget_template_directory_uri() . '/js/bundle.min.js#asyncload',\n\t\t[],\n\t\tfalse,\n\t\ttrue\n\t);\n}", "function wsds_async_scripts( $tag, $handle, $src ) {\n\t$async_scripts = array( \n\n\t);\n\n if ( in_array( $handle, $async_scripts ) ) {\n return '<script type=\"text/javascript\" src=\"' . $src . '\" async=\"async\"></script>' . \"\\n\";\n }\n\n return $tag;\n}", "public function enqueueScripts() {}", "function barbacco_scripts_loads() {\n\t\tif ( ! is_admin() ) {\n\t\t\twp_deregister_script( 'jquery' );\n\t\t\twp_register_script( 'jquery', ( \"https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js\" ), false, '1.12.4', true );\n\t\t\twp_enqueue_script( 'jquery' );\n\t\t}\n \n\t\twp_register_script( 'boot-scripts', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.5', true );\n\t\twp_enqueue_script( 'boot-scripts' );\n\t\t\n\t\twp_register_script( 'my-scripts', get_template_directory_uri() . '/js/barbacco-scripts.min.js', array( 'jquery' ), '1.0.0', true );\n\t\twp_enqueue_script( 'my-scripts' );\n\t\t\n\t\twp_register_script( 'html5-conditional-scripts', ( \"https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js\" ), '', '', true );\n\t\twp_enqueue_script( 'html5-conditional-scripts' );\n\t\tglobal $wp_scripts;\n\t\t$wp_scripts->add_data( 'html5-conditional-scripts', 'conditional', 'IE 9' );\n\t\twp_register_script( 'respondjs-conditional-scripts', ( \"https://oss.maxcdn.com/respond/1.4.2/respond.min.js\" ), '', '', true );\n\t\twp_enqueue_script( 'respondjs-conditional-scripts' );\n\t\tglobal $wp_scripts;\n\t\t$wp_scripts->add_data( 'respondjs-conditional-scripts', 'conditional', 'IE 9' );\n\t}", "public function loadJavaScripts(){\n //SAMPLE:wp_register_script( string $handle, string|bool $src, string[] $deps = array(), string|bool|null $ver = false, bool $in_footer = false )\n\n\n wp_register_script(\"paulScript\",get_template_directory_uri().'/js/paulScript.js','',1,true );\n\n wp_enqueue_script('paulScript');\n\n\n\n }", "function wsds_defer_scripts( $tag, $handle, $src ) {\n\t$defer_scripts = array( \n\t\t'child-understrap-scripts',\n\t\t'admin-bar',\n\t\t'jquery-migrate',\n\t);\n\n if ( in_array( $handle, $defer_scripts ) ) {\n return '<script type=\"text/javascript\" src=\"' . $src . '\" defer=\"defer\"></script>' . \"\\n\";\n }\n\n return $tag;\n}", "public function loadScripts($observer) {\n\n\t\tif (Mage::helper('flexslider')->isEnabled() == 1) {\n\t\t\t$_head = $this->__getHeadBlock();\n\t\t\tif ($_head) {\n\t\t\t\t$_head->addFirst('skin_css', \t\t'flexslider/css/flexslider.css');\n\t\t\t\t$_head->addFirst('skin_css', \t\t'flexslider/css/styles.css.php');\n\t\t\t\t$_head->addEnd('js',\t\t\t\t'flexslider/jquery.flexslider-min.js');\n\n\t\t\t\tif (Mage::helper('flexslider')->isjQueryEnabled() == 1) {\n\t\t\t\t\tif (Mage::helper('flexslider')->versionjQuery() == 'latest') {\n\t\t\t\t\t\t$_head->addBefore(\t'js', \t'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', \t'flexslider/jquery.flexslider-min.js');\n\t\t\t\t\t\t$_head->addAfter(\t'js', \t'flexslider/jquery.noconflict.js', \t\t\t\t\t\t\t\t'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');\n\t\t\t\t\t} elseif (Mage::helper('flexslider')->versionjQuery() == '1.9.1') {\n\t\t\t\t\t\t$_head->addBefore(\t'js', \t'flexslider/jquery-1.9.1.min.js', \t'flexslider/jquery.flexslider-min.js');\n\t\t\t\t\t\t$_head->addAfter(\t'js', \t'flexslider/jquery.noconflict.js', \t'flexslider/jquery-1.9.1.min.js');\n\t\t\t\t\t} elseif (Mage::helper('flexslider')->versionjQuery() == '1.8.3') {\n\t\t\t\t\t\t$_head->addBefore(\t'js', \t'flexslider/jquery-1.8.3.min.js', \t'flexslider/jquery.flexslider-min.js');\n\t\t\t\t\t\t$_head->addAfter(\t'js', \t'flexslider/jquery.noconflict.js', \t'flexslider/jquery-1.8.3.min.js');\n\t\t\t\t\t} elseif (Mage::helper('flexslider')->versionjQuery() == 'oldest') {\n\t\t\t\t\t\t$_head->addBefore(\t'js', \t'flexslider/jquery-1.4.3.min.js', \t'flexslider/jquery.flexslider-min.js');\n\t\t\t\t\t\t$_head->addAfter(\t'js', \t'flexslider/jquery.noconflict.js', \t'flexslider/jquery-1.4.3.min.js');\n\t\t\t\t\t}\n\t\t\t\t\t$_head->addAfter(\t\t'js', \t'flexslider/jquery.easing.js', \t\t'flexslider/jquery.noconflict.js');\n\t\t\t\t\t$_head->addAfter(\t\t'js', \t'flexslider/jquery.fitvid.js', \t\t'flexslider/jquery.easing.js');\n\t\t\t\t\t$_head->addAfter(\t\t'js', \t'flexslider/froogaloop.js', \t\t'flexslider/jquery.fitvid.js');\n\t\t\t\t} else {\n\t\t\t\t\t$_head->addBefore(\t\t'js', \t'flexslider/jquery.easing.js',\t\t'flexslider/jquery.flexslider-min.js');\n\t\t\t\t\t$_head->addAfter(\t\t'js', \t'flexslider/jquery.fitvid.js', \t\t'flexslider/jquery.easing.js');\n\t\t\t\t\t$_head->addAfter(\t\t'js', \t'flexslider/froogaloop.js', \t\t'flexslider/jquery.fitvid.js');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function fetchAllJS()\n {\n foreach ($this->footer_js_files as $item) {\n $file = ROOTPATH . \"public/\" . $item;\n if (!file_exists($file)) {\n continue;\n }\n echo \"<script type='text/javascript' src='\".base_url($item).\"'></script>\\n\";\n }\n }", "abstract public function getJsLoader();", "public function insertLazyloadScript()\r\n {\r\n if (! $this->option_array->get('images') && ! $this->option_array->get('iframes')) {\r\n return;\r\n }\r\n\r\n if (! $this->shouldLazyload()) {\r\n return;\r\n }\r\n\r\n /**\r\n * Filters the threshold at which lazyload is triggered\r\n *\r\n * @since 1.2\r\n * @author Remy Perona\r\n *\r\n * @param int $threshold Threshold value.\r\n */\r\n $threshold = apply_filters('rocket_lazyload_threshold', 300);\r\n\r\n /**\r\n * Filters the use of the polyfill for intersectionObserver\r\n *\r\n * @since 3.3\r\n * @author Remy Perona\r\n *\r\n * @param bool $polyfill True to use the polyfill, false otherwise.\r\n */\r\n $polyfill = apply_filters('rocket_lazyload_polyfill', false);\r\n\r\n $script_args = [\r\n 'base_url' => ROCKET_LL_FRONT_JS_URL,\r\n 'version' => '12.0',\r\n 'polyfill' => $polyfill,\r\n ];\r\n\r\n $inline_args = [\r\n 'threshold' => $threshold,\r\n 'options' => [\r\n 'use_native' => 'true',\r\n ],\r\n ];\r\n\r\n if ($this->option_array->get('images') || $this->option_array->get('iframes')) {\r\n $inline_args['elements']['loading'] = '[loading=lazy]';\r\n }\r\n\r\n if ($this->option_array->get('images')) {\r\n $inline_args['elements']['background_image'] = '.rocket-lazyload';\r\n }\r\n\r\n /**\r\n * Filters the arguments array for the lazyload script options\r\n *\r\n * @since 2.0\r\n * @author Remy Perona\r\n *\r\n * @param array $inline_args Arguments used for the lazyload script options.\r\n */\r\n $inline_args = apply_filters('rocket_lazyload_script_args', $inline_args);\r\n\r\n echo '<script>' . $this->assets->getInlineLazyloadScript($inline_args) . '</script>';\r\n $this->assets->insertLazyloadScript($script_args);\r\n }", "function wsds_defer_scripts( $tag, $handle, $src ) {\n\t$defer_scripts = array( \n\t\t'main-script',\n\t);\n if ( in_array( $handle, $defer_scripts ) ) {\n return '<script type=\"text/javascript\" src=\"' . $src . '\" defer=\"defer\"></script>' . \"\\n\";\n }\n return $tag;\n}", "public function enqueue()\n {\n $scripts = $this->scripts();\n\n foreach ($scripts as $script) {\n [\n 'handle' => $handle,\n 'src' => $src,\n 'dependencies' => $dependencies,\n 'version' => $version\n ] = $script;\n\n wp_register_script(\n $handle,\n $src,\n $dependencies,\n $version,\n $this->in_footer\n );\n\n if (isset($script['inline'])) {\n $inline = $script['inline'];\n\n [\n 'js_key' => $js_key,\n 'data' => $data,\n 'position' => $position\n ] = $inline;\n\n $json_data = json_encode($data);\n\n wp_add_inline_script(\n $handle,\n \"window.__{$js_key}__ = $json_data\",\n $position\n );\n }\n\n wp_enqueue_script($handle);\n }\n }", "function wsds_defer_scripts( $tag, $handle, $src ) {\n\t$defer_scripts = array( \n\t\t'jquery.smoothscroll.min.js',\n\t\t'yuspify.min.js',\n\t\t'flickity',\n\t\t'nouislider',\n\t\t'contact-form-7',\n\t\t\n\t);\n\n if ( in_array( $handle, $defer_scripts ) ) {\n return '<script src=\"' . $src . '\" defer=\"defer\" type=\"text/javascript\"></script>' . \"\\n\";\n }\n \n return $tag;\n}", "function cp_load_css_async()\n {\n\n $scripts = '<script>function cpLoadCSS(e,t,n){\"use strict\";var i=window.document.createElement(\"link\"),o=t||window.document.getElementsByTagName(\"script\")[0];return i.rel=\"stylesheet\",i.href=e,i.media=\"only x\",o.parentNode.insertBefore(i,o),setTimeout(function(){i.media=n||\"all\"}),i}</script>';\n\n echo $scripts;\n }", "function load_scripts()\n\t{\n\t\twp_deregister_script( 'jquery' );\n\t\twp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, NULL, true );\n\t\twp_enqueue_script( 'jquery' );\n\t\t// concatenated production scripts Run 'gulp js' to update and then increment version number to bust cache\n\t\twp_enqueue_script('script', get_stylesheet_directory_uri() . '/dist/js/j.min.js', '', '1.0', true);\n\n\t\tif (is_single()) {\n\t\t\twp_enqueue_script('prism', get_stylesheet_directory_uri() . '/dist/js/prism.js', '', '1.0', true);\n\t\t\twp_enqueue_style( 'prism-styles', get_stylesheet_directory_uri() . '/css/prism.css', array(), false );\n\t\t}\n\t}", "function rocket_lazyload_async_script( $tag, $handle ) {\n\t\t_deprecated_function( __FUNCTION__, '2.11.2' );\n\n\t\treturn $tag;\n\t}", "public function preload_scripts()\n {\n $scripts = $this->scripts();\n\n if (!is_admin()) {\n foreach ($scripts as $script) {\n if (isset($script['preload']) && $script['preload'] === true) {\n echo '<link rel=\"preload\" href=\"' . $script['src'] . '\" as=\"script\">';\n }\n }\n }\n }", "protected function loadJavascriptResources()\n {\n $this->pageRenderer->addJsFile(\n 'EXT:core/Resources/Public/JavaScript/Contrib/jquery/jquery.js'\n );\n $this->pageRenderer->loadRequireJs();\n $this->pageRenderer->addRequireJsConfiguration(\n [\n 'shim' => [\n 'ckeditor' => ['exports' => 'CKEDITOR'],\n 'ckeditor-jquery-adapter' => ['jquery', 'ckeditor'],\n ],\n 'paths' => [\n 'TYPO3/CMS/FrontendEditing/Contrib/toastr' =>\n 'EXT:frontend_editing/Resources/Public/JavaScript/Contrib/toastr',\n 'TYPO3/CMS/FrontendEditing/Contrib/immutable' =>\n 'EXT:frontend_editing/Resources/Public/JavaScript/Contrib/immutable'\n ]\n ]\n );\n\n $this->pageRenderer->addJsFile(\n 'EXT:backend/Resources/Public/JavaScript/backend.js'\n );\n // Load CKEDITOR and CKEDITOR jQuery adapter independent for global access\n $this->pageRenderer->addJsFooterFile('EXT:rte_ckeditor/Resources/Public/JavaScript/Contrib/ckeditor.js');\n $this->pageRenderer->addJsFooterFile(\n 'EXT:frontend_editing/Resources/Public/JavaScript/Contrib/ckeditor-jquery-adapter.js'\n );\n\n // Fixes issue #377, where CKEditor dependencies fail to load if the version number is added to the file name\n if ($GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename'] === 'embed') {\n $this->pageRenderer->addJsInlineCode(\n 'ckeditor-basepath-config',\n 'window.CKEDITOR_BASEPATH = ' . GeneralUtility::quoteJSvalue(PathUtility::getAbsoluteWebPath(\n GeneralUtility::getFileAbsFileName(\n 'EXT:rte_ckeditor/Resources/Public/JavaScript/Contrib/'\n )\n )) . ';',\n true,\n true\n );\n }\n\n $configuration = $this->getPluginConfiguration();\n if (isset($configuration['includeJS']) && is_array($configuration['includeJS'])) {\n foreach ($configuration['includeJS'] as $file) {\n $this->pageRenderer->addJsFile($file);\n }\n }\n }", "function load_scripts() {\n wp_register_script( BBP_NAME . '-js', BBP_URL . 'js/blackbirdpie.js', array(), '20110404' );\n wp_enqueue_script( BBP_NAME . '-js' );\n }", "function buscemi_scripts()\n{\n wp_enqueue_script('jquery');\n if (localInstall() == true) {\n $reloadScript = 'http://localhost:35729/livereload.js';\n wp_register_script('livereload', $reloadScript, null, false, true);\n wp_enqueue_script('livereload');\n }\n wp_register_script('lazyload', get_template_directory_uri() . '/app/vendors/lazyload.min.js', null, false, false);\n wp_enqueue_script('lazyload');\n wp_register_script('picturefill', get_template_directory_uri() . '/app/vendors/picturefill.min.js', null, false, false);\n wp_enqueue_script('picturefill');\n// wp_register_script( $handle, $src, $deps, $ver, $in_footer );\n wp_enqueue_style('buscemi_style', get_template_directory_uri() . '/app/main.min.css', null, null, null);\n wp_enqueue_script('buscemi_script', get_template_directory_uri() . '/app/app.min.js', array('jquery'), null, true);\n\n}", "function add_async_attribute($tag, $handle) {\n $scripts_to_async = array(\n 'bootstrap.min', 'jquery.fancybox.min', 'iframeResizer.min', 'bxslider.min', 'jquery.cookie', 'math.min', 'custom'\n );\n \n foreach($scripts_to_async as $async_script) {\n if ($async_script === $handle) {\n return str_replace(' src', ' async=\"async\" src', $tag);\n }\n }\n return $tag;\n }", "public function enqueueThemeScripts()\n {\n $js_uri = get_theme_file_uri( '/assets/dist/scripts/' );\n $js_dir = get_theme_file_path( '/assets/dist/scripts/' );\n\n $js_files = $this->getJsFiles();\n foreach ( $js_files as $handle => $data ) {\n $src = $js_uri . $data['file'];\n $version = logger()->getAssetVersion( $js_dir . $data['file'] );\n $deps = $data['deps'];\n $in_foot = $data['in_foot'];\n\n wp_enqueue_script( $handle, $src, $deps, $version, $in_foot );\n }\n\n if ( ! is_admin() ) {\n wp_dequeue_style( 'wp-block-library' );\n }\n }", "function childtheme_script_manager() {\n // registers modernizr script, childtheme path, no dependency, no version, loads in header\n wp_register_script('modernizr-js', get_stylesheet_directory_uri() . '/js/modernizr.js', false, false, false);\n // registers fitvids script, local childtheme path, yes dependency is jquery, no version, loads in footer\n wp_register_script('fitvids-js', get_stylesheet_directory_uri() . '/js/jquery.fitvids.js', array('jquery'), false, true);\n // registers misc custom script, childtheme path, yes dependency is jquery, no version, loads in footer\n wp_register_script('custom-js', get_stylesheet_directory_uri() . '/js/custom.js', array('jquery'), false, true);\n\n // enqueue the scripts for use in theme\n wp_enqueue_script ('modernizr-js');\n wp_enqueue_script ('fitvids-js');\n wp_enqueue_script ('custom-js');\n\n if ( is_front_page() ) {\n // example of conditional loading, if you only use a script or style on one page, load it conditionally!\n }\n}", "function wfc_js_scripts(){\n if( !is_admin() ){\n wp_deregister_script( 'jquery' );\n wp_register_script( 'jquery', (\"http://code.jquery.com/jquery-latest.min.js\"), false, \"\", true );\n wp_enqueue_script( 'jquery' );\n }\n if( AUTOLOAD_MINIFY === true ){\n wp_register_script(\n \"extended_assets_compressed\",\n WFC_URI.'/comp_assets/extended_assets_compressed.js', array('jquery'), '', true );\n wp_enqueue_script( \"extended_assets_compressed\" );\n } else{\n if( get_option( 'wfc_autoload_assets' ) ){\n $all_js = new wfc_auto_load_assets();\n if( !is_array( $all_js->autoload( 'js' ) ) ){\n die($all_js->autoload( 'js' ));\n }\n foreach( $all_js->autoload( 'js' ) as $k => $v ){\n wp_register_script( $k, WFC_JS_URI.'/'.$v, array('jquery'), '', true );\n wp_enqueue_script( $k );\n }\n }\n }\n }", "public function register_assets() {\n $scripts = $this->get_scripts();\n $styles = $this->get_styles();\n\n foreach ( $scripts as $handle => $script ) {\n $deps = isset( $script['deps'] ) ? $script['deps'] : false;\n wp_register_script( $handle, $script['src'], $deps, $script['version'], true );\n }\n\n foreach ( $styles as $handle => $style ) {\n $deps = isset( $style['deps'] ) ? $style['deps'] : false;\n wp_register_style( $handle, $style['src'], $deps, $style['version'] );\n }\n\n wp_localize_script( 'woo-stock-email-script', 'wssn', [\n 'url' => admin_url( 'admin-ajax.php' ),\n ] );\n }", "private static function front_register_scripts() {\n\t\t$register_scripts = array(\n\t\t\t'but-account' => array(\n\t\t\t\t'src' => self::get_asset_url( 'assets/js/but-account.js' ),\n\t\t\t\t'deps' => array( 'jquery' )\n\t\t\t),\n\t\t\t'but-front' => array(\n\t\t\t\t'src' => self::get_asset_url( 'assets/js/but-front.js' ),\n\t\t\t\t'deps' => array( 'jquery' )\n\t\t\t)\n\t\t);\n\t\tforeach ( $register_scripts as $handle => $props ) {\n\t\t\twp_register_script( $handle, $props['src'], $props['deps'], false, true );\n\t\t}\n\t}" ]
[ "0.6056171", "0.6018959", "0.59866214", "0.5857969", "0.5828985", "0.58032244", "0.5775298", "0.564204", "0.5479523", "0.5357848", "0.5343944", "0.5340911", "0.53335106", "0.5327923", "0.5327904", "0.53261405", "0.5319245", "0.52867454", "0.5283244", "0.52760834", "0.5273382", "0.52640194", "0.5254229", "0.5239481", "0.5219446", "0.5215092", "0.5183416", "0.51827776", "0.51794356", "0.51781356" ]
0.65514743
0
Load JS script from other block / component By default the $path is relative to `app/themes/pazola/parts/components` base. $name is a name of a component directory. Example: loadScript('box', 'pazola/scripthandle');
function loadScript($path, $name, $deps = [], $base = 'parts/components', $file_name = 'index') { $file = get_template_directory_uri() . '/' . $base . '/' . $path . '/' . $file_name . '.min.js'; $args = []; $args['name'] = $name; $args['file'] = $file; $args['deps'] = $deps; add_action( 'wp_footer', function() use ($args) { wp_enqueue_script( $args['name'], $args['file'] . '#asyncload', $args['deps'], false, true ); }, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load($name = '') {\n $location = sapwood_get_component_dir($name) . \"/{$name}.php\";\n sapwood_maybe_load($location);\n }", "public static function register_block_script( $name ) {\n\t\t$filename = 'build/' . $name . '.js';\n\t\tself::register_script( 'wc-' . $name, plugins_url( $filename, __DIR__ ) );\n\t\twp_enqueue_script( 'wc-' . $name );\n\t}", "public static function script($name)\n {\n static::make(\n \"script-template\",\n $name,\n \"scripts/modules\",\n [],\n \".coffee\"\n );\n }", "function elgg_load_js($name) {\n\telgg_load_external_file('js', $name);\n}", "protected function getPath($name) {\n return resource_path('assets/js/components/' . $name);\n }", "public function load($name) {\r //we check whether it's a layout or page , and depending on $this->page_name OR $this->layout_name we find the appropriate partial file\r\r $parts = explode('.', $name, 2);\r\r $type = $parts[0];\r\r if ($type != 'page' AND $type != 'layout')\r return '';\r\r\r\r $file = str_replace('.', '/', $parts[1]);\r\r if ($type == 'page' AND $file == 'content')\r return parent::load(\"/{$type}s/{$this->page_name}.mustache\");\r\r\r\r $item_name = $type . '_name';\r\r $item_name = $this->$item_name; //page_name OR layout_name , value of current page or layout e.g. default, login | index, widgets, etc ...\r //look in the partials for this page or layout\r\r $path = \"/{$type}s/partials/{$item_name}/{$file}.mustache\";\r\r if (!is_file($this->baseDir . $path)) {\r\r //look in the upper folder, which contains partials for all pages or layouts\r\r $path = \"/{$type}s/partials/_shared/{$file}.mustache\";\r\r if (!is_file($this->baseDir . $path))\r return '';\r }\r\r\r\r return parent::load($path); //we don't use $this->baseDir.$path , because baseDir has already been passed onto parent(Mustache_Loader_FilesystemLoader)\r }", "function extant_get_child_script_uri( $name, $path = 'js' ) {\n\n\treturn extant_get_script_uri( $name, $path, 'stylesheet' );\n}", "static public function ui_script($path) {\n self::add_path('ui_scripts',$path);\n }", "abstract public function setScript($path);", "function extant_get_script_uri( $name, $path = 'js', $where = 'template' ) {\n\n\t$suffix = hybrid_get_min_suffix();\n\t$path = 'stylesheet' === $where ? '%2$s/' . $path : '%1$s/' . $path;\n\n\t$dir = trailingslashit( hybrid_sprintf_theme_dir( $path ) );\n\t$uri = trailingslashit( hybrid_sprintf_theme_uri( $path ) );\n\n\treturn $suffix && file_exists( \"{$dir}{$name}{$suffix}.js\" ) ? \"{$uri}{$name}{$suffix}.js\" : \"{$uri}{$name}.js\";\n}", "public function load($name) {\n\t\tpreg_match('/^Mod([A-Z][a-z0-9]+)([A-Z][a-zA-Z0-9]+)?(\\-(.+))?$/', $name, $matches);\n\t\t$fname = NINJA_ROOT . '/src/ninja/Mod/' . $matches[1] . '/template/' . $name . '.html.mustache';\n\t\treturn file_get_contents($fname);\n\t}", "function _scriptPath($type/*img,js,css*/, $name, $escape = true)\n {\n try {\n $ret = $this->_script(\"public/$type/\" . $name);\n } catch (Zend_View_Exception $e) {\n return;\n }\n return $escape ? $this->escape($ret) : $ret;\n }", "function viteJs(string $name): string\n{\n $jsAsset = viteAsset($name . '.js');\n return \"<script type='module' src='{$jsAsset}'></script>\";\n}", "abstract public function getJsLoader();", "public function renderScript( $path ){\n\t\t//$path = $script['path'];\n\n\t\tif( substr( $path , 0, 4 ) == 'http' ){\n\t\t\treturn '<script type=\"text/javascript\" src=\"'.$path.'\"></script>'.\"\\r\";\n\t\t}\n\n\t\t$subdir = env('SUBDIR') ? '/'.env('SUBDIR'): '';\n\t\t$path = substr( $path , 0 , 1 ) == '/' ? $path : '/'.$path;\n\n\t\treturn '<script src=\"'.$subdir.$path.'\"></script>'.\"\\r\\n\";\n\t}", "public function load($name);", "public function load($name);", "public static function helper($name=null){\n \n $helper = end(self::$load);\n $slash_val = array_shift(array_values(self::$slash));\n $php_val = end(self::$slash);\n \n $dir = dirname(dirname(__FILE__));\n \n if( !is_null($name)){\n if( is_dir($dir)){\n $file = $dir . $slash_val . $helper . $slash_val . __( $name ) . $php_val;\n if( file_exists($file)){ \n if( !empty($name)): require_once $dir . $slash_val . $helper . $slash_val . __( $name ) . $php_val; else: endif;\n }\n }\n } \n }", "abstract public function load($name);", "public static function loadJScript($filename, $part=null){\n echo \"\\n\";\n $scriptpath = APPDIR.\"/js/$filename/load.php\";\n if( file_exists($scriptpath) ){\n include $scriptpath;\n if(isset($load)){\n if($part!=null){\n $load = array($part => $load[$part]);\n }\n \n foreach ($load as $type => $files){\n switch ($type){\n case 'css':\n foreach ($files as $file){\n $properties = array('href'=>APPURL.'/js/'.$filename.'/'.$file, 'rel'=>'stylesheet', 'type'=>'text/css');\n echo self::tag('link', $properties, '', true), \"\\n\";\n }\n break;\n case 'js':\n foreach ($files as $file){\n $properties = array('src'=>APPURL.'/js/'.$filename.'/'.$file, 'type'=>'text/javascript');\n echo self::tag('script', $properties), \"\\n\";\n }\n break;\n }\n }\n }\n }\n \n }", "function LiangLee_inc_js($params,$jsname) {\n if (isset($params,$jsname)) {\n $path = \"mod/\".$params.\"/vendors/\";\n echo \"<script type=\\\"text/javascript\\\" src=\\\"\".elgg_get_site_url().$path.$jsname.\"\\\"></script>\\n\";\n\t } else {\n\t if (elgg_is_admin_logged_in()) {\n register_error(elgg_echo('lianglee:cant:load:js'));\n } else {\n register_error(elgg_echo('lianglee:cant:load:js:code'));\t\n }\n\t }\n}", "static function loadDriver($path){\n\t\techo \"<script src='/drives/\".$path.\".js'></script>\";\n\t}", "function load_file( $name, $file_path, $is_script = false )\n\t\t\t{\n\t\t\n\t\t \t$url = content_url( $file_path, __FILE__ );\n\t\t\t\t$file = $file_path;\n\t\t\t\t\t\n\t\t\t\tif( $is_script )\n\t\t\t\t{\n\n\t\t\t\t\twp_register_script( $name, $url, '', '', true );\n\t\t\t\t\twp_enqueue_script( $name );\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\twp_register_style( $name, $url, '', '', true );\n\t\t\t\t\twp_enqueue_style( $name );\n\n\t\t\t\t}\n\t\t\t\n\t\t\t}", "public function setScriptPath($path) {}", "function _loader($name, $path=HELPER){\n\tglobal $lc_autoload;\n\t$lc_autoload[] = $path . $name . '.php';\n\t$lc_autoload = array_unique($lc_autoload);\n}", "private function load_file( $name, $file_path, $is_script = false ) {\n\n\t\t$url = plugins_url($file_path, __FILE__);\n\t\t$file = plugin_dir_path(__FILE__) . $file_path;\n\n\t\tif( file_exists( $file ) ) {\n\t\t\tif( $is_script ) {\n\t\t\t\twp_register_script( $name, $url, array('jquery') ); //depends on jquery\n\t\t\t\twp_enqueue_script( $name );\n\t\t\t} else {\n\t\t\t\twp_register_style( $name, $url );\n\t\t\t\twp_enqueue_style( $name );\n\t\t\t} // end if\n\t\t} // end if\n\n\t}", "public static function set_script( $name ) {\n\t\t$js = self::get_instance();\n\t\t$js->script_name = $name;\n\t}", "function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "static function block($name,$data=null)\n {\n // Add Extension if Missing\n $x = pathinfo($name,PATHINFO_EXTENSION);\n if (empty($x)) {\n $name.= '.php';\n }\n\n $file = sprintf('%s/block/%s',self::$root,ltrim($name,'/'));\n if (is_file($file)) {\n ob_start();\n include($file);\n $html = ob_get_clean();\n return $html;\n }\n }", "public function getSource($name)\n\t{\n\t\treturn file_get_contents($this->getPath(Bundle::name($name), Bundle::element($name)));\n\t}" ]
[ "0.690609", "0.6122634", "0.59269994", "0.5796781", "0.57720506", "0.5753695", "0.5751129", "0.5666369", "0.5538611", "0.5535905", "0.5461843", "0.54575765", "0.54333043", "0.5426883", "0.5418751", "0.5381171", "0.5381171", "0.53622836", "0.53427243", "0.53376365", "0.53351915", "0.531381", "0.52919126", "0.52885234", "0.52469826", "0.5218194", "0.52177167", "0.52125525", "0.5202595", "0.51247334" ]
0.6369601
1
Register third part scripts Later load as dependencies Example, insert when register block scripts wp_enqueue_script( 'acfgallery', get_template_directory_uri() . '/parts/blocks/acfgallery/index.min.jsasyncload', [ 'slick_script' ], false, true );
function load_scripts_block_assets() { wp_register_script( 'slick_script', get_template_directory_uri() . '/js/plugins/slick.min.js#asyncload', [], false, true ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_dependencies(){\n wp_register_script(\n 'dependencies-script',\n get_template_directory_uri() . '/js/block-dependencies.js',\n array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' )\n );\n\n wp_enqueue_script( 'dependencies-script' );\n}", "function mg_load_scripts() \n{\n\t\n\t//wp_dequeue_script('fancyBox'); \n\t//wp_dequeue_style('fancyBox'); \t\n\t\n\t//wp_register_script('ayotic-barba', get_bloginfo('stylesheet_directory') . '/assets/vendors/barba/barba.min.js' );\n\twp_register_script('ayotic-script', get_bloginfo('stylesheet_directory') . '/assets/js/main.js' );\n\t\n\t//wp_enqueue_script( 'ayotic-barba', '', array( 'jquery' ), '0.0.1', true );\n\twp_enqueue_script( 'ayotic-script', '', array(), '0.0.1', true );\n\t\n}", "function nr_load_scripts() {\n\n wp_dequeue_style('wp-block-library');\n wp_dequeue_style('wp-block-library-theme');\n\n\twp_enqueue_style('main', NR_THEME_URL.'/app.css', false, NR_VERSION);\n\twp_enqueue_style('fonts', 'https://fast.fonts.net/t/1.css?apiType=css&projectid=e0897766-a751-4fd7-89ea-7081fe24868a', false,null);\n\n\twp_deregister_script('jquery');\n\twp_deregister_script('wp-embed');\n\n\twp_register_script('jquery', NR_THEME_URL.'/js/jquery-3.3.1.min.js',null,null,true); \n\twp_enqueue_script('jquery');\n\t\t\t\t\t\t\t\t\t\n\twp_register_script('plugins', NR_THEME_URL.'/js/plugins.js','jquery',NR_VERSION,true); \n\twp_enqueue_script('plugins');\t\n\t\n\twp_register_script('site', NR_THEME_URL.'/js/site.js',array('jquery','plugins'),NR_VERSION,true); \n\twp_enqueue_script('site');\n\t\t\t\n}", "public function loadJavaScripts(){\n //SAMPLE:wp_register_script( string $handle, string|bool $src, string[] $deps = array(), string|bool|null $ver = false, bool $in_footer = false )\n\n\n wp_register_script(\"paulScript\",get_template_directory_uri().'/js/paulScript.js','',1,true );\n\n wp_enqueue_script('paulScript');\n\n\n\n }", "function clea_cecile_b_enqueue_scripts() {\n\tif ( is_page_template( 'page/ac-front-page-template.php' ) ) {\n\t\twp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/flexslider/flexslider.min.js' , array( 'jquery' ), '20120713', true );\n\t}\n\t\n\tif ( is_page_template( 'page/cb-front-page-test1.php' ) ) {\n\t\twp_enqueue_script( 'jquery-masonry' );\n\t}\n}", "function t0theme_scripts() {\n\t\t// wp_deregister_script( 'jquery' ); //Ya lo incluyo en main.min.js\n\t\twp_enqueue_style( 'mainstyles', get_stylesheet_uri() );\n\t\twp_register_script( 'slick-carousel', get_template_directory_uri() . '/assets/bower_components/slick-carousel/slick/slick.js' );\n\t\twp_enqueue_script( 't0theme_scripts', get_template_directory_uri() . '/assets/js/main.min.js', array('slick-carousel'), '', true );\n\t}", "function Progressive_scripts()\n{\n wp_enqueue_script(\n 'bootstrap',\n get_template_directory_uri() . '/framework/js/bootstrap.min.js',\n array(),\n '1.0.0',\n true\n );\n wp_enqueue_script('custom-js', get_template_directory_uri() . '/framework/js/scripts.js', array(), '1.0.0', true);\n wp_enqueue_script(\n 'flexslider',\n get_template_directory_uri() . '/framework/js/jquery.flexslider.js',\n array(),\n '1.0.0',\n true\n );\n}", "function load_assets() {\n\t\t\n\t\t// add support for visual composer animations, row stretching, parallax etc\n\t\tif ( function_exists( 'vc_asset_url' ) ) {\n\t\t\twp_enqueue_script( 'waypoints', vc_asset_url( 'lib/waypoints/waypoints.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true );\n\t\t\t//wp_enqueue_script( 'wpb_composer_front_js', vc_asset_url( 'js/dist/js_composer_front.min.js' ), array( 'jquery' ), WPB_VC_VERSION, true );\n\t\t}\n\t\t\n\t\t// JS scripts\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'popper', get_template_directory_uri() . '/assets/libs/popper/popper.min.js', array( 'jquery' ), Trends()->config['cache_time'], true );\n\t\twp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/libs/bootstrap/bootstrap.min.js', array( 'jquery' ), Trends()->config['cache_time'], true );\n\t\twp_enqueue_script( 'chartjs', get_template_directory_uri() . '/assets/libs/chart/Chart.bundle.js', array( 'jquery' ), Trends()->config['cache_time'], true );\n\t\twp_enqueue_script( 'charts', get_template_directory_uri() . '/assets/js/charts.js', array( 'jquery' ), Trends()->config['cache_time'], true );\n\n\t\twp_register_script( 'google-fonts', get_template_directory_uri() . '/assets/libs/google-fonts/webfont.js', false, Trends()->config['cache_time'], true );\n\t\twp_register_script( 'fruitfulblankprefix-front', get_template_directory_uri() . '/assets/js/front.js', array(\n\t\t\t'jquery',\n\t\t\t'google-fonts'\n\t\t), Trends()->config['cache_time'], true );\n\t\t\n\t\t$js_vars = array(\n\t\t\t'ajaxurl' => esc_url(admin_url( 'admin-ajax.php' )),\n\t\t\t'assetsPath' => get_template_directory_uri() . '/assets',\n\t\t);\n\t\t\n\t\twp_enqueue_script( 'fruitfulblankprefix-front' );\n\t\twp_localize_script( 'fruitfulblankprefix-front', 'themeJsVars', $js_vars );\n\t\t\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\n\t\tif ( $this->antispam_enabled() === 1 ) {\n\t\t\twp_enqueue_script( 'fruitfulblankprefix-antispam', get_template_directory_uri() . '/assets/js/antispam.js', array(\n\t\t\t\t'jquery',\n\t\t\t), Trends()->config['cache_time'], true );\n\t\t}\n\t\t\n\t\t\n\t\t// CSS styles\n\t\twp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/libs/font-awesome/css/font-awesome.min.css', false, Trends()->config['cache_time'] );\n\t\twp_enqueue_style( 'animate', get_template_directory_uri() . '/assets/libs/animatecss/animate.min.css', false, Trends()->config['cache_time'] );\n\t\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/libs/bootstrap/bootstrap.min.css', false, Trends()->config['cache_time'] );\n\t\t//wp_enqueue_style( 'uikit', get_template_directory_uri() . '/assets/libs/uikit/style.css', false, Trends()->config['cache_time'] );\n\t\t//wp_enqueue_style( 'uikit-elements', get_template_directory_uri() . '/assets/libs/uikit/elements.css', false, Trends()->config['cache_time'] );\n\t\twp_enqueue_style( 'fruitfulblankprefix-style', get_template_directory_uri() . '/assets/css/front/front.css', false, Trends()->config['cache_time'] );\n\t\t\n\t}", "function load_scripts() {\n wp_enqueue_style('bootstrap-min', get_template_directory_uri() . '/css/bootstrap.min.css' );\n wp_enqueue_style('fancybox-css', get_template_directory_uri() . '/css/jquery.fancybox.css' );\n wp_enqueue_style('main-css', get_template_directory_uri() . '/css/main.css' );\n wp_enqueue_style('responsive-css', get_template_directory_uri() . '/css/responsive.css' );\n wp_enqueue_style('animate-min-css', get_template_directory_uri() . '/css/animate.min.css' );\n wp_enqueue_style('font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css' );\n \n \n \n # First parameter is the id or name of the file you are adding - must be unique, second parameter is the path to the file, third parameter is dependency and typical when there is no dependency you will type an empty array, fourth parameter is the version - you can use the value null or type the exact version number, fifth parameter will tell whether you want to add the script in the footer of your document.\n wp_enqueue_script('jquery-two', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', array(), '1.11.3', true );\n wp_enqueue_script('bootstrap-min-js', get_template_directory_uri() . '/js/bootstrap.min.js', array(), 'null', true );\n wp_enqueue_script('jquery-fancybox-pack-js', get_template_directory_uri() . '/js/jquery.fancybox.pack.js', array(), 'null', true );\n wp_enqueue_script('jquery-waypoints-min-js', get_template_directory_uri() . '/js/jquery.waypoints.min.js', array(), 'null', true );\n wp_enqueue_script('retina-min-js', get_template_directory_uri() . '/js/retina.min.js', array(), 'null', true );\n wp_enqueue_script('modernizr-js', get_template_directory_uri() . '/js/modernizr.js', array(), 'null', true );\n wp_enqueue_script('main-js', get_template_directory_uri() . '/js/main.js', array(), 'null', true );\n \n}", "function as3_js() {\n\twp_enqueue_script( 'jquery-js', 'https://code.jquery.com/jquery-3.3.1.slim.min.js');\n\twp_enqueue_script( 'popper-min', 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js' );\n\twp_enqueue_script( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js');\n\twp_enqueue_script( 'owl-min', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/owl.carousel.min.js' );\n\twp_enqueue_script( 'main', get_stylesheet_directory_uri().'/js/main.js' );\n\twp_enqueue_script( 'font-awesome', 'https://use.fontawesome.com/e66dca7e8d.js' );\n}", "function custom_scripts(){\n wp_register_script( \n 's3Slider', \n get_template_directory_uri() . '/js/s3Slider.js', \n array( 'jquery' )\n );\n\twp_register_script( \n 'customquery', \n get_template_directory_uri() . '/js/custom.js', \n array( 'jquery' )\n );\n\twp_enqueue_script('jquery');\n\twp_enqueue_script('customquery');\n\twp_enqueue_script('s3Slider');\n\t\n}", "function scriptAbout() {\n wp_register_script('shortcode1', get_template_directory_uri() . '/assets/wp-content/plugins/unyson/framework/extensions/shortcodes/shortcodes/section/static/js/coref718.js?ver=4.7.12', array('jquery'), null, true);\n wp_enqueue_script('shortcode1'); \n\n wp_register_script('shortcode2', get_template_directory_uri() . '/assets/wp-content/plugins/unyson/framework/extensions/shortcodes/shortcodes/section/static/js/transitionf718.js?ver=4.7.12', array('jquery'), null, true);\n wp_enqueue_script('shortcode2'); \n \n wp_register_script('shortcode3', get_template_directory_uri() . '/assets/wp-content/plugins/unyson/framework/extensions/shortcodes/shortcodes/section/static/js/backgroundf718.js?ver=4.7.12', array('jquery'), null, true);\n wp_enqueue_script('shortcode3'); \n \n wp_register_script('shortcode4', get_template_directory_uri() . '/assets/wp-content/plugins/unyson/framework/extensions/shortcodes/shortcodes/section/static/js/background.initf718.js?ver=4.7.12', array('jquery'), null, true);\n wp_enqueue_script('shortcode4'); \n \n wp_register_script('shortcode5', get_template_directory_uri() . '/assets/wp-content/plugins/unyson/framework/extensions/shortcodes/shortcodes/testimonials/static/js/jquery.carouFredSel-6.2.1-packedf718.js?ver=4.7.12', array('jquery'), null, true);\n wp_enqueue_script('shortcode5'); \n }", "function pretaoser_register_scripts()\n{\n\t//$theme_version = wp_get_theme()->get('Version');\n\n\twp_enqueue_script('popper', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js', [], false, true);\n\twp_enqueue_script('bootstrap', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js', ['jquery', 'popper'], false, true);\n\twp_enqueue_script('font-awesome-icons', 'https://use.fontawesome.com/releases/v5.13.0/js/all.js', [], false, true);\n\twp_enqueue_script('pretaoser-slick-carousel', get_stylesheet_directory_uri() . '/assets/js/slick.min.js', [], false, true);\n\twp_enqueue_script('pretaoser-main-scripts', get_stylesheet_directory_uri() . '/assets/js/main-scripts.js', ['jquery', 'pretaoser-slick-carousel'], false, true);\n\tif (is_front_page()) {\n\t\twp_enqueue_script('pretaoser-services-carousel', get_stylesheet_directory_uri() . '/assets/js/services-carousel.js', ['jquery', 'pretaoser-slick-carousel'], false, true);\n\t\twp_enqueue_script('pretaoser-testimonials-carousel', get_stylesheet_directory_uri() . '/assets/js/testimonials-carousel.js', ['jquery', 'pretaoser-slick-carousel'], false, true);\n\t}\n}", "function gutenberg_register_scripts() {\n\t$suffix = SCRIPT_DEBUG ? '' : '.min';\n\n\t// Vendor\n\twp_register_script( 'react', 'https://unpkg.com/react@15/dist/react' . $suffix . '.js' );\n\twp_register_script( 'react-dom', 'https://unpkg.com/react-dom@15/dist/react-dom' . $suffix . '.js', array( 'react' ) );\n\n\t// Editor\n\twp_register_script( 'wp-element', plugins_url( 'element/build/index.js', __FILE__ ), array( 'react', 'react-dom' ) );\n\twp_register_script( 'wp-blocks', plugins_url( 'blocks/build/index.js', __FILE__ ), array( 'wp-element' ) );\n}", "function load_theme_scripts() {\n\t\twp_enqueue_script(\n\t\t'script',\n\t\tget_template_directory_uri() . '/js/bundle.min.js#asyncload',\n\t\t[],\n\t\tfalse,\n\t\ttrue\n\t);\n}", "function load_javascript() {\n\t\twp_enqueue_script('jquery');\n\t\twp_enqueue_script('popper', 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.5/umd/popper.min.js', false);\n\t\twp_enqueue_script('bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js', false);\n\t\twp_enqueue_script('fontawesome', 'https://use.fontawesome.com/releases/v5.0.6/js/all.js', false);\n\t\t// wp_enqueue_script('backstretch', get_template_directory_uri() . '/js/jquery.backstretch.min.js', false);\n\t\t// wp_enqueue_script('fancybox', get_template_directory_uri() . '/js/fancybox.1.3.22.js', false);\n\t\t// wp_enqueue_script('magnificpopup', get_template_directory_uri() . '/js/jquery.magnific-popup.min.js', false, null);\n\t\t// wp_enqueue_script('masonry', 'https://cdnjs.cloudflare.com/ajax/libs/masonry/4.2.0/masonry.pkgd.min.js', false);\n\n\t\twp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.js', array( 'jquery' ), null, 'all');\n\t}", "public function register_scripts(){\n\t\t// include file only if js method is enabled\n\t\twp_enqueue_script( 'unslider-js', AAS_BASE_URL . 'public/assets/js/unslider.min.js', array('jquery'), AAS_VERSION );\n\t}", "function fanatic_scripts() {\r\n\t\t// get google CDN jQuery rather than local copy\r\n\t\twp_deregister_script('jquery');\r\n\t\twp_enqueue_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js' , array() , '3.1.0', false);\r\n wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-migrate-1.2.1.min.js' , array() , '1.2.1', false);\r\n\t\t// Theme Styles\r\n\t\t\r\n\twp_enqueue_style( 'slick-style', get_template_directory_uri().'/lib/plugins/slick/slick.css' );\r\n wp_enqueue_style( 'slick-theme-style', get_template_directory_uri().'/lib/plugins/slick/slick-theme.css' );\r\n wp_enqueue_style( 'lightbox-style', get_template_directory_uri().'/lib/plugins/lightbox/css/lightbox.css' );\r\n wp_enqueue_style( 'main-style', get_template_directory_uri().'/css/style.css' );\r\n\t\t// Fonts\r\n\t\twp_enqueue_style( 'font-style', 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,900' );\r\n\t\t// Theme Scripts\r\n\t\t\r\n\t\twp_enqueue_script( 'slick-scripts', get_template_directory_uri().'/lib/plugins/slick/slick.min.js');\r\n wp_enqueue_script( 'isotope-scripts', get_template_directory_uri().'/lib/plugins/isotope/isotope.pkgd.js');\r\n wp_enqueue_script( 'instafeed', get_template_directory_uri().'/lib/plugins/instafeed/instafeed.js');\r\n wp_enqueue_script( 'lightbox', get_template_directory_uri().'/lib/plugins/lightbox/js/lightbox.js');\r\n wp_enqueue_script( 'site-scripts', get_template_directory_uri().'/js/script.min.js',array('jquery', 'slick-scripts', 'isotope-scripts', 'instafeed', 'lightbox'), '29022016' , true );\r\n\t}", "function weavr_scripts() {\n\n\tif (!is_admin()) {\n\n wp_register_script('conditionizr', get_template_directory_uri() . '/assets/js/vendor/conditionizr.js', array(), '4.1.0'); // Conditionizr\n wp_enqueue_script('conditionizr'); // Enqueue it!\n\n\t\twp_register_script( 'modernizr', get_template_directory_uri() . '/assets/js/vendor/modernizr-2.6.2.min.js', false, '2.7.0', false );\n\t\twp_enqueue_script( 'modernizr' );\n\n\t wp_register_script('flauntJS', get_template_directory_uri() . '/assets/js/flaunt-ck.js', array('jquery'), '1.0.0', true); // Custom scripts\n\t wp_enqueue_script('flauntJS'); // Enqueue it!\n\t \t\n\t wp_register_script('weavr_scripts', get_template_directory_uri() . '/assets/js/scripts-ck.js', array(), '1.0.0', true); // Custom scripts\n\t wp_enqueue_script('weavr_scripts'); // Enqueue it!\n \n }\n \n}", "public function add_scripts() {\n\t\t\t\tFusion_Dynamic_JS::enqueue_script( 'fusion-carousel' );\n\t\t\t}", "function custom_scripts() {\n //wp_register_script('site', get_template_directory_uri() . '/js/site.js', 'jquery', '1.0');\n //wp_register_script('cycle2', get_template_directory_uri() . '/js/jquery.cycle2.min.js', 'jquery', '2.1.5');\n\t\t//wp_register_script('gallery', get_template_directory_uri() . '/js/gallery2012.js', 'jquery', '1.0');\n\t\t//wp_register_script('masonry', get_template_directory_uri() . '/js/jquery.masonry.min.js', 'jquery', '1.0');\t\t\n\t\t//wp_register_script('carouFredSel', get_template_directory_uri() . '/js/jquery.carouFredSel-6.2.1-packed.js', 'jquery', '1.0');\t\t\t\t\n\t\t//wp_register_script('vimeo-api', 'http://a.vimeocdn.com/js/froogaloop2.min.js', 'jquery', '1.0');\n //wp_register_script('vimeoplayer', get_template_directory_uri() . '/js/vimeoplayer2013.js', 'jquery', '1.0');\t\t\n //wp_register_script('infinitescroll', get_template_directory_uri() . '/js/jquery.infinitescroll.min.js', 'jquery', '1.0');\t\n \n //wp_enqueue_script('jquery');\n //wp_enqueue_script('carouFredSel', 'jquery'); \t \n //wp_enqueue_script('masonry', 'jquery');\n //wp_enqueue_script('cycle2', 'jquery'); \n //wp_enqueue_script('infinitescroll', 'jquery'); \n //wp_enqueue_script('vimeo-api', 'jquery');\n //wp_enqueue_script('vimeoplayer', 'jquery');\n //wp_enqueue_script('gallery', 'jquery');\n //wp_enqueue_script('site', 'jquery'); \n\n // Setup JS variables in scripts \n\t\t/*\n\t\twp_localize_script('site', 'siteVars', array(\n \t\t'themeURL' => get_template_directory_uri(),\n \t\t'homeURL' => home_url()\n ));\n\t\t*/ \n \n }", "function include_myuploadscript() {\n\tif ( ! did_action( 'wp_enqueue_media' ) ) {\n\t\twp_enqueue_media();\n\t}\n wp_enqueue_style('MyStyles', get_stylesheet_directory_uri() . '/backend-styles/admin-main.min.css');\n \n wp_enqueue_script( 'myuploadscript', get_stylesheet_directory_uri() . '/js/scripts.min.js', array('jquery'), null, false );\n wp_enqueue_script('lazy', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.10/jquery.lazy.min.js');\n wp_enqueue_script('lazyplug', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.10/jquery.lazy.min.js');\n }", "public function enqueue_scripts() {\n wp_register_script($this->_token . '-plugins',\n esc_url($this->assets_url) . 'js/plugins' . $this->script_suffix . '.js', array('jquery'),\n $this->_version, true);\n wp_enqueue_script($this->_token . '-plugins');\n\n wp_register_script($this->_token . '-frontend',\n esc_url($this->assets_url) . 'js/frontend' . $this->script_suffix . '.js', array('jquery'),\n $this->_version, true);\n wp_enqueue_script($this->_token . '-frontend');\n\n }", "public function enqueue_scripts() {\n\n wp_register_script( 'panzi-jquery-cookies', plugin_dir_url( __FILE__ ) . '/js/socialshareprivacy.cupcakebridge/javascripts/jquery.cookies.js', array('jquery'), $this->version, true );\n wp_register_script( 'wp-cupcake-bridge-social-share-privacy', plugin_dir_url( __FILE__ ) . '/js/socialshareprivacy.cupcakebridge/javascripts/socialshareprivacy.js', array('jquery', 'panzi-jquery-cookies'), $this->version, true );\n wp_register_script( 'wp-cupcake-bridge-service', plugin_dir_url( __FILE__ ) . '/js/socialshareprivacy.cupcakebridge/javascripts/modules/cupcakebridge.js', array('jquery', 'panzi-jquery-cookies'), $this->version, true );\n wp_register_script( 'wp-cupcake-bridge', plugin_dir_url( __FILE__ ) .'/js/wp-cupcake-bridge-public.js' , array('jquery'), $this->version, true );\n\n }", "function includeFrontEndFiles(){\n wp_register_script( 'custom_wp_js', get_bloginfo('stylesheet_directory') . '/js/script.js', array('jquery'), '', TRUE );\n wp_enqueue_script( 'custom_wp_js' );\n wp_register_script( 'd3', get_bloginfo('stylesheet_directory') . '/js/d3.min.js', array('jquery'), '', TRUE );\n wp_enqueue_script( 'd3' );\n wp_register_script( 'topojson', get_bloginfo('stylesheet_directory') . '/js/topojson.min.js', array('jquery'), '', TRUE );\n wp_enqueue_script( 'topojson' );\n wp_register_script( 'datamaps', get_bloginfo('stylesheet_directory') . '/js/datamaps.usa.min.js', array('jquery'), '', TRUE );\n wp_enqueue_script( 'datamaps' );\n}", "public function enqueue_scripts() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Cr_Featured_Images_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Cr_Featured_Images_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/cr-featured-images-admin.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-button', 'jquery-ui-slider' ), $this->version, false );\n\t\t//wp_enqueue_script( 'watermark-admin-script', plugins_url( 'js/admin-settings.js', __FILE__ ), array( 'jquery', 'jquery-ui-core', 'jquery-ui-button', 'jquery-ui-slider' ), $this->defaults['version'] );\n\n\t}", "function buscemi_scripts()\n{\n wp_enqueue_script('jquery');\n if (localInstall() == true) {\n $reloadScript = 'http://localhost:35729/livereload.js';\n wp_register_script('livereload', $reloadScript, null, false, true);\n wp_enqueue_script('livereload');\n }\n wp_register_script('lazyload', get_template_directory_uri() . '/app/vendors/lazyload.min.js', null, false, false);\n wp_enqueue_script('lazyload');\n wp_register_script('picturefill', get_template_directory_uri() . '/app/vendors/picturefill.min.js', null, false, false);\n wp_enqueue_script('picturefill');\n// wp_register_script( $handle, $src, $deps, $ver, $in_footer );\n wp_enqueue_style('buscemi_style', get_template_directory_uri() . '/app/main.min.css', null, null, null);\n wp_enqueue_script('buscemi_script', get_template_directory_uri() . '/app/app.min.js', array('jquery'), null, true);\n\n}", "function load_my_scripts() {\r\n \t\t// Register AOS CSS\r\n \t\twp_enqueue_style('aos-css', get_template_directory_uri() . '/ux/vendor/aos.css', array(), null, 'screen');\r\n\r\n \t\t// Register Main CSS\r\n \t\twp_enqueue_style('main-css', get_template_directory_uri() . '/ux/css/styles.min.css', array(), null, 'screen');\r\n\r\n\t\t// Register AOS JS\r\n\t\twp_enqueue_script('aos-js', get_template_directory_uri() . '/ux/vendor/aos.js', array(), null, true);\r\n\r\n\t\t// Register Main JS\r\n\t\twp_enqueue_script('main-js', get_template_directory_uri() . '/ux/js/main.min.js', array('jquery'), null, true);\r\n\r\n\t\t// Localize Main JS for Ajax filtering\r\n\t\twp_localize_script('main-js', 'myAjax', array('ajaxURL' => admin_url('admin-ajax.php')));\r\n\t}", "function load_scripts() {\n\t\n\twp_register_script('jquery', get_template_directory_uri() . '/library/jquery/jquery.min.js', array(), 1, 1, 1 );\n\twp_enqueue_script('jquery');\n\n\twp_register_script('bootstrap-js', get_template_directory_uri() . '/library/bootstrap/js/bootstrap.bundle.min.js', array(), 1, 1, 1 );\n\twp_enqueue_script('bootstrap-js');\n\n\twp_register_script('clean-blog-js', get_template_directory_uri() . '/js/clean-blog.min.js', array(), 1, 1, 1 );\n\twp_enqueue_script('clean-blog-js');\n}", "function iva_frontend_scripts() {\n\twp_register_script('iva-easing', THEME_JS .'/jquery.easing.1.3.js', 'jquery', '', 'in_footer');\n\twp_register_script('iva-sf-hover', THEME_JS .'/hoverIntent.js', '', '', 'in_footer');\n\twp_register_script('iva-sf-menu', THEME_JS .'/superfish.js', '', '', 'in_footer');\n\twp_register_script('iva-gmap-api', 'http://maps.google.com/maps/api/js?sensor=false', '', '', 'in_footer');\n\twp_register_script('iva-gmap-min', THEME_JS . '/jquery.gmap.js', '', '', 'in_footer');\n\twp_register_script('iva-jgalleria', THEME_JS .'/src/galleria.js', '', '', 'in_footer');\n\twp_register_script('iva-jgclassic', THEME_JS .'/src/themes/classic/galleria.classic.js', '', '', 'in_footer');\n\twp_register_script('iva-contact', THEME_JS .'/atp_form.js', '', '', 'in_footer');\n\twp_register_script('iva-jcarousel', THEME_JS .'/jquery.jcarousel.min.js', 'jquery', '', 'in_footer');\n\twp_register_script('iva-jPlayer', THEME_JS. '/jquery.jplayer.min.js', 'jquery', '', 'in_footer');\n\twp_register_script('iva-prettyPhoto', THEME_JS .'/jquery.prettyPhoto.js', 'jquery', '', 'in_footer');\n\twp_register_script('iva-preloader', THEME_JS .'/jquery.preloadify.min.js', 'jquery', '', 'in_footer');\n\twp_register_script('iva-waypoints', THEME_JS .'/waypoints.js', 'jquery', '', 'in_footer');\n\twp_register_script('iva-progresscircle', THEME_JS .'/jquery.easy-pie-chart.js', 'jquery', '', 'in_footer');\n\twp_register_script('iva-excanvas', THEME_JS .'/excanvas.js', 'jquery', '', 'in_footer');\n\twp_register_script('iva-Modernizr', THEME_JS .'/Modernizr.js', '', '', 'in_footer');\n\twp_register_script('iva-isotope', THEME_JS .'/isotope.js', '', '', 'in_footer');\n\twp_register_script('iva-fitvids', THEME_JS .'/jquery.fitvids.js','jquery', '', 'in_footer');\n\twp_register_script('iva-custom', THEME_JS . '/sys_custom.js', 'jquery', '', 'in_footer');\n\t\n\t/**\n\t * Enqueue Frontend Scripts\n\t */\n\twp_enqueue_script('jquery');\n\twp_enqueue_script('iva-easing');\n\twp_enqueue_script('iva-sf-hover');\n\twp_enqueue_script('iva-sf-menu');\n\twp_enqueue_script('iva-jPlayer');\n\twp_enqueue_script('iva-preloader');\n\twp_enqueue_script('iva-prettyPhoto');\n\twp_enqueue_script('iva-Modernizr');\n\twp_enqueue_script('iva-isotope');\n\twp_enqueue_script('iva-fitvids');\n\twp_enqueue_script('iva-custom');\n\twp_enqueue_script('iva-waypoints');\n\n\twp_localize_script( 'jquery', 'atp_panel', array( 'SiteUrl' => get_template_directory_uri() ) );\t\t\n\n\twp_register_style( 'iva-responsive', THEME_CSS . '/responsive.css', array(), '1', 'screen' );\n\n\t// Enqueue Frontend Styles\n\twp_enqueue_style('iva-theme-style', get_stylesheet_uri() );\n\twp_enqueue_style('iva-animate', THEME_CSS.'/animate.css', array(), '1', 'screen' );\n\twp_enqueue_style('iva-prettyPhoto', THEME_CSS.'/prettyPhoto.css', array(), '1', 'screen' );\n\twp_enqueue_style('iva-responsive' );\n\twp_enqueue_style('iva-jplayer',THEME_CSS.'/blue.monday/jplayer.blue.monday.css', array(), '1', 'screen' );\n\n\tif ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }\n\n\tif ( get_option( 'iva_style' ) != '0' ) {\n\t\t$iva_style = get_option( 'iva_style' );\n\t\twp_enqueue_style( 'iva-style', THEME_URI.'/colors/'.$iva_style, array(), '1', 'screen' );\n\t}\n\t\n}" ]
[ "0.76612014", "0.7484132", "0.7368726", "0.7324035", "0.7262334", "0.72299796", "0.7197293", "0.7178415", "0.7146802", "0.71334606", "0.71171796", "0.7115912", "0.7097696", "0.70910084", "0.7078047", "0.7047628", "0.7041055", "0.7040829", "0.7037962", "0.7029319", "0.702055", "0.7017971", "0.70169526", "0.70150447", "0.70005476", "0.6978042", "0.69753385", "0.6969611", "0.69644195", "0.6964182" ]
0.8434599
0
Setup product wise mail config
public function __construct() { $config = Config::get('product.' . env('PRODUCT') . '.mail'); Config::set('mail',$config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initialConfig() {\n\t\t$this->mailer->isHTML(TRUE);\n\t\t$this->mailer->FromName = SMTP_FROM_NAME;\n\t\t$this->mailer->From = SMTP_SENDER;\n\t\t$this->mailer->Sender = SMTP_SENDER;\n\n\t\t$this->mailer->IsSMTP(); \n\t\t$this->mailer->SMTPAuth = TRUE; \n\t\t$this->mailer->SMTPSecure = SMTP_SECURE; \n\t\t$this->mailer->Host = SMTP_HOST; \n\t\t$this->mailer->Port = SMTP_PORT; \n\t\t$this->mailer->Username = SMTP_EMAIL_ACCOUNT; \n\t\t$this->mailer->Password = SMTP_EMAIL_PASSWORD; \n\n\t\t//Subject\n\t\t$this->mailer->Subject = $this->getSubject();\n\t}", "function ServerAdminMail( )\n\t{\n\t\t// call our conf reader\n\t\t$this->core = new ServerAdminCore;\n\t\t//var_dump($this);\n\t\t$this->setProgramsAndDefaults( 'mail' );\n\n\t\tif($vpostmail = $this->getConfig('mail', 'vpostmail'))\n\t\t{\n\t\t\t$this->vpostmail = $vpostmail;\n\t\t}\n\t\t\n\t\t$this->addProg('vpostmail', $this->vpostmail);\n\t}", "public function bootSetEmailConfigs()\n {\n if (class_exists('Cuenta')) {\n $cuenta = \\Cuenta::cuentaSegunDominio();\n\n $mail_from = env('MAIL_FROM_ADDRESS');\n if(empty($mail_from)) {\n $mail_from = $cuenta['nombre'] . '@' . env('APP_MAIN_DOMAIN', 'localhost');\n }\n\n $data = [\n 'address' => $mail_from,\n 'name' => $cuenta['nombre_largo'],\n ];\n\n config(['mail.from' => $data]);\n }\n }", "private function __setEmailSettings() {\n $this->cronEmails = array(\n 'dev' => array(\n '[email protected]'\n ),\n 'live' => array(\n '[email protected]'\n )\n );\n }", "public function mail_configAction()\n {\n $data = null;\n $mail_config = Settings::findFirst(\"name = 'mail_config'\");\n if ($mail_config && $mail_config->value) {\n $data = json_decode($mail_config->value);\n }\n\n $this->view->data = $data;\n\n if ($this->request->isPost()) {\n // get data from form\n $from_name = $this->request->getPost('from_name');\n $from_email = $this->request->getPost('from_email');\n $smtp_server = $this->request->getPost('smtp_server');\n $smtp_port = $this->request->getPost('smtp_port');\n $smtp_security = $this->request->getPost('smtp_security');\n $smtp_username = $this->request->getPost('smtp_username');\n $smtp_password = $this->request->getPost('smtp_password');\n $smtp_test = $this->request->getPost('smtp_test');\n\n // check data\n if (!$from_name || !$from_email || !$smtp_server) {\n $this->flash->error($this->t->_('Please input data'));\n $this->backendRedirect('/settings/mail_config');\n }\n\n // default port\n if (!$smtp_port) {\n $smtp_port = 25;\n }\n // default not security\n if (!$smtp_security) {\n $smtp_security = 0;\n }\n\n // send test mail\n if ($smtp_test == '1') {\n $email = new MyMail();\n $email->setMailSettings(array(\n 'fromName' => $from_name,\n 'fromEmail' => $from_email,\n 'smtp' => array(\n 'server' => $smtp_server,\n 'port' => $smtp_port,\n 'security' => $smtp_security,\n 'username' => $smtp_username,\n 'password' => $smtp_password\n )\n ));\n\n try {\n $email->send($from_email, 'Caro Framework Send Test Mail', 'Caro Framework Send Test Mail');\n $this->flash->warning($this->t->_('Please check your email to see mail test.') . ' Email: ' . $from_email);\n } catch (\\Swift_SwiftException $e) {\n $this->flash->error($e->getMessage());\n }\n\n $this->backendRedirect('/settings/mail_config');\n\n } else {\n // create/update settings\n if ($mail_config) {\n $mail_config->name = 'mail_config';\n $mail_config->value = json_encode(array(\n 'from_name' => $from_name,\n 'from_email' => $from_email,\n 'smtp_server' => $smtp_server,\n 'smtp_port' => $smtp_port,\n 'smtp_security' => $smtp_security,\n 'smtp_username' => $smtp_username,\n 'smtp_password' => $smtp_password,\n ));\n $mail_config->update();\n\n } else {\n $settings = new Settings();\n $settings->name = 'mail_config';\n $settings->value = json_encode(array(\n 'from_name' => $from_name,\n 'from_email' => $from_email,\n 'smtp_server' => $smtp_server,\n 'smtp_port' => $smtp_port,\n 'smtp_security' => $smtp_security,\n 'smtp_username' => $smtp_username,\n 'smtp_password' => $smtp_password,\n ));\n $settings->save();\n }\n\n $this->flash->success($this->t->_('Update mail server is success'));\n $this->backendRedirect('/settings/mail_config');\n }\n }\n }", "public function actionConfiguracionmails()\n {\n Yii::import('application.models.CojEmailPlaceholder');\n $data = [];\n $data['emailsConfig'] = CojEmailPlaceholder::getEmailsPlaceholder();\n $this->layout = 'layout_dashboad_profile_admin';\n $this->render('emailsConfig', $data);\n }", "public function email_template_setting() {\r\n\t\t\t$email_template = get_option( 'cp_failure_email_template' );\r\n\t\t\t$email_template_sbj = get_option( 'cp_failure_email_subject' );\r\n\r\n\t\t\tif ( isset( $email_template_sbj ) && '' !== $email_template_sbj ) {\r\n\t\t\t\t$subject = $email_template_sbj;\r\n\t\t\t} else {\r\n\t\t\t\t/* translators: %s Product name */\r\n\t\t\t\t$subject = sprintf( __( 'Important Notification! - [SITE_NAME] - %s [MAILER_SERVICE_NAME] configuration error', 'convertpro-addon' ), CPRO_BRANDING_NAME );\r\n\t\t\t}\r\n\r\n\t\t\tif ( isset( $email_template ) && '' !== $email_template ) {\r\n\t\t\t\t$template = $email_template;\r\n\t\t\t} else {\r\n\t\t\t\t$template = 'The design <strong>[DESIGN_NAME]</strong> integrated with <strong>[MAILER_SERVICE_NAME]</strong> is not working! The following error occured when a user tried to subscribe - \\n\\n[ERROR_MESSAGE]\\n\\nPlease check <a href=\"[DESIGN_LINK]\" target=\"_blank\" rel=\"noopener\">configuration</a> settings ASAP.\\n\\n ----- \\n\\n The details of the subscriber are given below.\\n\\n [FORM_SUBMISSION_DATA] \\n\\n ----- \\n\\n [ [SITE_NAME] - [SITE_URL] ]';\r\n\t\t\t\t$template = str_replace( '\\n', \"\\n\", $template );\r\n\t\t\t}\r\n\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t<h3 class=\"cp-gen-set-title cp-error-services-title\"><?php esc_html_e( 'Error Notification', 'convertpro-addon' ); ?></h3>\r\n\t\t\t<p>\r\n\t\t\t<?php\r\n\t\t\tesc_html_e( 'This is an email that will be sent to you every time a user subscribes through a form and some error is encountered. You can customize the email subject and body in the fields below. ', 'convertpro-addon' );\r\n\t\t\t?>\r\n\t\t\t<strong>Note:</strong>\r\n\t\t\t<?php\r\n\t\t\tesc_html_e( 'This is applicable when you integrate with some mailer service.', 'convertpro-addon' );\r\n\t\t\t?>\r\n\t\t\t</p>\r\n\t\t\t<table class=\"cp-postbox-table form-table\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<label for=\"option-admin-menu-subject-page\"><?php esc_html_e( 'Template Subject', 'convertpro-addon' ); ?></label>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type=\"text\" id=\"cp_failure_email_subject\" name=\"cp_failure_email_subject\" value=\"<?php echo esc_html( stripslashes( $subject ) ); ?>\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<label for=\"option-admin-menu-template-page\"><?php esc_html_e( 'Template', 'convertpro-addon' ); ?></label>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<textarea id=\"cp_failure_email_template\" name=\"cp_failure_email_template\" rows=\"10\" cols=\"50\" ><?php echo esc_textarea( ( stripslashes( $template ) ) ); ?></textarea>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t<?php\r\n\t\t\techo ob_get_clean(); //PHPCS:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\r\n\t\t}", "public function setUp()\n\t{\n\t\t$this->mail->isSMTP(); // Set mailer to use SMTP\n\t\t$this->mail->Mailer = 'smtp';\n\t\t$this->mail->SMTPAuth = true; // authentication enabled\n\t\t$this->mail->SMTPSecure = 'tls'; // secure transfer enabled REQUIRED for GMail ; encription options must match requirement of email service provider eg. gmail.com , yahoo.com , google.com\n\n\t\t//create env set up followed .env file\n\t\t$this->mail->Host = getenv('SMTP_HOST'); //SMTP server name\n\t\t$this->mail->Port = getenv('SMTP_PORT'); //TCP port to connect to \n\n\t\t$environment = getenv('APP_ENV');\n\t\t//in dev, env is called local\n\t\t//in production, env is called production\n\t\tif($environment === 'local'){\n\t\t\t// this SMTPOptions have to be changed once we use GoDaddy server.\n\t\t\t$this->mail->SMTPOptions =[\n\t\t\t\t'ssl' => array(\n\t\t\t\t\t'verify_peer' => false,\n\t\t\t\t\t'verify_peer_name' => false,\n\t\t\t\t\t'allow_self_signed' => true\n\t\t\t\t)\n\t\t\t];\n\n\t\t\t// $this->mail->SMTPDebug =2; // Enable verbose debug output\n\t\t\t$this->mail->SMTPDebug = '';\n\t\t}\n\n\t\t//auth info\n\t\t$this->mail->Username = getenv('EMAIL_USERNAME'); //SMTP username ; it is set in C:\\xampp\\sendmail\\sendmail.ini and C:\\xampp\\php\\php.ini\n\t\t$this->mail->Password = getenv('EMAIL_PASSWORD'); //SMTP password ; it is set in C:\\xampp\\sendmail\\sendmail.ini and C:\\xampp\\php\\php.ini\n\n\t\t//enable email to be send as html\n\t\t$this->mail->isHTML(true); // Set email format to HTML\n\t\t$this->mail->SingleTo = true;\n\n\t\t//sender info\n\t\t$this->mail->From = getenv('ADMIN_EMAIL'); \n\t\t$this->mail->FromName= getenv('ADMIN_EMAIL'); \n\n \t }", "function setMailAdmin() {\n $mail = new Core_Mail();\n $mail->setDestinatarioCreateUser();\n $mail->setAsunto('nuevo usuario');\n $mail->setMensaje('se ha reado un nuevo usuario ');\n $mail->send();\n }", "function smptp_mail($config = [])\n{\n global $system;\n\n /**\n * get envirotment variabel config secara global\n */\n\n $mail_system[\"MAIL_DEBUG\"] = ($system[\"MAIL_DEBUG\"] == \"true\" ) ? TRUE : FALSE;\n $mail_system[\"MAIL_MAILER\"] = $system[\"MAIL_MAILER\"] ? $system[\"MAIL_MAILER\"] : \"\";\n $mail_system[\"MAIL_HOST\"] = $system[\"MAIL_HOST\"] ? $system[\"MAIL_HOST\"] : \"\";\n $mail_system[\"MAIL_PORT\"] = $system[\"MAIL_PORT\"] ? $system[\"MAIL_PORT\"] : \"\";\n $mail_system[\"MAIL_USERNAME\"] = $system[\"MAIL_USERNAME\"] ? $system[\"MAIL_USERNAME\"] : \"\";\n $mail_system[\"MAIL_PASSWORD\"] = $system[\"MAIL_PASSWORD\"] ? $system[\"MAIL_PASSWORD\"] : \"\";\n $mail_system[\"MAIL_ENCRYPTION\"] = $system[\"MAIL_ENCRYPTION\"] ? $system[\"MAIL_ENCRYPTION\"] : \"\";\n $mail_system[\"MAIL_FROM_ADDRESS\"] = $system[\"MAIL_FROM_ADDRESS\"] ? $system[\"MAIL_FROM_ADDRESS\"] : \"\";\n $mail_system[\"MAIL_FROM_NAME\"] = $system[\"MAIL_FROM_NAME\"] ? $system[\"MAIL_FROM_NAME\"] : \"\";\n\n $email = new Mailer($mail_system);\n\n $data[\"to\"] = $config[\"to\"] ? $config[\"to\"] : \"\";\n $data[\"subject\"] = $config[\"subject\"]? $config[\"subject\"] : \"\";\n $data[\"message\"] = $config[\"message\"] ? $config[\"message\"] : \"\"; \n $data[\"header\"] = $config[\"header\"] ? $config[\"header\"] : \"\";\n $data[\"template\"] = $config[\"template\"] ? $config[\"template\"] : \"\";\n\n /**\n * Check email validation\n */\n\n // check string email\n if (empty($data[\"to\"])) {\n echo \"silahkan isi alamat emailnya terlebih dahulu<br>\";\n }else{\n // validate email\n if (filter_var($data[\"to\"] , FILTER_VALIDATE_EMAIL)) {\n // email valid \n $email->send_mail($data);\n // echo $data[\"to\"] .\"is a valid email address\" ;\n } else {\n // email tidak valid\n echo $data[\"to\"] . \" is not a valid email address\";\n }\n } \n}", "public function setMailTransporter($email_template) {\n $ret = true;\n\n // Now (2019-12-19) send all mail via Pepipost\n // Set Pepipost SMTP Config\n $config = Config::get('product.' . env('PRODUCT') . '.mail_pepipost');\n Config::set('mail',$config);\n\n return $ret;\n }", "function lynt_customize_mail_settings($phpmailer) {\n //$phpmailer->From = \"[email protected]\";\n //Set custom From Name\n //$phpmailer->FromName = 'Vlada Smitka';\n \n //Set Sender (Return-Path) to From address \n $phpmailer->Sender = $phpmailer->From;\n \n //Setup your own SMTP server\n /*\n $phpmailer->Host = 'smpt.server';\n $phpmailer->Port = 465;\n $phpmailer->SMTPSecure = 'tls';\n $phpmailer->Username = 'jmeno';\n $phpmailer->Password = 'heslo';\n $phpmailer->SMTPAuth = true;\n $phpmailer->IsSMTP();\n */\n}", "protected function sendVendorNotification(){\n \t\n \t\t\ttry {\n \t\t\t\t$fieldsetData['subject'] = 'DS360 Product Setup completed on Magento';\n \t\t\t\t$postObject = new Varien_Object();\n \t\t\t\t$postObject->setData($fieldsetData);\n \t\t\t\t$templateId = 'logicbroker_productsetup_notification';\n \t\t\t\t$email = Mage::helper('dropship360')->getConfigObject('apiconfig/email/toaddress');\n \t\t\t\t$isMailSent = Mage::helper('dropship360')->sendMail($postObject,$email,$templateId);\n \t\t\t\tif (!$isMailSent) {\n \t\t\t\t\tMage::helper('dropship360')->genrateLog(0,'Order notification started','Order notification ended','First product setup complete successfully but email sending failed');\n \t\t\t\t}\n \t\t\t\treturn true;\n \t\t\t} catch (Exception $e) {\n \t\t\treturn false;//$e->getMassage();\n \t\t}\n \t}", "protected function mailConfigCheck()\n {\n if (!$this->app['config']->get('general/mailoptions') && $this->app['users']->getCurrentuser() && $this->app['users']->isAllowed('files:config')) {\n $notice = json_encode([\n 'severity' => 1,\n 'notice' => 'The <strong>mail configuration parameters</strong> have not been set up. This may interfere with password resets, and extension functionality. Please set up the <code>mailoptions</code> in <code>config.yml</code>.',\n ]);\n $this->app['logger.flash']->configuration($notice);\n }\n }", "function smtp() {\n \n // Verify if the smtp option is enabled\n if ( get_option('smtp-enable') ) {\n \n // Set the default protocol\n $protocol = 'sendmail';\n \n // Verify if user have added a protocol\n if ( get_option('smtp-protocol') ) {\n \n $protocol = get_option('smtp-protocol');\n \n }\n \n // Create the configuration array\n $d = array(\n 'mailtype' => 'html',\n 'charset' => 'utf-8',\n 'smtpauth' => true,\n 'priority' => '1',\n 'newline' => \"\\r\\n\",\n 'protocol' => $protocol,\n 'smtp_host' => get_option('smtp-host'),\n 'smtp_port' => get_option('smtp-port'),\n 'smtp_user' => get_option('smtp-username'),\n 'smtp_pass' => get_option('smtp-password')\n );\n \n // Verify if ssl is enabled\n if (get_option('smtp-ssl')) {\n \n $d['smtp_crypto'] = 'ssl';\n \n } elseif (get_option('smtp-tls')) {\n \n // Set TSL if is enabled\n $d['smtp_crypto'] = 'tls';\n \n }\n \n return $d;\n \n } else {\n \n return ['mailtype' => 'html', 'charset' => 'utf-8', 'newline' => \"\\r\\n\", 'priority' => '1'];\n \n }\n \n }", "protected function makeEmails()\n {\n }", "private function getEmailDetails()\n {\n $config['protocol'] = (string) ConfigXml::getInstance()->config->email->{'protocol'};\n\t\t\t$config['smtp_host'] = (string) ConfigXml::getInstance()->config->email->{'smtp-host'};\n\t\t\t$config['smtp_user'] = (string) ConfigXml::getInstance()->config->email->{'smtp-user'};\n\t\t\t$config['smtp_pass'] = (string) ConfigXml::getInstance()->config->email->{'smtp-pass'};\n\t\t\t$config['smtp_port'] = (string) ConfigXml::getInstance()->config->email->{'smtp-port'};\n\n\t\t\t$config['charset'] = 'iso-8859-1';\n\t\t\t$config['wordwrap'] = TRUE;\n $config['mailtype'] = 'html';\n\n return $config;\n }", "function mailer($from,$name,$title,$body,$field_attachment=NULL,$arr_cate_id,$menu_class,$support_lang='vi',$send_me=false,$mail_to=false){\n\n\t\t$this->phpmailer->IsSMTP();\n\n\t\t$str_select=\"*\";\n\t\t$arr_where_in=array('email_server_smtp','email_port_smtp','email_secure_smtp','email_debug_smtp','email_your_name','email_email_smtp','email_pass_smtp');\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where_in('general_config.general_config_id',$arr_where_in);\n\t\t$query=$this->db->get('general_config');\n\t\t$arr_general_config=$query->result_array();\n\n\t\tif(is_array($arr_general_config) && !empty($arr_general_config)){\n\n\t\t\tforeach($arr_general_config as $key=> $value){\n\t\t\t\t$arr_config[element('general_config_id',$value,'')]=element('general_config_value',$value,'');\n\t\t\t}\n\n\t\t\ttry{\n\n\t\t\t\t$this->phpmailer->CharSet=\"utf-8\";\n\n\t\t\t\t$this->phpmailer->Host=$arr_config['email_server_smtp']; // specify main and backup server :smtp.gmail.com\n\t\t\t\t$this->phpmailer->Port=$arr_config['email_port_smtp']; // set the port to use :465\n\n\t\t\t\t$this->phpmailer->SMTPAuth=true; // turn on SMTP authentication :true\n\t\t\t\tif(preg_match(\"/ssl/i\",$arr_config['email_secure_smtp']))\n\t\t\t\t\t$this->phpmailer->SMTPSecure=$arr_config['email_secure_smtp']; // :ssl\n\t\t\t\t$this->phpmailer->Username=$arr_config['email_email_smtp']; // your SMTP username or your gmail username :[email protected] \n\t\t\t\t$this->phpmailer->Password=$arr_config['email_pass_smtp']; // your SMTP password or your gmail password :123456789\n\n\t\t\t\t$this->phpmailer->From=$arr_config['email_email_smtp'];\n\t\t\t\t$this->phpmailer->FromName=$arr_config['email_your_name']; // Name to indicate where the email came from when the recepient received\n\n\t\t\t\tif($mail_to != false){\n\n\t\t\t\t\t$str_select='*';\n\t\t\t\t\t$arr_where=array($this->_table.'.support_id'=>$mail_to,$this->_table.'.support_public'=>1,'category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$support_lang,'category_sub.cate_public'=>1);\n\n\t\t\t\t\t$this->db->select($str_select);\n\t\t\t\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t\t\t\t$this->db->where($arr_where);\n\n\t\t\t\t\t$query=$this->db->get($this->_table);\n\t\t\t\t\t$arr_support=$query->row_array();\n\n\t\t\t\t\tif(is_array($arr_support) && !empty($arr_support)){\n\n\t\t\t\t\t\t$this->phpmailer->AddAddress($arr_support['support_nick'],$arr_support['support_name']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->phpmailer->AddAddress($arr_config['email_email_smtp'],$arr_config['email_your_name']);\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\t$str_select='*';\n\t\t\t\t\t$arr_where=array($this->_table.'.support_public'=>1,'category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$support_lang,'category_sub.cate_public'=>1);\n\n\t\t\t\t\t$this->db->select($str_select);\n\t\t\t\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t\t\t\t$this->db->where($arr_where);\n\t\t\t\t\t$this->db->where_in($this->_table.'.cate_id',$arr_cate_id);\n\n\t\t\t\t\t$query=$this->db->get($this->_table);\n\t\t\t\t\t$arr_support=$query->result_array();\n\n\t\t\t\t\tif(is_array($arr_support) && !empty($arr_support)){\n\n\t\t\t\t\t\t$this->phpmailer->AddAddress($arr_support[0]['support_nick'],$arr_support[0]['support_name']);\n\t\t\t\t\t\tfor($i=1; $i < count($arr_support); $i++)\n\t\t\t\t\t\t\t$this->phpmailer->AddCC($arr_support[$i]['support_nick'],$arr_support[$i]['support_name']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->phpmailer->AddAddress($arr_config['email_email_smtp'],$arr_config['email_your_name']);\n\t\t\t\t}\n\n\t\t\t\tif($send_me === true)\n\t\t\t\t\t$this->phpmailer->AddCC($from,$name);\n\n\t\t\t\t$this->phpmailer->AddReplyTo($from,$name);\n\t\t\t\t$this->phpmailer->WordWrap=50; //set word wrap\n\t\t\t\t$this->phpmailer->IsHTML(true); // send as HTML\n\t\t\t\t$this->phpmailer->Subject=$title;\n\t\t\t\t$this->phpmailer->Body=$body; //HTML Body\n\t\t\t\t$this->phpmailer->AltBody=\"\"; //Text Body\n\t\t\t\t$this->phpmailer->SMTPDebug=$arr_config['email_debug_smtp']; // 1=errors and messages\n\t\t\t\t// 2=messages only \n\t\t\t\t$this->phpmailer->PluginDir=\"\";\n\n\t\t\t\tif($field_attachment !== NULL && isset($_FILES[$field_attachment]) && $_FILES[$field_attachment]['error'] == UPLOAD_ERR_OK)\n\t\t\t\t\t$this->phpmailer->AddAttachment($_FILES[$field_attachment]['tmp_name'],$_FILES[$field_attachment]['name'],'base64','application/octet-stream');\n\n\t\t\t\tif($this->phpmailer->Send()){\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(phpmailerException $e){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t}", "protected function _initFromConfig()\n {\n $frontController = Zend_Controller_Front::getInstance();\n $options = $frontController->getParam('bootstrap')\n ->getApplication()\n ->getOptions();\n\n if (!array_key_exists('mail', $options)) {\n return;\n }\n $mailOptions = $options['mail'];\n\n $senderMail = $mailOptions['sender']['from'];\n $senderName = $mailOptions['sender']['name'];\n if (!empty($senderMail)) {\n $this->setFrom($senderMail, $senderName);\n }\n\n $sendViaSmtp = ($mailOptions['sendViaSmtp'] == 1 ? true : false);\n if ($sendViaSmtp) {\n if (!array_key_exists('host', $mailOptions['smtp'])) {\n throw new MBit_Exception('while sending mails via smtp, a host has to be configured');\n }\n\n $host = trim((string) $mailOptions['smtp']['host']);\n unset($mailOptions['smtp']['host']);\n\n $smtpOptions = $mailOptions['smtp'];\n $transport = new Zend_Mail_Transport_Smtp($host, $smtpOptions);\n $this->setDefaultTransport($transport);\n }\n }", "function mail_config()\n {\n\n\n // // $mail->IsSMTP();\n // // $mail->SMTPDebug = 0;\n // // $mail->Debugoutput = 'html';\n // // $mail->Mailer = \"smtp\";\n // // $mail->SMTPAuth = false; \n // // $mail->Port = 25; \n // // $mail->Host = \"10.165.35.105\";\n\n // $mail->IsSMTP();\n\n // $mail->SMTPOptions = array(\n // 'ssl' => array(\n // 'verify_peer' => false,\n // 'verify_peer_name' => false,\n // 'allow_self_signed' => true\n // )\n // );\n $mail = new PHPMailer;\n $mail->isSMTP();\n $mail->SMTPDebug = 0;\n $mail->Debugoutput = 'html';\n $mail->Mailer = \"smtp\";\n $mail->SMTPAuth = true; \n $mail->Username = '[email protected]'; \n $mail->Password = 'wisdompark00123'; \n $mail->Port = 465; \n $mail->Host = \"ssl://smtp.gmail.com\";\n $mail->From = '[email protected]';\n $mail->FromName = 'WisdomPark';\n \n // $mail = new PHPMailer;\n // $mail->isSMTP();\n // $mail->SMTPDebug = 2;\n // $mail->Host = 'smtp.hostinger.com';\n // $mail->Port = 587;\n // $mail->SMTPAuth = true;\n // $mail->Username = '[email protected]';\n // $mail->Password = 'wisdompark00123';\n // $mail->setFrom('[email protected]', 'Wisdom Park');\n\n return $mail;\n }", "private function sendEmail($product)\n {\n $email = require_once 'email.php';\n if (!mail($email, sprintf('%s model is in stock!', $product['name']), $product['url'])) {\n echo \"\\n\", sprintf('Email failed to send for model %s. Link: %s', $product['name'], $product['url']);\n }\n }", "public function sendNotificationEmail()\n {\n $helper=Mage::helper('kdcatalogupdates');\n if($helper->isEnabled()){\n $logCollection=Mage::getModel('kdcatalogupdates/log')->getCollection();\n if($logCollection->count()){\n $notificationEmail= $helper->getNotificationEmail();\n $emailTemplate = Mage::getModel('core/email_template')\n ->loadDefault('productattribute_update_notification');\n\n $emailTemplateVariables = array();\n $emailTemplate->setTemplateSubject('Changed Product Attributes');\n $emailTemplate->setSenderName($helper->getSenderName());\n $emailTemplate->setSenderEmail($helper->getSenderEmail());\n if($emailTemplate->send($notificationEmail,'', $emailTemplateVariables))\n {\n foreach($logCollection as $log){\n $log->delete();\n }\n }\n }\n }\n }", "function sendMail($mail_config)\n {\n $message = $this->getMessageTemplate($mail_config['message_template'],$mail_config['message_data']);\n $this->email->from('[email protected]', 'MK Solutions');\n $this->email->to($mail_config['to']);\n\n\t\t\n\t\tif( array_key_exists('cc', $mail_config) == true)\n\t\t\t$this->email->cc($mail_config['cc']);\n\n\t\tif( array_key_exists('bcc', $mail_config) == true){\n\t\t\t/*if($mail_config['bcc'] != \"[email protected]\")\n\t\t\t\t$this->email->bcc($mail_config['bcc'],\"[email protected]\");\n\t\t\telse*/\n\t\t\t\t$this->email->bcc($mail_config['bcc']);\n\t\t}\n\t\t//else\n\t\t\t//$this->email->bcc(\"[email protected]\");\n\t\t\n\t\t$this->email->subject($mail_config['subject']);\n $this->email->message($message);\n\n if($this->email->send())\n return true; \n else return false;\n }", "public function emailConfigAction()\n {\n $block = $this->getLayout()->createBlock(\n 'ddg_automation/adminhtml_dashboard_tabs_config'\n );\n $this->getResponse()->setBody($block->toHtml());\n }", "private function config(){\n //Instantiates class property $connection to new PHPMailer object from composer package\n $this->connection = new PHPMailer;\n //Set SMTP propert of $connection to true\n $this->connection->isSMTP(); \n $this->connection->SMTPAutoTLS = false;\n $this->connection->SMTPDebug = 2;\n $this->connection->Debugoutput = 'html'; \n //Set SMTP host \n $this->connection->Host = EMAIL_HOST; \n $this->connection->SMTPAuth = true; \n //Set credentials of SMTP connection \n $this->connection->Username = EMAIL_USERNAME; \n $this->connection->Password = EMAIL_PASSWORD;\n //SET connection protocol, SSL or TLS\n $this->connection->SMTPSecure = EMAIL_SMTP_SECURE;\n //SET port according to connection protocol for host\n $this->connection->Port = EMAIL_PORT;\n $this->connection->setFrom(EMAIL_USERNAME, EMAIL_SENDER_NAME);\n $this->connection->isHTML(true);\n /*Options diable peer verficaion,\n * Should not be done in professional deployment\n * but done for sake of testing\n */ \n $this->connection->SMTPOptions = array(\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n 'allow_self_signed' => true\n ),\n 'tls' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n 'allow_self_signed' => true\n )\n );\n }", "function transport_email_admin(){\n}", "public function send_email(){\n // Get recipients from config file ( webroot/files/mail_config.cfg )\n $cfg_file = fopen(\"files/mail_config.cfg\", \"r\") or die(\"Unable to open file!\");\n $cfg_to = fgets($cfg_file);\n fclose($cfg_file);\n\n // Set up the e-mail.\n $mail_to = $this->request->data('Message')['email'] . \" , \" . $cfg_to;\n $mail_subject = $this->request->data('Message')['subject'];\n $mail_message = \"<html><body>\";\n $mail_message .= \"<h1>Hello MessageApp!</h1>\";\n $mail_message .= \"<p>\" . $this->request->data('Message')['message'] . \"</p>\";\n $mail_message .= \"</body></html>\";\n $mail_headers = \"From: \" . strip_tags('[email protected]') . \"\\r\\n\";\n $mail_headers .= \"MIME-Version: 1.0\\r\\n\";\n $mail_headers .= \"Content-Type: text/html; charset=ISO-8859-1\\r\\n\";\n\n // Send the mail.\n mail($mail_to, $mail_subject, $mail_message, $mail_headers);\n }", "protected static function addConfigEmailLog() {\n self::$event->getIO()->write(\":: add email logging to Silverstripe _config.php\");\n File::addContent(\n self::$config_silverstripe_old, \n \"SS_Log::add_writer(new SS_LogEmailWriter('\".self::$project_company_email.\"'), SS_Log::WARN, '<=');\"\n );\n }", "public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n \n $product= $observer->getProduct(); \n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n $property = $objectManager->get ( 'Magento\\Catalog\\Model\\Product' )->load ( $product->getId() );\n $templateId = 'airhotels_product_admin_booking_delete_option';\n $propertyName = $property->getName ();\n $userId = $property->getUserId ();\n $customer = $objectManager->get ( 'Magento\\Customer\\Model\\Customer' )->load ( $userId );\n $recipient = $customer->getEmail ();\n $customerName = $customer->getName ();\n if (! empty ( $recipient ) && $userId ) {\n /**\n * Sending property delete email to host\n */\n $admin = $objectManager->get ( 'Apptha\\Airhotels\\Helper\\Data' );\n /**\n * Assign admin details\n */\n $adminName = $admin->getAdminName ();\n $adminEmail = $admin->getAdminEmail ();\n /* Receiver Detail */\n $receiverInfo = [\n 'name' => $customerName,\n 'email' =>$recipient\n ];\n /* Sender Detail */\n $senderInfo = [\n 'name' => $adminName,\n 'email' => $adminEmail,\n ];\n $emailTempVariables = (array (\n 'ownername' => $adminName,\n 'pname' => $propertyName,\n 'cname' => $customerName\n ));\n /* We write send mail function in helper because if we want to\n use same in other action then we can call it directly from helper */\n \n /* call send mail method from helper or where you define it*/\n $objectManager->get('Apptha\\Airhotels\\Helper\\Email')->yourCustomMailSendMethod(\n $emailTempVariables,\n $senderInfo,\n $receiverInfo,\n $templateId\n );\n }\n }", "function merchant_checkout_send_admin_email( $purchase, $details, $email ) {\n\n\t\t// Make sure email content exists\n\t\tif ( !is_array( $details ) || !array_key_exists( 'email_2_subject', $details ) || !array_key_exists( 'email_2_content', $details ) ) return;\n\n\t\t// Variables\n\t\t$admin_email = sanitize_email( get_option( 'admin_email' ) );\n\t\t$name = get_bloginfo( 'name' );\n\t\t$domain = merchant_get_site_domain();\n\n\t\t// Setup email\n\t\t$headers = array(\n\t\t\t'From: ' . $name . ' <notifications@' . $domain . '>',\n\t\t\t'Sender: ' . $name . ' <' . $admin_email . '>',\n\t\t\t'Reply-To: ' . $name . ' <' . $admin_email . '>',\n\t\t);\n\t\t$subject = $details['email_2_subject'];\n\t\t$message = nl2br( str_replace( '{{username}}', $email, $details['email_2_content'] ) );\n\n\t\t// Send email\n\t\twp_mail( $admin_email, $subject, $message, $headers );\n\n\t}" ]
[ "0.7043164", "0.6992924", "0.6580031", "0.6530009", "0.63401055", "0.62656355", "0.6222098", "0.6210698", "0.6166014", "0.61587745", "0.61537194", "0.6141898", "0.6025962", "0.59978837", "0.59755427", "0.59742963", "0.5964908", "0.5955716", "0.593572", "0.59248835", "0.5908267", "0.58680296", "0.5866765", "0.58570707", "0.5853759", "0.58427715", "0.5842213", "0.5828311", "0.5816974", "0.57927185" ]
0.7230528
0
Calculate the number of seconds with the given delay.
protected function getSeconds($delay) { if ($delay instanceof DateTime) { return max(0, $delay->getTimestamp() - $this->getTime()); } elseif ($delay instanceof \Carbon\Carbon) { return max(0, $delay->timestamp - $this->getTime()); } elseif (isset($delay['date'])) { $time = strtotime($delay['date']) - $this->getTime(); return $time; } else { $delay = strtotime($delay) - time(); } return (int)$delay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDelay(): int;", "public function getDelay(): int;", "public function getDelay(): int\n {\n return $this->delay;\n }", "public function getDelay();", "public function time_delay() {\n return block_quickmail_plugin::calculate_seconds_from_time_params($this->get('time_delay_unit'),\n $this->get('time_delay_amount'));\n }", "public function getDelay(): float\n {\n return $this->delay;\n }", "function get_timing_delay() {\n\n\t\t$timing_type = $this->get_timing_type();\n\n\t\tif ( ! in_array( $timing_type, array( 'delayed', 'scheduled' ) ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$number = $this->get_timing_delay_number();\n\t\t$unit = $this->get_timing_delay_unit();\n\n\t\t$units = array(\n\t\t\t'm' => MINUTE_IN_SECONDS,\n\t\t\t'h' => HOUR_IN_SECONDS,\n\t\t\t'd' => DAY_IN_SECONDS,\n\t\t\t'w' => WEEK_IN_SECONDS,\n\t\t);\n\n\t\tif ( ! $number || ! isset( $units[ $unit ] ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn $number * $units[ $unit ];\n\t}", "private static function calculateDelay($val) {\r\n\t\t// Defensive programming\r\n\t\t$count = $val['count'];\r\n\t\t$count = $count < 1 ? 1 : $count;\r\n\t\t$count = $count > self::THOTTLE_MAX_COUNT ? self::THOTTLE_MAX_COUNT : $count;\r\n\r\n\t\treturn self::THROTTLE_TIME + self::THROTTLE_TIME * ($count - 1) * self::THROTTLE_FACTOR;\r\n\t}", "function computeTakeIntoAccountDelayStat() {\n\n if (isset($this->fields['id'])\n && !empty($this->fields['date'])) {\n $calendars_id = $this->getCalendar();\n $calendar = new Calendar();\n\n // Using calendar\n if (($calendars_id > 0) && $calendar->getFromDB($calendars_id)) {\n return max(1, $calendar->getActiveTimeBetween($this->fields['date'],\n $_SESSION[\"glpi_currenttime\"]));\n }\n // Not calendar defined\n return max(1, strtotime($_SESSION[\"glpi_currenttime\"])-strtotime($this->fields['date']));\n }\n return 0;\n }", "public function seconds();", "public function getSeconds() {}", "public function getSeconds() {}", "private function get_update_sleep_time() {\n //f(x) = 2 / (1 + e^(-x + 5)) + 1\n $denominator = 1 + pow(2.72, $this->numUpdates * -1 + 5);\n $updateTime = (2 / $denominator) + 1;\n $this->numUpdates += 1;\n return intval($updateTime * 1000000);\n //return self::UPDATE_SLEEP_TIME\n }", "private function calculateTimeDelta(): int\n {\n $endpoint = sprintf('https://%s/1.0/auth/time', $this->getEndpoint());\n $response = $this->client->request('GET', $endpoint);\n\n return $response->getContent() - time();\n }", "public function getSeconds(): int\n {\n return $this->seconds;\n }", "public function getElapsedSecs();", "protected function get_time()\n\t{\n\t\t$ret_val = microtime(true) - $this->timer;\n\n\t\treturn $ret_val;\n\t}", "function getSeconds();", "public function calcWaitTime(): int\n {\n return round(1000000 / $this->throughputLimit);\n }", "public function getTotalElapsedSeconds() {}", "public function getDurationSec()\n\t{\n\t\treturn $this->getDtend()->getTimestamp() - $this->getDtstart()->getTimestamp();\n\t}", "public function getDelay($retries, $with_jitter = true)\n {\n return 0;\n }", "public function getSecondsBeforeNextAttempts();", "public function calculateIntervalSeconds()\n {\n // If previous closed interval exists use its last message date to start calculate current time\n $lastTime = (int) $this->startMessage->getDateAdded()->format('U');\n $time = (int) $this->endMessage->getDateAdded()->format('U');\n\n if ($time > $lastTime + self::TIME_WINDOW) {\n $seconds = self::TIME_WINDOW;\n\n } else {\n $seconds = $time - $lastTime;\n }\n\n return $seconds;\n }", "public function calculated_send_time() {\n return time() + $this->time_delay();\n }", "function precision_timer($action = 'start', $start_time = null)\n{\n $currtime = microtime(true);\n\n if ($action == 'stop') {\n return $currtime - $start_time;\n }\n\n return $currtime;\n}", "static function secondstotime($sec) {\r\n\t\t}", "public function getDelay()\n {\n return $this->delay;\n }", "public function getDelay()\n {\n return $this->delay;\n }", "public function getTimeoutSec()\n {\n return isset($this->timeout_sec) ? $this->timeout_sec : 0;\n }" ]
[ "0.67994297", "0.67994297", "0.6584746", "0.650127", "0.64806336", "0.6315355", "0.62532395", "0.624358", "0.6060163", "0.60469943", "0.5926993", "0.5926993", "0.5886529", "0.5866355", "0.5864915", "0.5860028", "0.58564013", "0.5849923", "0.5844864", "0.58415145", "0.5779665", "0.5770018", "0.57587034", "0.5753039", "0.5696867", "0.56757164", "0.5653964", "0.56474555", "0.56474555", "0.5631187" ]
0.78689647
0
Return Mail Template names for sending mail via Pepipost
public function getPepipostMailTemplates() { $ret = []; $ret = [ 'emails.' . env('PRODUCT') . '.customer.forgetpassword', 'emails.' . env('PRODUCT') . '.customer.welcome', 'emails.' . env('PRODUCT') . '.customer.email_verification', //'emails.' . env('PRODUCT') . '.customer.customerorder', ]; return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function mailTemplates() {\n $t = array(\n 'completed' => 'order-completed.txt',\n 'completed-wm' => 'order-completed-webmaster.txt',\n 'completed-dl' => 'order-completed-dl.txt',\n 'completed-wm-dl' => 'order-completed-dl-webmaster.txt',\n 'pending' => 'order-pending.txt',\n 'pending-wm' => 'order-pending-webmaster.txt',\n 'refunded' => 'order-refunded.txt',\n 'cancelled' => 'order-cancelled.txt',\n 'completed-wish' => 'order-completed-wish.txt',\n 'completed-wish-dl' => 'order-completed-wish-dl.txt',\n 'completed-wish-recipient' => 'order-completed-wish-recipient.txt',\n 'completed-wish-recipient-dl' => 'order-completed-wish-recipient-dl.txt'\n );\n return $t;\n }", "public function mailTemplates() {\n $t = array(\n 'completed' => 'order-completed.txt',\n 'completed-wm' => 'order-completed-webmaster.txt',\n 'completed-dl' => 'order-completed-dl.txt',\n 'completed-wm-dl' => 'order-completed-dl-webmaster.txt',\n 'pending' => 'order-pending.txt',\n 'pending-wm' => 'order-pending-webmaster.txt',\n 'refunded' => 'order-refunded.txt',\n 'cancelled' => 'order-cancelled.txt',\n 'completed-wish' => 'order-completed-wish.txt',\n 'completed-wish-dl' => 'order-completed-wish-dl.txt',\n 'completed-wish-recipient' => 'order-completed-wish-recipient.txt',\n 'completed-wish-recipient-dl' => 'order-completed-wish-recipient-dl.txt'\n );\n return $t;\n }", "public function getTemplateName()\n\t{\n\t\treturn 'uitypes/Email.tpl';\n\t}", "function get_template_names() {\n\treturn array(\n\t\t'upcoming-renewal',\n\t\t'thanks-one-time-donation',\n\t\t'thanks-recurring-donation',\n\t);\n}", "function templates()\n {\n return [\"registration.tpl\",\"activation.tpl\",\"mail_tpl/activation_mail.tpl\"];\n }", "public function ListEmailTemplates()\n {\n return $this->callMethod(__FUNCTION__);\n }", "public function registerMailTemplates()\n {\n return [];\n }", "function email_template($data=array()){\n\t\n\t$type=$data['type'];\n\tif($type == 'FP'){\n\t\tforgot_pass_template($data);\n\t}\n}", "function getTemplateNames() {\n\t\treturn $this->pl->getTemplateNames();\n\t}", "private function getTemplates()\n {\n return EmailConfig::fetchAll(Context::getContext()->language->id);\n }", "public abstract function getMailingTemplateManager();", "public function sendmailwithtemplateAction() {\r\n $Emaillist = $this->getEmailappTable()->searchBy($_REQUEST); \r\n $iddata = $_POST['maillist']; \r\n $idlist = explode(',', $iddata); \r\n foreach ($idlist as $id) {\r\n $iddatum = $this->getEmailappTable()->getMailContent($id); \r\n $to_name = $iddatum['name'];\r\n $to_email = $iddatum['email'];\r\n $email_template = $_POST['body'];\r\n $email_template = str_replace('{user}', $iddatum['name'], $email_template);\r\n $email_template = str_replace('{table_content}', $iddatum['content'], $email_template);\r\n $triggerMail = new EmailAlert(array());\r\n $mail_send = $triggerMail->sendBulkEmail($to_email,$to_name,$email_template);\r\n $updateDate = $this->getEmailappTable()->UpdateEmailapp($iddatum['id']); \r\n }\r\n $this->flashMessenger()->addSuccessMessage('Mail Sent successfully');\r\n return $this->redirect()->toRoute('emailapp');\r\n }", "public function buildFromTemplate() {\n\t\t//html\n\t\ttry {\n\t\t\t$template = new Template('tenant_portal', 'mail/'.$this->template);\n\t\t\tif ($this->params && !empty($this->params)) {\n\t\t\t\tforeach ($this->params as $key => $value) {\n\t\t\t\t\t$template->assign($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$html = $template->fetchPage();\n\t\t} catch (\\Exception $e) {\n\t\t\t$html = null;\n\t\t}\n\t\t// plain text\n\t\ttry {\n\t\t\t$template = new Template('tenant_portal', 'mail/'.$this->template.'.plain');\n\t\t\tif ($this->params && !empty($this->params)) {\n\t\t\t\tforeach ($this->params as $key => $value) {\n\t\t\t\t\t$template->assign($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$text = $template->fetchPage();\n\t\t} catch (\\Exception $e) {\n\t\t\t$text = null;\n\t\t}\n\t\treturn Array($html,$text);\n\t}", "public function getEmailTemplate()\n {\n return $this->emailTemplate;\n }", "public function getTemplateArray()\n {\n return [\n 'title' => 'title.message.html.twig',\n 'body' => $this->channel . '.message.html.twig',\n ];\n }", "public static function collectionName()\n {\n return 'messageTemplate';\n }", "function handler_email_template($handler, $email)\n\t\t{\n\t\t\treturn handler_templates_dir($handler).\"email/$email.txt\";\n\t\t}", "function get_email_template( $template_name ) {\n\t$query_args = array(\n\t\t'post_type' => EMAIL_POST_TYPE,\n\t\t'orderby' => 'date',\n\t\t'order' => 'DESC',\n\t\t'numberposts' => 1,\n\t\t'meta_key' => 'wpf-stripe_email-template-name',\n\t\t'meta_value' => $template_name,\n\t);\n\n\t$result = get_posts( $query_args );\n\n\tif ( empty( $result ) ) {\n\t\treturn false;\n\t}\n\n\t$current_template = array_shift( $result );\n\n\treturn $current_template;\n}", "function email_tpl($name, $object)\n\t{\n\t\t$ci = &get_instance();\n\t\t$templates = $ci->model->get(\"*\", TABLE_EMAIL_TEMPLATES, ['name' => $name], '', '', true);\n\n\t\tif (isset($templates[$object])) return $templates[$object];\n\t}", "function _getTemplateEmail( $emailTemplate )\r\n\t{\r\n\t\t$message \t= file_get_contents( $emailTemplate );\r\n\t\treturn $message;\r\n\t}", "function add_file_sharing_email_templates() {\n $CI = &get_instance();\n\n $data['file_sharing_templates'] = $CI->emails_model->get(['type' => 'file_sharing', 'language' => 'english']);\n\n $CI->load->view('file_sharing/email_templates', $data);\n }", "public function getTemplateName($module_conf)\n {\n $email_conf= array();\n \n $email_conf= $this->getConfiguarationSetting('email_birthday_conf');\n \n return $email_conf['birthday_coupon']['email_templates'];\n }", "function _invite_template() {\n\t\treturn Array( 'send-invites.php' );\n\t}", "public function getMailPostPubliSubject();", "public function getEmailTemplateShort()\n\t{\n\t\treturn $this->_emailTemplateShort;\n\t}", "function bbp_get_single_reply_template()\n{\n}", "function compose_mail()\n\t{\n\t\t$from = $title = $message = $email = '';\n\n\t\t$message = __('Message from page: ').$this->page.\"\\n\";\n\t\tforeach ($this->form as $key => $value)\n\t\t{\n\t\t\t$message .= $key.' = '.$value.\"\\n\";\n\t\t}\n\n\t\t// reserved words\n\t\tif (isset($this->form['email']) != '') \t{ $email .= $this->form['email'].' ';\t}\n\t\tif (isset($this->form['name']) != '') \t{ $from .= $this->form['name'].' ';\t}\n\t\tif (isset($this->form['title']) != '')\t{ $title .= $this->form['title'].' ';\t}\n\n\t\tif ((get_option('wordpress_api_key') != '') AND (file_exists('/wp-content/plugins/fcc/akismet.php'))) return $this->akismet_sendmail($message,$from,$email,$title);\n\t\telse return $this->sendmail($message,$from,$email,$title);\n\n\t}", "function send_template_mail ($template_slug, $to, $args = array()) {\n\n $template = get_page_by_path($template_slug, OBJECT, 'post');\n $template_id = get_the_subtitle($template);\n\n if (!$template || !$template_id) {\n error_log('Email template not found: ' . $template_slug);\n return false;\n }\n\n\t$headers = new SendGrid\\Email();\n $headers->setTemplateId($template_id);\n\n\tforeach ($args as $key => $value) {\n\t\t$headers->addSubstitution('[%' . $key . '%]', array($value));\n }\n\n $result = wp_mail($to, '', '', $headers);\n\n\tif ($result) {\n\t\terror_log('[Bingo] Template email \"' . $template_slug . '\" sent to ' . $to . ' ' . json_encode($args));\n\t} else {\n\t\terror_log('Email sent fail, to: ' . $to . ', header was: ' . json_encode($headers, JSON_UNESCAPED_UNICODE));\n }\n\n\treturn $result;\n}", "public function getListTemplate()\n {\n $res = phpfox::getLib('phpfox.database')->select('distinct mt.*,e.type_id')\n ->from($this->_sTable,'mt')\n ->leftjoin(phpfox::getT('emailsystem'),'e','e.template_id = mt.template_id') \n ->execute('getRows');\n \n if( count($res) <=0)\n {\n return null;\n }\n return $res;\n }", "public function getTemplateName();" ]
[ "0.7586142", "0.7586142", "0.66689306", "0.64540243", "0.6453635", "0.64444846", "0.6418486", "0.63008", "0.6288247", "0.622616", "0.6196337", "0.6171688", "0.61559534", "0.60994256", "0.6086571", "0.60793483", "0.6079115", "0.60730004", "0.605275", "0.60262305", "0.60165083", "0.5978001", "0.596382", "0.5907973", "0.5869477", "0.5855513", "0.58345014", "0.58225834", "0.5807069", "0.579045" ]
0.77129656
0
Sets Mail Transporter according to mail template
public function setMailTransporter($email_template) { $ret = true; // Now (2019-12-19) send all mail via Pepipost // Set Pepipost SMTP Config $config = Config::get('product.' . env('PRODUCT') . '.mail_pepipost'); Config::set('mail',$config); return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _setDefaultMailTransport()\r\n\t{\r\n\t\t$settings = array(\r\n\t\t\t'auth' => isset($this->_config->mail->auth) ? $this->_config->mail->auth : null,\r\n\t\t\t'username' => isset($this->_config->mail->username) ? $this->_config->mail->username : null,\r\n\t\t\t'password' => isset($this->_config->mail->password) ? $this->_config->mail->password : null,\r\n\t\t\t'ssl' => isset($this->_config->mail->ssl) ? $this->_config->mail->ssl : null,\r\n\t\t\t'port' => isset($this->_config->mail->port) ? $this->_config->mail->port : null\r\n\t\t);\t\r\n\r\n\t\t\t\t\t\r\n\t\t$tr = new Zend_Mail_Transport_Smtp($this->_config->mail->smtp, $settings);\r\n\t\tZend_Mail::setDefaultTransport($tr);\r\n\t}", "private function getTransport()\n\t{\n\t\treturn Config::get('email/transport', 'mail');\n\t}", "private function _initMailer(){\n\t\t\n\t\t//Configuracion\n\t\t$configParams = array(\n\t\t\t'auth' => 'login',\n\t\t\t'username' => $this->_username,\n\t\t\t'password' => $this->_password,\n\t\t);\n\t\t\n\t\t//Transporter\n\t\treturn ($this->_ZendTransporter = new Zend_Mail_Transport_Smtp($this->_server, $configParams));\n\t\t\n\t}", "private static function getMailTransport()\n {\n return \\Swift_MailTransport::newInstance();\n }", "private function initialConfig() {\n\t\t$this->mailer->isHTML(TRUE);\n\t\t$this->mailer->FromName = SMTP_FROM_NAME;\n\t\t$this->mailer->From = SMTP_SENDER;\n\t\t$this->mailer->Sender = SMTP_SENDER;\n\n\t\t$this->mailer->IsSMTP(); \n\t\t$this->mailer->SMTPAuth = TRUE; \n\t\t$this->mailer->SMTPSecure = SMTP_SECURE; \n\t\t$this->mailer->Host = SMTP_HOST; \n\t\t$this->mailer->Port = SMTP_PORT; \n\t\t$this->mailer->Username = SMTP_EMAIL_ACCOUNT; \n\t\t$this->mailer->Password = SMTP_EMAIL_PASSWORD; \n\n\t\t//Subject\n\t\t$this->mailer->Subject = $this->getSubject();\n\t}", "function setup_phpmailer(PHPMailer &$phpmailer) {\n\n $phpmailer->set('exceptions', false);\n\n // Return path setting\n $return_path = $this->get_option('return_path');\n if (!empty($return_path)) {\n if (empty($phpmailer->Sender))\n $phpmailer->Sender = $return_path;\n }\n\n // SMTP configuration\n $host = $this->get_option('smtp_host');\n if (!empty($host)) {\n $user = $this->get_option('smtp_user');\n $pass = $this->get_option('smtp_pass');\n $port = $this->get_option('smtp_port');\n $this->log('Using SMTP');\n $phpmailer->Host = $host;\n $phpmailer->IsSMTP();\n if (!empty($port))\n $phpmailer->Port = (int) $port;\n\n if (!empty($user)) {\n $phpmailer->SMTPAuth = true;\n $phpmailer->Username = $user;\n $phpmailer->Password = $pass;\n }\n }\n\n $sender_name = $this->get_option('sender_name');\n $sender_email = $this->get_option('sender_email');\n switch ($this->get_option('sender')) {\n\n case 'always':\n if (!empty($sender_email))\n $phpmailer->From = $sender_email;\n if (!empty($sender_name))\n $phpmailer->FromName = $sender_name;\n break;\n\n case 'default':\n if (strpos($phpmailer->From, 'wordpress@') !== false) {\n if (!empty($sender_email))\n $phpmailer->From = $sender_email;\n if (!empty($sender_name))\n $phpmailer->FromName = $sender_name;\n }\n break;\n }\n }", "function lynt_customize_mail_settings($phpmailer) {\n //$phpmailer->From = \"[email protected]\";\n //Set custom From Name\n //$phpmailer->FromName = 'Vlada Smitka';\n \n //Set Sender (Return-Path) to From address \n $phpmailer->Sender = $phpmailer->From;\n \n //Setup your own SMTP server\n /*\n $phpmailer->Host = 'smpt.server';\n $phpmailer->Port = 465;\n $phpmailer->SMTPSecure = 'tls';\n $phpmailer->Username = 'jmeno';\n $phpmailer->Password = 'heslo';\n $phpmailer->SMTPAuth = true;\n $phpmailer->IsSMTP();\n */\n}", "function IsMail() {\n $this->Mailer = \"mail\";\n }", "public abstract function getMailingTemplateManager();", "protected function createMailDriver()\n\t{\n\t\treturn MailTransport::newInstance();\n\t}", "public function mailer($mailer);", "public function setTemplate($template)\n {\n $tempPath = $this->_config->email->templatesPath;\n $this->_template = $template;\n $myView = new Zend_View;\n $myView->setScriptPath($tempPath);\n $hasContent = false;\n\n // compile html template if available\n $fileName = 'html.'.$template;\n $filePath = $tempPath.'/'.$fileName;\n\n if ( is_file($filePath) ) {\n $this->_logger->info('Custom_Email::setTemplate(): Rendering HTML \"' . $template . '\" template.');\n $viewHtml = clone $myView;\n $this->_body_html = $this->applyTokens($viewHtml, $fileName);\n $hasContent = true;\n }\n\n // compile plain text template if available\n $fileName = 'plain.'.$template;\n $filePath = $tempPath.'/'.$fileName;\n\n if ( is_file($filePath) ) {\n $this->_logger->info('Custom_Email::setTemplate(): Rendering plain text \"' . $template . '\" template.');\n $viewPlain = clone $myView;\n $this->_body_plain = $this->applyTokens($viewPlain,$fileName);\n $hasContent = true;\n }\n \n if ( !$hasContent ) {\n $this->_logger->err('Custom_Email::setTemplate(' . $template . '): Unable to find e-mail template.');\n }\n }", "public static function registerTransport()\n {\n $client = self::getClient();\n $mailer = self::getMailer();\n $transport = new SparkPostApiTransport($client);\n $mailer = new Mailer($transport);\n Injector::inst()->registerService($mailer, MailerInterface::class);\n return $mailer;\n }", "public function mailer(string $mailer): self;", "public function setTransportLanguage()\n {\n $transporter = TransporterFactory::build();\n $transporter->setHeaderOnRequest($this->request);\n }", "public function setMailer(Mailer $mailer)\r\n\t{\r\n\r\n\t\t$this->mailer = $mailer;\r\n\r\n\t}", "protected function _initFromConfig()\n {\n $frontController = Zend_Controller_Front::getInstance();\n $options = $frontController->getParam('bootstrap')\n ->getApplication()\n ->getOptions();\n\n if (!array_key_exists('mail', $options)) {\n return;\n }\n $mailOptions = $options['mail'];\n\n $senderMail = $mailOptions['sender']['from'];\n $senderName = $mailOptions['sender']['name'];\n if (!empty($senderMail)) {\n $this->setFrom($senderMail, $senderName);\n }\n\n $sendViaSmtp = ($mailOptions['sendViaSmtp'] == 1 ? true : false);\n if ($sendViaSmtp) {\n if (!array_key_exists('host', $mailOptions['smtp'])) {\n throw new MBit_Exception('while sending mails via smtp, a host has to be configured');\n }\n\n $host = trim((string) $mailOptions['smtp']['host']);\n unset($mailOptions['smtp']['host']);\n\n $smtpOptions = $mailOptions['smtp'];\n $transport = new Zend_Mail_Transport_Smtp($host, $smtpOptions);\n $this->setDefaultTransport($transport);\n }\n }", "public function useMailjet(): Mailer\n\t{\n\t\t$this->setHandlerMode(self::HANDLER_MODE_MAILJET);\n\t\treturn $this;\n\t}", "public function setMailTransport(TransportInterface $mailTransport)\n {\n $this->mailTransport = $mailTransport;\n }", "protected function setTemplate()\n {\n $this->template = 'user/day.tpl';\n }", "public function email_template_setting() {\r\n\t\t\t$email_template = get_option( 'cp_failure_email_template' );\r\n\t\t\t$email_template_sbj = get_option( 'cp_failure_email_subject' );\r\n\r\n\t\t\tif ( isset( $email_template_sbj ) && '' !== $email_template_sbj ) {\r\n\t\t\t\t$subject = $email_template_sbj;\r\n\t\t\t} else {\r\n\t\t\t\t/* translators: %s Product name */\r\n\t\t\t\t$subject = sprintf( __( 'Important Notification! - [SITE_NAME] - %s [MAILER_SERVICE_NAME] configuration error', 'convertpro-addon' ), CPRO_BRANDING_NAME );\r\n\t\t\t}\r\n\r\n\t\t\tif ( isset( $email_template ) && '' !== $email_template ) {\r\n\t\t\t\t$template = $email_template;\r\n\t\t\t} else {\r\n\t\t\t\t$template = 'The design <strong>[DESIGN_NAME]</strong> integrated with <strong>[MAILER_SERVICE_NAME]</strong> is not working! The following error occured when a user tried to subscribe - \\n\\n[ERROR_MESSAGE]\\n\\nPlease check <a href=\"[DESIGN_LINK]\" target=\"_blank\" rel=\"noopener\">configuration</a> settings ASAP.\\n\\n ----- \\n\\n The details of the subscriber are given below.\\n\\n [FORM_SUBMISSION_DATA] \\n\\n ----- \\n\\n [ [SITE_NAME] - [SITE_URL] ]';\r\n\t\t\t\t$template = str_replace( '\\n', \"\\n\", $template );\r\n\t\t\t}\r\n\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t<h3 class=\"cp-gen-set-title cp-error-services-title\"><?php esc_html_e( 'Error Notification', 'convertpro-addon' ); ?></h3>\r\n\t\t\t<p>\r\n\t\t\t<?php\r\n\t\t\tesc_html_e( 'This is an email that will be sent to you every time a user subscribes through a form and some error is encountered. You can customize the email subject and body in the fields below. ', 'convertpro-addon' );\r\n\t\t\t?>\r\n\t\t\t<strong>Note:</strong>\r\n\t\t\t<?php\r\n\t\t\tesc_html_e( 'This is applicable when you integrate with some mailer service.', 'convertpro-addon' );\r\n\t\t\t?>\r\n\t\t\t</p>\r\n\t\t\t<table class=\"cp-postbox-table form-table\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<label for=\"option-admin-menu-subject-page\"><?php esc_html_e( 'Template Subject', 'convertpro-addon' ); ?></label>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input type=\"text\" id=\"cp_failure_email_subject\" name=\"cp_failure_email_subject\" value=\"<?php echo esc_html( stripslashes( $subject ) ); ?>\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t\t<label for=\"option-admin-menu-template-page\"><?php esc_html_e( 'Template', 'convertpro-addon' ); ?></label>\r\n\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<textarea id=\"cp_failure_email_template\" name=\"cp_failure_email_template\" rows=\"10\" cols=\"50\" ><?php echo esc_textarea( ( stripslashes( $template ) ) ); ?></textarea>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t<?php\r\n\t\t\techo ob_get_clean(); //PHPCS:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\r\n\t\t}", "public function prepare(): Mailer\n\t{\n\t\t# Reset handler\n\t\t$this->handler = null;\n\n\t\t# Create Monitoring Status\n\t\tswitch ($this->handlerMode) {\n\t\t\tcase self::HANDLER_MODE_PHPMAILER:\n\t\t\tcase self::HANDLER_MODE_SWIFTMAILER:\n\t\t\tcase self::HANDLER_MODE_MAILJET:\n\t\t\t\t$this->param->setVia($this->handlerMode);\n\t\t\t\t$this->Monitoring()->create($this->param);\n\t\t\t\tbreak;\n\t\t\tcase self::HANDLER_MODE_MAILJETBULK:\n\t\t\t\tif($global = $this->bulk->getGlobal()) {\n\t\t\t\t\t$global->setVia($this->handlerMode);\n\t\t\t\t\t$this->Monitoring()->create($global);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Undefined mail hander');\n\t\t}\n\n\t\t# [ONLY IF ENABLE] > Prepare mail\n\t\tif($this->enabled) {\n\n\t\t\tswitch ($this->handlerMode) {\n\t\t\t\tcase self::HANDLER_MODE_PHPMAILER:\n\t\t\t\t\t$this->handler = new Handler_PHPMailer($this->config->PHPMailerConfig(), $this->param);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::HANDLER_MODE_SWIFTMAILER:\n\t\t\t\t\t$this->handler = new Handler_SwiftMailer($this->config->SwiftMailerConfig(), $this->param);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::HANDLER_MODE_MAILJET:\n\t\t\t\t\t$this->handler = new Handler_Mailjet($this->config->MailjetConfig(), $this->param);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::HANDLER_MODE_MAILJETBULK:\n\t\t\t\t\t$this->handler = new Handler_MailjetBulk($this->config->MailjetConfig(), $this->bulk);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Exception('Undefined mail hander');\n\t\t\t}\n\n\t\t\t$this->handler->prepare();\n\t\t}\n\n\t\treturn $this;\n\t}", "function so_agent_mail_smtp()\n\t{\n\t\tparent::so_agent();\n\t\t$this->agent_table = $this->wf_table.'mail_smtp';\n\t}", "function IsSMTP() {\n $this->Mailer = \"smtp\";\n }", "function IsSendmail() {\n $this->Mailer = \"sendmail\";\n }", "protected function getSwiftmailer_Mailer_Default_TransportService()\n {\n $this->services['swiftmailer.mailer.default.transport'] = $instance = new \\Swift_Transport_SpoolTransport(${($_ = isset($this->services['swiftmailer.mailer.default.transport.eventdispatcher']) ? $this->services['swiftmailer.mailer.default.transport.eventdispatcher'] : $this->getSwiftmailer_Mailer_Default_Transport_EventdispatcherService()) && false ?: '_'}, ${($_ = isset($this->services['swiftmailer.mailer.default.spool']) ? $this->services['swiftmailer.mailer.default.spool'] : $this->get('swiftmailer.mailer.default.spool')) && false ?: '_'});\n\n $instance->registerPlugin(${($_ = isset($this->services['swiftmailer.mailer.default.plugin.messagelogger']) ? $this->services['swiftmailer.mailer.default.plugin.messagelogger'] : $this->get('swiftmailer.mailer.default.plugin.messagelogger')) && false ?: '_'});\n\n return $instance;\n }", "public function setMailSender($mail_sender);", "function setTemplate($file) {\n\t\t\t$tpl = dirname(__FILE__).\"/../../templ/\".$file;\n\n\t\t\tif (!file_exists($tpl)) {\n\t\t\t\tthrow new RuntimeException(\"Mail template \".$file.\" was not found.\");\n\t\t\t}\n\n\t\t\t$f = file_get_contents($tpl);\n\n\t\t\t// Extract subject from the template\n\t\t\tif (preg_match('#^@subject\\s+(.*)(\\r\\n|\\n|$)#', $f, $match, PREG_OFFSET_CAPTURE)) {\n\t\t\t\t$this->subject = $match[1][0];\n\t\t\t\t$f = substr($f, 0, $match[0][1]).substr($f, $match[0][1] + strlen($match[0][0]));\n\t\t\t}\n\n\t\t\t// Extract rest of the message\n\t\t\t$this->body = $f;\n\t\t}", "public static function setDefaultMailer(Mailer $mailer)\n {\n self::$defaultMailer = $mailer;\n }", "public function __construct($destinatario,$assunto,$template,$variaveis) {\n\t\tinclude('phpmailer/class.phpmailer.php');\n\t\tif (!file_exists(\"config.ini\"))\n\t\t\tdie(\"Não encontrei o arquivo config.ini dentro da pasta \\\"web\\\" ou você arruma ou eu paro por aqui.<br>Verifique o arquivo de exemplo chamado \\\"config.ini.sample\\\"\");\n\t\t$ini_array = parse_ini_file(\"config.ini\", true);\n\t\t\n\t\tself::$smtp_host = $ini_array['smtp_host'];\n\t\tself::$user = $ini_array['smtp_user'];\n\t\tself::$remetente_email = $ini_array['smtp_user'];\n\t\tself::$pass = $ini_array['smtp_password'];\n\t\n\t\t// Setup PHPMailer\n\t\tself::$mail = new PHPMailer();\n\t\tself::$mail->IsSMTP();\n\t\tself::$mail->SMTPDebug = false;\n\t\tself::$mail->Debug = false;\n\t\t// This is the SMTP mail server\n\t\tself::$mail->Host = self::$smtp_host;\n\t\tself::$mail->Port = self::$smtp_port;\n\t\tself::$mail->SMTPAutoTLS = false;\n\t\t// Remove these next 3 lines if you dont need SMTP authentication\n\t\tself::$mail->SMTPAuth = true;\n\t\tself::$mail->Username = self::$user;\n\t\tself::$mail->Password = self::$pass;\n\t\t//self::$mail->SMTPSecure = 'ssl';\n\t\t\n\t\t// Set who the email is coming from\n\t\tself::$mail->SetFrom(self::$remetente_email, self::$remetente_nome);\n\t\t\t\t\n\t\t// Set who the email is sending to\n\t\tself::$mail->AddAddress($destinatario);\n\n\t\t// Set the subject\n\t\tself::$mail->Subject = $assunto;\n\n\t\t// Encoding e anything\n\t\tself::$mail->CharSet = 'UTF-8';\n\t\tself::$mail->Encoding = 'base64';\n\t\t\n\t\t// Retrieve the email template required\n\t\t$message = file_get_contents('mail_templates/'.$template.'.html');\n\n\t\tforeach ($variaveis as $key => $value) {\n\t\t\t$message = str_replace('%'.$key.'%', $value, $message);\n\t\t}\t\t\n\t\t\n\t\t//Set the message\n\t\tself::$mail->MsgHTML($message);\n\t\t//self::$mail->AltBody(strip_tags($message));\n\t}" ]
[ "0.6801594", "0.6704808", "0.6491934", "0.61982226", "0.6190495", "0.61586046", "0.6083593", "0.60437953", "0.6037448", "0.5919039", "0.59093153", "0.5840594", "0.580579", "0.58009696", "0.5784956", "0.5745959", "0.5735082", "0.56640065", "0.56264836", "0.5624991", "0.5593757", "0.5579007", "0.5577691", "0.5574113", "0.5560874", "0.55480146", "0.5545832", "0.55356115", "0.551951", "0.55143815" ]
0.7514835
0
Checks if the directory is already processed by Hindsight
public function isInitted() { return (FileStorage::isUsefulDirectory($this->directory) && FileStorage::isUsefulFile($this->directory . "/hindsight.json") && FileStorage::isUsefulFile($this->directory . "/hindsight.lock")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasDirectory()\n {\n return ! empty($this->directories);\n }", "public function hasDir(){\n return $this->_has(8);\n }", "public function valid() {\n\t\t// We are still valid if there is a directory left to scan.\n\t\treturn count($this->dir) != 0;\n\t}", "public function hasDirectory() : bool\n {\n return isset($this->directory);\n }", "private static function q001()\n\t{\n\t\t$status = self::get_folder_status();\n\t\treturn !$status['output'];\n\t}", "private function running() {\n return file_exists('analizing.lock');\n }", "public function directoryExists(): bool\n {\n return File::exists($this->directory);\n }", "public function is_valid_dir() {\n if ($this->filecount > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function isExist()\r\n {\r\n return $this->dir->isExist($this->getFilePath());\r\n }", "protected function _init()\n {\n\n /*\n * Fail immediately if the directory has not been set\n */\n if (is_null($this->_directory))\n {\n return false;\n }\n\n if (!$this->isActive())\n {\n\n /*\n * Directory check\n */\n if (!is_readable($this->_directory))\n {\n mkdir($this->_directory);\n file_put_contents($this->_directory . 'index.html', '');\n }\n\n }\n\n /*\n * Final check after all of the above\n */\n if ($this->isActive())\n {\n return true;\n }\n\n return false;\n\n }", "public function exists()\n {\n return isset($this->dirname) &&\n file_exists( $this->getPath().$this->dirname );\n }", "public function isExist() : bool {\n return self::isFileExist($this->getAbsolutePath());\n }", "private static function q002()\n\t{\n\t\t$status = self::get_folder_status();\n\t\treturn !$status['temporary'];\n\t}", "public function isExists(){\n\t\t// Very strange: file_exists('') === true!!!\n\t\treturn ('' != $this->path() and file_exists($this->path()));\n\t}", "private function check_for_directory_errors() {\n $errors = FALSE;\n\n // If the output path doesn't exist\n if( !is_dir( $this->output_path ) )\n {\n $this->messages[] = 'The path ' . $this->output_path . ' does not exists';\n $errors = TRUE;\n }\n\n // Checking if the directory where the output files will be written, is readable/writable\n if(!is_writable($this->output_path) || !is_readable($this->output_path)) {\n $this->messages[] = $this->output_path . ' is not a readable or writable directory';\n $errors = TRUE;\n } else {\n // If it is, checking if the contained files are readable/writable\n $not_writable_files = FALSE;\n $files = scandir($this->output_path);\n foreach ($files as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (!is_writable($this->output_path .'/' . $file) || !is_readable($this->output_path .'/' . $file)) {\n $this->messages[] = $this->output_path .'/' . $file . ' is not readable or writable<br>';\n $errors = TRUE;\n }\n }\n }\n }\n\n return $errors;\n }", "private function check_images_dir() {\n return is_dir($this->images_dir);\n }", "public function hasDirectoryPath(){\n return (bool) $this->root;\n }", "protected function check_out_path()\n\t{\n\t\tif (is_dir($this->dest_path)) \n\t\t{\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isDirectory(): bool\n {\n return $this->filename === null;\n }", "protected function baseDirExists() {\n\t\treturn $this->filesystem->exists( $this->baseDir );\n\t}", "public function exists(): bool\n {\n return is_dir($this->root()) === true;\n }", "public function exists()\r\n {\r\n $this->loadFromDB();\r\n if($this->panoFolderPath == \"\") {\r\n return false;\r\n }\r\n if(!is_dir($this->panoFolderPath)) {\r\n return false;\r\n }\r\n if($this->xml_configuration == \"\") {\r\n return false;\r\n }\r\n\r\n\r\n return true;\r\n }", "protected function check_sprite_path()\n\t{\n\t\techo 'Sprite source directory: '. $this->sprite_path .\" - \". $this->get_time() .\"s\\n\";\n\t\tif (is_dir($this->sprite_path))\n\t\t{\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private function checkDir()\n {\n if (!is_dir($this->option['templateDir'])) {\n $this->core->err('101', $this->option['templateDir']);\n }\n\n if (!is_dir($this->option['compileDir'])) {\n $this->core->err('101', $this->option['compileDir']);\n }\n\n if (!is_dir($this->option['cacheDir'])) {\n $this->core->err('101', $this->option['cacheDir']);\n }\n\n }", "function is_dir_empty($dir) {\n if (!is_readable($dir)) return NULL;\n return (count(scandir($dir)) == 2);\n }", "public function exists()\n\t{\n\t\treturn @is_readable($this->directory . '/' . $this->filename) and\n\t\t\tis_file($this->directory . '/' . $this->filename);\n\t}", "function _sensation_check_dir($dir) {\n // Normalize directory name\n $dir = file_stream_wrapper_uri_normalize($dir);\n\n // Create directory (if not exist)\n file_prepare_directory($dir, FILE_CREATE_DIRECTORY);\n}", "function checkDirectoryExistence($dirname)\r\n{\r\n\tclearstatcache();\r\n\r\n\tif (!file_exists($dirname))\r\n\t{\r\n\t\tif (!mkdir($dirname))\r\n\t\t{\r\n\t\t\tdisplayError(\"Failed to create directory: '\" . $dirname . \"'! Cannot continue without file system access!\", \"\", \"\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\r\n\treturn 1;\r\n}", "public function checkExists() {\n\t\t\tif(file_exists($this->target)) {\n\t\t\t\tthrow new uploadException(\"File already exists in the folder.\");\t\t\t\n\t\t\t}\n\t\t}", "protected function skip() {\n return file_exists($this->file);\n }" ]
[ "0.68001133", "0.6676428", "0.65421414", "0.651618", "0.6437296", "0.638748", "0.6307296", "0.6269306", "0.6224918", "0.6210054", "0.6128888", "0.6122033", "0.6116586", "0.6101341", "0.6100149", "0.60968846", "0.6096401", "0.60658836", "0.60647476", "0.6052349", "0.6047529", "0.60096294", "0.5997378", "0.5993407", "0.5964306", "0.5936899", "0.5930591", "0.5926982", "0.58409643", "0.5839098" ]
0.70058984
0
Imports website project data from the directory, into this object
private function importDataFromDirectory() { # get JSON $this->hindsightJson = $this->getHindsightJson(); # get HTML $this->htmlTemplate = $this->getHTMLTemplateContents(); # get Markdown File List $this->markdownList = $this->getMarkdownFileList(); # parse data from JSON $this->seedData = $this->resolveSeedData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadProjects()\r\n\t{\r\n\t\tforeach($this->getConfig('projects') as $name => $data)\r\n\t\t{\r\n\t\t\t$project = $this->dataRepository->createOrUpdateProject($name, $data['path'], $data['tests_path']);\r\n\r\n\t\t\tforeach($data['suites'] as $suite_name => $suite_data)\r\n\t\t\t{\r\n\t\t\t\t$this->dataRepository->createOrUpdateSuite($name, $project->id, $suite_data);\r\n\t\t\t}\r\n\r\n\t\t\t$this->addToWatchFolders($data['path'], $data['watch_folders']);\r\n\r\n\t\t\t$this->addToExclusions($data['path'], $data['exclude_folders']);\r\n\t\t}\r\n\r\n\t\t$this->dataRepository->deleteUnavailableProjects(array_keys($this->getConfig('projects')));\r\n\t}", "private static function _importData($path) {\n if (!file_exists($path . '/content.json')) {\n if (file_exists($path . '/nicepage/content/content.json')) { // import plugin zip\n $path .= '/nicepage/content';\n } else if (file_exists($path . '/content/content.json')) { // import theme zip\n $path .= '/content';\n }\n }\n $import = new NpContentImporter($path);\n $remove_prev = !!_arr($_REQUEST, 'removePrev');\n $import->import($remove_prev);\n }", "public static function loadWebsiteFixtures()\n {\n include __DIR__ . '/../../_files/websiteFixtures.php';\n }", "public function run()\n {\n $json = File::get('database/data/projects.json');\n $data = json_decode($json);\n foreach ($data as $project) {\n $projects[] = ['id' => $project->id, 'name' => $project->name];\n }\n Project::insert($projects);\n }", "public static function loadWebsiteFixtures()\n {\n include __DIR__ . '/../../../../../../_files/websiteFixtures.php';\n }", "private static function loadStaticData() \n {\n $data_dir = self::$APP_PATH.\"data\";\n self::$data = new Data\\StaticData($data_dir);\n }", "public static function loadWebsiteFixtures()\n {\n include __DIR__ . '/../../../_files/websiteFixtures.php';\n }", "public function import();", "public function import();", "public static function loadWebsiteFixtures(): void\n {\n include __DIR__ . '/../../../../_files/websiteFixtures.php';\n }", "protected function loadFiles(): void\n {\n /**\n * @var array<string, string>\n */\n $contentFiles = [];\n\n /**\n * @var array<string>\n */\n $files = [];\n\n /**\n * @var array<string>\n */\n $languages = [];\n\n $site = $this->site;\n\n if (isset($this->path) && FileSystem::isDirectory($this->path, assertExists: false)) {\n foreach (FileSystem::listFiles($this->path) as $file) {\n $name = FileSystem::name($file);\n\n $extension = '.' . FileSystem::extension($file);\n\n if ($extension === $site->get('content.extension')) {\n $language = null;\n\n if (preg_match('/([a-z0-9]+)\\.([a-z]+)/', $name, $matches)) {\n // Parse double extension\n [, $name, $language] = $matches;\n }\n\n if ($site->templates()->has($name)) {\n $contentFiles[$language] = [\n 'path' => FileSystem::joinPaths($this->path, $file),\n 'filename' => $file,\n 'template' => $name,\n ];\n if ($language !== null && !in_array($language, $languages, true)) {\n $languages[] = $language;\n }\n }\n } elseif (in_array($extension, $site->get('files.allowedExtensions'), true)) {\n $files[] = App::instance()->getService(FileFactory::class)->make(FileSystem::joinPaths($this->path, $file));\n }\n }\n }\n\n if (!empty($contentFiles)) {\n // Get correct content file based on current language\n ksort($contentFiles);\n\n // Language may already be set\n $currentLanguage = $this->language ?? $site->languages()->current();\n\n /**\n * @var string\n */\n $key = isset($currentLanguage, $contentFiles[$currentLanguage->code()])\n ? $currentLanguage->code()\n : array_keys($contentFiles)[0];\n\n // Set actual language\n $this->language ??= $key ? new Language($key) : null;\n\n $this->contentFile ??= new ContentFile($contentFiles[$key]['path']);\n\n $this->template ??= $site->templates()->get($contentFiles[$key]['template']);\n\n $this->scheme ??= $site->schemes()->get('pages.' . $this->template);\n } else {\n $this->template ??= $site->templates()->get('default');\n\n $this->scheme ??= $site->schemes()->get('pages.default');\n }\n\n $this->fields ??= $this->scheme()->fields();\n\n $defaultLanguage = in_array((string) $site->languages()->default(), $languages, true)\n ? $site->languages()->default()\n : null;\n\n $this->languages ??= new Languages([\n 'available' => $languages,\n 'default' => $defaultLanguage,\n 'current' => $this->language ?? null,\n 'requested' => $site->languages()->requested(),\n 'preferred' => $site->languages()->preferred(),\n ]);\n\n $this->files ??= new FileCollection($files);\n\n $this->data = [...$this->defaults(), ...$this->data];\n }", "private static function load()\r\n\t{\r\n\t\t$file = self::configFile();\r\n\t\tif ( !file_exists($file) )\r\n\t\t{\r\n\t\t\t// This should probably be an error, no configuration means no database means no functional website.\r\n\t\t\t// On the other hand, the framework itself should run just fine without any data available.\r\n\t\t\tLog::fatal( \"configuration file not found: $file\" );\r\n\t\t\tLog::debug( \"configuration file not found: $file\" );\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tinclude_once \"$file\";\r\n\t}", "public function __construct()\n {\n $this->loadProjects();\n }", "public function initializeBaseData()\n {\n // Set the package name\n $this->package = basename(__DIR__);\n\n // -------------------------------------\n // Set info and version\n // -------------------------------------\n\n $this->info = ee('App')->get($this->package);\n $this->version = $this->info->getVersion();\n\n // -------------------------------------\n // Load helper, libraries and models\n // -------------------------------------\n ee()->load->add_package_path(PATH_ADDONS . $this->package);\n ee()->load->helper($this->package);\n ee()->load->library($this->libraries);\n ee()->load->model($this->models);\n\n // -------------------------------------\n // Class name shortcut\n // -------------------------------------\n\n $this->class_name = ucfirst($this->package);\n\n // -------------------------------------\n // Get site shortcut\n // -------------------------------------\n\n $this->site_id = (int) ee()->config->item('site_id');\n }", "public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}", "public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}", "public function import($data);", "private static function load_files() {\r\n\t\t\t/* Classes */\r\n\t\t\trequire_once CP_SERVICES_BASE_DIR . 'classes/class-convertplugservices.php';\r\n\t\t\trequire_once CP_SERVICES_BASE_DIR . 'classes/class-cpro-ajax.php';\r\n\t\t\trequire_once CP_SERVICES_BASE_DIR . 'classes/class-convertplughelper.php';\r\n\t\t}", "private function import()\n {\n $filePath = '/application/dataset.txt';\n $this->model_index->import($filePath);\n\n }", "function av5_merlin_local_import_files() {\r\n\treturn array(\r\n\t\tarray(\r\n\t\t\t'import_file_name'\t\t\t\t => 'clean-theme',\r\n\t\t\t'local_import_customizer_file'\t => trailingslashit( get_template_directory() ) . 'inc/demo-data-clean/customizer.dat',\r\n\t\t\t'local_import_redux'\t\t\t => array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'file_path'\t\t => trailingslashit( get_template_directory() ) . 'inc/demo-data-clean/redux.json',\r\n\t\t\t\t\t'option_name'\t => apply_filters( 'av5_redux_name', 'lid_av5' ),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n}", "protected static function setupProjects()\n\t{\n\t\tself::$projects['rtvrijnmond'] = array(\n\t\t\t'title'\t\t\t=> 'RTVRijnmond',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/rijnmond'),\n\t\t\t'content_tpl'\t=> 'portfolio/rijnmond',\n\t\t\t'tags'\t\t\t=> array('Drupal6', 'Varnish', 'Capistrano', 'Cluster', 'Migration', 'Symfony2', 'Twitter Bootstrap'),\n\t\t\t'urls'\t\t\t=> strtotime('2011-11-27 00:00:00') < time() ? array('http://www.rijnmond.nl'\t=> 'RTVRijnmond') : array(),\n\t\t);\n\n\t\tself::$projects['koersvo'] = array(\n\t\t\t'title'\t\t\t=> 'Onderwijszorgprofielen',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/koersvo'),\n\t\t\t'content_tpl'\t=> 'portfolio/koersvo',\n\t\t\t'tags'\t\t\t=> array('Symfony2', 'HTML2PDF', 'Forms'),\n\t\t);\n\t\t\n\t\tself::$projects['gites'] = array(\n\t\t\t'title'\t\t\t=> 'Gites',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/gites'),\n\t\t\t'content_tpl'\t=> 'portfolio/gites',\n\t\t\t'tags'\t\t\t=> array('HoppingerCMS', 'Huge project', 'Invoicing', 'Migration', 'Lead developer'),\n\t\t\t'urls'\t\t\t=> array('http://www.gites.nl' => 'Gites'),\n\t\t);\n\t\t\n\t\tself::$projects['timerime'] = array(\n\t\t\t'title'\t\t\t=> 'Timerime',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/timerime'),\n\t\t\t'content_tpl'\t=> 'portfolio/timerime',\n\t\t\t'tags'\t\t\t=> array('HoppingerCMS', 'High load'),\n\t\t\t'urls'\t\t\t=> array('http://www.timerime.com' => 'Timerime'),\n\t\t);\n\t\t\n\t\tself::$projects['dierenambulance'] = array(\n\t\t\t'title'\t\t\t=> 'Dierenambulance',\n\t\t\t'content_tpl'\t=> 'portfolio/dierenambulance',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/diam'),\n\t\t\t'tags'\t\t\t=> array('HoppingerCMS'),\n\t\t);\n\t\t\n\t\tself::$projects['vvd'] = array(\n\t\t\t'title'\t\t\t=> 'VVD Rotterdam',\n\t\t\t'content_tpl'\t=> 'portfolio/vvd',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/vvd'),\n\t\t\t'tags'\t\t\t=> array('Drupal'),\n\t\t\t'urls'\t\t\t=> array('http://www.vvdrotterdam.nl' => 'VVD Rotterdam'),\n\t\t);\n\t\t\n\t\tself::$projects['qhome'] = array(\n\t\t\t'title'\t\t\t=> 'Qhome',\n\t\t\t'content_tpl'\t=> 'portfolio/qhome',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/qhome'),\n\t\t\t'tags'\t\t\t=> array('HoppingerCMS', 'Gites API'),\t\t\t\n\t\t\t'urls'\t\t\t=> array('http://www.qhome.fr' => 'QHome'),\n\t\t\n\t\t);\n\t\t\n\t\tself::$projects['bondgenoten'] = array(\n\t\t\t'title'\t\t\t=> 'Bondgenoten',\n\t\t\t'content_tpl'\t=> 'portfolio/bondgenoten',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/bondgenoten'),\n\t\t\t'tags'\t\t\t=> array('HoppingerCMS'),\n\t\t\t'urls'\t\t\t=> array(\n\t\t\t\t'http://www.bondgenoten.net'\t\t=> 'Bondgenoten',\n\t\t\t\t'http://www.boomvanmourik.nl'\t\t=> 'Boom van mourik',\n\t\t\t\t'http://www.newid.nl'\t\t\t\t=> 'Van tongeren',\n\t\t\t\t'http://www.uwontwerper.nl'\t\t\t=> 'Uw ontwerper',\n\t\t\t),\n\t\t);\n\t\t\n\t\tself::$projects['united'] = array(\n\t\t\t'title'\t\t\t=> 'Unitedtrust',\n\t\t\t'content_tpl'\t=> 'portfolio/united',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/united'),\n\t\t\t'tags'\t\t\t=> array('HoppingerCMS'),\t\t\t\n\t\t\t'urls'\t\t\t=> array(\n\t\t\t\t'http://www.united-itrust.com'\t\t=> 'UnitedTrust',\n\t\t\t\t'http://www.united-ibank.com'\t\t=> 'UnitedBank',\n\t\t\t),\n\t\t);\n\t\t\n\t\tself::$projects['maasmond'] = array(\n\t\t\t'title'\t\t\t=> 'Maasmond',\n\t\t\t'images'\t\t=> self::getImages(self::getImageDir() . '/maasmond'),\n\t\t\t'tags'\t\t\t=> array('HoppingerCMS'),\n\t\t\t'urls'\t\t\t=> array('http://www.maasmond.nl' => 'Maasmond'),\n\t\t);\n\t\t\n\t\t$i = 0;\n\t\tforeach (self::$projects as $slug => $project) {\n\t\t\t$project['slug']\t= $slug;\n\t\t\t$project['weight']\t= $i;\n\t\t\t\n\t\t\tself::$projects[$slug] = $project;\n\t\t\t$i ++;\n\t\t}\n\t}", "public function import() {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n if ($_FILES['file0']['error'] == 0) {\n $data = yaml_parse_file($_FILES['file0']['tmp_name']);\n \n $SlideList = new SlideList;\n $SlideList->deleteAll();\n $Step = new Step;\n $Step->deleteAll();\n $Page = new Page;\n $Page->deleteAll();\n \n $result = array();\n \n foreach($data['steps'] as $step) {\n $slides = $step['_slides'];\n unset($step['_slides']);\n $Step->create($step);\n $result[] = \"Created step {$step['title']}\";\n foreach($slides as $slide) {\n $SlideList->create($slide);\n $result[] = \"Created slide {$slide['title']}\";\n }\n }\n foreach($data['pages'] as $page) {\n $Page->create($page);\n $result[] = \"Created page {$page['title']}\";\n }\n $this->set('result', $result);\n } else {\n $this->set('result', 'Upload failed');\n }\n }\n }", "abstract public function import();", "function rekord_import_files() {\n\treturn array(\n\t array(\n\t\t'import_file_name' => 'Demo Import 1',\n\t\t'categories' => array( 'Category 1', 'Category 2' ),\n\t\t'local_import_file' => trailingslashit( get_template_directory() ) . 'inc/demo-data/content.xml',\n\t\t'local_import_widget_file' => trailingslashit( get_template_directory() ) . 'inc/demo-data/widgets.wie',\n\t\t'local_import_customizer_file' => trailingslashit( get_template_directory() ) . 'inc/demo-data/customizer.dat',\n\t\t'import_preview_image_url' => get_template_directory_uri() . '/inc/demo-data/screenshot.jpg',\n\t\t'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'rekord' ),\n\t ),\n\t);\n }", "public function import()\n {\n $this->load->view('layouts/main', $this->Data);\n }", "public function demo_importer() {\n\t\tinclude_once dirname( __FILE__ ) . '/admin/views/html-admin-page-importer.php';\n\t}", "private function initializeProject() {\n \n $this->newProject->setInputHandler($this->project->getInputHandler());\n \n foreach($this->project->getBuildListeners() as $listener) {\n $this->newProject->addBuildListener($listener);\n }\n \n /* Copy things from old project. Datatypes and Tasks are always\n * copied, properties and references only if specified so/not\n * specified otherwise in the XML definition.\n */\n // Add Datatype definitions\n foreach ($this->project->getDataTypeDefinitions() as $typeName => $typeClass) {\n $this->newProject->addDataTypeDefinition($typeName, $typeClass);\n }\n \n // Add Task definitions\n foreach ($this->project->getTaskDefinitions() as $taskName => $taskClass) {\n if ($taskClass == \"propertytask\") {\n // we have already added this taskdef in init()\n continue;\n }\n $this->newProject->addTaskDefinition($taskName, $taskClass);\n }\n\n // set user-defined properties\n $this->project->copyUserProperties($this->newProject);\n\n if (!$this->inheritAll) {\n // set System built-in properties separately,\n // b/c we won't inherit them.\n $this->newProject->setSystemProperties();\n\n } else {\n // set all properties from calling project\n $properties = $this->project->getProperties();\n foreach ($properties as $name => $value) { \n if ($name == \"basedir\" || $name == \"phing.file\" || $name == \"phing.version\") {\n // basedir and phing.file get special treatment in main()\n continue;\n }\n // don't re-set user properties, avoid the warning message\n if ($this->newProject->getProperty($name) === null){\n // no user property\n $this->newProject->setNewProperty($name, $value);\n }\n }\n \n }\n \n }", "public function buildProject()\n {\n $this->filesystem->mkdir(array(\n $this->getRootDir(),\n $this->getCacheDir(),\n $this->getLogDir(),\n $this->getWebDir(),\n $this->getWebDir().'/uploads',\n ));\n\n $this->filesystem->touch(array(\n $this->getWebDir().'/'.$this->getIndexFile(),\n $this->getWebDir().'/class.php',\n $this->getWebDir().'/phpinfo.php',\n $this->getWebDir().'/authors.txt',\n $this->getWebDir().'/uploads/picture.png',\n ));\n }", "public function load() {}", "public function load_files() {\n\n\t\t// load our admin piece\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( 'lib/admin.php' );\n\t\t}\n\t}" ]
[ "0.65115744", "0.58243525", "0.5728251", "0.57072306", "0.5695041", "0.56877315", "0.56637263", "0.56166774", "0.56166774", "0.5594954", "0.5588792", "0.5583083", "0.55671054", "0.5549487", "0.55402833", "0.55402833", "0.5529289", "0.55229217", "0.54888594", "0.54584193", "0.5452122", "0.5428707", "0.5402092", "0.53889877", "0.53611815", "0.53596675", "0.5351038", "0.5345256", "0.53376853", "0.5327377" ]
0.7463917
0
Returns the 'hindsight.json' JsonFile for the project directory
private function getHindsightJson() { if (FileStorage::isUsefulDirectory($this->directory)) { # Folder is useful. Hindsight is running. if ($this->isInitted()) { $HindsightJson = new JsonFile($this->directory . "/hindsight.json"); # return HindsightJson if useful if ($HindsightJson->isUseful()) { return $HindsightJson; } else return false; } else return false; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetJsonFilePath(){\n\n\t\t\t$initialPath = \"Data\\cines.json\";\n\t\t\t\n\t\t\tif(file_exists($initialPath)){\n\t\t\t\t$jsonFilePath = $initialPath;\n\t\t\t}else{\n\t\t\t\t$jsonFilePath = ROOT.$initialPath;\n\t\t\t}\n\t\t\t\n\t\t\treturn $jsonFilePath;\n\t\t}", "function GetJsonFilePath(){\n\n\t\t\t$initialPath = \"Data\\\\funciones.json\";\n\t\t\t\n\t\t\tif(file_exists($initialPath)){\n\t\t\t\t$jsonFilePath = $initialPath;\n\t\t\t}else{\n\t\t\t\t$jsonFilePath = ROOT.$initialPath;\n\t\t\t}\n\t\t\t\n\t\t\treturn $jsonFilePath;\n\t\t}", "public function jsonFile() {\n\n $content = file_get_contents(public_path('filejson.json'));\n return $content;\n }", "public function getFilePath(): string\n {\n return oas_path(\n $this->version . '/paths/' . $this->getFileName() . '.json'\n );\n }", "public function get_acf_json_path() {\n\t\t\treturn plugin_dir_path( $this->file ) . 'acf-json';\n\t\t}", "public function getCacheFilePath()\n {\n return dirname(__FILE__).'/../Json/inventoryfeed.json';\n }", "protected function _getConfigFilePath() {\n\t\treturn APP_DIR . 'config' . DIRECTORY_SEPARATOR . $this->_language . '.json';\n\t}", "function getJsonFile() {\n $file = Storage::get('public/db.json');\n return (array) json_decode($file);\n}", "function getGameFile() {\n $levelsDir = \"../levels\";\n //Get the level file contents.\n if ( file_exists($levelsDir.\"/game.json\") ) {\n $fh = fopen($levelsDir.\"/game.json\", 'r');\n\n $fileData = fread($fh, filesize($levelsDir.\"/game.json\"));\n\n fclose($fh);\n\n die($fileData);\n }\n}", "private function getFixtureFilePath(): string\n {\n return __DIR__.'/../fixtures/database/json-settings.json';\n }", "public function getJsonPath()\n {\n return $this->json_path;\n }", "public function getJsonPath(): string\n {\n $jsonPath = defined('CRAFT_COMPOSER_PATH') ? CRAFT_COMPOSER_PATH : Craft::getAlias('@root/composer.json');\n if (!is_file($jsonPath)) {\n throw new Exception('Could not locate your composer.json file.');\n }\n return $jsonPath;\n }", "private function getJson()\n {\n return json_decode(file_get_contents($this->composerFile->getPathname()));\n }", "public function getConfigFilePath(): string;", "public function getCurrentThemeJsonPath()\n {\n return $this->getConfiguredBundlePath() . '/css/' . $this->getThemeChoice() . '/theme.json';\n }", "private function createSettingsFile() {\n\t\t$data = (object) [\n\t\t\t\"gtag\" => \"\",\n\t\t\t\"gmap\" => \"\",\n\t\t\t\"sendgrid_api\" => \"\",\n\t\t\t\"pages\" => (object) [\n\t\t\t\t\"home\" => (object) [\n\t\t\t\t\t\"slides\" => [],\n\t\t\t\t\t\"backgroundTestimoni\" => ''\n\t\t\t\t],\n\t\t\t\t\"menu\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t],\n\t\t\t\t\"gallery\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t],\n\t\t\t\t\"contact\" => (object) [\n\t\t\t\t\t\"headerImage\" => \"\"\n\t\t\t\t]\n\t\t\t]\n\t\t];\n\n\t\treturn create_json_file($this->_filePath, $data);\n\t}", "public function get_local_json_path() {\n\t\treturn MY_ACF_PATH . 'acf-json';\n\t}", "protected function getMockFile()\n {\n return 'starcraft' . DIRECTORY_SEPARATOR . 'player.json';\n }", "private function getComposerJson()\n {\n $composerFile = ($this->composerFileFactory)();\n return new JsonFile($composerFile);\n }", "public function get()\n {\n return $this->fitbit->get(implode('/', [\n 'foods',\n 'log',\n 'water',\n 'goal',\n ]) . '.json');\n }", "function getJsonRelPath() {\n\t\tglobal $moduleRelPath,$CONF;\n\t\treturn $moduleRelPath.'/'.str_replace(\"%PILOTID%\",$this->getPilotID(),str_replace(\"%YEAR%\",$this->getYear(),$CONF['paths']['js']) ).'/'.\n\t\t\t\trawurlencode($this->filename).\".json.js\";\n\t\t\t\t\n\t\t// return str_replace('.//','',$this->getPilotRelDir()).\"/flights/\".$this->getYear().\"/\".rawurlencode($this->filename).\".json.js\";\n\t}", "public function getProjectDir(): string;", "public function getProjectDir();", "public function getProjectFolder(): string;", "public function getComposerFile(): File\n {\n return new File(sprintf('%s/%s', $this->rootDir, self::PATH_COMPOSER_JSON));\n }", "public function config()\n { \n $path = $this->prepare_path(($this->settings())->configuration->path).'.php';\n\n $data = include($path);\n $data = json_decode(json_encode($data));\n\n return $data;\n }", "public static function getStorageDescriptorPath()\n {\n return preg_replace('/.php$/', '.json', __FILE__);\n }", "private function readFile(){\n $file = file_get_contents($_SERVER['DOCUMENT_ROOT'].\"/hangout-reader/json/Hangouts.json\");\n if($file === false){\n return false;\n }\n return $file;\n }", "function getJSON(){\n\t\tglobal $data;\n\t\t$jsonString = file_get_contents('data.json');\n\t\t$data = json_decode($jsonString);\n\t}", "public function getCachedApiPath()\n {\n return $this->app->bootstrapPath().'/cache/api.json';\n }" ]
[ "0.67718005", "0.6563185", "0.6551306", "0.60091716", "0.5976183", "0.5954404", "0.5844049", "0.575368", "0.5695366", "0.5692245", "0.5684034", "0.5653341", "0.56530255", "0.565234", "0.5638495", "0.56345814", "0.56293917", "0.5588622", "0.55466336", "0.5521133", "0.5461059", "0.5445092", "0.54413134", "0.54347974", "0.5426219", "0.54122794", "0.5400836", "0.5376376", "0.53185815", "0.5317977" ]
0.7211505
0
Gets HTML template contents
private function getHTMLTemplateContents() { if ($this->isInitted()) { if (FileStorage::isUsefulFile($this->directory . "/" . self::TEMPLATE_FILE)) { $contents = file_get_contents($this->directory . "/" . self::TEMPLATE_FILE); return $contents; } else return false; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHtml()\n {\n // Start new output buffering\n ob_start();\n\n // Extract logs to local scope for the template\n $logs = $this->logs;\n\n // Process template and return results\n include $this->temlate_file;\n return ob_get_clean();\n }", "public function getContent()\n {\n extract($this->vars);\n ob_start();\n require $this->baseDir . '/' . $this->template;\n $content = ob_get_contents();\n ob_clean();\n \n return $content;\n }", "public function getContent()\n\t{\n\t\treturn $this->fetch($this->template.'.tpl');\n\t}", "public function getHTML() {\n // Start output buffering\n ob_start();\n\n // Make database accessible (if set in route)\n global $pdo;\n\n // Make our query string accessible\n global $query;\n $query = $this->route['query'];\n\n // Make our route parameters accessible\n global $params;\n $params = isset($this->route['params']) ? $this->route['params'] : array();\n\n // Get our template file\n include_once \"theme/\" . $this->route['theme'] . \"/\" . $this->route['template'];\n $template = ob_get_contents();\n ob_clean();\n\n // Include our view preloader files\n if (!empty($this->route['preload'])) {\n foreach ($this->route['preload'] AS $preload) {\n include_once \"preload/\" . $preload;\n }\n }\n\n // Clean our buffer and get our views\n foreach ($this->route['view'] AS $region => $view_inc) {\n include_once \"views/\" . $view_inc;\n $view = ob_get_contents();\n ob_clean();\n $template = str_replace(\"{{\" . $region . \"}}\", $view, $template);\n }\n\n // End output buffering and replace regions with HTML\n ob_end_clean();\n print preg_replace(\"/{{([a-zA-Z0-9])+}}/i\", \"\", $template);\n }", "function getHTML()\n {\n // Create a new Template Object\n $this->template = new Template( $this->pathModuleRoot.'templates/' );\n\n // store the page labels\n $this->template->setXML( 'pageLabels', $this->labels->getLabelXML() );\n\n // store the links for the sidebar\n\t\t$this->template->set( 'links',$this->links );\n\n // store the admin links for the sidebar\n\t\t$this->template->set( 'adminLinks', $this->adminLinks );\n\n // store the campus level links for the sidebar\n\t\t$this->template->set( 'campusLevelLinks',$this->campusLevelLinks );\n\n\t\t// return the html from the commong display template\n\t\treturn $this->template->fetch( 'obj_AdminSideBar.php' );\n\n }", "public function getHtml()\n\t{\n\t\treturn $this->tpl->get();\n\t}", "public function toHtml() {\n $template_html = '';\n \n $framework = Framework::getInstance();\n \n $framework_cache = $framework->getCache();\n \n if($framework_cache->initialized()) {\n $template_html = $framework_cache->get($this->template_path);\n }\n else { \n $template_html = file_get_contents($this->template_path);\n \n if($framework_cache->initialized()) {\n $framework_cache->set($this->template_path, $template_html);\n }\n }\n \n return $template_html;\n }", "public function GetHTML()\n\t{\n\t\treturn file_get_contents($this->m_Filename);\n\t}", "public function get_content_html() {\n\t\tob_start();\n\t\twc_get_template(\n\t\t\t$this->template_html,\n\t\t\tarray(\n\t\t\t\t'email_heading' \t=> $this->get_heading(),\n\t\t\t\t'first_name'\t\t=> $this->object['first_name'],\n\t\t\t\t'last_name'\t\t\t=> $this->object['last_name'],\n\t\t\t\t'recipient_name'\t=> $this->object['recipient_name'],\n\t\t\t\t'voucher_link'\t\t=> $this->object['voucher_link'],\n\t\t\t\t'recipient_message'\t=> $this->object['recipient_message']\n\t\t\t),\n\t\t\t'',\n\t\t\t$this->template_base\n\t\t);\n\t\treturn ob_get_clean();\n\t}", "public function getHTML();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getPageContent() {\n\t\treturn get_view(DIR_TMPL . $this->module . \"/\" . $this->module . \".tpl.php\");\n\t}", "function getTemplate();", "public function forTemplate()\n {\n return $this->AsHTML();\n }", "protected function fetchTemplate() {\n\t\tif ($this->settings['output'] == 'javascript') {\n\t\t\t$file = 'javascript.html';\n\t\t} else {\n\t\t\t$file = 'image.html';\n\t\t}\n\n\t\treturn $this->cObj->fileResource($this->settings['templatePath'] . $file);\n\t}", "public function get_template() {\n\t\treturn $this->args['html_template'];\n\t}", "public function get_template_content() {\n \n $template = $_GET['templateID'];\n \n if( ! isset( $template ) ) {\n return;\n }\n \n $template_content = $this->templateInstance->get_template_content( $template );\n \n if ( empty ( $template_content ) || ! isset( $template_content ) ) {\n wp_send_json_error();\n }\n \n $data = array(\n 'template_content' => $template_content\n );\n \n wp_send_json_success( $data );\n \n }", "public abstract function getHTML();", "function render() {\n #$this->templateFileContents = file_get_contents($this->templateFile);\n $this->renderTags();\n $this->handleCommands();\n return trim($this->templateFileContents);\n }", "abstract public function getTemplate();", "abstract public function getTemplate();", "function getContents(&$templateMgr) {\n\t\treturn parent::getContents($templateMgr);\n\t}", "public function forTemplate()\n {\n return $this->MarkdownAsHTML();\n }", "private function getHTML() {\n\t\t$ch = curl_init($this->itemURL);\n\t\tob_start();\n\t\tcurl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$retrievedhtml = ob_get_contents();\n\t\tob_end_clean();\n\t\t\n\t\treturn $retrievedhtml;\n\t}", "public function get_content_html() {\n\n\t\t// Set up the base args for the HTML email.\n\t\t$base_args = array(\n\t\t\t'order' => $this->object,\n\t\t\t'email_heading' => $this->get_heading(),\n\t\t\t'recipient' => $this->recipient,\n\t\t\t'sections' => $this->build_email_body_sections(),\n\t\t\t'sent_to_admin' => false,\n\t\t\t'plain_text' => false,\n\t\t\t'email' => $this,\n\t\t);\n\n\t\t// Filter the args.\n\t\t$html_args = apply_filters( Core\\HOOK_PREFIX . 'reminder_email_html_args', $base_args );\n\n\t\t// Return the template HTML using our args.\n\t\treturn wc_get_template_html( $this->template_html, $html_args );\n\t}", "public function getHtml() {\n\t}", "public static function getContent() {\r\n\t\treturn isset($GLOBALS['html']) ? $GLOBALS['html'] : '';\r\n\t}" ]
[ "0.8229231", "0.7670417", "0.762109", "0.76181006", "0.7431954", "0.73247075", "0.7280866", "0.71718234", "0.71624917", "0.71280706", "0.71256", "0.71256", "0.71256", "0.71256", "0.7027127", "0.7025829", "0.6958559", "0.6941713", "0.68770397", "0.6868323", "0.68296266", "0.6826449", "0.6820395", "0.6820395", "0.6812758", "0.6797969", "0.67768264", "0.67589086", "0.674922", "0.67394423" ]
0.7966674
1
Get Markdown file list in a project directory
private function getMarkdownFileList() { if (FileStorage::isUsefulDirectory($this->directory)) { $list = glob($this->directory . "/pages/*.md"); $markdownFileList = array(); foreach ($list as $name) { if (FileStorage::isUsefulFile($name)) { array_push($markdownFileList, $name); } } # return the list return $markdownFileList; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listFiles() {\n\t\t$files = [];\n\t\tforeach ( new DirectoryIterator( $this->templateDir ) as $file ) {\n\t\t\tif ( $file->isDot() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( !$file->isFile() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$page = PageFactory::create(\n\t\t\t\t$file->getBasename(),\n\t\t\t\t$file->getPathname(),\n\t\t\t\t$this->config\n\t\t\t);\n\t\t\tif ( $page ) {\n\t\t\t\t$files[ $page->pageName ] = $page;\n\t\t\t}\n\t\t}\n\n\t\tksort( $files );\n\t\treturn $files;\n\t}", "public function files_list();", "public function list() {\n $fs = new FileSystem($this->context);\n $aResult = array();\n foreach($fs->list('template') as $sFilename) {\n // assume we are not listing admin pages:\n $sSummary = trim(htmlspecialchars(Token::removeTokens($this->fs->load('template', $sFilename))));\n $aPage = array(\n \"name\" => $sFilename,\n \"nameSafe\" => htmlspecialchars($sFilename,ENT_QUOTES),\n \"summary\" => $sSummary\n );\n $aResult[] = $aPage;\n }\n return $aResult;\n }", "function lecture_files($link, $proj = FALSE) {\n $ret = array();\n\n // Iterates recursively Lecture folder and subfolders\n foreach (new DirectoryIterator($link) as $f) {\n $fn = $f->getFileName();\n\n // Don't show system setting files\n if ($f->isDot() || in_array($fn, _PLW_FILES)) continue;\n\n // Don't show Word Press files\n if (substr($fn, 0, 3) == 'wp-') continue;\n\n // Depending on settings, ignores hidden files or not\n if (!SHOW_HIDDEN && substr($fn,0,1)=='.') continue;\n\n if ($f->isDir() && !$proj) {\n $a = lecture_files($link .'/'. $fn);\n if(sizeof($a) > 0) $ret['d_'. $fn] = $a;\n }\n else {\n if (in_array(pathinfo($fn, PATHINFO_EXTENSION), SRC_EXT)) $ret['f_'. $fn] = $fn;\n }\n }\n ksort($ret);\n return $ret;\n}", "function get_documents($dir, $last_dir = null) {\n\t\t$files = array();\n\t\t$scan = scandir($dir);\n\n\t\tforeach($scan as $name) {\n\t\t\tif (substr($name, 0, 1) == '.')\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tif ($name == 'index.md')\n\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\tif (substr($name, -3, 3) == '.md')\n\t\t\t\tarray_push($files, array(\n\t\t\t\t\t'url' => $this->get_url($name, $last_dir),\n\t\t\t\t\t'path' => \"$dir/$name\",\n\t\t\t\t\t'title' => $this->get_title($name)\n\t\t\t\t));\n\t\t\t\t\n\t\t\tif (is_dir(\"$dir/$name\"))\n\t\t\t\t$files[] = array(\n\t\t\t\t\t'title' => $this->get_title($name),\n\t\t\t\t\t'folder' => $this->get_documents(\"$dir/$name\", $this->filter_path(\"$dir/$name\"))\n\t\t\t\t);\n\t\t}\n\t\t\t\n\t\treturn $files;\n\t}", "public function getPath()\n {\n return $this->title.'.markdown';\n }", "function getFilesList()\n{\n $some_link = 'https://github.com/apps4webte/curldata2021';\n $tagName = 'a';\n $attrName = 'class';\n $attrValue = 'js-navigation-open Link--primary';\n\n $dom = new DOMDocument;\n $dom->preserveWhiteSpace = false;\n @$dom->loadHTMLFile($some_link);\n\n $html = getTags( $dom, $tagName, $attrName, $attrValue );\n\n $html = strip_tags($html);\n\n $resourcesCount = substr_count($html, '.');\n\n $resources = [];\n for ($i =0; $i < $resourcesCount; $i++){\n $resources[] = strval(substr($html,0, $pos = strpos($html, '.')) . \".csv\");\n $html = substr($html, $pos = strpos($html, '.')+4);\n }\n\n return $resources;\n}", "private function init()\n {\n $this->info('init markdown folder');\n if(file_exists($this->markdown_path)){\n $this->removeDirectory($this->markdown_path);\n mkdir($this->markdown_path, 0777, true);\n }else{\n mkdir($this->markdown_path, 0777, true);\n } \n\n return collect([\n \"controllers\" => $this->getControllersList(),\n \"models\" => $this->getModelsList(),\n \"database\" => $this->getDatabaseList(),\n ]);\n }", "public function getJavaMultipleFiles() {}", "protected function renderDocs()\n {\n $renderDir = $this->getRenderDirectory();\n $tempFolder = $this->getTempDirectory() . '/docs-main';\n\n // Clear out old rendered docs\n if (count(File::files($renderDir)) > 0) {\n File::deleteDirectory($renderDir, true);\n }\n\n $files = (is_dir($tempFolder))\n ? new RecursiveIteratorIterator(new RecursiveDirectoryIterator($tempFolder))\n : [];\n\n foreach ($files as $file) {\n // YAML files - structure and menus\n if (File::isFile($file) && File::extension($file) === 'yaml') {\n if (!File::exists($renderDir . '/config')) {\n File::makeDirectory($renderDir . '/config', 0777, true);\n }\n\n File::move($file, $renderDir . '/config/' . File::basename($file));\n }\n\n // Image files\n if (File::isFile($file) && in_array(File::extension($file), ['jpg', 'jpeg', 'png', 'gif'])) {\n if (!File::exists($renderDir . '/images')) {\n File::makeDirectory($renderDir . '/images', 0777, true);\n }\n\n File::move($file, $renderDir . '/images/' . File::basename($file));\n }\n\n // Markdown files - documentation content\n if (File::isFile($file) && File::extension($file) === 'md') {\n $filename = File::name($file);\n $html = Markdown::parse(File::get($file));\n File::put($renderDir . '/' . $filename . '.html', $html);\n }\n }\n\n // Remove temp folder\n File::deleteDirectory($tempFolder);\n }", "public function listContents($directory = '', $recursive = false);", "public function _fileList()\n\t{\n\t\t$page = new \\Components\\Courses\\Models\\Page(Request::getInt('page', 0));\n\t\tif (!$page->exists())\n\t\t{\n\t\t\t$page->set('offering_id', $this->view->offering->get('id'));\n\t\t\t$page->set('section_id', Request::getInt('section_id', 0));\n\t\t}\n\n\t\t$path = $this->_path($page);\n\n\t\t$folders = array();\n\t\t$docs = array();\n\n\t\tif (is_dir($path))\n\t\t{\n\t\t\t// Loop through all files and separate them into arrays of images, folders, and other\n\t\t\t$dirIterator = new DirectoryIterator($path);\n\t\t\tforeach ($dirIterator as $file)\n\t\t\t{\n\t\t\t\tif ($file->isDot())\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($file->isDir())\n\t\t\t\t{\n\t\t\t\t\t$name = $file->getFilename();\n\t\t\t\t\t$folders[$path . DS . $name] = $name;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($file->isFile())\n\t\t\t\t{\n\t\t\t\t\t$name = $file->getFilename();\n\t\t\t\t\tif (('cvs' == strtolower($name))\n\t\t\t\t\t || ('.svn' == strtolower($name)))\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$docs[$path . DS . $name] = $name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tksort($folders);\n\t\t\tksort($docs);\n\t\t}\n\n\t\t$this->view->docs = $docs;\n\t\t$this->view->folders = $folders;\n\n\t\tforeach ($this->getErrors() as $error)\n\t\t{\n\t\t\t$this->view->setError($error);\n\t\t}\n\n\t\t$this->view->setLayout('list');\n\t}", "function MyMod_Latex_Files_Get()\n {\n $files=$this->ExistentPathsFiles\n (\n $this->MyMod_Latex_Paths(),\n $this->MyMod_Latex_Files()\n );\n\n return $files;\n }", "public function getMarkdown($filename, $type = 'github') {\n $arBox = $this->app['my']->get('array');\n $strBox = $this->app['my']->get('string');\n $basepath = $this->app['basepath'];\n $locale = $this->getLocale();\n $title = \"\";\n $filename = trim($filename);\n $filename = str_replace('\\\\', '/', $filename);\n //-------------------------------------------\n if (is_file($filename)) {\n $lastFilename = $arBox->set($filename, \"/\")->getLast();\n // Set title\n $title = $lastFilename;\n // Check word in uppercase\n $upperFilename = $strBox->set($lastFilename)->toUpper()->get();\n $isUpper = ($arBox->set($lastFilename, \".\")->get(0) == $arBox->set($upperFilename, \".\")->get(0));\n if ($isUpper) {\n $locale = strtoupper($locale);\n }\n // Get the name of the file to a different locale \n $lastFilename = $arBox->set($lastFilename, \".\")->get(0) . \"-{$locale}.md\";\n $localeFilename = $arBox->set($filename, \"/\")->pop()->join('/') . \"/{$lastFilename}\";\n // Get file content\n if (is_file($localeFilename)) {\n // Set title\n $title = $lastFilename;\n $strFile = file_get_contents($localeFilename);\n } else {\n $strFile = file_get_contents($filename);\n }\n } else {\n\n // Get file name\n $filename = $basepath . '/app/Views/' . $this->getIncPath() . '/' . $filename;\n if (!is_file($filename)) {\n $this->app->abort(404, \"File '{$filename}' does not exist.\");\n }\n $lastFilename = $arBox->set($filename, \"/\")->getLast();\n // Set title\n $title = $lastFilename;\n\n // Check word in uppercase\n $upperFilename = $strBox->set($lastFilename)->toUpper()->get();\n $isUpper = ($arBox->set($lastFilename, \".\")->get(0) == $arBox->set($upperFilename, \".\")->get(0));\n if ($isUpper) {\n $locale = strtoupper($locale);\n }\n // Get the name of the file to a different locale \n $lastFilename = $arBox->set($lastFilename, \".\")->get(0) . \"-{$locale}.md\";\n $localeFilename = $arBox->set($filename, \"/\")->pop()->join('/') . \"/{$lastFilename}\";\n // Get file content\n if (is_file($localeFilename)) {\n // Set title\n $title = $lastFilename;\n $strFile = file_get_contents($localeFilename);\n } else {\n $strFile = file_get_contents($filename);\n }\n }\n switch ($type) {\n case 'traditional':\n $markdown = $this->app['my']->get('markdown');\n break;\n case 'github':\n $markdown = $this->app['my']->get('markdown_github');\n break;\n case 'extra':\n $markdown = $this->app['my']->get('markdown_extra');\n break;\n default:\n break;\n }\n // Get markdown parser text\n $text = $markdown->parse($strFile);\n $content = array('title' => $title, 'text' => $text);\n return $content;\n }", "function getTemplateFiles()\r\n\t{\r\n\t\t$directory = \"models/site-templates/\";\r\n\t\t$languages = glob($directory . \"*.css\");\r\n\t\t//print each file name\r\n\t\treturn $languages;\r\n\t}", "public function getFiles()\n {\n return $this->getAutoloadContent('files');\n }", "public function getFiles();", "public function listfilesTask()\n\t{\n\t\t// Incoming\n\t\t$listdir = Request::getInt('listdir', 0, 'get');\n\n\t\t// Check if coming from another function\n\t\tif ($listdir == '')\n\t\t{\n\t\t\t$listdir = $this->listdir;\n\t\t}\n\n\t\tif (!$listdir)\n\t\t{\n\t\t\tNotify::error(Lang::txt('COURSES_NO_ID'), 'courses');\n\t\t}\n\n\t\t$path = PATH_APP . DS . trim($this->config->get('uploadpath', '/site/courses'), DS) . DS . $listdir;\n\n\t\t// Get the directory we'll be reading out of\n\t\t$d = @dir($path);\n\n\t\t$images = array();\n\t\t$folders = array();\n\t\t$docs = array();\n\n\t\tif ($d)\n\t\t{\n\t\t\t// Loop through all files and separate them into arrays of images, folders, and other\n\t\t\twhile (false !== ($entry = $d->read()))\n\t\t\t{\n\t\t\t\t$img_file = $entry;\n\t\t\t\tif (is_file($path . DS . $img_file)\n\t\t\t\t && substr($entry, 0, 1) != '.'\n\t\t\t\t && strtolower($entry) !== 'index.html')\n\t\t\t\t{\n\t\t\t\t\tif (preg_match(\"#bmp|gif|jpg|jpeg|jpe|tif|tiff|png#i\", $img_file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$images[$entry] = $img_file;\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$docs[$entry] = $img_file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (is_dir($path . DS . $img_file)\n\t\t\t\t && substr($entry, 0, 1) != '.'\n\t\t\t\t && strtolower($entry) !== '..'\n\t\t\t\t && strtolower($entry) !== '.git'\n\t\t\t\t && strtolower($entry) !== 'cvs')\n\t\t\t\t{\n\t\t\t\t\t$folders[$entry] = $img_file;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$d->close();\n\n\t\t\tksort($images);\n\t\t\tksort($folders);\n\t\t\tksort($docs);\n\t\t}\n\n\t\t$this->view\n\t\t\t->set('docs', $docs)\n\t\t\t->set('folders', $folders)\n\t\t\t->set('images', $images)\n\t\t\t->set('config', $config)\n\t\t\t->set('listdir', $listdir)\n\t\t\t->display();\n\t}", "public function files() {\n $files= array();\n foreach ($this->commit->getFiles() as $file) {\n $files[]= new GitHubCommitFileView($file);\n }\n\n return $files;\n }", "private function getMarkdownPagesState(array $markdownFileList)\n {\n # get valid string list of Markdown file paths\n $validPathList = WebsiteComposer::validateMarkdownFileList($markdownFileList);\n # just a simple, empty array\n $state = array();\n\n foreach ($validPathList as $validPath) {\n # match the contents and with file paths\n $state[$validPath] = FileStorage::getFileContents($validPath);\n }\n\n return $state;\n }", "function print_project_files() {\n global $g_proj;\n $link1 = '<a class=\"w3-bar-item w3-button w3-round-large w3-hover-shadow';\n $link2 = ' src\" href=\"';\n\n // Ignore subdirectories (can be used for includes in php file)\n $files = lecture_files(PATH_MAIN . PROJECTS_FOLDER[0], true);\n\n foreach ($files as $file) {\n $f = substr($file, 0, -4);\n\n echo $link1 . ($f == $g_proj\n ? ' w3-light-gray w3-border w3-border-light-grey w3-hover-border-blue-grey'\n : '') . $link2 . PATH_WEB .'?'. PROJECTS_FOLDER[1] .'='. $f .'\">'\n . $f .'</a>'. \"\\n\";\n }\n}", "function getLanguageFiles()\r\n\t{\r\n\t\t$directory = \"models/languages/\";\r\n\t\t$languages = glob($directory . \"*.php\");\r\n\t\t//print each file name\r\n\t\treturn $languages;\r\n\t}", "private function _markdownList($messages)\n\t{\n\t\t$list = '';\n\n\t\tforeach ($messages as $message)\n\t\t{\n\t\t\t$list .= '- '.$message.\"\\n\";\n\t\t}\n\n\t\treturn $list;\n\t}", "private function readWikiContent() {\n static $processedFiles = array();\n foreach ($this->jsonFilesToUse as $index => $jsonFile) {\n if ($jsonFile !== '.' && $jsonFile !== '..') {\n //each file has 10 documents, if all document is processed, continue with next document\n if ($processedFiles[$jsonFile] && $processedFiles[$jsonFile]['lastProcessedIndex'] === 10) {\n continue;\n }\n if (!$processedFiles[$jsonFile]) {\n $allProcessedFiles = file($this->fileProcessedListLocation, FILE_IGNORE_NEW_LINES);\n if (in_array($jsonFile, $allProcessedFiles)) {\n continue;\n }\n file_put_contents($this->fileProcessedListLocation, $jsonFile . PHP_EOL, FILE_APPEND);\n $processedFiles[$jsonFile] = array('lastProcessedIndex' => 0);\n echo PHP_EOL . \"File in Process........................ \". $jsonFile . PHP_EOL;\n }\n\n $wikiData = json_decode(file_get_contents($jsonFile), true);\n $content = strip_tags($wikiData['data']['add'][$processedFiles[$jsonFile]['lastProcessedIndex']]['fields'][1]['value']);\n $processedFiles[$jsonFile]['lastProcessedIndex'] += 1;\n return $content;\n }\n }\n\n }", "function bgl360_di_getContentFileOfTheFolder($filePath) {\r\n\r\n\r\n $file = '';\r\n $files = glob($filePath . '*', GLOB_MARK);\r\n\r\n //print_r($files);\r\n\r\n //foreach($paths as $key => $path):\r\n\r\n $files = glob($filePath .'/*');\r\n ksort($files);\r\n foreach ($files as $file) {\r\n if (is_dir($file)) {\r\n return $file;\r\n }\r\n }\r\n\r\n // $dir = \"../mydir/\";\r\n // chdir($dir);\r\n // array_multisort(array_map('filemtime', ($files = glob(\"*.*\"))), SORT_DESC, $files);\r\n // foreach($files as $filename)\r\n // {\r\n // echo \"<li>\".substr($filename, 0, -4).\"</li>\";\r\n // }\r\n\r\n //endforeach;\r\n\r\n // $files = array();\r\n // if ($handle = opendir('.')) {\r\n // while (false !== ($file = readdir($handle))) {\r\n // if ($file != \".\" && $file != \"..\") {\r\n // $files[filemtime($file)] = $file;\r\n // }\r\n // }\r\n // closedir($handle);\r\n //\r\n // // sort\r\n // ksort($files);\r\n // // find the last modification\r\n // $reallyLastModified = end($files);\r\n //\r\n // foreach($files as $file) {\r\n // $lastModified = date('F d Y, H:i:s',filemtime($file));\r\n // if(strlen($file)-strpos($file,\".swf\")== 4){\r\n // if ($file == $reallyLastModified) {\r\n // // do stuff for the real last modified file\r\n // }\r\n // echo \"<tr><td><input type=\\\"checkbox\\\" name=\\\"box[]\\\"></td><td><a href=\\\"$file\\\" target=\\\"_blank\\\">$file</a></td><td>$lastModified</td></tr>\";\r\n // }\r\n // }\r\n // }\r\n //\r\n // foreach ($files as $file) {\r\n // if (is_dir($file)) {\r\n // return $file;\r\n // }\r\n // }\r\n}", "function getListFile(Project $p) {\n if ($this->isReference()) {\n $ref = $this->getRef($p);\n return $ref->getListFile($p);\n }\n return $this->listfile;\n }", "function get_markdown( $doc_path, $command ) {\n\tif ( !file_exists( $doc_path ) )\n\t\treturn false;\n\n\t$fd = fopen( \"php://temp\", \"rw\" );\n\n\tif ( $command instanceof Dispatcher\\Documentable )\n\t\tadd_initial_markdown( $fd, $command );\n\n\tfwrite( $fd, file_get_contents( $doc_path ) );\n\n\tif ( 0 === ftell( $fd ) )\n\t\treturn false;\n\n\tfseek( $fd, 0 );\n\n\treturn $fd;\n}", "public function getFiles() {\n $fout = array();\n $files = scandir($this->dirname);\n foreach($files as $f) {\n $ff = $this->dirname.'/'.$f;\n\n if(is_file($ff) && $this->match($f)) {\n $fout[] = new TodoTxtFile($ff);\n }\n }\n\n return $fout;\n }", "protected function linkedFiles()\n\t{\n\t\treturn [];\n\t}", "function get_content($dir) {\n\t$files = array();\n\n\tclearstatcache();\n\t$fd = @opendir($dir);\n\twhile($entry = @readdir($fd)) {\n\t\tif($entry == \".\") continue;\n\t\tif($entry == \"..\") continue;\n\n\t\tif(is_dir(\"{$dir}/{$entry}\"))\n\t\t\tcontinue;\n\t\telse\n\t\t\tarray_push($files, $entry);\n\t}\n\t@closedir($fd);\n\tnatsort($files);\n\treturn $files;\n}" ]
[ "0.6332151", "0.62338245", "0.6086179", "0.60592836", "0.59706056", "0.5924126", "0.5897702", "0.58862716", "0.5863582", "0.5831524", "0.58166456", "0.5810933", "0.5795214", "0.5794261", "0.5782084", "0.5768751", "0.5763966", "0.57575786", "0.57351893", "0.5693597", "0.5689006", "0.5671069", "0.56546944", "0.5627547", "0.56142896", "0.56010133", "0.5581336", "0.55669814", "0.5555485", "0.55546534" ]
0.7700807
0
ID is based on method, URI, query params and GraphQL query body
public function testRequestIdentifier() { $responses = [ new MockResponseFromFile(__DIR__ . '/graphql/ping.json'), new MockResponseFromFile(__DIR__ . '/graphql/ping.json'), new MockResponseFromFile(__DIR__ . '/graphql/ping.json'), new MockResponseFromFile(__DIR__ . '/graphql/ping.json'), ]; $api = new GraphQL('https://example.com/api/'); $api->setHttpClient(new MockHttpClient($responses)); $query = 'query { entries(section: "news", limit: 2) { id } }'; $response = $api->query($query); $expected = ContentHasher::hash('GET https://example.com/api/test ' . $query); $options = $api->mergeHttpOptions($api->getCurrentDefaultOptions(), ['body' => $query]); $this->assertSame($expected, $api->getRequestIdentifier('GET ' . $api->getUri('test'), $options)); $query = 'query { entries(section: "news", limit: 2, page: $id) { id } }'; $variables = ['page' => 42]; $response = $api->query('test', $variables); $query = 'query { entries(section: "news", limit: 2, page: $id) { id } } variables { id: 42}'; $expected = ContentHasher::hash('GET https://example.com/api/test ' . $query); $options = $api->mergeHttpOptions($api->getCurrentDefaultOptions(), ['body' => $query]); $this->assertSame($expected, $api->getRequestIdentifier('GET ' . $api->getUri('test'), $options)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function query($id) {\n }", "public function apiQueryIdentifier()\n\t{\n\t\treturn self::NAME;\n\t}", "final function id(): string { return $this->id; }", "abstract protected function getIdParam();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public abstract function query($id);", "public function id()\n {\n return $this->query->get('id');\n }", "public function getId( );", "public function id($id);", "public function getWithId()\n {\n }", "protected function _get_base_id_query($id)\n {\n return $this->_url . $this->_api_version . '/' . $this->_query_type . '/' . $id . '/?format=json&key=' . $this->_key;\n }", "public function id(): string;", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "public function testById()\n {\n $queryBuilder = $this->nodesQuery->byId(123)->getQuery();\n\n $this->assertStringContainsString('node_id = :id', $queryBuilder->getSQL());\n $this->assertEquals(123, $queryBuilder->getParameter('id'));\n }", "public function GetId ();", "function getId();", "function getId();", "function getId();" ]
[ "0.6037195", "0.574408", "0.56134677", "0.5556891", "0.55331177", "0.55331177", "0.55331177", "0.55331177", "0.55331177", "0.55331177", "0.55331177", "0.55331177", "0.55331177", "0.55331177", "0.55331177", "0.55007", "0.5487673", "0.5464512", "0.5455519", "0.54383755", "0.5392374", "0.5390689", "0.53711087", "0.53711087", "0.53711087", "0.5354565", "0.53387797", "0.5329781", "0.5329781", "0.5329781" ]
0.6558027
0
Test valid GraphQL query building
public function testBuildQuery() { // ping $graphQL = new GraphQL('https://example.com/api'); $query = '{ping}'; $expected = <<<EOD { "query": "{ping}" } EOD; $this->assertEquals($expected, $graphQL->buildQuery($query)); // double-quotes $query = 'query { entries(section: "news", limit: 2) { id } }'; $expected = <<<EOD { "query": "query { entries(section: \"news\", limit: 2) { id } }" } EOD; $this->assertEquals($expected, $graphQL->buildQuery($query)); // line returns $query = <<<EOD query { entries(section: "news", limit: 2) { id } } EOD; $expected = <<<EOD { "query": "query { entries(section: \"news\", limit: 2) { id } }" } EOD; $this->assertEquals($expected, $graphQL->buildQuery($query)); // variables $query = <<<'EOD' query ($offset: Int) { entries(section: "news", limit: 2, offset: $offset) { id } } EOD; $expected = <<<'EOD' { "query": "query ($offset: Int) { entries(section: \"news\", limit: 2, offset: $offset) { id } }", "variables": { "offset": 10 } } EOD; $this->assertEquals($expected, $graphQL->buildQuery($query, ["offset" => 10])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testValidateComplexButValidQuery()\n {\n $query = '\n query NestedQueryWithFragment {\n hero {\n ...NameAndAppearances\n friends {\n ...NameAndAppearances\n friends {\n ...NameAndAppearances\n }\n }\n }\n }\n fragment NameAndAppearances on Character {\n name\n appearsIn\n }';\n\n $schema = StarWarsSchema::buildSchema();\n\n $parser = new Parser();\n $validator = new Validator();\n\n $parser->parse($query);\n $document = $parser->getParsedDocument();\n\n $validator->validate($schema, $document);\n\n self::assertEmpty($validator->getErrors());\n }", "public function testIsGraphQuery()\n {\n $this->assertFalse($this->fixture->isGraphQuery());\n }", "public function testQuery() {\n $builder = new Builder();\n $request = new Request();\n\n $builder->request($request);\n\n $this->assertNull($builder->query());\n $this->assertEquals([], $builder->query([]));\n $this->assertEquals([], $builder->query());\n $this->assertEquals(['val'], $builder->query(['val']));\n $this->assertEquals(['val', 'test'], $builder->query(['val', 'test']));\n }", "public function testBasicBehaviour()\n {\n $user = $this->asSuper();\n\n $query = /** @lang GraphQL */'{ \n me { \n id \n name \n person_id \n created_at \n created_by \n updated_at \n updated_by \n } \n }';\n\n $this->graphql($query)->assertNoErrors()->assertData([\n 'me' => [\n 'id' => $user->id,\n 'name' => $user->name,\n 'person_id' => $user->person_id,\n 'created_at' => $user->created_at->format(config('graphql.output_formats.datetime')),\n 'created_by' => $user->created_by,\n 'updated_at' => $user->updated_at->format(config('graphql.output_formats.datetime')),\n 'updated_by' => $user->updated_by,\n ]\n ]);\n }", "abstract protected function validateQuery();", "public function testQuery() {\n $parser = new Parser();\n $request = new Request();\n\n $parser->request($request);\n\n $this->assertNull($parser->query());\n $this->assertEquals([], $parser->query([]));\n $this->assertEquals([], $parser->query());\n $this->assertEquals(['val'], $parser->query(['val']));\n $this->assertEquals(['val', 'test'], $parser->query(['val', 'test']));\n }", "public function testInvalid()\n {\n Query::create(\\stdClass::class, [\n 'asd' => 'basd',\n ]);\n }", "public function testEndpointWithSchema()\n {\n $queryPath = route('graphql.query', ['custom']);\n $response = $this->call('GET', route('graphql.graphiql', ['custom']));\n $this->assertEquals(200, $response->status());\n $this->assertEquals($queryPath, $response->original->graphqlPath);\n $content = $response->getContent();\n $this->assertContains($queryPath, $content);\n }", "public function build_query();", "public function testIsQueryValid()\n {\n\n $this->assertTrue($this->column->isQueryValid(true));\n $this->assertTrue($this->column->isQueryValid(false));\n $this->assertTrue($this->column->isQueryValid(1));\n $this->assertTrue($this->column->isQueryValid(0));\n // Doesn't work with PHP 7\n // $this->assertFalse($this->column->isQueryValid('foo'));\n }", "public function testPostTypeQueryForPosts() {\n\t\t/**\n\t\t * Create the global ID based on the post_type and the created $id\n\t\t */\n\t\t$global_id = \\GraphQLRelay\\Relay::toGlobalId( 'postType', 'post' );\n\n\t\t/**\n\t\t * Create the query string to pass to the $query\n\t\t */\n\t\t$query = \"\n\t\tquery {\n\t\t\tposts {\n\t\t\t\tpostTypeInfo {\n\t\t\t\t\tcanExport\n\t\t\t\t\tconnectedTaxonomies {\n\t\t\t\t\t\tname\n\t\t\t\t\t}\n\t\t\t\t\tconnectedTaxonomyNames\n\t\t\t\t\tdeleteWithUser\n\t\t\t\t\tdescription\n\t\t\t\t\texcludeFromSearch\n\t\t\t\t\tgraphqlPluralName\n\t\t\t\t\tgraphqlSingleName\n\t\t\t\t\thasArchive\n\t\t\t\t\thierarchical\n\t\t\t\t\tid\n\t\t\t\t\tlabel\n\t\t\t\t\tlabels {\n\t\t\t\t\t\tname\n\t\t\t\t\t\tsingularName\n\t\t\t\t\t\taddNew\n\t\t\t\t\t\taddNewItem\n\t\t\t\t\t\teditItem\n\t\t\t\t\t\tnewItem\n\t\t\t\t\t\tviewItem\n\t\t\t\t\t\tviewItems\n\t\t\t\t\t\tsearchItems\n\t\t\t\t\t\tnotFound\n\t\t\t\t\t\tnotFoundInTrash\n\t\t\t\t\t\tparentItemColon\n\t\t\t\t\t\tallItems\n\t\t\t\t\t\tarchives\n\t\t\t\t\t\tattributes\n\t\t\t\t\t\tinsertIntoItem\n\t\t\t\t\t\tuploadedToThisItem\n\t\t\t\t\t\tfeaturedImage\n\t\t\t\t\t\tsetFeaturedImage\n\t\t\t\t\t\tremoveFeaturedImage\n\t\t\t\t\t\tuseFeaturedImage\n\t\t\t\t\t\tmenuName\n\t\t\t\t\t\tfilterItemsList\n\t\t\t\t\t\titemsListNavigation\n\t\t\t\t\t\titemsList\n\t\t\t\t\t}\n\t\t\t\t\tmenuIcon\n\t\t\t\t\tmenuPosition\n\t\t\t\t\tname\n\t\t\t\t\tpublic\n\t\t\t\t\tpubliclyQueryable\n\t\t\t\t\trestBase\n\t\t\t\t\trestControllerClass\n\t\t\t\t\tshowInAdminBar\n\t\t\t\t\tshowInGraphql\n\t\t\t\t\tshowInMenu\n\t\t\t\t\tshowInNavMenus\n\t\t\t\t\tshowInRest\n\t\t\t\t\tshowUi\n\t\t\t\t}\n\t\t\t}\n\t\t}\";\n\n\t\t/**\n\t\t * Run the GraphQL query\n\t\t */\n\t\twp_set_current_user( $this->admin );\n\t\t$actual = do_graphql_request( $query );\n\n\t\t/**\n\t\t * Establish the expectation for the output of the query\n\t\t */\n\t\t$expected = [\n\t\t\t'data' => [\n\t\t\t\t'posts' => [\n\t\t\t\t\t'postTypeInfo' => [\n\t\t\t\t\t\t'canExport' => true,\n\t\t\t\t\t\t'connectedTaxonomies' => [\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'name' => 'category'\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'name' => 'post_tag'\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'connectedTaxonomyNames' => [ 'category', 'post_tag' ],\n\t\t\t\t\t\t'deleteWithUser' => true,\n\t\t\t\t\t\t'description' => '',\n\t\t\t\t\t\t'excludeFromSearch' => false,\n\t\t\t\t\t\t'graphqlPluralName' => 'posts',\n\t\t\t\t\t\t'graphqlSingleName' => 'post',\n\t\t\t\t\t\t'hasArchive' => false,\n\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t'id' => $global_id,\n\t\t\t\t\t\t'label' => 'Posts',\n\t\t\t\t\t\t'labels' => [\n\t\t\t\t\t\t\t'name' => 'Posts',\n\t\t\t\t\t\t\t'singularName' => 'Post',\n\t\t\t\t\t\t\t'addNew' => 'Add New',\n\t\t\t\t\t\t\t'addNewItem' => 'Add New Post',\n\t\t\t\t\t\t\t'editItem' => 'Edit Post',\n\t\t\t\t\t\t\t'newItem' => 'New Post',\n\t\t\t\t\t\t\t'viewItem' => 'View Post',\n\t\t\t\t\t\t\t'viewItems' => 'View Posts',\n\t\t\t\t\t\t\t'searchItems' => 'Search Posts',\n\t\t\t\t\t\t\t'notFound' => 'No posts found.',\n\t\t\t\t\t\t\t'notFoundInTrash' => 'No posts found in Trash.',\n\t\t\t\t\t\t\t'parentItemColon' => null,\n\t\t\t\t\t\t\t'allItems' => 'All Posts',\n\t\t\t\t\t\t\t'archives' => 'Post Archives',\n\t\t\t\t\t\t\t'attributes' => 'Post Attributes',\n\t\t\t\t\t\t\t'insertIntoItem' => 'Insert into post',\n\t\t\t\t\t\t\t'uploadedToThisItem' => 'Uploaded to this post',\n\t\t\t\t\t\t\t'featuredImage' => 'Featured Image',\n\t\t\t\t\t\t\t'setFeaturedImage' => 'Set featured image',\n\t\t\t\t\t\t\t'removeFeaturedImage' => 'Remove featured image',\n\t\t\t\t\t\t\t'useFeaturedImage' => null,\n\t\t\t\t\t\t\t'menuName' => 'Posts',\n\t\t\t\t\t\t\t'filterItemsList' => 'Filter posts list',\n\t\t\t\t\t\t\t'itemsListNavigation' => 'Posts list navigation',\n\t\t\t\t\t\t\t'itemsList' => 'Posts list',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'menuIcon' => null,\n\t\t\t\t\t\t'menuPosition' => 5,\n\t\t\t\t\t\t'name' => 'post',\n\t\t\t\t\t\t'public' => true,\n\t\t\t\t\t\t'publiclyQueryable' => true,\n\t\t\t\t\t\t'restBase' => 'posts',\n\t\t\t\t\t\t'restControllerClass' => 'WP_REST_Posts_Controller',\n\t\t\t\t\t\t'showInAdminBar' => true,\n\t\t\t\t\t\t'showInGraphql' => true,\n\t\t\t\t\t\t'showInMenu' => true,\n\t\t\t\t\t\t'showInNavMenus' => true,\n\t\t\t\t\t\t'showInRest' => true,\n\t\t\t\t\t\t'showUi' => true,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$this->assertEquals( $expected, $actual );\n\t}", "public function testIsValidQuery(): void\n {\n $testCases = [\n \"\" => true,\n \"first_name=John&last_name=Doe\" => true,\n // All of the valid characters together\n \"%00azAZ09-._~!$&'()*+,;=:@/?\" => true,\n // Invalid characters and percent encodings\n \"#\" => false,\n \"[\" => false,\n \"]\" => false,\n \"%A\" => false,\n \"%G\" => false,\n \"%GA\" => false,\n \"%AG\" => false\n ];\n\n foreach ($testCases as $query => $isValid) {\n $this->assertEquals($isValid, Rfc3986::isValidQuery($query), \"Failed for case '$query'.\");\n }\n }", "public function testGetQueryParts()\n {\n $this->fixture = new SelectQueryImpl(\n 'PREFIX foo: <http://bar.de/>\n SELECT ?s ?p ?o\n FROM <http://foo/bar/>\n FROM NAMED <http://foo/bar/named>\n WHERE {\n ?s ?p ?o.\n ?s?p?o.\n ?s <http://www.w3.org/2000/01/rdf-schema#label> \"Foo\"^^<http://www.w3.org/2001/XMLSchema#string> .\n ?s ?foo \"val EN\"@en\n FILTER (?o = \"Bar\")\n FILTER (?o > 40)\n FILTER regex(?g, \"r\", \"i\")\n }\n LIMIT 10\n OFFSET 5 ',\n new RdfHelpers()\n );\n\n $queryParts = $this->fixture->getQueryParts();\n\n // Checks the return for the following patterns:\n // FILTER (?o = 'Bar')\n // FILTER (?o > 40)\n // FILTER regex(?g, 'r', 'i')\n $this->assertEquals(\n [\n [\n 'type' => 'expression',\n 'sub_type' => 'relational',\n 'patterns' => [\n [\n 'value' => 'o',\n 'type' => 'var',\n 'operator' => '',\n ],\n [\n 'value' => 'Bar',\n 'type' => 'literal',\n 'sub_type' => 'literal2',\n 'operator' => '',\n ],\n ],\n 'operator' => '=',\n ],\n\n // FILTER (?o > 40)\n [\n 'type' => 'expression',\n 'sub_type' => 'relational',\n 'patterns' => [\n [\n 'value' => 'o',\n 'type' => 'var',\n 'operator' => '',\n ],\n [\n 'value' => '40',\n 'type' => 'literal',\n 'operator' => '',\n 'datatype' => 'http://www.w3.org/2001/XMLSchema#integer',\n ],\n ],\n 'operator' => '>',\n ],\n\n // FILTER regex(?g, 'r', 'i')\n [\n 'args' => [\n [\n 'value' => 'g',\n 'type' => 'var',\n 'operator' => '',\n ],\n [\n 'value' => 'r',\n 'type' => 'literal',\n 'sub_type' => 'literal2',\n 'operator' => '',\n ],\n [\n 'value' => 'i',\n 'type' => 'literal',\n 'sub_type' => 'literal2',\n 'operator' => '',\n ],\n ],\n 'type' => 'built_in_call',\n 'call' => 'regex',\n ],\n ],\n $queryParts['filter_pattern']\n );\n\n // graphs\n $this->assertEquals(['http://foo/bar/'], $queryParts['graphs']);\n\n // named graphs\n $this->assertEquals(['http://foo/bar/named'], $queryParts['named_graphs']);\n\n // triple patterns\n // Checks the return for the following patterns:\n // ?s ?p ?o.\n // ?s?p?o.\n // ?s <http://www.w3.org/2000/01/rdf-schema#label> \\'Foo\\'^^<http://www.w3.org/2001/XMLSchema#string> .\n // ?s ?foo \\'val EN\\'@en .\n $this->assertEquals(\n [\n // ?s ?p ?o.\n [\n 's' => 's',\n 'p' => 'p',\n 'o' => 'o',\n 's_type' => 'var',\n 'p_type' => 'var',\n 'o_type' => 'var',\n 'o_datatype' => '',\n 'o_lang' => '',\n ],\n // ?s?p?o.\n [\n 's' => 's',\n 'p' => 'p',\n 'o' => 'o',\n 's_type' => 'var',\n 'p_type' => 'var',\n 'o_type' => 'var',\n 'o_datatype' => '',\n 'o_lang' => '',\n ],\n // ?s <http://www.w3.org/2000/01/rdf-schema#label>\n // \\'Foo\\'^^<http://www.w3.org/2001/XMLSchema#string> .\n [\n 's' => 's',\n 'p' => 'http://www.w3.org/2000/01/rdf-schema#label',\n 'o' => 'Foo',\n 's_type' => 'var',\n 'p_type' => 'uri',\n 'o_type' => 'typed-literal',\n 'o_datatype' => 'http://www.w3.org/2001/XMLSchema#string',\n 'o_lang' => '',\n ],\n // ?s ?foo \\'val EN\\'@en .\n [\n 's' => 's',\n 'p' => 'foo',\n 'o' => 'val EN',\n 's_type' => 'var',\n 'p_type' => 'var',\n 'o_type' => 'literal',\n 'o_datatype' => '',\n 'o_lang' => 'en',\n ],\n ],\n $queryParts['triple_pattern']\n );\n\n /*\n * limit\n */\n $this->assertEquals('10', $queryParts['limit']);\n\n /*\n * offset\n */\n $this->assertEquals('5', $queryParts['offset']);\n\n /*\n * prefixes\n */\n $this->assertEquals(\n [\n 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#',\n 'xsd' => 'http://www.w3.org/2001/XMLSchema#',\n ],\n $queryParts['namespaces']\n );\n\n /*\n * prefixes\n */\n $this->assertEquals(['foo' => 'http://bar.de/'], $queryParts['prefixes']);\n\n /*\n * result vars\n */\n $this->assertEquals(['s', 'p', 'o'], $queryParts['result_variables']);\n\n /*\n * variables\n */\n $this->assertEquals(['s', 'p', 'o', 'foo', 'g'], $queryParts['variables']);\n }", "public function testPostQuery(): void {\n $result = $this->query('query { root }', NULL, [], NULL, FALSE, Request::METHOD_POST);\n $this->assertSame(200, $result->getStatusCode());\n $this->assertSame([\n 'data' => [\n 'root' => 'test',\n ],\n ], json_decode($result->getContent(), TRUE));\n $this->assertFalse($result->isCacheable());\n }", "public function testNoteThatNonExistingFieldsAreInvalid()\n {\n $query = '\n query HeroSpaceshipQuery {\n hero {\n favoriteSpaceship\n }\n }';\n\n $schema = StarWarsSchema::buildSchema();\n\n $parser = new Parser();\n $validator = new Validator();\n\n $parser->parse($query);\n $document = $parser->getParsedDocument();\n\n $validator->validate($schema, $document);\n\n self::assertNotEmpty($validator->getErrors());\n }", "abstract protected function constructQuery();", "public function testQuery(): void {\n $result = $this->query('query { root }');\n\n $this->assertSame(200, $result->getStatusCode());\n $this->assertSame([\n 'data' => [\n 'root' => 'test',\n ],\n ], json_decode($result->getContent(), TRUE));\n $this->assertTrue($result->isCacheable());\n $this->assertEquals('max-age=900, public', $result->headers->get('Cache-Control'));\n }", "public function testConstructor()\n {\n $this->fixture = new SelectQueryImpl(\n 'SELECT ?s ?p ?o FROM <'.$this->testGraph->getUri().'> WHERE {?s ?p ?o.}',\n new RdfHelpers()\n );\n\n $queryParts = $this->fixture->getQueryParts();\n\n // select\n $this->assertEquals('SELECT ?s ?p ?o', $queryParts['select']);\n\n // from\n $this->assertEquals([$this->testGraph->getUri()], $queryParts['graphs']);\n\n // where\n $this->assertEquals('WHERE {?s ?p ?o.}', $queryParts['where']);\n }", "public function generateQuery();", "public function testCanLoginWithGraphQL()\n {\n $this->createClient();\n $response = $this->post('/graphql', [\n 'query' => \"mutation{\n login(data: { username: \\\"[email protected]\\\", password: \\\"password\\\"}) {\n access_token\n }\n }\"\n ]);\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'data' => [\n 'login' => [\n 'access_token',\n ]\n ]\n ]);\n }", "public function testPersistedQueryBatchingFoundNotFoundAndInvalidHash(): void\n {\n\n $response = $this->call('GET', '/graphql', [\n 'query' => trim($this->queries['examples']),\n 'extensions' => [\n 'persistedQuery' => [\n 'version' => 1,\n 'sha256Hash' => hash('sha256', trim($this->queries['examples'])),\n ],\n ],\n ]);\n\n self::assertEquals(200, $response->getStatusCode());\n\n $content = $response->json();\n\n self::assertArrayHasKey('data', $content);\n self::assertEquals(['examples' => $this->data], $content['data']);\n\n // run query persisted and not\n\n $response = $this->call('POST', '/graphql', [\n [\n 'extensions' => [\n 'persistedQuery' => [\n 'version' => 1,\n 'sha256Hash' => hash('sha256', trim($this->queries['examples'])),\n ],\n ],\n ],\n [\n 'variables' => [\n 'index' => 0,\n ],\n 'extensions' => [\n 'persistedQuery' => [\n 'version' => 1,\n 'sha256Hash' => hash('sha256', trim($this->queries['examplesWithVariables'])),\n ],\n ],\n ],\n [\n 'query' => trim($this->queries['examplesWithVariables']),\n 'variables' => [\n 'index' => 0,\n ],\n 'extensions' => [\n 'persistedQuery' => [\n 'version' => 1,\n 'sha256Hash' => hash('sha256', 'foo'),\n ],\n ],\n ],\n ]);\n\n self::assertEquals(200, $response->getStatusCode());\n\n $content = $response->json();\n\n unset($content[1]['errors'][0]['extensions']['file']);\n unset($content[1]['errors'][0]['extensions']['line']);\n unset($content[2]['errors'][0]['extensions']['file']);\n unset($content[2]['errors'][0]['extensions']['line']);\n\n self::assertArrayHasKey(0, $content);\n self::assertArrayHasKey(1, $content);\n self::assertArrayHasKey(2, $content);\n\n self::assertArrayHasKey('data', $content[0]);\n self::assertEquals(['examples' => $this->data], $content[0]['data']);\n\n self::assertEquals([\n [\n 'message' => AutomaticPersistedQueriesError::MESSAGE_PERSISTED_QUERY_NOT_FOUND,\n 'extensions' => [\n 'code' => AutomaticPersistedQueriesError::CODE_PERSISTED_QUERY_NOT_FOUND,\n 'category' => AutomaticPersistedQueriesError::CATEGORY_APQ,\n ],\n ],\n ], $content[1]['errors']);\n\n self::assertEquals([\n [\n 'message' => AutomaticPersistedQueriesError::MESSAGE_INVALID_HASH,\n 'extensions' => [\n 'code' => AutomaticPersistedQueriesError::CODE_INTERNAL_SERVER_ERROR,\n 'category' => AutomaticPersistedQueriesError::CATEGORY_APQ,\n ],\n ],\n ], $content[2]['errors']);\n }", "public function testBuildRequestQuery()\n {\n $expected = \"&filter%5Bfield%5D%5B0%5D=turtle&filter%5Boperator%5D%5B0%5D=equals&filter%5Bvalue%5D%5B0%5D=Donatello\";\n\n $filter = new Filter;\n $filter->data = new FilterItem(\"turtle\", \"equals\", \"Donatello\");\n\n $query = $filter->addFilterItem($filter->data);\n $addeds = $filter->returnItems();\n $addeds = $addeds[0];\n $this->assertInstanceOf('SurveyGizmo\\Helpers\\FilterItem', $addeds);\n $actual = $filter->buildRequestQuery();\n $this->assertEquals($expected, $actual);\n\n }", "public function testRequireFieldsOnObjects()\n {\n $query = '\n query HeroNoFieldsQuery {\n hero\n }\n ';\n\n $schema = StarWarsSchema::buildSchema();\n\n $parser = new Parser();\n $validator = new Validator();\n\n $parser->parse($query);\n $document = $parser->getParsedDocument();\n $validator->validate($schema, $document);\n\n self::assertNotEmpty($validator->getErrors());\n }", "public function testRqlIsParsedOnlyOnGetRequest()\n {\n $appData = [\n 'showInMenu' => false,\n 'order' => 100,\n 'name' => ['en' => 'Administration'],\n ];\n\n $client = static::createRestClient();\n $client->request('GET', '/core/app/?invalidrqlquery');\n $this->assertEquals(Response::HTTP_BAD_REQUEST, $client->getResponse()->getStatusCode());\n $this->assertStringContainsString('syntax error in rql', $client->getResults()->message);\n\n $client = static::createRestClient();\n $client->request('GET', '/core/app/admin?invalidrqlquery');\n $this->assertEquals(Response::HTTP_BAD_REQUEST, $client->getResponse()->getStatusCode());\n $this->assertStringContainsString('syntax error in rql', $client->getResults()->message);\n\n $client = static::createRestClient();\n $client->request('OPTIONS', '/core/app/?invalidrqlquery');\n $this->assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());\n\n $client = static::createRestClient();\n $client->request('OPTIONS', '/schema/core/app/collection?invalidrqlquery');\n $this->assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());\n\n $client = static::createRestClient();\n $client->request('OPTIONS', '/schema/core/app/item?invalidrqlquery');\n $this->assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());\n\n $client = static::createRestClient();\n $client->request('GET', '/schema/core/app/collection?invalidrqlquery');\n $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());\n\n $client = static::createRestClient();\n $client->request('GET', '/schema/core/app/item?invalidrqlquery');\n $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());\n\n\n $client = static::createRestClient();\n $client->post('/core/app/?invalidrqlquery', $appData);\n $this->assertEquals(Response::HTTP_CREATED, $client->getResponse()->getStatusCode());\n\n $client = static::createRestClient();\n $client->put('/core/app/admin?invalidrqlquery', $appData);\n $this->assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());\n\n $client = static::createRestClient();\n $client->request('DELETE', '/core/app/admin?invalidrqlquery');\n $this->assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());\n }", "public function createQuery()\n\t{\n\t}", "public function createQuery()\n\t{\n\t}", "public function testQueryTypeAnd() {\n $backend = $this->prophesize(BackendInterface::class);\n $backend->getSupportedFeatures()->willReturn([]);\n $server = $this->prophesize(ServerInterface::class);\n $server->getBackend()->willReturn($backend);\n $index = $this->prophesize(IndexInterface::class);\n $index->getServerInstance()->willReturn($server);\n $query = $this->prophesize(SearchApiQuery::class);\n $query->getIndex()->willReturn($index);\n\n $facet = new Facet(\n ['query_operator' => 'AND', 'widget' => 'links'],\n 'facets_facet'\n );\n $facet->addProcessor([\n 'processor_id' => 'granularity_item',\n 'weights' => [],\n 'settings' => ['granularity' => 10],\n ]);\n\n // Results for the widget.\n $original_results = [\n ['count' => 3, 'filter' => '2'],\n ['count' => 5, 'filter' => '4'],\n ['count' => 7, 'filter' => '9'],\n ['count' => 9, 'filter' => '11'],\n ];\n\n // Facets the widget should produce.\n $grouped_results = [\n 0 => ['count' => 15, 'filter' => '0'],\n 10 => ['count' => 9, 'filter' => 10],\n ];\n\n $query_type = new SearchApiGranular(\n [\n 'facet' => $facet,\n 'query' => $query->reveal(),\n 'results' => $original_results,\n ],\n 'search_api_string',\n []\n );\n\n $built_facet = $query_type->build();\n $this->assertInstanceOf(FacetInterface::class, $built_facet);\n\n $results = $built_facet->getResults();\n $this->assertSame('array', gettype($results));\n\n foreach ($grouped_results as $k => $result) {\n $this->assertInstanceOf(ResultInterface::class, $results[$k]);\n $this->assertEquals($result['count'], $results[$k]->getCount());\n $this->assertEquals($result['filter'], $results[$k]->getDisplayValue());\n }\n }", "public function testPostAnalyticsConversationsAggregatesQuery()\n {\n }", "public function test_me()\n {\n //prepare\n $user = factory(User::class)->create();\n Passport::actingAs($user);\n\n //execute\n $response = $this->graphQL('\n query {\n me {\n id\n name\n email\n }\n }\n ');\n\n //assert\n $response->assertJson([\n 'data' => [\n 'me' => []\n ]\n ]);\n }", "public function testBuildQuery() {\n\t\t$vars = ['foo' => 'bar'];\n\n\t\t$this->assertEquals('?foo=bar', Url::buildQuery($vars));\n\t}" ]
[ "0.7422704", "0.69677013", "0.6909391", "0.6889033", "0.6704434", "0.65604043", "0.6311232", "0.62809205", "0.62007916", "0.61675876", "0.6156956", "0.607608", "0.6069674", "0.602695", "0.60081434", "0.59963834", "0.5984429", "0.5972776", "0.59671724", "0.59397215", "0.5926154", "0.5887397", "0.5865662", "0.5856629", "0.5843997", "0.5843997", "0.5834255", "0.58335805", "0.5831842", "0.5830132" ]
0.73353845
1
Build the polynom based on the given points.
protected function buildPolynom() { $points = array(); foreach ( $this->source as $key => $value ) { if ( !is_numeric( $key ) ) { throw new ezcGraphDatasetAverageInvalidKeysException(); } if ( ( $this->min === false ) || ( $this->min > $key ) ) { $this->min = (float) $key; } if ( ( $this->max === false ) || ( $this->max < $key ) ) { $this->max = (float) $key; } $points[] = new ezcGraphCoordinate( (float) $key, (float) $value ); } // Build transposed and normal Matrix out of coordiantes $a = new ezcGraphMatrix( count( $points ), $this->polynomOrder + 1 ); $b = new ezcGraphMatrix( count( $points ), 1 ); for ( $i = 0; $i <= $this->properties['polynomOrder']; ++$i ) { foreach ( $points as $nr => $point ) { $a->set( $nr, $i, pow( $point->x, $i ) ); $b->set( $nr, 0, $point->y ); } } $at = clone $a; $at->transpose(); $left = $at->multiply( $a ); $right = $at->multiply( $b ); $this->polynom = $left->solveNonlinearEquatation( $right ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function polyGravity1($points){\n $x_sum = 0;\n $y_sum = 0;\n\n\n $num = count($points);\n foreach ($points as $p){\n //separate into individual x and y value\n $poly_x_y = explode(',', $p);\n \n\tif (count($poly_x_y)<2){\n echo \"Wrong Point format!!!: '$p'\\n\".count($points);\n debug_print_backtrace();\n }\n\t$x_sum += $poly_x_y[0];\n\t$y_sum += $poly_x_y[1];\n\n }\n \n $x_av = $x_sum/$num;\n $y_av = $y_sum/$num;\n return new Point( $x_av, $y_av);\n}", "function polyGravity($points){\n $min_x = 100000;\n $min_y = 100000;\n $max_x = 0;\n $max_y = 0;\n\t \n foreach ($points as $p){\n //separate into individual x and y value\n $poly_x_y = explode(',', $p);\n if (count($poly_x_y)<2){\n echo \"Wrong Point format!!!: '$p'\\n\".count($points);\n debug_print_backtrace();\n }\n if ($poly_x_y[0] > $max_x) $max_x = $poly_x_y[0];\n if ($poly_x_y[0] < $min_x) $min_x = $poly_x_y[0];\n if ($poly_x_y[1] > $max_y) $max_y = $poly_x_y[1];\n if ($poly_x_y[1] < $min_y) $min_y = $poly_x_y[1];\n }\n \n return new Point( ($max_x+$min_x)/2, ($max_y+$min_y)/2 );\n}", "protected function populate( $limit, $points = array( ) ) \n { \n //Keep generating points while the value of $limit is a truthy value \n if( $limit-- ) \n { \n //Create arbitrary x and y coordinates \n $x = rand( 0, SVG_WIDTH ); \n $y = rand( 0, SVG_HEIGHT ); \n\n //Create a new point using the above coordinates\n $points[ ] = new svg_point( $x, $y );\n\n //Proceed to the next iteration \n $points = $this->populate( $limit, $points ); \n } \n\n //Return the array of points \n return( $points ); \n }", "public function __construct($points) { \n\t\n $this->points = $points;\n\t\t\n }", "private function buildPositions(){\n $this->positions = new PositionCollection();\n for($y=1;$y<=$this->height;$y++){\n for($x=1;$x<=$this->width;$x++){\n $this->positions->push( new Position($x,$y) );\n }\n }\n \n }", "function generate_map_circles($aggrq, $tool = \"ndt\")\r\n{\r\n\tglobal $message, $glasnost_throttles_accepted_percentage;\r\n\t//$arearadiuses = array(0.003,0.005,0.15,0.25,0.5);\r\n\t$arearadiuses = array(0.005,0.008,0.18,0.28,0.6);\r\n\t$areapolygonangles = array(60,45,30,15,10);\r\n\t$thisarealat = 0;\r\n\t$thisarealng = 0;\r\n\t$index = 0;\r\n\t$protocols = array(\"flash\",\"bittorent\",\"emule\",\"gnutella\",\"pop\",\"imap\",\"http\",\"ssh\");\r\n\t$jscode = \"\";\r\n\t$phparraytojson = array();\r\n\tif (is_null($aggrq))\r\n\t\treturn array(\"\",\"\");\r\n\t$polygons_defined = false;\r\n\tif (isset($aggrq['pols']))//this is the query for retrieving actual polygons\r\n\t{\r\n\t\t$polygons_defined = true;\r\n\t\t//Simple execution without prepared statement, since parameters are properly sanitized in mappoints.php\r\n\t\t$res = execute_query($aggrq['pols']);\r\n\t\t$aid = 0;\r\n\t\t//$i = -1;\r\n\t\twhile($row = $res -> fetch_assoc())\r\n\t\t{\t\r\n\t\t\tif ($aid != $row['id']) //[[p,l],[p,l],[p,l]]\r\n\t\t\t\t$aid = $row['id'];\r\n\t\t\t$areapolygons[$aid]['php'][] = array($row['points'], $row['levels']); \r\n\t\t\t$komma = (count($areapolygons[$aid]['php']) > 1)? ',':'';\r\n\t\t}\r\n\t}\r\n\t$metricscount =($tool == \"ndt\")? 5:8;\r\n\t$measurements_index = $metricscount+1;\r\n\t$connections_index = $metricscount+2;\r\n\t\r\n\tforeach($aggrq AS $key => $q)\r\n\t{ \r\n\t\tif (is_numeric($key)) \r\n\t\t{\r\n\t\t\t//Simple execution without prepared statement, since parameters are properly sanitized in mappoints.php\r\n\t\t\t$res = execute_query($q);\r\n\t\t\t$array_length = ($polygons_defined)? 7:6;\r\n\t\t\t$region_connections = 0;\r\n\t\t\t$processed_array = init_value_holders($tool, 0);\r\n\t\t\t\r\n\t\t\t/*********** Iterate over results and construct appropriate area data rows. Multiple rows may refer to one area when area connections *******\r\n\t\t\t************* span accross multiple ISPs *******************************************/\r\n\t\t\twhile($row = $res -> fetch_array(MYSQLI_BOTH))\r\n\t\t\t{\t\r\n\t\t\t\t//If area is changed and not only ISP inside the same area\r\n\t\t\t\t//...........create NEW area data row\r\n\t\t\t\tif (($row['longitude'] != $thisarealng) && ($row['latitude'] != $thisarealat )) \r\n\t\t\t\t{\r\n\t\t\t\t\t$table_fields = array_keys($row);\r\n\t\t\t\t\t$areatype = $table_fields[1];\r\n\t\t\t\t\tglobal ${\"min_connections_per_$areatype\"}, ${\"min_connections_per_$areatype\".'_glasnost'}; \r\n\t\t\t\t\t$min_connections_per_area = ($tool == \"ndt\")? ${\"min_connections_per_$areatype\"}:${\"min_connections_per_$areatype\".'_glasnost'};\r\n\t\t\t\t\t\r\n\t\t\t\t\t//if previous region contained very few connections, denote by assigning negative values to all metrics (i.e. make area polygon gray)\r\n\t\t\t\t\tif ($processed_array[$connections_index] > 0)\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t if( $processed_array[$connections_index] < $min_connections_per_area)\r\n\t\t\t\t\t\t//Too few connections in area\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tunset($phparraytojson[\"circles\"][$i][5]);\r\n\t\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0] = init_value_holders($tool, -1);\r\n\t\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0][0] = 0; //isp = 0\r\n\t\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0][$measurements_index] = 0; // measurements = 0\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if($_SESSION['profile'] < 2) //show aggregate for isps since not privileged profile\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t//Normailize by dividing with sum of connections in case of ndt that contains averages for the metrics\r\n\t\t\t\t\t\t\tif($tool == \"ndt\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tfor($y=1;$y<$metricscount+1;$y++)\r\n\t\t\t\t\t\t\t\t\t$processed_array[$y] = $processed_array[$y]/$processed_array[$connections_index]; \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tunset($phparraytojson[\"circles\"][$i][5]);\r\n\t\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0] = $processed_array;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tunset($processed_array);\r\n\t\t\t\t\t$processed_array = init_value_holders($tool, 0);\r\n\t\t\t\t\t$thisarea_no = $row[0];\r\n\t\t\t\t\t$thisarealat = $row['latitude'];\r\n\t\t\t\t\t$thisarealng = $row['longitude'];\r\n\t\t\t\t\t$thisareaname = $row['areaname'];\r\n\t\t\t\t\t$thisareacat = $row['category'];\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$index][0] = floatval($thisarealat);\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$index][1] = floatval($thisarealng);\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$index][2] = \"$thisareaname\";\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$index][3] = $arearadiuses[$thisareacat];\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$index][4] = $areapolygonangles[$thisareacat];\r\n\t\t\t\t\tif($polygons_defined)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$phparraytojson[\"circles\"][$index][6] = $areapolygons[$thisarea_no]['php'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$index++;\r\n\t\t\t\t\t$areaisps = 0;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t//...........Now add ISP data, maybe multiple times\r\n\t\t\t\t\r\n\t\t\t\t$thisisp = $row['isp_id'];\r\n\t\t\t\t$i = $index-1;\r\n\t\t\t\t\r\n\t\t\t\tif($row['measurements'] == NULL)\r\n\t\t\t\t// The area emerged from region table's left outer join. It doesn't contain enough measurements. Corresponding records contain NULLs\t\r\n\t\t\t\t{\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0] = init_value_holders($tool, -1);\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0][0] = 0; //isp = 0\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0][$measurements_index] = 0; // measurements = 0\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\t\r\n\t\t\t\t\tif($tool == \"ndt\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][$areaisps] = array(0=>intval($thisisp),1=>round($row['avgdown'],1),2=>round($row['avgup'],1),3=>round($row['avgloss'],1),4=>round($row['avgrtt'],0),5=>round($row['avgjitter'],1),6=>intval($row['measurements']),7=>intval($row['connections']));\r\n\t\t\t\t\t\tfor($x=1;$x<6;$x++)\r\n\t\t\t\t\t\t\t$processed_array[$x] += $row['connections']*$phparraytojson[\"circles\"][$i][5][$areaisps][$x];\r\n\t\t\t\t\t\tfor($x=6;$x<8;$x++)\r\n\t\t\t\t\t\t\t$processed_array[$x] += $phparraytojson[\"circles\"][$i][5][$areaisps][$x];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse // $tool == glasnost\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][$areaisps][0] = intval($thisisp);\r\n\t\t\t\t\t\t$p = 1;\r\n\t\t\t\t\t\tforeach($protocols AS $protocol)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][$areaisps][$p++] = array(intval($row[$protocol.'_throttled_connections']), intval($row['connections_with_'.$protocol.'_measurements']), intval($row[$protocol.'_measurements']));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][$areaisps][$p] = intval($row['measurements']);\r\n\t\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][$areaisps][$p+1] = intval($row['connections']);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor($x=1;$x<11;$x++)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\tif($x>0 && $x<9)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tfor($j=0;$j<3;$j++)\r\n\t\t\t\t\t\t\t\t\t$processed_array[$x][$j] += $phparraytojson[\"circles\"][$i][5][$areaisps][$x][$j];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t$processed_array[$x] += $phparraytojson[\"circles\"][$i][5][$areaisps][$x];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t\t$areaisps++;\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t/////***** Do the same processing for last area's tuples [ln. 657-675]\r\n\t\t\tif ($processed_array[$connections_index] > 0)\r\n\t\t\t{\t\r\n\t\t\t\tif( $processed_array[$connections_index] < $min_connections_per_area)\r\n\t\t\t\t//Too few connections in area\r\n\t\t\t\t{\r\n\t\t\t\t\tunset($phparraytojson[\"circles\"][$i][5]);\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0] = init_value_holders($tool, -1);\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0][0] = 0; //isp = 0\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0][$measurements_index] = 0; // measurements = 0\r\n\t\t\t\t}\r\n\t\t\t\telse if($_SESSION['profile'] < 2) //show aggregate for isps since not priviledged profile\r\n\t\t\t\t{\t\r\n\t\t\t\t\t//Normailize by dividing with sum of connections in case of ndt that contains averages for the metrics\r\n\t\t\t\t\tif($tool == \"ndt\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor($y=1;$y<$metricscount+1;$y++)\r\n\t\t\t\t\t\t\t$processed_array[$y] = $processed_array[$y]/$processed_array[$connections_index]; \r\n\t\t\t\t\t}\r\n\t\t\t\t\tunset($phparraytojson[\"circles\"][$i][5]);\r\n\t\t\t\t\t$phparraytojson[\"circles\"][$i][5][0] = $processed_array;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tunset($processed_array);\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t$json = json_encode($phparraytojson);\r\n\treturn $json;\r\n}", "private function generer_point_pop() {\n $t=0;\n while ($t<10) {\n $x = $this->x_depart + self::DECALAGE_X[0][$t];\n $y = $this->y_depart + self::DECALAGE_Y[0][$t];\n if ($this->secteurs[$y][$x]->getSecteurType() == 0) {\n $this->secteurs[$y][$x]->setSecteurType(99);\n $this->asteroidesPop();\n $t=10;\n \t}\n $t++;\n }\n // recherche du point de pop des autres joueurs\n $nb_niv = intval(TAILLE_MAP_COTE/(2*COEF_POPULATION)); // nb de niveaux de pop à générer\n $z=1;\n for ($niv=1;$niv<=$nb_niv;$niv++) {\n \t\t$s=1;\n \t\twhile ($s<=(8*$niv)) {\n \t\t\t$this->x_pos=$this->x_depart + (COEF_POPULATION*self::DECALAGE_X[$niv][$s]) + rand(-1,1);\n \t\t\t$this->y_pos=$this->y_depart + (COEF_POPULATION*self::DECALAGE_Y[$niv][$s]) + rand(-1,1);\n \t\t\t$t=0;\n \t\t\twhile ($t<10) {\n $x = $this->x_pos + self::DECALAGE_X[0][$t];\n $y = $this->y_pos + self::DECALAGE_Y[0][$t];\n if ($this->secteurs[$y][$x]->getSecteurType() == 0) {\n $this->secteurs[$y][$x]->setSecteurType(99);\n $this->secteurs[$y][$x]->setSecteurOrdre($z);\n $this->asteroidesPop();\n \t\t\t\t\t$t=10;\n \t\t\t\t\t$z++;\n \t\t\t\t}\n \t\t\t\t$t++;\n \t\t\t}\n \t\t\t$s++;\n \t\t}\n \t}\n\n }", "public function providerForTestGenerateParams()\n {\n $temp1 = array(\n 'MULTIPOINT' => array(\n 'no_of_points' => 2,\n 0 => array('x' => '5.02', 'y' => '8.45'),\n 1 => array('x' => '6.14', 'y' => '0.15')\n )\n );\n $temp2 = $temp1;\n $temp2['gis_type'] = 'MULTIPOINT';\n\n return array(\n array(\n \"'MULTIPOINT(5.02 8.45,6.14 0.15)',124\",\n null,\n array(\n 'srid' => '124',\n 0 => $temp1\n )\n ),\n array(\n 'MULTIPOINT(5.02 8.45,6.14 0.15)',\n 2,\n array(\n 2 => $temp2\n )\n )\n );\n }", "public function make_geogebra_question_point() {\n question_bank::load_question_definition_classes('geogebra');\n $geo = new qtype_geogebra_question();\n test_question_maker::initialise_a_question($geo);\n $geo->name = \"Finding a point in the plane\";\n $geo->questiontext = \"Drag the point to ({a}/{b})\";\n $geo->generalfeedback = 'Generalfeedback: Dragging a point isn\\'t to hard.';\n $geo->ggbxml = ggbstringsfortesting::$pointxml;\n $geo->ggbparameters = ggbstringsfortesting::$pointparameters;\n $geo->ggbviews = ggbstringsfortesting::$views;\n $geo->ggbcodebaseversion = '5.0';\n $geo->israndomized = 1;\n $geo->randomizedvar = 'a,b,';\n $geo->answers = array(\n 13 => new question_answer(13, 'e', 1.0, 'Very Good!', FORMAT_HTML)\n );\n $geo->qtype = question_bank::get_qtype('geogebra');\n\n return $geo;\n }", "function cross_plants( $arr_plants, $int_number_of_offspring )\n\t{\n\t\tif ( count( $arr_plants ) == 1 )\n\t\t{\n\t\t\t$arr_plants[ 1 ] = $arr_plants[ 0 ];\n\t\t}\n\t\t\n\t\t// if we have multiple parents, then we will need to know how many plants we are going to pick\n\t\t// from each pair of the parents, so calculate\n\t\t$tmp_int_number_of_cross = count( $arr_plants ) * ( count( $arr_plants ) - 1 ) / 2;\n\t\t$tmp_int_plants_per_recombination = floor( $int_number_of_offspring / $tmp_int_number_of_cross );\t// number of plants picked from each pair of parents\n\t\t$tmp_int_plants_remained = $int_number_of_offspring - $tmp_int_plants_per_recombination * $tmp_int_number_of_cross;\n\t\t\n\t\t$tmp_arr_next_generation = array();\n\t\t\n\t\tfor ( $i = 0; $i < count( $arr_plants ) - 1; ++$i )\n\t\t{\n\t\t\tfor ( $j = $i + 1; $j < count( $arr_plants ); ++$j )\n\t\t\t{\n\t\t\t\tif ( $i == count( $arr_plants ) - 2 && $j == count( $arr_plants ) - 1 )\n\t\t\t\t{\n\t\t\t\t\t$tmp_arr_next_generation = array_merge( $tmp_arr_next_generation, Simulation::combine_plants( $arr_plants[$i], $arr_plants[$j], $tmp_int_plants_per_recombination + $tmp_int_plants_remained ) );\n\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$tmp_arr_next_generation = array_merge( $tmp_arr_next_generation, Simulation::combine_plants( $arr_plants[$i], $arr_plants[$j], $tmp_int_plants_per_recombination ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $tmp_arr_next_generation;\n\t}", "private function _random_shape() {\n $rshapes = array();\n // Bounding points that constrain the maximal shape expansion\n $min = new Point(0, 0);\n $max = new Point($this->width, $this->height);\n // Get a start point\n $previous = $startp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n // Of how many random geometrical primitives should our random shape consist?\n $ngp = secure_rand(min($this->dsettings['shapeify']['r_num_gp']), max($this->dsettings['shapeify']['r_num_gp']));\n\n foreach (range(0, $ngp) as $j) {\n // Find a random endpoint for geometrical primitves\n // If there are only 4 remaining shapes to add, choose a random point that\n // is closer to the endpoint!\n $rp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n if (($ngp - 4) <= $j) {\n $rp = new Point(secure_rand($min->x, $max->x), secure_rand($min->y, $max->y));\n // Make the component closer to the startpoint that is currently wider away\n // This ensures that the component switches over the iterations (most likely).\n $axis = abs($startp->x - $rp->x) > abs($startp->y - $rp->y) ? 'x' : 'y';\n if ($axis === 'x') {\n $rp->x += ($startp->x > $rp->x) ? abs($startp->x - $rp->x) / 4 : abs($startp->x - $rp->x) / -4;\n } else {\n $rp->y += ($startp->y > $rp->y) ? abs($startp->y - $rp->y) / 4 : abs($startp->y - $rp->y) / -4;\n }\n }\n\n if ($j == ($ngp - 1)) { // Close the shape. With a line\n $rshapes[] = array($previous, $startp);\n break;\n } elseif (rand(0, 1) == 1) { // Add a line\n $rshapes[] = array($previous, $rp);\n } else { // Add quadratic bezier curve\n $rshapes[] = array($previous, new Point($previous->x, $rp->y), $rp);\n }\n\n $previous = $rp;\n }\n return $rshapes;\n }", "public function make_geogebra_question_manually() {\n question_bank::load_question_definition_classes('geogebra');\n $geo = new qtype_geogebra_question();\n test_question_maker::initialise_a_question($geo);\n $geo->name = \"Finding a point in the plane\";\n $geo->questiontext = \"Drag the point to ({a}/{b})\";\n $geo->generalfeedback = 'Generalfeedback: Dragging a point isn\\'t to hard.';\n $geo->ggbturl = 'https://tube.geogebra.org/student/mI8RJzVzI';\n $geo->ggbxml = ggbstringsfortesting::$pointxml;\n $geo->ggbparameters = ggbstringsfortesting::$pointparameters;\n $geo->ggbviews = ggbstringsfortesting::$views;\n $geo->ggbcodebaseversion = '5.0';\n $geo->israndomized = 0;\n $geo->randomizedvar = '';\n $geo->qtype = question_bank::get_qtype('geogebra');\n\n return $geo;\n }", "public function setPoints($points)\n {\n $this->points = $points;\n\n return $this;\n }", "public function getPolynom()\n {\n if ( $this->polynom === false )\n {\n $this->buildPolynom();\n }\n\n return $this->polynom;\n }", "function __construct($point = 0){\n $this->point = $point;\n }", "public function __construct()\n {\n $this->_1859_P_Proof = array('PR 1', 'PR 2');\n $this->_1859_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6');\n\n $this->_1860_P_Proof = array('PR 1', 'PR 2');\n $this->_1860_P = array('Snow 1', 'Snow 2');\n\n $this->_1861_P_Proof = array('PR 1', 'PR 2');\n $this->_1861_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6');\n\n $this->_1862_P_Proof = array('PR 1', 'PR 2');\n $this->_1862_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4');\n\n $this->_1863_P_Proof = array('PR 1', 'PR 2');\n $this->_1863_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13');\n\n $this->_1864_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1864_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20');\n\n $this->_1865_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1865_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15');\n\n $this->_1866_P_Proof = array('PR 1');\n $this->_1866_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16');\n\n $this->_1867_P_Proof = array();\n $this->_1867_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8');\n\n $this->_1868_P_Proof = array('PR 1');\n $this->_1868_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11');\n\n $this->_1869_P_Proof = array('PR 1', 'PR 2');\n $this->_1869_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16');\n\n $this->_1870_P_Proof = array('PR 1', 'PR 2');\n $this->_1870_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33', 'Snow 34', 'Snow 35', 'Snow 36', 'Snow 37', 'Snow 38', 'Snow 39', 'Snow 40', 'Snow 41');\n\n $this->_1871_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1871_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5');\n\n $this->_1872_P_Proof = array('PR 1');\n $this->_1872_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14');\n\n $this->_1873_P_Proof = array('PR 1');\n $this->_1873_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7');\n\n $this->_1874_P_Proof = array('PR 1');\n $this->_1874_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4');\n\n $this->_1875_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1875_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15');\n\n $this->_1876_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1876_P = array('Snow 1');\n\n $this->_1877_P_Proof = ['PR 1', 'PR 2', 'PR 3'];\n $this->_1877_P = array('Snow 1', 'Snow 2');\n\n $this->_1878_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1878_P = array('Snow 1', 'Snow 2', 'Snow 3');\n\n $this->_1879_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1879_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4');\n\n $this->_1880_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1880_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4');\n\n $this->_1881_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1881_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7');\n\n $this->_1882_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1882_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7');\n\n $this->_1883_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1883_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10');\n\n $this->_1884_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1884_P = array('Snow 1', 'Snow 2', 'Snow 3');\n\n $this->_1885_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1885_P = array('Snow 1', 'Snow 2');\n\n $this->_1886_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1886_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8');\n\n $this->_1887_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5', 'PR 6');\n $this->_1887_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10');\n\n $this->_1888_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1888_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33');\n\n $this->_1889_P_Proof = array('PR 1', 'PR 2');\n $this->_1889_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33');\n\n $this->_1890_P_Proof = array('PR 1', 'PR 2');\n $this->_1890_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15');\n\n $this->_1891_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1891_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23');\n\n $this->_1892_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1892_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14');\n\n $this->_1893_P_Proof = array('PR 1', 'PR 2');\n $this->_1893_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18');\n\n $this->_1894_P_Proof = array('PR 1', 'PR 2');\n $this->_1894_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6');\n\n $this->_1895_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1895_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31');\n\n $this->_1896_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1896_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17');\n\n $this->_1897_P_Proof = array('PR 1', 'PR 2');\n $this->_1897_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18');\n\n $this->_1898_P_Proof = array('PR 1', 'PR 2', 'PR 3');\n $this->_1898_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33', 'Snow 34', 'Snow 35', 'Snow 36');\n\n $this->_1899_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1899_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22');\n\n $this->_1900_P_Proof = array('PR 1', 'PR 2');\n $this->_1900_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23');\n\n $this->_1901_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4', 'PR 5');\n $this->_1901_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24');\n\n $this->_1902_P_Proof = array('PR 1', 'PR 2', 'PR 3', 'PR 4');\n $this->_1902_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13');\n\n $this->_1903_P_Proof = array('PR 1');\n $this->_1903_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25');\n\n $this->_1904_P_Proof = array('PR 1');\n $this->_1904_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16');\n\n $this->_1905_P_Proof = array('PR 1');\n $this->_1905_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29');\n\n $this->_1906_P_Proof = array('PR 1');\n $this->_1906_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33', 'Snow 34', 'Snow 35', 'Snow 36', 'Snow 37', 'Snow 38', 'Snow 44');\n\n $this->_1907_P_Proof = array('PR 1');\n $this->_1907_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23', 'Snow 24', 'Snow 25', 'Snow 26', 'Snow 27', 'Snow 28', 'Snow 29', 'Snow 30', 'Snow 31', 'Snow 32', 'Snow 33', 'Snow 34', 'Snow 35', 'Snow 36', 'Snow 37', 'Snow 38', 'Snow 39', 'Snow 40', 'Snow 41', 'Snow 42', 'Snow 43', 'Snow 44', 'Snow 45', 'Snow 46', 'Snow 47', 'Snow 48', 'Snow 49', 'Snow 50');\n\n $this->_1908_P_Proof = array('PR 1', 'PR 2');\n $this->_1908_P = array('Snow 1', 'Snow 2', 'Snow 3', 'Snow 4', 'Snow 5', 'Snow 6', 'Snow 7', 'Snow 8', 'Snow 9', 'Snow 10', 'Snow 11', 'Snow 12', 'Snow 13', 'Snow 14', 'Snow 15', 'Snow 16', 'Snow 17', 'Snow 18', 'Snow 19', 'Snow 20', 'Snow 21', 'Snow 22', 'Snow 23');\n $this->_1908_S = array('Snow 1', 'Snow 2');\n\n $this->_1909_P_Proof = array('PR 1');\n $this->_1909_P = array('Snow 1', 'Snow 2');\n $this->_1909_S = array('Snow 1', 'Snow 2');\n }", "public function get_geogebra_question_data_point() {\n $q = new stdClass();\n $q->name = 'Finding a point in the plane';\n $q->questiontext = \"Drag the point to ({a}/{b})\";\n $q->questiontextformat = FORMAT_HTML;\n $q->generalfeedback = \"Generalfeedback: Dragging a point isn't to hard\";\n $q->generalfeedbackformat = FORMAT_HTML;\n $q->defaultmark = 1;\n $q->penalty = 0.3333333;\n $q->qtype = 'geogebra';\n $q->length = '1';\n $q->hidden = '0';\n $q->createdby = '2';\n $q->modifiedby = '2';\n $q->options = new stdClass();\n $q->options->answers = array();\n $q->options->answers[0] = new stdClass();\n $q->options->answers[0]->answer = 'e';\n $q->options->answers[0]->fraction = '1.0000000';\n $q->options->answers[0]->feedback = 'Very good.';\n $q->options->answers[0]->feedbackformat = FORMAT_HTML;\n\n $q->options->ggbturl = 'https://tube.geogebra.org/student/mI8RJzVzI';\n $q->options->ggbxml = ggbstringsfortesting::$pointxml;\n $q->options->ggbparameters = ggbstringsfortesting::$pointparameters;\n $q->options->ggbviews = ggbstringsfortesting::$views;\n $q->options->ggbcodebaseversion = '5.0';\n $q->options->israndomized = 1;\n $q->options->randomizedvar = 'a,b,';\n\n return $q;\n }", "public function setAsPoints($points) {\n\t\t$wkt = '';\n\t\t$pointsWKT = array();\n\t\tforeach($points as $point) {\n\t\t\t$pointsWKT[] = implode(' ', $point);\n\t\t}\n\t\t$wkt = implode(',',$pointsWKT);\n\t\t$this->setAsWKT($this->stat('wkt_name') . \"({$wkt})\");\n\t}", "public function get_geogebra_question_form_data_point() {\n $form = new stdClass();\n $form->name = \"Finding a point in the plane\";\n $form->questiontext = array();\n $form->questiontext['format'] = \"1\";\n $form->questiontext['text'] = \"Drag the point to ({a}/{b})\";\n\n $form->defaultmark = 1;\n $form->generalfeedback = array();\n $form->generalfeedback['format'] = '1';\n $form->generalfeedback['text'] = \"Generalfeedback: Dragging a point isn't to hard\";\n\n $form->ggbturl = 'https://tube.geogebra.org/student/mI8RJzVzI';\n $form->ggbxml = ggbstringsfortesting::$pointxml;\n $form->ggbparameters = ggbstringsfortesting::$pointparameters;\n $form->ggbviews = ggbstringsfortesting::$views;\n $form->ggbcodebaseversion = '5.0';\n $form->israndomized = 1;\n $form->randomizedvar = 'a,b,';\n\n $form->noanswers = 1;\n $form->answer = array();\n $form->answer[0] = 'e';\n\n $form->fraction = array();\n $form->fraction[0] = '1.0';\n\n $form->feedback = array();\n $form->feedback[0] = array();\n $form->feedback[0]['format'] = '1';\n $form->feedback[0]['text'] = 'Very good.';\n\n $form->penalty = '0.3333333';\n $form->numhints = 2;\n $form->hint = array();\n $form->hint[0] = array();\n $form->hint[0]['format'] = '1';\n $form->hint[0]['text'] = '';\n\n $form->hint[1] = array();\n $form->hint[1]['format'] = '1';\n $form->hint[1]['text'] = '';\n\n $form->qtype = 'geogebra';\n return $form;\n }", "function generate_map_pins($query,$userconnection,$userlocation,$tool=\"ndt\",$bottomleft_coor=null,$topright_coor=null)\r\n{\r\n\tglobal $lang_statistics_from,$lang_measurements_count, $lang_measurements,$lang_measurement_count,$lang_not_enough_measurements_for_this_time_period,$lang_undefined,$lang_undefined_f,$max_distance_from_exchange_meters, $max_vdsl_distance_from_exchange_meters, $lang_outof;\r\n\tglobal $lang_downstream, $lang_upstream, $lang_packet_loss, $lang_rtt, $lang_jitter,$lang_bandwidth_purchased,$lang_distance_to_exchange,$lang_max_bw_ondistance,$glasnost_throttles_accepted_percentage,$lang_throttled_measurements;\r\n\t$phparraytojson = array();\r\n\tif (is_null($query))\r\n\t\treturn array(\"\",\"\",0,0,0,0);\r\n\t\r\n\t//If viewport boundaries not given, build an area around user location\r\n\tif (!is_array($bottomleft_coor) && !is_array($topright_coor))\r\n\t{\r\n\t\t$lat_diff = 0.0065798;\r\n\t\t$lng_diff = 0.0119737;\r\n\t\t$min_lat = $userlocation['latitude'] - $lat_diff;\r\n\t\t$min_lng = $userlocation['longitude'] - $lng_diff;\r\n\t\t$max_lat = $userlocation['latitude'] + $lat_diff;\r\n\t\t$max_lng = $userlocation['longitude'] + $lng_diff;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$min_lat = $bottomleft_coor['lat'];\r\n\t\t$min_lng = $bottomleft_coor['lng'];\r\n\t\t$max_lat = $topright_coor['lat'];\r\n\t\t$max_lng = $topright_coor['lng'];\r\n\t}\r\n\t\r\n\t\r\n\t//Simple execution without prepared statement, since parameters are properly sanitized in mappoints.php\r\n\t$res = execute_query($query);\r\n\t$jscode = \"\";\r\n\t$i=0;\r\n\t$current_exchange = array('lat'=>\"\",'lng'=>\"\");\r\n\t$exchid = 0;\r\n\t$mypointexists = false;\r\n\t$ispid = 0;\r\n\t$protocols = array(\"flash\",\"bittorent\",\"emule\",\"gnutella\",\"pop\",\"imap\",\"http\",\"ssh\");\r\n\tif(isset($_SESSION['user_id']))\n\t{\t\n\t\t$userconnections = array();\n\t\t$userconns = get_alluser_connections($_SESSION['user_id']);\n\t\tforeach($userconns as $uc)\t\n\t\t\t$userconnections[] = $uc['connection_id'];\n\t}\n\t$phparraytojson[\"mypointid\"] = array();\n\t\n\twhile ($row = $res -> fetch_assoc())\r\n\t{\r\n\t\tif ($_SESSION['profile'] > 1)\r\n\t\t\t$ispid = $row['isp_id'];\r\n\r\n\t\t\r\n\t\tif (in_array($row['cid'], $userconnections))\r\n\t\t{\r\n\t\t\t//specify user's big balloon\r\n\t\t\t$phparraytojson[\"mypointid\"][] = $i;\r\n\t\t\t$mypointexists = true;\r\n\t\t}\r\n\t\t$lang_mcount = ($row['mcount'] == 1)? $lang_measurement_count:$lang_measurements_count;\r\n\t\t$mcount = ($row['mcount'] == NULL)? 0:$row['mcount'];\r\n\t\t$phparraytojson[\"points\"][] = array(\"new google.maps.LatLng({$row['latitude']},{$row['longitude']})\",$ispid);\r\n\t\t//****************************** NDT ***********************************\r\n\t\tif($tool == \"ndt\")\r\n\t\t{\r\n\t\t\t$phparraytojson[\"values\"][0][$i] = ($row['downstream_bw'] == NULL)? -1:$row['downstream_bw'];\r\n\t\t\t$phparraytojson[\"values\"][1][$i] = ($row['upstream_bw'] == NULL)? -1:$row['upstream_bw'];\r\n\t\t\t$phparraytojson[\"values\"][2][$i] = ($row['loss'] == NULL)? -1:$row['loss'];\r\n\t\t\t$phparraytojson[\"values\"][3][$i] = ($row['rtt'] == NULL)? -1:$row['rtt'];\r\n\t\t\t$phparraytojson[\"values\"][4][$i] = ($row['jitter'] == NULL)? -1:$row['jitter'];\r\n\t\t\t\r\n\t\t\t$balloon_content = '<div class=\"balloonmetric balloonline\">'.$lang_downstream.'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvalue balloonline\">'.round($row['downstream_bw'],1).' Mbps</div>'\r\n\t\t\t.'<div class=\"balloonmetric\">'.$lang_upstream.'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvalue\">'.round($row['upstream_bw'],1).' Mbps</div>'\r\n\t\t\t.'<div class=\"balloonmetric\">'.$lang_packet_loss.'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvalue\">'.round($row['loss'],1).' %</div>'\r\n\t\t\t.'<div class=\"balloonmetric\">'.$lang_rtt.'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvalue\">'.round($row['rtt'],0).' msec</div>'\r\n\t\t\t.'<div class=\"balloonmetric\">'.$lang_jitter.'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvalue\">'.round($row['jitter'],1).' msec</div>';\r\n\t\t}\r\n\t\t//****************************** Glasnost ***********************************\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach($protocols as $k => $protocol)\r\n\t\t\t{\r\n\t\t\t\tif ($row[$protocol.'_measurements'] == 0)\r\n\t\t\t\t\t$phparraytojson[\"values\"][$k][$i] = -1;\r\n\t\t\t\telse if($row[$protocol.'_throttled_measurements'] > $glasnost_throttles_accepted_percentage * $row[$protocol.'_measurements']) \r\n\t\t\t\t\t$phparraytojson[\"values\"][$k][$i] = 1;\r\n\t\t\t\telse\r\n\t\t\t\t\t$phparraytojson[\"values\"][$k][$i] = 0;\r\n\t\t\t\t\t\r\n\t\t\t\t$lang_m = ($row[$protocol.'_measurements'] == 1)? $lang_measurement_count:$lang_measurements_count;\r\n\t\t\t\t$protocolval[$protocol] = ($row[$protocol.'_measurements'] > 0)? \"{$row[$protocol.'_throttled_measurements']} $lang_outof {$row[$protocol.'_measurements']} (\". round($row[$protocol.'_throttled_measurements']*100.0/$row[$protocol.'_measurements']).\"%)\":\" - \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$balloon_content = '<div class=\"balloonmetric balloonline\" style=\"width:100%;text-align:center\">'.$lang_throttled_measurements.\"</div>\"\r\n\t\t\t.'<div class=\"balloonmetricsmall\">'.\"Flash Video\".':&nbsp;&nbsp;</div><div class=\"balloonmetricvaluelarge\">'.$protocolval['flash'].\"</div>\"\r\n\t\t\t.'<div class=\"balloonmetricsmall\">'.\"BitTorrent\".'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvaluelarge\">'.$protocolval['bittorent'].\"</div>\"\r\n\t\t\t.'<div class=\"balloonmetricsmall\">'.\"eMule\".'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvaluelarge\">'.$protocolval['emule'].\"</div>\"\r\n\t\t\t.'<div class=\"balloonmetricsmall\">'.\"Gnutella\".'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvaluelarge\">'.$protocolval['gnutella'].\"</div>\"\r\n\t\t\t.'<div class=\"balloonmetricsmall\">'.\"POP\".'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvaluelarge\">'.$protocolval['pop'].\"</div>\"\r\n\t\t\t.'<div class=\"balloonmetricsmall\">'.\"IMAP\".'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvaluelarge\">'.$protocolval['imap'].\"</div>\"\r\n\t\t\t.'<div class=\"balloonmetricsmall\">'.\"HTTP\".'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvaluelarge\">'.$protocolval['http'].\"</div>\"\r\n\t\t\t.'<div class=\"balloonmetricsmall\">'.\"SSH\".'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvaluelarge\">'.$protocolval['ssh'].\"</div>\";\r\n\t\t\t\r\n\t\t}\r\n\t\t$addr = (is_null($row['address']))? $row['address2']:$row['address'];\r\n\t\t$addr = address_format($addr);\r\n\t\t$kbps = $row['contract_ul'] % 1000;\r\n\t\t$mbps = round($row['contract_ul']/1000,0);\r\n\t\t$contractupstream = ($kbps > 0)? \"$kbps kbps\":\"$mbps Mbps\";\r\n\t\t$dist = \"\";\r\n\t\t$vdist = \"\";\r\n\t\tif ($row['distance_to_exchange'] > $max_distance_from_exchange_meters )\r\n\t\t\t$dist = \"&gt; \".meters2Km($max_distance_from_exchange_meters);\r\n\t\t\r\n\t\tif($row['distance_to_exchange'] > $max_vdsl_distance_from_exchange_meters)\r\n\t\t\t$vdist = \"&gt; \".meters2Km($max_vdsl_distance_from_exchange_meters);\r\n\t\t\r\n\t\t$dist = (empty($dist) && $row['exchange_id']>0)? \"~&nbsp;\".meters2Km($row['distance_to_exchange']):$lang_undefined;\r\n\t\t$maxbwdist = (($row['distance_to_exchange'] <= $max_distance_from_exchange_meters) && $row['exchange_id']>0)? \"~&nbsp;\".kbps2Mbps($row['max_bw_ondistance']).\" ADSL\":$lang_undefined_f.\" ADSL\";\r\n\t\t$maxvdslbwdist = (empty($vdist) && $row['exchange_id']>0)? \"~&nbsp;\".kbps2Mbps($row['max_vdslbw_ondistance']).\" VDSL\":$lang_undefined_f.\" VDSL\";\r\n\t\t\r\n\t\t$phparraytojson[\"infos\"][$i] = '<div class=\"balloon\">'\r\n\t\t\t.'<div class=\"balloonaddrrow\"><img class=\"balloonisplogo\" align=\"right\" src=\"images/isp'.$ispid.'logo.png\">'\r\n\t\t\t.''.$addr.'</div>'\r\n\t\t\t.'<div class=\"balloonmetric balloonline\">'.$lang_bandwidth_purchased.'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvalue balloonline\">&darr;'.$row['contract_dl'].'Mbps&nbsp;&nbsp;&uarr;'.$contractupstream.'</div>'\r\n\t\t\t.'<div class=\"balloonmetric balloonline\">'.$lang_distance_to_exchange.'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvalue balloonline\">'.$dist.'</div>'\r\n\t\t\t.'<div class=\"balloonmetric\">'.$lang_max_bw_ondistance.'&nbsp;&nbsp;&nbsp;</div><div class=\"balloonmetricvalue\">'.$maxbwdist.'</div>'\r\n\t\t\t.'<div class=\"balloonmetric\">'.'&nbsp;'.'&nbsp;&nbsp;&nbsp;</div><div style=\"color:#555555;\" class=\"balloonmetricvalue\">'.$maxvdslbwdist.'</div>'\r\n\t\t\t.$balloon_content\r\n\t\t\t.'<div class=\"balloonfooter\">'.$lang_statistics_from.' '.$mcount.' '.$lang_mcount.'</div>'\r\n\t\t\t.'<div style=\"clear: both\"></div>'\r\n\t\t\t.'</div>';\r\n\t\t$min_lat = min($min_lat,$row['latitude']);\r\n\t\t$min_lng = min($min_lng,$row['longitude']);\r\n\t\t$max_lat = max($max_lat,$row['latitude']);\r\n\t\t$max_lng = max($max_lng,$row['longitude']);\r\n\t\t$i++;\r\n\t}\r\n\t\r\n\t$json = json_encode($phparraytojson);\r\n\treturn $json;\r\n}", "abstract function build();", "public function __construct ( $lowerlimit = 0.0, $upperlimit = 0.0, $points = 0.0, $order = 0 )\n\t{\n\t\t$this->lowerlimit = $lowerlimit;\n\t\t$this->upperlimit = $upperlimit;\n\t\t$this->points = $points;\n\t\t$this->order = $order;\n\t}", "public function __construct( $limit, $name = '' )\n { \n //Generate some points; -it isn't a polygonal chain without them! \n $points = $this->populate( ( int ) $limit ); \n\n //Invoke parent's constructor with points and assign the name\n parent::__construct( $points, $name );\n }", "function proj2D(): Point { return new Point([$this->geom[0], $this->geom[1]]); }", "function gen_37( )\r\n{\r\n $x_pow = 0;\r\n $y_pow = 0;\r\n $q_num = \"\";\r\n $q_denom = \"\";\r\n $question = \"\";\r\n $numerator = \"\";\r\n $denominator = \"\";\r\n $a = rand(2,6);\r\n $b = rand(2,7);\r\n $c = rand(3,6);\r\n $d = rand(2,6);\r\n $qn_coeff = pow($a,2);\r\n $qn_x_pow = 2 * $b;\r\n $qn_y_pow = 2 * $c + 1;\r\n $qd_x_pow = (-1) * $d;\r\n $qd_y_pow = \"(3/2)\";\r\n $a_coeff = $a;\r\n $a_x_pow = $b + $d;\r\n $a_y_pow = $c - 1;\r\n $q_num = \"(\".$qn_coeff.\"x^(\".$qn_x_pow.\")*y^(\".$qn_y_pow.\"))^(1/2)\";\r\n $q_denom = \"(x^(\".$qd_x_pow.\")*y^\".$qd_y_pow.\")\";\r\n $numerator = $a_coeff.\"x^\".$a_x_pow.\"y^\".$a_y_pow;\r\n $denominator = \"1\";\r\n $question = $q_num.\"/\".$q_denom;\r\n $answer = array($question,$numerator,$denominator,0,0,0);\r\n return $answer;\r\n}", "function __construct($p1,$p2)\n\t{\n\t\t$this->point1 = $p1;\n\t\t$this->point2 = $p2;\n\t\t$this->recalc();\n\t}", "abstract public function build();", "abstract public function build();", "protected function _create()\n\t{\n\t\t/* range */\n\n\t\t$min = $this->_range['min'];\n\t\t$max = $this->_range['max'];\n\n\t\t/* random numbers */\n\n\t\t$a = mt_rand($min + 1, $max);\n\t\t$b = mt_rand($min, $a - 1);\n\n\t\t/* operator */\n\n\t\t$c = $this->_getOperator();\n\t\t$operator = $this->_operators[$c];\n\n\t\t/* solution and task */\n\n\t\t$this->_solution = $a + $b * $c;\n\t\t$this->_task = l($a) . ' ' . l($operator) . ' ' . l($b);\n\t}", "public function __construct( $points = array( ), $name = '' )\n {\n parent::__construct( $points, $name );\n }" ]
[ "0.5562599", "0.54944247", "0.54712975", "0.5327773", "0.5291986", "0.51240677", "0.51089764", "0.5001888", "0.49636987", "0.49515948", "0.49477878", "0.4913091", "0.4809351", "0.47254747", "0.4671846", "0.46624118", "0.4651773", "0.4651565", "0.46458346", "0.45632562", "0.45479584", "0.45288724", "0.4516733", "0.45122603", "0.4505762", "0.45054492", "0.44889733", "0.44889733", "0.4482732", "0.44784546" ]
0.6203647
0
/ Create a function that will create a deck of cards, randomize it, and then return the deck.
function createDeck(){ $deck = array(); $suits = array ( "clubs", "diamonds", "hearts", "spades" ); $faces = array ( "Ace" => 1, "2" => 2, "3" => 3, "4" => 4, "5" => 5, "6" => 6, "7" => 7, "8" => 8, "9" => 9, "10" => 10, "Jack" => 11, "Queen" => 12, "King" => 13 ); // assigns the suits array to each face in faces array foreach($suits as $suit){ // assign each face a value foreach($faces as $face => $value){ $deck["$face of $suit"] = $value; } } return $deck; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDeck($deck) {\n shuffle($deck);\n return $deck;\n}", "function draw_card1($deck) {\n $random_suit = array_rand($deck);\n $random_card = array_rand($deck[$random_suit]);\n $selected_card1 = [\n 'name' => $random_card . ' of ' . $random_suit,\n 'score' => $deck[$random_suit][$random_card],\n ];\n unset($deck[$random_suit][$random_card]);\n return $selected_card1;\n}", "public function generate_game_deck(){\n\n foreach( $this->DECK_LIST as $card_num){\n $card = new Card($card_num);\n $this->addCard($card);\n }\n $this->shuffleDeck();\n\n }", "function buildDeck($suits, $cards) \n{\n foreach ($cards as $value) \n {\n foreach ($suits as $suit) \n {\n $deckOfCards[] = $value . ' ' . $suit;\n }\n }\n shuffle($deckOfCards);\n $deck = $deckOfCards;\n return $deck;\n}", "function draw_card3($deck) {\n $random_suit = array_rand($deck);\n $random_card = array_rand($deck[$random_suit]);\n $selected_card3 = [\n 'name' => $random_card . ' of ' . $random_suit,\n 'score' => $deck[$random_suit][$random_card],\n ];\n unset($deck[$random_suit][$random_card]);\n return $selected_card3;\n}", "public function make(): Deck\n {\n\n // Add all unique cards for a full deck\n $cards = [];\n foreach (CardType::values() as $type) {\n foreach (CardValue::values() as $value) {\n array_push($cards, new Card($type, $value));\n }\n }\n\n $deck = new Deck($cards);\n if ($this->shuffle) {\n $deck->shuffle();\n }\n\n return $deck;\n }", "function shuffleDeck($deck) { \n \t$randomDeck = array(); \n\t $keys = array_keys($deck); \n\t shuffle($keys); \n\t foreach($keys as $key) { \n\t $randomDeck[$key] = $deck[$key]; \n\t }\n\t return $randomDeck; \n\t}", "public function shuffleDeck() {\n\t\tif (is_array($this->cards) && count($this->cards) > 0) {\n\t\t\tshuffle($this->cards);\t\t\n\t\t}\n\t}", "function pickCard($deck, &$usedCards) {\n \n $chosenCard = rand(0, 51);\n for ($i = 0; $i < count($usedCards); $i++) {\n \n // If the chosen card was already removed,\n // choose another and loop through again\n if ($chosenCard == $usedCards[$i]) {\n $chosenCard = rand(0, 51);\n $i = 0;\n }\n }\n \n // Return the random card and remove it from the deck\n $usedCards[] = $chosenCard;\n return $deck[$chosenCard];\n }", "function shuffle_deck ($dbh)\n{\n $sth = $dbh->query (\"SELECT face, suit FROM deck ORDER BY RAND()\");\n $sth->setFetchMode (PDO::FETCH_OBJ);\n return ($sth->fetchAll ());\n}", "function shuffle(){\r\n\t\tif(empty($this->deck)) return; // no cards in the deck to shuffle.\r\n\t\t$arrLen = count($this->deck);\r\n\t\tfor($i=0; $i < $arrLen; $i++) {\r\n\t\t\t$newDeck[] = $this->deal_one_card();\r\n\t\t}\r\n\t\t$this->deck = $newDeck;\r\n\t}", "public function cards();", "private function getCard()\n {\n //Mix the decks\n shuffle($this->decks);\n //Get a card\n return $this->decks[0]->getCard();\n }", "function shuffleDeck($deck) {\n $keys= array_keys($deck);\n shuffle($keys);\n return array_merge(array_flip($keys), $deck);\n}", "public function Shuffle() {\r\n\t\tshuffle($this->iCards); \r\n\t}", "public function getDrawDeck();", "function deal_one_card(){\r\n\t\tif(empty($this->deck)) return false; // no cards left\r\n\t\t$arrLen = count($this->deck);\r\n\t\t$key = mt_rand(0,$arrLen-1);\r\n\t\t$card = $this->deck[$key];\r\n\t\tarray_splice($this->deck, $key,1);\r\n\t\treturn $card;\r\n\t}", "public function shuffle()\n {\n // TODO (voir les fonctions sur les tableaux)\n shuffle($this->cards);\n }", "public function __construct() // this will construct a standard deck of 52 playing cards\n {\n $card_value = [\"Ace\", 2,3,4,5,6,7,8,9,10, \"Jack\",\"Queen\",\"King\"];\n $suits = [\"Diamonds\", \"Hearts\", \"Clubs\" ,\"Spades\"];\n //$this->deck = [];\n //echo \"Creating a deck......\" . '<br>';\n\n foreach ($suits as $suit) // will make 4 iterations\n {\n //echo $suit .'<br>';\n foreach ($card_value as $value) //will make 13 iterations through each of the 4 suits\n {\n $this->deck[] = $value . ' of ' . $suit . ', ';\n\n\n }\n }\n return $this;\n }", "function generate_manacurve($deck) {\t\tforeach($deck['cards']['one'] as $card) {\n\t\t\tvar_dump($card);\n\t\t}\n\t\tforeach($deck['cards']['two'] as $card) {\n\t\t\tvar_dump($card);\n\t\t}\n\t\tforeach($deck['cards']['n'] as $card) {\n\t\t\tvar_dump($card);\n\t\t}\n\t}", "public function drawCard(){\n if ($this->deckSize > 0){//\n $this->deckSize -= 1;\n }\n elseif ($this->deckSize == 0){//if deck is empty\n $this->generate_game_deck(); //generate a new deck, deckSize set back at 45\n $this->deckSize -= 1;\n }\n $this->card_pop = end($this->deck);\n return array_pop($this->deck);\n }", "function dealCards($randomDeck, $numOfPlayers){\n \t$players = [];\n\n\t $randomDeckLength = count($randomDeck); // 52 cards\n\n \t/* count num of cards in deck,\n \tthen divide to know how many cards each player should get */\n\t $cardsPerPlayer = $randomDeckLength / $numOfPlayers; // 13 cards\n\n\t\t// use for loop to add dealt cards to players array\n\t\tfor ($i=0; $i < $numOfPlayers; $i++) { \n \t\t// find array length to know what index to remove from\n\t \t$randomDeckLengthCurrent = count($randomDeck); // 39 cards\n\t\t\t$findIndex = $randomDeckLengthCurrent - $cardsPerPlayer; \n\t \t$usersHand = array_splice($randomDeck, $findIndex);\n\t\t\t$players[$i] = $usersHand;\n\t\t}\n\t\treturn $players;\n }", "function buildDeck($suits, $cards) \n{\n // todo\n\t$deck = [];\n\tforeach($cards as $card)\n\t{\n\t\tforeach($suits as $suit)\n\t\t{\n\t\t\t$deck[] = $card . ' ' . $suit;\n\t\t}\n\t}\n\treturn $deck;\n}", "function setDeck(){\n global $hearts, $spades, $diamonds, $clubs;\n \n for($i = 1; $i <= 13; $i++) {\n $hearts[] = $i;\n $clubs[] = $i;\n $diamonds[] = $i;\n $spades[] = $i;\n \n }\n }", "protected static function create() {\n $game = new Game();\n $game->players[0]->name = $_SESSION['playerName'];\n\n // shuffle the cards\n $cards = Card::shuffle();\n\n // deal the cards\n for ($i = 0; $i < sizeof($cards); ++$i) {\n $game->players[$i % 2]->giveCard($cards[$i]);\n }\n\n // save the game in the database\n $game->save();\n $gameID = DB::lastID();\n\n // update the session\n $_SESSION['gameID'] = $gameID;\n $_SESSION['playerID'] = 0;\n\n // return the created game\n return self::find($gameID);\n }", "function draw() {\n global $suits, $hearts, $spades, $diamonds, $clubs, $playersArray;\n \n shuffle($hearts);\n shuffle($spades);\n shuffle($diamonds);\n shuffle($clubs);\n shuffle($playersArray);\n \n $total = 0;\n $i = 0;\n \n echo \"<div>\";\n \n while ($total < 42) {\n \n if ((43 - $total) <= 7) { //allows total to go over 42, but not by an absurd amount\n break;\n }\n \n $randomSuit = array_rand($suits);\n switch ($randomSuit) { //used to choose card from correct img folder\n case 0: $suit = \"hearts\";\n break;\n case 1: $suit = \"clubs\";\n break;\n case 2: $suit = \"diamonds\";\n break;\n case 3: $suit = \"spades\";\n break;\n default:\n break;\n }\n \n if ($suit == \"hearts\") {\n $card = $hearts[0];\n array_shift($hearts);\n $total += $card;\n } \n else if ($suit == \"clubs\") {\n $card = $clubs[0];\n array_shift($clubs);\n $total += $card;\n }\n else if ($suit == \"diamonds\") {\n $card = $diamonds[0];\n array_shift($diamonds);\n $total += $card;\n } else {\n $card = $spades[0];\n array_shift($spades);\n $total += $card;\n }\n \n \n echo \"<img src= 'img/cards/$suit/$card.png' alt= '$suit/$card' title= '$suit/$card' width= '60px'/>\";\n //echo \" Total = $total\";\n }\n echo \"</div>\";\n return $total;\n }", "public function shuffle();", "private function initializeDeck() {\n\t\t$deck = array();\n\t\tfor ($i = self::CLUBS; $i <= self::HEARTS; ++$i) {\n\t\t\tfor ($j = 2; $j <= self::ACE; ++$j) {\n\t\t\t\t$deck[] = (string) $i.$j;\n\t\t\t}\n\t\t}\n\t\treturn $deck;\n\t}", "function rand();", "public function shuffle(array &$cards);" ]
[ "0.80995595", "0.7177522", "0.71096504", "0.7097253", "0.6968048", "0.6927636", "0.6521366", "0.6382499", "0.63795537", "0.6363193", "0.62463695", "0.61089396", "0.5971233", "0.59686905", "0.5965259", "0.59623706", "0.5929713", "0.58754563", "0.5859704", "0.5810995", "0.57819265", "0.57818496", "0.575395", "0.5738926", "0.5707579", "0.5705333", "0.56946516", "0.56734896", "0.56554693", "0.56245023" ]
0.7209722
1
Return an array of languagekeys used in the given script
function getScriptKeys($script_file) { $lang_keys = array(); $lang_keys['script_file'] = $script_file; $all_lang_keys['lang_keys'] = array(); // REGEXpression to find language-keys $regx_find_lang_keys = '/(?<= t\(\')(.*?[^\\\\])(?=\')/m'; // Thanks to DrDeath :-D ( https://github.com/DrDeath ) $handle = @fopen($script_file, "r"); if ($handle) { while (($buffer = fgets($handle, 4096)) !== false) { preg_match_all($regx_find_lang_keys, $buffer, $matches, PREG_SET_ORDER, 0); if ( count($matches) ) { //dd($matches[0][0]); $all_lang_keys['lang_keys'][] = $matches[0][0]; } } // IF no matches where found --> convert $all_lang_keys['lang_keys'] from empty array to FALSE $all_lang_keys['lang_keys'] = (! count($all_lang_keys['lang_keys'])) ? FALSE : $all_lang_keys['lang_keys']; // make UNIQUE if (! $all_lang_keys['lang_keys']) { $lang_keys['lang_keys'] = FALSE; // add some more information $lang_keys['num_keys_found'] = FALSE; $lang_keys['num_keys_unique'] = FALSE; } else { $lang_keys['lang_keys'] = array_unique($all_lang_keys['lang_keys']); // add some more information $lang_keys['num_keys_found'] = count($all_lang_keys['lang_keys']); $lang_keys['num_keys_unique'] = count($lang_keys['lang_keys']); } if (!feof($handle)) { mpt_die('Error while reading ' . $script_file); } fclose($handle); } return $lang_keys; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vars_language()\n\t{\n\t\tglobal $board_config, $lang;\n\n\t\t$array = array();\n\t\twhile ( list ( $key, $data ) = @each ( $lang['TPL'] ) )\n\t\t{\n\t\t\t$array['L_' . strtoupper($key)] = $data;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function getLanguages() {\n\t\t$stmt = $this->_pdo->prepare('SELECT * FROM translations LIMIT 1');\n\t\t$stmt->execute();\n\t\t$arr = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\treturn array_keys($arr);\n\t}", "function getLangKeys($lang_file) {\n $lang_keys = array();\n\n $handle = @fopen($lang_file, \"r\");\n if ($handle) {\n while (($buffer = fgets($handle, 4096)) !== false) {\n $extract = explode('=>', $buffer);\n if (substr(trim($extract[0]), 0, 1) === \"'\") {\n // strip off whitespaces\n $lang_key = trim($extract[0]);\n // strip off leading '\n $lang_key = substr($lang_key, 1);\n // strip off trailing '\n $lang_key = substr($lang_key, 0, -1);\n // and add it to the list\n $lang_keys[] = $lang_key;\n }\n }\n if (!feof($handle)) {\n mpt_die('Error while reading ' . $lang_file);\n }\n fclose($handle);\n }\n return $lang_keys;\n}", "public static function avilablableLangs() {\n\t\treturn array_keys(self::$availableLangData);\n\t}", "final public function translationKeys(): array\n {\n helper('filesystem');\n\n $sets = [];\n $dirs = directory_map(getcwd() . '/Language', 1);\n\n foreach ($dirs as $dir) {\n $dir = trim($dir, '\\\\/');\n $sets[$dir] = [$dir];\n }\n\n return $sets;\n }", "public static function getAvailableLanguages()\r\n {\r\n $result = array();\r\n $refClass = new ReflectionClass(__CLASS__);\r\n foreach($refClass->getConstants() as $k => $v)\r\n {\r\n if(substr($k, 0, strlen('LANGUAGE_')) !== 'LANGUAGE_') {\r\n continue;\r\n }\r\n $k = substr($k, strlen('LANGUAGE_'));\r\n $k = ucfirst(strtolower($k));\r\n $ks = explode('_', $k);\r\n \r\n if(count($ks) > 1) {\r\n $k = array_shift($ks) . ' (' . implode(' ', $ks).')';\r\n } \r\n $result[$v] = $k;\r\n }\r\n return $result;\r\n }", "public function get_langs() {\n\t\treturn array_keys( $this->contents );\n\t}", "function get_langindex_keys() {\n $keys = file_get_contents('langindex.json');\n $keys = (array) json_decode($keys);\n\n foreach ($keys as $key => $value) {\n $map = new StdClass();\n if ($value == 'local_moodlemobileapp') {\n $map->file = $value;\n $map->string = $key;\n } else {\n $exp = explode('/', $value, 2);\n $map->file = $exp[0];\n if (count($exp) == 2) {\n $map->string = $exp[1];\n } else {\n $exp = explode('.', $key, 3);\n\n if (count($exp) == 3) {\n $map->string = $exp[2];\n } else {\n $map->string = $exp[1];\n }\n }\n }\n\n $keys[$key] = $map;\n }\n\n $total = count($keys);\n echo \"Total strings to translate $total\\n\";\n\n return $keys;\n}", "public static function getLanguages() {\n\t\t$languages = array();\n\t\tforeach (self::$cache['codes'] as $languageCode => $languageID) {\n\t\t\t$languages[$languageID] = WCF::getLanguage()->getDynamicVariable('wcf.global.language.'.$languageCode);\n\t\t}\n\t\t\n\t\tStringUtil::sort($languages);\n\t\t\n\t\treturn $languages;\n\t}", "public function getScripts()\n\t{\n\t\treturn $this->simplify($this->findInfo('Scripts', 'Languages'));\n\t}", "function getLanguageList()\n{\n\t$files = glob(PATH_LANGUAGES . '*.json');\n\t$tmp = array();\n\tforeach ($files as $file) {\n\t\t$t = new dbJSON($file, false);\n\t\t$native = $t->db['language-data']['native'];\n\t\t$locale = basename($file, '.json');\n\t\t$tmp[$locale] = $native;\n\t}\n\n\treturn $tmp;\n}", "public static function getAvailableLanguages() {\n\t\t//--\n\t\t$all_languages = (array) self::getSafeLanguagesArr();\n\t\t//--\n\t\treturn (array) array_keys((array)$all_languages);\n\t\t//--\n\t}", "public function getAvailableLanguages ();", "function lang_phrases($code='db')\r\n\t{\r\n\t\t$lang = array();\r\n\t\tif($code == 'db')\r\n\t\t{\r\n\t\t\t$phrases = $this->get_phrases();\r\n\t\t\tforeach($phrases as $phrase)\r\n\t\t\t{\r\n\t\t\t\t$lang[$phrase['varname']] = $phrase['text'];\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$lang = $this->getPhrasesFromPack();\r\n\t\t}\r\n\t\treturn $lang;\r\n\t}", "public static function getLanguageCodes() {\n\t\t$languages = array();\n\t\tforeach (self::$cache['codes'] as $languageCode => $languageID) {\n\t\t\t$languages[$languageID] = $languageCode;\n\t\t}\n\t\t\n\t\tStringUtil::sort($languages);\n\t\treturn $languages;\n\t}", "public function getClientSideLangStrings()\n {\n return [];\n }", "public function getNativeLanguages();", "function getLanguageList()\r\n{\r\n\t$languages = array('English'=>'English'); // English is always included by default\r\n\tforeach (getDirFiles(dirname(dirname(dirname(__FILE__))) . DS . 'languages') as $this_language)\r\n\t{\r\n\t\tif (strtolower(substr($this_language, -4)) == '.ini')\r\n\t\t{\r\n\t\t\t$lang_name = substr($this_language, 0, -4);\r\n\t\t\t// Set name as both key and value\r\n\t\t\t$languages[$lang_name] = $lang_name;\r\n\t\t}\r\n\t}\r\n\tksort($languages);\r\n\treturn $languages;\r\n}", "function getLanguages() {\n // Sorted by value\n $languages = array(\n 'id_ID' => 'Bahasa Indonesia',\n 'bs_BA' => 'Bosanski',\n 'ca_ES' => 'Català',\n 'cs_CZ' => 'Čeština',\n 'da_DK' => 'Dansk',\n 'de_DE' => 'Deutsch (Sie)',\n 'de_DE_du' => 'Deutsch (du)',\n 'en_GB' => 'English (GB)',\n 'en_US' => 'English (US)',\n 'es_ES' => 'Español (España)',\n 'es_VE' => 'Español (Venezuela)',\n 'fr_FR' => 'Français',\n 'el_GR' => 'Grec',\n 'hr_HR' => 'Hrvatski',\n 'it_IT' => 'Italiano',\n 'hu_HU' => 'Magyar',\n 'mk_MK' => 'Македонски',\n 'my_MY' => 'Melayu',\n 'nl_NL' => 'Nederlands',\n 'nb_NO' => 'Norsk',\n 'pl_PL' => 'Polski',\n 'pt_PT' => 'Português',\n 'pt_BR' => 'Português (Brasil)',\n 'ro_RO' => 'Română',\n 'ru_RU' => 'Русский',\n 'sr_Latn_RS' => 'Srpski',\n 'fi_FI' => 'Suomi',\n 'sk_SK' => 'Slovenčina',\n 'sv_SE' => 'Svenska',\n 'tr_TR' => 'Türkçe',\n 'uk_UA' => 'Українська',\n 'ko_KR' => '한국어',\n 'zh_CN' => '中文(简体)',\n 'zh_TW' => '中文(繁體)',\n 'ja_JP' => '日本語',\n 'th_TH' => 'ไทย',\n 'vi_VN' => 'Tiếng Việt',\n 'fa_IR' => 'فارسی',\n );\n\n return $languages;\n}", "public function getLangcodes() {\n // Cache the file system based language list calculation because this would\n // be expensive to calculate all the time. The cache is cleared on core\n // upgrades which is the only situation the CKEditor file listing should\n // change.\n $langcode_cache = \\Drupal::cache()->get('ckeditor.langcodes');\n if (!empty($langcode_cache)) {\n $langcodes = $langcode_cache->data;\n }\n if (empty($langcodes)) {\n $langcodes = [];\n // Collect languages included with CKEditor based on file listing.\n $files = scandir('core/assets/vendor/ckeditor/lang');\n foreach ($files as $file) {\n if ($file[0] !== '.' && preg_match('/\\.js$/', $file)) {\n $langcode = basename($file, '.js');\n $langcodes[$langcode] = $langcode;\n }\n }\n \\Drupal::cache()->set('ckeditor.langcodes', $langcodes);\n }\n\n // Get language mapping if available to map to Drupal language codes.\n // This is configurable in the user interface and not expensive to get, so\n // we don't include it in the cached language list.\n $language_mappings = $this->moduleHandler->moduleExists('language') ? language_get_browser_drupal_langcode_mappings() : [];\n foreach ($langcodes as $langcode) {\n // If this language code is available in a Drupal mapping, use that to\n // compute a possibility for matching from the Drupal langcode to the\n // CKEditor langcode.\n // For instance, CKEditor uses the langcode 'no' for Norwegian, Drupal\n // uses 'nb'. This would then remove the 'no' => 'no' mapping and replace\n // it with 'nb' => 'no'. Now Drupal knows which CKEditor translation to\n // load.\n if (isset($language_mappings[$langcode]) && !isset($langcodes[$language_mappings[$langcode]])) {\n $langcodes[$language_mappings[$langcode]] = $langcode;\n unset($langcodes[$langcode]);\n }\n }\n\n return $langcodes;\n }", "function get_languages(){\n\t\treturn array(\n\t\t\t'US' => 'English',\n\t\t\t'FR' => 'French',\n\t\t\t'SA' => 'Arabic',\n\t\t\t'ZA' => 'Afrikanas',\n\t\t);\n\t}", "public function getEnabledLanguages();", "public static function getLanguages()\n {\n return array_keys(self::getDisplayLanguages(self::getDefault()));\n }", "public function getKeyValueAllLanguages($key,$value,$id);", "function get_language_array()\r\n {\r\n $aLanguage = array();\r\n $sLoc = dirname(__FILE__) . '/languages';\r\n if(is_readable($sLoc . '/EN.ini'))\r\n $aLanguage = parse_ini_file($sLoc . '/EN.ini');\r\n if(is_readable($sLoc . '/EN_custom.ini'))\r\n $aLanguage = array_merge($aLanguage, parse_ini_file($sLoc . '/EN_custom.ini'));\r\n if(LANGUAGE != 'EN'){\r\n if(is_readable($sLoc . '/'.LANGUAGE.'.ini'))\r\n $aLanguage = array_merge($aLanguage, parse_ini_file($sLoc . '/'.LANGUAGE.'.ini'));\r\n if(is_readable($sLoc . '/'.LANGUAGE.'_custom.ini'))\r\n $aLanguage = array_merge($aLanguage, parse_ini_file($sLoc . '/'.LANGUAGE.'_custom.ini'));\r\n }\r\n return $aLanguage;\r\n }", "private function getLanguagesInUse()\n {\n // Get all languages in use (see #6013)\n $query = \"\n SELECT language FROM tl_member\n UNION SELECT language FROM tl_user\n UNION SELECT REPLACE(language, '-', '_') FROM tl_page\n WHERE type='root'\n \";\n\n $statement = $this->connection->prepare($query);\n $statement->execute();\n\n $languages = [];\n\n while ($language = $statement->fetch(\\PDO::FETCH_OBJ)) {\n if ('' === $language->language) {\n continue;\n }\n\n $languages[] = $language->language;\n\n // Also cache \"de\" if \"de-CH\" is requested\n if (strlen($language->language) > 2) {\n $languages[] = substr($language->language, 0, 2);\n }\n }\n\n return array_unique($languages);\n }", "public static function getStandardLanguageList();", "public static function getKeys(): array;", "public function term_edit_form_langs () {\n\n\n $langs = array();\n\n $site_lang = get_locale();\n\n $available_lang = get_option ( 'alwpr_langs', array() );\n\n foreach ( $available_lang as $key=>$value ) {\n\n // site base language\n if ( $value['language'] == $site_lang ) {\n \n continue;\n \n }\n\n $langs[$key] = $value['english_name'] . '/' . $value['native_name'];\n }\n\n return $langs;\n\n\n }", "function MBYTE_languageList ($charset = 'utf-8')\n{\n global $_CONF;\n\n if ($charset != 'utf-8') {\n $charset = '';\n }\n\n $language = array ();\n $fd = opendir ($_CONF['path_language']);\n\t\n while (($file = @readdir ($fd)) !== false) {\n if ((substr ($file, 0, 1) != '.') && preg_match ('/\\.php$/i', $file)\n && is_file ($_CONF['path_language'] . $file)\n && ((empty ($charset) && (strstr ($file, '_utf-8') === false))\n || (($charset == 'utf-8') && strstr ($file, '_utf-8')))) {\n clearstatcache ();\n $file = str_replace ('.php', '', $file);\n $langfile = str_replace ('_utf-8', '', $file);\n $uscore = strpos ($langfile, '_');\n if ($uscore === false) {\n $lngname = ucfirst ($langfile);\n } else {\n $lngname = ucfirst (substr ($langfile, 0, $uscore));\n $lngadd = substr ($langfile, $uscore + 1);\n $lngadd = str_replace ('utf-8', '', $lngadd);\n $lngadd = str_replace ('_', ', ', $lngadd);\n $word = explode (' ', $lngadd);\n $lngadd = '';\n foreach ($word as $w) {\n if (preg_match ('/[0-9]+/', $w)) {\n $lngadd .= strtoupper ($w) . ' ';\n } else {\n $lngadd .= ucfirst ($w) . ' ';\n }\n }\n $lngname .= ' (' . trim ($lngadd) . ')';\n }\n $language[$file] = $lngname;\n }\n }\n asort ($language);\n\t\n return $language;\t\n}" ]
[ "0.68764055", "0.684172", "0.68147266", "0.679169", "0.67707413", "0.672279", "0.67199564", "0.6498089", "0.6448131", "0.64309895", "0.64177567", "0.6411593", "0.6375031", "0.6363849", "0.62922287", "0.62862885", "0.62465787", "0.6228295", "0.62155914", "0.6212724", "0.6190909", "0.61855555", "0.6182467", "0.6158204", "0.6112722", "0.61120003", "0.6108444", "0.6095985", "0.6075456", "0.60672325" ]
0.78823245
0
Make (generate or update) a translationfile
function makeTranslation($lang_file, $trans_keys, $translated_keys = array('foo' => 'bar'), $prepare_translation = FALSE) { // try opening file in WRITE-mode if (!$handle = fopen($lang_file, 'w')) { mpt_die('Error while trying to create/update ' . $lang_file); }; // generate PHP opening-tags and required code for the array ... if (!fwrite($handle, getTransHeader())) { mpt_die('Error while trying to write to ' . $lang_file); } // now let's iterate over the keys to get translated and generate the code foreach ($trans_keys as $trans_key) { // Check if current lang_key has already been translated if (array_key_exists($trans_key, $translated_keys)) { $trans_line = " '$trans_key' => '$translated_keys[$trans_key]'," . PHP_EOL; } else { $trans_line = ($prepare_translation) ? " // " : " "; $trans_line .= "'$trans_key' => ''," . PHP_EOL; } if (!fwrite($handle, $trans_line)) { mpt_die('Error while trying to write to ' . $lang_file); } } // generate final code and colse the file-handle if (!fwrite($handle, getTransFooter())) { mpt_die('Error while trying to close ' . $lang_file); } fclose($handle); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCompile(): void {\n Plugin::getInstance()->gettext->compile();\n }", "function __t($key = null, $replace = [], $locale = null)\n{\n $segments = explode('.', $key);\n\n if (is_null($key) || count($segments) != 2) {\n\n return $key;\n }\n\n $group = $segments[0];\n $sourceText = $segments[1];\n\n $trans = __($key, $replace, $locale);\n\n //set the Langs \n\n $sourceLang = 'en'; // auto \n\n $targetLang = $locale ?? app()->getLocale() ?? 'ar';\n $locale = $targetLang;\n\n\n $langPath = app()->langPath();\n $localeFileCheck = $langPath . '/' . $locale . '/' . $group . '.php';\n \n try {\n $transfilecheck = include($localeFileCheck);\n $TransCheckExist = array_key_exists($sourceText, $transfilecheck); \n } catch (\\Throwable $th) {\n $TransCheckExist = false;\n }\n\n\n if ($trans != $key && $TransCheckExist) {\n return $trans;\n }\n \n\n\n try {\n\n //call the google tranlate to get trans word with curl call\n $client = new GuzzleHttp\\Client();\n\n $url = \"https://translate.googleapis.com/translate_a/single?client=gtx&sl=\"\n . $sourceLang . \"&tl=\" . $targetLang . \"&dt=t&q=\" . $sourceText;\n\n\n $res = $client->request('GET', $url);\n $status = $res->getStatusCode();\n // \"200\"\n $header = $res->getHeader('content-type')[0];\n // 'application/json; charset=utf8'\n $body = $res->getBody();\n\n if ($status != 200) {\n throw new Exception(\"Error in google translate api call\");\n }\n\n $body = json_decode($body, true);\n $translatedText = $body[0][0][0];\n\n\n //write result tranlation to the language file in laravel\n $langPath = app()->langPath();\n\n $EnFile['Path'] = $langPath . '/en/' . $group . '.php';\n $localeFile['Path'] = $langPath . '/' . $locale . '/' . $group . '.php';\n $EnFile['Msg'] = \"'\" . $sourceText . \"'\" . \"=>\" . \"'\" . $sourceText . \"'\" . \",\";\n $localeFile['Msg'] = \"'\" . $sourceText . \"'\" . \"=>\" . \"'\" . $translatedText . \"'\" . \",\";\n\n\n\n $transFiles = [$localeFile];\n if ($locale != \"en\") {\n $transFiles[] = $EnFile;\n }\n\n\n foreach ($transFiles as $file) {\n\n $path = $file['Path'];\n $msg = $file['Msg'];\n\n $parts = explode('/', $path);\n $file = array_pop($parts);\n\n $dir = '';\n foreach ($parts as $part) {\n if (!is_dir($dir .= \"/$part\")) mkdir($dir);\n }\n\n $path = \"$dir/$file\";\n if (!file_exists($path)) {\n $dummyContent = \"<?php return [ ];\"; // Some simple example content.\n file_put_contents($path, $dummyContent); // Save our content to the file.\n }\n\n //wite to the en file\n $FileContent = file_get_contents($path);\n\n //find \"];\"\n $startpos = strpos($FileContent, \"[\");\n $endpos = strpos($FileContent, \"];\") ;\n\n \n\n $NewFileContent = \"<?php return [\" . \" \" .PHP_EOL;\n $NewFileContent .= substr($FileContent, $startpos +1 , $endpos - ($startpos + 1));\n $NewFileContent .= PHP_EOL . \" \" . $msg . \" \" . PHP_EOL;\n $NewFileContent .= PHP_EOL . \" \" . \"];\";\n\n\n file_put_contents($path, $NewFileContent);\n\n }\n\n return $translatedText; \n\n } catch (Exception $e) {\n Log::error(\"Error in translate the word : \" . $key . \" \", ['Message' => $e->getMessage()]);\n return $trans;\n }\n}", "function createTranslationFile($dictionary_name) {\n $dictionary_file =Languages::getDictionaryPath($dictionary_name);\n if (!is_file($dictionary_file)) {\n return false;\n } // if\n \n $translation_file = Languages::getTranslationPath($this, $dictionary_name);\n if (!folder_is_writable(dirname($translation_file))) {\n return false;\n } // if\n \n if (is_file($translation_file)) {\n return true;\n } // if\n \n $dictionary = Languages::getDictionary($dictionary_name);\n $translation = array();\n if (is_foreachable($dictionary)) {\n foreach ($dictionary as $dictionary_word) {\n \t$translation[$dictionary_word] = '';\n } // foreach\n } // if\n \n $result = file_put_contents($translation_file, \"<?php return \".var_export($translation, true).\" ?>\");\n if (!$result) {\n return false;\n } // if\n \n return true;\n }", "public function createPOFile($path, $locale, $domain, $write = true)\n {\n\n $project = $this->configuration->getProject();\n $timestamp = date(\"Y-m-d H:iO\");\n $translator = $this->configuration->getTranslator();\n $encoding = $this->configuration->getEncoding();\n $relativePath = $this->getRelativePath($path, $this->basePath);\n\n $template = 'msgid \"\"' . \"\\n\";\n $template .= 'msgstr \"\"' . \"\\n\";\n $template .= '\"Project-Id-Version: ' . $project . '\\n' . \"\\\"\\n\";\n $template .= '\"POT-Creation-Date: ' . $timestamp . '\\n' . \"\\\"\\n\";\n $template .= '\"PO-Revision-Date: ' . $timestamp . '\\n' . \"\\\"\\n\";\n $template .= '\"Last-Translator: ' . $translator . '\\n' . \"\\\"\\n\";\n $template .= '\"Language-Team: ' . $translator . '\\n' . \"\\\"\\n\";\n $template .= '\"Language: ' . $locale . '\\n' . \"\\\"\\n\";\n $template .= '\"MIME-Version: 1.0' . '\\n' . \"\\\"\\n\";\n $template .= '\"Content-Type: text/plain; charset=' . $encoding . '\\n' . \"\\\"\\n\";\n $template .= '\"Content-Transfer-Encoding: 8bit' . '\\n' . \"\\\"\\n\";\n $template .= '\"X-Generator: Poedit 1.5.4' . '\\n' . \"\\\"\\n\";\n $template .= '\"X-Poedit-KeywordsList: _' . '\\n' . \"\\\"\\n\";\n $template .= '\"X-Poedit-Basepath: ' . $relativePath . '\\n' . \"\\\"\\n\";\n $template .= '\"X-Poedit-SourceCharset: ' . $encoding . '\\n' . \"\\\"\\n\";\n\n // Source paths\n $sourcePaths = $this->configuration->getSourcesFromDomain($domain);\n\n // Compiled views on paths\n if (count($sourcePaths)) {\n \n // View compilation\n $this->compileViews($sourcePaths, $domain);\n array_push($sourcePaths, $this->getStorageForDomain($domain)); \n\n $i = 0;\n foreach ($sourcePaths as $sourcePath) {\n $template .= '\"X-Poedit-SearchPath-' . $i . ': ' . $sourcePath . '\\n' . \"\\\"\\n\";\n $i++;\n }\n\n }\n\n if ($write) {\n\n // File creation\n $file = fopen($path, \"w\");\n $result = fwrite($file, $template);\n fclose($file);\n\n return $result;\n\n } else {\n\n // Contents for update\n return $template . \"\\n\";\n }\n\n }", "private function translations()\n {\n if($this->project->langs)\n {\n $this->prepareTranslation();\n $this->default_file = $this->easyLanguage->getDefaultFile();\n }\n\n $this->setLayout('translations');\n }", "private function updateTranslationFiles($namespace, $className, Entries $entries)\n {\n $templateFileName = $this->findPotFile($namespace, $className);\n try {\n $extractor = new PoExtractor();\n $previousEntries = $extractor->extract($templateFileName);\n } catch (\\InvalidArgumentException $e) {\n $previousEntries = $entries;\n $this->filesys->mkdir(dirname($templateFileName));\n self::generator()\n ->generateFile($entries, $this->findPoFile($namespace, $className));\n }\n if ($previousEntries !== $entries) {\n foreach ($entries as $entry) {\n if (!$translation = $previousEntries->find(null, $entry)) {\n $newEntry = $entries->insert(null, $entry->getOriginal());\n $newEntry->setTranslation($entry->getTranslation());\n }\n }\n }\n\n $result = self::generator()\n ->generateFile($entries, $templateFileName);\n if (!$result) {\n throw new \\RuntimeException(\"Failed to generate $templateFileName\");\n }\n }", "public function updateFromCatalog(): void\n {\n $domain = $this->params['domain'];\n\n $localePath = ROOT . '/src/Locale/';\n\n $catalogFile = $localePath . $domain . '.pot';\n if (!file_exists($catalogFile)) {\n $this->abort(sprintf('Catalog File %s not found.', $catalogFile));\n }\n\n $poFiles = [];\n $folder = new Folder($localePath);\n $tree = $folder->tree();\n\n foreach ($tree[1] as $file) {\n $basename = basename($file);\n if ($domain . '.po' === $basename) {\n $poFiles[] = $file;\n }\n }\n if (empty($poFiles)) {\n $this->abort(sprintf('I could not find any matching po files in the given locale path (%s) for the domain (%s)', $localePath, $domain));\n }\n\n if (!$this->params['overwrite']) {\n $this->out('I will update the following .po files and their corresponding .mo file with the keys from catalog: ' . $catalogFile);\n foreach ($poFiles as $poFile) {\n $this->out(' - ' . $poFile);\n }\n $response = $this->in('Would you like to continue?', ['y', 'n'], 'n');\n if ($response !== 'y') {\n $this->abort('Aborted');\n }\n }\n\n foreach ($poFiles as $poFile) {\n $catalogEntries = Translations::fromPoFile($catalogFile);\n $moFile = str_replace('.po', '.mo', $poFile);\n $translationEntries = Translations::fromPoFile($poFile);\n\n $newTranslationEntries = $catalogEntries->mergeWith($translationEntries, Merge::REFERENCES_THEIRS);\n\n $newTranslationEntries->deleteHeaders();\n foreach ($translationEntries->getHeaders() as $key => $value) {\n $newTranslationEntries->setHeader($key, $value);\n }\n\n if ($this->params['strip-references']) {\n foreach ($newTranslationEntries as $translation) {\n $translation->deleteReferences();\n }\n }\n\n $newTranslationEntries->toPoFile($poFile);\n $newTranslationEntries->toMoFile($moFile);\n $this->out('Updated ' . $poFile);\n $this->out('Updated ' . $moFile);\n }\n }", "function old_translateText_1($sourceText, $fromLanguage, $toLanguage) {\n\t\t\n\t\t// saving the content to a temp file\n\t\tif (trim ( ini_get ( 'open_basedir' ) ) != '') {\n\t\t\t\n\t\t\techo '<br>open_basedir exists';\n\t\t\t$upload_dir = wp_upload_dir ();\n\t\t\t$tmpFileUri = $upload_dir ['basedir'] . '/wp_automatic_tmp';\n\t\t\t$tmpHandle = fopen ( $tmpFileUri, \"w+\" );\n\t\t\tfwrite ( $tmpHandle, $sourceText );\n\t\t} else {\n\t\t\t\n\t\t\t$tmpHandle = tmpfile ();\n\t\t\t$metaDatas = stream_get_meta_data ( $tmpHandle );\n\t\t\t$tmpFileUri = $metaDatas ['uri'];\n\t\t\t\n\t\t\tfwrite ( $tmpHandle, $sourceText );\n\t\t}\n\t\t\n\t\t// translate file url\n\t\tcurl_setopt ( $this->ch, CURLOPT_URL, \"https://translate.googleusercontent.com/translate_f\" );\n\t\tcurl_setopt ( $this->ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt ( $this->ch, CURLOPT_POST, true );\n\t\t\n\t\tif (class_exists ( 'CurlFile' )) {\n\t\t\t$curlFile = new \\CurlFile ( $tmpFileUri, 'text/plain', 'test.txt' );\n\t\t} else {\n\t\t\t$curlFile = '@' . $tmpFileUri . ';type=text/plain;filename=test.txt';\n\t\t}\n\t\t\n\t\t$post = [ \n\t\t\t\t'file' => $curlFile,\n\t\t\t\t'sl' => $fromLanguage,\n\t\t\t\t'tl' => $toLanguage,\n\t\t\t\t'js' => 'y',\n\t\t\t\t'prev' => '_t',\n\t\t\t\t'hl' => 'en',\n\t\t\t\t'ie' => 'UTF-8' \n\t\t\n\t\t];\n\t\t\n\t\tcurl_setopt ( $this->ch, CURLOPT_POSTFIELDS, $post );\n\t\t\n\t\t$headers = array ();\n\t\t$headers [] = \"User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0\";\n\t\t$headers [] = \"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.2878.95 Safari/537.36\";\n\t\t\n\t\t$headers [] = \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\";\n\t\t$headers [] = \"Accept-Language: en-US,en;q=0.5\";\n\t\t$headers [] = \"Referer: https://translate.google.com/?tr=f&hl=en\";\n\t\t$headers [] = \"Connection: keep-alive\";\n\t\t$headers [] = \"Upgrade-Insecure-Requests: 1\";\n\t\t\n\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPHEADER, $headers );\n\t\t\n\t\t$exec = curl_exec ( $this->ch );\n\t\t\n\t\t$x = curl_error ( $this->ch );\n\t\t\n\t\t// close and delete temp file\n\t\tfclose ( $tmpHandle );\n\t\t\n\t\t// Empty response check\n\t\tif (trim ( $exec ) == '') {\n\t\t\tthrow new Exception ( 'Empty translator reply with possible curl error ' . $x );\n\t\t}\n\t\t\n\t\t// Validate response result box\n\t\tif (stristr ( $exec, 'Error 403' )) {\n\t\t\techo $exec;\n\t\t\tthrow new Exception ( 'Error 403 from Google' );\n\t\t}\n\t\t\n\t\t// extra <pre removal fix\n\t\t$exec = str_replace ( '<pre>', '', $exec );\n\t\t$exec = str_replace ( '</pre>', '', $exec );\n\t\t\n\t\treturn $exec;\n\t}", "public function editTranslation()\n\t{\n\t\t// Get Hash of the translation\n\t\t$string = $this->get('PARAMS.hash');\n $lang = $this->get('PARAMS.lang');\n\n\t\t// Load it from database\n\t\t$translation = new \\model\\translations;\n\t\t$translation->load( array('string = :string AND language = :lang', \n array(':string' => $string, ':lang' => $lang)));\n\n\t\t// Change the attributes\n $translation->hash = $translation->hash ? $translation->hash : \\controller\\helper::randStr();\n $translation->string = $string;\n\t\t$translation->translation = trim($this->get('POST.translation'));\n\t\t$translation->language = $lang;\n\n\t\t// Save it!\n\t\t$translation->save();\n\t}", "public function gettext()\n {\n $this->taskGettextScanner()\n ->extract('templates/')\n ->extract('assets/js/modules', '/.*\\.js/')\n ->generate('locales/en.po', 'assets/js/locales/en.json')\n ->generate('locales/es.po', 'assets/js/locales/es.json')\n ->generate('locales/gl.po', 'assets/js/locales/gl.json')\n ->run();\n }", "public function load_translation()\n {\n $translator = new \\Gettext\\Translator();\n $i18n_path = realpath(__DIR__ . '/../../i18n/' . Config::$locale . '.po');\n\n if (file_exists($i18n_path)) {\n $translations = \\Gettext\\Translations::fromPoFile($i18n_path);\n $translator->loadTranslations($translations);\n }\n\n Translator::initGettextFunctions($translator);\n }", "public function updateTranslation ($sourceFile = null, $useDefaultTranslation = '') {\n\t\tif ($sourceFile === NULL) {\n\t\t\tif (count($this->args) != 1 || !file_exists($this->args[0])) {\n\t\t\t\t$this->log(\"USAGE: bin/cake localize updateTranslation sourceFile\");\n\t\t\t\texit(1);\n\t\t\t}\n\t\t}\n\n\t\t$sourceFile = array_shift($this->args);\n if($useDefaultTranslation == 'default'){\n I18n::extract_default($sourceFile, $this->_errHandler);\n }\n else {\n I18n::extract($sourceFile, $this->_errHandler);\n }\n\t}", "public function add_translations() {}", "public function new_language_files($po_file, $mo_file, $lang_code, $lang_id)\n {\n $directory = APPLICATION_PATH.'/application/';\n $gettext = new Gettext_lib();\n $lines = $gettext->scan_dir($directory);\n $db_lang_data = array();\n if (!empty($lines)) {\n $directory = APPLICATION_PATH.'/assets/';\n $lines_assets = $gettext->scan_dir($directory);\n $final_lines = array_merge($lines, $lines_assets);\n $final_lines = array_unique($final_lines);\n $response = $this->mdl_settings->insert_language_data($final_lines, $lang_code, $lang_id, false, false);\n if (!$response) {\n return false;\n }\n $file_po = $gettext->create_po($final_lines, $po_file);\n $fp = fopen($mo_file, \"w\");\n fclose($fp);\n exec('msgfmt '.$po_file.' -o '.$mo_file);\n return true;\n }\n return false;\n }", "public function translate()\n\t{\n\t\t$dir \t= Language::where('id', Input::get('languageID'))->first()->short;\n\t\t$words\t= Input::get('words');\n\t\t\n\t\t$contents = \"\n\t\t<?php\n\t\treturn array(\";\n\t\t\n\t\tforeach ($words as $k => $v)\n\t\t{\n\t\t\t$contents .= '\"' . $k . '\" => \"' . $v . '\", ';\n\t\t}\n\t\n\t\t$contents .= \");\";\n\t\t\n\t\tFile::put( app_path() . '/lang/' . $dir . '/invoice.php', $contents);\n\t\t\n\t\treturn Redirect::to('language')->with('message', trans('invoice.data_was_saved'));\n\t}", "function build_project($slug) {\n ob_start();\n require(\"single_project.haml.php\");\n $output = ob_get_clean();\n $new_filename = \"build/content/make/\".$slug;\n file_put_contents($new_filename.\".haml\", $output);\n exec(\"haml $new_filename.haml $new_filename.html\");\n exec(\"rm $new_filename.haml\");\n echo $slug.\".html created\\n\";\n}", "public function create_template() {\n\n $new_file_name = $this->MIGRATE_FILE_PREFIX . date('Ymdhms');\n $template = file_get_contents(Utility::current_dir() . $this->MIGRATIONS_TEMPLATE);\n if(empty($template)) {\n echo \"Template file failed to load!\\n\";\n exit;\n }\n $template = str_replace(\"VERSION\", $new_file_name, $template);\n $path = $this->migration_full_path() . $new_file_name .'.'. $this->FILE_TYPE;\n echo \"Adding a new migration version file ...\\n\";\n\n $f = @fopen($path, 'w');\n if ($f) {\n fputs($f, $template);\n fclose($f);\n echo \"Done.\\nYou can now write php scripts to run the sql alter query(s) in the up() method of $this->MIGRATIONS_DIR\" . $new_file_name .'.'. $this->FILE_TYPE . \". \\n\";\n }\n else {\n echo \"Failed.\\n\";\n }\n }", "function old_translateText_2($sourceText, $fromLanguage, $toLanguage) {\n\t\t$upload_dir = wp_upload_dir ();\n\t\t$tmpFileUri = $upload_dir ['basedir'] . '/wp_automatic_tmp.txt';\n\t\t$tmpHandle = fopen ( $tmpFileUri, \"w+\" );\n\t\tfwrite ( $tmpHandle, $sourceText );\n\t\t\n\t\t$translation_file_url = $upload_dir ['baseurl'] . '/wp_automatic_tmp.txt';\n\t\t\n\t\techo '<br>Translation file URL' . $translation_file_url;\n\t\t\n\t\t// test on localhost\n\t\t// $translation_file_url = 'https://deandev.com/files/wp_automatic_tmp.txt';\n\t\t\n\t\t$url = \"https://translate.google.com/translate?hl=en&ie=UTF8&prev=_t&sl=$fromLanguage&tl=$toLanguage&u=\" . urlencode ( $translation_file_url );\n\t\t\n\t\t// Translate a url\n\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );\n\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( $url ) );\n\t\t\n\t\t$exec = curl_exec ( $this->ch );\n\t\t$x = curl_error ( $this->ch );\n\t\t\n\t\t// Extract iframe url _p\n\t\tpreg_match ( '{(https://translate.googleusercontent.com.*?)\"}', $exec, $translateUrls );\n\t\t$translateUrl = $translateUrls [1];\n\t\t\n\t\t// Validate _p url\n\t\tif (! stristr ( $translateUrl, '_p' )) {\n\t\t\tthrow new Exception ( '_p url can not be extracted' );\n\t\t}\n\t\t\n\t\t// process _p url\n\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );\n\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( $translateUrl ) );\n\t\t\n\t\t$exec = curl_exec ( $this->ch );\n\t\t$x = curl_error ( $this->ch );\n\t\t\n\t\t// Extract _c url\n\t\tpreg_match ( '{URL=(.*?)\"}', $exec, $translateUrls2 );\n\t\t$translateUrl2 = html_entity_decode ( $translateUrls2 [1] );\n\t\t\n\t\t// Validate _c url\n\t\tif (! stristr ( $translateUrl2, '_c' )) {\n\t\t\tthrow new Exception ( '_c url can not be extracted' );\n\t\t}\n\t\t\n\t\t// process _c url\n\t\tcurl_setopt ( $this->ch, CURLOPT_HTTPGET, 1 );\n\t\tcurl_setopt ( $this->ch, CURLOPT_URL, trim ( $translateUrl2 ) );\n\t\t$exec = curl_exec ( $this->ch );\n\t\t\n\t\t// validate final content\n\t\tif (trim ( $exec ) == '') {\n\t\t\tthrow new Exception ( '_c url returned empty response' );\n\t\t}\n\t\t\n\t\t// clean content\n\t\t$exec = preg_replace ( '{<span class=\"google-src-text.*?>.*?</span>}', \"\", $exec );\n\t\t$exec = preg_replace ( '{<span class=\"notranslate.*?>(.*?)</span>}', \"$1\", $exec );\n\t\t$exec = str_replace ( ' style=\";text-align:left;direction:ltr\"', '', $exec );\n\t\t\n\t\t// Return result\n\t\treturn $exec;\n\t}", "public function _createNewTranslations() {\n\t\tif ( empty($_FILES['u' . $_SESSION['secure']]) ) {\n\t\t\tthrow new Exception('No translation file found');\n\t\t}\n\t\t$file = (object) $_FILES['u' . $_SESSION['secure']];\n\t\t\n\t\tif ( !empty($file->error) || ($fp = fopen($file->tmp_name, 'r')) === FALSE ) {\n\t\t\tthrow new Exception('Something went wrong with the upload, please try again');\n\t\t}\n\t\t\n\t\tif ( !empty($_REQUEST['separator']) ) {\n\t\t\t$this->_csvSeparator = $_REQUEST['separator'];\n\t\t}\n\t\t\n\t\t// remove any \"old\" translations\n\t\t$this->removeTranslations();\n\t\ttouch($this->_dbLocation);\n\t\t$this->_getPDO();\n\t\t\n\t\tif ( !($cols = @fgets($fp)) ) {\n\t\t\tthrow new Exception('No valid columns found in file');\n\t\t} else {\n\t\t\t$cols = str_getcsv(trim($cols), $this->_csvSeparator, '\"');\n\t\t}\n\t\t\n\t\t$pre = \"`\";\n\t\t$post = \"` COLLATE NOCASE\";\n\t\t$sql = \"CREATE TABLE translations ({$pre}\" . implode(\"{$post}, {$pre}\", $cols) . \"{$post});\";\n\t\t$this->_pdo->exec($sql);\n\t\t\n\t\t$sql = \"INSERT INTO translations (`\" . implode('`, `', $cols) . \"`) VALUES (:\" . implode(', :', $cols) . \")\";\n\t\t$stmt = $this->_pdo->prepare($sql);\n\n\t\twhile ( ($line = fgets($fp)) !== FALSE ) {\n\t\t\tset_time_limit(1);\n\t\t\t$line = str_getcsv(rtrim($line), $this->_csvSeparator, '\"');\n\t\t\t\n\t\t\t$fields = array();\n\t\t\tforeach ( $line as $id => $val ) {\n\t\t\t\tif ( $id >= count($cols) ) break;\n\t\t\t\t$stmt->bindValue($cols[$id], $val);\n\t\t\t} // foreach\n\t\t\t$stmt->execute();\n\t\t} // while\n\t\t\n\t}", "public function handle()\n {\n $locale = $this->argument('locale');\n\n $path_locale = resource_path('lang/' . $locale);\n\n $output = '';\n\n // load translation arrays from default locale\n $files = File::files(resource_path('lang/' . config('app.locale')));\n foreach($files as $file) {\n if ($file->getExtension() !== 'php') {\n continue;\n }\n // import translation arrays\n $file_path_locale = $path_locale . '/' . $file->getFilename();\n $data_default = Arr::dot(include $file->getPathname());\n $data_export = [];\n if (File::exists($file_path_locale)) {\n $data_export = include $file_path_locale;\n }\n /*\n * po file structure:\n * each translation should have\n * - whitespace\n * - msgctxt: provide context for duplicate msgids (will be array key in\n * dot notation)\n * - msgid: untranslated string\n * - msgtr: translation\n */\n $domain = $file->getBasename();\n foreach($data_default as $key => $value) {\n $domain_key = \"{$domain}:{$key}\";\n $this->info($domain_key);\n $output .= \"msgctxt \\\"{$domain_key}\\\"\\n\";\n\n $output .= 'msgid ';\n $value = str_replace(\"\\\"\",'\\\"', $value);\n $msgid_lines = explode(\"\\n\", $value);\n $msgid_line_count = count($msgid_lines);\n if ($msgid_line_count > 1) {\n $output .= \"\\\"\\\"\\n\";\n for($i = 0; $i < $msgid_line_count; $i++) {\n $msgid_line = $msgid_lines[$i];\n $output .= \"\\\"\" . $msgid_line;\n if ($i !== $msgid_line_count-1) {\n $output .= \"\\\\n\";\n }\n $output .=\"\\\"\\n\";\n }\n } else {\n $output .= \"\\\"{$value }\\\"\\n\";\n }\n\n $output .= 'msgstr ';\n $msgstr = str_replace(\"\\\"\", '\\\"', data_get($data_export, $key));\n $msgstr_lines = explode(\"\\n\", $msgstr);\n $msgstr_line_count = count($msgstr_lines);\n if ($msgstr_line_count > 1) {\n $output .= \"\\\"\\\"\\n\";\n for($i = 0; $i < $msgstr_line_count; $i++) {\n $msgstr_line = $msgstr_lines[$i];\n $output .= \"\\\"\" . $msgstr_line;\n if ($i !== $msgstr_line_count-1) {\n $output .= \"\\\\n\";\n }\n $output .=\"\\\"\\n\";\n }\n } else {\n $output .=\"\\\"{$msgstr}\\\"\\n\";\n }\n\n $output .= \"\\n\";\n }\n }\n\n $output_path = resource_path() . '\\\\po_files';\n File::replace(\"{$output_path}\\\\translations-{$locale}.po\", $output);\n }", "public function run()\n {\n ini_set(\"memory_limit\", \"-1\");\n set_time_limit(0);\n \n $translations_file = Path::getInstance()->getTemporaryPath(__NAMESPACE__) . 'translations.csv';\n Filesystem::create_dir(dirname($translations_file));\n \n $time_start = microtime(true);\n \n $file_handle = fopen($translations_file, 'w');\n \n $base_language = Configuration::getInstance()->get_setting(array(__NAMESPACE__, 'base_language'));\n $source_language = Configuration::getInstance()->get_setting(array(__NAMESPACE__, 'source_language'));\n $target_languages = Configuration::getInstance()->get_setting(array(__NAMESPACE__, 'target_languages'));\n \n $this->write_line(\n $file_handle, \n array('Package', 'Variable', 'Base language', 'Source language', 'Target Languages'));\n \n $language_values = array('', '', $base_language, $source_language);\n $target_languages = explode(',', $target_languages);\n foreach ($target_languages as $target_language)\n {\n $language_values[] = $target_language;\n }\n \n $languages = array_merge($target_languages, array($base_language, $source_language));\n \n $this->write_line($file_handle, $language_values);\n \n $package_list = \\Chamilo\\Configuration\\Package\\PlatformPackageBundles::getInstance()->get_type_packages();\n \n foreach ($package_list as $packages)\n {\n foreach ($packages as $package)\n {\n $translations = array();\n $language_path = Path::getInstance()->namespaceToFullPath($package) . 'resources/i18n/';\n \n foreach (array_unique($languages) as $language)\n {\n $language_file = $language_path . $language . '.i18n';\n $translations[$language] = parse_ini_file($language_file);\n }\n \n $variables = array();\n \n foreach ($translations as $language => $translation_values)\n {\n $variables = array_merge($variables, array_keys($translation_values));\n }\n \n $variables = array_unique($variables);\n \n foreach ($variables as $variable)\n {\n $row = array();\n $row[] = $package;\n $row[] = $variable;\n $row[] = $translations[$base_language][$variable];\n $row[] = $translations[$source_language][$variable];\n \n foreach ($target_languages as $target_language)\n {\n $row[] = $translations[$target_language][$variable];\n }\n \n $this->write_line($file_handle, $row);\n }\n }\n }\n \n $time_end = microtime(true);\n \n Filesystem::file_send_for_download($translations_file, true);\n }", "public function generateLocale($params) {\n if (!isset($params['modules']) && !isset($params['custom_modules'])) {\n throw new Easylife_Translation_Exception(Mage::helper('translation')->__('No modules specified'));\n }\n if (!isset($params['locale'])) {\n throw new Easylife_Translation_Exception(Mage::helper('translation')->__('Locale not set'));\n }\n if ($params['modules'] == 0) {\n if (!isset($params['custom_modules'])) {\n throw new Easylife_Translation_Exception(Mage::helper('translation')->__('No modules specified'));\n }\n $moduleIds = explode('&', $params['custom_modules']);\n }\n else {\n $moduleIds = Mage::getModel('translation/module')->getCollection()->getAllIds();\n }\n $this->setIgnoreHelpers($params['ignore']);\n $themes = isset($params['themes']) ? $params['themes'] : array();\n $fileContents = $this->getModuleTexts($moduleIds, $themes);\n\n $io = $this->getIo();\n $tempFolder = Mage::helper('translation')->getTempDir().md5(microtime()).'/';\n $io->checkAndCreateFolder($tempFolder);\n //read existing modules\n $existingTranslations = $this->getExistingTranslations($params['locale']);\n $byModule = $existingTranslations['by_module'];\n $byText = $existingTranslations['by_text'];\n //$translated = array();\n $io->cd($tempFolder);\n foreach ($fileContents as $moduleName=>$texts) {\n ksort($texts);\n $files[] = $moduleName.'.csv';\n $io->streamOpen($moduleName.'.csv', 'w');\n foreach ($texts as $text) {\n //check if text is translated in module\n $arr = array();\n $arr[] = $text;\n if (isset($byModule[$moduleName][$text])) {\n $arr[] = $byModule[$moduleName][$text];\n $arr[] = 'true';\n }\n elseif ($params['use_any'] && isset($byText[$text])) {\n $values = array_values($byText[$text]);\n $arr[] = $values[0];\n $arr[] = 'true';\n }\n else {\n $arr[] = $text;\n $arr[] = 'false';\n }\n $io->streamWriteCsv($arr);\n }\n $io->streamClose();\n }\n $this->_createArchive($files, $params['locale']);\n $io->cd(Mage::helper('translation')->getTempDir());\n $io->rmdir($tempFolder, true);\n return Mage::helper('translation')->getTempDir().$params['locale'].'.tgz';\n }", "public function translateFile($path)\n {\n $fileContents = file_get_contents($path);\n $namespace = $this->detectSourceNamespace($fileContents);\n $className = String::sliceTo(basename($path), '.php');\n $phpdocExtractor = $this->docExtractor();\n $entriesTranslated = $this->localizeEntries(\n $namespace,\n $className,\n $phpdocExtractor\n ->extract($path)\n );\n\n $replaces = [];\n\n foreach ($phpdocExtractor::getPhpDocs() as $phpDoc) {\n /** @var $translation Translation */\n $translation = $entriesTranslated->find(null, $phpDoc);\n if ($translation) {\n $replaces[$phpDoc] = $translation->getTranslation();\n }\n }\n\n return strtr($fileContents, $replaces);\n }", "public function actionGenerateTranslateAndroid()\n {\n //getting language id\n $languageId = $_GET['id'];\n\n //generating file details\n $filePath = '/uploads/csv/' . 'translation_android_' . $languageId . '.xml';\n $file = dirname(dirname(__FILE__)) . $filePath;\n\n //generating file contents\n $current = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>-n-r-<resources>-n-r-\";\n\n //validate language id\n if (intval($languageId) == 0) {\n $languageId = 1;\n }\n\n //query to fetch required data from database\n $labelData = (new \\yii\\db\\Query())\n ->select('*')\n ->from('system_labels')\n ->leftJoin('translation', '`translation`.`label_id` = `system_labels`.`label_id`')\n ->Where(['not', ['access_key_android' => '']])\n ->andWhere('`translation`.`is_approved` = 1')\n ->andWhere('`translation`.`language_id` = ' . $languageId)\n ->all();\n\n //make preparation to put contents into the file\n foreach ($labelData as $label) {\n $current .= ' <string name=\"' . $label['access_key_android'] . '\">' . $label['translation'] . '</string>-n-r-';\n }\n $current .= '</resources>';\n\n //writing content into file\n file_put_contents($file, $current); //, FILE_APPEND | LOCK_EX\n\n //setup message and redirecting\n \\Yii::$app->getSession()->setFlash('success', 'Translation file for Android is generated successfully.<a href=\"' . str_replace(\"?\", \"/\", $_SERVER['REQUEST_URI']) . \"../../../../..\" . $filePath . '\" target=\"_blank\">Open File </a>');\n return $this->redirect(['language/index']);\n }", "function writeFiles()\n{\n\n // read the storage\n $output = store(0, 0, array(), true);\n\n // iterate through the files and merge the information for the same strings\n foreach ($output as $file => $content) {\n // the original created separate .pot files for each source file\n // that containted over 11 strings, we've dropped this rule\n //if (count($content) <= 11 && $file != 'general') {\n if ($file != 'general') {\n @$output['general'][1] = array_unique(array_merge($output['general'][1], $content[1]));\n if (!isset($output['general'][0])) {\n $output['general'][0] = $content[0];\n }\n unset($content[0]);\n unset($content[1]);\n foreach ($content as $msgid) {\n $output['general'][] = $msgid;\n }\n unset($output[$file]);\n }\n }\n\n // create the POT file\n foreach ($output as $file => $content) {\n\n $tmp = preg_replace('<[/]?([a-z]*/)*>', '', $file);\n $tmp = preg_replace('/^\\.+/', '', $tmp);\n $file = str_replace('.', '-', $tmp) . '.pot';\n $filelist = $content[1];\n unset($content[1]);\n\n // source file and version information (from the Id tags)\n //if (count($filelist) > 1) {\n // $filelist = \"Generated from files:\\n# \" . join(\"\\n# \", $filelist);\n //} elseif (count($filelist) == 1) {\n // $filelist = \"Generated from file: \" . join(\"\", $filelist);\n //} else {\n // $filelist = \"No version information was available in the source files.\";\n //}\n\n // writing the final POT to the proper file(s) / STDOUT\n //$fp = fopen($file, 'w');\n fwrite(STDOUT, str_replace(\"--VERSIONS--\", $filelist, join(\"\", $content)));\n //fclose($fp);\n\n }\n\n}", "public function importTranslations() {\n\t\tif($this->_withVersionUpdate) {\n\t\t\t$lastImportTime = $this->importIntoDatabase();\n\t\t} else {\n\t\t\t// Set paths and file search\n\t\t\t$localImportPath = BASE_PATH . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'translationUpdater' . DIRECTORY_SEPARATOR . 'import' . DIRECTORY_SEPARATOR;\n\t\t\t$ftpPathToConnect = $this->_ftpBasePathToConnect;\n\n\t\t\t$currentEnvironment = $this->_currentEnvironment;\n\n\t\t\tif($currentEnvironment != 'production') {\n\t\t\t\t$ftpPathToConnect .= 'export' . DIRECTORY_SEPARATOR;\n\n\t\t\t\t$fileGlobString = $localImportPath . 'liveExport_*.xml';\n\t\t\t} else {\n\t\t\t\t$ftpPathToConnect .= 'import' . DIRECTORY_SEPARATOR;\n\n\t\t\t\t$fileGlobString = $localImportPath . 'translatorExport_*.xml';\n\t\t\t}\n\n\t\t\t$oldFiles = glob($fileGlobString);\n\t\t\tforeach($oldFiles as $file) {\n\t\t\t\tunlink($file);\n\t\t\t}\n\n\t\t\t// Download available files from FTP\n\t\t\t$this->_ftpServerConnection->downloadDirectoryFromFtp($ftpPathToConnect, $localImportPath);\n\t\t\t$filesToImport = glob($fileGlobString);\n\n\t\t\tif(count($filesToImport)) {\n\t\t\t\t$fileToImport = $filesToImport[0];\n\t\t\t\t$importFileName = str_replace('.xml', '', basename($fileToImport));\n\t\t\t\t$importFileNameExplosion = explode('_', $importFileName);\n\t\t\t\t$timestamp = $importFileNameExplosion[count($importFileNameExplosion) - 1];\n\n\t\t\t\t$translationUpdaterInfo = parse_ini_file($this->_localTranslationUpdaterInfoFile, TRUE);\n\t\t\t\t$lastImportTime = $translationUpdaterInfo[$currentEnvironment]['import'];\n\n\t\t\t\tif($lastImportTime < $timestamp) {\n\t\t\t\t\t$lastImportTime = $this->importIntoDatabase();\n\n\t\t\t\t\t// Update local info.ini\n\t\t\t\t\tif($currentEnvironment == 'production') {\n\t\t\t\t\t\t$iniUpdate = \"[production]\\n\\nimport = \" . $lastImportTime . \"\\nexport = \" . $this->_lastProductionExport . \"\\n\\n[translator]\\n\\nimport = \" . $this->_lastTranslatorImport . \"\\nexport = \" . $this->_lastProductionExport;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$iniUpdate = \"[production]\\n\\nimport = \" . $this->_lastProductionImport . \"\\nexport = \" . $this->_lastProductionExport . \"\\n\\n[translator]\\n\\nimport = \" . $lastImportTime . \"\\nexport = \" . $this->_lastTranslatorExport;\n\t\t\t\t\t}\n\n\t\t\t\t\t$fp = fopen($this->_localTranslationUpdaterInfoFile, 'w');\n\t\t\t\t\tfwrite($fp, $iniUpdate);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($filesToImport as $file) {\n\t\t\t\tunlink($file);\n\t\t\t}\n\n\t\t\t// Upload local info.ini to FTP\n\t\t\t$this->_ftpServerConnection->reconnectToFtp();\n\t\t\t$this->_ftpServerConnection->uploadFileToFtp($this->_localTranslationUpdaterInfoFile, $this->_ftpBasePathToConnect . 'info.ini');\n\t\t\t$this->_ftpServerConnection->closeFtpConnection();\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function generate() {\n $nativeSrcDir = $this->projDir . \"/\" . $this->projectFile->nativeSourceDir;\n foreach (OneFile::listFiles($nativeSrcDir, true) as $fn)\n OneFile::copy($nativeSrcDir . \"/\" . $fn, $this->outDir . \"/\" . $fn);\n \n $generators = array(new JavaGenerator(), new CsharpGenerator(), new PythonGenerator(), new PhpGenerator());\n foreach ($this->projectFile->projectTemplates as $tmplName) {\n $compiler = CompilerHelper::initProject($this->projectFile->name, $this->srcDir, $this->projectFile->sourceLang, null);\n $compiler->processWorkspace();\n \n $projTemplate = new ProjectTemplate($this->baseDir . \"/project-templates/\" . $tmplName);\n $langId = $projTemplate->meta->language;\n $generator = \\OneLang\\Core\\ArrayHelper::find($generators, function ($x) use ($langId) { return strtolower($x->getLangName()) === $langId; });\n $langName = $generator->getLangName();\n $outDir = $this->outDir . \"/\" . $langName;\n \n foreach ($generator->getTransforms() as $trans)\n $trans->visitFiles(array_values($compiler->projectPkg->files));\n \n // copy implementation native sources\n $oneDeps = array();\n $nativeDeps = Array();\n foreach ($this->projectFile->dependencies as $dep) {\n $impl = \\OneLang\\Core\\ArrayHelper::find($compiler->pacMan->implementationPkgs, function ($x) use ($dep) { return $x->content->id->name === $dep->name; });\n $oneDeps[] = $impl;\n $langData = (@$impl->implementationYaml->languages[$langId] ?? null);\n if ($langData === null)\n continue;\n \n foreach ($langData->nativeDependencies ?? array() as $natDep)\n $nativeDeps[$natDep->name] = $natDep->version;\n \n if ($langData->nativeSrcDir !== null) {\n if ($projTemplate->meta->packageDir === null)\n throw new \\OneLang\\Core\\Error(\"Package directory is empty in project template!\");\n $srcDir = $langData->nativeSrcDir . ((substr_compare($langData->nativeSrcDir, \"/\", strlen($langData->nativeSrcDir) - strlen(\"/\"), strlen(\"/\")) === 0) ? \"\" : \"/\");\n $dstDir = $outDir . \"/\" . $projTemplate->meta->packageDir . \"/\" . ($langData->packageDir ?? $impl->content->id->name);\n $depFiles = array_map(function ($x) use ($srcDir) { return substr($x, strlen($srcDir)); }, array_values(array_filter(array_keys($impl->content->files), function ($x) use ($srcDir) { return (substr_compare($x, $srcDir, 0, strlen($srcDir)) === 0); })));\n foreach ($depFiles as $fn)\n OneFile::writeText($dstDir . \"/\" . $fn, (@$impl->content->files[$srcDir . $fn] ?? null));\n }\n \n if ($langData->generatorPlugins !== null)\n foreach ($langData->generatorPlugins as $genPlugFn)\n $generator->addPlugin(new TemplateFileGeneratorPlugin($generator, (@$impl->content->files[$genPlugFn] ?? null)));\n }\n \n // generate cross compiled source code\n \\OneLang\\Core\\console::log(\"Generating \" . $langName . \" code...\");\n $files = $generator->generate($compiler->projectPkg);\n foreach ($files as $file)\n OneFile::writeText($outDir . \"/\" . ($projTemplate->meta->destinationDir ?? \"\") . \"/\" . $file->path, $file->content);\n \n // generate files from project template\n $model = new ObjectValue(Array(\n \"dependencies\" => new ArrayValue(array_map(function ($name) use ($nativeDeps) { return new ObjectValue(Array(\n \"name\" => new StringValue($name),\n \"version\" => new StringValue((@$nativeDeps[$name] ?? null))\n )); }, array_keys($nativeDeps))),\n \"onepackages\" => new ArrayValue(array_map(function ($dep) { return new ObjectValue(Array(\n \"vendor\" => new StringValue($dep->implementationYaml->vendor),\n \"id\" => new StringValue($dep->implementationYaml->name)\n )); }, $oneDeps))\n ));\n $projTemplate->generate($outDir, $model);\n }\n }", "public function testTranslationFiles(): void\n {\n // default library language\n $default_lang = 'en';\n\n // Load translation array for default language and then compare all the\n // other translations with it.\n \\App::setLocale($default_lang);\n // We must NOT call langGet() wrapper as we want whole translation array\n /** @var array $base_translations */\n $base_translations = \\Lang::get('response-builder::builder');\n\n // get list of all other directories in library's lang folder.\n /** @var array $entries */\n $entries = glob(__DIR__ . '/../../../src/lang/*', GLOB_ONLYDIR);\n $supported_languages =\n array_filter(\n array_filter(\n array_map(static function($entry) {\n return basename($entry);\n }, $entries)\n ),\n static function($item) use ($default_lang) {\n return $item !== $default_lang;\n }\n );\n\n $this->assertGreaterThan(0, \\count($supported_languages));\n\n foreach ($supported_languages as $lang) {\n // get the translation array for given language\n \\App::setLocale($lang);\n // We must NOT call langGet() wrapper as we want whole translation array\n /** @var array $translation */\n $translation = \\Lang::get('response-builder::builder');\n\n // ensure it has all the keys base translation do\n foreach ($base_translations as $key => $val) {\n $msg = \"Missing localization entry '{$key}' in '{$lang}' language file.\";\n $this->assertArrayHasKey($key, $translation, $msg);\n unset($translation[ $key ]);\n }\n // ensure we have no dangling translation entries left that\n // are no longer present in base translation.\n $sep = \"\\n \";\n $msg = \"Unwanted entries in '{$lang}' language file:{$sep}\" . implode($sep, array_keys($translation));\n $this->assertEmpty($translation, $msg);\n }\n }", "public function actionGenerateTranslateIos()\n {\n $languageId = intval($_GET['id']);\n\n //generating file details\n $filePath = '/uploads/csv/' . 'translation_ios_' . $languageId . '.txt';\n $file = dirname(dirname(__FILE__)) . $filePath;\n\n\n // Open the file to get existing content\n $current = \"\";\n\n //check and validate language\n //\\Yii::$app->session->get('languageId');\n if (intval($languageId) == 0) {\n $languageId = 1;\n }\n\n //query to fetch required data from database\n $labelData = (new \\yii\\db\\Query())\n ->select('*')\n ->from('system_labels')\n ->leftJoin('translation', '`translation`.`label_id` = `system_labels`.`label_id`')\n ->Where(['not', ['access_key_ios' => '']])\n ->andWhere('`translation`.`is_approved` = 1')\n ->andWhere('`translation`.`language_id` =' . $languageId)\n ->all();\n\n //make preparation to put contents into the file\n foreach ($labelData as $label) {\n $current .= $label['access_key_ios'] . ' = \"' . $label['translation'] . '\";-n-r-';\n }\n\n //writing content into file\n file_put_contents($file, $current); //, FILE_APPEND | LOCK_EX\n\n //setup message and redirecting\n \\Yii::$app->getSession()->setFlash('success', 'Translation file for IOS is generated successfully.<a href=\"' . str_replace(\"?\", \"/\", $_SERVER['REQUEST_URI']) . \"../../../../..\" . $filePath . '\" target=\"_blank\">Open File </a>');\n return $this->redirect(['language/index']);\n }", "function geotagmapper_set_lang_file() {\r\n\t$currentLocale = get_locale();\r\n\tif(!empty($currentLocale)) {\r\n\t\t$moFile = dirname(__FILE__) . \"/lang/\" . $currentLocale . \".mo\";\r\n\t\tif(@file_exists($moFile) && is_readable($moFile)) load_textdomain('geotagmapper', $moFile);\r\n\t}\r\n}" ]
[ "0.5963471", "0.595848", "0.5957854", "0.59559786", "0.5946123", "0.594029", "0.58688045", "0.57350695", "0.5698952", "0.56284183", "0.562413", "0.561894", "0.5614449", "0.55988264", "0.5560645", "0.5556417", "0.55024695", "0.54850334", "0.54365003", "0.54278064", "0.54006743", "0.5379838", "0.53649527", "0.53557986", "0.5354487", "0.53436756", "0.5310365", "0.52801263", "0.5252153", "0.5238153" ]
0.6740408
0
return the HEADER of a tranlationsfile
function getTransHeader(){ $file_header = <<<EOD <?php // Plugin-translation-file generated with **KB_make_plugin_translations.php** // Check it out at https://github.com/manne65-hd/Kanboard_MakePluginTranslationFiles return array( EOD; return $file_header; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHeader();", "public function getHeaderName();", "abstract public function getHeader();", "public function getHeader()\n {\n return <<<EOF\n _______ ___ __ ___ _______ .______ _______ _______ .__ __. \n | ____| / \\ | |/ / | ____|| _ \\ / _____|| ____|| \\ | | \n | |__ / ^ \\ | ' / | |__ | |_) | | | __ | |__ | \\| | \n | __| / /_\\ \\ | < | __| | / | | |_ | | __| | . ` | \n | | / _____ \\ | . \\ | |____ | |\\ \\----. | |__| | | |____ | |\\ | \n |__| /__/ \\__\\ |__|\\__\\ |_______|| _| `._____| \\______| |_______||__| \\__|\n\nEOF;\n\n}", "public function getHeader(){\n $header = $this->_headerScript;\n $header.= $this->_headerStyle;\n $header.= $this->getOnLoad();\n return $header;\n }", "private function getHeader()\r\n {\r\n return $this->header;\r\n }", "public function getHeaderId()\n {\n return self::HEADER_ID;\n }", "public function getHeaderId()\n {\n return self::HEADER_ID;\n }", "public function getHeader()\r\n {\r\n return $this->header;\r\n }", "public function getHeader()\n {\n return $this->_header;\n }", "public function getHeader(){\n\t\treturn $this->attributes['header'];\n\t}", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->header;\n }", "public function getHeader()\n {\n return $this->_header;\n }", "public function getHeader()\n {\n }", "public function getHeader()\n\t{\n\t\treturn $this->header;\n\t}", "public function getHeaderContent();", "public function getHeader() {\n\t\treturn $this->header;\n\t}", "public function GetHeader()\r\n\t{\r\n\t\treturn $this->pObjResponse->GetHeader();\r\n\t}", "function get_header($locale = NULL, $source = NULL, $id = NULL, $charset = 'UTF-8') {\n return <<<EOH\n# $id language/translation.\n#\n# Source: $source\n#\n# Copyright (c) 2013 The Open University.\n# This file is distributed under the same license as the PACKAGE package.\n# IET-OU <EMAIL@ADDRESS>, YEAR.\n#\n#, fuzzy\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: $id\\\\n\"\n\"Report-Msgid-Bugs-To: iet-webmaster+@+open.ac.uk\\\\n\"\n\"POT-Creation-Date: 2013-10-02 14:00+0100\\\\n\"\n\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\\\n\"\n\"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\\\n\"\n\"Language-Team: LANGUAGE <[email protected]>\\\\n\"\n\"Language: $locale\\\\n\"\n\"MIME-Version: 1.0\\\\n\"\n\"Content-Type: text/html; charset=$charset\\\\n\"\n\"Content-Transfer-Encoding: 8bit\\\\n\"\n\"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\\\n\"\n\n\nEOH;\n }", "public function getHeader()\n\t{\n\t\treturn $this->getResponse()->getHeaderContent();\n\t}", "protected function getHeader()\r\n {\r\n $result = parent::getHeader();\r\n return $result;\r\n }", "function bbp_get_email_header()\n{\n}", "public function getHeader(): string\n {\n return $this->debugTool->getRenderHeader();\n }", "protected function readHeader()\n {\n \t// attibution de l'entete dans file_id\n \t$this->data_mesgs['file_id']['type']=\"GPX\";\n \t$this->data_mesgs['file_id']['manufacturer']=(string) $this->file_contents['creator'];\n \t$this->data_mesgs['file_id']['number']=(string) $this->file_contents['version'];\n \t$datebrut=(string)$this->file_contents->metadata->time;\n \t$this->data_mesgs['file_id']['time_created']=strtotime( $datebrut);\n \t\n// \tprint_r($this->file_contents);\n }", "public function getSetupHeader()\r\n {\r\n return $this->_setupHeader;\r\n }", "abstract public function getHeaderInfo();", "public function getHeader() : array;", "public function generateDiffHeader(): string;" ]
[ "0.68519354", "0.66667354", "0.6609438", "0.6567064", "0.6559121", "0.6557531", "0.6549481", "0.6549481", "0.653449", "0.65261865", "0.6521463", "0.6517718", "0.6517718", "0.6517718", "0.64824015", "0.64774156", "0.6459649", "0.64504725", "0.64362276", "0.64303", "0.641507", "0.63788795", "0.63735914", "0.6361035", "0.63424677", "0.6321322", "0.63146746", "0.6309591", "0.6299639", "0.6281336" ]
0.6771713
1
return the FOOTER of a tranlationsfile
function getTransFooter(){ $file_footer = <<<EOD ); EOD; return $file_footer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFooterContent();", "public function getFooter()\n {\n return <<<EOF\n\n<info>\nFinished. \n</info>\n\n\nEOF;\n\n}", "public static function footer(){\n\t\tforeach (self::$footer as $footerLine){\n\t\t\techo $footerLine.PHP_EOL;\n\t\t}\n\t}", "public function footer()\n {\n return $this->footer;\n }", "private function getFooter()\n {\n return sprintf(UUP_MAIL_MESSAGE_FOOTER, $this->data->options->app_name, $this->data->options->app_base);\n }", "public function generateDiffFooter(): string;", "public function GenFooter() {\n\t\t$this->sOutputFooter = $this->oTpl->fetch($this->aTplFile['footer']);\n\n\t\t// Set time used and db query executed time\n\t\tif ($this->bShowDebugInfo)\n\t\t\t$this->sOutputFooter = str_replace('<!-- debug info -->'\n\t\t\t\t, $this->oCtl->GetDebugInfo($this)\n\t\t\t\t. '<!-- debug info -->'\n\t\t\t\t, $this->sOutputFooter);\n\n\t\treturn $this->sOutputFooter;\n\t}", "public function GetFooter()\r\n\t{\r\n\t\treturn $this->pObjResponse->GetFooter();\r\n\t}", "public function getFooter()\n {\n return $this->getValue('nb_catalog_tag_lang_footer');\n }", "public function footer() {\n global $CFG, $USER;\n\n $output = $this->container_end_all(true);\n\n $footer = $this->opencontainers->pop('header/footer');\n\n // Provide some performance info if required\n $performanceinfo = '';\n if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {\n $perf = get_performance_info();\n if (defined('MDL_PERFTOLOG') && !function_exists('register_shutdown_function')) {\n error_log(\"PERF: \" . $perf['txt']);\n }\n if (defined('MDL_PERFTOFOOT') || debugging() || $CFG->perfdebug > 7) {\n $performanceinfo = essential_performance_output($perf, $this->page->theme->settings->perfinfo);\n }\n }\n\n $footer = str_replace($this->unique_performance_info_token, $performanceinfo, $footer);\n\n $footer = str_replace($this->unique_end_html_token, $this->page->requires->get_end_code(), $footer);\n\n $this->page->set_state(moodle_page::STATE_DONE);\n\n if(!empty($this->page->theme->settings->persistentedit) && property_exists($USER, 'editing') && $USER->editing && !$this->really_editing) {\n $USER->editing = false;\n }\n\n return $output . $footer;\n }", "public function getFooter(): string\n {\n return $this->debugTool->getRenderFooter();\n }", "private function getFooter() {\n\t\treturn \n\t\t\"</body>\n\t\t</html>\";\n\t}", "public function getTableFooter(){\n ob_start(); // intended only to capture echoed string\n ?>\n <?php // Start constructing the column header ?>\n <tfoot>\n <?php echo $this->getTableHeadFooter(); ?>\n </tfoot>\n <?php\n\n return ob_get_clean();\n }", "public function getFooter()\n {\n $footer = \"\\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\\n\"\n . \"/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; \\n\"\n . \"/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\\n\"\n . \"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\\n\"\n . \"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\\n\"\n . \"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\\n\"\n . \"/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\\n\"\n . \"\\n-- Dump completed on \" . Mage::getSingleton('core/date')->gmtDate() . \" GMT\";\n\n return $footer;\n }", "public static function footer(){\t?>\r\n\t\t\t<footer>\r\n\t\t\t\t<p>(c)2017 Web programada por: Jose Montes & Juan Javier Ligero Rambla</p>\r\n\t\t\t</footer>\r\n\t\t<?php }", "public function getFooter() {\n $sRet = \"}\\n\";\n $sRet .= \"// End Class \\\"$this->classname\\\"\\n?>\";\n\n return($sRet);\n }", "public function getFooter(){\n\n return \" </body>\n </html>\";\n }", "public function footer() {\n global $CFG, $DB, $USER;\n\n $output = $this->container_end_all(true);\n\n $footer = $this->opencontainers->pop('header/footer');\n\n if (debugging() and $DB and $DB->is_transaction_started()) {\n // TODO: MDL-20625 print warning - transaction will be rolled back\n }\n\n // Provide some performance info if required\n $performanceinfo = '';\n if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {\n $perf = get_performance_info();\n if (defined('MDL_PERFTOLOG') && !function_exists('register_shutdown_function')) {\n error_log(\"PERF: \" . $perf['txt']);\n }\n if (defined('MDL_PERFTOFOOT') || debugging() || $CFG->perfdebug > 7) {\n $performanceinfo = moodlebook_performance_output($perf);\n }\n }\n\n $perftoken = (property_exists($this, \"unique_performance_info_token\"))?$this->unique_performance_info_token:self::PERFORMANCE_INFO_TOKEN;\n $endhtmltoken = (property_exists($this, \"unique_end_html_token\"))?$this->unique_end_html_token:self::END_HTML_TOKEN;\n\n $footer = str_replace($perftoken, $performanceinfo, $footer);\n\n $footer = str_replace($endhtmltoken, $this->page->requires->get_end_code(), $footer);\n\n $this->page->set_state(moodle_page::STATE_DONE);\n\n if(!empty($this->page->theme->settings->persistentedit) && property_exists($USER, 'editing') && $USER->editing && !$this->really_editing) {\n $USER->editing = false;\n }\n\n return $output . $footer;\n }", "function footer()\n\t{\n\t\treturn \"<footer>By Lauren Johnston</footer>\\n</body></html>\";\n\t}", "public function footer()\n\t{\n\t\t$this->save();\n\t\treturn $this->getView()->render();\n\t}", "public function get_template_footer(){\n\t\t\n\t\t$html = '</body></html>';\n\t\t\n\t\treturn $html;\n\t\t\n\t}", "public static function getGeneralFooter() {\n ?>\n <footer class = \"py-5 bg-dark\">\n <div class = \"container\">\n <p class = \"m-0 text-center text-white\" > Copyright &copy Estampaty</p>\n </div>\n <!--/.container -->\n </footer>\n <?php\n }", "function getFooterText()\n{\n // Load project config\n $fileConfigPath = ROOT_DIR . \"/config/project.json\";\n $fileConfig = file_get_contents($fileConfigPath);\n\n // If config file exist\n if ($fileConfig !== false) {\n $configJson = json_decode($fileConfig, true);\n // If configuration file is json\n if ($configJson !== null) {\n $footerTextField = $configJson['blocks']['footer']['content'];\n // If trying to rename the slug\n if ($footerTextField) {\n $data = $footerTextField;\n }\n }\n return $data;\n }\n}", "private function getFooter()\n {\n $template = '</body></html>';\n \n return $template;\n }", "public static function get_footer_content() {\n\t\t\techo Elementor\\Plugin::instance()->frontend->get_builder_content_for_display( self::get_footer_id() );\n\t\t}", "public function getFooter()\n {\n return Debug::getRenderFooter();\n }", "public function getFooter() {\n return $this->footer;\n }", "public function getFooter() {\n return $this->footer;\n }", "public function GetFooter()\r\n {\r\n global $var;\r\n $this->Alerts();\r\n $head[] = $this->GetJavascript(1);\r\n if ($this->GetScript(1)) {\r\n $head[] = $this->GetScript(1);\r\n }\r\n $head[] = '</body>';\r\n $head[] = '</html>';\r\n\r\n echo implode(\"\\n\", $head);\r\n }", "function rain_the_custom_footer(){\n\t\techo rain\\Rain_Customizer::get_instance()->get_footer_markup();\n\t}" ]
[ "0.70775557", "0.6967127", "0.69296414", "0.6916228", "0.68600506", "0.68262285", "0.68043053", "0.67693126", "0.6768947", "0.6764569", "0.6715587", "0.6707791", "0.66762847", "0.6650288", "0.6645135", "0.66157985", "0.6615379", "0.66074145", "0.6601168", "0.6595784", "0.6581183", "0.6571194", "0.6520033", "0.6518138", "0.6510366", "0.6502821", "0.6484944", "0.6484944", "0.6454177", "0.64530194" ]
0.754462
0
Check if all languages given by $my_plugin_langs are valid ... otherwise DIE with an ERRORmessage
function checkLangsValid() { global $mpt_config; $example_plugin_langs = array( 'xy_XY', 'zz_ZZ', ); if (! array_diff($mpt_config['my_plugin_langs'], $example_plugin_langs)) { echoMessage('You must configure the script by setting the array $my_plugin_langs!', 'w'); die; } if(! is_array($mpt_config['my_plugin_langs'])) { mpt_die('$my_plugin_langs MUST be an array!'); } foreach($mpt_config['my_plugin_langs'] as $my_plugin_lang) { if(! array_key_exists($my_plugin_lang, $mpt_config['kb_all_langs'])) { mpt_die($my_plugin_lang . ' is not a valid language-code!'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lingotek_notify_if_no_languages_added() {\n // add a warning message.\n $target_locales = lingotek_get_target_locales();\n if (empty($target_locales)) {\n drupal_set_message(t('No languages are enabled yet for Lingotek Translation. Please add one or more languages (located under \"Your site Languages\" on the Dashboard tab).'), 'warning');\n }\n}", "public function testValidateLanguage()\n {\n $oLang = new oxLang();\n\n $this->assertEquals( 1, $oLang->validateLanguage( 1 ) );\n $this->assertEquals( 0, $oLang->validateLanguage( 3 ) );\n $this->assertEquals( 0, $oLang->validateLanguage( 'xxx' ) );\n }", "protected function validate_lang( $args, $lang = null ) {\n\t\t$errors = new WP_Error();\n\n\t\t// Validate locale with the same pattern as WP 4.3. See #28303\n\t\tif ( ! preg_match( '#^[a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?$#', $args['locale'], $matches ) ) {\n\t\t\t$errors->add( 'pll_invalid_locale', __( 'Enter a valid WordPress locale', 'polylang' ) );\n\t\t}\n\n\t\t// Validate slug characters\n\t\tif ( ! preg_match( '#^[a-z_-]+$#', $args['slug'] ) ) {\n\t\t\t$errors->add( 'pll_invalid_slug', __( 'The language code contains invalid characters', 'polylang' ) );\n\t\t}\n\n\t\t// Validate slug is unique\n\t\tforeach ( $this->get_languages_list() as $language ) {\n\t\t\tif ( $language->slug === $args['slug'] && ( null === $lang || ( isset( $lang ) && $lang->term_id != $language->term_id ) ) ) {\n\t\t\t\t$errors->add( 'pll_non_unique_slug', __( 'The language code must be unique', 'polylang' ) );\n\t\t\t}\n\t\t}\n\n\t\t// Validate name\n\t\t// No need to sanitize it as wp_insert_term will do it for us\n\t\tif ( empty( $args['name'] ) ) {\n\t\t\t$errors->add( 'pll_invalid_name', __( 'The language must have a name', 'polylang' ) );\n\t\t}\n\n\t\t// Validate flag\n\t\tif ( ! empty( $args['flag'] ) && ! file_exists( POLYLANG_DIR . '/flags/' . $args['flag'] . '.png' ) ) {\n\t\t\t$flag = PLL_Language::get_flag_informations( $args['flag'] );\n\n\t\t\tif ( ! empty( $flag['url'] ) ) {\n\t\t\t\t$response = function_exists( 'vip_safe_wp_remote_get' ) ? vip_safe_wp_remote_get( esc_url_raw( $flag['url'] ) ) : wp_remote_get( esc_url_raw( $flag['url'] ) );\n\t\t\t}\n\n\t\t\tif ( empty( $response ) || is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {\n\t\t\t\t$errors->add( 'pll_invalid_flag', __( 'The flag does not exist', 'polylang' ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $errors;\n\t}", "function _langs($excepts=NULL){\n\tglobal $lc_languages;\n\t$langs = array();\n\tif($excepts){\n\t\tforeach($lc_languages as $lcode => $lname){\n\t\t\tif(is_array($excepts) && in_array($lcode, $excepts)) continue;\n\t\t\tif(is_string($excepts) && $lcode == $excepts) continue;\n\t\t\t$langs[$lcode] = $lname;\n\t\t}\n\t}else{\n\t\t$langs = $lc_languages;\n\t}\n\treturn (count($langs)) ? $langs : false;\n}", "public static function validateLang()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(2, 2),\n\t\t);\n\t}", "private function checkLang(string $lang): bool\n {\n $arrlang = array(\n 'ab', 'aa', 'af', 'ak', 'sq', 'am', 'ar', 'an', 'hy', 'as', 'av', 'ae', 'ay', 'az', 'bm', 'ba',\n 'eu', 'be', 'bn', 'bh', 'bi', 'bs', 'br', 'bg', 'my', 'ca', 'ch', 'ce', 'ny', 'zh', 'zh-Hans',\n 'zh-Hant', 'cv', 'kw', 'co', 'cr', 'hr', 'cs', 'da', 'dv', 'nl', 'dz', 'en', 'eo', 'et', 'ee',\n 'fo', 'fj', 'fi', 'fr', 'ff', 'gl', 'gd', 'gv', 'ka', 'de', 'el', 'kl', 'gn', 'gu', 'ht', 'ha',\n 'he', 'hz', 'hi', 'ho', 'hu', 'is', 'io', 'ig', 'id', 'in', 'ia', 'ie', 'iu', 'ik', 'ga', 'it',\n 'ja', 'jv', 'kl', 'kn', 'kr', 'ks', 'kk', 'km', 'ki', 'rw', 'rn', 'ky', 'kv', 'kg', 'ko', 'ku',\n 'kj', 'lo', 'la', 'lv', 'li', 'ln', 'lt', 'lu', 'lg', 'lb', 'gv', 'mk', 'mg', 'ms', 'ml', 'mt',\n 'mi', 'mr', 'mh', 'mo', 'mn', 'na', 'nv', 'ng', 'nd', 'ne', 'no', 'nb', 'nn', 'ii', 'oc', 'oj',\n 'cu', 'or', 'om', 'os', 'pi', 'ps', 'fa', 'pl', 'pt', 'pa', 'qu', 'rm', 'ro', 'ru', 'se', 'sm',\n 'sg', 'sa', 'sr', 'sh', 'st', 'tn', 'sn', 'ii', 'sd', 'si', 'ss', 'sk', 'sl', 'so', 'nr', 'es',\n 'su', 'sw', 'ss', 'sv', 'tl', 'ty', 'tg', 'ta', 'tt', 'te', 'th', 'bo', 'ti', 'to', 'ts', 'tr',\n 'tk', 'tw', 'ug', 'uk', 'ur', 'uz', 've', 'vi', 'vo', 'wa', 'cy', 'wo', 'fy', 'xh', 'yi', 'ji',\n 'yo', 'za', 'zu'\n );\n\n return in_array($lang, $arrlang);\n }", "private function checkSubPageLanguage() {\n\t\tif ( $this->languageCode !== null && !$this->termsLanguages->hasLanguage( $this->languageCode ) ) {\n\t\t\t$errorMessage = $this->msg(\n\t\t\t\t'wikibase-wikibaserepopage-invalid-langcode',\n\t\t\t\t$this->languageCode\n\t\t\t)->parse();\n\n\t\t\t$this->showErrorHTML( $errorMessage );\n\t\t}\n\t}", "function fatalChecks()\n{\n\t$errors = array();\n\t\n\t// Make sure the installer is not locked.\n\tif (@$_GET[\"step\"] != \"finish\" and file_exists(\"lock\")) $errors[] = \"<strong>esoTalk is already installed.</strong><br/><small>To reinstall esoTalk, you must remove <strong>install/lock</strong>.</small>\";\n\t\n\t// Check the PHP version.\n\tif (!version_compare(PHP_VERSION, \"4.3.0\", \">=\")) $errors[] = \"Your server must have <strong>PHP 4.3.0 or greater</strong> installed to run esoTalk.<br/><small>Please upgrade your PHP installation (preferably to version 5) or request that your host or administrator upgrade the server.</small>\";\n\t\n\t// Check for the MySQL extension.\n\tif (!extension_loaded(\"mysql\")) $errors[] = \"You must have <strong>MySQL 4 or greater</strong> installed and the <a href='http://php.net/manual/en/mysql.installation.php' target='_blank'>MySQL extension enabled in PHP</a>.<br/><small>Please install/upgrade both of these requirements or request that your host or administrator install them.</small>\";\n\t\n\t// Check file permissions.\n\t$fileErrors = array();\n\t$filesToCheck = array(\"\", \"avatars/\", \"plugins/\", \"skins/\", \"config/\", \"install/\", \"upgrade/\");\n\tforeach ($filesToCheck as $file) {\n\t\tif ((!file_exists(\"../$file\") and !@mkdir(\"../$file\")) or (!is_writable(\"../$file\") and !@chmod(\"../$file\", 0777))) {\n\t\t\t$realPath = realpath(\"../$file\");\n\t\t\t$fileErrors[] = $file ? $file : substr($realPath, strrpos($realPath, \"/\") + 1) . \"/\";\n\t\t}\n\t}\n\tif (count($fileErrors)) $errors[] = \"esoTalk cannot write to the following files/folders: <strong>\" . implode(\"</strong>, <strong>\", $fileErrors) . \"</strong>.<br/><small>To resolve this, you must navigate to these files/folders in your FTP client and <strong>chmod</strong> them to <strong>777</strong>.</small>\";\n\t\n\t// Check for PCRE UTF-8 support.\n\tif (!@preg_match(\"//u\", \"\")) $errors[] = \"<strong>PCRE UTF-8 support</strong> is not enabled.<br/><small>Please ensure that your PHP installation has PCRE UTF-8 support compiled into it.</small>\";\n\t\n\t// Check for the gd extension.\n\tif (!extension_loaded(\"gd\") and !extension_loaded(\"gd2\")) $errors[] = \"The <strong>GD extension</strong> is not enabled.<br/><small>This is required to save avatars and generate captcha images. Get your host or administrator to install/enable it.</small>\";\n\t\n\tif (count($errors)) return $errors;\n}", "function otherLangs() {\n global $mpt_config;\n $other_langs = array();\n\n foreach($mpt_config['kb_all_langs'] as $lang_key => $lang_name) {\n if(! in_array($lang_key, $mpt_config['my_plugin_langs'])) {\n $other_langs[$lang_key] = $lang_name;\n }\n }\n return $other_langs;\n}", "function _checkTranslate()\n\t{\n\t\tglobal $lng, $ilSetting, $ilUser, $rbacsystem;\n\n\t\tif (!$ilSetting->get(\"lang_ext_maintenance\")\n\t\tor !$ilSetting->get(\"lang_translate_\".$lng->getLangKey()))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($ilUser->getId())\n\t\t{\n\t\t\t$ref_id = self::_lookupLangFolderRefId();\n\t\t\treturn $rbacsystem->checkAccess(\"read,write\", (int) $ref_id);\n\t\t}\n\t\treturn false;\n\t}", "private function langaugeValidator(string $lang){\n $langChecker = false;\n foreach($this->langList as $key => $value){\n if($value == $lang)\n $langChecker = true;\n }\n return (($langChecker == true) ? $lang : 'en');\n }", "public function meetDependencies($return_status = false){\n\n\t\t\t// depends on \"Languages\"\n\t\t\t$languages_status = ExtensionManager::fetchStatus( array('handle' => 'languages') );\n\t\t\t$languages_status = current( $languages_status );\n\n\t\t\tif( $languages_status != EXTENSION_ENABLED ){\n\t\t\t\tif( $return_status ){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthrow new Exception('Frontend Localisation depends on Languages extension.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function language_selector_get_allowed_translations() {\n\t\n\t$configured_allowed = elgg_get_plugin_setting(\"allowed_languages\", \"language_selector\");\n\t\n\tif (empty($configured_allowed)) {\n\t\t$allowed = array(\"en\");\n\t\t\n\t\t$installed_languages = get_installed_translations();\n\t\n\t\t$min_completeness = (int) elgg_get_plugin_setting(\"min_completeness\", \"language_selector\");\n\t\t\n\t\tif ($min_completeness > 0) {\n\t\t\tif (elgg_is_active_plugin(\"translation_editor\")) {\n\t\t\t\t$completeness_function = \"translation_editor_get_language_completeness\";\n\t\t\t} else {\n\t\t\t\t$completeness_function = \"get_language_completeness\";\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($installed_languages as $lang_id => $lang_description) {\n\t\n\t\t\t\tif ($lang_id != \"en\") {\n\t\t\t\t\tif (($completeness = $completeness_function($lang_id)) >= $min_completeness) {\n\t\t\t\t\t\t$allowed[] = $lang_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\telgg_set_plugin_setting(\"allowed_languages\", implode(\",\", $allowed), \"language_selector\");\n\t\t\n\t} else {\n\t\t$allowed = string_to_tag_array($configured_allowed);\n\t}\n\n\treturn $allowed;\n}", "public function check() {\r\n\t\tif (trim( $this->title ) == '') {\r\n\t\t\t$this->_error = \"You must enter a name.\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (trim( $this->sef ) == '') {\r\n\t\t\t$this->_error = \"You must enter a corresponding language code.\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// check for existing language code\r\n\t\t$this->_db->setQuery( \"SELECT id FROM #__languages \"\r\n\t\t. \"\\nWHERE code='$this->sef' AND id!='$this->id'\"\r\n\t\t);\r\n\r\n\t\t$xid = intval( $this->_db->loadResult() );\r\n\t\tif ($xid && $xid != intval( $this->id )) {\r\n\t\t\t$this->_error = \"There is already a language with the code you provided, please try again.\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "public static function onPluginsLoaded(){\r\n\r\n\t\t//dmp(GlobalsUC::$pathWPLanguages);exit();\r\n\t\t\r\n\t\tload_plugin_textdomain( \"unlimited_elements\", FALSE, GlobalsUC::$pathWPLanguages );\r\n\t\t\r\n\t}", "public function validateI18n()\n\t{\n\t\tif($this->getTable()->hasI18n())\n\t\t{\n\t\t\tif($this->get('Translation')->count() === 0)\n\t\t\t{\n\t\t\t\t$newI18n = $this->_getNewI18n();\n\t\t\t\tif(!$newI18n->isValid())\n\t\t\t\t{\n\t\t\t\t\tthrow new Doctrine_Validator_Exception(array($newI18n));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$inError = array();\n\n\t\t\t\tforeach($this->get('Translation') as $translation)\n\t\t\t\t{\n\t\t\t\t\t$state = $translation->isValid();\n\t\t\t\t\tif(true !== $state)\n\t\t\t\t\t{\n\t\t\t\t\t\t$inError[] = $translation;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!empty($inError))\n\t\t\t\t{\n\t\t\t\t\tthrow new Doctrine_Validator_Exception($inError);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function translations_AddLanguages ($WORD_ARRAY)\n {\n $ERRORLIST = '';\n foreach ($WORD_ARRAY as $key => $value)\n {\n if (strpos($key, '::') != false) #a valid language tranlsation will have a :: character in its key\n {\n $PARTS = explode('::', $key);\n $IDENTIFIER = $PARTS[1];\n $LANG_NAME = $value;\n $this->translations_db_AddLanguageColumn ($LANG_NAME);\n }\n }\n }", "function pmprosl_check_plugins() {\r\n\t// Don't waste resources on the frontend.\r\n\tif( ! is_admin() || ! defined( 'PMPRO_VERSION') ) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * Array of plugin arrays.\r\n\t * Required keys are name, shortcode, and a constant we can use to check if plugin is installed.\r\n\t */\r\n\t$plugins = array(\r\n\t\tarray(\r\n\t\t'name' => 'NextEnd Social Login',\r\n\t\t'shortcode' => '[nextend_social_login]',\r\n\t\t'constant' => 'NSL_PATH_FILE',\r\n\t\t),\r\n\t\tarray( \r\n\t\t\t'name' => 'Super Socializer',\r\n\t\t\t'shortcode' => '[TheChamp-Login]',\r\n\t\t\t'constant' => 'THE_CHAMP_SS_VERSION',\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'name' => 'WordPress Social Login',\r\n\t\t\t'shortcode' => '[wordpress_social_login]',\r\n\t\t\t'constant' => 'WORDPRESS_SOCIAL_LOGIN_ABS_PATH',\r\n\t\t)\r\n\t);\r\n\t\r\n\t$active_plugins = array();\r\n\tforeach( $plugins as $plugin ) {\r\n\t\t// is the plugin installed? if so, add to list of active plugins\r\n\t\tif( defined( $plugin['constant'] ) ) {\r\n\t\t\t$active_plugins[] = $plugin;\r\n\t\t}\r\n\t}\r\n\t\t\r\n\t$active_plugin_count = count( $active_plugins );\r\n\t\r\n\tif( $active_plugin_count > 1 ) {\r\n\t\t// more than one plugin installed, let's warn them\r\n\t\t$notice = esc_html__( \"The following plugins are activated\", 'pmpro-social-login') . \":<br/>\";\r\n\t\tfor( $i = 0; $i < $active_plugin_count; $i++ ) {\r\n\t\t\t$notice .= $active_plugins[$i]['name'] . \"<br/>\";\r\n\t\t}\r\n\t\t$notice .= sprintf( esc_html__( 'Paid Memberships Pro Social Login will use %s for social login integration. Deactivate the plugins you don\\'t want to use or use the pmprosl_login_shortcode filter to change this behavior.', 'pmpro-social-login' ), esc_html( $active_plugins[0]['name'] ) );\r\n\t} elseif( $active_plugin_count < 1 ) {\r\n\t\t// no plugins installed, warn about that\r\n\t\t/* translators: %1$s is a link to the NextEnd plugin, %2$s is a link to the Super Socializer plugin */\r\n\t\t$notice = sprintf( esc_html__( 'The Social Login Add On for Paid Memberships Pro requires either the %1$s or %2$s plugin to be installed and configured.', 'pmpro-social-login' ), '<a href=\"https://wordpress.org/plugins/nextend-facebook-connect/\">NextEnd Social Login</a>', '<a href=\"https://wordpress.org/plugins/super-socializer/\">Super Socializer</a>' );\r\n\t} else {\r\n\t\t// Just one plugin installed. Remove the notice.\r\n\t\t$notice = '';\r\n\t}\r\n\t\r\n\t// Set the notice.\r\n\tupdate_option( 'pmpro_social_login_notice', $notice );\r\n\t\r\n\t// Use first plugin we find.\r\n\tif( $active_plugin_count ) {\r\n\t\tupdate_option( 'pmpro_social_login_shortcode', $active_plugins[0]['shortcode'] );\r\n\t}\r\n}", "static private function checkLanguage() {\n $langSet = C('DEFAULT_LANG');\n //load language packet \n if (!C('LANG_SWITCH_ON')){\n \tvar_dump('LANG_SWITCH_ON');\n L(include BUDDY_PATH.'/Lang/'.$langSet.'.php');\n return;\n }\n //enable lang auto detect \n if (C('LANG_AUTO_DETECT')){\n if(isset($_GET[C('VAR_LANGUAGE')])){\n $langSet = $_GET[C('VAR_LANGUAGE')];\n //set buddy cookie\n cookie('bd_language',$langSet,3600);\n }elseif(cookie('bd_language')){\n $langSet = cookie('bd_language');\n }elseif(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){\n preg_match('/^([a-z\\-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches);\n $langSet = $matches[1];\n cookie('bd_language',$langSet,3600);\n }\n if(false === stripos(C('LANG_LIST'),$langSet)) {\n $langSet = C('DEFAULT_LANG');\n }\n }\n //define langset\n define('LANG_SET',strtolower($langSet));\n //load lang file\n if(is_file(BUDDY_PATH.'/Lang/'.LANG_SET.'.php'))\n {\n L(include BUDDY_PATH.'/Lang/'.LANG_SET.'.php');\n }\n //load common lan file\n if (defined('LANG_PATH') && is_file(LANG_PATH.DIRECTORY_SEPARATOR.LANG_SET.'/Common.php'))\n {\n L(include LANG_PATH.DIRECTORY_SEPARATOR.LANG_SET.'/Common.php');\n }\n }", "function isValid($lg){\n\t\t$lang = new Sushee_Language($lg);\n\t\treturn !!$lang->getISO1();\n\t}", "public static function validateLanguage($y_language) {\n\t\t//--\n\t\tif((string)trim((string)$y_language) == '') {\n\t\t\treturn false;\n\t\t} //end if\n\t\t//--\n\t\t$all_languages = (array) self::getSafeLanguagesArr();\n\t\t//--\n\t\t$ok = false;\n\t\t//--\n\t\tif(strlen((string)$y_language) == 2) { // if language id have only 2 characters\n\t\t\tif(preg_match('/^[a-z]+$/', (string)$y_language)) { // language id must contain only a..z characters (iso-8859-1)\n\t\t\t\tif(is_array($all_languages)) {\n\t\t\t\t\tif($all_languages[(string)$y_language]) { // if that lang is set in languages array\n\t\t\t\t\t\t$ok = true;\n\t\t\t\t\t} //end if\n\t\t\t\t} //end if\n\t\t\t} //end if\n\t\t} //end if\n\t\t//--\n\t\treturn (bool) $ok;\n\t\t//--\n\t}", "function _multilingual(){\n\tif(_cfg('languages')){\n\t\treturn (count(_cfg('languages')) > 1) ? true : false;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function testAllowedLanguageGetAllowedLanguagesForUser() {\n $allowed_languages = allowed_languages_get_allowed_languages_for_user($this->user);\n\n $this->assertEquals($allowed_languages, ['sv', 'en']);\n }", "public function test_loadPluginErrorReturn()\n {\n $this->assertFalse($this->smarty->_loadPlugin('Smarty_Not_Known'));\n }", "public function check( $value ) {\n\n\t\tif ( ! is_array( $value ) ) {\n\t\t\tthrow new Exception( 'Plugins Check requires array of arrays parameter with inner keys: file, name, version (optional)' );\n\t\t}\n\n\t\t$active_plugins_raw = wp_get_active_and_valid_plugins();\n\n\t\tif ( is_multisite() ) {\n\t\t\t$active_plugins_raw = array_merge( $active_plugins_raw, wp_get_active_network_plugins() );\n\t\t}\n\n\t\t$active_plugins = array();\n\t\t$active_plugins_versions = array();\n\n\t\tforeach ( $active_plugins_raw as $plugin_full_path ) {\n\t\t\t$plugin_file = str_replace( WP_PLUGIN_DIR . '/', '', $plugin_full_path );\n\t\t\t$active_plugins[] = $plugin_file;\n\n\t\t\tif ( file_exists( $plugin_full_path ) ) {\n\t\t\t\t$plugin_api_data = @get_file_data( $plugin_full_path, array( 'Version' ) ); // phpcs:ignore\n\t\t\t\t$active_plugins_versions[ $plugin_file ] = $plugin_api_data[0];\n\t\t\t} else {\n\t\t\t\t$active_plugins_versions[ $plugin_file ] = 0;\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $value as $plugin_data ) {\n\t\t\tif ( ! in_array( $plugin_data['file'], $active_plugins, true ) ) {\n\t\t\t\t$this->add_error(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t// Translators: Plugin name.\n\t\t\t\t\t\t'Required plugin: %s',\n\t\t\t\t\t\t$plugin_data['name']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} elseif ( isset( $plugin_data['version'] ) && version_compare( $active_plugins_versions[ $plugin_data['file'] ], $plugin_data['version'], '<' ) ) {\n\t\t\t\t$this->add_error(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t// Translators: 1. Plugin name, 2. Required version, 3. Used version.\n\t\t\t\t\t\t'Minimum required version of %1$s plugin is %2$s. Your version is %3$s',\n\t\t\t\t\t\t$plugin_data['name'],\n\t\t\t\t\t\t$plugin_data['version'],\n\t\t\t\t\t\t$active_plugins_versions[ $plugin_data['file'] ]\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t}", "function accept_lang($lang = 'en')\r\n\t{\r\n\t\treturn (in_array(strtolower($lang), $this->languages(), TRUE)) ? TRUE : FALSE;\r\n\t}", "function epfl_news_check_required_parameters($channel, $lang) {\n\n // check lang\n if ($lang !== \"fr\" && $lang !== \"en\" ) {\n return FALSE;\n }\n\n // check channel\n if ($channel === \"\") {\n return FALSE;\n }\n\n return TRUE;\n}", "function epfl_news_check_required_parameters($channel, $lang) {\n\n // check lang\n if ($lang !== \"fr\" && $lang !== \"en\" ) {\n return FALSE;\n }\n\n // check channel\n if ($channel === \"\") {\n return FALSE;\n }\n\n return TRUE;\n}", "protected function set_languages(): bool {\n\t\t$this->languages = [];\n\t\t$languages = wp_parse_slug_list( $this->plato_project->get_languages() );\n\t\tforeach ( $languages as $language_code ) {\n\t\t\t$language_code = strtoupper( $language_code );\n\t\t\t$language = siw_get_language( $language_code, Language::PLATO_CODE );\n\t\t\tif ( ! is_a( $language, Language::class ) ) {\n\t\t\t\tLogger::error( sprintf( 'Taal met code %s niet gevonden', $language_code ), self::LOGGER_SOURCE );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->languages[] = $language;\n\t\t}\n\t\treturn isset( $this->languages );\n\t}", "public static function validateLang()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 10),\n );\n }" ]
[ "0.5988241", "0.59534156", "0.59365624", "0.5856586", "0.5844965", "0.57880014", "0.57389945", "0.57336044", "0.5666584", "0.5640324", "0.5627805", "0.56219167", "0.56083524", "0.55752856", "0.55566925", "0.55434036", "0.5541823", "0.55405736", "0.5519674", "0.54958135", "0.54940474", "0.5473199", "0.5461886", "0.5440354", "0.53786844", "0.53710043", "0.53684187", "0.53684187", "0.53657466", "0.5353824" ]
0.8181568
0
Return all languagecodes EXCEPT for those configured in $my_plugin_langs
function otherLangs() { global $mpt_config; $other_langs = array(); foreach($mpt_config['kb_all_langs'] as $lang_key => $lang_name) { if(! in_array($lang_key, $mpt_config['my_plugin_langs'])) { $other_langs[$lang_key] = $lang_name; } } return $other_langs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDisabledLanguages();", "function supplang_languages() {\n\t$languages = array(\n\t\t'filtered' => array(),\n\t\t// The option array uses the language locale as a key to indicate its availability\n\t\t'available' => get_option( SUPPLANG_AVAILABLE_UIL ),\n\t);\n\n\tforeach ( supplang_registered_languages() as $lang ) {\n\t\tif ( array_key_exists( $lang['locale'], $languages['available'] ) ) {\n\t\t\t// Add filtered language\n\t\t\tarray_push(\n\t\t\t\t$languages['filtered'], array_filter(\n\t\t\t\t\t$lang, function( $key ) {\n\t\t\t\t\t\t// Do not send the description key\n\t\t\t\t\t\treturn 'description' !== $key;\n\t\t\t\t\t}, ARRAY_FILTER_USE_KEY\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $languages['filtered'];\n}", "public static function getOtherAvailableLanguages()\r\n\t{\r\n\t\tif( $languages = self::getLanguageArray(null) )\r\n\t\t{\r\n\t\t\t$codes = Array();\r\n\t\t\tforeach($languages as $key => $value)\r\n\t\t\t\tif( $key != self::getCurrentLanguage() )\r\n\t\t\t\t\t$codes[] = $key;\r\n\t\t\treturn $codes;\r\n\t\t}\r\n\t\telse\r\n\t\t\tCommon::reportRunningWarning(\"[Class Language] None language table found !\");\r\n\t}", "function _langs($excepts=NULL){\n\tglobal $lc_languages;\n\t$langs = array();\n\tif($excepts){\n\t\tforeach($lc_languages as $lcode => $lname){\n\t\t\tif(is_array($excepts) && in_array($lcode, $excepts)) continue;\n\t\t\tif(is_string($excepts) && $lcode == $excepts) continue;\n\t\t\t$langs[$lcode] = $lname;\n\t\t}\n\t}else{\n\t\t$langs = $lc_languages;\n\t}\n\treturn (count($langs)) ? $langs : false;\n}", "private function filterNewLangcode($langcodes)\n {\n $enabledLanguages = $this->getLanguageManager()->getLanguages();\n foreach ($langcodes as $key => $langcode) {\n if (isset($enabledLanguages[$langcode])) {\n $this->logger->warning(dt('The language !langcode is already enabled.', [\n '!langcode' => $langcode\n ]));\n unset($langcodes[$key]);\n }\n }\n\n return $langcodes;\n }", "public function getEnabledLanguages();", "public function getTranslatedLanguages() {\n return static::find()->where('id = :id AND language != :language', [':id' => $this->id, 'language' => $this->language])->all();\n }", "static function ignoredWords(){\n return array(\"a\", \"o\", \"de\", \"da\", \"do\", \"em\", \"e\", \"para\", \"por\", \"que\");\n }", "function language_selector_get_allowed_translations() {\n\t\n\t$configured_allowed = elgg_get_plugin_setting(\"allowed_languages\", \"language_selector\");\n\t\n\tif (empty($configured_allowed)) {\n\t\t$allowed = array(\"en\");\n\t\t\n\t\t$installed_languages = get_installed_translations();\n\t\n\t\t$min_completeness = (int) elgg_get_plugin_setting(\"min_completeness\", \"language_selector\");\n\t\t\n\t\tif ($min_completeness > 0) {\n\t\t\tif (elgg_is_active_plugin(\"translation_editor\")) {\n\t\t\t\t$completeness_function = \"translation_editor_get_language_completeness\";\n\t\t\t} else {\n\t\t\t\t$completeness_function = \"get_language_completeness\";\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($installed_languages as $lang_id => $lang_description) {\n\t\n\t\t\t\tif ($lang_id != \"en\") {\n\t\t\t\t\tif (($completeness = $completeness_function($lang_id)) >= $min_completeness) {\n\t\t\t\t\t\t$allowed[] = $lang_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\telgg_set_plugin_setting(\"allowed_languages\", implode(\",\", $allowed), \"language_selector\");\n\t\t\n\t} else {\n\t\t$allowed = string_to_tag_array($configured_allowed);\n\t}\n\n\treturn $allowed;\n}", "public function getLanguageCodes()\n {\n return $this->language_codes;\n }", "public function getAvailableLanguages ();", "public static function available_languages() {\n\n\t\t$languages = array(\n\t\t\t'czech' => 'APP_StopWords_Czech',\n\t\t\t'danish' => 'APP_StopWords_Danish',\n\t\t\t'dutch' => 'APP_StopWords_Dutch',\n\t\t\t'english' => 'APP_StopWords_English',\n\t\t\t'finnish' => 'APP_StopWords_Finnish',\n\t\t\t'french' => 'APP_StopWords_French',\n\t\t\t'german' => 'APP_StopWords_German',\n\t\t\t'hungarian' => 'APP_StopWords_Hungarian',\n\t\t\t'italian' => 'APP_StopWords_Italian',\n\t\t\t'norwegian' => 'APP_StopWords_Norwegian',\n\t\t\t'polish' => 'APP_StopWords_Polish',\n\t\t\t'portuguese' => 'APP_StopWords_Portuguese',\n\t\t\t'romanian' => 'APP_StopWords_Romanian',\n\t\t\t'russian' => 'APP_StopWords_Russian',\n\t\t\t'slovak' => 'APP_StopWords_Slovak',\n\t\t\t'spanish' => 'APP_StopWords_Spanish',\n\t\t\t'swedish' => 'APP_StopWords_Swedish',\n\t\t\t'turkish' => 'APP_StopWords_Turkish',\n\t\t);\n\n\t\treturn $languages;\n\t}", "private function getLanguagesInUse()\n {\n // Get all languages in use (see #6013)\n $query = \"\n SELECT language FROM tl_member\n UNION SELECT language FROM tl_user\n UNION SELECT REPLACE(language, '-', '_') FROM tl_page\n WHERE type='root'\n \";\n\n $statement = $this->connection->prepare($query);\n $statement->execute();\n\n $languages = [];\n\n while ($language = $statement->fetch(\\PDO::FETCH_OBJ)) {\n if ('' === $language->language) {\n continue;\n }\n\n $languages[] = $language->language;\n\n // Also cache \"de\" if \"de-CH\" is requested\n if (strlen($language->language) > 2) {\n $languages[] = substr($language->language, 0, 2);\n }\n }\n\n return array_unique($languages);\n }", "public function getAllLanguages()\n {\n return array('de');\n }", "public static function getPortalLanguages() {\n global $languages;\n foreach($languages as $name => $label) {\n if(strcmp(DEFAULT_LANG,$name) == 0){\n $list .= '<option value='.$name.' selected>'.$label.'</option>';\n } else {\n $list .= '<option value='.$name.'>'.$label.'</option>';\n }\n }\n return $list;\n }", "function getLanguageList()\r\n{\r\n\t$languages = array('English'=>'English'); // English is always included by default\r\n\tforeach (getDirFiles(dirname(dirname(dirname(__FILE__))) . DS . 'languages') as $this_language)\r\n\t{\r\n\t\tif (strtolower(substr($this_language, -4)) == '.ini')\r\n\t\t{\r\n\t\t\t$lang_name = substr($this_language, 0, -4);\r\n\t\t\t// Set name as both key and value\r\n\t\t\t$languages[$lang_name] = $lang_name;\r\n\t\t}\r\n\t}\r\n\tksort($languages);\r\n\treturn $languages;\r\n}", "public function getNonUsedLocales()\n {\n return $this->fetchLocales(false);\n }", "public static function allLanguages()\n\t{\n\t\t$_countries = array(\n\t\t\t\t'Arabic'=>'Arabic',\n\t\t\t\t'Chinese - Cantonese'=>'Chinese - Cantonese',\n\t\t\t\t'Chinese - Mandarin'=>'Chinese - Mandarin',\n\t\t\t\t'English'=>'English',\n\t\t\t\t'Danish'=>'Danish',\n\t\t\t\t'Dutch'=>'Dutch',\n\t\t\t\t'Filipino'=>'Filipino',\n\t\t\t\t'Finish'=>'Finish',\n\t\t\t\t'French'=>'French',\n\t\t\t\t'German'=>'German',\n\t\t\t\t'Greek'=>'Greek',\n\t\t\t\t'Indonesian'=>'Indonesian',\n\t\t\t\t'Italian'=>'Italian',\n\t\t\t\t'Japanese'=>'Japanese',\n\t\t\t\t'Korean'=>'Korean',\n\t\t\t\t'Malay'=>'Malay',\n\t\t\t\t'Norwegian'=>'Norwegian',\n\t\t\t\t'Polish'=>'Polish',\n\t\t\t\t'Portuguese'=>'Portuguese',\n\t\t\t\t'Russian'=>'Russian',\n\t\t\t\t'Spanish'=>'Spanish',\n\t\t\t\t'Swedish'=>'Swedish',\n\t\t\t\t'Thai'=>'Thai',\n\t\t\t\t'Turkish'=>'Turkish',\n\t\t\t\t'Vietnamese'=>'Vietnamese',\n\t\t\t\t);\n\t\treturn $_countries;\n\t}", "function bamobile_mobiconnector_get_wpml_list_languages(){\r\n\t$listlangs = array();\r\n\tif('woocommerce-multilingual/wpml-woocommerce.php'){\r\n\t\tglobal $wpdb;\r\n\t\t$prefix = $wpdb->prefix;\r\n\t\t$sql = \"SELECT SQL_CALC_FOUND_ROWS * FROM \".$prefix.\"icl_locale_map as local LEFT JOIN \".$prefix.\"icl_languages as lang ON local.code = lang.code\";\r\n\t\t$listlangs = $wpdb->get_results($sql,ARRAY_A);\r\n\t}\r\n\treturn $listlangs;\r\n}", "public static function getLanguages() {\n\t\t$languages = array();\n\t\tforeach (self::$cache['codes'] as $languageCode => $languageID) {\n\t\t\t$languages[$languageID] = WCF::getLanguage()->getDynamicVariable('wcf.global.language.'.$languageCode);\n\t\t}\n\t\t\n\t\tStringUtil::sort($languages);\n\t\t\n\t\treturn $languages;\n\t}", "function languages()\n {\n // trust configuration\n $configured = $this->rc->config->get('spellcheck_languages');\n if (!empty($configured) && is_array($configured) && !$configured[0]) {\n return $configured;\n }\n else if (!empty($configured)) {\n $langs = (array)$configured;\n }\n else if ($this->backend) {\n $langs = $this->backend->languages();\n }\n\n // load index\n @include(RCUBE_LOCALIZATION_DIR . 'index.inc');\n\n // add correct labels\n $languages = array();\n foreach ($langs as $lang) {\n $langc = strtolower(substr($lang, 0, 2));\n $alias = $rcube_language_aliases[$langc];\n if (!$alias) {\n $alias = $langc.'_'.strtoupper($langc);\n }\n if ($rcube_languages[$lang]) {\n $languages[$lang] = $rcube_languages[$lang];\n }\n else if ($rcube_languages[$alias]) {\n $languages[$lang] = $rcube_languages[$alias];\n }\n else {\n $languages[$lang] = ucfirst($lang);\n }\n }\n\n // remove possible duplicates (#1489395)\n $languages = array_unique($languages);\n\n asort($languages);\n\n return $languages;\n }", "function lingotek_get_target_locales($codes_only = TRUE) {\n $target_languages = db_query(\"SELECT * FROM {languages} WHERE lingotek_enabled = :enabled\", array(':enabled' => 1))->fetchAll();\n $target_codes = array();\n foreach ($target_languages as $target_language) {\n $target_codes[] = $target_language->lingotek_locale;\n }\n return $codes_only ? $target_codes : $target_languages;\n}", "private static function getSafeLanguagesArr() {\n\t\t//--\n\t\tglobal $languages;\n\t\t//--\n\t\tif(!is_array($languages)) {\n\t\t\t$languages = array('en' => '[EN]');\n\t\t} else {\n\t\t\t$languages = (array) array_change_key_case((array)$languages, CASE_LOWER); // make all keys lower\n\t\t} //end if\n\t\t//--\n\t\treturn (array) $languages;\n\t\t//--\n\t}", "function get_rocket_all_active_langs() {\n\t\t_deprecated_function( __FUNCTION__, '2.2', 'get_rocket_i18n_code()' );\n\t\treturn get_rocket_i18n_code();\n\t}", "public function ldv_get_available_languages(){ \r\n \r\n return array(\r\n __('Use WordPress default', 'ldv-reviews') => '',\r\n __('English (US)', 'ldv-reviews') => 'en_US', \r\n __('English (GB)', 'ldv-reviews') => 'en_GB',\r\n __('French (FR)', 'ldv-reviews') => 'fr_FR',\r\n __('French (CA)', 'ldv-reviews') => 'fr_CA',\r\n __('Spanish (ES)', 'ldv-reviews') => 'es_ES', \r\n __('Spanish (MX)', 'ldv-reviews') => 'es_MX', \r\n __('Italian', 'ldv-reviews') => 'it_IT',\r\n __('German (DE)', 'ldv-reviews') => 'de_DE',\r\n __('Russian', 'ldv-reviews') => 'ru_RU',\r\n __('Portuguese', 'ldv-reviews') => 'pt_PT', \r\n );\r\n }", "public function term_edit_form_langs () {\n\n\n $langs = array();\n\n $site_lang = get_locale();\n\n $available_lang = get_option ( 'alwpr_langs', array() );\n\n foreach ( $available_lang as $key=>$value ) {\n\n // site base language\n if ( $value['language'] == $site_lang ) {\n \n continue;\n \n }\n\n $langs[$key] = $value['english_name'] . '/' . $value['native_name'];\n }\n\n return $langs;\n\n\n }", "private static function getLanguages()\n {\n $translations = array();\n $dirs = new DirectoryIterator(Yii::app()->messages->basePath);\n foreach ($dirs as $dir)\n if ($dir->isDir() && !$dir->isDot())\n $translations[$dir->getFilename()] = $dir->getFilename();\n return in_array(Yii::app()->sourceLanguage, $translations) ? $translations : array_merge($translations, array(Yii::app()->sourceLanguage => Yii::app()->sourceLanguage));\n }", "public static function getStandardLanguageList();", "public function get_languages()\n {\n return $this->found_languages;\n }", "public function getLanguages() {\r\n return glob($this->language_folder.'*.'.$this->language_ext);\r\n }" ]
[ "0.72996855", "0.6822406", "0.66581887", "0.6602444", "0.6503994", "0.6438258", "0.6390003", "0.6218206", "0.6183836", "0.61721575", "0.61632556", "0.61530185", "0.614379", "0.61099553", "0.6087384", "0.607936", "0.6054107", "0.60522264", "0.60459846", "0.6032103", "0.6024254", "0.60085833", "0.5989515", "0.5970241", "0.5965104", "0.5961649", "0.59346575", "0.5931059", "0.59229594", "0.5899115" ]
0.77456075
0
ECHO a (colored) message to the screen
function echoMessage($message, $type = ''){ switch ($type) { case 'e': // error RED echo "\033[31m$message \033[0m\n"; break; case 's': // success GREEN echo "\033[32m$message \033[0m\n"; break; case 'w': // warning YELLOW echo "\033[33m$message \033[0m\n"; break; case 'i': // info BLUE echo "\033[36m$message \033[0m\n"; break; default: // white echo "$message\n"; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _showMessage()\r\n {\r\n Log::addLog(\"staus is \" . (is_null($this->status) ? 'NULL' : ($this->status ? 'TRUE' : 'FALSE')));\r\n echo (is_null($this->status) ? '' : (\"\\033[46m[\" . date(\"Y-m-d H:i:s\") . \"]\\033[0m \" . \r\n ($this->status ? \"\\033[32mSuccess!\\033[0m \" : \"\\033[31mFailed!\\033[0m \") \r\n . $this->cmd . PHP_EOL)) . $this->message . PHP_EOL;\r\n }", "private static function print_message($message, $color = NULL)\n\t{\n\t\techo self::colorize($message, $color).PHP_EOL;\n\t}", "private function e($msg, $good = TRUE) {\n if($good) {\n $color = \"\\033[94m \";\n }else {\n $color = \"\\033[91m\";\n }\n\n echo $color . $msg . \"\\033[0m\" . \"\\n\"; # \\n because this is expected to run on unix.\n }", "function out($message = \"\", $die = false, $newline = true) {\n\t\n\t$colors = array(\n\t\t\"|w|\" => \"1;37\",\t// White\n\t\t\"|b|\" => \"0;34\",\t// Blue\n\t\t\"|y|\" => \"0;33\",\t// Yellow\n\t\t\"|g|\" => \"0;32\",\t// Green\n\t\t\"|r|\" => \"0;31\",\t// Red\n\t\t\"|n|\" => \"0\"\t\t// Neutral\n\t);\n\t\n\t$message = \"$message|n|\";\n\t\n\tforeach ($colors as $color => $value)\n\t\t$message = str_replace($color, \"\\033[\" . $value . \"m\", $message);\n\t\n\tif ($newline)\n\t\techo $message . PHP_EOL;\n\telse\n\t\techo $message;\n\t\n\tif ($die)\n\t\tdie();\n}", "private function echoMessage($message) {\n\t\tprint $message . \"\\n\";\n\t}", "function debugmsg ($message, $color=\"green\")\n {\n echo \"<pre style=\\\"color : $color\\\">$message\\n</pre>\";\n }", "public function echo($message) {}", "function debug_message($message, $continued=FALSE)\n{\n\t$html = '<span style\"color:orange;\">';\n\t$html .= $message . '</span>';\n\tif ($continued == FALSE) {\n\t $html .= '<br />';\n\t}\n\t$html .= \"\\n\";\n\techo $html;\n}", "public static function log($message = ' ', $color = self::COLOR_BLACK, $bgColor = self::COLOR_GREY_LIGHT)\n {\n echo (\n '<pre style=\"color: '\n . $color\n . '; background-color: '\n . $bgColor\n . '; margin: 0; padding: 0 10 0 10;\">'\n );\n echo $message;\n echo '</pre>';\n }", "public function display($message)\n {\n $this->newLine();\n $this->out($message);\n $this->newLine();\n $this->newLine();\n }", "public function echoMessage(): void\n {\n echo $this->message;\n }", "function display_message(){\n\t\n\t\t$output = $this ->get_os_message().$this -> alt_browser();\n\t\treturn $output ; \n\t}", "function niceTry($message)\n{\n echo(BODY_START);\n echo(HEAD_START);\n echo(HEAD_END);\n echo(\"<CENTER>\");\n echo(\"<FONT FACE='Arial'>\");\n echo(\"$message\");\n echo(\"<BR><A HREF='http://www.twoforboth.com/football'>Back to Main Football Page</A>\");\n echo(BODY_END);\n}", "function Msg($str,$color){\n echo \"<p style=\\\"color:$color;font-size:1em\\\">$str</p>\"; \n }", "public function println($message, $color = 'NORMAL', $exit = false)\n\t{\n\t\t$str = $this->colorizeStr($message, $color) . PHP_EOL;\n\t\tif ($exit)\n\t\t\texit($str);\n\t\telse\n\t\t\techo $str;\n\t}", "function e107cli_print($message = '', $indent = 0) {\n $msg = str_repeat(' ', $indent) . (string) $message . \"\\n\";\n if ($charset = e107cli_get_option('output_charset') && function_exists('iconv')) {\n $msg = iconv('UTF-8', $charset, $msg);\n }\n print $msg;\n}", "function printMsg($msg) {\n echo \"<pre>$msg</pre>\";\n }", "function writeMessage(){\n\t\t\techo \"Your mum gay lol!!\";\n\t\t}", "public function info(string $message)\n\t{\n\t\techo $this->controller->ansiFormat($message, Console::FG_CYAN) . \"\\n\";\n\t}", "private function debugPrint($text) {\n return;\n printf('<p style=\"color:red;font-weight:bold;\">%s</p>', $text);\n }", "public static function printEcho($msg) {\n\n if (self::$enablePrintEcho) {\n echo $msg;\n }\n }", "private function message($msg) {\n echo $msg;\n }", "function PrintMessages()\n\t{\n\t\techo \"<div id='dialogue'>\";\n\t\techo \"<span id='message'>\";\n\t\tif ($GLOBALS['message'] != \"\")\n\t\t{\n\t\t\techo $GLOBALS['message'];\n\t\t}\n\t\techo \"</span>\";\n\t\t\n\t\techo \"<span id='errorMessage'>\";\n\t\tif ($GLOBALS['errorMessage'] != \"\")\n\t\t{\n\t\t\techo \"<h2>ERROR:</h2>\";\n\t\t\techo $GLOBALS['errorMessage'];\n\t\t}\n\t\techo \"</span>\";\n\t\techo \"</div>\";\n\t}", "public function printWithHighlights() {\n echo \"\\033[92m\";\n for ($i = 0; $i < 13; $i++) {\n echo $this->getCardValue($i) . \" \";\n }\n echo \"\\033[0m\";\n echo \"\\n\" . \"--------------------------------------\" . \"\\n\";\n\n for ($s = 0; $s < 4; $s++) {\n for ($v = 0; $v < 13; $v++) {\n $card = $this->deck[(13 * $s) + $v];\n\n // Invert card color if it is aligned\n if ($card % 13 === $v) {\n echo \"\\033[7m\";\n }\n\n echo $this->getCard($card);\n\n echo \"\\033[0m\";\n echo \" \";\n }\n\n echo \"\\n\";\n }\n\n echo \"\\n\";\n }", "public function print($message, $color = 'NORMAL', $exit = false)\n\t{\n\t\t$str = $this->colorizeStr($message, $color);\n\t\tif ($exit)\n\t\t\texit($str);\n\t\telse\n\t\t\techo $str;\n\t}", "protected function _displayMessage($message = '')\n {\n\n print $message . \"\\n\";\n\n }", "public function display($message){\r\n echo $message.\"<br/>\";\r\n }", "function showColoredParagraph($text, $color)\n {\n echo \"<p style='color: $color'>\";\n echo $text;\n echo \"</p>\";\n }", "public static function line($message) {\n if(self::getOption('silent')) return;\n echo $message.\"\\n\";\n }", "function out($msg)\r\n{\r\n echo $msg . PHP_EOL;\r\n}" ]
[ "0.6991402", "0.68942076", "0.6856623", "0.68503165", "0.6823744", "0.6807326", "0.6796755", "0.6681225", "0.6606286", "0.659931", "0.65595174", "0.6481772", "0.64678097", "0.64034384", "0.6402223", "0.6390722", "0.6348657", "0.6322351", "0.6298088", "0.62805325", "0.6276938", "0.62440383", "0.62286085", "0.6222041", "0.6192287", "0.6160201", "0.61581916", "0.61466", "0.6107582", "0.6089622" ]
0.6918087
1
Devuelve el valor del campo codcaj
public function getCodcaj(){ return $this->codcaj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCod(){\n\t\t\treturn $this->cod;\n\t\t}", "public function getCodClinica()\n {\n return $this->getModel()->getValor(\"codClinica\");\n }", "public function getCodigo()\n {\n return codigo;\n }", "public function getCodare(){\n\t\treturn $this->codare;\n\t}", "public function setCodcaj($codcaj){\n\t\t$this->codcaj = $codcaj;\n\t}", "public function getCodigo(){\n return $this->codigo;\n }", "public function getCodigo(){\n return $this->codigo;\n }", "public function getCodigo()\n {\n return $this->codigo;\n }", "public function getCodigo()\n {\n return $this->codigo;\n }", "public function getCodigo()\n {\n return $this->codigo;\n }", "public function getCodigo()\n {\n return $this->codigo;\n }", "public function getCodigo()\n {\n return $this->codigo;\n }", "public function getcodigo()\r\n\t{\r\n\t\treturn $this->codigo;\r\n\t}", "public function get_codigo(){\n return $this->codigo;\n }", "public function getCodigo()\r\n {\r\n return $this->codigo;\r\n }", "public function getCodigo()\r\n {\r\n return $this->codigo;\r\n }", "public function getCodigo()\r\n {\r\n return $this->codigo;\r\n }", "public function getCodigo()\n {\n return $this->codigo;\n }", "public function getCodigo()\n {\n return $this->codigo;\n }", "public function getCodhor()\n {\n return $this->_codhor;\n }", "public function getCodigo() {\n return $this->iCodigo;\n }", "protected function get_cuando_cambia_valor()\n\t{\n\t\t//--- Se llama a $this->objeto_js para que los ML se posicionen en la fila correcta\n\t\t$js = $this->objeto_js().\";\".$this->cuando_cambia_valor;\t\t\n\t\treturn $js;\n\t}", "public function getCodEdital()\n {\n return $this->codEdital;\n }", "function getCamCod() {\n\t return $this->cam_cod;\n\t }", "function set_cuando_cambia_valor($js)\n\t{\n\t\t$this->cuando_cambia_valor = $js;\n\t}", "public function getCodaction()\r\n {\r\n return $this->codaction;\r\n }", "public function getCodeVentilCompta(): ?string {\n return $this->codeVentilCompta;\n }", "public function getCodigo() {\n return $this->iCodigoEscola;\n }", "public function getCodIntegracao()\n\t{\n\t\treturn $this->cod_integracao;\n\t}", "public function getCodiceEsito()\n {\n return $this->codice_esito;\n }" ]
[ "0.6787929", "0.6780283", "0.67347646", "0.6676487", "0.64877003", "0.64864755", "0.6473402", "0.639608", "0.639608", "0.639608", "0.639608", "0.639608", "0.6393957", "0.6345675", "0.6340201", "0.6340201", "0.6340201", "0.6335205", "0.6335205", "0.6320319", "0.62700945", "0.62402594", "0.6176545", "0.6162869", "0.6122297", "0.61096156", "0.607076", "0.6051325", "0.60306835", "0.6009448" ]
0.77644825
0
Devuelve el valor del campo documento
public function getDocumento(){ return $this->documento; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDocumento()\n {\n return $this->documento;\n }", "public function getNombreDocumento()\n {\n return $this->nombre_documento;\n }", "public function getFieldValue(): string;", "public function getFieldValue() : string;", "function get_tipo_documento($vals,$args){\n\textract($vals);\n\textract($args);\n\t//habria que ver si hay do de tipo de documento\n\t$do_tipo_documento = DB_DataObject::factory('tipo_documento');\n\t$do_tipo_documento -> tipo_doc_id = $record[$id];\n\tif($do_tipo_documento -> find(true))\n\t\treturn $do_tipo_documento -> tipo_doc_descripcion;\n}", "public function obterValor(){\n return $this->valor;\n }", "private function campo(){}", "public function setDocumento($documento){\n\t\t$this->documento = $documento;\n\t}", "public function valorespordefecto($documento){\n\t\t$matriz=VwOpcionesdocumentos::Model()->search_d($documento)->getData();\n\t\t//recorreindo la matriz\n // print_r($matriz);\n\n\t\t$i=0;\n\n\t\tfor ($i=0; $i <= count($matriz)-1;$i++) {\n\t\t\tif ($matriz[$i]['tipodato']==\"N\" ) {\n\t\t\t\t$this->{$matriz[$i]['campo']}=!empty($matriz[$i]['valor'])?$matriz[$i]['valor']+0:'';\n\t\t\t}ELSE {\n\t\t\t\t$this->{$matriz[$i]['campo']}=!empty($matriz[$i]['valor'])?$matriz[$i]['valor']:'';\n\n\t\t\t}\n\n\t\t}\n\t\treturn 1;\n\t}", "public function getComponentValue()\n {\n if ($this->scope == self::SCOPE_ADD) {\n $valor = $this->CamposFormato->predeterminado;\n } else {\n $valor = \"<?= ComponentFormGeneratorController::callShowValue(\n {$this->Formato->getPK()},\n \\$_REQUEST['iddoc'],\n '{$this->CamposFormato->nombre}'\n ) ?>\";\n }\n\n return $valor;\n }", "public function getNumeroDocumento() {\n\n $numeroDocumento = \"\";\n\n $documento = $this->getDocumento();\n if ($documento)\n $numeroDocumento = $documento->getNumeroDocumento();\n\n unset($documento);\n return $numeroDocumento;\n }", "public function toDbFieldValue();", "public function fieldDoc()\n {\n return $this->hasOne(FieldDoc::class);\n }", "public function getTexto() {\n return $this->texto;\n }", "function conf__cuadro_doc(toba_ei_cuadro $cuadro)\n {\n //si es un conjunto el id_conjunto va en id_materia y el ultimo paramantro es 1\n $datos=$this->dep('datos')->tabla('asignacion_materia')->get_docentes($this->s__datos['id_materia'],$this->s__datos['anio'],$this->s__datos['id_periodo'],$this->s__datos['conj']); \n $cuadro->set_datos($datos);\n }", "public function establecerValor()\n {\n if( $this->sistema->configuracion->activados(Configuracion::DEFINIR_VALORES_AL_VALIDAR) ) {\n $this->campo->valor = $this->sistema->datos[$this->campo->clave()] ?? null;\n }\n }", "public function getTexto()\n {\n return $this->texto;\n }", "public function documento($datos)\n {\n if ($datos['tipo_documento'] == 'CC') {\n $this->identificador = 1;\n $this->documento = $datos['tipo_documento'] . $datos['documento'];\n }\n if ($datos['tipo_documento'] == 'TI') {\n $this->identificador = 2;\n $this->documento = $datos['tipo_documento'] . $datos['documento'];\n }\n if ($datos['tipo_documento'] == 'CE') {\n $this->identificador = 3;\n $this->documento = $datos['tipo_documento'] . $datos['documento'];\n }\n\n }", "public function getValor();", "public function getDocCriacao()\n\t{\n\t\treturn $this->doc_criacao;\n\t}", "function getDocFieldID() {\n\t\treturn $this->iDocFieldID;\n\t}", "public function getEntityField();", "public function getDocumento() {\n\n $documento = NULL;\n\n if (($this->Entidad != '') and ($this->IDEntidad != '')) {\n $documento = new $this->Entidad($this->IDEntidad);\n }\n\n return $documento;\n }", "public function getObservacao()\n {\n return $this->getModel()->getValor(\"observacao\");\n }", "public function getFieldValue()\n {\n return $this->field_value;\n }", "public function getValorRecebido()\n {\n return $this->valor_principal;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }" ]
[ "0.69001585", "0.6470057", "0.6308641", "0.6275627", "0.6260363", "0.61434853", "0.613823", "0.59956974", "0.59851354", "0.5968133", "0.5948591", "0.5943675", "0.5912455", "0.5869135", "0.5862703", "0.58387583", "0.5825086", "0.5791975", "0.57801414", "0.5779098", "0.5771244", "0.57527673", "0.56882423", "0.5644577", "0.56336176", "0.5613784", "0.5610578", "0.5610578", "0.5610578", "0.5610578" ]
0.70250523
0
Devuelve el valor del campo nota
public function getNota(){ return $this->nota; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNota()\n {\n return $this->nota;\n }", "public function establecerValor()\n {\n if( $this->sistema->configuracion->activados(Configuracion::DEFINIR_VALORES_AL_VALIDAR) ) {\n $this->campo->valor = $this->sistema->datos[$this->campo->clave()] ?? null;\n }\n }", "public function getFieldValue(): string;", "public function getFieldValue() : string;", "private function campo(){}", "public function getValor($atributo){//retornar algún valor\n \treturn $this->$atributo;\n }", "public function getDataNota() {\n return $this->oDataNota;\n }", "function value($field){\r\n $field=empty($field) ? \"\" : htmlutf8($this->data[$field]);\r\n return $field;\r\n /*\r\n if (empty($field)) {\r\n return \"\";\r\n }\r\n return htmlutf8($this->data[$field]);\r\n */\r\n }", "function setValorNota($nValorNota) {\n $this->oObjCalculo->setValorNota($nValorNota);\n }", "public function getValorAttribute()\n {\n return str_replace('.','',$this->monto);\n }", "public function getIdNota()\n {\n return $this->id_nota;\n }", "public function obterValor(){\n return $this->valor;\n }", "public function getAsistenciaValue()\n {\n return $this->asistenciaValue;\n }", "public function getEditableValue();", "protected function valor_telefone($valor){\r\n\t\tif(strlen($valor) > 0){\r\n\t\t\t$valor = removeformat($valor);\r\n\t\t}\r\n\t\treturn $valor;\r\n\t}", "public function getValor() {\n return $this->nValor;\n }", "public function setNota($nota){\n\t\t$this->nota = $nota;\n\t}", "public function toDbFieldValue();", "public function getNumeroNota() {\n return $this->iNumeroNota;\n }", "public function getValor();", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getValor()\n {\n return $this->valor;\n }", "public function getNullValue() {}", "public function getFieldValue()\n {\n return $this->field_value;\n }", "public function getTextValue()\n\t{\n\t\treturn NULL;\n\t}", "public function message()\n {\n return 'O campo :attribute é uma data de nascimento inválida.';\n }", "public function value($field);" ]
[ "0.69147104", "0.6626484", "0.65020245", "0.64462173", "0.6362862", "0.6330397", "0.62791103", "0.6246506", "0.62329274", "0.6216132", "0.62006724", "0.6141432", "0.61272925", "0.609224", "0.6015242", "0.600383", "0.5980603", "0.5977072", "0.5965953", "0.5952363", "0.5923282", "0.5923282", "0.5923282", "0.5923282", "0.5923282", "0.590088", "0.58963656", "0.58825916", "0.58710635", "0.5869903" ]
0.7045319
0
Get logId for current http request
public static function logId() { return SLog::getInstance()->logId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function logId()\r\n {\r\n return self::getInstance()->intLogId;\r\n }", "public function getLogId()\n {\n return $this->log_id;\n }", "public function getLogId() {\n return $this->log_id;\n }", "function getId() {\n return $this->log->getId();\n }", "public function getID () {\n\t\treturn $this->log_id;\n\t}", "public function getIdLog() \n\t{\n\t\treturn $this->idLog;\n\t}", "public function getID () {\n\t\treturn $this->idLog;\n\t}", "public function getLogContainerId()\n\t{\n\t\treturn $this->getId() . '_log';\n\t}", "public function getLogId(){\n\n }", "public function getLogUserId()\n {\n return $this->log_user_id;\n }", "static function _log_request($market, $account, $api, $request){\n if(!self::$_logging) return true;\n $log_position = ROOT.\"/log/api.log\";\n $id = 0;\n // Log request parameters and fetch log id\n\n return $id;\n }", "public function getLogRequestsIncomingId(): int\n {\n return $this -> log_requests_incoming_id;\n }", "public function getActionlogsId()\n {\n return $this->actionlogs_id;\n }", "public function getLogTypeId()\n {\n return $this->log_type_id;\n }", "public static function requestId()\n {\n return \\uniqid(\\home_url(), false);\n }", "function getBaseLog(){\t\t\n\t\tif(!isset($_REQUEST['appid'])\n\t\t\t||!isset($_REQUEST['event'])\n\t\t\t||!isset($_REQUEST['uid'])) throw new Exception(\"no appid or event or uid\");\n\t\tif(isset($_REQUEST['timestamp']))\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\telse \n\t\t\t$timestamp = $_SERVER['REQUEST_TIME'];\n\t\t$log=$_REQUEST['appid'].\"\\t\".$_REQUEST['uid'].\"\\t\".$_REQUEST['ref'].\n\t\t\t\"\\t\".$_REQUEST['event'].\"\\t\".$_REQUEST['json_var'].\"\\t\".$timestamp.\"\\n\";\n\t\t\n\t\tif ($_REQUEST ['event'] === \"user.visit\") {\n\t\t\t$ip = getIP ();\n\t\t\tif ($ip != false) {\n\t\t\t\t$log = $log . $_REQUEST ['appid'] . \"\\t\" . $_REQUEST ['uid'] . \"\\t\" . '' . \"\\t\" . \"user.update\" . \"\\t\" . '{\"geoip\":\"' . $ip . '\"}' . \"\\t\" . $timestamp . \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $log;\n\t}", "public function getSystemLogID() {\n\t\treturn $this->getGUID();\n\t}", "protected function _getRequestId()\n\t{\n\t\treturn !$this->_processor ? null : $this->_processor->getRequestId();\n\t}", "public function getLogToken() {\n\t\treturn $this->logToken;\n\t}", "private static function _getLogThread() {\n\t\tif(!self::$_log_thread) {\n\t\t\ttry {\n \t\t\t// Generate a version 5 (name-based and hashed with SHA1) UUID object\n \t\t\t$uuid5 = Uuid::uuid4();\n\t\t\t\tself::$_log_thread = $uuid5->toString();\n\n\t\t\t} catch (UnsatisfiedDependencyException $e) {\n\t\t\t\t\n\t\t\t\tself::$_log_thread = uniqid('log_thread',true);\n\t\t\t\t\n\t\t\t}//end catch\n\t\t\t\n\t\t}\n\t\t\n\t\treturn self::$_log_thread;\n\t}", "public function log()\n {\n $request = A::getMainApp()->request;\n $response = A::getMainApp()->response;\n\n $log = array(\n 'ip' => CommonHelpers::getIp(),\n 'client_puk' => $request->puk,\n 'query' => $request->fullUri,\n 'module' => $request->module,\n 'action' => $request->action,\n 'params' => serialize($request->params),\n 'response_code' => $response->code,\n 'response_message' => $response->message,\n );\n\n $db = new MainDb();\n return $db->insert('logs', $log);\n }", "public function getRequestID()\n {\n if (null==$this->_requestID) {\n $this->_requestID = $this->createRequestID();\n }\n return $this->_requestID;\n }", "abstract protected function logRequestUrl();", "public static function getId()\n {\n $id = str_replace('/', '-', $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);\n return $id;\n\n }", "public function getLastRequestId()\n\t{\n\t\treturn $this->_lastRequestId;\n\t}", "abstract protected function getRequestUrlLogData();", "public function logs_get_last_local_event_id()\n {\n $statement = $this->db->prepare('SELECT MAX(id) FROM '.self::LOG_TABLE_NAME);\n $success = $statement->execute();\n if(!$success) {\n $this->log(EventType::LOGGER, LogLevel::CRITICAL, __FUNCTION__ . \" failed\", array(\"RecorderLogger\"));\n return 0;\n }\n $results = $statement->fetch(PDO::FETCH_NUM);\n $maxId = $results[\"0\"];\n return $maxId;\n }", "function getStoreLog(){\n\t\tif(!isset($_REQUEST['appid']))throw new Exception(\"no appid\");\n\t\tif(!isset($_REQUEST['log']))throw new Exception(\"no log\");\n\t\t$log = $this->addAppidForStoreLog($_REQUEST['log']);\n\t\treturn $log.\"\\n\";\n\t}", "protected function _detectId()\n {\n return $_SERVER['REQUEST_URI'];\n }", "private static function get_tid() {\n return Config::get('analytics.id');\n }" ]
[ "0.7771088", "0.75176895", "0.75077647", "0.7271315", "0.7092681", "0.7035768", "0.6901806", "0.6690121", "0.6569086", "0.6498782", "0.64706177", "0.62748146", "0.6235611", "0.62209564", "0.6147006", "0.61225563", "0.6113919", "0.60873216", "0.6064586", "0.6041921", "0.6036701", "0.5942498", "0.59332", "0.5914603", "0.58806485", "0.58729", "0.5864316", "0.58596057", "0.5854436", "0.58509547" ]
0.76726633
1
saber si existe un usuario en la DB le pasas la tabla donde tiene que buscar, campo en la tabla, y la condicion. id_where es el campo y $id_registro es lo que tiene que cumplir.
function si_existe($id_tabla,$tabla,$id_where,$id_registro){ $conn = conexion(); $sql = " select $id_tabla from $tabla where $id_where='$id_registro'"; $existe = null; if($rs = $conn->query($sql)){ if($rs->num_rows>0){ $existe = true; }else $existe = false; } return $existe; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function registroAltaContrato($id_contrato, $id_usuario, $tipo_usuario, $nombre_servicio){\n $usuario_row = Usuario::obtenUsuarioId($id_usuario);\n $tipo_usu_upper = strtoupper($tipo_usuario);\n $nombre = $usuario_row->getNombre();\n $fecha_registro = date('Y-m-d H:i:s');\n $texto_fecha = substr($fecha_registro, 0, 10);\n $texto_hora = substr($fecha_registro, 11);\n $texto_registro = 'ALTA-CONTRATO:' . $nombre_servicio . ';USUARIO-' . $tipo_usu_upper .\n ':' . $nombre . ';FECHA-HORA:' . $fecha_registro . ':' . $texto_fecha . ' a las ' .\n $texto_hora;\n $tabla = 'registros';\n //conectamos a la base de datos\n $dbh = BD::conectar();\n //creamos la sentencia SQL para insertar el registro\n $sql = \"INSERT INTO $tabla (\n fecha_registro,\n texto_registro,\n id_servicio,\n id_informe,\n id_contrato,\n id_anuncio)\n VALUES (\n :fecha_registro,\n :texto_registro,\n NULL,\n NULL,\n :id_contrato,\n NULL)\";\n //creamos los parámetros\n $parametros = array(\n ':fecha_registro' =>$fecha_registro,\n ':texto_registro' => $texto_registro,\n ':id_contrato' => $id_contrato\n );\n $insert = $dbh->prepare($sql);\n $registro = $insert->execute($parametros);//número de registros afectados\n return $registro;\n }", "public function ingresoUsuarioModel($datosModel, $tabla){\n\t\t//se obtiene el correo que sera la condicion con la que se buscara\n\t\t$e = $datosModel[\"correo\"];\n\t\t//Se prepara la consulta\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla WHERE email = '$e' AND eliminado=0\");\n\t\t//Se ejecuta la consulta\n\t\t$stmt->execute();\n\t\t//Se retorna la fila si es que existe\n\t\treturn $stmt->fetch();\n\t\t//se cierra la consulta\n\t\t$stmt->close();\n\n\t}", "function retorne_usuario_seguindo($idamigo, $idusuario){\n\n// tabela\n$tabela = TABELA_SEGUIDORES;\n\n// verifica se e o proprio usuario\nif($idamigo == $idusuario){\n\n// retorno nulo\nreturn null;\n\n};\n\n// query\n$query = \"select *from $tabela where idusuario='$idusuario' and idamigo='$idamigo';\";\n\n// retorno\nif(retorne_numero_linhas_query($query) == 1){\n\n// seguidor\nreturn 1;\n\n}else{\n\n// nao seguidor\nreturn 2;\n\n};\n\n}", "function valida_existe_usuario($conexion, $usuario) {\n //Creamos un array que contendrá todos los errores para posteriormente mostrarlos al usuario.\n $errores = array();\n $select = \"SELECT Usuario FROM usuario WHERE Usuario like ?\";\n //Preparamos consulta sql.\n $statement = mysqli_prepare($conexion, $select);\n //Agregamos variables a la consulta sql, pasados como parametros.\n mysqli_stmt_bind_param($statement,'s', $usuario);\n //Ejecutamos la sentencia.\n mysqli_stmt_execute($statement);\n //Transfiere un conjunto de resultados desde una sentencia preparada (SELECT, SHOW, DESCRIBE, EXPLAIN), y únicamente si se quiere almacenar en buffer el conjunto de resultados completo en el cliente. \n mysqli_stmt_store_result($statement);\n //Devuelve el número de filas de un conjunto de resultados de una sentencia\n $count = mysqli_stmt_num_rows($statement);\n //Cerramos la sentencia.\n mysqli_stmt_close($statement);\n //Si la sentencia ha producido un numero de filas mayor a 0 el usuario es repetido y devolvemos el campo y mensaje de error.\n if ($count > 0) {\n //Creamos un array que contendrá el campo y el error referidos al al usuario repetido.\n $errorUsuRepetido = array();\n $errorUsuRepetido['campo'] = \"usuarioRe\";\n $errorUsuRepetido['mensaje'] = \"Lo siento, el usuario que usted ha escogido ya existe. Pruebe con otro distinto\";\n array_push($errores, $errorUsuRepetido);\n }\n return $errores;\n }", "public function iniciarSesion($id, $contrasenia){\n if ((!isset($id) || strlen($id) == 0) || (!isset($contrasenia) || strlen($contrasenia) == 0)){\n throw new Exception(\"Alguno de los parametros recibidos esta vacío\");\n }\n // Genero la consulta\n // SELECT u.nickname FROM usuario u WHERE ( u.nickname = $id OR u.email = $id ) AND u.contrasenia = $contrasenia \n $this->db->select('u.nickname')->from('usuario u')\n ->group_start()\n ->where('u.nickname', $id)\n ->or_where('u.email', $id)\n ->group_end()\n ->where('u.contrasenia', $contrasenia)\n ->where('u.verificado', true);\n // ejecuto la query\n $result = $this->db->get();\n\n if ($result->num_rows() == 1){\n $r = $result->row();\n $resultNick = $r->nickname;\n return $resultNick;\n }else{\n return NULL;\n }\n }", "function consultarId(){\n\n $stmt = $this->db->prepare(\"SELECT *\n\t\t\t\t\tFROM usuario\n\t\t\t\t\tWHERE login = ? \");\n $stmt->execute(array($this->login));\n $resultado = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if($resultado != null){\n return $resultado['usuario_id'];\n }else{\n return 'No existe el usuario en la BD';\n }\n }", "function validaDatosRegistro($usuario,$correo){\n\t\t$sql=\"select Usuario from $this->tbname where Usuario =?\";\n\t\t$resultado=$this->base->prepare($sql);\n\t\t$resultado->execute(array($usuario));\n\t\t$registro=$resultado->fetch(PDO::FETCH_ASSOC);\n\t\t$resultado->closeCursor(); \n\t\tif($registro==null){\n\t\t\t$sql=\"select Email from $this->tbname where Email =?\";\n\t\t\t$resultado=$this->base->prepare($sql);\n\t\t\t$resultado->execute(array($correo));\n\t\t\t$registro=$resultado->fetch(PDO::FETCH_ASSOC);\n\t\t\t$resultado->closeCursor(); \n\t\t\tif($registro==null){\n\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "function ConsultaID(){\r\n // $query = \"SELECT ID_Usuario, US_Nombres, US_Apellidos, US_Direccion, US_Fecha_Nacimiento, US_Nacionalidad, US_Telefono, US_Email FROM \" . $this->table_name . \" WHERE ID_Usuario = ?\";\r\n $query = \"SELECT\r\n `ID_Usuario`, `US_Nombres`, `US_Apellidos`, `US_Direccion`, `US_Fecha_Nacimiento`, `US_Nacionalidad`, `US_Telefono`, `US_Email`\r\n FROM\r\n \" . $this->table_name . \" \r\n WHERE\r\n ID_Usuario='\".$this->ID_Usuario.\"'\";\r\n $stmt = $this->conn->prepare($query);\r\n // execute query\r\n $stmt->execute();\r\n return $stmt;\r\n }", "public function existeUsuario(){\n $query = \"SELECT * FROM \". self::$tabla . \" WHERE email = '\" . $this->email . \"' LIMIT 1\";\n\n $resultado = self::$db->query($query);\n\n if (!$resultado->num_rows) { //num bows es mi indicativo para saber si hay resultados o no\n self::$errores[] = 'El usuario no existe';\n return; //para que el codigo deje de ejecutarse\n }\n return $resultado; //en caso de no existir un error retorna el resultado\n\n\n }", "public function Buscar(){\n // $usuario = new Usuario(null, null, $email, null, null, null, null); \n // $find = $this->daoUsuario->buscarPorId($usuario); \n // if($find){\n // echo(\"ok\");\n // }else{\n // echo(\"error\");\n // }\n }", "public static function tblhistoricodeelimi($email,$nombre,$apellido,$nivel,$tabla,$registro,$idRegistro,$fchcreacion,$emailusuacreo,$emailusuaelimino){\n\n\t \t//??OBTENER TODO EL REGISTRO QUE SE VA A ELIMINAR\n\t \t/*\n\t \t$consulta = \"SELECT * FROM $tabla WHERE $nombreIdRegistro = ?\";\n\t\t\n\t\ttry{\n\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n\t\t\t$resultado->bindParam(1,$idRegistro,PDO::PARAM_INT);\n\t\t\t$resultado->execute();\n\t\t\t$registroCompleto= $resultado->fetchAll(PDO::FETCH_ASSOC);\n\t\t\tforeach ($resultado as $row) {\n\t\t \t$row[\"Id\"];\n\t\t }\n\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t \t\n\t \t//\n \n $insert =\"INSERT INTO tblhistoricodeelimi (tblhistoricodeelimi_email,tblhistoricodeelimi_nombre,tblhistoricodeelimi_apellido,tblhistoricodeelimi_nivel,tblhistoricodeelimi_tabla,tblhistoricodeelimi_registro,tblhistoricodeelimi_idRegistro,tblhistoricodeelimi_fchcreacion,tblhistoricodeelimi_fchelimino,tblhistoricodeelimi_emailusuacreo,tblhistoricodeelimi_emailusuaelimino) VALUES (?,?,?,?,?,?,?,?,NOW(),?,?)\"; \n \n try{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($insert);\n\t\t\t$resultado->bindParam(1,$email,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(2,$nombre,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(3,$apellido,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(4,$nivel,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(5,$tabla,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(6,$registro,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(7,$idRegistro,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(8,$fchcreacion,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(9,$emailusuacreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(10,$emailusuaelimino,PDO::PARAM_STR);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->rowCount(); //retorna el numero de registros afectado por el insert\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n }", "public function ingresoUsuarioModel($datosModel, $tabla){\n\t\t//Se almacenan los datos del array datosModel en variables separadas\n\t\t$u = $datosModel[\"usuario\"];\n\t\t$c = $datosModel[\"contra\"];\n\t\t//Se prepara la consulta\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla WHERE usuario = '$u' AND pass = '$c' AND eliminado=0\");\n\t\t//Se ejecuta la consulta\n\t\t$stmt->execute();\n\t\t//Se retorna la fila si es que existe\n\t\treturn $stmt->fetch();\n\t\t//se cierra la consulta\n\t\t$stmt->close();\n\n\t}", "function RellenaDatos()\n\t\t{\n\t\t $sql = \"SELECT * FROM CLASH WHERE (id_enfrentamiento = '$this->id_enfrentamiento') && (id_campeonato = '$this->id_campeonato')\";\n\t\t // Si la busqueda no da resultados, se devuelve el mensaje de que no existe\n\t\t if (!($resultado = $this->bd->query($sql))){\n\t\t\t\treturn 'No existe en la base de datos'; // \n\t\t\t}\n\t\t else{ // si existe se devuelve la tupla resultado\n\t\t\t\t$result = $resultado->fetch_array();\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}", "function recordusuarioperfilstandar($idusuario){\n\n /*Verificamos que el perfil ya se encuentre registrado*/\n $query_select =\"SELECT * FROM usuario_perfil WHERE idusuario='\".$idusuario.\"' AND idperfil = '1' \";\n $result_select = $this->db->query($query_select); \n $exist = $result_select->num_rows();\n \n /*Si ya existe no lo registramos*/ \n if ($exist == 1) {\n return true;\n }else{\n /*Registramos*/\n $query_record =\"INSERT INTO usuario_perfil VALUES ('\".$idusuario.\"' , '1')\"; \n $result = $this->db->query($query_record); \n return $result; \n }\n\n }", "function comprobarRegistro(){\n\n\t\t$sql = \"SELECT * FROM USUARIO WHERE login = '$this->login'\";\n\n\t\t$result = $this->mysqli->query($sql);\n\t\t$total_tuplas = mysqli_num_rows($result);\n\n\t\tif ($total_tuplas > 0){ // esi hay mas de 0 tuplas, existe ya el usuarios\n\t\t\t$this->lista['mensaje'] = 'ERROR: El usuario ya existe';\n\t\t\treturn $this->lista;\n\t\t\t}\n\t\telse{\n\t \treturn true; //no existe el usuario\n\t\t}\n\n\t}", "static public function mdlRegistroUsuario($tabla,$datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla( \n\t\t\t NombreUsu,ApellidoUsu,DNI,CorreoUsu,claveUsu,fotoUsu,EstadoUsu,idTipo,verificacion,modo,emailEncriptado)\n\t\tVALUES(:NombreUsu,:ApellidoUsu,:DNI,:CorreoUsu,:claveUsu,:fotoUsu,:EstadoUsu,:idTipo,:verificacion,:modo,:emailEncriptado)\");\n\n\t\t$stmt->bindParam(\":NombreUsu\", $datos[\"NombreUsu\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":ApellidoUsu\", $datos[\"ApellidoUsu\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":DNI\", $datos[\"DNI\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":CorreoUsu\", $datos[\"CorreoUsu\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":claveUsu\", $datos[\"claveUsu\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fotoUsu\", $datos[\"fotoUsu\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":EstadoUsu\",$datos[\"EstadoUsu\"],PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":idTipo\",$datos[\"idTipo\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":verificacion\",$datos[\"verificacion\"],PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":modo\",$datos[\"modo\"],PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":emailEncriptado\", $datos[\"emailEncriptado\"], PDO::PARAM_STR);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "static public function mdlRegistroUsuario($tabla, $datos){\n\n\t\tdate_default_timezone_set(\"America/Argentina/Tucuman\");\n\n\t\t$fechaAltaUser= date('Y-m-d');\n\t\t$hora = date('H:i:s');\n\t\t$fechaAltaOK = $fechaAltaUser.' '.$hora;\n\t\t\t\t\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla (PersonaID, FechaAlta, NombreUsuario, Clave, Imagen, RolesID) VALUES (:personaId, :fechaAlta, :usuario, :clave, :ruta, :rolId)\");\n\n\t\t$stmt -> bindParam(\":personaId\", $datos[\"persona\"], PDO::PARAM_INT);\n\t\t$stmt -> bindParam(\":fechaAlta\", $fechaAltaOK, PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":usuario\", $datos[\"user\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":clave\", $datos[\"pass\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":ruta\", $datos[\"ruta\"], PDO::PARAM_INT);\n\t\t$stmt -> bindParam(\":rolId\", $datos[\"rol\"], PDO::PARAM_INT);\n\t\t\n\t\tif($stmt ->execute()){\n\n\t\t\treturn 'ok';\n\n\t\t} else {\n\n\t\t\t\t\n\t\t\treturn \"error usuario\";\n\n\t\t}\n\n\t\t#CERRAMOS LAS CONEXIONES CREADAS\n\t\t$stmt -> close();\n\t\t\n\t}", "function verificar($nombre,$id=\"\")\n {\n global $db;\n $sql = \" select count(*) as total from \".$this->table;\n $sql.= \" where login = '$nombre'\";\n if ($id != \"\")\n $sql.= \" and userId <> $id\";\n $db->SetFetchMode(ADODB_FETCH_ASSOC);\n\t\t$info = $db->execute($sql);\n if ($info->fields[\"total\"] == 0)\n return 0;\n else\n return 1;\n }", "function contratoVigente($usuario) {\n\t$params = array(\":usuario\" => $usuario);\n\t$sql =\n\t\t\"SELECT 1\n\t\t\t FROM web.wue_usuariosextranet, web.wuc_usuariosclientes, web.wcu_contratosxusuarios, aco_contrato, aem_empresa\n\t\t\tWHERE ue_id = uc_idusuarioextranet\n\t\t\t\tAND uc_id = cu_idusuario(+)\n\t\t\t\tAND cu_contrato = co_contrato(+)\n\t\t\t\tAND co_idempresa = em_id(+)\n\t\t\t\tAND (uc_esadmintotal = 'S' OR art.afi.check_cobertura(em_cuit, SYSDATE) = 1)\n/*\t\t\t\tAND (uc_esadmintotal = 'S' OR co_estado <> 6)*/\n\t\t\t\tAND ue_usuario = :usuario\";\n\t$result = existeSql($sql, $params);\n\n\tif (!$result) {\n\t\t$params = array(\":usuario\" => $usuario);\n\t\t$sql =\n\t\t\t\"SELECT 1\n\t\t\t\t FROM web.wue_usuariosextranet, web.wuc_usuariosclientes, web.wcu_contratosxusuarios, art.sex_expedientes\n\t\t\t\tWHERE ue_id = uc_idusuarioextranet\n\t\t\t\t\tAND uc_id = cu_idusuario\n\t\t\t\t\tAND cu_contrato = ex_contrato\n\t\t\t\t\tAND NVL(ex_causafin, ' ') NOT IN('02', '99', '95')\n\t\t\t\t\tAND ex_altamedica IS NULL\n\t\t\t\t\tAND ue_usuario = :usuario\";\n\t\t$result = existeSql($sql, $params);\n\t}\n\n\treturn $result;\n}", "function consultaUsuario($idUsuario = NULL) {\n $query = new Query();\n if (isset($idUsuario)) {\n $query->sql = \"SELECT id_administrador, nombre, nombre_usuario, correo FROM administrador WHERE status = 1 and id_administrador = $idUsuario\";\n } else {\n $query->sql = \"SELECT id_administrador, nombre, nombre_usuario, correo FROM administrador WHERE status = 1 ORDER BY id_administrador\";\n }\n\n $resultados = $query->select();\n\n if ($resultados) {\n return $resultados;\n } else {\n return NULL;\n }\n}", "public function creaRegistroUsuario($idusuario, $correo, $pass, $idPersona){\n\t\t\t//se crea la conexion\n\t\t\t$this->creaConexion();\n\t\t\t//creamos el query\n\t\t\t$consulta = \"INSERT INTO public.mv_usuario (id_usuario, correo, contrasenia, id_persona_usuario) VALUES($idusuario, '$correo', '$pass', $idPersona);\";\n\t\t\t//Enviamos la consulta\n\t\t\t$query = pg_query($this->conexion,$consulta) or die(-1);\n\t\t\t//tomamos el resultado\n\t\t\t$respQuery = pg_affected_rows($query);\n\t\t\t//retornamos elñ resultado\n\t\t\treturn $respQuery;\n\t\t}", "function usuarioexiste($usuario) {\n //Conectar base de datos\n $c = conectar();\n //Consulta sql cuantos usuarios hay con es nombre de usuario.\n $select = \"select count(id_usuario) as cuantos from login where usuario='$usuario';\";\n $resultado = mysqli_query($c, $select);\n $fila = mysqli_fetch_assoc($resultado);\n //Devuelve 0 si el usuario no existe o 1 si existe. No pueden haber más de 1.\n extract($fila);\n desconectar($c);\n return $cuantos;\n}", "function verificaEliminacionUsuario($correo, $usuario) {\n if (($id = consultaExistenciaParametro(\"nombre_usuario\", $usuario, false)) != NULL) {\n $query = new Query();\n// $query->delete(\"administrador\", \"id_administrador = $id\");\n $uniq = uniqid();\n $query->sql=\"UPDATE administrador set nombre_usuario = nombre_usuario || ' (Perfil desactivado:$uniq)', correo = correo || ' (Perfil desactivado:$uniq)', nombre = nombre || ' (Perfil desactivado)' where id_administrador = $id\";\n \n $query->update($query->sql);\n }\n\n if (($id = consultaExistenciaParametro(\"correo\", $correo, false)) != NULL) {\n $query = new Query();\n// $query->delete(\"administrador\", \"id_administrador = $id\");\n $uniq = uniqid();\n $query->sql=\"UPDATE administrador set nombre_usuario = nombre_usuario || ' (Perfil desactivado:$uniq)', correo = correo || ' (Perfil desactivado:$uniq)', nombre = nombre || ' (Perfil desactivado)' where id_administrador = $id\";\n echo $query->sql;\n $query->update($query->sql);\n }\n}", "function buscarRefeicao($nome_refeicao,$descricao_refeicao,$data_criacao,$id_ficha){\n try {\n $pdo=conexao();\n $stmt = $pdo->prepare(\"SELECT id_refeicao FROM refeicao WHERE nome_refeicao=:valor1 AND descricao_refeicao=:valor2 AND id_ficha=:valor3 AND data_criacao=:valor4 LIMIT 1\");\n $stmt->bindValue(\":valor1\",$nome_refeicao);\n $stmt->bindValue(\":valor2\",$descricao_refeicao);\n $stmt->bindValue(\":valor3\",$id_ficha);\n $stmt->bindValue(\":valor4\",$data_criacao);\n\n $stmt->execute();\n\n $users = $stmt->fetchAll(PDO::FETCH_ASSOC);\n foreach( $users as $user){\n $id_refeicao=$user['id_refeicao'];\n\n }\n if($users!= NULL){\n return $id_refeicao;\n }\n\n\n }catch (PDOException $ex){\n\n return $ex;\n }\n}", "public function buscarU($id){\n\t\t//Se prepara la consulta\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM usuarios WHERE id_usuario='$id'\");\n\t\t//se ejecuta la consulta\n\t\t$stmt->execute();\n\t\t//Se devuelve el registro encontrado\n\t\treturn $stmt->fetch();\n\t\t//Se cierra la consulta\n\t\t$stmt->close();\n\t}", "public function buscar() {\n $sentencia = $this->bd->prepare(\"SELECT * FROM usuario WHERE id_usuario = ?\");\n $sentencia->execute([$this->id]);\n $datos = $sentencia->fetch(\\PDO::FETCH_ASSOC);\n $this->poblar($datos);\n return $sentencia->rowCount() ? TRUE : FALSE;\n }", "static public function mdlValidarUsuario($datosModel, $tabla){\n\n\t\t$link = new PDO(\"mysql:host=localhost;dbname=db_delivery\",\"root\",\"\");\n\t\t$stmt = $link ->prepare(\"SELECT NombreUsuario FROM $tabla WHERE NombreUsuario = :nombreusuario \");\n\t\t$stmt ->bindParam(\":nombreusuario\", $datosModel, PDO::PARAM_STR);\n\t\t$stmt->execute();\n\t\treturn $stmt->fetch();\n\t\t$stmt->close();\n\n\t}", "function buscarByIdUsuario() //Devuelve una fila\n\t{\n\t\t$bd = new BaseDatos();\n\n\t\t//Ejecutar el metodo Conectar\n\t\t//y guardo la conexion\n\t\t$cnx = $bd->conectar();\n\n\t\t//Preparar la sentencia\n\t\t$stmt = $cnx->prepare(\"select * from usuario where id=:id\");\n\n\t\t//Enviar el parametro\n\t\t$stmt->bindValue(\":id\",$this->id);\n\n\t\t//Ejecutar la sentencia\n\t\t$stmt->execute();\n\n\t\t//Recuperar las filas\n\t\t$fila = $stmt->fetch();\n\n\t\t//Devolver la TABLA\n\t\treturn $fila;\n\n\t}", "public function consultarId($_id){\n $stmt = $this->_conn->prepare(\"SELECT * FROM ge_usuario WHERE id_usuario = :id\");\n $stmt->bindValue(\":id\", $_id);\n $stmt->execute();\n //retornar para cada usuario no banco, um usuario objeto\n while ($linha = $stmt->fetch()) {\n $usuario = new Usuario($linha[\"id_usuario\"]\n ,$linha[\"usuario\"]\n ,$linha[\"senha\"]\n ,$linha[\"nome\"]\n ,$linha[\"email\"]\n ,$linha[\"celular\"]\n ,$linha[\"telefone\"]\n ,$linha[\"ativo\"]\n ,$linha[\"id_ultimo_sinal\"]\n ,$linha[\"perfil\"]);\n }\n return $usuario;\n //fecha conexão\n //$this->_conn->__destruct();\n }", "function dimeidconcierto($nomconcierto) {\n //Conectar base de datos\n $c = conectar();\n //Consulta sql\n $select = \"select id_concierto from concierto where nombre='$nomconcierto';\";\n $resultado = mysqli_query($c, $select);\n desconectar($c);\n if ($fila = mysqli_fetch_assoc($resultado)) {\n //Devuelve el id de usuario\n $id_concierto = $fila['id_concierto'];\n return $id_concierto;\n } else {\n //Si el usuario no existe devuelve -1\n return -1;\n }\n}" ]
[ "0.6463314", "0.62698364", "0.6264648", "0.62482834", "0.62409574", "0.6227207", "0.6218852", "0.62044156", "0.6199943", "0.6178257", "0.6176883", "0.6160654", "0.61176234", "0.60976976", "0.60682905", "0.60653484", "0.60567296", "0.6050579", "0.6028784", "0.6001545", "0.59902364", "0.59801084", "0.59347284", "0.5932763", "0.59304065", "0.5919802", "0.588401", "0.5882325", "0.5881659", "0.5877876" ]
0.6910802
0
Redirect user to steam login page.
public function login() { return $this->steam->redirectToSteam(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirectToSteam()\n {\n return $this->steam->redirect();\n }", "public function redirectToSteam()\n {\n return $this->steam->redirect();\n }", "function _loginRedirect() {\n // send user to the login page\n header(\"Location:/login.php\");\n }", "public function redirectToLogin() {\n\n $tmp = explode( '.', $this->session->getStatus( 'tripple_login' ) );\n $map = array (\n Request::MOD => $tmp [0],\n Request::CON => $tmp [1],\n Request::RUN => $tmp [2] \n );\n $this->request->addParam( $map );\n \n if ('ajax' == $this->request->param( 'rqt', Validator::CNAME )) {\n $tmp = explode( '.', $this->session->getStatus( 'tripple_login' ) );\n // $this->tplEngine->setStatus( 401 );\n $this->tpl->redirectUrl = 'index.php?mod=' . $tmp [0] . '&amp;mex=' . $tmp [1] . '&amp;do=' . $tmp [2];\n }\n \n $this->main();\n \n }", "public function emulateLogin()\n {\n $from = (Input::get('target') != null) ? Input::get('target') : $this->getServerVariable('HTTP_REFERER');\n\n $this->sp->makeAuthRequest($from);\n $this->sp->redirect();\n }", "public function redirectToLogin()\n {\n $this->redirect('/auth/login');\n }", "public function login_redir(){\r\n\t\t//untuk mengecek apabila user tidak memiliki akses langsung diredirect ke halaman login\r\n\t\tif(!$this->cek_login())\r\n\t\t\theader(\"location:index.php\");\r\n\t}", "function login() {\n\t\theader( 'Location: ' . $this->login_slug );\n\t}", "function redirect_to_login(){\n ssf_redirect(\"accounts/login\");\n}", "function bbp_redirect_login($url = '', $raw_url = '', $user = '')\n{\n}", "public function redirectToProvider()\n {\n return Socialite::driver('steam')->redirect();\n }", "public static function redirectToLogin(){\n\t\tController::redirect(array(true,static::config('url_login'),'?'=>'back='.urlencode(CHttpRequest::getCurrentUrl())));\n\t}", "function onelogin_saml_auth_or_redirect()\n{\n global $user, $phpEx;\n $returnTo = generate_board_url() . '/';\n $returnTo .= request_var('redirect', $user->page['page']);\n onelogin_saml_instance()->requireAuth(array(\n 'ReturnTo' => $returnTo,\n ));\n}", "public function redirectToSteam(): RedirectResponse;", "function fake_login()\n\t{\n\t\t$this->redirect(array('action' => 'login'));\n\t}", "function login_redirect() {\n\t$_SESSION['auth_redirect'] = 'https://evescoutrescue.com'.htmlentities($_SERVER['PHP_SELF']);\n\theader(\"Location: ../auth/login.php\");\n\texit;\n}", "public function redirect()\n\t{\n\t\tglobal $_DB;\n\n\t\t// Get GroupMe API url\n\t\t$query = \"SELECT value\n\t\t\t\t FROM globals \n\t\t\t\t WHERE name = 'OAUTH_CALLBACK' \n\t\t\t\t LIMIT 1\";\n\n\t\t$url = $_DB['botstore']->doQueryAns($query, $params);\n\n\t\tif($url)\n\t\t{\n\t\t\t// Push user to GroupMe website for authentication\n\t\t\theader('Location: ' . $url);\n\t\t\tdie();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// No URL? That's bad.\n\t\t\t\\Thinker\\Http\\Redirect::error(500);\n\t\t}\n\t}", "public function quis() {\n redirect(base_url() . 'index.php/login');\n }", "public function testRedirectToLogin()\n {\n $this->printTestStartMessage(__FUNCTION__);\n $this->visit('/login')\n ->see('Login');\n }", "function redirect_login_page()\n {\n\n if (isset($this->db_settings_data['set_login_url'])) {\n $login_url = get_permalink(absint($this->db_settings_data['set_login_url']));\n\n $page_viewed = basename(esc_url_raw($_SERVER['REQUEST_URI']));\n\n if ($page_viewed == \"wp-login.php\" && $_SERVER['REQUEST_METHOD'] == 'GET') {\n wp_redirect($login_url);\n exit;\n }\n }\n }", "public function login()\n {\n $return_to = $this->input->get('return_to');\n $this->aad_auth->login($return_to === NULL ? site_url() : $return_to);\n }", "public function testLoginRedirect()\r\n\t{\r\n\t\t$user = Woodling::retrieve('User');\r\n\r\n\t\t// Retrieve credentials before saving, for plaintext password\r\n\t\t$params = array(\r\n\t\t\t'email'\t\t=> $user->email,\r\n\t\t\t'username'\t => $user->email,\r\n\t\t\t'password'\t => $user->password,\r\n\t\t);\r\n\r\n\t\t$user->save();\r\n\r\n\t\t// Login user\r\n\t\t$this->assertTrue(Confide::logAttempt($params));\r\n\r\n\t\t// Login page should redirect to home page\r\n\t\t$this->call('GET', 'user/login');\r\n\t\t$this->assertRedirectedTo('/');\r\n\t}", "public function testRedirectAfterLogin()\n {\n $faker = Faker::create();\n $password = $faker->password;\n\n $user = factory(CalculatieTool\\Models\\User::class)->create([\n 'secret' => Hash::make($password)\n ]);\n\n $this->visit('/account')\n ->type($user->username, 'username')\n ->type($password, 'secret')\n ->press('Login')\n ->seePageIs('/account');\n }", "public function loginAction()\n {\n if (isset($_GET['back-url'])) {\n $backUrl = $_GET['back-url'];\n } else {\n $backUrl = null;\n }\n View::renderTemplate('User::frontend/account/login.html', [\n 'back_url' => $backUrl\n ]);\n }", "public function auth()\n {\n try {\n if ($this->steam->validated()) {\n $this->authenticated($this->request, $this->steam->getPlayer());\n }\n } catch (Exception $e) {\n $this->error($e);\n }\n\n return $this->steam->previousPage();\n }", "public function login()\n {\n $steamId = $this->SteamOpenId->validate();\n if ($this->Users->find()->where(['steam_id' => $steamId])->isEmpty()) {\n $this->Users->register($steamId);\n }\n $user = $this->Users->find()->where(['steam_id' => $steamId])->first();\n $updated = intval($this->Users->updateSteamData($steamId));\n if ($updated == 2) {\n $this->Flash->error(__('Please make your profile public to login!'));\n return $this->redirect($this->Auth->logout());\n } else if ($updated == 3) {\n $this->Flash->error(__('Please set up your country on your steamprofile to log in!'));\n return $this->redirect($this->Auth->logout());\n } else if ($updated == false) {\n $this->Flash->error(__('Error while updating steamdata. Please contact support!'));\n return $this->redirect($this->Auth->logout());\n };\n $user = $this->Users->get($steamId);\n if ($user['role_id'] == 4) {\n $this->Flash->error(__('You are currently banned from this site!'));\n return $this->redirect($this->Auth->logout());\n }\n $this->Auth->setUser($user);\n return $this->redirect(['controller' => 'Lobbies', 'action' => 'home']);\n\n }", "public function requireLogin()\n {\n if(! Authenticate::getUser())\n {\n //echo \"got profile index<br/>\";\n Flash::addMessage('Please log in to access requested page');\n\n Authenticate::rememberRequestedPage();\n\n $this->redirect('/fyp/public/?Admin/Login/new');\n }\n }", "public function login()\n {\n return Socialite::driver( 'google' )\n ->with( [ 'hd' => 'tri.be' ] )\n ->redirect();\n }", "static function redirectLogin($message = null) {\n\t\t$args = array();\n\n\t\tif (isset($_SERVER['REQUEST_URI'])) {\n\t\t\t$args['source'] = $_SERVER['REQUEST_URI'];\n\t\t}\n\t\tif ($message !== null) {\n\t\t\t$args['loginMessage'] = $message;\n\t\t}\n\n\t\tRequest::redirect(null, 'login', null, null, $args);\n\t}", "public function redirect();" ]
[ "0.744114", "0.744114", "0.71766233", "0.7054257", "0.70430636", "0.6981076", "0.695269", "0.6944182", "0.69311666", "0.68283576", "0.68268687", "0.68189156", "0.6808486", "0.6767579", "0.674471", "0.66792536", "0.66602784", "0.66508824", "0.66139024", "0.6606236", "0.6582162", "0.6573308", "0.65624505", "0.65473753", "0.65448624", "0.65335", "0.6531343", "0.65195185", "0.6493307", "0.649241" ]
0.7750331
0
$this>db>where('nim_mhs', $nim)>update('mahasiswa', ['poin_mhs' => $sisa]);
public function updatePoinKompen($nim, $sisa) { $object = array('poin_mhs' => $sisa); $this->db->where('nim_mhs', $nim); $this->db->update('mahasiswa', $object); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatesiswa($data,$siswa,$nisn){\n $this->db->where('nisn', $nisn);\n\t\t$this->db->update($siswa,$data);\n\t}", "public function updateSiswa(){\n\t\tif(session()->get('level')!='admin'){\n\t\t\treturn redirect()->to('/petugas/dashboard');\n\t\t\texit;\t\t\n\t\t}\n\n\t\t$dataSiswa=[\n\t\t\t'nis'=>$this->request->getPost('txtInputNis'),\n\t\t\t'nama'=>$this->request->getPost('txtInputNama'),\n\t\t\t'id_kelas'=>$this->request->getPost('txtPilihanKelas'),\n\t\t\t'alamat'=>$this->request->getPost('txtInputAlamat'),\n\t\t\t'no_telp'=>$this->request->getPost('txtInputHandphone'),\n\t\t\t'id_spp'=>$this->request->getPost('txtPilihanTarif')\n\t\t];\n\n\t\t$this->siswa->update($this->request->getPost('txtInputNisn'),$dataSiswa);\n\t\treturn redirect()->to('/siswa');\n\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 redirect(site_url('siswa'));\n }", "public function update(Request $request)\n {\n // dd($request->id);\n // $doanvien_kn = qd_dv_ketnap::join('dv_ketnap','dv_ketnap.ID','=','qd_dv_ketnap.DV_KETNAP_ID')\n // ->where('qd_dv_ketnap.ID', $request->id)\n // ->select('qd_dv_ketnap.DOANVIEN_THANHNIEN_ID', 'dv_ketnap.NGAYKETNAP')\n // ->get();\n \n // $doanvien_thanhnien = doanvien_thanhnien::find('')\n $qd_dv_ketnap = qd_dv_ketnap::findOrFail($request->id);\n // dd($k, $k1);\n $student_id = qd_dv_ketnap::join('dv_ketnap','dv_ketnap.ID','qd_dv_ketnap.DV_KETNAP_ID')\n ->where('qd_dv_ketnap.ID', $request->id)\n ->select('qd_dv_ketnap.DOANVIEN_THANHNIEN_ID','dv_ketnap.NGAYKETNAP')\n ->first();\n// print_r($student_id);\n // dd($student_id);\n $qd_dv_ketnap->DUYET_KN = '1';\n $qd_dv_ketnap->save();\n\n $capnhat = doanvien_thanhnien::find($student_id->DOANVIEN_THANHNIEN_ID);\n $capnhat->NGAYVAODOAN_SV = $student_id->NGAYKETNAP;\n $capnhat->NOIVAODOAN_SV = 'Cần Thơ';\n $capnhat->save();\n\n //dd($student_id->DOANVIEN_THANHNIEN_ID);\n // $capnhat = 'update doanvien_thanhnien set doanvien_thanhnien.NGAYVAODOAN_SV = ' //+ $student_id->qd_dv_ketnap->NGAYKETNAP\n // + \"'2019/09/20'\"\n // + ' where ID = '+ $student_id->DOANVIEN_THANHNIEN_ID ;\n\n// $capnhat = \n \n\n Session::flash('capquyensuccess', 'Duyệt thành công^^');\n return redirect(route('qd_dv_ketnap.index'));\n }", "public function updateData(){\n $id = $_POST['id_jasa_desain'];\n $jenis_jasa_desain = $_POST['jenis_jasa_desain'];\n $tipe_desain = $_POST['tipe_desain'];\n $hasil = $this->db->query(\"UPDATE jasa_desain SET jenis_jasa_desain = ?, tipe_desain=? WHERE id_jasa_desain =? \", array($jenis_jasa_desain, $tipe_desain, $id));\n return $hasil;\n }", "public function update(){\n $query = \"UPDATE `manga` SET `nom`= :nom,`annee`= :annee,`genre`= :genre,`commentaire`= :commentaire,`id_utilisateur`= :id_utilisateur WHERE id_manga = :id_manga\";\n $result = $this->pdo->prepare($query);\n $result->bindValue(\"nom\", $this->nom, PDO::PARAM_STR);\n $result->bindValue(\"annee\", $this->annee, PDO::PARAM_INT);\n $result->bindValue(\"genre\", $this->genre, PDO::PARAM_STR);\n $result->bindValue(\"commentaire\", $this->commentaire, PDO::PARAM_STR);\n $result->bindValue(\"id_utilisateur\", $this->id_utilisateur, PDO::PARAM_INT);\n $result->bindValue(\"id_manga\", $this->id_manga, PDO::PARAM_INT);\n $result->execute();\n \n }", "function editSiswa($data){\n\t\t$data = $this->security->xss_clean($data);\n\t\t$data = $this->db->escape_str($data);\n\t\t$this->db->flush_cache();\n\t\t$this->db->where('nis',$data['nis']);\n\t\tif(!$this->db->update('siswa',$data)){\n\t\t\t$query=$this->db->error();\n\t\t\treturn $query['code'];\n\t\t}else {\n\t\t\t$query='0';\n\t\t\treturn $query;\n\t\t}\n\t}", "function update($pharmacie)\n {\n try{\n\n\n $st = $this->db->prepare('UPDATE pharmacie SET email = ?,location = ?,nompharmacie = ?,telephone = ? WHERE code_pharmacie = ?');\n $st->execute(array($pharmacie->getEmail(), $pharmacie->getLocation(),\n $pharmacie->getNompharmacie(),$pharmacie->getTelephone(),$pharmacie->getCodePharmacie()));\n if($st->rowCount() > 0){\n return true;\n echo \"Bien Modified\";\n }\n return false;\n }\n catch(PDOException $e){\n echo \"Error :\" .$e->getMessage();;\n }\n\n\n }", "public function update()\n\t{\n\t\t\t//\n\t\t\t$result[\"status\"] = \"error\";\n\t\t\t$result[\"message\"] = \"NIS tidak boleh kosong\";\n\t\t\n\t\t\tif($this->input->post('nis')!=\"\")\n\t\t\t{\n\t\t\t\t$this->db->select(\"nis\");\n\t\t\t\t$this->db->where(\"nis\",$this->input->post('nis'));\n\t\t\t\tif($this->db->get(\"siswa\")->num_rows()==0)\n\t\t\t\t{\n\t\t\t\t\t$this->db->where(\"replid\",$this->input->post('replid'));\n\t\t\t\t\t$this->db->update(\"siswa\",array(\"nis\"=>$this->input->post(\"nis\")));\n\t\t\t\t\t$result[\"status\"] = \"success\";\n\t\t\t\t\t$result[\"message\"] = \"NIS berhasil diubah\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$result[\"status\"] = \"error\";\n\t\t\t\t\t$result[\"message\"] = \"NIS sudah digunakan , gunakan NIS yang lain\";\n\t\t\t\t}\n\t\t\t}\n\t\t$this->M_API->JSON($result);\n\t\t\t\n\t}", "public function ubahDataPekerjaan()\n {\n $id = $this->input->post('id_mohon');\n $tanggal_pekerjaan = $this->input->post('tanggal_pekerjaan');\n $id_ulp = $this->input->post('id_ulp');\n $id_penyulang = $this->input->post('id_penyulang');\n $id_vendor = $this->input->post('id_vendor');\n $id_pegawai = $this->input->post('id_pegawai');\n $pekerjaan = $this->input->post('pekerjaan');\n\n\n $data = [\n \"tanggal_pekerjaan\" => $tanggal_pekerjaan,\n \"id_ulp\" => $id_ulp,\n \"id_penyulang\" => $id_penyulang,\n \"id_vendor\" => $id_vendor,\n \"id_pegawai\" => $id_pegawai,\n \"pekerjaan\" => $pekerjaan \n ];\n\n // $where= [\n // \"id_mohon\" => $id\n // ];\n\n $this->db->where('id_mohon', $this->input->post('id_mohon'));\n $this->db->update('tb_permohonan', $data);\n // var_dump($_POST);\n // die;\n }", "public function ch_jawaban($data) {\n $this->db->where('id_soal',$data['id_soal']);\n $this->db->update_batch('tb_piljawaban', $data['dataJawaban'], 'pilihan');\n }", "function updatePeminjaman($table,$kode,$data){\n\t\t$this->db->where('kode_peminjaman',$kode);\n\t\treturn $this->db->update($table,$data);\n\t}", "public function simpan_perubahan(){\n $query = \"update member set nama = '$this->nama', alamat = '$this->alamat', no_telp = '$this->no_telp'\n where id_member = $this->id_member\";\n $this->db->query($query);\n }", "public function update($id,$nis,$nama)\n {\n $siswa = Siswa::find($id);\n $siswa->nis = $nis;\n $siswa->nama = $nama;\n $siswa->kelas= 'XI-Tsm5';\n $siswa->jurusan= \"Teknik Sepeda Motor\";\n $siswa->alamat= \"Rancamanyar\";\n $siswa->tgl_lahir= '2002-12-28';\n $siswa->save();\n\n return $siswa;\n //\n }", "public function update(Request $request, Siswa $siswa)\n {\n $request->validate([\n 'nis' => 'required|size:5',\n 'nama' => 'required',\n 'kelas' => 'required',\n 'alamat' => 'required',\n ]);\n\n\n Siswa::where('id', $siswa->id)\n ->update([\n 'nis' => $request->nis,\n 'nama' => $request->nama,\n 'kelas' => $request->kelas,\n 'alamat' => $request->alamat,\n\n ]);\n return redirect('/siswa')->with('status', 'Data Siswa Berhasil Diubah!');\n }", "public function update(Request $request)\n {\n $mahasiswa = \\DB::table('mahasiswas')->select('nim')->where('nim',$request->input('nim'));\n $foto=$request->file('foto')->getClientOriginalName();\n $request->file('foto')->storeAs('public/upload',$foto);\n\n\n $mahasiswa->update( ['foto'=> $foto]); \n $mahasiswa->update( ['nama'=>$request->input('nama')]);\n $mahasiswa->update( ['alamat'=>$request->input('alamat')]);\n $mahasiswa->update( ['jurusan'=>$request->input('jurusan')]);\n $mahasiswa->update( ['jenis_kelamin'=>$request->input('jurusan')]);\n\n\n return back();\n }", "function get_update_pesanan($data = array(),$no_pesanan){\n \t\t$this->db->where('no_pesanan', $no_pesanan);\n \t\t$this->db->update('tpesanan', $data);\n \t\t$retVal = ($this->db->affected_rows()!=0) ? true : false ;\n \treturn $retVal;\n \t\t\n }", "function update_jeni($id_jenis,$params)\n {\n $this->db->where('id_jenis',$id_jenis);\n return $this->db->update('jenis',$params);\n }", "function update_katakunci($data, $where, $table)\n {\n $this->db->where($where);\n $this->db->update($table,$data);\n }", "function update_prodi($data_prodi) {\n\t\t\tglobal $con;\n\t\t\t\n\t\t\t$id_prodi = $data_prodi['id_prodi'];\n\t\t\t$id_jurusan = $data_prodi['id_jurusan']; \n\t\t\t$nama_prodi = $data_prodi['nama_prodi']; \n\t\n\t\t\tmysqli_query($con, \"update tb_prodi set id_jurusan='$id_jurusan', nama_prodi='$nama_prodi' where id_prodi='$id_prodi'\");\n\t\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablenombre.\" set nombre_prueba=\\\"$this->nombre\\\",curso_prueba=$this->curso,tema_prueba=$this->tema,num_preguntas_prueba=$this->numpreguntas,fecha_cierra_prueba=\\\"$this->fecha_cierra\\\",ver_resultado_prueba=$this->verresultados,asignatura_prueba=$this->asignatura,fecha_abre_prueba=\\\"$this->fecha_abre\\\",grado=$this->grado where id_prueba=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update(Request $request, Siswa $siswa,$id)\n {\n $getData = Siswa::find($id);\n \n $nama = $request->nama;\n $alamat = $request->alamat;\n \n $data = [\n 'nama' => $nama,\n 'alamat' => $alamat\n ];\n \n // $getData->nama = $nama;\n // $getData->alamat = $alamat;\n // $getData->save();\n $getData->update($data);\n return response()->json([\n 'message' => \"Data Berhasil Di ubah\",\n 'data' => $getData\n ]);\n }", "function update_entry($data)\n{\n $this->db->update('barang', $data, array('id_barang' => $data['id_barang']));\n }", "function update($matricula){\n $sql=\"UPDATE trabajadores set nombre='\".$this->nombre.\"',apellido_p='\".$this->apellidopat.\"',apellido_m='\".$this->apellidomat.\"' WHERE matricula='\".$matricula.\"'\";\n $this->model->query($sql);\n }", "function f_updatesiswaiuran($rs) {\n\t$q = \"\n\t\tupdate\n\t\t\tt0202_siswaiuran\n\t\tset\n\t\t\tP01 = '0', P02 = '0', P03 = '0', P04 = '0', P05 = '0', P06 = '0',\n\t\t\tP07 = '0', P08 = '0', P09 = '0', P10 = '0', P11 = '0', P12 = '0'\n\t\twhere\n\t\t\ttahunajaran_id = \".$rs[\"tahunajaran_id\"].\"\n\t\t\tand siswa_id = \".$rs[\"siswa_id\"].\"\";\n\tExecute($q);\n\n\t// ambil data pembayaran sesuai tahunajaran_id dan siswa_id\n\t$q = \"select * from v0301_bayarmasterdetail where\n\t\ttahunajaran_id = \".$rs[\"tahunajaran_id\"].\"\n\t\tand siswa_id = \".$rs[\"siswa_id\"].\"\";\n\t$r = Execute($q);\n\n\t// recordset dilooping hingga eof\n\twhile (!$r->EOF) {\n\t\tif (!is_null($r->fields[\"Periode1\"])) {\n\t\t\t$Periode1 = \"P\" . substr(\"00\" . $r->fields[\"Periode1\"], -2);\n\t\t\t$Periode1value = \n\t\t\t$q = \"update t0202_siswaiuran set \" . $Periode1 . \" = '1'\n\t\t\t\twhere iuran_id = \".$r->fields[\"iuran_id\"] . \" and siswa_id = \".$rs[\"siswa_id\"].\"\";\n\t\t\tExecute($q);\n\t\t}\n\t\tif (!is_null($r->fields[\"Periode2\"])) {\n\t\t\tfor ($i = $r->fields[\"Periode1\"]; $i <= $r->fields[\"Periode2\"]; $i++) {\n\t\t\t\t$Periode2 = \"P\" . substr(\"00\" . $i, -2);\n\t\t\t\t$q = \"update t0202_siswaiuran set \" . $Periode2 . \" = '1'\n\t\t\t\t\twhere iuran_id = \".$r->fields[\"iuran_id\"] . \" and siswa_id = \".$rs[\"siswa_id\"].\"\";\n\t\t\t\tExecute($q);\n\t\t\t}\n\t\t}\n\t\t$r->MoveNext();\n\t}\n}", "function update_data_kucing_gejalaKhusus1($optradio){\n\t\t\t\n\t\t\t\n\t\t\t$query = $this->db->query(\"UPDATE data_kucing SET demam = '$optradio'\");\n\t\t\t\n\t\t\treturn $query;\n\t\t\t}", "public function update(Request $request, $id)\n {\n try{\n $sp = SanPham::find($id);\n $sp->sp_ten = $request->sp_ten;\n $sp->lsp_ma = $request->lsp_ma; //trước giống tên cột sau giống tên input ở form nhập liệu\n $sp->hsx_ma = $request->hsx_ma; //trước giống tên cột sau giống tên input ở form nhập liệu\n $sp->sp_seri = $request->sp_seri; //trước giống tên cột sau giống tên input ở form nhập liệu\n $sp->sp_mota = $request->sp_mota; //trước giống tên cột sau giống tên input ở form nhập liệu\n $sp->sp_giagoc = $request->sp_giagoc; //trước giống tên cột sau giống tên input ở form nhập liệu\n $sp->sp_giaban = $request->sp_giaban; //trước giống tên cột sau giống tên input ở form nhập liệu\n $sp->sp_danhgia = $request->sp_danhgia; //trước giống tên cột sau giống tên input ở form nhập liệu\n $sp->sp_capnhat = Carbon::now(); //trước giống tên cột sau giống tên input ở form nhập liệu\n $sp->sp_trangthai = $request->sp_trangthai; //trước giống tên cột sau giống tên input ở form nhập liệu\n \n $sp->save();\n\n return redirect(route('sanpham.index')); //trả về trang cần hiển thị\n }\n catch(QueryException $ex){\n return reponse([\n 'error' => true, 'message' => $ex->getMessage()], 500);\n }\n }", "function updateSeguimiento($seguimiento_id, $data)\n\t{\n\t\t$this->db->where('seguimiento_id', $seguimiento_id);\n\t\t$this->db->update('seguimiento', $data);\t\n\t}", "function update_indemnite(Indemnite $annee_indemnite) {\n $connexion = get_connexion();\n $sql = \"UPDATE indemnite SET annee_indemnite=:annee_indemnite, tarifkilometrique_indemnite=:tarifkilometrique_indemnite\";\n\n try {\n $sth = $connexion->prepare($sql);\n $sth->execute(\n array(\n\n \":annee_indemnite\" => $indemnite_object->getAnnee_indemnite(),\n \":tarifkilometrique_indemnite\" => $indemnite_object->getTarifkilometrique_indemnite()\n\n ));\n \n } catch (PDOException $e) {\n throw new Exception(\"Erreur lors de la requête SQL : \" . $e->getMessage());\n }\n $nb = $sth->rowcount();\n return $nb; // Retourne le nombre de mise à jour\n}", "public function updatePerfil($nombre, $apellidos, $direccion, $telefono,$redes,$correo)\n{\n $sqlUpdate=\"UPDATE perfil SET nombre='\".$nombre.\"', apellidos='\".$apellidos.\"',direccion='\".$direccion.\"', telefono='\".$telefono.\"', redes_Sociales='\".$redes.\"', correo='\".$correo.\"' WHERE correo='\".$correo.\"'\";\n $this->realizarConsulta($sqlUpdate);\n\n}" ]
[ "0.74945956", "0.7184404", "0.7070516", "0.6933024", "0.6927892", "0.6897668", "0.68627185", "0.6811587", "0.6758701", "0.67380255", "0.6736869", "0.6686824", "0.6673514", "0.6649964", "0.6560996", "0.65579385", "0.6544913", "0.651419", "0.65088344", "0.65062106", "0.647978", "0.6465295", "0.64573", "0.6452431", "0.6450572", "0.6421588", "0.641559", "0.638522", "0.6383236", "0.63801247" ]
0.7536263
0
Loads the global unlock percentages of all achievements for the given game
public static function getGlobalPercentages($appId) { $params = ['gameid' => $appId]; $data = WebApi::getJSONObject('ISteamUserStats', 'GetGlobalAchievementPercentagesForApp', 2, $params); $percentages = []; foreach($data->achievementpercentages->achievements as $achievementData) { $percentages[$achievementData->name] = (float) $achievementData->percent; } return $percentages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_abilities(){\r\n\t$db = file_get_contents(\"abilities.json\");\r\n\t$json = json_decode($db);\r\n\r\n\t//prep the abilities; loop over them and calculate average effective dmg & dmg per tick\r\n\t//set a property on-cooldown to 0 for later\r\n\tforeach($json->abilities as $style){\r\n\r\n\t\tforeach($style as &$ability){\r\n\t\t\tif($ability->min_damage == false){\r\n\t\t\t\t$ability->min_damage = ($ability->max_damage * 0.20);\r\n\t\t\t}\r\n\r\n\t\t\t$ability->on_cd = 0;\r\n\t\t\t$ability->average_damage = (($ability->max_damage - $ability->min_damage)/2)+$ability->min_damage;\r\n\t\t\t$ability->tick_damage = $ability->average_damage / $ability->cast_duration;\r\n\t\t}\r\n\t}\r\n\r\n\treturn $json->abilities;\r\n}", "public function achievements ( $gamertag = FALSE, $game_id = FALSE )\n {\n if ( !$gamertag || !$game_id )\n return FALSE;\n\n return $this->fetch_data(\n $gamertag, // gamertag we wish to lookup\n 'achievements', // type of lookup\n $game_id // game id to lookup against\n );\n }", "public function getUserAchievements($steamid, $app_id) {\r\n $this->disableErrorChecking();\r\n \r\n $this->createRequest('get', \"/profiles/{$steamid}/stats/{$app_id}/achievements\", array(\r\n 'xml' => 1\r\n ));\r\n }", "function boss_profile_achievements() {\n\t\t\tglobal $user_ID;\n\n\t\t\t//user must be logged in to view earned badges and points\n\n\t\t\tif ( is_user_logged_in() && function_exists( 'badgeos_get_user_achievements' ) ) {\n\n\t\t\t\t$achievements = badgeos_get_user_achievements( array( 'user_id' => bp_displayed_user_id(), 'display' => true ) );\n\n\t\t\t\tif ( is_array( $achievements ) && !empty( $achievements ) ) {\n\n\t\t\t\t\t$number_to_show\t = 5;\n\t\t\t\t\t$thecount\t\t = 0;\n\n\t\t\t\t\twp_enqueue_script( 'badgeos-achievements' );\n\t\t\t\t\twp_enqueue_style( 'badgeos-widget' );\n\n\t\t\t\t\t//load widget setting for achievement types to display\n\t\t\t\t\t$set_achievements = ( isset( $instance[ 'set_achievements' ] ) ) ? $instance[ 'set_achievements' ] : '';\n\n\t\t\t\t\t//show most recently earned achievement first\n\t\t\t\t\t$achievements = array_reverse( $achievements );\n\n\t\t\t\t\techo '<ul class=\"profile-achievements-listing\">';\n\n\t\t\t\t\tforeach ( $achievements as $achievement ) {\n\n\t\t\t\t\t\t//verify achievement type is set to display in the widget settings\n\t\t\t\t\t\t//if $set_achievements is not an array it means nothing is set so show all achievements\n\t\t\t\t\t\tif ( !is_array( $set_achievements ) || in_array( $achievement->post_type, $set_achievements ) ) {\n\n\t\t\t\t\t\t\t//exclude step CPT entries from displaying in the widget\n\t\t\t\t\t\t\tif ( get_post_type( $achievement->ID ) != 'step' ) {\n\n\t\t\t\t\t\t\t\t$permalink\t = get_permalink( $achievement->ID );\n\t\t\t\t\t\t\t\t$title\t\t = get_the_title( $achievement->ID );\n\t\t\t\t\t\t\t\t$img\t\t = badgeos_get_achievement_post_thumbnail( $achievement->ID, array( 50, 50 ), 'wp-post-image' );\n\t\t\t\t\t\t\t\t$thumb\t\t = $img ? '<a style=\"margin-top: -25px;\" class=\"badgeos-item-thumb\" href=\"' . esc_url( $permalink ) . '\">' . $img . '</a>' : '';\n\t\t\t\t\t\t\t\t$class\t\t = 'widget-badgeos-item-title';\n\t\t\t\t\t\t\t\t$item_class\t = $thumb ? ' has-thumb' : '';\n\n\t\t\t\t\t\t\t\t// Setup credly data if giveable\n\t\t\t\t\t\t\t\t$giveable\t = credly_is_achievement_giveable( $achievement->ID, $user_ID );\n\t\t\t\t\t\t\t\t$item_class\t .= $giveable ? ' share-credly addCredly' : '';\n\t\t\t\t\t\t\t\t$credly_ID\t = $giveable ? 'data-credlyid=\"' . absint( $achievement->ID ) . '\"' : '';\n\n\t\t\t\t\t\t\t\techo '<li id=\"widget-achievements-listing-item-' . absint( $achievement->ID ) . '\" ' . $credly_ID . ' class=\"widget-achievements-listing-item' . esc_attr( $item_class ) . '\">';\n\t\t\t\t\t\t\t\techo $thumb;\n\t\t\t\t\t\t\t\techo '<a class=\"widget-badgeos-item-title ' . esc_attr( $class ) . '\" href=\"' . esc_url( $permalink ) . '\">' . esc_html( $title ) . '</a>';\n\t\t\t\t\t\t\t\techo '</li>';\n\n\t\t\t\t\t\t\t\t$thecount++;\n\n\t\t\t\t\t\t\t\tif ( $thecount == $number_to_show && $number_to_show != 0 && is_plugin_active('badgeos-community-add-on/badgeos-community.php') ) {\n\t\t\t\t\t\t\t\t\techo '<li id=\"widget-achievements-listing-item-more\" class=\"widget-achievements-listing-item\">';\n\t\t\t\t\t\t\t\t\techo '<a class=\"badgeos-item-thumb\" href=\"' . bp_core_get_user_domain( bp_displayed_user_id() ) . '/achievements/\"><span class=\"fa fa-ellipsis-h\"></span></a>';\n\t\t\t\t\t\t\t\t\techo '<a class=\"widget-badgeos-item-title ' . esc_attr( $class ) . '\" href=\"' . bp_core_get_user_domain( bp_displayed_user_id() ) . '/achievements/\">' . __( 'See All', 'social-learner' ) . '</a>';\n\t\t\t\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\techo '</ul><!-- widget-achievements-listing -->';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function achievements ( $player, $game) {\n\t\t$url = $this->api_url.\"/json/achievements/\".$game.\"/\".urlencode($player);\n\t\t$object = self::_request($url);\n\t\tif(!is_object($object) || ($object->Success != 1 && $object->Success != false)){\n\t\t\treturn FALSE;\n\t\t}\n\t\tif(isset($object->Game->Progress->LastPlayed)){\n\t\t\t\t$object->Game->Progress->LastPlayed = str_replace(\"/Date(\", \"\", str_replace(\")/\", \"\", $object->Game->Progress->LastPlayed));\n\t\t}\n\t\tforeach ($object->Achievements as $key => &$achievement) {\n\t\t\tif(isset($achievement->EarnedOn)){\n\t\t\t\t$achievement->EarnedOn = str_replace(\"/Date(\", \"\", str_replace(\")/\", \"\", $achievement->EarnedOn));\n\t\t\t}\n\t\t}\n\t\treturn $object;\n\t}", "function getAchievementList(&$db) {\n\t$rslt = mysql_query('SELECT * FROM pqr_achievements');\n\tif (!$rslt) die('access token error: '.mysql_error($db));\n\t\n\t$count = 0;\n\twhile ($row = mysql_fetch_array($rslt)){\n\t\t$accesslist[$count] = $row;\n\t\t$count++;\n\t}\n\t\n\treturn $accesslist;\n}", "public function getEarnedOverallAchievements($category = null)\n {\n $unlocked = count($this->getUnlockedAchievements($category));\n $total = count($this->checkerLocator->getTypes($category));\n\n return array(\n 'unlocked' => $unlocked,\n 'total' => $total,\n 'percent' => $unlocked == 0 ? 0 : round($unlocked/$total*100)\n );\n }", "function game_achievements ( $app_id ) {\n $query = GET_ACHIEVES . $app_id;\n// $stmt = $mysqli->prepare( GET_ACHIEVES );\n // $stmt->bind_param(\"s\"\n $result = mysql_query ( $query ) or die( \"Query Failed \" . mysql_error() );\n \n if( !$result ){\n echo \"<p><i>No achievements... yet</i></p>\";\n return;\n }\n // Print out achievements \n echo \"<ul>\";\n while( $a = mysql_fetch_array( $result, MYSQL_ASSOC )){\n echo \"<li>\";\n echo \"<a href='\" . ACHIEVEMENT . $a['title'] . \"&app=\". $this->app . \"'>\";\n echo \"<div class='achievement' id='\" . $a['title'] . \"'>\";\n echo \"<h3>\" . $a['title'] . \" \";\n echo \"<span id='point'>\" . $a['score'] . \" Points</span></h3>\";\n echo \"<p>\" . $a['description'] . \"</p>\";\n echo \"</div>\";\n echo \"</a>\";\n echo \"</li>\";\n }\n\n echo \"</ul>\";\n return;\n }", "function load_gameTotals($pGameType = NULL) {\n for ($i = 0; $i<$this->unfilteredKidCount; ++$i) {\n $curKid = $this->unfilteredKidArray[$i];\n if ($curKid != NULL) { // rare but kidperiod record can be hidden\n $curKid->per->KcmGamePoints = 0;\n } \n } \n $fieldList = \"*\";\n $sql = array();\n $sql[] = \"SELECT \".$fieldList;\n $sql[] = \"FROM `gp:gametotals`\";\n if ($this->loadPeriodId >= 1) {\n $sql[] = \"WHERE `gpGT:@PeriodId` ='\" . $this->loadPeriodId.\"'\";\n } \n else { \n $sql[] = \"WHERE `gpGT:@ProgramId` ='\" . $this->loadProgramId . \"'\";\n } \n if ($pGameType !== NULL) {\n $sql[] = \" AND `gpGT:GameTypeIndex` ='\".$pGameType.\"'\";\n }\n $query = implode( $sql, ' '); \n $result = $this->db->rc_query( $query );\n if ($result === FALSE) {\n kcm_db_CriticalError( __FILE__,__LINE__);\n }\n while($row = $result->fetch_array()) {\n $kidPeriodId = $row['gpGT:@KidPeriodId'];\n $kid = $this->getKidByKidPeriodId($kidPeriodId);\n if ($kid != NULL) { // rare but kidperiod record can be hidden\n $gameTypeIndex = $row['gpGT:GameTypeIndex'];\n $curTotals = $kid->ttt[$gameTypeIndex];\n $curTotals->db_readRow_gameTotals($row);\n switch ($gameTypeIndex) {\n case 0: $kid->per->KcmGamePoints += $curTotals->totWon * 10 + $curTotals->totDraw * 5;\n break;\n case 1: $kid->per->KcmGamePoints += $curTotals->totWon * 5 + $curTotals->totDraw * 3;\n break;\n case 2: $kid->per->KcmGamePoints += $curTotals->totWon * 3;\n break;\n }\n }\n }\n}", "public function getInProgressAchievements()\n {\n if (is_null($this->user)) {\n return array();\n }\n\n $types = $this->checkerLocator->getTypes();\n $userAchievements = $this->repository->findAchievements($this->user, $types, false);\n\n $tmp = array();\n foreach ($userAchievements as $userAchievement) {\n $listener = $this->checkerLocator->get($userAchievement->getAchievement());\n $listener->setUserAchievement($userAchievement);\n $progress = $listener->getUserAchievement()->getProgress();\n $total = $listener->getOptions()->getValue();\n $tmp[$listener->getOptions()->getId()] = (float) number_format($progress / $total * 100, 2);\n }\n\n arsort($tmp);\n\n $achievements = array();\n foreach ($tmp as $achievementId => $progress) {\n $listener = $this->checkerLocator->get($achievementId);\n $achievements[] = $listener;\n }\n\n return $achievements;\n }", "function load_final_grades() {\n global $CFG;\n\n $sql = \"SELECT g.id, g.itemid, g.userid, g.finalgrade, g.hidden, g.locked, g.locktime, g.overridden,\n gt.feedback, gt.feedbackformat,\n gi.grademin, gi.grademax\n FROM {$CFG->prefix}grade_items gi,\n {$CFG->prefix}grade_grades g\n LEFT JOIN {$CFG->prefix}grade_grades_text gt ON g.id = gt.gradeid\n WHERE g.itemid = gi.id\n AND gi.courseid = $this->courseid $this->userselect\";\n\n if ($grades = get_records_sql($sql)) {\n foreach ($grades as $grade) {\n $this->finalgrades[$grade->userid][$grade->itemid] = $grade;\n }\n }\n }", "public function achievements()\n\t{\n\t\treturn $this->has_many('Achievement');\n\t}", "public function get_achievements_array()\n\t{\n\t\treturn $this->ACHIEVEMENTS;\n\t}", "function getGameProgression()\r\n {\r\n // TODO: compute and return the game progression\r\n\r\n return 0;\r\n }", "public function calcPointsEarned($game)\n {\n $homeTeam = $game->getHomeTeam()->getReport();\n $awayTeam = $game->getAwayTeam()->getReport();\n \n if ($game->getReportStatus() == 'Reset')\n {\n $homeTeam->clrData();\n $awayTeam->clrData();\n return;\n }\n $this->calcPointsEarnedForTeam($game,$homeTeam,$awayTeam);\n $this->calcPointsEarnedForTeam($game,$awayTeam,$homeTeam);\n }", "public function getGroupCachePercent() {}", "function getGameProgression()\n {\n // TODO: compute and return the game progression\n\n return 0;\n }", "function getGameProgression()\n {\n // TODO: compute and return the game progression\n\n return 0;\n }", "public function getAllGrades() {\n\t\t$section = $this->assignment->section;\n\t\t$semester = $section->semester;\n\t\t$sectionId = $section->id;\n\n\t\t// Get the raw grade data\n\t\t$gradesTable = new Grades($this->assignment->site->db);\n\t\t$rawGrades = $gradesTable->getAssignmentGrades($semester, $sectionId, $this->assignment->tag);\n\n\t\t// Compute it for the user\n\t\t$grades = [];\n\n\t\tforeach($rawGrades as $memberId => $rawMemberGrades) {\n\t\t\t$grades[$memberId] = [];\n\n\t\t\t$memberGrades = [];\n\n\t\t\tforeach($this->gradeParts as $gradeItem) {\n\t\t\t\t$status = $gradeItem->createStatus($memberId, $rawGrades[$memberId]);\n\t\t\t\tif($status !== null) {\n\t\t\t\t\t$memberGrades[$gradeItem->tag] = $status;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$grade = $this->computeGrade($memberId, $rawGrades[$memberId]);\n\n\t\t\t$grades[$memberId] = [\n\t\t\t\t'grades'=>$memberGrades,\n\t\t\t\t'grade'=>$grade\n\t\t\t];\n\n\n\t\t}\n\n\t\treturn $grades;\n\t}", "public function achievements()\n {\n return $this->has_many_and_belongs_to('Achievement');\n }", "public function getAchievements() { return $this->Achievements; }", "public function setAchievements($steamId, $dB)\r\n {\r\n\r\n $appId = $this->getAppId();\r\n\r\n $achievementURL = 'http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/?appid=' . $appId . '&key=1DE926993382D94F844F42DD076A24BB&steamid=' . $steamId;\r\n $achievementData = curl_connect($achievementURL);\r\n $achievementOut = json_decode($achievementData);\r\n\r\n $achievementCount = 0;\r\n $hasAchieved = 0;\r\n\r\n foreach ($achievementOut->playerstats as $categories) {\r\n foreach ($categories as $achievements) {\r\n $apiname = $achievements->apiname;\r\n $achieved = $achievements->achieved;\r\n $achievementCount++;\r\n if ($achieved == 1) {\r\n $boolAchieved = true;\r\n $hasAchieved++;\r\n } else {\r\n $boolAchieved = false;\r\n }\r\n $achResult = mysqli_query($dB, \"INSERT INTO achievement(apiname)\r\n VALUES ('$apiname')\");\r\n\r\n $achId = mysqli_query($dB, \"SELECT achievement_id FROM achievement \r\n WHERE apiname LIKE '%$apiname%' LIMIT 1\")->fetch_object()->achievement_id;\r\n\r\n $achGame = mysqli_query($dB, \"INSERT INTO game_achievement(app_id, achievement_id)\r\n VALUES ('$appId','$achId')\");\r\n\r\n $achAppLink = mysqli_query($dB, \"INSERT INTO user_achievement(user_id, achievement_id, achieved)\r\n VALUES ('$steamId','$achId','$boolAchieved')\");\r\n }\r\n }\r\n $gameCompletionPercent = $hasAchieved / $achievementCount * 100;\r\n return $gameCompletionPercent;\r\n }", "public function getUnlockedAchievements($user_id){\n return $this->db->query(\"\n SELECT user.user_name, unlocked_achievements.user_id_ach, unlocked_achievements.ach_id_unlocked,\n user.user_id, achievements.ach_id, achievements.ach_name,\n achievements.ach_desc, achievements.ach_image, achievements.ach_value,\n achievements.ach_creator\n\n FROM user, achievements, unlocked_achievements\n WHERE user.user_id = unlocked_achievements.user_id_ach AND achievements.ach_id = unlocked_achievements.user_id_ach AND unlocked_achievements.user_id_ach = $user_id\n \");\n\n }", "function findAchievements ( PDO $pdo, $id ){\n $sql = \"SELECT u.*, uA.*, a.*\nFROM user as u\nINNER JOIN userAchiev as uA\nON u.id = uA.user_id\nINNER JOIN achievements as a\nON uA.achiev_id = a.a_user_id\nWHERE u.id = :id;\";\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam( ':id', $id, PDO::PARAM_INT );\n $stmt->execute();\n $results = [];\n while( $row = $stmt->fetchObject() ){\n $results[] = $row;\n }\n return $results;\n}", "function score()\n {\n access::ensure(\"scoring\");\n $achid = vsql::retr(\"SELECT id FROM achievements WHERE deleted = 0 AND \" . vsql::id_condition($_REQUEST[\"id\"], \"ground\"));\n insider_achievements::score(array_keys($achid));\n }", "protected function getUnlocksCountByButton()\n\t\t\t{\n\t\t\t\tif( $this->_unlocksCount !== false ) {\n\t\t\t\t\treturn $this->_unlocksCount;\n\t\t\t\t}\n\n\t\t\t\t$cache = get_site_transient('onp_sl_unlocks_count');\n\t\t\t\tif( $cache ) {\n\t\t\t\t\t$this->_unlocksCount = $cache;\n\n\t\t\t\t\treturn $this->_unlocksCount;\n\t\t\t\t}\n\n\t\t\t\tglobal $wpdb;\n\n\t\t\t\t$metrics = array(\n\t\t\t\t\t'unlock-via-facebook-like',\n\t\t\t\t\t'unlock-via-facebook-share',\n\t\t\t\t\t'unlock-via-twitter-tweet',\n\t\t\t\t\t'unlock-via-twitter-follow',\n\t\t\t\t\t'unlock-via-linkedin-share',\n\t\t\t\t\t'unlock-via-google-plus',\n\t\t\t\t\t'unlock-via-google-share',\n\t\t\t\t\t'email-received'\n\t\t\t\t);\n\n\t\t\t\t$metrics = apply_filters('onp_sl_achievement_popups_track_metrics', $metrics);\n\n\t\t\t\t$value = intval($wpdb->get_var(\"SELECT COUNT(*) FROM \" . $wpdb->prefix . \"opanda_stats_v2 WHERE metric_name='unlock'\"));\n\t\t\t\tif( $value > 10000 ) {\n\t\t\t\t\t$this->_unlocksCount = 'inf';\n\t\t\t\t\tset_site_transient('onp_sl_unlocks_count', $this->_unlocksCount, 60 * 60 * 12);\n\n\t\t\t\t\treturn $this->_unlocksCount;\n\t\t\t\t}\n\n\t\t\t\t$inClause = array();\n\t\t\t\tforeach($metrics as $metric)\n\t\t\t\t\t$inClause[] = \"'$metric'\";\n\t\t\t\t$inClause = implode(',', $inClause);\n\n\t\t\t\t$sql = \"SELECT SUM(metric_value) as total_count, metric_name \" . \"FROM \" . $wpdb->prefix . \"opanda_stats_v2 \" . \"WHERE metric_name IN ($inClause) GROUP BY metric_name\";\n\n\t\t\t\t$counts = $wpdb->get_results($sql, ARRAY_A);\n\n\t\t\t\t$result = array();\n\t\t\t\tforeach($counts as $row) {\n\t\t\t\t\t$result[$row['metric_name']] = $row['total_count'];\n\t\t\t\t}\n\n\t\t\t\tforeach($metrics as $metric) {\n\t\t\t\t\tif( !isset($result[$metric]) ) {\n\t\t\t\t\t\t$result[$metric] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->_unlocksCount = $result;\n\t\t\t\tset_site_transient('onp_sl_unlocks_count', $this->_unlocksCount, 60 * 60 * 12);\n\n\t\t\t\treturn $this->_unlocksCount;\n\t\t\t}", "public function getGlobalAbilities()\n {\n return $this->global_abilities;\n }", "function display_available_games ()\n{\n // restricted, then we're done\n\n $result = mysql_query ('SELECT SignupsAllowed FROM Con');\n if (! $result)\n return display_mysql_error ('Failed to get SignupsAllowed');\n\n $row = mysql_fetch_object ($result);\n if (\"Yes\" != $row->SignupsAllowed)\n return;\n\n // Get the max players for each game\n\n $sql = 'SELECT EventId,';\n $sql .= ' MaxPlayersMale + MaxPlayersFemale + MaxPlayersNeutral AS Players';\n $sql .= ' FROM Events';\n $sql .= ' WHERE SpecialEvent=0';\n $sql .= ' AND IsOps=\"N\"';\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error ('Failed to get player count', $sql);\n\n $max_players = array ();\n while ($row = mysql_fetch_object ($result))\n {\n $max_players[$row->EventId] = $row->Players;\n }\n\n//dump_array ('max_players', $max_players);\n\n // OK, now get the runs with the number of players signed up for each\n\n $sql = 'SELECT COUNT(*) AS Count,';\n $sql .= ' Events.EventId, Events.Title, Runs.Day, Runs.StartHour';\n $sql .= ' FROM Signup, Runs, Events';\n $sql .= ' WHERE Signup.State=\"Confirmed\"';\n $sql .= ' AND Signup.Counted=\"Y\"';\n $sql .= ' AND Runs.RunId=Signup.RunId';\n $sql .= ' AND Events.EventId=Runs.EventId';\n $sql .= ' AND Events.IsOps=\"N\"';\n $sql .= ' AND Events.IsConSuite=\"N\"';\n $sql .= ' AND Events.SpecialEvent=0';\n $sql .= ' GROUP BY Signup.RunId';\n $sql .= ' ORDER BY Runs.Day, Runs.StartHour';\n\n $result = mysql_query ($sql);\n if (! $result)\n return display_mysql_error ('Failed to get signedup counts', $sql);\n\n $header_shown = false;\n\n while ($row = mysql_fetch_object ($result))\n {\n//echo \"<!-- EventId: $row->EventId, Count: $row->Count, Title: $row->Title -->\\n\";\n\n if ($row->Count < $max_players[$row->EventId])\n {\n if (! $header_shown)\n {\n\t$header_shown = true;\n\techo \"<p><b>There are still openings in these great games!</b><br>\\n\";\n }\n\n printf (\"&#149;&nbsp;&nbsp;%s - %s&nbsp;%s<br>\\n\",\n\t $row->Title,\n\t $row->Day,\n\t start_hour_to_24_hour ($row->StartHour));\n }\n }\n echo \"<br>\\n\";\n}", "function getMyBadges()\n\t{\n\t\tglobal $dbc;\n\t\tglobal $fgmembersite;\n\t\tif(!$fgmembersite->CheckLogin())\n\t\t\treturn false;\n\t\t$q=mysqli_query($dbc,\"SELECT b.image_id FROM backpack b, people3 p WHERE p.id_user=b.id_user AND p.username='\".$_SESSION[$fgmembersite->GetLoginSessionVar()].\"'\");\n\t\twhile($row=mysqli_fetch_array($q,MYSQLI_ASSOC))$IDs[]=$row['image_id'];\n\t\t$q=mysqli_query($dbc,\"SELECT image_id,badge_name,badge_desc FROM images3 WHERE image_id IN (\".implode(',',$IDs).\")\");\n\t\t$badges=array();\n\t\twhile($row=mysqli_fetch_array($q,MYSQLI_ASSOC))array_push($badges,$row);\n\t\treturn $badges;\n\t}", "function getBonusUnlockCountByBadges($pid, $rank, $connection)\n{\n // Check if Minimum Rank Unlocks obtained\n if ($rank < Config::Get('game_unlocks_bonus_min'))\n return 0;\n\n // Are bonus Unlocks available?\n $level = (int)Config::Get('game_unlocks_bonus');\n if ($level == 0)\n return 0;\n\n // Define Kit Badges Array\n $kitbadges = array(\n 1031119, // Assault\n 1031120, // Anti-tank\n 1031109, // Sniper\n 1031115, // Spec-Ops\n 1031121, // Support\n 1031105, // Engineer\n 1031113 // Medic\n );\n\n // Count number of kit badges obtained\n $checkawds = implode(\",\", $kitbadges);\n $query = <<<SQL\nSELECT COUNT(`award_id`) AS `count` \nFROM `player_award` \nWHERE `player_id` = $pid \n AND (\n `award_id` IN ($checkawds) \n AND `level` >= $level\n );\nSQL;\n\n return (int)$connection->query($query)->fetchColumn(0);\n}" ]
[ "0.5834691", "0.58046347", "0.5792219", "0.56287014", "0.55898285", "0.55242443", "0.5500492", "0.54966366", "0.5444764", "0.52762294", "0.5259083", "0.52051055", "0.5153229", "0.51430917", "0.5140328", "0.51401246", "0.5140089", "0.5140089", "0.5118273", "0.50705135", "0.5056412", "0.50395906", "0.5034622", "0.4991258", "0.4950844", "0.49404064", "0.49313813", "0.4906351", "0.48941994", "0.4892416" ]
0.64229363
0
Returns the symbolic API name of this achievement
public function getApiName() { return $this->apiName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_name() {\n\t\treturn __( 'RapidAPI', 'jet-engine' );\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApiKeyName()\n\t{\n\t\treturn BrokerSubAccount::getById(InCache('sub_account_id'))->getAccountName();\n\t}", "public function getApName()\n {\n return $this->get(self::AP_NAME);\n }", "private function getApiName()\n {\n $name = $this->getConfig()->get('api.default', null); \n \n if ( is_null($name) ) {\n \n throw new Exception('An Api must be specified !');\n }\n \n return $name; \n }", "public function getName()\n\t{\n\t\t return Craft::t('Hop Alerts Fetch');\n\t}", "public static function getName(): string;", "public static function getName(): string;", "public static function getName(): string;", "public static function getName(): string;", "protected function _getApiCall() : string {\n return lcfirst((substr(static::class, strrpos(static::class, '\\\\') + 1)));\n }", "public function getInternalName();", "public function getModuleAPIName()\n {\n return $this->moduleAPIName;\n }" ]
[ "0.7006597", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.67024606", "0.66251916", "0.65412974", "0.6512092", "0.63047075", "0.63047075", "0.63047075", "0.63047075", "0.6275678", "0.62445307", "0.62443346" ]
0.71135557
0
Returns the url for the closed icon of this achievement
public function getIconClosedUrl() { return $this->iconClosedUrl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIconOpenUrl() {\n return $this->iconOpenUrl;\n }", "public function getIconUrl()\n {\n return $this->icon_url;\n }", "public function urlIcon(): string;", "public function getIconUrl()\n {\n return $this->iconUrl;\n }", "public function getIconUrl();", "function icon() {\n\t\t$url = $this->plugin_url();\n\t\t$url .= '/images/transmit_blue.png';\n\t\treturn $url;\n\t}", "public function getCheckoutIconUrl()\n {\n $url = $this->_getEndpoint(ApiEndpoints::ENDPOINT_GLOBAL_ASSETS).'/bambora_icon_64x64.png';\n\n return $url;\n }", "function getIconUrl() {\n return get_image_url('activity_log/comment.gif', RESOURCES_MODULE);\n }", "public function get_icon()\n {\n return 'fa fa-link';\n }", "public function pathImageOpening()\n {\n return asset('public/main/icons/projectPublish.png');\n }", "public function getIconUrl(): string\n {\n $result = '';\n $tokenDetails = $this->getTokenDetails();\n $iconForType = $this->getIconForType((string)$tokenDetails['type']);\n if (is_array($iconForType) && isset($iconForType['url'])) {\n $result = (string)$iconForType['url'];\n }\n\n return $result;\n }", "public function getIcon(): string;", "public function icon ( ) { return NULL; }", "public function get_icon()\n {\n return 'eicon-yoast';\n }", "public function getIcon() {}", "public function getIcon() {\n return strval($this->icon);\n }", "public static function iconPath()\n {\n return Craft::getAlias(\"@closum/closumconnector/assetbundles/configurationsutility/dist/img/Configurations-icon.svg\");\n }", "public function getIcon()\n {\n return $this->fields['icon'];\n }", "public function get_icon() {\n return 'astha far fa-images';\n }", "public function getIconAttribute()\n {\n if($this->team_id){\n return Storage::getUrl('team_icon',$this->team_id . \".png\");\n } else{\n return asset(\"img/icon.jpeg\");\n }\n }", "function getIcon()\n\t{\n return sotf_Blob::findBlob($this->id, 'icon');\n\t}", "public function icon()\n {\n return $this->getAttribute('icon');\n }", "public function getIcon()\n {\n if (!$this->icon) {\n return \"\";\n }\n return Html::get()->image($this->icon, $this->translate($this->label));\n }", "public static function iconPath()\n {\n return Craft::getAlias(\"@dfo/elasticraft/assetbundles/elasticraftutilityutility/dist/img/ElasticraftUtility-icon.svg\");\n }", "public function get_menu_icon() {\r\n\r\n\t\treturn file_get_contents( $this->get_base_path() . '/images/menu-icon.svg' );\r\n\r\n\t}", "public function getIcon();", "public function getIcon();", "public function get_icon()\n {\n return parent::get_icon();\n }", "public function getIcon()\n {\n return $this->icon;\n }", "public function relIconPath()\n {\n preg_match('/icons\\/.*/', $this->icon, $matches);\n\n return $matches[0];\n }" ]
[ "0.71082395", "0.6885687", "0.678096", "0.67621696", "0.66824937", "0.6602906", "0.6356286", "0.63522786", "0.6340476", "0.62658614", "0.6230608", "0.6228043", "0.6177102", "0.61742365", "0.6168404", "0.6150445", "0.61473244", "0.6116345", "0.6114816", "0.6086367", "0.60550183", "0.6052008", "0.60438496", "0.60415953", "0.59978664", "0.5991361", "0.5991361", "0.59867126", "0.59787303", "0.59764075" ]
0.8088906
0
Returns the url for the open icon of this achievement
public function getIconOpenUrl() { return $this->iconOpenUrl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function urlIcon(): string;", "public function getIconUrl()\n {\n return $this->icon_url;\n }", "public function getIconClosedUrl() {\n return $this->iconClosedUrl;\n }", "public function pathImageOpening()\n {\n return asset('public/main/icons/projectPublish.png');\n }", "public function getIconUrl()\n {\n return $this->iconUrl;\n }", "public function getIconUrl();", "function icon() {\n\t\t$url = $this->plugin_url();\n\t\t$url .= '/images/transmit_blue.png';\n\t\treturn $url;\n\t}", "public function get_icon()\n {\n return 'fa fa-link';\n }", "public function getCheckoutIconUrl()\n {\n $url = $this->_getEndpoint(ApiEndpoints::ENDPOINT_GLOBAL_ASSETS).'/bambora_icon_64x64.png';\n\n return $url;\n }", "function getIconUrl() {\n return get_image_url('activity_log/comment.gif', RESOURCES_MODULE);\n }", "public function getIconUrl(): string\n {\n $result = '';\n $tokenDetails = $this->getTokenDetails();\n $iconForType = $this->getIconForType((string)$tokenDetails['type']);\n if (is_array($iconForType) && isset($iconForType['url'])) {\n $result = (string)$iconForType['url'];\n }\n\n return $result;\n }", "public function get_icon() {\n\t\treturn 'eicon-call-to-action';\n\t}", "protected function getOpenGraphImage()\n {\n return '[IMAGE_URL]';\n }", "public function get_icon() {\n return 'astha far fa-images';\n }", "public function relIconPath()\n {\n preg_match('/icons\\/.*/', $this->icon, $matches);\n\n return $matches[0];\n }", "public function getFontAwesomeUrl()\n {\n if ($this->useCdn()) {\n $uri = \"//netdna.bootstrapcdn.com/font-awesome/%s/css/font-awesome%s\";\n } else {\n $uri = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)\n . 'frontend/base/default/ash_fontawesome/%s/css/font-awesome%s';\n }\n\n return sprintf($uri, $this->getVersion(), $this->_getFileExtension());\n }", "public function getIconURL($params = array()) {\n\t\treturn _elgg_services()->iconService->getIconURL($this, $params);\n\t}", "public function icon()\n {\n return $this->getAttribute('icon');\n }", "public function getIconWebPath(){\n\t\treturn \"/uploads/account/{$this->getId()}/{$this->getPhoto()}\";\n\t}", "public function get_icon()\n {\n return 'eicon-yoast';\n }", "public function getImageUrlIcon() \n {\n $icon = $this->icon;\n return Yii::$app->urlManager->baseUrl . '/admin/uploads/center/' . $icon;\n }", "public function get_menu_icon() {\r\n\r\n\t\treturn file_get_contents( $this->get_base_path() . '/images/menu-icon.svg' );\r\n\r\n\t}", "public function getIconAttribute()\n {\n if($this->team_id){\n return Storage::getUrl('team_icon',$this->team_id . \".png\");\n } else{\n return asset(\"img/icon.jpeg\");\n }\n }", "function getIconURI($iconPath) {\n return 'module:'.$this->guid.'/'.$iconPath;\n }", "public function getIcon(): string;", "public static function iconPath()\n {\n return Craft::getAlias(\"@dfo/elasticraft/assetbundles/elasticraftutilityutility/dist/img/ElasticraftUtility-icon.svg\");\n }", "public function get_icon() {\r\n return 'fas fa-file-code';\r\n }", "public function getIcon()\n {\n return $this->fields['icon'];\n }", "public function get_menu_icon() {\n\n\t\treturn file_get_contents( $this->get_base_path() . '/images/menu-icon.svg' );\n\n\t}", "public function get_menu_icon() {\n\n\t\treturn file_get_contents( $this->get_base_path() . '/images/menu-icon.svg' );\n\n\t}" ]
[ "0.6965582", "0.6908672", "0.6876494", "0.6826951", "0.68104196", "0.6796052", "0.6754748", "0.66508245", "0.6307433", "0.62527025", "0.6232026", "0.61822057", "0.61776465", "0.6172773", "0.6125516", "0.6107536", "0.6105791", "0.6091217", "0.60567015", "0.6050378", "0.6036552", "0.6004581", "0.6002123", "0.5983039", "0.5982732", "0.5963117", "0.5960418", "0.594223", "0.59418094", "0.59418094" ]
0.8027037
0
Returns an instance of this achievement for the given user and the given unlock state
public function getInstance(SteamId $user, $unlocked) { return new Instance($this, $user, $unlocked); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function call_analysis_action_achievement_mthd_getbyuser($useruid){\n return AchievementController::getReachedAchievements($useruid);}", "public function getUnlockedAchievements($user_id){\n return $this->db->query(\"\n SELECT user.user_name, unlocked_achievements.user_id_ach, unlocked_achievements.ach_id_unlocked,\n user.user_id, achievements.ach_id, achievements.ach_name,\n achievements.ach_desc, achievements.ach_image, achievements.ach_value,\n achievements.ach_creator\n\n FROM user, achievements, unlocked_achievements\n WHERE user.user_id = unlocked_achievements.user_id_ach AND achievements.ach_id = unlocked_achievements.user_id_ach AND unlocked_achievements.user_id_ach = $user_id\n \");\n\n }", "public function index(User $user)\n {\n $result = event(new AchievementUnlocked($user));\n\n return response()->json([\n 'unlocked_achievements' => !empty($result[0]['unlockedAchivementArry']) ? $result[0]['unlockedAchivementArry'] : [],\n 'next_available_achievements' => !empty($result[0]['nextAvailAchivementArry']) ? $result[0]['nextAvailAchivementArry'] : [],\n 'current_badge' => $result[0]['currnetBedgeArry'],\n 'next_badge' => $result[0]['nextBedgeArry'],\n 'remaing_to_unlock_next_badge' => $result[0]['reminaingtoUnlockNextBedgeArry'],\n ]);\n }", "public function achievement()\n\t{\n\t\treturn $this->belongs_to('Achievement');\n\t}", "function UnlockAchievement($achievement_id_pass, $user_id_pass, $conn_pass)\n{\n $sql = \"SELECT * FROM unlockedachievements WHERE achievement_id_fk = '$achievement_id_pass' AND user_id_fk = '$user_id_pass'\";\n // Run the query\n $result = mysqli_query($conn_pass, $sql);\n // Check if we have results\n $resultCheck = mysqli_num_rows($result); \n // Get the value within the result\n if ($resultCheck > 0) \n {\n // Already unlocked\n }\n else\n {\n // Insert the unlocked achievement in the unlockedachievements table\n $sql = \"INSERT INTO unlockedachievements (achievement_id_fk, user_id_fk, unlocked) VALUES ('$achievement_id_pass', '$user_id_pass', TRUE);\";\n\n mysqli_query($conn_pass, $sql);\n }\n \n}", "public function user()\n {\n if ($this->hasInvalidState()) {\n throw new InvalidStateException();\n }\n\n $response = $this->getAccessTokenResponse($this->getCode());\n $this->credentialsResponseBody = $response;\n\n $user = $this->mapUserToObject($this->getUserByToken(\n $token = $this->parseAccessToken($response)\n ));\n\n if ($user instanceof User) {\n $user->setAccessTokenResponseBody($this->credentialsResponseBody);\n }\n\n return $user->setToken($token)\n ->setRefreshToken($this->parseRefreshToken($response))\n ->setExpiresIn($this->parseExpiresIn($response))\n ->setIdToken($this->parseIdToken($response));\n }", "public static function forUser($user)\n {\n /** @var \\Illuminate\\Auth\\Access\\Gate $instance */\n return $instance->forUser($user);\n }", "public function testUnlocked()\n {\n $this->app['config']->set('achievements.locked_sync', false);\n $this->assertEquals(0, $this->users[0]->achievements->count());\n $unlocked = AchievementDetails::getUnsyncedByAchiever($this->users[0])->get();\n $this->assertEquals(2, $unlocked->count());\n\n $this->users[0]->unlock($this->onePost);\n $this->users[0] = $this->users[0]->fresh();\n\n $unlocked = AchievementDetails::getUnsyncedByAchiever($this->users[0])->get();\n $this->assertEquals(1, $unlocked->count());\n\n /* Testing for sync enabled */\n $this->assertEquals(0, $this->users[1]->achievements->count());\n $this->app['config']->set('achievements.locked_sync', true);\n $this->users[1] = $this->users[1]->fresh();\n $this->assertEquals(2, $this->users[1]->achievements->count());\n }", "public function retrieve_user_edit_assistant() : user_edit_assistant2\n {\n if( !isset($_SESSION[__CLASS__]) ) throw new \\LogicException('No stored user_edit data to decode');\n list($sig,$data) = explode('::',$_SESSION[__CLASS__],2);\n unset($_SESSION[__CLASS__]);\n $verify = sha1(__FILE__.$data);\n if( $sig != $verify ) throw new \\LogicException('Could not verify integrity of stored data');\n $data = json_decode($data,TRUE);\n if( !$data ) throw new \\LogicException('Could not decode user_edit_asistant state');\n if( !isset($data['user']) ) throw new \\LogicException('Could not decode user_edit_asistant state');\n $data['user'] = $this->create_user($data['user']);\n $obj = new user_edit_assistant2($this->GetModule(), $this->GetSettings(), $data);\n return $obj;\n }", "public static function buildAchievementService() {\n\t\t$achievementService = new AchievementService(self::$apiKey, self::$secretKey);\n\t\treturn $achievementService;\n\t}", "public function findInactiveByUser($user) {\n return $this->findBy(array('user' => $user, 'status' => 0));\n }", "public static function GetInstanceFromUserInput(...$aArgs)\n\t{\n\t\t$aArgs[0] = \\CMDBSource::Quote($aArgs[0]);\n\n\t\treturn new iTopMutex(...$aArgs);\n\t}", "public function openAccount()\n {\n return (new Accountant)->forUser($this);\n }", "private function check_achievements($user_id)\n {\n $games = DB::table('games_history')->where('user_id', '=', $user_id)->where('game_id', '=', 2)->count();\n $achievement = false;\n\n switch ($games) {\n case 1:\n $achievement = DB::table('achievements')->where('link', '=', 'badges/speakabout1.png')->get();\n break;\n case 10:\n $achievement = DB::table('achievements')->where('link', '=', 'badges/speakabout10.png')->get();\n break;\n case 25:\n $achievement = DB::table('achievements')->where('link', '=', 'badges/speakabout25.png')->get();\n break;\n case 50:\n $achievement = DB::table('achievements')->where('link', '=', 'badges/speakabout50.png')->get();\n break;\n case 100:\n $achievement = DB::table('achievements')->where('link', '=', 'badges/speakabout100.png')->get();\n break;\n }\n\n if ($achievement) {\n $id = $achievement[0]->id;\n $user = User::find($user_id);\n $user->achievements()->attach($id);\n\n $return = ['link' => $achievement[0]->link, 'title' => $achievement[0]->title];\n return $return;\n } else {\n return false;\n }\n }", "function el_user_by_guid($guid) {\n\t\t$user = new ElUser;\n\t\t$user->guid = $guid;\n\t\treturn $user->getUser();\n}", "public function getUserAchievements()\n {\n return $this->hasMany(UserAchievement::class, ['achievement_id' => 'id']);\n }", "public static function userDoorFactory($userName){\r\n\t\t$accounts = XMLAccount::xmlAccountFactory();\r\n\t\tif($accounts==null)\treturn null;\r\n\t\t$user = $accounts->getUser($userName);\r\n\t\tif($user==null) return null;\r\n\t\t\r\n\t\t$folder = $user->getAbsoluteDirectory();\r\n\t\tif(!file_exists($folder)) return null;\r\n\t\t//gets config file of current user\r\n\t\t$configName = $user->config();\r\n\t\t$config = new Config($folder, $configName);\r\n\t\tif($config==null)return null;\r\n\t\treturn new UserDoor($user, $config);\r\n\t}", "public function getByUserId($userId){\n return $this->getBy(array('ItemStatusId' => STATUS_ACTIVED));\n }", "static public function getInstance(\\LK\\User $account){\n $manager = new \\LK\\Merkliste\\History\\UserManager();\n $manager->setAccount($account);\n return $manager;\n }", "function getUserBySignoffType($signoffType) {\n\t\t$signoffDao =& DAORegistry::getDAO('SignoffDAO');\n\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\n\t\t$signoff =& $signoffDao->build($signoffType, ASSOC_TYPE_MONOGRAPH, $this->getMonographId());\n\n\t\tif (!$signoff) return false;\n\t\t$user =& $userDao->getUser($signoff->getUserId());\n\n\t\treturn $user;\n\t}", "public function checkAndUnlock(User $user, string $action, int $action_count): void {\n // Vérifier si on a un badge qui correspond à action et action count\n try {\n $badge = $this->em\n ->getRepository('ForumBundle:Badge')\n ->findWithUnlockForAction($user->getId(), $action, $action_count);\n // Vérifier si l'utilisateur a déjà ce badge\n if ($badge->getUnlocks()->isEmpty()) {\n // Débloquer le badge pour l'utilisateur en question\n $unlock = new BadgeUnlock();\n $unlock->setBadge($badge);\n $unlock->setUser($user);\n $this->em->persist($unlock);\n $this->em->flush();\n // Emetter un évènement pour informer l'application du déblocage de bage\n $this->dispatcher->dispatch(BadgeUnlockedEvent::NAME, new BadgeUnlockedEvent($unlock));\n }\n } catch (NoResultException $e) {\n\n }\n }", "public function get_entries_by_user_for_timeframe( $user_id, $billable, $only_billed, $only_unbilled, $is_closed, $updated_since ) {\n\n\t\t}", "function elgg_get_access_object() {\n\tstatic $elgg_access;\n\n\tif (!$elgg_access) {\n\t\t$elgg_access = new ElggAccess();\n\t}\n\n\treturn $elgg_access;\n}", "function boss_profile_achievements() {\n\t\t\tglobal $user_ID;\n\n\t\t\t//user must be logged in to view earned badges and points\n\n\t\t\tif ( is_user_logged_in() && function_exists( 'badgeos_get_user_achievements' ) ) {\n\n\t\t\t\t$achievements = badgeos_get_user_achievements( array( 'user_id' => bp_displayed_user_id(), 'display' => true ) );\n\n\t\t\t\tif ( is_array( $achievements ) && !empty( $achievements ) ) {\n\n\t\t\t\t\t$number_to_show\t = 5;\n\t\t\t\t\t$thecount\t\t = 0;\n\n\t\t\t\t\twp_enqueue_script( 'badgeos-achievements' );\n\t\t\t\t\twp_enqueue_style( 'badgeos-widget' );\n\n\t\t\t\t\t//load widget setting for achievement types to display\n\t\t\t\t\t$set_achievements = ( isset( $instance[ 'set_achievements' ] ) ) ? $instance[ 'set_achievements' ] : '';\n\n\t\t\t\t\t//show most recently earned achievement first\n\t\t\t\t\t$achievements = array_reverse( $achievements );\n\n\t\t\t\t\techo '<ul class=\"profile-achievements-listing\">';\n\n\t\t\t\t\tforeach ( $achievements as $achievement ) {\n\n\t\t\t\t\t\t//verify achievement type is set to display in the widget settings\n\t\t\t\t\t\t//if $set_achievements is not an array it means nothing is set so show all achievements\n\t\t\t\t\t\tif ( !is_array( $set_achievements ) || in_array( $achievement->post_type, $set_achievements ) ) {\n\n\t\t\t\t\t\t\t//exclude step CPT entries from displaying in the widget\n\t\t\t\t\t\t\tif ( get_post_type( $achievement->ID ) != 'step' ) {\n\n\t\t\t\t\t\t\t\t$permalink\t = get_permalink( $achievement->ID );\n\t\t\t\t\t\t\t\t$title\t\t = get_the_title( $achievement->ID );\n\t\t\t\t\t\t\t\t$img\t\t = badgeos_get_achievement_post_thumbnail( $achievement->ID, array( 50, 50 ), 'wp-post-image' );\n\t\t\t\t\t\t\t\t$thumb\t\t = $img ? '<a style=\"margin-top: -25px;\" class=\"badgeos-item-thumb\" href=\"' . esc_url( $permalink ) . '\">' . $img . '</a>' : '';\n\t\t\t\t\t\t\t\t$class\t\t = 'widget-badgeos-item-title';\n\t\t\t\t\t\t\t\t$item_class\t = $thumb ? ' has-thumb' : '';\n\n\t\t\t\t\t\t\t\t// Setup credly data if giveable\n\t\t\t\t\t\t\t\t$giveable\t = credly_is_achievement_giveable( $achievement->ID, $user_ID );\n\t\t\t\t\t\t\t\t$item_class\t .= $giveable ? ' share-credly addCredly' : '';\n\t\t\t\t\t\t\t\t$credly_ID\t = $giveable ? 'data-credlyid=\"' . absint( $achievement->ID ) . '\"' : '';\n\n\t\t\t\t\t\t\t\techo '<li id=\"widget-achievements-listing-item-' . absint( $achievement->ID ) . '\" ' . $credly_ID . ' class=\"widget-achievements-listing-item' . esc_attr( $item_class ) . '\">';\n\t\t\t\t\t\t\t\techo $thumb;\n\t\t\t\t\t\t\t\techo '<a class=\"widget-badgeos-item-title ' . esc_attr( $class ) . '\" href=\"' . esc_url( $permalink ) . '\">' . esc_html( $title ) . '</a>';\n\t\t\t\t\t\t\t\techo '</li>';\n\n\t\t\t\t\t\t\t\t$thecount++;\n\n\t\t\t\t\t\t\t\tif ( $thecount == $number_to_show && $number_to_show != 0 && is_plugin_active('badgeos-community-add-on/badgeos-community.php') ) {\n\t\t\t\t\t\t\t\t\techo '<li id=\"widget-achievements-listing-item-more\" class=\"widget-achievements-listing-item\">';\n\t\t\t\t\t\t\t\t\techo '<a class=\"badgeos-item-thumb\" href=\"' . bp_core_get_user_domain( bp_displayed_user_id() ) . '/achievements/\"><span class=\"fa fa-ellipsis-h\"></span></a>';\n\t\t\t\t\t\t\t\t\techo '<a class=\"widget-badgeos-item-title ' . esc_attr( $class ) . '\" href=\"' . bp_core_get_user_domain( bp_displayed_user_id() ) . '/achievements/\">' . __( 'See All', 'social-learner' ) . '</a>';\n\t\t\t\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\techo '</ul><!-- widget-achievements-listing -->';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function itemAccount( $user_id ){\n $stockpile = $this->binder->itemAccount( $user_id );\n if( ! $stockpile instanceof \\Gaia\\Stockpile\\Iface ) {\n throw new Exception('invalid stockpile object', $stockpile );\n }\n return $stockpile;\n }", "public function __construct($user, $exclusive)\n {\n $this->user = $user;\n $this->exclusive = $exclusive;\n }", "public function userLookup(): UserLookup\n {\n return new UserLookup($this->settings);\n }", "public function getAllotmentOOEntryForDateAndUser($user, $date) {\n\t\treturn \\OOEntryQuery::create()\n\t\t\t\t\t\t->filterByType(\\OOEntry::TYPE_ALLOTMENT_FULL_DAY)\n\t\t\t\t\t\t->_or()\n\t\t\t\t\t\t->filterByType(\\OOEntry::TYPE_ALLOTMENT_HALF_DAY_AM)\n\t\t\t\t\t\t->_or()\n\t\t\t\t\t\t->filterByType(\\OOEntry::TYPE_ALLOTMENT_HALF_DAY_PM)\n\t\t\t\t\t\t->useEntryQuery()\n\t\t\t\t\t\t\t->filterByUser($user)\n\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t->useDayQuery()\n\t\t\t\t\t\t\t->filterByDateOfDay($date)\n\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t->useOOBookingQuery()\n\t\t\t\t\t\t\t->useOORequestQuery(\"request\", \\OOEntryQuery::LEFT_JOIN)\n\t\t\t\t\t\t\t\t->filterByStatus(\\OORequest::STATUS_APPROVED)\n\t\t\t\t\t\t\t\t->_or()\n\t\t\t\t\t\t\t\t->filterByStatus(null)\n\t\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t->endUse()\t\t\n\t\t\t\t\t\t->findOne();\t\t\t\t\t\t\n\t}", "protected final function _unlock()\n\t{\n\t\t$this->_locked = false;\n\t\t\n\t\treturn $this;\n\t}", "public function is_user_locked_out( $user_id ) {\n\n\t\t/** @var wpdb $wpdb */\n\t\tglobal $wpdb;\n\n\t\treturn (bool) $wpdb->get_var( $wpdb->prepare(\n\t\t\t\"SELECT `lockout_user` FROM `{$wpdb->base_prefix}itsec_lockouts` WHERE `lockout_active`=1 AND `lockout_expire_gmt` > %s AND `lockout_user` = %d;\",\n\t\t\tdate( 'Y-m-d H:i:s', ITSEC_Core::get_current_time_gmt() ), $user_id\n\t\t) );\n\t}" ]
[ "0.5553064", "0.5506155", "0.52347094", "0.51296896", "0.5055874", "0.48340708", "0.4692245", "0.46749124", "0.46443474", "0.4639155", "0.46306354", "0.45662248", "0.45451364", "0.45321617", "0.45280576", "0.45228696", "0.45168784", "0.4467141", "0.44391158", "0.44226554", "0.44216704", "0.44032624", "0.4385949", "0.43821284", "0.43809587", "0.43783814", "0.4356689", "0.43450052", "0.4342798", "0.43183133" ]
0.62925756
0
Returns whether this achievement is hidden
public function isHidden() { return $this->hidden; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isHidden(): bool;", "public function isHidden()\n {\n return 0 !== ($this->getState() & self::STATE_HIDDEN);\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden() {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\r\n {\r\n $hidden = strtolower($this->getMetaData('hidden'));\r\n if ($hidden == 'true' || $hidden == '1') {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "public function isHidden()\n {\n return (bool) $this->_reaktorfile->getHidden();\n }", "public function canHide()\n\t{\t\treturn self::s_canHide(get_class($this));\n\t}", "public function isInvisible()\n {\n return false === $this->isVisible();\n }", "public function getIsHidden()\n {\n return $this->hidden;\n }", "public function IsHidden()\n {\n return true;\n }", "public function isHidden()\n {\n return false;\n }", "public function isVisible()\n {\n return ($this->isOnline() && !($this->getState() & self::STATE_HIDDEN));\n }", "function get_hidden() {\n $this->load_grade_item();\n if (!empty($this->grade_item)) {\n return $this->grade_item->hidden;\n } else {\n return false;\n }\n }", "public function isVisible()\n {\n return \n $this->hidden == false &&\n $this->approved == true &&\n $this->_id != false &&\n $this->image;\n }", "public function isVisible()\n\t\t\t{\n\n\t\t\t\t$action = $this->getAchievementAction();\n\t\t\t\tif( 'review' == $action ) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t}", "public function isHidden()\n\t{\n\t\treturn $this->withMeta([ 'isHidden' => true ]);\n\t}", "public function isAuditRespectsHidden()\n {\n return isset($this->auditRespectsHidden) && $this->auditRespectsHidden;\n }", "public function is_visible() {\n\t\treturn $this->visible;\n\t}", "public function getHide()\n {\n return $this->hide;\n }", "public function isVisible()\n {\n if (!$this->isAllowed()) {\n return false;\n }\n return parent::isVisible();\n }", "public function isHide($attr)\n {\n return ($attr->hasFlag(Attribute::AF_HIDE) || ($attr->hasFlag(Attribute::AF_HIDE_ADD) && $attr->hasFlag(Attribute::AF_HIDE_EDIT))) && !$attr->hasFlag(Attribute::AF_FORCE_LOAD);\n }", "protected function checkVisibility()\n {\n $is_hidden = $this->user->hasFlag(Model::FLAG_PRIVATE_PROFILE) && empty(BlockHelper::checkCurrentEventsExists($this->auth_user, $this->user));\n $is_blocked = !empty($this->user->blocked);\n\n return !$is_hidden && !$is_blocked;\n }", "public function isVisible()\n {\n return $this->getVisibility();\n }" ]
[ "0.760116", "0.7557536", "0.74910516", "0.7485405", "0.74579245", "0.74579245", "0.74579245", "0.74579245", "0.74579245", "0.74579245", "0.74579245", "0.737079", "0.73286724", "0.72479934", "0.7231324", "0.72263485", "0.721497", "0.7208178", "0.71375203", "0.7048742", "0.7027959", "0.6995564", "0.69718677", "0.6969678", "0.6960791", "0.6865639", "0.68541646", "0.68304247", "0.6819749", "0.6749185" ]
0.75728434
1
Search 'element' in 'sqltable' under 'column id'
function Search_Table_For_Element($element,$sqltable,$column_id){ //store the filtered table $table_check = mysql_query("SELECT * FROM $sqltable WHERE $column_id = '$element' "); $table_check_set = mysql_fetch_array($table_check); //table_check_set length is zero if the data doesnt exist otherwise its a +ve number $result = strlen((string)$table_check_set); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inputted_to_sql_for_search($row,$i)\n\t{\n\t\treturn NULL;\n\t}", "public function table_find_by_id($table,$field,$id){\n $query=mysqli_query($this->connect,\"SELECT * FROM `\".$table.\"` WHERE `\".$field.\"`='\".$id.\"'\");\n return $query;\n}", "function db_search($value,$column,$column_want,$table) {\n\t\t$query = \"SELECT $column_want FROM $table WHERE `$column` LIKE '$value'\";\n\t\t$result = mysql_query($query,$this->db_connection);\n\t\twhile($entry = mysql_fetch_assoc($result)) {\n\t\t\t$results[] = $entry;\n\t\t}\n\t\treturn $results;\n\t}", "function find($item, $table, $column) {\n\t\tglobal $DB_Username, $DB_Password, $DB_Name;\n\t\t$sql = new mysqli(\"localhost\", $DB_Username, $DB_Password, $DB_Name);\n\t\t$query = \"SELECT $column FROM $table\";\n\t\t$result = $sql->query($query);\n\t\twhile ($row = $result->fetch_row()) {\n\t\t\tif ($row[0] == $item) {\n\t\t\t\t$sql->close();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t$sql->close();\n\t\treturn false;\n\t}", "public function search_id($table,$field,$value,$order,$first,$last){ \n $sql=mysqli_query($this->connect,\"SELECT * from `\".$table.\"` WHERE `\".$field.\"` IN (\".$value.\")order by \".$order.\" limit \".$first.\",\".$last.\"\");\n return $sql;\n }", "function getValuesforRBColumns($column_name, $search_string) {\n\tglobal $log, $adb;\n\t$log->debug('> getValuesforRBColumns '.$column_name.','.$search_string);\n\t$sql = \"select concat(tablename,':',fieldname) as tablename from vtiger_entityname where entityidfield=? or entityidcolumn=?\";\n\t$result = $adb->pquery($sql, array($column_name));\n\t$tablename = $adb->query_result($result, 0, 'tablename');\n\t$num_rows = $adb->num_rows($result);\n\tif ($num_rows >= 1) {\n\t\t$val = $tablename;\n\t\t$explode_column=explode(',', $val);\n\t\t$x=count($explode_column);\n\t\tif ($x >= 1) {\n\t\t\t$main_tablename = explode(':', $explode_column[0]);\n\t\t\t$where=\" $explode_column[0] like '\".formatForSqlLike($search_string).\"' or $main_tablename[0]$main_tablename[1] like '\".formatForSqlLike($search_string).\"'\";\n\t\t}\n\t}\n\t$log->debug('< getValuesforRBColumns');\n\treturn $where;\n}", "public function findByElement($element)\n {\n return $this->findBySql('element_id=?', array($element->id), true);\n }", "function fetchField($column = 0);", "static function col_contains_2ro($string='',$colname='',$stringtwo='',$colnametwo='',$outputCol=''){\n $sql = \" SELECT DISTINCT \".self::$database->escape_string($outputCol).\" \";\n $sql .= \" FROM \".static::$table_name.\" \";\n $sql .= \" WHERE \".self::$database->escape_string($colname).\" LIKE '%\".self::$database->escape_string($string).\"%' \";\n $sql .= \" AND \".self::$database->escape_string($colnametwo).\" LIKE '%\".self::$database->escape_string($stringtwo).\"%' \";\n $sql .= \" LIMIT 1 \";\n//ChromePhp::log('col_contains_2ro '.$sql);\n $return_set = self::$database->query($sql);\n $row = $return_set->fetch_array();//fetch_array is used for 1 value result\n return array_shift($row);\n }", "public function findSQL($searchSql='', array $searchValues=array());", "public function getbyelement($table,$data_where)\r\n {\r\n $query = $this->db->get_where($table, $data_where);\r\n return $query->row();\r\n }", "function getRow($sql);", "function GetUniqueWhere($colone){\r\n $where = \"\";\r\n\r\n foreach($colone as $col){\r\n \r\n /// Get WHERE part\r\n if(IsPrimaryKey($col)){\r\n $my_id = $col->name ;\r\n if($where != \"\") $where .= \" AND\\n\";\r\n $where .= \" ( $my_id='\\$this->$my_id' ) \";\r\n } \r\n }\r\n return $where;\r\n}", "public function search_id_n($table,$field,$value,$order,$first,$last){ \n $sql=mysqli_query($this->connect,\"SELECT * from `\".$table.\"` WHERE `\".$field.\"` IN (\".$value.\")order by \".$order.\" limit \".$first.\",\".$last.\"\");\n return $sql;\n }", "function SingleColumnSearch($matchingVal, $specific_column, $table, $db)\n{\n //add full text functionality to column\n $q_f = \"ALTER TABLE \" . $table . \" ADD FULLTEXT (\" . $specific_column . \") \";\n\n $stmt = $db->prepare($q_f);\n\n $stmt->execute();\n\n $q =\n \"SELECT p.*, MATCH (p.\" .\n $specific_column .\n \") AGAINST (?) AS score FROM \" .\n $table .\n \" p WHERE p.question_id <> 23 AND MATCH (p.\" .\n $specific_column .\n \") AGAINST (?) > 0 LIMIT 4\";\n\n $stmt_s = $db->prepare($q);\n\n $stmt_s->bind_param(\"ss\", $matchingVal, $matchingVal);\n\n $stmt_s->execute();\n\n return $stmt_s;\n}", "public function findBy($columnName, $value, array $columns = ['*']);", "public static function find_by_sql($sql=\"\") {\r\n\t\tglobal $database;\r\n\t\t$result_set = $database->query($sql); /*result_set e' un array arr['tupla_i']['attr_i']*/\r\n\t\t$object_array = array(); /*array indefinito di oggetti Comment*/\r\n\t\twhile ($row = $database->fetch_array($result_set)) {\r\n\t\t\t$object_array[] = self::instantiate($row);\r\n\t\t}\r\n\t\treturn $object_array;\r\n\t}", "function where($column, $value = SYND_SQL_MISSING_PARAM);", "function SingleColumnSearchRelatedQuestion(\n $matchingVal,\n $qId,\n $specific_column,\n $table,\n $db\n) {\n $q_f = \"ALTER TABLE \" . $table . \" ADD FULLTEXT (\" . $specific_column . \") \";\n\n $stmt = $db->prepare($q_f);\n\n $stmt->execute();\n\n $q =\n \"SELECT p.*, MATCH (p.\" .\n $specific_column .\n \") AGAINST (?) AS score FROM \" .\n $table .\n \" p WHERE p.question_id !=? AND p.question_id <> 23 AND MATCH (p.\" .\n $specific_column .\n \") AGAINST (?) > 0 LIMIT 4\";\n\n $stmt_s = $db->prepare($q);\n\n $stmt_s->bind_param(\"sss\", $matchingVal, $qId, $matchingVal);\n\n $stmt_s->execute();\n\n return $stmt_s;\n}", "public function find($value, $column = null) {\n $column = ($column === null) ? $this->pk : $column ;\n $sql = 'SELECT * FROM ' . $this->table .\n ' WHERE ' . $column . '=' . $this->db->pdb($value) . ' AND ' . $this->standard_restrictions() . ' LIMIT 1';\n $result = $this->db->get_row($sql);\n\n\n if (is_array($result)) {\n return $this->return_instance($result);\n }\n\n return false;\n }", "function selectWhere($column = '*',$table, $where = '1=1'){\n $sql = $GLOBALS['con']->query(\"select $column from $table where $where\");\n $row=$sql->fetchAll(PDO::FETCH_ASSOC);\n return $row;\n}", "function getxmltablefield($databasename, $tablename, $fieldname, $path = \".\")\n{\n if (!file_exists(\"$path/$databasename/$tablename.php\"))\n return false;\n $rows = xmldb_readDatabase(\"$path/$databasename/$tablename.php\", \"field\");\n foreach ($rows as $row)\n {\n if ($row['name'] == $fieldname)\n {\n return $row;\n }\n }\n return false;\n}", "public function searchSQL($sql) {\r\n\r\n // SQL result holder\r\n $data = array();\r\n\r\n // Run the sql\r\n $query = $this->conn->query($sql);\r\n\r\n // Debugger if we get an error\r\n if (! $query) {\r\n printf(\"Error Message: %s\\n\", $this->conn->error);\r\n }\r\n\r\n // Collect rows returned into an associative array\r\n while($result = $query->fetch_array(MYSQLI_ASSOC)) {\r\n\r\n // Give each row an index\r\n array_push($data, $result);\r\n }\r\n\r\n // Free the result\r\n $query->free();\r\n\r\n // Send it back to caller\r\n return $data;\r\n }", "public static function find_by_id($id) \n {\n global $database;\n $result_set = static::find_by_query(\"SELECT * FROM \" . static::$db_table . \" WHERE id = $id \"); \n return !empty($result_set) ? array_shift($result_set) : false; \n \n }", "static public function col_contains_string($string='',$col=''){\n $sql = \"SELECT COUNT(*) FROM \" . static::$table_name. \"\"; //se usa static y no self para que llame al child class\n $sql .= \" WHERE \".self::$database->escape_string($col).\" LIKE '%\".self::$database->escape_string($string).\"%' \";\n $return_set = self::$database->query($sql);\n $row = $return_set->fetch_array();//fetch_array is used for 1 value result\n return array_shift($row);\n }", "function get_where($id) {\n\t\t$db = $this->database;\n\t\t$table = $this->get_table();\n\t\t$db->where('id', $id);\n\t\t$query=$db->get($table);\n\t\t//print_r($query->row_array());exit;\n\t\treturn $query->row_array();\n }", "function get_of_prodbyID($id, $column){\n\t\treturn array_values(select(\"select \".$column.\" from producto where codigo=\".$id.\"\")[0])[0];\n\t}", "protected function rowInArray($id, $keycolumn, $array) {\n $total = count($array);\n for ($i = 0; $i < $total; $i++) {\n if ($array[$i][$keycolumn] == $id) {\n return $i;\n }\n }\n return null;\n }", "public abstract function field($sql);", "function find($id)\n {\n $query = sprintf(\"select * from %s where %s=%s\", self::tabla, self::id_tabla, $id);\n $row = $this->db->query($query);\n return $row;\n }" ]
[ "0.61979204", "0.6119276", "0.6035421", "0.6016913", "0.5879455", "0.5840019", "0.5812554", "0.5766862", "0.57197857", "0.57194155", "0.5699408", "0.5654662", "0.55893713", "0.55871975", "0.55792046", "0.5564102", "0.5559419", "0.55374557", "0.5514301", "0.5509369", "0.549113", "0.54846126", "0.54766464", "0.5470319", "0.5464135", "0.54497457", "0.54466546", "0.5441736", "0.5436253", "0.54233336" ]
0.6808723
0
Returns all tokens of the given type.
public function getTokensByType($type) { $result = []; foreach ($this->tokens as $token) { if ($token['type'] == $type) { $result[] = $token; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTokens();", "public function getTokens();", "public static function parameterTypeTokens()\n {\n $tokens = self::$parameterTypeTokens;\n $tokens += self::namespacedNameTokens();\n return $tokens;\n }", "public function getTokens(): array\n {\n return $this->tokens;\n }", "public function getTokens()\n {\n $storage = PHP_Depend_StorageRegistry::get(PHP_Depend::TOKEN_STORAGE);\n return (array) $storage->restore($this->getUUID(), get_class($this));\n }", "public static function returnTypeTokens()\n {\n $tokens = self::$returnTypeTokens;\n $tokens += self::$ooHierarchyKeywords;\n $tokens += self::namespacedNameTokens();\n return $tokens;\n }", "private function getNodes($type)\n {\n $nodes = array();\n // because i don't like anonymous functions\n foreach ($this->nodes as $node => $nodeType) {\n if ($nodeType === $type) {\n $nodes[] = $node;\n }\n }\n return $nodes;\n }", "function typenames() : array\n\t{\n\t\t$list = array();\n\t\t /*\n\t\t * Scan file tokens for 'typedef' keywords\n\t\t */\n\t\t$s = new lexer($this->path);\n\t\twhile (1) {\n\t\t\t$t = $s->get();\n\t\t\tif ($t === null) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// When a 'typedef' is encountered, look ahead\n\t\t\t// to find the type name\n\t\t\tif ($t->type == 'typedef') {\n\t\t\t\t$list[] = self::get_typename($s);\n\t\t\t}\n\n\t\t\tif ($t->type == 'macro' && strpos($t->content, '#type') === 0) {\n\t\t\t\t$list[] = trim(substr($t->content, strlen('#type') + 1));\n\t\t\t}\n\t\t}\n\t\treturn $list;\n\t}", "public function getTokens()\n {\n if (count($this->tokens) == 0) {\n $this->Load();\n }\n\n return $this->tokens;\n }", "private function getLanguageToken($type) {\n\t\t// Escolhe a expressão regular requerida\n\t\t$regExp = self::$tokenTypesRegExps[$type];\n\n\t\t/* Pega uma parte do programa principal para análise,\n\t\t * a partir do cursor, para não procurar tokens já identificados.\n\t\t */\n\t\t$slice = substr($this->inputProgram, $this->cursor);\n\n\t\t$matches;\n\n\t\t// Usamos PREG_OFFSET_CAPTURE para saber a posição onde o token ocorre.\n\t\tif(preg_match($regExp, $slice, $matches, PREG_OFFSET_CAPTURE)) {\n\t\t\t/* Caso a expressão case com alguma parte do programa,\n\t\t\t * o índice 0 do array $matches contém a string casada.\n\t\t\t *\n\t\t\t * Dentro de $matches[0], o índice [1] representa a posição\n\t\t\t * identificada por PREG_OFFSET_CAPTURE...\n\t\t\t */\n\t\t\t$pos = $matches[0][1];\n\n\t\t\t/* Só prosseguiremos com a análise caso a ER case com o começo do\n\t\t\t * restante do programa, se não estamos deixando tokens para trás.\n\t\t\t */\n\t\t\tif($pos == 0) {\n\t\t\t\t/*\n\t\t\t\t * Dentro de $matches[0], o índice [0] representa\n\t\t\t\t * a string casada com a ER.\n\t\t\t\t */\n\t\t\t\t$lexeme = $matches[0][0];\n\n\t\t\t\t// Armazenamos a linha e a coluna atuais...\n\t\t\t\t$line = $this->line;\n\t\t\t\t$col = $this->col;\n\n\t\t\t\t/*\n\t\t\t\t * O tratamento abaixo se deve única e exclusivamente para\n\t\t\t\t * acertar a posição (linha e coluna) no programa.\n\t\t\t\t */\n\t\t\t\tif($type == self::T_WHITESPACE) {\n\t\t\t\t\t$lf = \"\\n\";\n\t\t\t\t\t$posLf = strpos($lexeme, $lf);\n\t\t\t\t\t$lastPosLf = strrpos($lexeme, $lf);\n\n\t\t\t\t\t/* Caso haja quebras de linha, precisamos incrementar\n\t\t\t\t\t * o valor da linha e resetar o valor da coluna.\n\t\t\t\t\t */\n\t\t\t\t\tif($posLf !== false) {\n\t\t\t\t\t\t$this->line += substr_count($lexeme, $lf);\n\t\t\t\t\t\t$this->col = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t$tab = \"\\t\";\n\t\t\t\t\t$posTab = strpos($lexeme, $tab);\n\n\t\t\t\t\t/* Caso haja tabulações, precisamos contar quantas\n\t\t\t\t\t * existem DEPOIS da última quebra de linha e somar esse\n\t\t\t\t\t * valor multiplicado pelo fator tabSize à coluna atual.\n\t\t\t\t\t */\n\t\t\t\t\tif($posTab !== false) {\n\t\t\t\t\t\t$this->col += $this->tabSize *\n\t\t\t\t\t\t\t\t\t substr_count($lexeme, $tab, $lastPosLf);\n\t\t\t\t\t} \n\n\t\t\t\t\t/* Caso haja espaços, precisamos contar quantos\n\t\t\t\t\t * existem DEPOIS da última quebra de linha e somar esse\n\t\t\t\t\t * valor à coluna atual.\n\t\t\t\t\t */\n\t\t\t\t\t$space = \" \";\n\t\t\t\t\t$spacePos = strpos($lexeme, $space);\n\t\t\t\t\tif($spacePos !== false) {\n\t\t\t\t\t\t$this->col += substr_count($lexeme, $space, $lastPosLf);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* Se não for espaço em branco, apenas somamos\n\t\t\t\t\t * o tamanho do token à coluna.\n\t\t\t\t\t */\n\t\t\t\t\t$this->col += strlen($lexeme);\n\t\t\t\t}\n\n\t\t\t\t// Incrementamos o cusor\n\t\t\t\t$this->cursor += strlen($lexeme);\n\n\t\t\t\treturn array('lexeme' => $lexeme,\n\t\t\t\t\t\t\t 'line'\t => $line,\n\t\t\t\t\t\t\t 'col'\t => $col,\n\t\t\t\t\t\t\t 'type'\t => $type);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function getTokens()\n {\n return $this->tokens;\n }", "public function getTokens()\n {\n return $this->tokens;\n }", "public function getTokens()\n {\n return $this->tokens;\n }", "public function getTokens()\n\t{\n\t\treturn $this->tokens;\n\t}", "public function getTokens()\n {\n return $this->command->getTokens();\n }", "public function getTokenTypeHandlers();", "public function getTokens() {\n\t\treturn $this->tokens;\n\t}", "public static function propertyTypeTokens()\n {\n $tokens = self::$propertyTypeTokens;\n $tokens += self::namespacedNameTokens();\n return $tokens;\n }", "public function getType()\n {\n return $this->token_type;\n }", "public function allOfType($type)\n {\n # FIXME: shorten if $type is a URL\n if (isset($this->_typeIndex[$type])) {\n return $this->_typeIndex[$type];\n } else {\n return array();\n }\n }", "public function getTokenTypeHandler($type = null);", "public function getTypes(){\n // définition de la requete\n $query = 'SHOW COLUMNS FROM ' . $this->table . ' like \\'type\\'';\n $this->query = $query;\n // éxécution de la requete\n $resultat = $this->db->query($query);\n\n if(!$resultat){\n return [];\n }\n else{\n $clean = ['enum(', ')', '\\''];\n $liste = explode(',', str_replace($clean, '', $resultat->fetch()['Type'])); \n return $liste;\n }\n }", "public function getTokenParsers()\n {\n return [];\n }", "public static function getTokens($types=array(),$s='',$grabNextString=false)\n\t{\n\t\t$matches = array();\n\t\t/*-DIRECTORY--------------------------------------------------*/\n\t\tif (is_dir($s)) {\n\t\t\tforeach (Filesystem::contents($s) as $p) {\n\t\t\t\t$matches = array_merge($matches,\n\t\t\t\t\tself::getTokens($types,\"$s/$p\",$grabNextString));\n\t\t\t}\n\t\t\treturn array_unique($matches);\n\t\t}\n\t\t/*-FILE-------------------------------------------------------*/\n\t\tif (is_file($s)) {\n\t\t\tif (strcasecmp(Filesystem::extension($s),'php') !== 0)\n\t\t\t\treturn $matches;\n\t\t\telse $s = Filesystem::load($s);\n\t\t}\n\t\t/*-STRING-----------------------------------------------------*/\n\t\tif (!is_array($types)) $types = array($types);\n\t\t$tokens = token_get_all($s);\n\t\t$grabNext = false;\n\t\tforeach ($tokens as $t) {\n\t\t\tif (!is_array($t)) continue;\n\t\t\tif ($grabNext) {\n\t\t\t\tif ($t[0] !== T_STRING) continue;\n\t\t\t\tarray_push($matches,$t[1]);\n\t\t\t\t$grabNext = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tforeach ($types as $type) {\n\t\t\t\tif ($t[0] === $type) {\n\t\t\t\t\tif ($grabNextString) $grabNext = true;\n\t\t\t\t\telse array_push($matches,$t[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn array_unique($matches);\n\t}", "protected function get_tokens() {\n\n\t\tif ( ! empty( $this->tokens ) ) {\n\t\t\treturn $this->tokens;\n\t\t}\n\n\t\t$tokens = array();\n\n\t\tif ( $this->tokenization_allowed() && is_user_logged_in() ) {\n\n\t\t\tforeach ( $this->get_gateway()->get_payment_tokens_handler()->get_tokens( get_current_user_id() ) as $token ) {\n\n\t\t\t\t// some gateways return all tokens for each gateway, so ensure the token type matches the gateway type\n\t\t\t\tif ( ( $this->get_gateway()->is_credit_card_gateway() && $token->is_check() ) || ( $this->get_gateway()->is_echeck_gateway() && $token->is_credit_card() ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// set token\n\t\t\t\t$tokens[ $token->get_id() ] = $token;\n\n\t\t\t\t// don't force new payment method if an existing token is default\n\t\t\t\tif ( $token->is_default() ) {\n\t\t\t\t\t$this->default_new_payment_method = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->tokens = $tokens;\n\t}", "public function get($id, $type) {\n\t\t\treturn Application::$app->database->select([\n\t\t\t\t\t'table' => 'tokens',\n\t\t\t\t\t'where' => [\n\t\t\t\t\t\t'user' => $id,\n\t\t\t\t\t\t'type' => $type\n\t\t\t\t\t]\n\t\t\t\t])[0]['token'] ?? null;\n\t\t}", "protected function _all($type) {\n return $this->__query($this->index(), $type);\n }", "private function getTokens($content)\n {\n $scanner = new PhpScanner($content);\n return $scanner->scan();\n }", "public static function getTokenName( $type )\n {\n $names = array(\n self::DOCUMENT => 'Document',\n self::SECTION => 'Section',\n self::TITLE => 'Title',\n self::PARAGRAPH => 'Paragraph',\n self::BULLET_LIST => 'Bullet list item',\n self::ENUMERATED_LIST => 'Enumerated list item',\n self::BULLET_LIST_LIST => 'Bullet list',\n self::ENUMERATED_LIST_LIST => 'Enumerated list',\n self::TEXT_LINE => 'Text line',\n self::BLOCKQUOTE => 'Blockquote',\n self::ANNOTATION => 'Blockquote anotation',\n self::COMMENT => 'Comment',\n self::TRANSITION => 'Page transition',\n self::FIELD_LIST => 'Field list',\n self::DEFINITION_LIST => 'Definition list item',\n self::DEFINITION_LIST_LIST => 'Definition list',\n self::LINE_BLOCK => 'Line block',\n self::LINE_BLOCK_LINE => 'Line block line',\n self::LITERAL_BLOCK => 'Literal block',\n self::MARKUP_EMPHASIS => 'Emphasis markup',\n self::MARKUP_STRONG => 'Strong emphasis markup',\n self::MARKUP_INTERPRETED => 'Interpreted text markup',\n self::MARKUP_LITERAL => 'Inline literal markup',\n self::MARKUP_SUBSTITUTION => 'Substitution reference markup',\n self::LINK_ANONYMOUS => 'Anonymous hyperlink',\n self::LINK_REFERENCE => 'External Reference',\n self::TARGET => 'Internal Target',\n self::REFERENCE => 'Internal Reference',\n self::LITERAL => 'Inline Literal',\n self::SUBSTITUTION => 'Substitution target',\n self::DIRECTIVE => 'Directive',\n self::NAMED_REFERENCE => 'Named reference target',\n self::FOOTNOTE => 'Footnote target',\n self::ANON_REFERENCE => 'Anonymous reference target',\n self::TABLE => 'Table node',\n self::TABLE_HEAD => 'Table head node',\n self::TABLE_BODY => 'Table body node',\n self::TABLE_ROW => 'Table row node',\n self::TABLE_CELL => 'Table cell node',\n );\n\n if ( !isset( $names[$type] ) )\n {\n return 'Unknown';\n }\n\n return $names[$type];\n }", "abstract function getTokenName($type);" ]
[ "0.68705356", "0.68705356", "0.63052183", "0.6212484", "0.61937004", "0.6182347", "0.6124308", "0.60481405", "0.60426235", "0.6036926", "0.6030618", "0.6030618", "0.6030618", "0.5968807", "0.5947398", "0.59464705", "0.5917182", "0.5905613", "0.5806319", "0.5764081", "0.57586086", "0.5664248", "0.565804", "0.56074584", "0.5602806", "0.5598165", "0.5594042", "0.5593856", "0.5585724", "0.55799437" ]
0.82242596
0
Check whether the expression contains at least one token of the given type.
public function hasTokenOfType($type) { foreach ($this->tokens as $token) { if ($token['type'] == $type) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function matchesAnyType(int ...$types): bool\n {\n foreach ($types as $type) {\n if ($this->tokens[$this->current]->matches($type)) {\n return true;\n }\n }\n return false;\n }", "public function matches(int $type, $values = null): bool\n {\n return $this->tokens[$this->current]->matches($type, $values);\n }", "private function _matchesExpressionStart()\n {\n return (!$this->stream->matches(Token::TYPE_RESERVED_KEYWORD) && !$this->stream->matches(Token::TYPE_SPECIAL))\n || $this->stream->matches(Token::TYPE_KEYWORD, array('not', 'true', 'false', 'null', 'row', 'array', 'case', 'exists'))\n || $this->stream->matches(Token::TYPE_SPECIAL_CHAR, array('(', '+', '-'))\n || $this->stream->matches(Token::TYPE_OPERATOR)\n || $this->_matchesFunctionCall();\n }", "public function hasTokens(){\n return preg_match($this->token_pattern, $this->html);\n }", "public function has_tokens() {\n\t\treturn ! empty( $this->tokens );\n\t}", "public static function is(string ...$types): bool\n {\n return in_array(static::current(), $types, true);\n }", "private function _check_access( $type ) {\n $tokens = Access_token::inst()->get_by_type( $type, $this->c_user->id, $this->profile->id );\n if(empty($tokens)) {\n return false;\n } else {\n return true;\n }\n }", "public function supports(TypeToken $type): bool\n {\n if ($type->isArray()) {\n return true;\n }\n\n return $type->isA(stdClass::class);\n }", "public function hasTokens()\n {\n return $this->tokens->valid();\n }", "function isType($type)\n {\n /* check is rather naive as it doesn't know about context\n so we check for a sequence of valid names for now\n TODO: check for either simple type, struct/class or single word (typedef)\n */\n $array = explode(\" \", str_replace('*', ' ', $type));\n foreach ($array as $name) {\n if (empty($name)) continue;\n // TODO :: should only be allowed for C++, not C extensions\n if (!$this->isName(str_replace(\"::\", \"\", $name))) return false;\n }\n return true;\n }", "public function hasMoreTokens() {\n\n if ($this->lookahead !== null) {\n\n return true;\n\n } \n\n return !empty($this->tokens);\n\n }", "public function isType($type) {\n if (key(preg_grep(\"/$type/i\", $this->response['headers'])) !== null) {\n return true;\n } else {\n return false;\n }\n }", "private function checkInput($type){\r\n return empty($type) ? false : true;\r\n }", "public function isToken()\n {\n return !empty($this->_value);\n }", "public function hasToken($token);", "public function checkType($type = ''){\n\t\treturn isset($this->types[$type]);\n\t}", "public function hasType(){\n return $this->_has(1);\n }", "public function has_tokens() {\n\t\t$has = false;\n\t\tif ( ! empty( $this->access_token ) ) {\n\t\t\t$has = true;\n\t\t}\n\t\treturn $has;\n\t}", "public function is($type) {\n $ctype = $this->get('content type');\n return !!preg_match('`' . $type . '`', $ctype);\n }", "private function isValidRequest($type){\n if (!$type)\n return false;\n return ($type==PLAIN || $type==TOKEN);\n }", "public function hasType(){\r\n return $this->_has(1);\r\n }", "public function hasType(){\r\n return $this->_has(1);\r\n }", "public function isEmpty()\n {\n return count($this->tokens) === 0;\n }", "public function has($type);", "public function isValidType($type);", "protected function checkType() {\n return in_array($this->type, $this->types);\n }", "public function hasType()\n {\n return $this->get(self::TYPE) !== null;\n }", "public function hasType()\n {\n return $this->type !== null;\n }", "protected function expectType($type)\n {\n $this->next();\n $token = end($this->stack);\n if ($token[0] !== $type) {\n throw new UnexpectedTokenException('Token of type ' . $type . ' was expected.');\n }\n }", "public function isTypeRegistered($type);" ]
[ "0.6510223", "0.6025081", "0.59432614", "0.5835487", "0.5604512", "0.5567869", "0.55417836", "0.55268276", "0.54592615", "0.54387593", "0.54325575", "0.5393126", "0.5358753", "0.53256696", "0.53244406", "0.53016406", "0.5285621", "0.52686375", "0.5265043", "0.52630645", "0.5240865", "0.5240865", "0.52127045", "0.5210211", "0.51910067", "0.51715285", "0.5133193", "0.51163", "0.51073027", "0.51062644" ]
0.68586665
0
/ ADD YOUR CUSTOM FUNCTIONS BELOW / ALLOW DO SHORTCODES FOR CONTACTFORM 7
function shortcodes_in_cf7( $form ) { $form = do_shortcode( $form ); return $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pc4u_contactform_html($atts) {\r\n\r\n global $pc4u_options;\r\n\r\n // Process Attributes - Set Defaults\r\n // No Prefilled Subject & Message, Show Telephone & Address - But Not Compulsary\r\n \r\n extract( shortcode_atts( array(\r\n 'contacttitle' => 'Contact Us',\r\n 'subjecttitle' => 'Subject',\r\n 'messagetitle' => 'Your Message',\r\n 'showtelephone' => '',\r\n 'musthavetelephone' => '',\r\n 'showaddress' => '',\r\n 'musthaveaddress' => '' \r\n ), $atts ) );\r\n\r\n $contactShowTelephone = true;\r\n $contactShowAddress = true;\r\n \r\n $GLOBALS['contactMustHaveTelephone'] = false ;\r\n $GLOBALS['contactMustHaveAddress'] = false ;\r\n \r\n // Process Telephone Flags\r\n if(!empty($showtelephone)){\r\n // Show Telephone Default True\r\n $showtelephone = strtoupper(trim($showtelephone));\r\n if($showtelephone !== \"YES\" && $showtelephone !== \"TRUE\") {\r\n $contactShowTelephone = false ;\r\n }\r\n }\r\n \r\n // If MUST HAVE Telephone is true then make sure it is displayed\r\n if(!empty($musthavetelephone)){\r\n // Must Have Telephone Default False\r\n $musthavetelephone = strtoupper(trim($musthavetelephone));\r\n if($musthavetelephone == \"YES\" || $musthavetelephone == \"TRUE\") {\r\n $GLOBALS['contactMustHaveTelephone']= true ;\r\n $contactShowTelephone = true; // If 'Must Have' Make Sure Displayed\r\n } \r\n }\r\n \r\n // Process Address Flags\r\n if(!empty($showaddress)){\r\n // Show Address Default True\r\n $showaddress = strtoupper(trim($showaddress));\r\n if($showaddress !== \"YES\" && $showaddress !== \"TRUE\") {\r\n $contactShowAddress = false ;\r\n }\r\n }\r\n // If MUST HAVE Address is true then make sure it is displayed\r\n\r\n if(!empty($musthaveaddress)){\r\n // Must Have Address Default False\r\n $musthaveaddress = strtoupper(trim($musthaveaddress));\r\n if($musthaveaddress == \"YES\" || $musthaveaddress == \"TRUE\") {\r\n $GLOBALS['contactMustHaveAddress'] = true ;\r\n $contactShowAddress = true ; // If 'Must Have' Make Sure Displayed\r\n }\r\n }\r\n \r\n echo '<form action=\"' . esc_url( $_SERVER['REQUEST_URI'] ) . '\" method=\"post\">';\r\n echo '<div id=Pc4uContact >';\r\n echo '<h2>'. $contacttitle. '</h2>';\r\n echo '<div id=\"postcodes4ukey\" style=\"display: none;\">' . $pc4u_options['user_key'] . '</div>';\r\n echo '<div id=\"postcodes4uuser\" style=\"display: none;\">'. $pc4u_options['user_name'] . '</div>';\r\n echo '<div id=\"WooInt\" style=\"display: none;\">' . $pc4u_options['woointegrate'] . '</div>';\r\n echo '<table><tbody>';\r\n echo '<tr><p><strong>Your Name*</strong><br/>';\r\n echo '<input name=\"pc4uName\" type=\"text\" pattern=\"[a-zA-Z0-9 ]+\" value=\"' . ( isset( $_POST[\"pc4uName\"] ) ? esc_attr( $_POST[\"pc4uName\"] ) : \"\" ) . '\" size=\"40\" />';\r\n echo '</p> </tr>';\r\n echo '<tr><p><strong>'. $subjecttitle.'* <br/>';\r\n echo '<input name=\"pc4uSubject\" type=\"text\" value=\"' . ( isset( $_POST[\"pc4uSubject\"] ) ? esc_attr( $_POST[\"pc4uSubject\"] ) :'' ) . '\" size=\"40\" />';\r\n echo '</p></tr>';\r\n echo '<tr><p><strong>'.$messagetitle. '*</strong> <br/>';\r\n echo '<textarea rows=\"5\" cols=\"35\" name=\"pc4uMessage\">' . ( isset( $_POST[\"pc4uMessage\"] ) ? esc_attr( $_POST[\"pc4uMessage\"] ) : '') . '</textarea>';\r\n echo '</p></tr>';\r\n echo '<tr><p><strong>Email Address*</strong><br/>';\r\n echo '<input name=\"pc4uEmail\" type=\"text\" value=\"' . ( isset( $_POST[\"pc4uEmail\"] ) ? esc_attr( $_POST[\"pc4uEmail\"] ) : \"\" ) . '\" size=\"40\" />';\r\n echo '<p></tr>';\r\n\r\n // Display Telephone If Required\r\n if($contactShowTelephone) {\r\n echo '<tr><p><strong>Telephone Number';\r\n echo '</strong><br/>';\r\n echo '<input name=\"pc4uTelephone\" type=\"text\" value=\"' . ( isset( $_POST[\"pc4uTelephone\"] ) ? esc_attr( $_POST[\"pc4uTelephone\"] ) : \"\" ) . '\" size=\"40\" />';\r\n echo '</p></tr>';\r\n }\r\n \r\n // Display Address If Required\r\n if($contactShowAddress) {\r\n echo '<tr><strong>Postal Address';\r\n \r\n echo '</strong><br/>';\r\n echo '<tr><td><strong>Postcode</strong></td>';\r\n echo '<td><input id=\"pc4uPostcode\" name=\"pc4uPostcode\"type=\"text\" value=\"' . ( isset( $_POST[\"pc4uPostcode\"] ) ? esc_attr( $_POST[\"pc4uPostcode\"] ) : \"\" ) . '\" size=\"12\"/>&nbsp&nbsp';\r\n echo '<input onclick=\"Pc4uSearchBegin();return false;\" type=\"submit\" value=\"Lookup Postcode\" /></td></tr>';\r\n echo '<tr><td> </td><td><select id=\"pc4uDropdown\" name=\"pc4uDropdown\" style=\"display: none;\" onchange=\"Pc4uSearchIdBegin()\"><option>Select an address:</option></select></td></tr>';\r\n echo '<tr><td><strong>Company</strong></td>';\r\n echo '<td><input id=\"pc4uCompany\" name=\"pc4uCompany\" type=\"text\" value=\"' . ( isset( $_POST[\"pc4uCompany\"] ) ? esc_attr( $_POST[\"pc4uCompany\"] ) : \"\" ) . '\" />';\r\n echo '</td></tr>';\r\n echo '<tr><td><strong>Address 1</strong></td>';\r\n echo '<td><input id=\"pc4uAddress1\" name=\"pc4uAddress1\" type=\"text\"value=\"' . ( isset( $_POST[\"pc4uAddress1\"] ) ? esc_attr( $_POST[\"pc4uAddress1\"] ) : \"\" ) . '\" />';\r\n echo '</td></tr>' ;\r\n echo '<tr><td><strong>Address 2</strong></td>';\r\n echo '<td><input id=\"pc4uAddress2\" name=\"pc4uAddress2\" type=\"text\" value=\"' . ( isset( $_POST[\"pc4uAddress2\"] ) ? esc_attr( $_POST[\"pc4uAddress2\"] ) : \"\" ) . '\" />';\r\n echo '</td></tr>';\r\n echo '<tr><td><strong>Town</strong></td>';\r\n echo '<td><input id=\"pc4uTown\" name=\"pc4uTown\" type=\"text\"value=\"' . ( isset( $_POST[\"pc4uTown\"] ) ? esc_attr( $_POST[\"pc4uTown\"] ) : \"\" ) . '\" />';\r\n echo '</td></tr>';\r\n echo '<tr><td><strong>County</strong></td>';\r\n echo '<td><input id=\"pc4uCounty\" name=\"pc4uCounty\" type=\"text\"value=\"' . ( isset( $_POST[\"pc4uCounty\"] ) ? esc_attr( $_POST[\"pc4uCounty\"] ) : \"\" ) . '\" />';\r\n echo '</td></tr>';\r\n }\r\n echo '<tr><td colspan=2><strong>* Required Field</strong></td></tr>';\r\n echo '<tr><td colspan=2><input type=\"submit\" name=\"pc4u-submitted\" value=\"Send Message\" style=\"font-weight: bold;\"/></td></tr>';\r\n echo '</tbody></table>';\r\n echo '</div></form>';\r\n}", "function rec_enquiry_form_callback() { ?>\n\t<div class=\"widget-sub-title-wrapper rec-enquiry-form\">\n\t\t<h5 class=\"tab-title\">Make an Enquiry</h5>\n\t\t<?php echo do_shortcode('[gravityform id=\"8\" title=\"false\" description=\"false\" tabindex=\"66\"]'); ?>\n\t</div>\n<?\n}", "function bmg_forms_register_shortcodes() {\n\tadd_shortcode('bmg_contact_us_form','bmg_contact_us_form_shortcode');\n\tadd_shortcode('bmg_forms','bmg_forms_shortcode');\n}", "function custom_wpcf7_form_elements( $form ) {\n $form = do_shortcode( $form );\n\n return $form;\n}", "function iwacontact_shortcode_box() {\n\n\tglobal $ajaxcontact;\n\t?>\n\t<p>\n\t\t<input type=\"text\" id=\"iwacf_shortcode\" class=\"widefat\" value=\"[insert_ajaxcontact id=<?php the_ID(); ?>]\" readonly=\"readonly\" /> \n\t</p>\n\t<p>\n\t\t<em><?php _e( 'Use the shortcode to add this form to any post or page', 'iwacontact' ); ?></em>\n\t</p>\n\t<?php\n\n}", "function initShortCode()\n {\n }", "function clb_register_shortcodes() {\n\t\n\tadd_shortcode('clb_form', 'clb_form_shortcode');\n\t\n}", "function formidable_section_description() {\n _e( 'Use the field(s) below to enter Formidable shortcodes.', 'inter' );\n }", "function dp_shortcode_head($defaults) {\r\n $defaults['dp_shortcode'] = 'Shortcode';\r\n return $defaults;\r\n}", "function mpcth_contact_shortcode($atts, $content = null) {\r\n\tglobal $mpcth_options;\r\n\r\n\textract(shortcode_atts(array(\r\n\t\t'css_animation' => ''\r\n\t), $atts));\r\n\r\n\t$email_label\t= __('Email', 'mpcth');\r\n\t$message_label\t= __('Message', 'mpcth');\r\n\t$author_label\t= __('Author', 'mpcth');\r\n\t$send_label\t\t= __('Send Message', 'mpcth');\r\n\r\n\t$email_required = get_option('require_name_email');\r\n\tif($email_required == '1')\r\n\t\t$email_label .= '*';\r\n\r\n\twp_enqueue_script('mpcth-contact-form-js', MPC_THEME_ROOT.'/mpc-wp-boilerplate/js/mpcth-contact-form.js', array('jquery'), '1.0');\r\n\twp_localize_script('mpcth-contact-form-js', 'cfdata', array(\r\n\t\t'email_label'\t\t=> $email_label,\r\n\t\t'message_label'\t\t=> $message_label,\r\n\t\t'author_label'\t\t=> $author_label,\r\n\t\t'send_label'\t\t=> $send_label,\r\n\t\t'target_email'\t\t=> $mpcth_options['mpcth_contact_email'],\r\n\t\t'email_required'\t=> $email_required,\r\n\t\t'empty_input_msg'\t=> __('Please input value!', 'mpcth'),\r\n\t\t'email_error_msg'\t=> __('Please provide valid author', 'mpcth'),\r\n\t\t'message_error_msg'\t=> __('Please provide valid email', 'mpcth'),\r\n\t\t'author_error_msg'\t=> __('Your message must be at least 5 characters long', 'mpcth'),\r\n\t\t'from_text'\t\t\t=> __('My blog - ', 'mpcth').get_bloginfo('title'),\r\n\t\t'subject_text'\t\t=> __('Message from ', 'mpcth'),\r\n\t\t'header_text'\t\t=> __('From: ', 'mpcth'),\r\n\t\t'body_name_text'\t=> __('Name: ', 'mpcth'),\r\n\t\t'body_email_text'\t=> __('Email: ', 'mpcth'),\r\n\t\t'body_msg_text'\t\t=> __('Message: ', 'mpcth'),\r\n\t\t'success_msg'\t\t=> __('Email successfully send!', 'mpcth'),\r\n\t\t'error_msg'\t\t\t=> __('There was an error. Please try again.', 'mpcth')\r\n\t) );\r\n\r\n\t$return = '';\r\n\t$return .=\r\n\t\t'<form action=\"'.MPC_THEME_ROOT.'/mpc-wp-boilerplate/php/mpcth-contact-form.php'.'\" id=\"mpcth_contact_form\" class=\"' . add_css_animation($css_animation) . '\" method=\"post\">'.\r\n\t\t\t'<p class=\"mpcth-cf-form-author\">'.\r\n\t\t\t\t'<input type=\"text\" name=\"author_cf\" id=\"author_cf\" value=\"'.$author_label.'*'.'\" class=\"requiredField comments_form author_cf\" tabindex=\"1\" onfocus=\"if(this.value==\\''.$author_label.'*\\') this.value=\\'\\';\" onblur=\"if(this.value==\\'\\')this.value=\\''.$author_label.'*\\';\"/>'.\r\n\t\t\t'</p>'.\r\n\t\t\t'<p class=\"mpcth-cf-form-email\">'.\r\n\t\t\t\t'<input type=\"text\" name=\"email_cf\" id=\"email_cf\" value=\"'.$email_label.'\" class=\"'.($email_required == '1' ? 'requiredField' : '').' comments_form email email_cf\" tabindex=\"2\" onfocus=\"if(this.value==\\''.$email_label.'\\') this.value=\\'\\';\" onblur=\"if(this.value==\\'\\')this.value=\\''.$email_label.'\\';\"/>'.\r\n\t\t\t'</p>'.\r\n\t\t\t'<p class=\"mpcth-cf-form-message\">'.\r\n\t\t\t\t'<textarea name=\"message_cf\" id=\"message_cf\" rows=\"1\" cols=\"1\" class=\"requiredField comments_form text_f message_cf\" tabindex=\"3\" onfocus=\"if(this.value==\\''.$message_label.'*\\') this.value=\\'\\';\" onblur=\"if(this.value==\\'\\')this.value=\\''.$message_label.'*\\';\">'.$message_label.'*'.'</textarea>'.\r\n\t\t\t'</p>'.\r\n\t\t\t'<p class=\"mpcth-cf-buttons\">'.\r\n\t\t\t\t'<input name=\"submit\" type=\"submit\" id=\"submit\" tabindex=\"4\" value=\"'.$send_label.'\" class=\"mpcth-cf-send\"/>'.\r\n\t\t\t\t'<input type=\"hidden\" name=\"submitted\" id=\"submitted\" value=\"true\" />'.\r\n\t\t\t'</p>'.\r\n\t\t\t'<p class=\"mpcth-cf-check\">'.\r\n\t\t\t\t'<input type=\"text\" name=\"checking\" id=\"checking\" class=\"checking\" value=\"\" style=\"display: none;\"/>'.\r\n\t\t\t'</p>'.\r\n\t\t\t'<div class=\"clear\"></div>'.\r\n\t\t'</form>'; \r\n\r\n\t$return = parse_shortcode_content($return);\r\n\treturn $return;\r\n}", "function monoque_contact_section()\n{\n echo 'Activate and Deactivate The Built-in Contact Form';\n}", "public function createShortcode()\n {\n $shortcode = '[gravityform id='.$this->formId;\n if ($this->getComponentField('show_description')) {\n $shortcode .= ' decription=true'; \n } else {\n $shortcode .= ' decription=false'; \n }\n if ($this->getComponentField('show_title')) { \n $shortcode .= ' title=true'; \n } else {\n $shortcode .= ' title=false'; \n }\n $shortcode .= ' ajax=true]';\n return $shortcode;\n }", "function ca_shortcode_init(){\n\t\tfunction ca_shortcode($atts = [], $content = null){\n\t\t\tif(get_option('ca_alert_type')['type'] == 'radio-alert'){\n\t\t\t\treturn ca_alert($content);\n\t\t\t}elseif(get_option('ca_alert_type')['type'] == 'radio-modal'){\n\t\t\t\treturn ca_modal($content);\n\t\t\t}else{\n\t\t\t\treturn ca_banner($content);\n\t\t\t}\n\t\t}\n\t\tadd_shortcode('combat-adblock', 'ca_shortcode');\n\t}", "function bambule_contact_section() {\n echo 'Activate an Deactivate the built-in Contact Form';\n}", "function najiub_contact_info_message()\n{\n echo 'Customize your Contact Information Links';\n}", "function wpgform_register_activation_hook()\n{\n $default_wpgform_options = array(\n 'sc_posts' => 1\n ,'sc_widgets' => 1\n ,'default_css' => 1\n ,'custom_css' => 0\n ,'custom_css_styles' => ''\n ,'donation_message' => 0\n ,'email_format' => WPGFORM_EMAIL_FORMAT_PLAIN\n ,'browser_check' => 0\n ) ;\n\n add_option('wpgform_options', $default_wpgform_options) ;\n //add_shortcode('wpgform', 'wpgform_shortcode') ;\n add_filter('widget_text', 'do_shortcode') ;\n}", "public function add_form_menu_page_handler() {\r\n echo do_shortcode( '[' . self::FORM_SHORTCODE . ']' );\r\n }", "function hs_create_form_shortcode($atts) {\n\t\tglobal $myhubspotwp;\n\t\t\n\t\textract(shortcode_atts(array(\n\t\t\t\"id\" => -1\n\t\t), $atts));\n\t\t\n\t\t$hs_content = $myhubspotwp->hs_format_text($this->hs_get_form($id));\n \n // Check for nested shortcodes\n $hs_content = do_shortcode($hs_content);\n \n\t\treturn $hs_content;\n\t}", "function support_contact_admin_area_head()\n{\n support_contact_script('support_contact_clients_area');\n}", "private function add_shortcodes()\n {\n }", "function program_cta_shortcode( $atts, $content = \"\" ) {\n $atts = shortcode_atts(array(\n 'loc' => '', // top or end\n 'show' => '', // (by) default, else requires true toggle\n 'default_content' => '', // blurb\n 'default_button' => 'Chat', // button text\n 'default_type' => 'url', // url or webtolead\n 'default_url' => '#def', // button url\n 'default_leadid' => '', // webtolead campaign ID\n 'default_leadret' => '', // webtolead return URL\n 'default_leadintro' => '', // webtolead form intro text\n ),$atts);\n\n /* set $atts['vars'] to $vars */\n foreach($atts as $key=>$val) { $$key = $val; }\n\n if (\n ( $show == 'default' && vo_meta('cta_toggle_'.$loc) != false ) // show by default & not hidden\n || ( vo_meta('cta_toggle_'.$loc)==true ) // visibility toggle is \"true\"\n ) {\n $cta_content = vo_meta('cta_content_'.$loc) ? : $default_content;\n $cta_button = vo_meta('cta_button_'.$loc) ?: $default_button;\n $cta_type = vo_meta('cta_type_'.$loc) ?: $default_type;\n $cta_url = vo_meta('cta_url_'.$loc) ?: $default_url;\n $cta_leadid = vo_meta('cta_leadid_'.$loc) ?: $default_leadid;\n $cta_leadret = vo_meta('cta_leadret_'.$loc) ?: get_the_permalink();\n $cta_leadintro = vo_meta('cta_leadintro_'.$loc) ?: $default_leadintro;\n $modal = $cta_type == 'webtolead' ? 'data-toggle=\"modal\" data-target=\"#ctaModal_'.$loc.'\"' : '';\n?>\n <div class=\"bg-light\" style=\"padding: 4em 0\">\n <div class=\"container\"><div class=\"row text-center\"><div class=\"col\">\n\n <img src=\"<?= get_template_directory_uri(); ?>/assets/images/logo/ventureout-logo.png\" alt=\"ventureout\" width=\"80\" /><br /><br />\n <h6 style=\"color:black\"><?=$cta_content?></h6><br />\n <a href=\"<?=$cta_url?>\" class=\"button min\" style=\"float:none;display: inline-block;\" <?=$modal?>><?=$cta_button?></a>\n\n </div></div></div>\n </div>\n\n<? if ($cta_type == 'webtolead') { ?>\n <div class=\"modal fade webtolead\" id=\"ctaModal_<?=$loc?>\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-body\">\n <?= wpautop($cta_leadintro) ?>\n <?= do_shortcode('[webtolead campaign=\"'.$cta_leadid.'\" return=\"'.$cta_leadret.'\"]') ?>\n </div>\n </div>\n </div>\n </div>\n<?\n } // end modal if webtolead\n } // end toggle CTA visibility\n}", "function yiw_sc_sample_func($atts, $content = null)\n{\n extract(shortcode_atts(array(\n 'class' => 'call-to-action',\n 'title' => null,\n 'incipit' => null,\n 'phone' => null\n ), $atts));\n\n $html = ''; // this is the var to use for the html output of shortcode\n\n return apply_filters( 'yiw_sc_sample_html', $html ); // this must be written for each shortcode\n}", "function msis_29_codex_add_help_text( $contextual_help, $screen_id, $screen ) {\n if ( 'msis_29' == $screen->id ) {\n $contextual_help =\n '<ul>' .\n '<li>' . __('Poniższe pytania dotyczą Pani/Pana zdania na temat wpływu stwardnienia rozsianego na Pani/Pana życie codzienne w ciągu ostatnich 14 dni', 'your_text_domain') . '</li>' .\n '<li>' . __('Przy każdym pytaniu proszę zaznaczyć jedną cyfrę, która najlepiej opisuje Pani/Pana sytuację.', 'your_text_domain') . '</li>' .\n '<li>' . __('Prosimy odpowiedzieć na wszystkie pytania.', 'your_text_domain') . '</li>' .\n '</ul>';\n\n } elseif ( 'edit-msis_29' == $screen->id ) {\n $contextual_help =\n '<p>' . __('To jest ekran pomocy wyświetlania tabeli zawartości ankiet.', 'your_text_domain') . '</p>' ;\n }\n return $contextual_help;\n}", "function civicrm_form_shortcode($attrs)\n{\n \n if ($_POST) {\n $option = get_option('civicrm');\n\n // TODO: Clean up input\n $first_name = $_POST[\"first_name\"];\n $last_name = $_POST[\"last_name\"];\n $email = $_POST[\"email\"];\n\n $contact_id = civicrm_add_contact($option['rest_url'], $option['site_key'], $option['api_key'], $first_name, $last_name, $email);\n // Only post an activity against this contact if activity_name and activity_subject are set in the [civicrm] shortcode\n if ($attrs['activity_name'] && $attrs['activity_subject'])\n civicrm_create_activity($option['rest_url'], $option['site_key'], $option['api_key'], $contact_id, $attrs['activity_name'], $attrs['activity_subject']);\n\n echo \"<p>Thanks for getting in touch! Your message has been sent</p>\";\n }\n?>\n <form action=\"\" method=\"post\" accept-charset=\"utf-8\" id=\"contact\">\n <p>\n Your First Name: <br>\n <input type=\"text\" name=\"first_name\" value=\"\" id=\"first_name\" />\n </p>\n\n <p>\n Your Last Name:<br>\n <input type=\"text\" name=\"last_name\" value=\"\" id=\"last_name\" />\n </p>\n\n <p>\n Email Address:<br>\n <input type=\"text\" name=\"email\" value=\"\" id=\"email\" />\n </p>\n \n <input type=\"submit\" value=\"contact\" name=\"contact\">\n</form>\n<?php\n}", "function sp_add_shortcodes() {\r\n\tadd_shortcode( 'col', 'col' );\r\n\tadd_shortcode( 'hr', 'sp_hr_shortcode_sc' );\r\n\tadd_shortcode( 'email_encoder', 'sp_email_encoder_sc' );\r\n\tadd_shortcode( 'slider', 'sp_slider_sc' );\r\n\tadd_shortcode( 'accordion', 'sp_accordion_shortcode' );\r\n\tadd_shortcode( 'accordion_section', 'sp_accordion_section_shortcode' );\t\r\n\tadd_shortcode( 'sc_gallery', 'sp_gallery_sc' );\r\n\t\r\n}", "function Onetouchcontact_widgetShow($vars) {\n\t$form='<form class=\"onetouchcontact\">Name<br/>'\n\t\t.'<input id=\"onetouchcontact-name\"/><br/>Email<br/>'\n\t\t.'<input id=\"onetouchcontact-email\"/><br/>';\n\tif ($vars->phone) {\n\t\t$form.='Phone<br/><input id=\"onetouchcontact-phone\" /><br/>';\n\t}\n\t$form.='<input type=\"hidden\" name=\"cid\" value=\"'.$vars->cid.'\"/>'\n\t\t.'<input type=\"hidden\" name=\"mid\" value=\"'.$vars->mid.'\"/>'\n\t\t.'<div class=\"onetouchcontact-msg\"></div>'\n\t\t.'<input class=\"submit\" type=\"submit\" value=\"subscribe\"/></form>';\n\tWW_addScript('onetouchcontact/frontend/js.js');\n\treturn $form;\n}", "public function addShortcodes ()\n\t\t{\n\t\t\tadd_shortcode('readmore', array(&$this, 'readmoreShortcode'));\n\t\t}", "function wporg_shortcode($atts = [], $content = null)\n{\n \n //$content = 'testadd';\n return $content;\n}", "function careerfy_vc_contact_information()\n{\n\n $cf7_posts = get_posts(array(\n 'post_type' => 'wpcf7_contact_form',\n 'numberposts' => -1\n ));\n $cf7_arr = array(\n esc_html__(\"Select Form\", \"careerfy-frame\") => ''\n );\n if (!empty($cf7_posts)) {\n foreach ($cf7_posts as $p) {\n $cf7_arr[$p->post_title] = $p->post_name;\n }\n }\n\n $params = array();\n $params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Contact Info title\", \"careerfy-frame\"),\n 'param_name' => 'con_info_title',\n 'value' => '',\n 'description' => '',\n );\n if (class_exists('WPCF7_ContactForm')) {\n $params[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Select Contact Form 7\", \"careerfy-frame\"),\n 'param_name' => 'con_form_7',\n 'value' => $cf7_arr,\n 'description' => '',\n );\n }\n $params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Contact Form title\", \"careerfy-frame\"),\n 'param_name' => 'con_form_title',\n 'value' => '',\n 'description' => '',\n );\n $params[] = array(\n 'type' => 'textarea',\n 'heading' => esc_html__(\"Description\", \"careerfy-frame\"),\n 'param_name' => 'con_desc',\n 'value' => '',\n 'description' => '',\n );\n $params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Address\", \"careerfy-frame\"),\n 'param_name' => 'con_address',\n 'value' => '',\n 'description' => '',\n );\n $params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Email\", \"careerfy-frame\"),\n 'param_name' => 'con_email',\n 'value' => '',\n 'description' => '',\n );\n $params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Phone\", \"careerfy-frame\"),\n 'param_name' => 'con_phone',\n 'value' => '',\n 'description' => '',\n );\n $params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Fax\", \"careerfy-frame\"),\n 'param_name' => 'con_fax',\n 'value' => '',\n 'description' => '',\n );\n $params[] = array(\n 'type' => 'param_group',\n 'value' => '',\n 'heading' => esc_html__(\"Social Links\", \"careerfy-frame\"),\n 'param_name' => 'social_links',\n 'params' => array(\n array(\n 'type' => 'iconpicker',\n 'value' => '',\n 'heading' => __('Social Icon', 'careerfy-frame'),\n 'param_name' => 'soc_icon',\n ),\n array(\n 'type' => 'textfield',\n 'value' => '',\n 'heading' => __('Social Link', 'careerfy-frame'),\n 'param_name' => 'soc_link',\n ),\n ),\n );\n $attributes = array(\n \"name\" => esc_html__(\"Contact Info\", \"careerfy-frame\"),\n \"base\" => \"careerfy_contact_info\",\n \"category\" => esc_html__(\"Careerfy Theme\", \"careerfy-frame\"),\n \"class\" => \"\",\n \"params\" => $params\n );\n\n if (function_exists('vc_map')) {\n vc_map($attributes);\n }\n}", "function sms_gateway_contact_edit_page() {\n return 'Contact edit page.';\n}" ]
[ "0.656786", "0.6543893", "0.64896065", "0.6415084", "0.63837504", "0.63604903", "0.6359647", "0.63261473", "0.6312902", "0.6311192", "0.6284726", "0.62683946", "0.6223527", "0.62051684", "0.61956275", "0.618428", "0.61818635", "0.6177587", "0.6157801", "0.61502826", "0.6143557", "0.6100614", "0.6092549", "0.60649806", "0.6064326", "0.6063092", "0.60403013", "0.60313094", "0.6024961", "0.60199755" ]
0.67943376
0
/ REMOVE PARENT FEATURES
function remove_parent_theme_features(){ remove_action('init', 'sydney_tables_module_cpt'); remove_action('init', 'sydney_toolbox_register_testimonials', 0); remove_action('load-post.php', 'call_Sydney_PT_Metabox' ); add_filter( 'theme_page_templates', 'remove_page_templates' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeChild() {\n // Not implemented yet...\n }", "public function uninstall($parent) \n {\n }", "function uninstall($parent) {\n }", "function remove_from_parent()\n {\n plugin::remove_from_parent();\n $ldap = $this->config->get_ldap_link();\n $ldap->rmDir($this->dn);\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));\n }\n new log(\"remove\",\"mimetypes/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());\n\n /* Optionally execute a command after we're done */\n $this->handle_post_events(\"remove\");\n\n /* Delete references to object groups */\n $ldap->cd ($this->config->current['BASE']);\n $ldap->search (\"(&(objectClass=gosaGroupOfNames)(member=\".LDAP::prepare4filter($this->dn).\"))\", array(\"cn\"));\n while ($ldap->fetch()){\n $og= new ogroup($this->config, $ldap->getDN());\n unset($og->member[$this->dn]);\n $og->save ();\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $og->dn, 0, get_class()));\n }\n }\n }", "public function remove()\n {\n parent::remove();\n }", "function wpse_58799_remove_parent_category() {\n if ('category' != $_GET['taxonomy'])\n return;\n\n $parent = 'parent()';\n\n if (isset($_GET['action']))\n $parent = 'parent().parent()';\n ?>\n <script type=\"text/javascript\">\n jQuery(document).ready(function($)\n { \n $('label[for=parent]').<?php echo $parent; ?>.remove(); \n });\n </script>\n <?php\n}", "public function test_changeParentWithoutParentWithoutExtras() {\n $grandchild = array_pop($this->fixture->getAllSections());\n $pagezone = $this->fixture->getRandomPageZoneForPlacement($grandchild);\n\n // remove extras on this page zone\n tx_newspaper_DB::getInstance()->deleteRows(\n 'tx_newspaper_pagezone_page_extras_mm', 'uid_local = ' . $pagezone->getUid()\n );\n $pagezone->rereadExtras();\n\n $this->assertEquals(0, sizeof($pagezone->getExtras()), sizeof($pagezone->getExtras()) . \" Extras left!\");\n\n $pagezone->changeParent(-1);\n\n $this->assertTrue(\n is_null($pagezone->getParentForPlacement()),\n \"Parent is \" . $pagezone->getParentForPlacement()\n );\n\n $inherited_extras = array_filter(\n $pagezone->getExtras(),\n function(tx_newspaper_Extra $e) { return $e->getOriginUid() != $e->getExtraUid(); }\n );\n\n $this->assertEquals(\n 0, sizeof($inherited_extras),\n sizeof($inherited_extras) . \" extras left: \" . print_r($inherited_extras, 1)\n );\n }", "public function deleteInheritance(){\n\t\t$this->setChildrenList();\n\t\t$sqlDel = \"DELETE FROM kmdescr \".\n\t\t\t\"WHERE (TID IN(\".$this->childrenStr.\")) \".\n\t\t\t\"AND (CID = \".$this->cid.\") AND (Inherited Is Not Null AND Inherited <> '')\";\n\t\t$this->conn->query($sqlDel);\n\t}", "protected function removeOne(){\n\t\t$nodeInfo = $this->getNodeInfo($this->_id);\n\t\t$select = $this->_db->select()\n\t\t\t\t\t\t->from($this->_name)\n\t\t\t\t\t\t->where('parents = ?', $nodeInfo['id'], INTEGER)\n\t\t\t\t\t\t->order('lft ASC');\n\t\t$result\t= $this->_db->fetchAll($select);\n\t\tforeach ($result as $k => $v){\n\t\t\t$childIds[] = $v['id'];\n\t\t}\n\t\trsort($childIds);\n\t\t\n\t\tif(count($childIds)>0){\n\t\t\tforeach ($childIds as $key => $val){\n\t\t\t\t$id = $val;\n\t\t\t\t$parent = $nodeInfo['parents'];\n\t\t\t\t$options = array('position'=>'after','brother_id'=>$nodeInfo['id']);\n\t\t\t\t$this->moveNode($id, $parent, $options);\n\t\t\t}\n\t\t\t$this->removeNode($nodeInfo['id']);\n\t\t}\n\t}", "function remove_from_parent()\n {\n $ldap= $this->config->get_ldap_link();\n\n /* Skip remove if this macro is still in use */\n $res = $ldap->search(\"(&(objectClass=goFonAccount)(objectClass=gosaAccount)(goFonMacro=*))\", array(\"goFonMacro\", \"cn\"));\n while ($val = $ldap->fetch()){ \n if(strstr($val['goFonMacro'][0],$this->dn)){ \n msg_dialog::display(_(\"Error\"), sprintf(_(\"Cannot delete entry because it is still in use by '%s'!\"), $val['cn'][0]), ERROR_DIALOG);\n return false;\n }\n }\n\n /* Try to remove from database */\n if(count($this->goFonHomeServers)){\n $str = $this->remove_from_database(true);\n if($str){ \n msg_dialog::display(_(\"Error\"), $str, ERROR_DIALOG);\n return false;\n }\n }else{\n msg_dialog::display(_(\"Configuration error\"), msgPool::noserver(_(\"GOfon\")), WARNING_DIALOG);\n return false;\n }\n\n /* Remove phone macro */ \n $ldap->rmDir($this->dn);\n new log(\"remove\",\"gofonmacro/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); \n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));\n }\n\n /* Delete references to object groups */\n $ldap->cd ($this->config->current['BASE']);\n $ldap->search (\"(&(objectClass=gosaGroupOfNames)(member=\".LDAP::prepare4filter($this->dn).\"))\", array(\"cn\"));\n while ($ldap->fetch()){\n $og= new ogroup($this->config, $ldap->getDN());\n unset($og->member[$this->dn]);\n $og->save ();\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));\n }\n }\n }", "function removeChild($name);", "function tapestry_remove_elements() {\n\t\n\t// Remove if post has format\n\tif ( get_post_format() ) {\n\t\tremove_action( 'genesis_post_title', 'genesis_do_post_title' );\n\t\tremove_action( 'genesis_before_post_content', 'genesis_post_info' );\n\t\tremove_action( 'genesis_after_post_content', 'genesis_post_meta' );\n\t}\n\t// Add back, as post has no format\n\telse {\n\t\tadd_action( 'genesis_post_title', 'genesis_do_post_title' );\n\t\tadd_action( 'genesis_before_post_content', 'genesis_post_info' );\n\t\tadd_action( 'genesis_after_post_content', 'genesis_post_meta' );\n\t}\n\t\n}", "function uninstall($parent)\n\t {\n\t\t// $parent is the calss calling this method\n\t }", "final public function removeChild(CtkBuildable $node) {\n\t\tthrow new CakeException(sprintf('Unknown child %s', get_class($node)));\n\t}", "public function deleteChildren()\n {\n \tstatic::deleteAll(['parent' => $this->id]);\n }", "public function destroyDescendants();", "function remove(){\n if(isset($this -> node -> medien)){\n // Medien\n foreach($this -> node -> medien as $entity){\n entity_delete('medium', $entity -> id);\n }\n }\n\n // remove PLZ-Sperren \n $manager = new \\LK\\Kampagne\\SperrenManager(); \n $result = db_query('SELECT field_medium_node_nid as nid, entity_id, entity_type FROM {field_data_field_medium_node} WHERE field_medium_node_nid =:nid', array(':nids' => $this -> node -> nid));\n foreach ($result as $record) {\n if($record -> entity_type === \"plz\"){\n $manager ->removeSperre($record -> entity_id);\n }\n }\n }", "function reloaded_related_remove() {\n global $db, $reloadedStack;\n \n //Auto install check\n $reloadedRelatedCheck = $db->Execute(\"SHOW COLUMNS FROM \" . TABLE_PRODUCTS . \" LIKE 'products_family'\");\n if($reloadedRelatedCheck->RecordCount() > 0 )\n {\n $db->Execute(\"ALTER TABLE \" . TABLE_PRODUCTS . \" DROP products_family\");\n }\n \n //Get configuration keys for mod\n $keys = reloaded_related_keys();\n \n $db->Execute(\"DELETE FROM \".TABLE_CONFIGURATION.\" WHERE configuration_key IN ('\" . implode(\"', '\", $keys) . \"')\");\n\t\t\n unset($keys);\n\t\t\n $reloadedStack->add_session('Related Products successfully removed', 'success');\n\t\t\n zen_redirect(zen_href_link('index.php'));\n \n }", "static function uninstall(): void {\n $sql = SQL::current();\n\n $sql->drop(\"categorize\");\n $sql->delete(\n table:\"post_attributes\",\n conds:array(\"name\" => \"category_id\")\n );\n }", "public function delete_tree() {\n\t\tif ( $this->child()->count() > 0 ) {\n\t\t\tforeach ( $this->child()->get() as $item ) {\n\n\t\t\t\t$item->delete_tree();\n\t\t\t}\n\t\t}\n\t\t$fe_path = app_path( '/views/frontend/pages' );\n\t\tif ( File::isFile( $fe_path . '/' . $this->slug . '.blade.php' ) ) {\n\t\t\tFile::delete( $fe_path . '/' . $this->slug . '.blade.php' );\n\t\t}\n\t\tif ( File::isFile( public_path( $this->image ) ) ) {\n\t\t\tFile::delete( public_path( $this->image ) );\n\t\t}\n\t\t$this->delete();\n\n\t\treturn;\n\t}", "function uninstall($parent)\n\t{\n\t\t//echo '<p>The module has been uninstalled</p>';\n\t}", "function remove_from_parent()\n {\n if ((!$this->initially_was_account) || (!$this->acl_is_removeable())){\n return;\n }\n\n plugin::remove_from_parent();\n $ldap= $this->config->get_ldap_link();\n\n $ldap->cd($this->dn);\n @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,\n $this->attributes, \"Save\");\n $this->cleanup();\n $ldap->modify ($this->attrs); \n\n /* Log last action */\n new log(\"remove\",\"users/\".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());\n \n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));\n }\n\n /* Optionally execute a command after we're done */\n $this->handle_post_events('remove',array(\"uid\" => $this->uid));\n }", "public function test_changeParentWithoutParentAndPresentExtras() {\n $parent_section = new tx_newspaper_Section($this->fixture->getParentSectionUid());\n $grandchild = array_pop($parent_section->getChildSections(true));\n $pageZone = $this->fixture->getRandomPageZoneForPlacement($grandchild);\n\n $pageZone->changeParent(-1);\n\n $this->assertTrue(\n is_null($pageZone->getParentForPlacement()),\n \"Parent is \" . $pageZone->getParentForPlacement()\n );\n\n $inherited_extras = array_filter(\n $pageZone->getExtras(),\n function(tx_newspaper_Extra $e) { return $e->getOriginUid() != $e->getExtraUid(); }\n );\n\n $this->assertEquals(\n 0, sizeof($inherited_extras),\n sizeof($inherited_extras) . \" extras left: \" . print_r($inherited_extras, 1)\n );\n }", "function remove_parent_filters()\n{\n\tremove_filter('excerpt_more', 'understrap_custom_excerpt_more');\n\tremove_filter('wp_trim_excerpt', 'understrap_all_excerpts_get_more_link');\n}", "function pixelgrade_jetpackme_remove_rp() {\n\tif ( class_exists( 'Jetpack_RelatedPosts' ) ) {\n\t\t$jprp = Jetpack_RelatedPosts::init();\n\t\t$callback = array( $jprp, 'filter_add_target_to_dom' );\n\t\tremove_filter( 'the_content', $callback, 40 );\n\t}\n}", "function _collapse(){\n foreach ($this->_branches as $key=>$value) {\n # $this->_branches[$key]->destroy();\n unset($this->_branches[$key]);\n }\n\n }", "public function unregisterChildren() {\n\n foreach ($this->children as $child) {\n if ($child instanceof BranchNode)\n $child->unregisterChildren();\n\n $child->unlink();\n\n $this->rootApplication->registry->removeSilent($child);\n }\n }", "function tripal_quick_fasta_fetch_parent_feature($feature_id, $parent_type_id) {\n\n $query = db_select('chado.feature_relationship', 'fr');\n $query->join('chado.feature', 'f', 'fr.object_id = f.feature_id');\n $query->fields('f', ['uniquename']);\n $query->condition('fr.subject_id', $feature_id);\n $query->condition('f.type_id', $parent_type_id);\n $result = $query->execute()->fetchField();\n return $result;\n}", "public function removeFromTree() {\n\t\ttry {\n\t\t\t$this->config->getDOM()->documentElement->appendChild($this->getNode());\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function removeChild() {\n\n $args = func_get_args();\n $return = array();\n\n for ($n = 0; $n < sizeof($args); $n++) {\n if (is_array($args[$n]))\n array_splice($args, $n, 1, $args[$n]);\n\n $obj = $args[$n];\n\n if (( $index = array_search($obj, $this->children, TRUE) ) === FALSE)\n throw new SFException('Node is not a child of this BranchNode', ERR_REPORT_APP);\n\n $this->fireLocalEvent('onBeforeRemoveChild', array($obj));\n\n if ($obj instanceof BranchNode && $this->isRegistered)\n $obj->unregisterChildren();\n\n $obj->unlink();\n\n array_splice($this->children, $index, 1);\n\n if ($this->isRegistered)\n $this->rootApplication->registry->remove($obj);\n\n $obj->unbind();\n\n $this->fireLocalEvent('onAfterRemoveChild', array($obj));\n\n array_push($return, $obj);\n }\n\n return TRUE;\n }" ]
[ "0.6360314", "0.6142839", "0.60760677", "0.60528356", "0.58836937", "0.5840819", "0.5717081", "0.571413", "0.5672608", "0.56104857", "0.5550023", "0.5543276", "0.5538718", "0.54912686", "0.54865706", "0.5442203", "0.5440159", "0.5370893", "0.53613555", "0.5340625", "0.53400403", "0.53268546", "0.53241915", "0.53228134", "0.52989495", "0.5292917", "0.52519196", "0.52351105", "0.5223002", "0.5210192" ]
0.63307196
1
/ REQUIRE CUSTOM SYDNEY BASED WIDGETS add GISAI tab to widgets menu
function add_widget_tabs($tabs) { $tabs[] = array( 'title' => __('GISAI widgets', 'GISAI'), 'filter' => array( 'groups' => array('GISAI') ) ); // TODO: Remove Sydney empty tab from sidebar return $tabs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_ioa_infographics() {\n\tglobal $wp_meta_boxes;\n\twp_add_dashboard_widget('ioa_infographic', 'Stats', 'ioa_infographics');\n\t\n\n\t$my_widget = $wp_meta_boxes['dashboard']['normal']['core']['ioa_infographic'];\n unset($wp_meta_boxes['dashboard']['normal']['core']['ioa_infographic']);\n $wp_meta_boxes['dashboard']['side']['core']['ioa_infographic'] = $my_widget;\n\n\t\n}", "function kwer_load_widgets() {\n\t\n\t// Call-to-action button link\n register_widget( 'Kwer_Widget_CTA_Btn' );\n register_widget( 'Kwer_Widget_Hours' );\n register_widget( 'Kwer_Widget_Text' );\n \n}", "function dweb_theme_widgets_tab($tabs){\n\t$tabs[] = array(\n\t\t'title' => __('DWeb Theme Widgets', 'dweb'),\n\t\t'filter' => array(\n\t\t\t'groups' => array('dweb-theme')\n\t\t)\n\t);\n\treturn $tabs;\n}", "function HtmlTabPlugin_admin_actions()\n{\t \n\tadd_options_page('HtmlTabPlugin','HtmlTabPlugin-Text','manage_options',_FILE_,'HtmlTabPlugin_admin');//Add to Setting as sub item\n\t//add_options_page('HtmlTabPlugin','HtmlTabPlugin-Text','manage_options',_FILE_,'HtmlTabPlugin_admin');\n\t//add_object_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show bottom comment as new Item\n\t//add_utility_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show on bottom as new Item\n\t//add_menu_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show on bottom as new Item\n}", "public function init() {\n// (Needs to implement the SpaceControllerBehavior)\n $spaceGuid = Yii::app()->getController()->getSpace()->guid;\n $space = Yii::app()->getController()->getSpace();\n\n\n $this->addItemGroup(array(\n 'id' => 'admin',\n 'label' => Yii::t('SpaceModule.widgets_SpaceAdminMenuWidget', '<strong>Group</strong> preferences'),\n 'sortOrder' => 100,\n ));\n\n // check user rights\n if ($space->isAdmin()) {\n $this->addItem(array(\n 'label' => Yii::t('SpaceModule.widgets_SpaceAdminMenuWidget', 'General'),\n 'group' => 'admin',\n 'url' => Yii::app()->createUrl('//space/admin/edit', array('sguid' => $spaceGuid)),\n 'icon' => '<i class=\"fa fa-cogs\"></i>',\n 'sortOrder' => 100,\n 'isActive' => (Yii::app()->controller->id == \"admin\" && Yii::app()->controller->action->id == \"edit\"),\n ));\n }\n\n // check user rights\n if ($space->isAdmin()) {\n $this->addItem(array(\n 'label' => Yii::t('SpaceModule.widgets_SpaceAdminMenuWidget', 'Members'),\n 'group' => 'admin',\n 'url' => Yii::app()->createUrl('//space/admin/members', array('sguid' => $spaceGuid)),\n 'icon' => '<i class=\"fa fa-group\"></i>',\n 'sortOrder' => 200,\n 'isActive' => (Yii::app()->controller->id == \"admin\" && Yii::app()->controller->action->id == \"members\"),\n ));\n }\n# $this->addItem(array(\n# 'label' => Yii::t('SpaceModule.widgets_SpaceAdminMenuWidget', 'Delete'),\n# 'url' => Yii::app()->createUrl('//space/admin/delete', array('sguid'=>$spaceGuid)),\n# 'sortOrder' => 500,\n# 'isActive' => (Yii::app()->controller->id == \"admin\" && Yii::app()->controller->action->id == \"delete\"),\n# ));\n# $this->addItem(array(\n# 'label' => Yii::t('SpaceModule.widgets_SpaceAdminMenuWidget', 'Back to workspace'),\n# 'url' => Yii::app()->createUrl('//space/space', array('sguid'=>$spaceGuid)),\n# 'sortOrder' => 1000,\n# ));\n\n\n parent::init();\n }", "function TZ_tab_Widget() {\n\t\n\t\t/* Widget settings */\n\t\t$widget_ops = array( 'classname' => 'tz_tab_widget', 'description' => __('A tab for recent tweets, facebook fanpage, linkedin posts and flickr photos.', 'framework') );\n\n\t\t/* Create the widget */\n\t\t$this->WP_Widget( 'tz_tab_widget', __('Easy Social Tabs', 'framework'), $widget_ops, $control_ops );\n\t}", "function add_ioa_admin_links() {\n\tglobal $wp_meta_boxes;\n\twp_add_dashboard_widget('ioa_admin_link', __('Quick Links','ioa'), 'ioa_admin_links');\n\t\n\n\t$my_widget = $wp_meta_boxes['dashboard']['normal']['core']['ioa_admin_link'];\n unset($wp_meta_boxes['dashboard']['normal']['core']['ioa_admin_link']);\n $wp_meta_boxes['dashboard']['side']['core']['ioa_admin_link'] = $my_widget;\n\n\t\n}", "function una_add_dash_widget3() { // Function\n wp_add_dashboard_widget ( // Register\n 'unamuno_dash_widget3', // Slug\n 'Petitions', // Title\n 'una_dash_widget_display3' // Callback\n );\n }", "public function widget_scripts() {}", "function fitts_widget_areas() {\r\n\r\n\r\n\r\n}", "function kcsu_widgets_init() {\n \n register_sidebar( array(\n 'name' => 'Home sidebar before menu',\n 'id' => 'home_right_1',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ) );\n \n register_sidebar( array(\n 'name' => 'Home sidebar after menu',\n 'id' => 'home_right_2',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ) );\n }", "function load_widgets() {\n // register_widget('ThemeWidgetGallery');\n}", "function una_add_dash_widget1() { // Function\n wp_add_dashboard_widget ( // Register\n 'unamuno_dash_widget1', // Slug\n 'Policy &amp; Profiles', // Title\n 'una_dash_widget_display1' // Display\n );\n}", "function nicholls_theme_widgets_home_special() {\n\tfnbx_generate_widgets( 'home-special' );\n}", "function mbtng_output_menu ($args) {\r\n// John Lisle commented out next line, added lines 2 and 3 after this\r\n//\tglobal $allow_admin, $languages_path; \r\n\tglobal $languages_path; // John Lisle\r\n\t$allow_admin = $_SESSION['allow_admin']; // John Lisle\r\n// the next line is to display the widgets NOT on the TNG page\r\n\tif (!mbtng_display_widget()) {\r\n\t\textract($args);\r\n\t\t$tng_folder = get_option('mbtng_path');\r\n\t\tchdir($tng_folder);\r\n\t\tinclude('begin.php');\r\n\t\tinclude_once($cms['tngpath'] . \"genlib.php\");\r\n\t\tinclude($cms['tngpath'] . \"getlang.php\");\r\n\t\tinclude($cms['tngpath'] . \"{$mylanguage}/text.php\");\r\n\t\techo $before_widget;\r\n\t\techo $before_title.'Genealogy Menu'.$after_title;\r\n\t\t$base_url = mbtng_base_url();\r\n\t\techo \"<ul>\\n\";\r\n\t\techo \"<li class=\\\"surnames\\\" style=\\\"font-weight:bold\\\"><a href=\\\"{$base_url}surnames.php\\\">{$text['mnulastnames']}</a></li>\\n\";\r\n\t\techo \"</ul>\\n\";\r\n\t\techo \"<ul style=\\\"margin-top:0.75em\\\">\\n\";\r\n\t\techo \"<li class=\\\"whatsnew\\\"><a href=\\\"{$base_url}whatsnew.php\\\">{$text['mnuwhatsnew']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"mostwanted\\\"><a href=\\\"{$base_url}mostwanted.php\\\">{$text['mostwanted']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"media\\\"><a href=\\\"{$base_url}browsemedia.php\\\">{$text['allmedia']}</a>\\n\";\r\n\t\t\techo \"<ul>\\n\";\r\n\t\t\techo \"<li class=\\\"photos\\\"><a href=\\\"{$base_url}browsemedia.php?mediatypeID=photos\\\">{$text['mnuphotos']}</a></li>\\n\";\r\n\t\t\techo \"<li class=\\\"histories\\\"><a href=\\\"{$base_url}browsemedia.php?mediatypeID=histories\\\">{$text['mnuhistories']}</a></li>\\n\";\r\n\t\t\techo \"<li class=\\\"documents\\\"><a href=\\\"{$base_url}browsemedia.php?mediatypeID=documents\\\">{$text['documents']}</a></li>\\n\";\r\n\t\t\techo \"<li class=\\\"videos\\\"><a href=\\\"{$base_url}browsemedia.php?mediatypeID=videos\\\">{$text['videos']}</a></li>\\n\";\r\n\t\t\techo \"<li class=\\\"recordings\\\"><a href=\\\"{$base_url}browsemedia.php?mediatypeID=recordings\\\">{$text['recordings']}</a></li>\\n\";\r\n\t\t\techo \"</ul></li>\";\r\n\t\techo \"<li class=\\\"albums\\\"><a href=\\\"{$base_url}browsealbums.php\\\">{$text['albums']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"cemeteries\\\"><a href=\\\"{$base_url}cemeteries.php\\\">{$text['mnucemeteries']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"heastones\\\"><a href=\\\"{$base_url}browsemedia.php?mediatypeID=headstones\\\">{$text['mnutombstones']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"places\\\"><a href=\\\"{$base_url}places.php\\\">{$text['places']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"notes\\\"><a href=\\\"{$base_url}browsenotes.php\\\">{$text['notes']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"anniversaries\\\"><a href=\\\"{$base_url}anniversaries.php\\\">{$text['anniversaries']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"reports\\\"><a href=\\\"{$base_url}reports.php\\\">{$text['mnureports']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"sources\\\"><a href=\\\"{$base_url}browsesources.php\\\">{$text['mnusources']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"repos\\\"><a href=\\\"{$base_url}browserepos.php\\\">{$text['repositories']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"trees\\\"><a href=\\\"{$base_url}browsetrees.php\\\">{$text['mnustatistics']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"language\\\"><a href=\\\"{$base_url}changelanguage.php\\\">{$text['mnulanguage']}</a></li>\\n\";\r\n\t\tif ($allow_admin) {\r\n\t\t\techo \"<li class=\\\"showlog\\\"><a href=\\\"{$base_url}showlog.php\\\">{$text['mnushowlog']}</a></li>\\n\";\r\n\t\t\techo \"<li class=\\\"admin\\\"><a href=\\\"{$base_url}admin.php\\\">{$text['mnuadmin']}</a></li>\\n\";\r\n\t\t}\r\n\t\techo \"<li class=\\\"bookmarks\\\"><a href=\\\"{$base_url}bookmarks.php\\\">{$text['bookmarks']}</a></li>\\n\";\r\n\t\techo \"<li class=\\\"suggest\\\"><a href=\\\"{$base_url}suggest.php\\\">{$text['contactus']}</a></li>\\n\";\r\n\t\techo \"</ul>\\n\";\r\n\t\techo \"<ul style=\\\"margin-top:0.75em\\\">\\n\";\r\n\t\tif (!is_user_logged_in()) {\r\n\t\t\techo \"<li class=\\\"register\\\" style=\\\"font-weight:bold\\\"><a href=\\\"{$base_url}newacctform.php\\\">{$text['mnuregister']}</a></li>\\n\";\r\n\t\t\techo \"<li class=\\\"login\\\" style=\\\"font-weight:bold\\\"><a href=\\\"{$base_url}login.php\\\">{$text['mnulogon']}</a></li>\\n\";\r\n\t\t} else {\r\n\t\t\tif (function_exists('wp_logout_url'))\r\n\t\t\t\techo \"<li class=\\\"logout\\\" style=\\\"font-weight:bold\\\"><a href=\\\"\".html_entity_decode(wp_logout_url()).\"\\\">{$text['logout']}</a></li>\\n\";\r\n\t\t\telse\r\n\t\t\t\techo \"<li class=\\\"logout\\\" style=\\\"font-weight:bold\\\"><a href=\\\"\".trailingslashit(get_bloginfo('wpurl')).\"wp-login.php?action=logout\".\"\\\">{$text['logout']}</a></li>\\n\";\r\n\t\t}\r\n\t\techo \"</ul>\";\r\n\t\techo $after_widget;\r\n\t}\r\n}", "function widget_display() { }", "function getTab()\n {\n return Html::el(\"span\")\n ->addHtml(Html::el(\"img\")\n ->setAttribute(\"width\",15)\n ->setAttribute(\"src\",\"data:image/png;base64,\".base64_encode(FileSystem::read(__DIR__.\"/icon.png\"))))\n ->addHtml(Html::el(\"\")\n ->addText(\" GraphQL\"));\n }", "function st_widgets_init() {\n \n}", "function casino2_widgets_init() {\n /* Pinegrow generated Register Sidebars Begin */\n\n /* Pinegrow generated Register Sidebars End */\n}", "function rgw_ordini_aperti($site,$gas){\n//array_push($site->css,\"widgets_ui\");\n\n// Nome id del widget\n$w_name = \"rgw_2\";\n\n\n// Negli array dei comandi java a fondo pagina inserisco le cose necessarie al widget\n//$site->java_scripts_bottom_body[]='<script type=\"text/javascript\">$(\"#'.$w_name.'\").draggable({});</script>';\n\n// istanzio un nuovo oggetto widget\n$w = new rg_widget();\n\n// Imposto le propriet? del widget\n$w->name = $w_name;\n$w->title=\"Ordini Aperti <cite style=\\\"font-size:.7em\\\">( \".n_ordini_partecipabili($gas).\" )</cite>\";\n$w->toggle_state =\"show\";\n$w->content = main_render_quick_ordini_aperti($gas);\n$w->footer = \"Ordini aperti visibili dal \".gas_nome($gas);\n$w->use_handler =false;\n// Eseguo il rendering\n$h = $w->rgw_render();\n\n// Distruggo il widget\nunset($w);\n\n//Ritorno l'HTML\nreturn $h;\n\n\n}", "abstract protected function get_widget();", "function _rex721_add_tab_option($params) {\n echo '<a href=\"#\" class=\"rex488_extra_settings_tab\" rel=\"social\" onclick=\"Rexblog.Article.ToggleExtraSettings(this, event);\">Social Links</a>&nbsp;|&nbsp;';\n}", "public function addWidgets()\n\t{\n\t}", "function add_dashboard_widget()\n{\n wp_add_dashboard_widget(\"IFP\", \"GRG Website Information\", \"display_ifp_dashboard_widget\");\n}", "function ipr_load_widget() {\n register_widget( 'IPR_Widget' );\n}", "function symmetri_dashwidget() { ?>\n\t\t<ul>\n\n\t\t\t<li><a href=\"post-new.php?post_type=symmetri_cpt_gallery\"><?php _e( 'Add new work item (image gallery)', 'symmetri' ); ?></a></li>\n\n\t\t\t<li><a href=\"edit.php?post_type=symmetri_cpt_gallery\"><?php _e( 'See all work items (shown on front page)', 'symmetri' ); ?></a></li>\n\n\t\t\t<li><a href=\"post-new.php\"><?php _e( 'Add new blog post (for category \"Work in progress\")', 'symmetri' ); ?></a></li>\n\n\t\t\t<li><a href=\"edit.php?post_type=page\"><?php _e( 'Edit pages (i.e. About, Contact)', 'symmetri' ); ?></a></li>\n\n\t\t</ul>\n\n\t\t<?php\n\t}", "function adding_admin_bar(){\n\n\tadd_menu_page(\n\t\t'i-learn_wp',\n\t\t'learning_plugin',\n\t\t'manage_options',\n\t\t'clicked',\n\t\t'wp_plugin_used',\n\t\t'',\n\t\t2\n\t\t\n\t\t\n\t\t);\n}", "public function __construct() {\n parent::__construct('bbfootball_menu_widget', 'Odds Menu', array(\n 'description' => 'Add a list of odds countries and leagues',\n 'customize_selective_refresh' => true,\n\t\t));\n }", "function aboutme_load_widget() {\n\n register_widget( __NAMESPACE__ . '\\\\aboutme_widget' );\n\n}", "function arphabet_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Top sidebar',\n\t\t'id' => 'header_top',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n //Register social-icons sidebar\n\n register_sidebar(array(\n 'name' => 'Social Icons',\n 'id' => 'soc_icons',\n 'before_widget' => '',\n 'after_widget' => '',\n 'before_title' => '<span style=\"display: none;\">',\n 'after_title' => '</span>',\n ) );\n\n}" ]
[ "0.6591895", "0.6475923", "0.63897246", "0.63807756", "0.6325719", "0.63189733", "0.630435", "0.62302566", "0.6227673", "0.6215903", "0.6140052", "0.613092", "0.6129323", "0.612624", "0.6091244", "0.608796", "0.6072735", "0.60646546", "0.6054723", "0.6053475", "0.6040442", "0.60351986", "0.6034892", "0.6027275", "0.6019035", "0.5997949", "0.59977555", "0.5994256", "0.5993542", "0.597997" ]
0.6717949
0
/ / /Method Name: Assemble List of PostHeart /Description: Assembles List of PostHeart from Results / /
public function AssembleList($result) { $this->logger->debug("START"); $aList = array(); try { if (!mysqli_num_rows($result)) { return $aList; } while ($row = mysqli_fetch_array($result)) { $postHeart = new PostHeart(); $postHeart->setHeartID($row['heartid']); $postHeart->setAppUserID($row['appuserid']); $postHeart->setPostID($row['postid']); $postHeart->setCreateDate($row['createdate']); $postHeart->setIsValid($row['isvalid']); $postHeart->setRemoveDate($row['removedate']); $aList[] = $postHeart; } } catch (Exception $ex) { $this->logger->error($query . "\n" . $ex->getMessage() . "\n" . $ex->getTraceAsString()); throw ex; } $this->logger->debug("END"); return $aList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AssemblePostHeart($result)\n\t\t{\n\t\t\t$this->logger->debug(\"START\");\n\t\t\t$postHeart = new PostHeart();\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (!mysqli_num_rows($result))\n\t\t\t\t{\n\t\t\t\t\treturn $postHeart;\n\t\t\t\t}\n\t\t\t\tif ($row = mysqli_fetch_array($result))\n\t\t\t\t{\n\t\t\t\t\t$postHeart->setHeartID($row['heartid']);\n\t\t\t\t\t$postHeart->setAppUserID($row['appuserid']);\n\t\t\t\t\t$postHeart->setPostID($row['postid']);\n\t\t\t\t\t$postHeart->setCreateDate($row['createdate']);\n\t\t\t\t\t$postHeart->setIsValid($row['isvalid']);\n\t\t\t\t\t$postHeart->setRemoveDate($row['removedate']);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$this->logger->error($query . \"\\n\" . $ex->getMessage() . \"\\n\" . $ex->getTraceAsString());\n\t\t\t\tthrow ex;\n\t\t\t}\n\t\t\t$this->logger->debug(\"END\");\n\t\t\treturn $postHeart;\n\t\t}", "private function getPosts(){\r\n\r\n $reactionType = 'post';\r\n\r\n \t\twhile($post = $this->Query->assoc($this->execQuery)){\r\n\r\n \t\t\t$mediaId = $post['media_id'];\r\n\r\n \t\t\t$mediaOwnerId = $post['user_id'];\r\n\r\n require_once('C:/xampp/htdocs/kampuscrush/api/user/user.php');\r\n\r\n # Create User Object\r\n $User = new User(2, $mediaOwnerId, $this->Id);\r\n\r\n $this->Reply['list'] = true;\r\n\r\n \t\t\t$this->Reply['posts'][] = array(\r\n \t\t\t\t# User Information\r\n \t\t\t\t\"user\" => $User->init(),\r\n\r\n \t\t\t\t# Actual Posts Details\r\n \t\t\t\t\"post\" => $post, # Since $post Is An Associative Array Itself\r\n\r\n \t\t\t\t\"commentCount\" => $this->Query->count(\"SELECT count(comment_id) FROM comments WHERE post_id = '$mediaId'\"),\r\n\r\n \t\t\t\t\"likesCount\" => $this->Query->count(\"SELECT count(like_id) FROM reaction WHERE post_id = '$mediaId' AND type = '$reactionType'\"),\r\n\r\n \t\t\t\t\"isLiked\" => $this->Query->count(\"SELECT count(like_id) FROM reaction WHERE post_id = '$mediaId' AND liker_id = '$this->Id' AND type = '$reactionType'\") == 0 ? false : true,\r\n \r\n \"views\" => $this->Query->count(\"SELECT count(play_id) FROM plays WHERE post_id = '$mediaId'\")\r\n \r\n \t\t\t); # End Of Array\r\n\r\n \t\t} # End Of While Loop\r\n \t\t\r\n return $this->Reply;\r\n \t}", "protected function processListings()\n {\n //$fields = $this->entity_info['parameters'];\n $new_results = [];\n\n if (!empty($this->list_results))\n {\n foreach ($this->list_results as $result)\n {\n $new_result = [\n 'Handle' => $result->getHandle()\n ];\n\n $new_results[] = $new_result;\n }\n\n $this->list_results = $new_results;\n }\n }", "public function index()\n {\n try {\n $posts = $this->getPostContract()\n ->fetch($this->inputs());\n } catch (\\Exception $Exception) {\n return $this->responseAdapter->responseWithException($Exception);\n }\n\n return $this->responseAdapter->response($posts);\n }", "public function listPost($param){\n\n extract($param);\n $map = ['tid'=>$this->block,'status'=>1];\n if($kword) $map['title'] = ['like','%'.$kword.'%'];\n $field = 'id,uid,title,create_time,update_time,content,top,special,reply_limit,views,repeat_id';\n $r = (new BbsPostLogicV2)->query($map,['curpage'=>$page,'size'=>$size],'create_time desc',false,$field);\n $list = $r['list'];\n $count = $r['count'];\n foreach ($list as &$v) {\n $v['uname'] = get_nickname($v['uid']);\n // 回复统计\n $r = (new BbsReplyLogicV2)->countReply($v['id']);\n $v['replys_count'] = $r[0];\n $v['replys_direct_count'] = $r[1];\n // 图片 (max:10)\n $r = (new BbsAttachLogicV2)->query(['pid'=>$v['id'],'rid'=>0],['curpage'=>1,'size'=>BbsLogicV2::MAX_POST_IMG],false,false,'img');\n $v['img'] = array_keys(changeArrayKey($r['list'],'img'));\n $v['content'] = BbsPostLogicV2::subPureContent($v['content']);\n\n $v['has_like'] = (new LikeLogicV2)->hasLikePost($uid,$v['id']);\n $v['likes'] = (new LikeLogicV2)->countPost($v['id']);\n // 时间转换\n $v['create_time_desc'] = getDateDesc($v['create_time'],'Y-m-d');\n // 转发信息\n if($v['repeat_id']>0){\n $r = $this->getDetail($v['repeat_id'],$uid);\n if(!$r['status']) return $r;\n $r['info']['content'] = BbsPostLogicV2::subPureContent($r['info']['content']);\n $v['repeat_info'] = $r['info'];\n $v['repeat_count'] = $r['info']['repeat_count'];\n }else{\n $v['repeat_info'] = ['temp'=>''];\n $v['repeat_count'] = 0;\n }\n } unset($v);\n\n return ['count'=>$count,'list'=>$list];\n }", "public function postLiveResults();", "public function get_results() {\n return Timber::get_posts($this->params());\n }", "function return_posts(){\n $postNum = 5;\n if (func_get_arg(0) == \"latest\") {\n $json_url = hostname.\"/latest.json\";\n }elseif (func_get_arg(0) == \"weekly\") {\n $json_url = hostname.\"/top/weekly.json\";\n }\n\n $fromUsername = func_get_arg(1);\n $toUsername = func_get_arg(2);\n \n $json = file_get_contents($json_url);\n if ($json != null){\n $posts = json_decode($json);\n } else{\n throw new Exception(\"Error Json Request\", 1);\n }\n $titles = array();\n $images = array();\n $urls = array();\n \n $topics = $posts->topic_list->topics;\n for ($i=0; $i <= $postNum-1 && $i <= count($topics)-1; $i++) { \n $titles[$i] = $topics[$i]->title;\n // if there's no img or the only img is from emojis, use default img.\n if ($topics[$i]->image_url == null ||substr($topics[$i]->image_url,0,14) == \"/plugins/emoji\"){\n $images[$i] =hostname.default_image;\n }\n else{\n $images[$i] =hostname.$topics[$i]->image_url;\n }\n $urls[$i] = hostname.\"/t/\".$topics[$i]->slug;\n } \n\n $resultStr =\"<xml>\\n\";\n $resultStr .=\"<ToUserName><![CDATA[\".$fromUsername.\"]]></ToUserName>\\n\";\n $resultStr .=\"<FromUserName><![CDATA[\".$toUsername.\"]]></FromUserName>\\n\";\n $resultStr .=\"<CreateTime>\".time().\"</CreateTime>\\n\";\n $resultStr .=\"<MsgType><![CDATA[news]]></MsgType>\\n\";\n $resultStr .=\"<ArticleCount>\".count($titles).\"</ArticleCount>\\n\";\n $resultStr .=\"<Articles>\\n\";\n \n for ($i=0; $i <= count($titles)-1; $i++) { \n $resultStr .= \"<item>\\n\";\n $resultStr .=\"<Title><![CDATA[\".$titles[$i].\"]]></Title>\\n\"; \n $resultStr .=\"<Description><![CDATA[\".$titles[$i].\"]]></Description>\\n\";\n $resultStr .=\"<PicUrl><![CDATA[\".$images[$i].\"]]></PicUrl>\\n\";\n $resultStr .=\"<Url><![CDATA[\".$urls[$i].\"]]></Url>\\n\";\n $resultStr .=\"</item>\\n\"; \n }\n $resultStr .= \"</Articles>\\n\";\n $resultStr .= \"<FuncFlag>0</FuncFlag>\\n\";\n $resultStr .= \"</xml> \";\n \n echo $resultStr;\n exit;\n}", "public function FetchPosts ()\n {\n\n $event_instances = EventInstance::where( 'name', '!=', 'default' )->get();\n\n foreach( $event_instances as $event_instance )\n {\n if( $this->show_output ) echo( \"FetchPosts: \" . $event_instance->name .\"\\n\" );\n $this->ProcessPosts( $event_instance );\n }\n\n }", "public function getPostMedievalRulers() {\n $rulers = $this->getAdapter();\n $select = $rulers->select()\n ->from($this->_name, array('id','term' => 'CONCAT(issuer,\" (\",date1,\" - \",date2,\")\")'))\n ->where('period = ?', (int)36)\n ->where('valid = ?', (int)1)\n ->order('date1');\n return $rulers->fetchPairs($select);\n }", "public function getPostMedievalRulersList() {\n $key = md5('pmedlistRulers');\n if (!$data = $this->_cache->load($key)) {\n $rulers = $this->getAdapter();\n $select = $rulers->select()\n ->from($this->_name)\n ->where('period = ?', (int)36)\n ->order('id');\n $data = $rulers->fetchAll($select);\n $this->_cache->save($data, $key);\n }\n return $data;\n }", "function get_event_list_new( $newargs = array()){\n\n\twp_reset_postdata();\n\twp_reset_query();\n\n\n\t$result = '';\t\n\t\n\t$args = array(\n\t\t'post_type' => 'event',\n\t\t'meta_key' => EVENT_PREFIX.'date',\n\t\t'orderby' => 'meta_value',\n 'order' => 'ASC',\n 'posts_per_page'=>'1'\n\n\t);\n\n\t//array_merge($args,$newargs);\n\n\n\t$query = new WP_Query( $args );\n/*\n\tfunction pgp(){\n\t\t$query->set( 'posts_per_page','2' );\n\t}\n\tadd_action( 'pre_get_posts', 'pgp' , 0 );\n\n*/\n\t//global $post;\n\t$resarray = array();\n\t$query->set( 'posts_per_page','2' );\n\twhile ( $query->have_posts() ):\n\t\t$query->the_post();\n\t\tsetup_postdata( $post );\n\t\t$url = '';\n\t\tif ( $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array(60,60) ) ) \t\n\t\t{\n\t\t\t$url = $thumb['0'];\n\t\t} \n\t\t$resarray[] = array(\n\t\t\t'id' => $post->ID,\n\t\t\t'date' => get_post_meta($post->ID,EVENT_PREFIX.'date',true),\n\t\t\t'location' => get_post_meta($post->ID,EVENT_PREFIX.'location',true),\n\t\t\t'street' => get_post_meta($post->ID,EVENT_PREFIX.'street',true),\n\t\t\t'city' => get_post_meta($post->ID,EVENT_PREFIX.'city',true),\n\t\t\t'permalink' => get_permalink($post->ID),\n\t\t\t'title' => $post->post_title,\n\t\t\t'thumb' => $url\n\t\t);\n\tendwhile;\n\twp_reset_postdata();\n\twp_reset_query();\n\treturn $resarray;\n}", "function fetchPostViews(){\n\t\t\n\t\t$user = Auth::User(); \n\t\t$userId = $user->id; \n\t\t$userPosts = Posts::where('user_id', '=', $userId)->get();\n\n\t\t$localPostNames = array();\n\t\t\n\t\t\n\t\tforeach($userPosts as $userPost){\n\t\t\t$postid =$userPost->id; //die;\n\t\t\tif( $userPost->schedule_option == 1){\n\t\t\t\t\n\t\t\t\t$gmb_post_ids = explode(\",\",$userPost->gmb_post_id);\n\t\t\t\tforeach($gmb_post_ids as $gm_id){\n\t\t\t\tarray_push($localPostNames, $gm_id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t//echo $postid; die;\n\t\t\t\t$response = DB::table('scheduled_gmb_events')->where('post_id', $postid)->get();\n\t\t\t\tforeach($response as $res){\n\t\t\t\t$gmb_post_ids = explode(\",\",$res->gmb_post_id);\n\t\t\t\tforeach($gmb_post_ids as $gm_id){\n\t\t\t\tarray_push($localPostNames, $gm_id);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t//\t$localPostNames[]= '2';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t//\techo \"<pre>\";\n\t\t$gmidsjson = json_encode($localPostNames);\n\t\t$access_token = $this->generateGmbAccessToken(); \n\t\t$json='{\n \"localPostNames\": [\n '.$gmidsjson.'\n ],\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"LOCAL_POST_VIEWS_SEARCH\"\n }\n ],\n \"timeRange\": {\n \"startTime\": \"2018-07-10T00:00:00.000000000Z\",\n \"endTime\": \"2019-10-17T00:00:00.000000000Z\"\n }\n }\n}';\n\t\t$endpoint = 'https://mybusiness.googleapis.com/v4/accounts/110858452171291353127/locations/13399109068475708528/localPosts:reportInsights';\t\n\n\t\t\t$client = new \\GuzzleHttp\\Client(['headers' => ['Authorization' => 'Bearer '.$access_token, 'Content-type'=> 'application/json']]);\n\t\t\t$response = $client->request('POST', $endpoint, ['body' => $json]);\n\t\t\t$statusCode = $response->getStatusCode();\n\t\t\t$content = $response->getBody();\n\t\t\t$dataObj = json_decode($content);\t\n\t\t\t$arr = (array)$dataObj->localPostMetrics;\n\t\t\t//$a=array_column($arr, 'localPostName', 'metricValues'); print_r($a); die;\n\t\t\t\n\t\t\t$newArr= array();\n\t\t\tforeach($dataObj->localPostMetrics as $postname){\n\t\t\t\t$localPostName = $postname->localPostName;\n\t\t\t\t$newArr[$localPostName] = $postname->metricValues[0]->totalValue->value;\n\t\t\t\t\n\t\t\t} \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t //~ $data = Posts::latest()->get();\n //~ $postViews= $newArr;\n //~ foreach($data as $dataArr){\n\t\t\t\t//~ $dataArr['type'] = 'Event';\n\t\t\t\t//~ $views='';\n\t\t\t\t//~ if($dataArr['schedule_option']== '1'){\n\t\t\t\t\t//~ $gmb_post_ids =\texplode(',',$dataArr->gmb_post_id);\n\t\t\t\t\t\n\t\t\t\t\t//~ foreach($gmb_post_ids as $gm_id){\n\t\t\t\t\t\t//~ if(array_key_exists($gm_id,$postViews)){\n\t\t\t\t\t\t\t//~ $views = $postViews[$gm_id];\n\t\t\t\t\t\t//~ }else{ $views = ''; }\n\t\t\t\t\t//~ }\t\n\t\t\t\t\t\n\t\t\t\t//~ }else{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//~ $response = DB::table('scheduled_gmb_events')->where('post_id', $dataArr->id)->get();\n\t\t\t\t\t//~ foreach($response as $res){\n\t\t\t\t\t//~ $gmb_post_ids = explode(\",\",$res->gmb_post_id);\n\t\t\t\t\t//~ foreach($gmb_post_ids as $gm_id){\n\t\t\t\t\t\t//~ if(array_key_exists($gm_id,$postViews)){\n\t\t\t\t\t\t\t//~ $views = $postViews[$gm_id];\n\t\t\t\t\t\t//~ }else{ $views = ''; }\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\t//~ echo $dataArr['views'] = $views; \n\t\t\t\t\n\t\t\t//~ }\n\t\t\t\t//~ die;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\treturn $newArr;\n\t\t\t\n\t}", "public function actionGetPostList(){\n //Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl.'/css/post.css');\n //$catalog_id = Yii::app()->request->getQuery('catalog_id', 11);\n\t\t$postParms = array();\n\t\t$db = Yii::app()->db;\n\t\t$_POST = (array) json_decode(file_get_contents('php://input'), true);\n\t\t$postParms = (!empty($_POST['parms']))? $_POST['parms'] : array();\n\t\t$catalog_id = $postParms['id'];\n\t\t$catalog_id = 12;\n $criteria = new CDbCriteria();\n $criteria->order = 'id DESC';\n if(!empty($catalog_id)){\n $criteria->addCondition('catalog_id='.$catalog_id);\n }\n \n\n \n //房产热点新闻\n $posts = Post::model()->findAll(array(\n 'select' => 't.id as id, title',\n 'condition' => 'catalog_id = :catalog_id',\n 'params' => array(':catalog_id' => $catalog_id),\n\t\t\t'with' => array('catalog'),\n 'order' => 't.id DESC',\n 'limit' => 5\n ));\n\t\t\n\t\n\n\t\t$result['posts'] = array_map(create_function('$m','return $m->getAttributes(array(\\'id\\',\\'title\\'));'),$posts);\n\t\t\n\t\techo json_encode($result);\n \n\n }", "function show_stats() {\r\n ?>\r\n\r\n<div class=\"wrap\">\r\n\t<h2>Successful Posts</h2>\r\n\r\n\t\t<?php\r\n\r\n\t\t$this->table->prepare_items();\r\n\t\t$this->table->display();\r\n\r\n\t\t$analysis_methods = array(\r\n\t\t\t'html_h1' => array( 'callback' => array( 'SP_analyze_data', 'html_tag' ), 'args' => array( 'tag' => 'h1' ) ),\r\n\t\t\t'html_h2' => array( 'callback' => array( 'SP_analyze_data', 'html_tag' ), 'args' => array( 'tag' => 'h2' ) ),\r\n\t\t\t'html_h3' => array( 'callback' => array( 'SP_analyze_data', 'html_tag' ), 'args' => array( 'tag' => 'h3' ) ),\r\n\t\t\t'html_h4' => array( 'callback' => array( 'SP_analyze_data', 'html_tag' ), 'args' => array( 'tag' => 'h4' ) ),\r\n\t\t\t'html_strong' => array( 'callback' => array( 'SP_analyze_data', 'html_tag' ), 'args' => array( 'tag' => 'strong' ) ),\r\n\t\t\t'html_em' => array( 'callback' => array( 'SP_analyze_data', 'html_tag' ), 'args' => array( 'tag' => 'em' ) ),\r\n\t\t\t'html_img' => array( 'callback' => array( 'SP_analyze_data', 'html_tag' ), 'args' => array( 'tag' => 'img' ) ),\r\n\t\t\t'html_a' => array( 'callback' => array( 'SP_analyze_data', 'html_tag' ), 'args' => array( 'tag' => 'a' ) ),\r\n\t\t\t'post_length' => array( 'callback' => array( 'SP_analyze_data', 'post_length' ), 'args' => array() ),\r\n\t\t\t'paragraph_density' => array( 'callback' => array( 'SP_analyze_data', 'paragraph_density' ), 'args' => array() ),\r\n\t\t\t'post_tags' => array( 'callback' => array( 'SP_analyze_data', 'post_tags' ), 'args' => array() ),\r\n\t\t\t'post_categories' => array( 'callback' => array( 'SP_analyze_data', 'post_categories' ), 'args' => array() ),\r\n\t\t\t'post_videos' => array( 'callback' => array( 'SP_analyze_data', 'post_videos' ), 'args' => array() )\r\n\t\t);\r\n\t\t$_analyze_data = new SP_analyze_data( $analysis_methods, $this->clusters, $this->prepared_data );\r\n\r\n\t\techo '<h3>Found indicators of success are:</h3>';\r\n\t\tvar_dump( $_analyze_data->get_success_metrics() );\r\n ?>\r\n\r\n</div>\r\n\r\n\t<?php\r\n\t}", "function posts_to_find_results($posts, $nrows, $count) {\n global $log;\n if ($nrows > $count) {\n $more = 1;\n $nrows = $count;\n } else {\n $more = 0;\n }\n\n $gameplays = array();\n for($i=0; $i<$nrows; $i++) {\n $post = $posts[$i];\n $g = ParseGameplayPost($post);\n $po = array();\n $po['title'] = $g['title'];\n $po['ID'] = $g['ID'];\n $po['slug'] = $g['slug'];\n $po['author'] = $g['author'];\n $po['link'] = $g['link'];\n $po['ytid'] = $g['ytid'];\n $po['preview'] = $g['preview'];\n $po['thumbnail'] = $g['thumbnail'];\n $po['caution'] = $g['audience'] == 'C';\n $po['hits'] = $g['hits'];\n $po['duration'] = round($g['duration'] / 60.0);\n $gameplays[] = $po;\n }\n\n $result = array(); // result object\n $result['gameplays'] = $gameplays;\n $result['more'] = $more;\n return $result;\n}", "public function run()\n {\n //\n $numberOfPosts = 100;\n\n Post::factory()->times($numberOfPosts)->create();\n\n $p = Post::get();\n\n for($i = 0; $i < $numberOfPosts; $i++)\n {\n //each post has at least one tag\n $tagId = Tag::inRandomOrder()->first()->id;\n $p[$i]->tags()->attach($tagId);\n\n $possible_images = ['map1.jpg',\n 'map2.jpg',\n 'map3.jpg',\n 'map4.jpg',\n 'map5.jpg',\n 'map6.jpg',\n 'map7.jpg',\n 'map8.jpg',];\n shuffle($possible_images);\n $p[$i]->image()->create(['filename' => $possible_images[0]]);\n\n }\n }", "public function run()\n {\n $arrs = [\n [\n 'photo' => 'images/shortcut/new/1.png?' . rand(10000, 99999),\n 'link_data' => '/pages/house/list/index?type=1',\n 'desc' => '热门房源'\n ],\n [\n 'photo' => 'images/shortcut/new/2.png?' . rand(10000, 99999),\n 'link_data' => '/pages/house/list/index?type=2',\n 'desc' => '最新房源'\n ],\n [\n 'photo' => 'images/shortcut/new/3.png?' . rand(10000, 99999),\n 'link_data' => '/pages/house/list/index?type=3',\n 'desc' => '即将预售'\n ],\n [\n 'photo' => 'images/shortcut/new/4.png?' . rand(10000, 99999),\n 'link_data' => '/pages/house/list/index?type=4',\n 'desc' => '最新摇号'\n ],\n [\n 'photo' => 'images/shortcut/new/5.png?' . rand(10000, 99999),\n 'link_data' => '/pages/house/list/index?type=5',\n 'desc' => '摇号剩余'\n ],\n [\n 'photo' => 'images/shortcut/new/6.png?' . rand(10000, 99999),\n 'link_data' => 'http://www.sohu.com/a/294613449_124714',\n 'desc' => '资格查询'\n ],\n [\n 'photo' => 'images/shortcut/new/7.png?' . rand(10000, 99999),\n 'link_data' => '/pages/house/list/index',\n 'desc' => '全部房源'\n ],\n [\n 'photo' => 'images/shortcut/new/8.png?' . rand(10000, 99999),\n 'link_data' => '/pages/transaction/index',\n 'desc' => '交易数据'\n ],\n [\n 'photo' => 'images/shortcut/new/9.png?' . rand(10000, 99999),\n 'link_data' => '/pages/calculator/index/index',\n 'desc' => '房贷计算'\n ],\n [\n 'photo' => 'images/shortcut/new/10.png?' . rand(10000, 99999),\n 'link_data' => '/pages/article/index',\n 'desc' => '楼市新闻'\n ],\n ];\n foreach ($arrs as $item)\n {\n \\App\\Models\\Shortcut::create($item);\n }\n }", "public function toGetPostPublishData() {\r\n $lmt = $this->input->get('lmt');\r\n $ofSet = $this->input->get('ofSet');\r\n $banner_type = $this->input->get('banner_type');\r\n $tablename = 'posts';\r\n $AllPostsData = $this->Global_model->toGetPostPublishData($tablename, $lmt, $ofSet, 1, $banner_type);\r\n if (isset($AllPostsData) && !empty($AllPostsData)) {\r\n echo json_encode($AllPostsData);\r\n exit;\r\n } else {\r\n echo 'fail';\r\n exit;\r\n }\r\n }", "function list_brands( WP_REST_Request $request ){\n $query = new WP_Query(array(\n 'post_type' => 'brands',\n 'post_status' => 'publish',\n 'posts_per_page'=> -1,\n 'orderby'=>'title',\n 'order'=>'ASC'\n ));\n\n $brand_list = array();\n\n while ($query->have_posts()) {\n\n $query->the_post();\n $brand_id = get_the_ID();\n $brand_name = get_the_title();\n array_push($brand_list, array('Title' => $brand_name, 'ID' => $brand_id));\n }\n\n wp_reset_query();\n\n return $brand_list;\n}", "public function postsParser()\r\n {\r\n $html1 = file_get_contents('https://habr.com/ru/all/');\r\n \r\n \\phpQuery::newDocument($html1);\r\n \r\n $parselinks = pq('.tm-article-snippet__title-link');\r\n $links = [];\r\n $index = 0;\r\n foreach ($parselinks as $link) {\r\n if ($index < 5) {\r\n $link = pq($link);\r\n \r\n $links[] = 'https://habr.com' . $link->attr(\"href\");\r\n $index++;\r\n } else {\r\n break;\r\n }\r\n }\r\n \r\n $data = [];\r\n foreach ($links as $value) {\r\n $html = file_get_contents($value);\r\n \r\n \\phpQuery::newDocument($html);\r\n\r\n $posts = pq('.tm-misprint-area__wrapper');\r\n\r\n foreach ($posts as $key => $post) {\r\n $post = pq($post);\r\n \r\n $data[] = '(\"' . htmlspecialchars(trim($post->find('h1')->text())) . '\",\"' . htmlspecialchars(mb_strimwidth(trim($post->find('#post-content-body')->text()), 0, 250, \"\")) . '\",\"'. htmlspecialchars(trim($post->find('#post-content-body')->html())) . '\",\"' . htmlspecialchars($value) . '\")';\r\n \r\n }\r\n }\r\n \r\n \\phpQuery::unloadDocuments();\r\n Post::set($data); \r\n }", "function getPostcards($_db)\n{\n $query = \"SELECT USER_USERNAME, STATUS_TITLE, STATUS_TEXT, TIME_STAMP, IMAGE_NAME, FILTER FROM WALL ORDER BY TIME_STAMP DESC\";\n \n if(!$result = $_db->query($query))\n {\n die('There was an error running the query [' . $_db->error . ']');\n }\n \n // Iterate through rows returned by table query, inserting them into HTML.\n $output = '';\n while($row = $result->fetch_assoc())\n {\n // Output posted date in a readable format.\n $postDate = date('F j, Y, g:i a T', $row['TIME_STAMP']);\n\n // Creates a single post from image and text. Because ' is escaped with \\' in the database, it is changed back here.\n $output = $output . '<div class=\"panel panel-default\"><div class=\"panel-heading\">\"'\n . str_replace(\"\\'\", \"'\", $row['STATUS_TITLE'])\n . '\" posted by ' . str_replace(\"\\'\", \"'\", $row['USER_USERNAME']) . '</div>'\n . '<div class=\"row\"><div class=\"col-md-5\">'\n . '<img class=\"img-responsive center-block w400 '. $row['FILTER'] . '\" src=\"' . $server_root\n . 'users/' . $row['IMAGE_NAME'] . '\" alt=\"' . $row['IMAGE_NAME'] . '\"></div>'\n . '<div class=\"col-md-7\"><br><p>' . str_replace(\"\\'\", \"'\", $row['STATUS_TEXT']) . '</p><hr><p>' . $postDate . '</p>'\n . '</div></div></div>' ;\n }\n \n return $output;\n}", "public function index()\n {\n return response(Post::getListData());\n }", "public function all() {\n\n\t\t// Set response type\n\t\t$this->response->type('application/json');\n\n\t\t// get article ranking \n\t\t$lists = $this->Article->find(\n\t\t\t'all',\n\t\t\tarray(\n\t\t\t\t'order' => array(\n\t\t\t\t\t'Like.value' => 'desc'\n\t\t\t\t),\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'Article.id',\n\t\t\t\t\t'Article.title',\n\t\t\t\t\t'Article.category_id',\n\t\t\t\t\t'Category.name',\n\t\t\t\t\t'Like.value'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Convert value \n\t\tforeach($lists as $key => $list) {\n\t\t\t$lists[$key]['Comment']['value'] = count($list['Comment']);\n\t\t\tif ($list['Like']['value'] == null) {\n\t\t\t\t$lists[$key]['Like']['value'] = 0;\n\t\t\t}\n\t\t}\n\n\t\t$lists += $this->success('03','Success');\n\t\t$this->set('result',$lists);\n\t\t\n\t}", "function aggregate_by_api(&$post);", "public function getTwitterPosts(){\n\n $url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';\n $requestMethod = 'GET';\n\n /** Perform a POST request and echo the response **/\n $settings = array(\n 'oauth_access_token' => \"3274216560-uDATfRyhJTQHbyrbcJh33Ha1jtNB8WEoi4Kp7HY\",\n 'oauth_access_token_secret' => \"wdUfaxH2HOhj33miixuueq4LxVBy0tdtXBXbIV41L3lrL\",\n 'consumer_key' => \"mgZVj3yzHpLoLt11Ed1VC7SqV\",\n 'consumer_secret' => \"f5FbRKEgxMvx4K7R8VyyU6tG9IGrHcGx9Joqsb3Rp4bi6BZPAv\"\n );\n\n $this->setCredentials($settings);\n $data = '?count=6&exclude_replies=true';\n\n $tweets = $this->setGetfield($data)\n ->buildOauth($url, $requestMethod)\n ->performRequest();\n\n $tweets = json_decode($tweets);\n $tweetCollection = '';\n foreach($tweets as $i=>$t){\n if(isset($t->text)){\n $tweetCollection[$i]['text'] = $t->text;\n }\n $tweetCollection[$i]['media_url']='';\n if(isset($t->entities->media)){\n $tweetCollection[$i]['media_url'] = $t->entities->media[0]->media_url;\n }\n else{\n //$tweetCollection['media_url'] = $t->entities->media[0]->media_url;\n }\n $tweetCollection[$i]['post_url']='';\n if(isset($t->entities->media)){\n $tweetCollection[$i]['post_url'] = $t->entities->media[0]->expanded_url;\n }\n\n if(isset($t->user->name)){\n $tweetCollection[$i]['user_name'] = $t->user->name;\n }\n\n if(isset($t->created_at)){\n $createdAt = $this->time_elapsed_string($t->created_at);\n $tweetCollection[$i]['created_at'] = $createdAt;\n }\n }\n return $tweetCollection;\n }", "public function get_list(){\n $this->set_list(true);\n $initialfetch = (($this->page - 1) * $this->itemsforpage);\n $posts = $this->fetch(\"SELECT id, title, picture, category,url, meta date FROM posts ORDER BY id DESC LIMIT $initialfetch, $this->itemsforpage \");\n return $posts;\n }", "public function getPosts()\n {\n $sql = ' SELECT posts.ID,\n posts.post_date_gmt,\n posts.post_content,\n posts.post_title,\n posts.post_excerpt,\n posts.post_status,\n posts.post_modified_gmt,\n posts.guid,\n posts.comment_count,\n users.user_nicename,\n users.user_url,\n users.user_registered\n FROM wp_posts posts\n INNER JOIN wp_users users\n ON posts.post_author = users.ID\n WHERE posts.post_status = \"publish\"\n AND posts.post_type = \"post\"\n ORDER BY posts.post_date DESC\n LIMIT 16';\n\n $definition = [\n 'entry' => $this->provider->newCollection($sql, [], [\n 'id' => new Field\\Callback('ID', function($id){\n return Uuid::nameBased($id);\n }),\n 'content' => 'post_content',\n 'title' => 'post_title',\n 'excerpt' => 'post_excerpt',\n 'status' => 'post_status',\n 'href' => 'guid',\n 'createdAt' => new Field\\DateTime('post_date_gmt'),\n 'updatedAt' => new Field\\DateTime('post_modified_gmt'),\n 'commentCount' => 'comment_count',\n 'author' => [\n 'displayName' => 'user_nicename',\n 'url' => 'user_url',\n 'createdAt' => new Field\\DateTime('user_registered'),\n ],\n ])\n ];\n\n return $this->builder->build($definition);\n }", "private function gatherData()\n {\n $this->progressBar->setMessage('Building Results');\n $this->progressBar->setMessage('...', 'filename');\n $this->progressBar->start(count($this->found));\n\n $gatherer = $this->getGatherer()->setNumContextLines($this->getNumContextLines());\n\n //Sort our result collection\n $this->found->sortByFilename();\n\n /** @var Result $result */\n foreach ($this->found as $result) {\n $this->progressBar->setMessage($result->getFilename(), 'filename');\n $this->progressBar->advance();\n\n //Filter our result set. If no matches exist afterwards, we'll squash it.\n $containsResults = $gatherer->gather($result);\n\n if (!$containsResults) {\n $this->progressBar->advance(-1);\n }\n }\n\n //Remove any results from our list which are empty.\n $this->found->squashEmptyResults();\n\n //Trim our result and context lines if necessary\n if ($this->doTrimMatches()) {\n $this->found->trimResults();\n }\n\n $this->progressBar->finish();\n $this->progressBar->clear();\n }", "public function testPostingAPIGetFbsPostingList0()\n {\n\n }" ]
[ "0.6612202", "0.5377579", "0.5252432", "0.52486455", "0.52432525", "0.5193895", "0.5137429", "0.50677943", "0.50303316", "0.49917653", "0.4983558", "0.49835238", "0.49801037", "0.49790537", "0.4971431", "0.49651533", "0.49590608", "0.49587247", "0.49455753", "0.4924605", "0.49174768", "0.4913847", "0.49120963", "0.4906379", "0.49061686", "0.48974535", "0.48953363", "0.48706678", "0.4861712", "0.48599455" ]
0.69131297
0
/ / /Method Name: AssemblePostHeart /Description: Assembles PostHeart from DataReader / /
public function AssemblePostHeart($result) { $this->logger->debug("START"); $postHeart = new PostHeart(); try { if (!mysqli_num_rows($result)) { return $postHeart; } if ($row = mysqli_fetch_array($result)) { $postHeart->setHeartID($row['heartid']); $postHeart->setAppUserID($row['appuserid']); $postHeart->setPostID($row['postid']); $postHeart->setCreateDate($row['createdate']); $postHeart->setIsValid($row['isvalid']); $postHeart->setRemoveDate($row['removedate']); } } catch (Exception $ex) { $this->logger->error($query . "\n" . $ex->getMessage() . "\n" . $ex->getTraceAsString()); throw ex; } $this->logger->debug("END"); return $postHeart; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function process()\n\t{\n\t\t// because they already contain complete information\n\n\t\tif ($this->source->rss_feed) {\n\n\t\t\t// do some cleanup and sanitization for Rss posts contents\n\n\t\t\t$this->post->content = scrub_content($this->post->content);\n\t\t\t$this->post->excerpt = summarize_content($this->post->content);\n\t\t\treturn $this->post;\n\t\t}\n\n\t\t// otherwise, start by getting content and building crawler\n\n\t\t$content = url_get_contents($this->url);\n\t\t$crawler = new Crawler();\n\t\t$crawler->addHtmlContent($content);\n\n\t\t// select class based on source\n\t\t\n\t\t$lookupTable = [\n\t\t\t'now.mmedia.me'\t\t=>\t'App\\Crawlers\\PostBuilders\\NowLebanonPostBuilder',\n\t\t\t'www.dailystar.com.lb'\t=>\t'App\\Crawlers\\PostBuilders\\DailyStarPostBuilder',\n\t\t\t'www.naharnet.com'\t=>\t'App\\Crawlers\\PostBuilders\\NaharnetPostBuilder',\n\t\t\t'thenational.ae'\t=>\t'App\\Crawlers\\PostBuilders\\TheNationalPostBuilder',\n\t\t];\n\n\t\t$className = $lookupTable[parse_url($this->source->homepage)['host']];\n\n\t\t$details = (new $className($this->url, $crawler))->getDetails();\n\t\t$this->post->url = $details['url'];\n\t\t$this->post->title = $details['title'];\n\t\t$this->post->publishing_date = $details['publishing_date'];\n\t\t$this->post->content = $details['content'];\n\t\t$this->post->excerpt = $details['excerpt'];\n\t\t$this->post->source_id = $this->source->id;\n\n\t\treturn $this->post;\n\t}", "function indextank_add_post_raw($index,$post) {\n if ($post->post_status == \"publish\") {\n $data = indextank_post_as_array($post);\n $res = $index->add_document($data['docid'], $data['fields'], $data['variables']); \n indextank_boost_post($post->ID);\n }\n}", "public function postFetch();", "public function run()\n {\n $heartwalls=[\n \t['Titanium', 500, 200],\n \t['Stuffed Animals', 300, 150],\n \t['Running Shoes', 1000, 500],\n \t['Steel', 650, 75],\n \t['Wood', 200, 0]\n ];\n\n $count = count($heartwalls);\n\n\t foreach ($heartwalls as $key => $heartwallData) {\n\t $heartwall = new heartwall();\n\n\t $heartwall->created_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t $heartwall->updated_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t $heartwall->material = $heartwallData[0];\n\t $heartwall->starting_distance =$heartwallData[1];\n $heartwall->current_distance=$heartwallData[2];\n\n\t $heartwall->save();\n\t $count--;\n\t };\n }", "function artxPost($data)\n {\n if (is_string($data))\n $data = array('content' => $data);\n $classes = isset($data['classes']) && strlen($data['classes']) ? $data['classes'] : '';\n artxFragmentBegin(\"<article class=\\\"art-post\" . $classes . \"\\\">\");\n artxFragmentBegin(\"<h2 class=\\\"art-postheader\\\">\");\n if (isset($data['header-text']) && strlen($data['header-text'])) {\n if (isset($data['header-link']) && strlen($data['header-link']))\n artxFragmentContent('<a href=\"' . $data['header-link'] . '\">' . $data['header-text'] . '</a>');\n else\n artxFragmentContent($data['header-text']);\n }\n artxFragmentEnd(\"</h2>\");\n artxFragmentBegin(\"<div class=\\\"art-postheadericons art-metadata-icons\\\">\");\n if (isset($data['metadata-header-icons']) && count($data['metadata-header-icons']))\n foreach ($data['metadata-header-icons'] as $icon)\n artxFragment('', $icon, '', ' | ');\n artxFragmentEnd(\"</div>\");\n artxFragmentBegin(\"<div class=\\\"art-postcontent clearfix\\\">\");\n if (isset($data['content']) && strlen($data['content']))\n artxFragmentContent(artxPostprocessPostContent($data['content']));\n artxFragmentEnd(\"</div>\");\n\n return artxFragmentEnd(\"</article>\", '', true);\n\n }", "function post()\n\t\t{\n\t\t}", "function efPostloader() {\n new Postloader();\n }", "public function run()\n {\n //clear data of table news_posts\n DB::table('news_posts')->truncate();\n\n $now = Carbon::now('Asia/Taipei');\n $num = 26; //no-repeat records\n $id = 0;\n $round = 30;\n $input_time = $now->subHours($num * $round); //first record is the oldest\n\n for ($i = 0; $i < $round; $i++) {\n\n $id++;\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '林書凱',\n 'title' => 'NBA》馬刺客場踢館 七六人吞5連敗',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => '聖安東尼奧馬刺',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"馬刺今天擊敗七六人,讓七六人苦吞五連敗。\" src=\"/storage/news-posts/February2017/Df2RcQoYN7cHj65FCLQE.jpg\" alt=\"馬刺今天擊敗七六人\" width=\"800\" />\n<figcaption><span style=\"color: #666666; font-family: Roboto, sans-serif; font-size: 15px; text-align: start; background-color: #fefefe;\">馬刺今天擊敗七六人,讓七六人苦吞五連敗。圖/翻攝自馬刺隊推特</span></figcaption>\n</figure>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">聖安東尼奧馬刺今天靠著雷納德(Kawhi Leonard)單場32分,以及派克(Tony Parker)18分力挺,以111比103擊敗費城七六人。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">七六人隊少了明星中鋒安彼得(Joel Embiid),他因左膝傷勢連續缺賽6場了,歐卡佛(Jahlil Okafor)攻下20分、8籃板,薩里奇(Dario Saric)同樣進帳20分,可惜無法阻止球隊吞下5連敗。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">整場比賽落後的七六人隊,在第4節歐卡佛兩罰得手後,把落後追到85比87只剩2分,不過馬刺隊利用一波16比5攻勢,再度放大雙方差距,馬刺隊葛林(Danny Green)在比賽剩2分14秒的三分球,讓馬刺隊103比92領先達11分。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">七六人隊在安彼得出賽時,戰績13勝18負,當他缺陣時,戰績跌到5勝16負。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">馬刺隊阿德雷奇(LaMarcus Aldridge)贊助15分、10籃板,戴德蒙(Dewayne Dedmon)10分、11籃板。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">馬刺主場AT&amp;T中心因要舉辦一年一度的牛仔競技大會,再兩場比賽他們就要展開第15度的牛仔客場長征(Rodeo Road Trip),20天中馬刺隊要在7個城市進行8場比賽,旅行里程達7378英哩(約11874公里),他們在牛仔客場之旅的戰績,為83勝36負。</p>',\n 'image' => '',\n 'meta_description' => '聖安東尼奧馬刺今天靠著雷納德(Kawhi Leonard)單場32分,以及派克(Tony Parker)18分力挺,以111比103擊敗費城七六人。七六人隊少了明星中鋒安彼得(Joel Embiid),他因左膝傷勢連續缺賽6場了,歐卡佛(Jahlil Okafor)攻下20分、8籃板,薩里奇(Dario Saric)同樣進帳20分,可惜無法阻止球隊吞下5連敗。',\n 'meta_keywords' => 'NBA》馬刺客場踢館 七六人吞5連敗 - 麗台運動報',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'breaking_news' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '林書凱',\n 'title' => 'NBA》騎士單節轟40分 柯佛三分射垮溜馬',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => 'NBA》騎士單節轟40分 柯佛三分射垮溜馬 - 麗台運動報',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"Kyle Korver今天攻下個人本季單場新高29分\" src=\"/storage/news-posts/February2017/9lwCHcYlKkNDf469MRdK.jpg\" alt=\"Kyle Korver今天攻下個人本季單場新高29分。圖/翻攝自騎士隊推特\" />\n<figcaption>柯佛三分射垮溜馬</figcaption>\n</figure>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">克利夫蘭騎士射手柯佛(Kyle Korver)今天攻下個人本季單場新高29分,加上當家球星詹姆斯(LeBron James)下半場為球隊提升活力,騎士隊132比117擊敗印第安那溜馬。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">騎士隊在這波客場4連戰前3場收下勝利,也贏得最近7場比賽的6場勝利,詹姆斯本戰貢獻25分、9助攻、6籃板,柯佛則是三分球9投8中,後衛厄文(Kyrie Irving)挹注29分。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">溜馬隊邁爾斯(C.J. Miles)23分為全隊最高,提格(Jeff Teague)獲得22分、14助攻,喬治(Paul George)22分、8籃板、6助攻,可惜球隊仍結束了本季最佳的7連勝,主場4連勝也喊停。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">騎士隊上半場狀況較差,但下半場投籃命中率高達61.9%,第3節狂轟40分,單節得分創球隊本季新高,且該節讓溜馬只得18分,因此扭轉了上半場57比63的落後劣勢。</p>\n<p style=\"box-sizing: border-box; border: 0px; margin: 0px 0px 21px; outline: 0px; padding: 0px; vertical-align: baseline; line-height: 27px; color: #333333; font-family: 微軟正黑體; font-size: 18px;\">柯佛生涯已經投進1992記三分球,超越奇德(Jason Kidd)的1988顆,排NBA史上第7。</p>',\n 'image' => '',\n 'meta_description' => '克利夫蘭騎士射手柯佛(Kyle Korver)今天攻下個人本季單場新高29分,加上當家球星詹姆斯(LeBron James)下半場為球隊提升活力,騎士隊132比117擊敗印第安那溜馬。 騎士隊在這波客場4連戰前3場收下勝利,也贏得最近7場比賽的6場勝利,詹姆斯本戰貢獻25分、9助攻、6籃板',\n 'meta_keywords' => 'NBA》騎士單節轟40分 柯佛三分射垮溜馬',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '自由時報',\n 'title' => 'NBA》一度被籃球榨乾 溜馬喬治振作擺脫季初陰霾',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => 'NBA》一度被籃球榨乾 溜馬喬治振作擺脫季初陰霾 - 自由體育',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"溜馬隊球星喬治\" src=\"/storage/news-posts/February2017/Diva64nIBBtCqBeUBvcy.jpg\" alt=\"溜馬隊球星喬治(Paul George)\" />\n<figcaption><span style=\"color: #000000; font-family: monospace; font-size: medium; text-align: start; white-space: pre-wrap;\">喬治。(美聯社)</span></figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">〔體育中心/綜合報導〕溜馬隊球星喬治(Paul George)在球季前兩個月活在恐懼中,「我那時正經歷一段黑暗的低潮。」喬治表示,「除了忙著應付腳傷,隊上的化學反應不佳,尤其是我和提格(Jeff Teague)間,我感到無能為力。」</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">喬治在2014年參加美國隊訓練時,右腳嚴重骨折,這兩年花了很多心力重回球場,期間也不時遇上其他傷病。喬治說:「我的身心都被籃球榨乾了,季初時我並不在100%狀態,我花了些時間才調整好。」</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">喬治說明關鍵在1月倫敦賽的一晚,他花了整夜的時間祈禱和冥想,「我發覺我所做的一切正是我最熱愛的,我該好好享受當下,這就是改變一切的關鍵。」</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">「現在我的身心狀態都已經調適良好。」喬治的覺醒也給溜馬帶來了正面能量,1月份拿下9勝4敗的佳績,更一度拉出7連勝,目前29勝23敗排名東區第六。</p>\n<p>&nbsp;</p>',\n 'image' => '',\n 'meta_description' => '溜馬隊球星喬治(Paul George)在球季前兩個月活在恐懼中,「我那時正經歷一段黑暗的低潮。」喬治表示,「除了忙著應付腳傷,隊上的化學反應不佳,尤其是我和提格(Jeff Teague)間,我感到無能為力。」喬治在2014年參加美國隊訓練時,右腳嚴重骨折',\n 'meta_keywords' => '溜馬喬治振作擺脫季初陰霾',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '自由時報',\n 'title' => '經典賽》台灣隊公布28人名單 旅外6人史上最少',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => '經典賽》台灣隊公布28人名單 旅外6人史上最少 - 自由體育',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"陽岱鋼\" src=\"/storage/news-posts/February2017/8RgzcLTDzvV9XwpmtMOp.jpg\" alt=\"陽岱鋼\" />\n<figcaption><span style=\"color: #000000; font-family: monospace; font-size: medium; text-align: start; white-space: pre-wrap;\">陽岱鋼雖還沒回覆是否參賽,仍列入28人名單。(資料照,記者陳志曲攝)</span></figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">〔記者徐正揚/台北報導〕中華棒協今天下午召開選訓會議,決定經典賽台灣隊28人名單、2月赴澳洲移訓練32人名單,雖然陽岱鋼尚未回覆是否參加,選訓委員與教練團仍決定把他放進28人名單。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">連同還不確定的陽岱鋼、準備去打日本獨立聯盟的羅國華,28人名單中只有6名旅外球員,是台灣歷次參加經典賽最少的1次,過去3屆最少都有9人,以第2屆11人最多。本屆是首次沒有業餘球員入選。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\"><iframe title=\"郭泰源談將陽岱鋼放入28人名單\" src=\"https://www.youtube.com/embed/GrG9y5dkeis?wmode=opaque&amp;theme=dark\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"\"></iframe></p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">經典賽台灣隊28人名單如下:</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">投手(13人)</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">郭俊麟、陳冠宇、宋家豪、江少慶(旅外)、潘威倫、王鏡銘、陳韻文(統一)、倪福德、黃勝雄、蔡明晉、林晨樺(富邦)、陳鴻文(中信)、羅國華(高知)。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">捕手(2人)</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">林琨笙(富邦)、鄭達鴻(中信)。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">內野手(7人)</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">林智勝、王勝偉、蔣智賢、許基宏(中信)、林志祥、陳鏞基(統一)、林益全(富邦)。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">外野手(6人)</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">陽岱鋼(旅外)、林哲瑄、胡金龍、高國輝(富邦)、張正偉、張志豪(中信)。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">至於澳洲移訓32人名單,由於28人名單內的球員無法全部前往,加入曾隨隊在台中集訓並列入觀察名單的球員,若28人名單需要替換,以澳洲移訓球員優先,澳洲移訓32人名單如下:</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">投手(15人)</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">郭俊麟、陳冠宇(旅外)、潘威倫、王鏡銘、陳韻文(統一)、倪福德、黃勝雄、蔡明晉、林晨樺(富邦)、陳鴻文(中信)、羅國華(高知)、呂彥青、許凱翔、吳俊杰、王政浩(業餘)。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">捕手(3人)</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">林琨笙、方克偉(富邦)、鄭達鴻(中信)。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">內野手(8人)</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">林智勝、王勝偉、蔣智賢、許基宏(中信)、林志祥、陳鏞基(統一)、林益全(富邦)、岳東華(業餘)。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">外野手(6人)</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">林哲瑄、胡金龍、高國輝(富邦)、張正偉、張志豪(中信)、羅國龍(統一)。</p>\n<figure class=\"image\"><img title=\"台灣隊投手郭俊麟\" src=\"/storage/news-posts/February2017/Xi3WtSS3unyPvgpJuIFp.jpg\" alt=\"台灣隊投手郭俊麟\" />\n<figcaption><span style=\"color: #000000; font-family: monospace; font-size: medium; text-align: start; white-space: pre-wrap;\">台灣隊投手郭俊麟。(資料照,記者陳志曲攝)</span></figcaption>\n</figure>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">&nbsp;</p>',\n 'image' => '',\n 'meta_description' => '中華棒協今天下午召開選訓會議,決定經典賽台灣隊28人名單、2月赴澳洲移訓練32人名單,雖然陽岱鋼尚未回覆是否參加,選訓委員與教練團仍決定把他放進28人名單。連同還不確定的陽岱鋼、準備去打日本獨立聯盟的羅國華',\n 'meta_keywords' => '經典賽》台灣隊公布28人名單 旅外6人史上最少',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '自由體育',\n 'title' => '經典賽》官方公布台灣隊陣容 王建民、王維中入列',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => '經典賽》官方公布台灣隊陣容 王建民、王維中入列 - 自由體育',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"王建民\" src=\"/storage/news-posts/February2017/xLOaKknsykdTIevdPFJb.jpeg\" alt=\"王建民\" />\n<figcaption><span style=\"color: #000000; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; font-size: 16px; letter-spacing: 1px; text-align: justify; background-color: #ffffff;\">王建民在台灣隊名單中。(資料照,記者林正堃攝)</span></figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">〔體育中心/綜合報導〕大聯盟官網今天公布各國經典賽28人名單,台灣隊除了先前已公布的正選名單外,新規則中的特別投手名單也出爐,王建民、賴鴻誠與王維中等人都入列。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">本屆經典賽增設特別投手名單,每輪之間可從當中替換2名投手,名單最多可放10人,台灣的這份名單是賴鴻誠、呂彥青、王建民、陽建福、王政浩、王維中、吳俊杰、<span style=\"margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; vertical-align: baseline;\">陳品學</span>。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">王建民、王維中先前都已宣布不打經典賽,不過依然出現在投特別名單,假如晉級次輪還有望出賽;去年勇奪中繼王的富邦投手賴鴻誠,先前對於未能入選經典賽感到失望,如今進入特別名單,仍有望出征。</p>\n<div id=\"story_body_content\" style=\"margin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: inherit; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; color: #000000; letter-spacing: 1px;\">\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: 1.7rem; font-family: inherit; vertical-align: baseline; text-align: justify;\">台灣隊預賽分在A組,將前往南韓首爾與南韓、荷蘭、以色列爭取2張8強門票,3月7日首戰以色列,8日對荷蘭,9日對南韓。</p>\n</div>\n<p>&nbsp;</p>',\n 'image' => '',\n 'meta_description' => '大聯盟官網今天公布各國經典賽28人名單,台灣隊除了先前已公布的正選名單外,新規則中的特別投手名單也出爐,王建民、賴鴻誠與王維中等人都入列。本屆經典賽增設特別投手名單,每輪之間可從當中替換2名投手,名單最多可放10人',\n 'meta_keywords' => '大聯盟官網今天公布各國經典賽28人名單',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '自由體育',\n 'title' => '中職》未來中職賽事 機捷將計畫加開末班車',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => '中職》未來中職賽事 機捷將計畫加開末班車 - 自由體育',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"機場捷運\" src=\"/storage/news-posts/February2017/dulpmBrDD623AkzZQnB3.jpg\" alt=\"機場捷運\" />\n<figcaption><span style=\"color: #000000; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; font-size: 16px; letter-spacing: 1px; text-align: justify; background-color: #ffffff;\">機場捷運未來將加開末班車,疏運看球民眾。(記者陳志曲攝)</span></figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">〔記者林宥辰/桃園報導〕為了因應中職賽事,機捷未來將在中職比賽結束前,將加開加班車疏運球迷人潮,球迷可望多一項便利選擇平安返家。</p>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">機捷桃園體育園區站緊鄰桃園國際球場,該站末班車為23:16分,目前正常班距為15分鐘一班,但桃捷公司董事長劉坤億說,中職賽事開打後,桃捷計畫做出彈性調整、加開班次,讓班次更加密集,外地球迷可選擇搭到高鐵站轉乘高鐵,北部地區球迷也能一路搭回台北。</p>\n<figure class=\"image\"><img title=\"機場捷運\" src=\"/storage/news-posts/February2017/ijsL640Nw1nx5QpSUaMv.jpg\" alt=\"機場捷運\" />\n<figcaption><span style=\"color: #000000; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; font-size: 16px; letter-spacing: 1px; text-align: justify; background-color: #ffffff;\">機場捷運未來將加開末班車,疏運看球民眾。(記者陳志曲攝)</span></figcaption>\n</figure>\n<p style=\"margin: 0px; padding: 0px 0px 20px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; font-size: 16px; line-height: 1.7rem; font-family: 微軟正黑體, 新細明體, Calibri, Arial, sans-serif; vertical-align: baseline; text-align: justify; color: #000000; letter-spacing: 1px;\">&nbsp;</p>',\n 'image' => '',\n 'meta_description' => '為了因應中職賽事,機捷未來將在中職比賽結束前,將加開加班車疏運球迷人潮,球迷可望多一項便利選擇平安返家。機捷桃園體育園區站緊鄰桃園國際球場,該站末班車為23:16分,目前正常班距為15分鐘一班',\n 'meta_keywords' => '未來中職賽事 機捷將計畫加開末班車',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '林暐凱',\n 'title' => 'HBL/甲級籃球聯賽男子組準決賽 10日觀戰重點',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => 'HBL/甲級籃球聯賽男子組準決賽 10日觀戰重點',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"高國豪\" src=\"/storage/news-posts/February2017/rnP2rKDi3FvuAtbaLyl5.jpg\" alt=\"高國豪\" />\n<figcaption><span style=\"color: rgba(0, 0, 0, 0.541176); font-family: Helvetica, Arial, sans-serif; font-size: 12px; letter-spacing: 2px; text-align: start; background-color: #ffffff;\">▲高國豪打出本季至今最佳表現。(圖/記者林志儒攝)</span></figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">105學年度HBL高中籃球甲級聯賽男子組八強準決賽於今(9)日休兵一天,10日將重新點燃戰火,接下來三天的賽程將是場場關鍵,每隊必定會卯足全力,爭取前往小巨蛋的四強門票。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">準決賽前四天賽程打完,能夠分成兩個集團,領先的集團分別是都拿下四連勝的南山高中、松山高中及高苑工商,也能排在領先集團的是「爆冷」輸給東山高中的能仁家商,能仁戰績為3勝1敗。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">較為不利的集團分別是1勝3敗的東山高中,以及三隻都吞下四連敗的泰山高中、南湖高中及東泰高中。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">男子組的比賽於兩地開打,分別在新莊體育館以及板橋體育館。新莊首戰是15:40泰山對決東泰,第二場是17:20高苑對上松山,第三場則是19:00能仁對決南山。板橋只有一場男子組的比賽,16:20由南湖對上東山。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">八強賽開打之前大家相當看好的泰山,但由於受到傷兵困擾,少了韓杰諭這名長人助陣,本屆賽事能走多遠,就看之後對上東泰、東山、南湖能否都拿下勝利,不然可能要到8強止步,全隊也希望能力拼八強首勝。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">東泰則是隊史首次晉級八強,當然也希望能夠力拼首勝,因此泰山對決東泰,兩隊勢必會上演一場惡戰,精彩可期。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">高苑對上松山則是面子之爭,兩隊在前四天都拿下四連勝,本場觀戰重點也在兩位高中「頂級」後衛的對決,高苑田浩對決松山高國豪,一直是大家的焦點,尤其在八強賽場場都有輸不得的壓力下,更能突顯其球星特質。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">能仁對決南山則是能仁有輸不得的壓力,前四天賽程「爆冷」輸給東山高中,晉級四強路上有了變數,畢竟最後三天的賽程分別對上南山、松山及高苑,能否晉級四強真的要全力以赴。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">南湖對決東山則是南湖要力拼首勝,東山因為贏能仁之後,保有晉級四強的一線生機,南湖則在三年級「雙槍」林仕軒、林梓峰火力不如預期,八強賽打得格外辛苦,「雙槍」能否及時回穩,攸關南湖的路能走多遠。</p>\n<p>&nbsp;</p>',\n 'image' => '',\n 'meta_description' => '105學年度HBL高中籃球甲級聯賽男子組八強準決賽於今(9)日休兵一天,10日將重新點燃戰火,接下來三天的賽程將是場場關鍵,每隊必定會卯足全力,爭取前往小巨蛋的四強門票。',\n 'meta_keywords' => '體育周報,運動,籃球,HBL,男子組,八強準決賽',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '顏真真',\n 'title' => '終止連2貶! 新台幣收31.046、升值8.2分',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 7,\n 'seo_title' => '終止連2貶! 新台幣收31.046、升值8.2分',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"新台幣匯率\" src=\"/storage/news-posts/February2017/znbCG8Qe69FkBTfOQhDz.jpg\" alt=\"新台幣匯率\" />\n<figcaption><span style=\"color: rgba(0, 0, 0, 0.541176); font-family: Helvetica, Arial, sans-serif; font-size: 12px; letter-spacing: 2px; text-align: start; background-color: #ffffff;\">▲亞洲貨幣兌美元表現牽動新台幣匯率走勢。(圖/NOWnews資料照)</span></figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">台北股、匯市9日同步走揚,新台幣兌美元9日終場收在31.046元、升值8.2分,也終止連續兩個交易日貶值走勢,台北外匯經紀公司成交量為6.05億美元。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">台股9日開高走高,終場上漲46.93點,收在9590.18點,成交量新台幣1034.46億元,3大法人合計在台股買超新台幣50.31億元,其中外資買超41.76億元。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">國際匯市部分,日圓一度升值至111.69日圓兌1美元,之後拉回至112.3價位,韓元則在1141.59至1147.4韓元兌1美元盤整,而人民幣兌美元中間價來到6.8710元兌1美元,較前一交易日(8日)中間價6.8849元升值139基點。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">至於新台幣,匯銀人士指出,新台幣兌美元以31.12元、升值0.8分開出後,在台股走揚及亞洲主要貨幣兌美元偏升下,一度觸及31.032元、升值9.6分,不過,隨後亞幣拉回,新台幣兌美元轉趨盤整,終場收在31.046元、升值8.2分,也終止連續兩個交易日升值走勢。</p>',\n 'image' => '',\n 'meta_description' => '台北股、匯市9日同步走揚,新台幣兌美元9日終場收在31.046元、升值8.2分,也終止連續兩個交易日貶值走勢,台北外匯經紀公司成交量為6.05億美元。',\n 'meta_keywords' => '財經,新台幣,台股,理財,美元,日圓',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'breaking_news' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '彭夢竺',\n 'title' => 'ApplePay將啟用 台灣行動支付大戰準備好了?',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 7,\n 'seo_title' => 'ApplePay將啟用 台灣行動支付大戰準備好了?',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"台灣行動支付\" src=\"/storage/news-posts/February2017/GZVsKlJhvU37sSNiIMgs.jpg\" alt=\"台灣行動支付\" />\n<figcaption><span style=\"color: rgba(0, 0, 0, 0.541176); font-family: Helvetica, Arial, sans-serif; font-size: 12px; letter-spacing: 2px; text-align: start; background-color: #ffffff;\">▲Apple Pay即將登台,台灣再度掀起一波行動支付大戰,GO survey調查發現,台灣行動支付發展依舊受到安全性牽制,使用現金及信用卡消費的民眾仍超過8成。(圖/HAPPY GO提供)</span></figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">隨著蘋果公司宣布Apple Pay即將登台,無論是電信業、通訊軟體或是手機品牌也先後大舉推出行動支付服務,台灣再度掀起一波行動支付大戰;不過,五花八門、琳琅滿目的支付工具,是否符合消費者的使用習慣與期待?HAPPY GO旗下的線上市調中心GO survey調查發現,台灣行動支付發展受到安全性牽制,便利是促動民眾使用的主因,且女性對行動支付觀念較開放,大多以超商、帳單繳交、餐飲娛樂及交通等日常生活場域為主。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">不管是FriDay Wallet、Line Pay、Samsung Pay,台灣行動支付浪潮正式展開,根據台灣金管會的觀察,預估在2020年全台行動支付的占比將達5成,但目前台灣使用現金及信用卡消費的仍超過8成,說明現行台灣行動支付仍有很大的成長空間。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">GO survey針對4千名消費者,透過線上問卷進行行動支付使用行為調查,根據調查結果,從消費者的角度分析歸納5大重點,窺探消費者期望未來行動支付的發展方向,以符合使用者的需求。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">調查結果顯示,隨著智能型商品的普及化,擁有智慧型手表、平板電腦、筆記型電腦的消費者,對於行動支付的接受度較高,未來橘色世代、女性對行動支付觀念較開放,20歲到29歲女性使用率高於男性。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">台灣行動支付發展受到許多限制,調查結果也發現,消費者習慣透過信用卡、現金的支付方式,並有近7成的消費者認為行動支付在安全性、個資洩漏上仍有很大的風險,只有像是Line Pay、歐付寶等因為使用方便、布點廣,加上知名度高,較為受到歡迎。<br style=\"box-sizing: border-box;\" />&nbsp;<br style=\"box-sizing: border-box;\" />此外,GO survey指出,民眾使用行動支付的情境以超商、帳單繳交、餐飲娛樂及交通等日常生活場域為主,且希望行動支付可以結合更多元的功能與優惠訊息,並持續簡化使用程序與優化介面,才能有助提升使用意願,成功延伸行動支付的普及與應用。</p>',\n 'image' => '',\n 'meta_description' => '隨著蘋果公司宣布Apple Pay即將登台,無論是電信業、通訊軟體或是手機品牌也先後大舉推出行動支付服務,台灣再度掀起一波行動支付大戰;不過,五花八門、琳琅滿目的支付工具,是否符合消費者的使用習慣與期待?HAPPY GO旗下的線上市調中心GO survey調查發現,台灣行動支付發展受到安全性牽制,便利是促動民眾使用的主因,且女性對行動支付觀念較開放,大多以超商、帳單繳交、餐飲娛樂及交通等日常生活場域為主。 ',\n 'meta_keywords' => '財經,行動支付,Apple Pay,GO survey',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '顏真真',\n 'title' => '違憲修法 薪扣額可能採雙軌制 最晚2020年報稅適用',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 7,\n 'seo_title' => '違憲修法 薪扣額可能採雙軌制 最晚2020年報稅適用',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"財政部賦稅署副署長宋秀玲\" src=\"/storage/news-posts/February2017/vXHERyTJ9tcrxUo4Xvxo.jpg\" alt=\"財政部賦稅署副署長宋秀玲\" />\n<figcaption><span style=\"color: rgba(0, 0, 0, 0.541176); font-family: Helvetica, Arial, sans-serif; font-size: 12px; letter-spacing: 2px; text-align: start; background-color: #ffffff;\">▲財政部賦稅署副署長宋秀玲。(圖/記者顏真真攝,2017.2.9)</span></figcaption>\n</figure>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">針對林若亞聲請釋憲案,大法官會議做出745號解釋,綜所稅薪資特別扣除額明定法定上限12.8萬元,違反平等原則違憲。對此,財政部9日召開記者會表示,未來將參考各國薪資所得課稅制度,在兼顧量能課稅與簡政便民原則下,尋求合理計算所得方式,訂定相關配套措施,一定會在兩年內檢討修正所得稅法相關規定,也就是說,最晚在2019年2月完成修法、2020年5月申報綜所稅時適用,薪資所得扣除額可能新增「實額扣除」選項。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">財政部賦稅署副署長宋秀玲9日指出,其實,目前各國做法不同,有採核實扣除,也有定額扣除、定率扣除,不過,由於薪資所得課稅人數在各國比例都很大,因此,還是要看當地稅法慣例,像是美國個人所得稅採列舉扣除、日本則採定率扣除、韓國採稅額扣除、中國大陸與台灣一樣,都是採定額扣除的方式。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">宋秀玲表示,過去我國考量薪資所得者多屬中低收入者,成本費用減除舉證有其困難度,加上這幾年用稅額試算也有共識,定額扣除對稅額計算是有其必要性,根據2015年綜合所得稅總申報戶共613萬戶,其中申報薪資所得戶數約540萬戶,估計薪資所得者適用稅額試算服務比例高達9成以上,該服務對薪資所得者確有簡化申報及大幅節省成本與時間效益。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">宋秀玲也強調,大法官釋憲中也表明,薪資所得定額扣除有其必要性與合理性,基於簡便、考量稽徵成本及納稅人舉證困難,採定額扣除方式對納稅人是較有利。至於未來薪資所得扣除的稅法設計是否會採多軌制?她說,依照大法官解釋,除現行「定額扣除」,還要多一個「實額扣除」,而且最晚要在2019年2月完成修法,也就是說,最晚2020年5月申報綜所稅時適用。</p>\n<p style=\"box-sizing: border-box; font-family: Helvetica, Arial, sans-serif; margin: 0px 0px 10px; max-width: 100%; color: rgba(0, 0, 0, 0.870588); font-size: 16px; letter-spacing: 2px;\">至於外界擔心修法後一般納稅人較難受惠,反有利高所得者,宋秀玲說,從大法官解釋意旨來看,主要是認為所得計算要符合真實所得,若未來稅法准許減除賺取薪資的直接必要成本費用,計算出的還是實質所得,而且納稅人要負相當舉證責任,「我想不至於有這樣的顧慮」,只是稅制會變複雜。</p>\n<p>&nbsp;</p>',\n 'image' => '',\n 'meta_description' => '針對林若亞聲請釋憲案,大法官會議做出745號解釋,綜所稅薪資特別扣除額明定法定上限12.8萬元,違反平等原則違憲。對此,財政部9日召開記者會表示,未來將參考各國薪資所得課稅制度,在兼顧量能課稅與簡政便民原則下,尋求合理計算所得方式,訂定相關配套措施,一定會在兩年內檢討修正所得稅法相關規定,也就是說,最晚在2019年2月完成修法、2020年5月申報綜所稅時適用,薪資所得扣除額可能新增「實額扣除」選項。',\n 'meta_keywords' => '財經,財政部,所得稅,薪資所得',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '財經中心',\n 'title' => '券商遭勒索駭客來自境外 證交所建置24小時監控服務',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 7,\n 'seo_title' => '券商遭勒索駭客來自境外 證交所建置24小時監控服務',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"證交所董事長施俊吉\" src=\"/storage/news-posts/February2017/v3WjUstnkB62l28FApS7.jpg\" alt=\"證交所董事長施俊吉\" />\n<figcaption><span style=\"color: #333333; font-family: \\'Helvetica Neue\\', Helvetica, Arial, sans-serif; font-size: 16px; text-align: left; background-color: #bfbfbf;\">▲近期有部份證券、期貨商遭分散式阻斷服務攻擊勒索事件(簡稱DDOS),證交所指出,經過初步調查都是境外攻擊。圖為證交所董事長施俊吉。(圖/記者許家禎攝,2016.11.30)</span></figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px 0px 1em; color: #333333; font-family: \\'Helvetica Neue\\', Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;\">近期有部份證券、期貨商遭分散式阻斷服務攻擊事件(簡稱DDOS),導致部分業者對外網頁頻寬滿載,以至於網路相關服務受到影響。金管會指示證交所利用「證券期貨市場資安通報平台」進行資安事件通報,並建置24小時監控服務。證交所今(9)日指出,此次駭客攻擊事件,經過初步調查都是境外攻擊,其中有由越南的網站攻擊。</p>\n<p style=\"box-sizing: border-box; margin: 0px 0px 1em; color: #333333; font-family: \\'Helvetica Neue\\', Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;\">證交所指出,這次DDOS攻擊影響業者眾多,政府相關單位均密切關注,金管會於第一時間啟動資安事件緊急應變機制,向行政院通報證券、期貨商遭受DDoS攻擊情形,同時協調所有金融業者加強資訊安全防護等五大措施,並指示證交所利用「證券期貨市場資安通報平台」進行資安事件通報,於「證券期貨產業資安資訊分享與分析中心」將相關資安資訊提供業者,及建置24小時網站監控服務,適時提醒業者注意並採取防護措施。</p>\n<p style=\"box-sizing: border-box; margin: 0px 0px 1em; color: #333333; font-family: \\'Helvetica Neue\\', Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;\">證交所表示,此次駭客攻擊事件,經過初步調查都是境外攻擊,其中有由越南的網站發動攻擊,但證交所也說,駭客可能隱藏位置或控制電腦,因此不代表就是越南方攻擊,至於券商遭勒索比特幣金額不等,跟券商大小無關,只是隨機的數字而已。</p>\n<p style=\"box-sizing: border-box; margin: 0px 0px 1em; color: #333333; font-family: \\'Helvetica Neue\\', Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;\">證交所於今(9)日上午請證券期貨周邊單位、三大電信公司、證券商及期貨商公會代表開會,行政院資安處、金管會資訊處及證期局等政府督導單位均列席指導,共同討論本次事件的預警、通報、資訊分享及電信業者所提供相關流量阻絕及清洗服務等機制,並就加強資訊安全防護措施、證券期貨市場現行應變機制、如何改善通報等議題進行檢討,同時請電信業者強化流量異常偵測功能,以及早發現並協助業者加速排除問題。</p>\n<p style=\"box-sizing: border-box; margin: 0px 0px 1em; color: #333333; font-family: \\'Helvetica Neue\\', Helvetica, Arial, sans-serif; font-size: 16px; text-align: justify;\">證交所董事長施俊吉會中作成3項指示,1、通報機制須更明確。2、由單一窗口新聞發布以避免訊息混亂。3、針對DDoS攻擊防護提供技術支援。因應後續業者可能遭受的DDoS攻擊,將由證交所、相關業者公會及電信業者不定期召開緊急應變會議以處理相關問題。</p>\n<p>&nbsp;</p>',\n 'image' => '',\n 'meta_description' => '近期有部份證券、期貨商遭分散式阻斷服務攻擊事件(簡稱DDOS),導致部分業者對外網頁頻寬滿載,以至於網路相關服務受到影響。金管會指示證交所利用「證券期貨市場資安通報平台」進行資安事件通報,並建置24小 | NOWnews 今日新聞',\n 'meta_keywords' => '券商遭駭,駭客勒索,DDoS攻擊,證交所,財經',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '盧冠誠',\n 'title' => '央行:物價2月應明顯下滑 若續破2%會有行動',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 7,\n 'seo_title' => '央行:物價2月應明顯下滑 若續破2%會有行動 - 財經 - 自由時報電子報',\n 'excerpt' => '',\n 'body' => '<p><span style=\"color: #333333; font-family: Arial, 新細明體, Helvetica, sans-serif; font-size: 15.2px; letter-spacing: 1px;\">主計總處昨公布1月CPI(消費者物價指數)年增率達2.25%,創近11個月新高,外界擔憂國內通貨膨脹是否過高,對此,中央銀行今天表示,這主要是受到農曆年的季節性因素影響,2月物價就會明顯下滑。</span></p>\n<figure class=\"image\"><img title=\"央行總裁彭淮南\" src=\"/storage/news-posts/February2017/0LOKmObkTZ9F5thc7PHW.jpg\" alt=\"央行總裁彭淮南\" />\n<figcaption><span style=\"color: #333333; font-family: Arial, 新細明體, Helvetica, sans-serif; font-size: 12.35px; letter-spacing: 1px; text-align: left; background-color: #dddddd;\">1月CPI(消費者物價指數)年增率達2.25%,中央銀行今天表示,主要是受到農曆年的季節性因素影響,2月物價就會明顯下滑。圖為央行總裁彭淮南。(資料照,記者王藝菘攝)</span></figcaption>\n</figure>\n<p style=\"margin: 0px; padding: 10px 5px; border: 0px; font-size: 0.95em; font-family: Arial, 新細明體, Helvetica, sans-serif; line-height: 25px; color: #333333; letter-spacing: 1px;\">&nbsp;</p>\n<p style=\"margin: 0px; padding: 10px 5px; border: 0px; font-size: 0.95em; font-family: Arial, 新細明體, Helvetica, sans-serif; line-height: 25px; color: #333333; letter-spacing: 1px;\">央行官員指出,1月CPI年增率升為2.25%,主因今年春節落在1月(去年在2月),部分服務費(如保母費、計程車資等)循例加價;若扣除春節循例加價的服務費,則1月CPI年增率降為1.61%,低於去年12月的1.7%。</p>\n<p style=\"margin: 0px; padding: 10px 5px; border: 0px; font-size: 0.95em; font-family: Arial, 新細明體, Helvetica, sans-serif; line-height: 25px; color: #333333; letter-spacing: 1px;\">央行官員表示,由於國內需求和緩,實際產出低於潛在產出,通膨預期溫和,主要機構預測今年CPI年增率平均值為1.18%。</p>\n<p style=\"margin: 0px; padding: 10px 5px; border: 0px; font-size: 0.95em; font-family: Arial, 新細明體, Helvetica, sans-serif; line-height: 25px; color: #333333; letter-spacing: 1px;\">至於一例一休對物價造成的衝擊,央行官員說,主計總處即將公布最新預測,屆時會把該因素考慮進去。</p>\n<p>&nbsp;</p>\n<p style=\"margin: 0px; padding: 10px 5px; border: 0px; font-size: 0.95em; font-family: Arial, 新細明體, Helvetica, sans-serif; line-height: 25px; color: #333333; letter-spacing: 1px;\">央行官員強調,若未來CPI年增率持續高過國發計畫的2%目標,央行必要時將採行妥適因應措施,例如透過調整準備貨幣,以及公開市場操作等。</p>',\n 'image' => '',\n 'meta_description' => '主計總處昨公布1月CPI(消費者物價指數)年增率達2.25%,創近11個月新高,外界擔憂國內通貨膨脹是否過高,對此,中央銀行今天表示,這主要是受到農曆年的季節性因素影響,2月物價就會明顯下滑。央行官員指出,1月CPI年增率升為2.25%,主因今年春節落在1月(去年在2月),部分服務費(如保母費、計程車資等)循例加價;若扣除春節循例加價的服務費,則1月CPI年增率降為1.61%,低於去年12月的1.7%。',\n 'meta_keywords' => '自由時報, 自由電子報, 自由時報電子報, Liberty Times Net, LTN',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => 'ETtoday國際新聞',\n 'title' => '英特爾用70億美元討川普歡心 7奈米工廠創3千職缺',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 6,\n 'seo_title' => '英特爾用70億美元討川普歡心 7奈米工廠創3千職缺 | ETtoday 東森新聞雲',\n 'excerpt' => '',\n 'body' => '<figure class=\"image\"><img title=\"英特爾公司(Intel)執行長科再奇(Brian Krzanich)\" src=\"/storage/news-posts/February2017/1ZDnlYJdv4pMbTlMBADV.jpg\" alt=\"英特爾公司(Intel)執行長科再奇(Brian Krzanich)\" />\n<figcaption>▲半導體業巨擘英特爾公司(Intel)執行長科再奇(Brian Krzanich)與川普。(圖/達志影像)</figcaption>\n</figure>\n<p>&nbsp;</p>\n<p>美國總統川普上任不到一個月,不少美國企業已經撤回海外資金回本土。半導體業巨擘英特爾公司(Intel)執行長科再奇(Brian Krzanich)今天在白宮橢圓辦公室宣布,將投資70億美元建造一家晶圓工廠,地點位在亞利桑納州。Fab 42 是全球最先進晶圓廠,生產 7 奈米晶片,可用於智慧型手機和資料中心領域。</p>\n<p>英特爾公司與美國總統川普一直在倡導新政策,以提高國內製造業。英特爾公司執行長科再奇(Brian Krzanich)表示,「我們支持政府的政策,通過新的標準和投資政策,使美國製造業在全球的競爭。」</p>\n<p>科再奇也說,英特爾已籌備這個工廠多年,希望在白宮與大家宣布這個消息,英特爾公司支持稅收和法規政策。而這間半導體工廠會在3至4年內建造完成,可創造 3 千個高科技、高收入就業機會。</p>\n<figure class=\"image\"><img title=\"半導體業巨擘英特爾公司(Intel)執行長科再奇(Brian Krzanich)\" src=\"/storage/news-posts/February2017/vt8JrkLuLBHC1pSEhd2x.jpg\" alt=\"半導體業巨擘英特爾公司(Intel)執行長科再奇(Brian Krzanich)\" />\n<figcaption>▲半導體業巨擘英特爾公司(Intel)執行長科再奇(Brian Krzanich)。(圖 /翻攝自 Brian Krzanich 推特)</figcaption>\n</figure>\n<p>&nbsp;</p>\n<p style=\"margin: 0px; padding: 0px; border: 0px; outline: 0px; font-family: Verdana, Geneva, sans-serif, 新細明體; color: #000000; font-size: 13px;\">&nbsp;</p>',\n 'image' => '',\n 'meta_description' => '美國總統川普上任不到一個月,不少美國企業已經撤回海外資金回本土。半導體業巨擘英特爾公司(Intel)執行長科再奇(Brian Krzanich)今天在白宮橢圓辦公室宣布,將投資70億美元建造一家晶圓工廠,地點位在亞利桑納州。Fab 42 是全球最先進晶圓廠,生產7 奈米晶片,可應於智慧型手機與資料中心領域。(Brian Krzanich,英特爾,Intel)',\n 'meta_keywords' => 'Brian Krzanich,英特爾,Intel',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '許凱涵',\n 'title' => '元宵佳節吃湯圓 衛生局為民眾健康把關',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 10,\n 'seo_title' => '元宵佳節吃湯圓 衛生局為民眾健康把關',\n 'excerpt' => '',\n 'body' => '<p><img src=\"/storage/news-posts/February2017/sqD6t5mwEYj7akF6HfHL.jpg\" alt=\"\" width=\"300\" height=\"401\" /></p>\n<p class=\"middle\" style=\"margin: 0px 0px 1.4em; padding: 0px; border: 0px; outline: 0px; font-size: 16px; vertical-align: baseline; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; font-family: Arial, Helvetica, sans-serif; line-height: 1.8em; color: #242424; letter-spacing: 1px;\">元宵節即將到來,在闔家同慶賞花燈、猜燈謎的同時,民眾少不了吃元宵湯圓應景,高雄市政府衛生局為保障市民食的安全並強化食品安全衛生管理,前往市場攤商、冷熱飲店及超市、大賣場等販售場所抽驗包裝及散裝湯圓、芋圓、豆餡(紅豆、薏仁)等,共計21件,檢驗項目包括防腐劑己二烯酸、苯甲酸、去水醋酸及規定內色素(8項)、規定外色素(鹽基性桃紅精等35項),檢驗結果均符合規定。</p>\n<p class=\"middle\" style=\"margin: 0px 0px 1.4em; padding: 0px; border: 0px; outline: 0px; font-size: 16px; vertical-align: baseline; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; font-family: Arial, Helvetica, sans-serif; line-height: 1.8em; color: #242424; letter-spacing: 1px;\">依「食品添加物使用範圍及限量暨規格標準」,防腐劑去水醋酸僅能使用於乾酪、乳酪、奶油及人造奶油等食品中,不得使用於湯圓產品;苯甲酸、己二烯酸可使用於湯圓產品,惟使用限量為1.0g/kg以下,違者將依違反食品安全衛生管理法第18條規定,依同法第47條第8款處新臺幣3-300萬元罰鍰;目前國內准用之著色劑分別是紅色6號、7號、40號,黃色4號、5號,綠色3號以及藍色1號、2號等,至於工業染料(如Rhodamine B 鹽基性桃紅精)不得添加於食品,違者依同法第15條第1項第10款,依同法第49條第1項處7年以下有期徒刑,得併科新臺幣8千萬以下罰金。</p>\n<p class=\"middle\" style=\"margin: 0px 0px 1.4em; padding: 0px; border: 0px; outline: 0px; font-size: 16px; vertical-align: baseline; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; font-family: Arial, Helvetica, sans-serif; line-height: 1.8em; color: #242424; letter-spacing: 1px;\">衛生局呼籲業者應落實自主管理,搓湯圓時要注意手部及製程環境衛生並遵守食品添加物使用相關規定,販賣業者需注意產品儲藏條件(冷藏溫度攝氏0-7℃,冷凍溫度攝氏負18℃以下)等。另提醒消費者湯圓為高熱量食品,以包餡元宵湯圓為例,4顆湯圓熱量相當於吃進一碗白飯,民眾可依產品外包裝營養標示依自己需求選購,進食時請小口食用並細嚼慢嚥,避免造成消化道或食道哽塞之風險。</p>\n<p class=\"middle\" style=\"margin: 0px 0px 1.4em; padding: 0px; border: 0px; outline: 0px; font-size: 16px; vertical-align: baseline; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; font-family: Arial, Helvetica, sans-serif; line-height: 1.8em; color: #242424; letter-spacing: 1px;\">衛生局重視消費者飲食安全,除了節慶前密集抽驗監測之外,接近節慶時仍會突擊稽查,以上稽查結果,可逕上高雄市政府衛生局網站(http://khd.kcg.gov.tw/)食品衛生專區查詢。若有任何食品衛生問題,歡迎逕洽衛生局食品衛生科(洽詢專線7134000轉食品衛生科)。</p>',\n 'image' => '',\n 'meta_description' => '元宵節即將到來,在闔家同慶賞花燈、猜燈謎的同時,民眾少不了吃元宵湯圓應景,高雄市政府衛生局為保障市民...',\n 'meta_keywords' => '元宵佳節,湯圓',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '蔡佳霖',\n 'title' => '鄧肯球衣退休 馬刺隊史第8人',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => '鄧肯球衣退休 馬刺隊史第8人 | NBA戰況 | NBA 台灣',\n 'excerpt' => '',\n 'body' => '<p>馬刺將在明天(19日)主場迎戰鵜鶘,這場比賽的賽後將會舉辦鄧肯(Tim Duncan)21號球衣退休儀式,格林(Danny Green)接受採訪時表示,他期盼球隊可以拿下這場勝利,留下一個最完美的結局。</p>\n<p>「這很像大四之夜,你可不希望學長們輸掉他們最後一場主場比賽。」格林說。「我們想為他贏得這場比賽,所以我們必須一開始就全力投入,展現能量,打出一場好的比賽。」</p>\n<p>鄧肯將是馬刺隊史第8位享受球衣退休榮耀的球員,前7位分別是羅賓森(David Robinson)、葛文(George Gervin)、艾略特(Sean Elliot)、強森(Avery Johnson)、包恩(Bruce Bowen)、西拉斯(James Silas)、摩爾(Johnny Moore)。</p>\n<p><iframe title=\"Tim Duncan Jersey Retirement Intro Video | Dec 18, 2016 | 2016-17 NBA Season\" src=\"https://www.youtube.com/embed/kYio4NoAE18?wmode=opaque&amp;theme=dark\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"\"></iframe></p>\n<p>&nbsp;</p>\n<p>根據先前的消息,這場比賽進場的球迷將會得到一件特製的鄧肯紀念T恤。</p>\n<p>40歲的鄧肯在今年夏天宣佈退休,結束19年的征戰。這19年期間,鄧肯打造了一個恐怖的馬刺盛世,球隊例行賽勝率從未低於6成,每一年都打進季後賽,還創下連續17年至少50勝的空前成就,幾乎成了難以擊破的超級障礙。</p>\n<p>鄧肯個人5度奪下總冠軍,15次入選明星賽,2度獲得年度MVP,3次決賽MVP,10次入選年度第一隊(3次年度第二隊和2次年度第三隊),8次入選年度防守第一隊(7次年度防守第二隊)。在生涯總得分、總籃板數、阻攻數、出賽場數、進球數均高居馬刺隊史第一位。</p>\n<p><img src=\"/storage/news-posts/February2017/IHqa7zo0CbTM5YpdxYTf.png\" alt=\"\" width=\"655\" height=\"435\" /></p>',\n 'image' => 'news-posts/February2017/yTCwJDejkjGou82AzkPb.jpg',\n 'meta_description' => '馬刺將在明天(19日)主場迎戰鵜鶘,這場比賽的賽後將會舉辦鄧肯(Tim Duncan)21號球衣退休儀式,格林(Danny Green)接受採訪時表示,他期盼球隊可以拿下這場勝利,留下一個最完美的結局。',\n 'meta_keywords' => '鄧肯,馬刺,格林,鵜鶘',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'carousel' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '劉家維',\n 'title' => 'NBA/再見永遠的21號!馬刺退休鄧肯球衣',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 1,\n 'seo_title' => 'NBA/再見永遠的21號!馬刺退休鄧肯球衣 | 運動 | 三立新聞網 SETN.COM',\n 'excerpt' => '馬刺主場AT&T Center在此役賽後為傳奇球星Tim Duncan舉辦了溫馨而隆重的球衣退休儀式,向這位陪伴馬刺走過19個球季的巨星致敬。',\n 'body' => '<p><span style=\"color: #333333; font-family: 微軟正黑體; font-size: 16px; text-align: justify;\">今(19)日聖安東尼奧馬刺在主場以113:100擊敗了紐奧良鵜鶘,不過在這特殊的夜晚,比賽勝負早已不是重點,馬刺主場AT&amp;T Center在此役賽後為傳奇球星Tim Duncan舉辦了溫馨而隆重的球衣退休儀式,向這位陪伴馬刺走過19個球季的巨星致敬。</span></p>\n<p><span style=\"color: #333333; font-family: 微軟正黑體; font-size: 16px; text-align: justify;\"><img title=\"tim duncan retirement jersey\" src=\"/storage/news-posts/February2017/QPHeMDhmf4mEP2F2Wty7.jpg\" alt=\"tim duncan retirement jersey\" width=\"523\" height=\"345\" /></span></p>\n<p>&nbsp;</p>\n<p style=\"margin: 0px 0px 1em; padding: 0px; color: #333333; font-family: 微軟正黑體; font-size: 16px; text-align: justify;\">今天包括Tim Duncan的家人們,以及他的大學恩師Dave Odom、傳奇球星「海軍上將」David Robinson、總教練Gregg Popovich,以及「GDP」隊友Tony Parker和Manu Ginobili等人都盛裝出席,並輪流為他致詞。</p>\n<p style=\"margin: 0px 0px 1em; padding: 0px; color: #333333; font-family: 微軟正黑體; font-size: 16px; text-align: justify;\">隨後馬刺主場大螢幕播放起精心準備的一段回顧影片,Duncan進入聯盟第二年就和David Robinson一同幫助馬刺奪下隊史首冠,包括2003、2005、2007、2014球季馬刺隊史五座總冠軍Duncan都功不可沒,有他在的19個球季馬刺每年都進入季後賽,他場上的身影早已是馬刺球迷難以忘懷的回憶。</p>\n<p style=\"margin: 0px 0px 1em; padding: 0px; color: #333333; font-family: 微軟正黑體; font-size: 16px; text-align: justify;\">最後輪到Duncan進行演說,他才剛接過麥克風就語帶哽咽,再次感謝了所有聖安東尼奧球迷,感謝整座城市對他的愛與支持。「每個人都在講我帶給他們什麼,但對我來說,你們對我的意義才更重大。」Duncan說:「是你們讓一切變成可能,尤其是Popovich,對我而言你不僅是一名教練,更是一位父親。」</p>\n<p style=\"margin: 0px 0px 1em; padding: 0px; color: #333333; font-family: 微軟正黑體; font-size: 16px; text-align: justify;\">最後Duncan也不忘笑中含淚地自嘲,儘管是這麼隆重的場合他還是沒有打領帶,而且難得的是,自己演講超過了30秒。隨著他向台下嘉賓一一致敬,馬刺主場上空Duncan的21號球衣也緩緩揭幕,並永遠高掛在此。</p>\n<p style=\"margin: 0px 0px 1em; padding: 0px; color: #333333; font-family: 微軟正黑體; font-size: 16px; text-align: justify;\"><iframe title=\"Tim Duncan Full Speech | Jersey Retirement Ceremony | December 18, 2016\" src=\"https://www.youtube.com/embed/Ln16us_-sbA?wmode=opaque&amp;theme=dark\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"\"></iframe></p>\n<p style=\"margin: 0px 0px 1em; padding: 0px; color: #333333; font-family: 微軟正黑體; font-size: 16px; text-align: justify;\">&nbsp;</p>',\n 'image' => 'news-posts/February2017/NMvXObaO5UAUyUPiRlj3.jpg',\n 'meta_description' => '今(19)日聖安東尼奧馬刺在主場以113:100擊敗了紐奧良鵜鶘,不過在這特殊的夜晚,比賽勝負早已不是重點,馬刺主場AT&amp;T Center在此役賽後為傳奇球星Tim Duncan舉辦了溫馨而隆重的球衣退休儀式,向這位陪伴馬刺走過19個球季的巨星致敬。',\n 'meta_keywords' => '退休,NBA,馬刺,Tim Duncan,Gregg Popovich,三立,三立新聞,三立新聞台,三立財經台,新聞台,財經台',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '林國賢',\n 'title' => '台灣燈會湧人潮、車潮 交通大打結',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 2,\n 'seo_title' => '台灣燈會湧人潮、車潮 交通大打結 - 生活 - 自由時報電子報',\n 'excerpt' => '',\n 'body' => '<p>台灣燈會開燈湧入190萬人參觀,散場時人潮、車潮塞爆,直到今天凌晨1時許才紓解;主辦單位預估今天入場人數與昨天相當,呼籲民眾多搭乘大眾運輸工具轉搭接駁車,紓解交通壓力。</p>\n<figure class=\"image\"><img title=\"台灣燈會開幕夜,現場人山人海。(圖由縣府提供)\" src=\"/storage/news-posts/February2017/CmmsqqAYoFaaxGdIqAZP.jpg\" alt=\"台灣燈會開幕夜,現場人山人海。(圖由縣府提供)\" />\n<figcaption>台灣燈會開幕夜,現場人山人海。(圖由縣府提供)</figcaption>\n</figure>\n<p>&nbsp;</p>\n<p>台灣燈會昨晚由總統蔡英文與民眾一起倒數開燈,賞燈民眾將燈區擠得水洩不通,晚上8時30分以後民眾陸續離場,但人潮眾多疏散不易,燈會周邊交通更是大打結,包括清雲路、145線道吳厝段、145乙往國道一號虎尾交流道段,一度定點動彈不得,直到凌晨0時過後才逐漸恢復正常。</p>\n<figure class=\"image\"><img title=\"台灣燈會首日人車爆滿,散場時周邊道路大塞車,直到今天凌晨才紓解。(記者林國賢攝)\" src=\"/storage/news-posts/February2017/g8nJVngS73epMx69xcBB.jpg\" alt=\"台灣燈會首日人車爆滿,散場時周邊道路大塞車,直到今天凌晨才紓解。(記者林國賢攝)\" />\n<figcaption>台灣燈會首日人車爆滿,散場時周邊道路大塞車,直到今天凌晨才紓解。(記者林國賢攝)</figcaption>\n</figure>\n<p>&nbsp;</p>\n<p>雲林縣政府文化處長林孟儀表示,今天入場賞燈民眾預估與昨天相當,但因明天是上班日,遊客應會提早離場,人潮最多時間應是晚間8、9點,希望民眾多使用大眾運輸系統,方便又安全。</p>\n<p>林孟儀指出,縣府在燈區周邊道路規劃接駁車專用道,主要提供接駁車及發生緊急事故供救護車、警車等救護車輛行駛,請一般車輛不要誤入,影響接駁與救護。</p>\n<p>&nbsp;</p>',\n 'image' => 'news-posts/February2017/4D7GCKUDHm11hkvZ2opC.jpg',\n 'meta_description' => '台灣燈會開燈湧入190萬人參觀,散場時人潮、車潮塞爆,直到今天凌晨1時許才紓解;主辦單位預估今天入場人數與昨天相當,呼籲民眾多搭乘大眾運輸工具轉搭接駁車,紓解交通壓力。台灣燈會昨晚由總統蔡英文與民眾一起倒數開燈,賞燈民眾將燈區擠得水洩不通,晚上8時30分以後民眾陸續離場,但人潮眾多疏散不易,燈會周邊交通更是大打結,包括清雲路、145線道吳厝段、145乙往國道一號虎尾交流道段,一度定點動彈不得,直到凌晨0時過後才逐漸恢復正常。',\n 'meta_keywords' => '台灣燈會,自由時報, 自由電子報',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'carousel' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => 'TVBS',\n 'title' => '禍從天降!路跑遭10Kg重馬達砸傷 險沒命',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 3,\n 'seo_title' => '禍從天降!路跑遭10Kg重馬達砸傷 險沒命',\n 'excerpt' => '',\n 'body' => '<p>民眾參加路跑,卻被從天而降的馬達砸傷!12日上午,有銀行業者舉辦路跑活動,但一名陳姓男子經過麥帥二橋橋下時,橋墩維護平台上的馬達疑似老舊鬆脫,居然直接掉落打傷人,跑者當場倒地,送醫救治後頭縫了12針、下巴4針,門牙還斷裂。無辜的陳姓跑者受訪時說,他醒來時已經在救護車,要是馬達掉落時間再晚點,恐怕傷的人更多。</p>\n<p>記者吳欣倫:「當時陳姓跑者就是行經麥帥二橋下面,不過他頭頂上的維修平台當時有個馬達疑似老舊鬆脫,掉落後直接砸到他,讓他血流如柱。」</p>\n<p>參加路跑怎麼會被砸傷?惹禍的就是這台重達10公斤的馬達,外層都是明顯的生鏽痕跡,砸中路過的陳姓跑者,救護人員到場後趕緊將他送醫,由於頭部前額充當其衝,除了腦震盪之外,頭部縫了12針,下巴4針,門牙斷4根,回想起事發經過,陳姓跑者心有餘悸。</p>\n<p>受傷陳姓跑者:「那個時間只會覺得,我怎麼躺在救護車,我快嚇死了,我真的不知道為什麼會倒地耶。」</p>\n<p>真的嚇都嚇死了,或許是因為受傷的關係,陳姓跑者還是有些聲音微弱,熱愛路跑的他,和老婆才在幾天前參加花博路跑,獲得團體賽第2名,在朋友邀約下想再次突破,沒想到禍從天降。</p>\n<p>受傷陳姓跑者:「氣死我,我使出洪荒之力,然後我覺得喉嚨怪怪的,我摸頭都是血,我就跟他們講說,既然要弄就弄成都敏俊,害我以後不趕跑河邊了。」</p>\n<p>當時,陳姓跑者的太太也目擊了所有過程,但怎麼也沒想過,受傷的居然是身邊的枕邊人。</p>\n<p>遭砸傷跑者太太黃小姐:「我有看到一個人滿臉是血,我沒認出來他是我老公,之後才回想起來,原來血流如注的是我老公。」</p>\n<p>台北新工處工務科科長郭俊昇:「那個馬達平台比較老舊,零件要去做更換。」</p>\n<p>台北市新工處表示,本來在3月要維護的機具卻突然壞了,將會再了解惹禍原因,至於賠償部分,會以「工務險」處理,路跑主辦單位也有300萬的意外險;只是這回在熱愛的路跑出事,短時間他們行經河濱公園,恐怕心中都會有陰影揮之不去。</p>\n<p><img title=\"路跑遭10Kg重馬達砸傷\" src=\"/storage/news-posts/February2017/zz1kCB78vE1g0ArvLwwN.jpg\" alt=\"路跑遭10Kg重馬達砸傷\" width=\"870\" height=\"489\" /></p>',\n 'image' => 'news-posts/February2017/dEAEmSbVaKf141dKP77i.jpg',\n 'meta_description' => '民眾參加路跑,卻被從天而降的馬達砸傷!12日上午,有銀行業者舉辦路跑活動,但一名陳姓男子經過麥帥二橋橋下時,橋墩維護平台上的馬達疑似老舊鬆脫,居然直接掉落打傷人,跑者當場倒地,送醫救治後頭縫了12針、...',\n 'meta_keywords' => '路跑,馬達',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '黃村杉',\n 'title' => '平溪天燈節登場 20呎台日美景主燈升空',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 4,\n 'seo_title' => '平溪天燈節登場 20呎台日美景主燈升空-大台北-HiNet新聞',\n 'excerpt' => '',\n 'body' => '<p style=\"margin: 0px 0px 20px; padding: 0px; border: none; text-align: justify; color: #555555; font-family: 微軟正黑體, Arial, Helvetica; font-size: 18px;\">平溪天燈節11日於十分廣場隆重登場,吸引來自世界各地的朋友一早到場排隊,1200份天燈施放卷50分鐘內即發送完畢。今年天燈活動亮點是象徵臺日交流意象的20呎大型主燈,市長朱立倫、日本臺灣交流協會沼田幹夫代表及侯友宜、李四川、葉惠青等3位副市長一同施放,且也邀臺日小朋友攜手體驗放天燈的樂趣。</p>\n<p style=\"margin: 0px 0px 20px; padding: 0px; border: none; text-align: justify; color: #555555; font-family: 微軟正黑體, Arial, Helvetica; font-size: 18px;\">該象徵臺日交流意象的20呎大型主燈,囊括新北市的野柳、九份、淡水、烏來、金瓜石、鶯歌等地區,秀出獨特的山城、瀑布、博物館、原住民圖騰以及天燈飛升的美景,也同時呈現深受台灣人喜愛的日本人氣景點,像是富士山、大阪城、晴空塔、淺草寺等等,都是兩地10大必去、必遊的超熱門景點。</p>\n<p style=\"margin: 0px 0px 20px; padding: 0px; border: none; text-align: justify; color: #555555; font-family: 微軟正黑體, Arial, Helvetica; font-size: 18px;\">朱立倫表示,新北市平溪天燈節已邁入第19個年頭,每年吸引無數國內外遊客造訪,屢獲國際推崇與肯定。據交通部觀光局105年最新統計資料,平溪首度躍升為來臺自由行旅客最喜愛的前10大熱門景點之一,同年也獲得國家地理雜誌推薦為「全球10大最佳冬季旅遊」之一,證明平溪在國際上的熱門程度及獨特的觀光魅力,讓平溪地區從平靜純樸的小鎮化身為國際知名的觀光景點。</p>\n<p style=\"margin: 0px 0px 20px; padding: 0px; border: none; text-align: justify; color: #555555; font-family: 微軟正黑體, Arial, Helvetica; font-size: 18px;\">觀光旅遊局強調,隨著平溪天燈節的轉型,平溪在地商圈、社團與協會等也積極投入資源推廣在地觀光,像是敲鐘躲貓貓、天燈我材必有用等季節性活動。另2/19(日)、2/25(六)更邀請知名自然觀察家-劉克襄老師及平溪文史工作者-郭聰能老師,帶領大家一同淨山並體驗平溪自然與人文之美。</p>',\n 'image' => 'news-posts/February2017/49qaoehTEry7A7DkGyBr.jpg',\n 'meta_description' => '記者黃村杉/新北報導 平溪天燈節11日於十分廣場隆重登場,吸引來自世界各地的朋友一早到場排隊,1200份天燈施放卷50分鐘內即發送完畢。今年天燈活動亮點是象徵臺日交流意象的20呎大型主燈,市長朱立倫、...',\n 'meta_keywords' => '平溪天燈節登場',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '娛樂頻道',\n 'title' => '聽張學友唱到哭 盧廣仲台下竟幾乎全程比「這手勢」',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 5,\n 'seo_title' => '聽張學友唱到哭 盧廣仲台下竟幾乎全程比「這手勢」 - 自由娛樂',\n 'excerpt' => '',\n 'body' => '<p>55歲的「歌神」張學友昨日晚間在台北小巨蛋華麗開唱,連唱6場、7.1萬張的門票全部受鑿,推估吸金超過2.3億台幣,人氣依舊不減。而和張同為「巨蟹座又屬牛」的創作歌手盧廣仲昨日也親臨現場一睹偶像風采,更興奮表示「超級害羞我臉超級紅」。</p>\n<figure class=\"image\"><img title=\"張學友昨日晚間在台北開唱。(資料照,記者趙世勳攝)\" src=\"/storage/news-posts/February2017/icmizrtdNlJCUG4fOCj3.jpg\" alt=\"張學友昨日晚間在台北開唱。(資料照,記者趙世勳攝)\" />\n<figcaption>張學友昨日晚間在台北開唱。(資料照,記者趙世勳攝)</figcaption>\n</figure>\n<p>&nbsp;</p>\n<p>張學友昨日開始在台舉辦「A CLASSIC TOUR 學友&middot;經典世界巡迴演唱會」,歌手盧廣仲不僅親自現身,還在臉書發文以「條列式」透露感想。盧首先表示,他聽到張唱《吻別》和《每天愛你多一些》時忍不住落淚,還跟張說自己小學參加歌唱比賽時就是演唱《吻別》,不過慘在第一輪就被淘汰,沒想到張回應說「因為很不適合你唱唷」,反應超幽默。</p>\n<figure class=\"image\"><img title=\"張學友出道多年人氣依舊不減。(資料照,記者趙世勳攝)\" src=\"/storage/news-posts/February2017/srFKlxoM9l2o9ZFRTFWp.jpeg\" alt=\"張學友出道多年人氣依舊不減。(資料照,記者趙世勳攝)\" />\n<figcaption>張學友出道多年人氣依舊不減。(資料照,記者趙世勳攝)</figcaption>\n</figure>\n<p>&nbsp;</p>\n<p>此外,盧還表示自己見到偶像「超級害羞我臉超級紅」,更搞笑列出「第3.5點」說張在舞台上唱歌時他幾乎全程都是「ROCK」手勢,笑翻眾人。不過,盧也感性說道,張跟他說,自己為了演唱會不僅健身2年、親自參與設計舞台,全場演唱會也沒用提詞機跟幾乎沒忘詞,讓他相當佩服又感動,直呼「謝謝歌神分享如此珍貴和巨大的意志力」。</p>\n<figure class=\"image\"><img title=\"盧廣仲臉書全文。(翻攝自盧廣仲臉書)\" src=\"/storage/news-posts/February2017/vqAaswSwS7I1WujQJBp5.png\" alt=\"盧廣仲臉書全文。(翻攝自盧廣仲臉書)\" />\n<figcaption>盧廣仲臉書全文。(翻攝自盧廣仲臉書)</figcaption>\n</figure>\n<p>&nbsp;</p>',\n 'image' => 'news-posts/February2017/PLYD8kgj1rjL3OpjvJwY.jpg',\n 'meta_description' => '盧廣仲(左)昨去看偶像張學友(右)的演唱會。(翻攝自盧廣仲臉書)〔娛樂頻道/綜合報導〕55歲的「歌神」張學友昨日晚間在台北小巨蛋華麗開唱,連唱6場、7.1萬張的門票全部受鑿,推估吸金超過2.3億台幣,人氣依舊不減。而和張同為「巨蟹座又屬牛」的創作歌手盧廣仲昨日也親臨現場一睹偶像風采,',\n 'meta_keywords' => '盧廣仲,張學友,演唱會',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '台灣好新聞報政治中心',\n 'title' => '自打臉?又主持萬大線動工 柯P:捷運局拜託的',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 8,\n 'seo_title' => '自打臉?又主持萬大線動工 柯P:捷運局拜託的',\n 'excerpt' => '',\n 'body' => '<p>台北市長柯文哲12日上午出席捷運萬大線CQ840及850A區段標聯合動土典禮,宣示萬大線台北市段全線動工,工期8年,預計114年完工。由於捷運萬大線已多次動工,柯文哲前年參加第3次區段標動工時曾批評,「多次動工有必要嗎?」。但今日又出席動工典禮,媒體質疑柯是否「自打嘴巴」?柯文哲12日受訪表示,萬大線是大陸工程包的,高達100多億,也是台北境內最大的一標,所以捷運局特別拜託他去,他只好答應。</p>\n<p>連接台北西區與中和及樹林的捷運萬大線分二期施作,第一期路線採地下興建,長9.5公里,其中北市段3.8公里、新北市段5.7公里,共設9座車站和1座機廠;第二期工程路線長13.3公里,全在新北市,設13座車站,包含地下2座、高架11座。未來完工通車後,將與中正紀念堂站銜接,可紓解萬華、中永和及土城等地交通。</p>\n<figure class=\"image\"><img title=\"台北捷運萬大線台北市段已進入全線動工階段,捷運工程局預計2025年萬大線就會完工。(圖/台北市政府捷運工程局)\" src=\"/storage/news-posts/February2017/5quF5BnwMq2pJzDLbw35.jpg\" alt=\"台北捷運萬大線台北市段已進入全線動工階段,捷運工程局預計2025年萬大線就會完工。(圖/台北市政府捷運工程局)\" />\n<figcaption>台北捷運萬大線台北市段已進入全線動工階段,捷運工程局預計2025年萬大線就會完工。(圖/台北市政府捷運工程局)</figcaption>\n</figure>\n<p>&nbsp;</p>\n<p>柯文哲今天一早也參加 2017台北渣打馬拉松,會受接受訪問。媒體詢問,之前不是才批評說不用每一段都要再動工一次?柯文哲說,萬大線工程約有800多億元,分為好幾區段招標,這是在台北市境內最大的一標,所以他大概也只會去這場。至於萬大線完工之前還會有其他動土嗎?柯文哲表示,好像應該沒有了,大概就這個,因為捷運局也不會隨便叫他再去什麼動土,大概就這一次而已。</p>\n<p>柯文哲說,萬大線行經的中正、萬華2區,是台北市發展比較早的地區,施工環境很艱困,但他對捷運局有信心,一定能夠克服所有困難,如期如質施工。他也特別提醒施工單位要以安全為重-注意工程安全,維持交通安全,確保民眾安全,有安全才有品質。</p>\n<p>捷運局表示,萬大線北市段所面對的挑戰包括,路窄、住宅密集、管線多且大、穿越新店溪、小轉彎半徑、碰到古河道、大排水箱涵、考古與文化遺址搶救。 萬大線行經的南海路、西藏路、萬大路等路寬都在30公尺以下,在圍籬的佈設、交通維持計畫的擬定等造成很大的困擾。路窄加住宅密集,車站連續壁幾乎緊貼民房,如路寬僅16.36公尺的南海路段約在30公分左右,需加強施作建物保護措施。LG03至LG04站的西藏路轉萬大路,是僅約50公尺的小轉彎半徑,潛盾施工難度高。G02站就在「植物園遺址」的中心點,必需先進行44個月的「人工考古開挖」後,才能進行主體工程。這些因素均會讓完工時間拉長。</p>\n<p>&nbsp;</p>',\n 'image' => 'news-posts/February2017/dpAtZsNg7RmnAm28OEXF.jpg',\n 'meta_description' => '台北市長柯文哲12日上午出席捷運萬大線CQ840及850A區段標聯合動土典禮,宣示萬大線台北市段全線動工,工期8年,預計114年完工。由於捷運萬大線已多次動工,柯文哲前年參加第3次區段標動工時曾批評,「多次動工有必要嗎?」。但今日又出席動工典禮,媒體質疑柯是否「自打嘴巴」?柯文哲12日受訪表示,萬大線是大陸工程包的,高達100多億,也是台北境內最大的一標,所以捷運局特別拜託他去,他只好答應。',\n 'meta_keywords' => '柯文哲,捷運萬大線',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'carousel' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '蘇文彬',\n 'title' => 'Android Wear 2.0正式問世,內建Google助手',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 9,\n 'seo_title' => 'Android Wear 2.0正式問世,內建Google助手',\n 'excerpt' => 'Android Wear 2.0強調更個人化訊息的錶面設計,讓使用者抬起手腕就能隨時檢示天氣、個人活動及行事曆等資訊,並首次內建Google Play,方便使用者尋找手錶專用的App,此外,Google Assistant也首次進入智慧手錶。',\n 'body' => '<p>原本該在去年秋天問世的Google下一代穿戴裝置平台Android Wear 2.0在本周正式登場,這個新的平台可讓智慧手錶更個人化,而且內建了Google Assistant助手功能,可透過語音命令讓助手幫你處理各種事務。</p>\n<p>Android Wear 2.0允許使用者個人化自己的錶面,用戶可隨時從錶面看到簡單的天氣資訊、股市表現、個人的活動紀錄或是約會提醒,或是透過手錶向Uber叫車,撥電話給重要的人等等。(下圖,來源:Google)</p>\n<p><img src=\"/storage/news-posts/February2017/Ijle0xJfgW9XshnQgQOH.gif\" alt=\"\" width=\"300\" height=\"300\" /></p>\n<p>在Android Wear平台上預載了Google Fit,這是一個運動健身專用App,可透過智慧手錶幫你紀錄外出散步、跑步或是其他運動時的心跳、步數、消耗的卡路里數等。如果使用的智慧手錶具備行動上網功能,運動時不需要攜帶手機,可以收發訊息、撥接電話。</p>\n<p>呼應使用者的需求,新的穿戴平台也內建了Google Play,方便使用者下載各種智慧手錶專用App,例如Android Pay、AccuWeather等。</p>\n<p>過去使用者在手錶上收到訊息,礙於智慧手錶在螢幕上先天較小的限制,回覆訊息可能比較困難,現在使用者可以在錶面上手寫文字或畫出表情符號回覆,也可以直接用說的回覆。</p>\n<p>此外,Android Wear 2.0也加入了Google Assistant助手功能,Google Assistant先前只在智慧喇叭Google Home、通訊程式Allo及Google Pixel,現在則將登上Android智慧手錶,用戶按下手錶的電源鈕並說「Ok Google」,就能以語音要求Google Assistant查詢天氣、寫下購物清單等等。目前Google Assistant僅支援英語、德語,未來幾個月將支援更多語言。</p>\n<p>Google也介紹了首款將採用Android Wear 2.0的智慧手錶LG Watch Style,該款智慧手錶可更換使用18mm錶帶。具備NFC以支援行動支付,並有GPS、心律感測等功能,協助使用者紀錄活動時的身體數據,手錶預計2月10日先在美國地區上市,後續幾週會在加拿大、台灣、俄羅斯推出。</p>\n<p>至於市場上既有的Android智慧手錶,包含華碩ZenWatch 2及3、華為的Huawei Watch,還有LG的G Watch R、Urbane及LTE版本,以及第二代Moto 360等等,未來幾週將可升級至新版本。</p>\n<p><iframe title=\"Android Wear: Make the most of every step\" src=\"https://www.youtube.com/embed/qlTGwPIOz0Y?wmode=opaque&amp;theme=dark\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"\"></iframe></p>',\n 'image' => 'news-posts/February2017/1XIzduvAYE2JNp7DxnkD.jpg',\n 'meta_description' => 'Android Wear 2.0強調更個人化訊息的錶面設計,讓使用者抬起手腕就能隨時檢示天氣、個人活動及行事曆等資訊,並首次內建Google Play,方便使用者尋找手錶專用的App,此外,Google Assistant也首次進入智慧手錶。',\n 'meta_keywords' => 'Android Wear 2.0',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '張家玲',\n 'title' => '宋智孝就愛這墨鏡 機場look輕鬆添星味',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 11,\n 'seo_title' => '宋智孝就愛這墨鏡機場look輕鬆添星味 | 即時新聞 | 20170211 | 蘋果日報',\n 'excerpt' => '',\n 'body' => '<p>韓國人氣綜藝節目《Running Man》昨晚在台舉辦見面會,唯一的女性成員宋智孝昨上午現身仁川機場搭乘專機時,身穿軍綠色外套搭配帥氣墨鏡,一路上親切和粉絲打招呼,而她用來增添明星味的墨鏡正是出自許多韓星追捧、她也曾多次在公眾場合配戴的眼鏡品牌Fakeme,此次她選搭的Lemming Merged款式外型雖簡單但充滿個性,共有4款不同顏色可選,每款售價8800元。(張家玲/台北報導)</p>\n<figure class=\"image\"><img title=\"宋智孝是Fakeme的粉絲,過去也曾選擇該牌墨鏡現身公眾場合。品牌提供\" src=\"/storage/news-posts/February2017/igTt6ienuyGmgdaGokun.jpg\" alt=\"宋智孝是Fakeme的粉絲,過去也曾選擇該牌墨鏡現身公眾場合。品牌提供\" />\n<figcaption>宋智孝是Fakeme的粉絲,過去也曾選擇該牌墨鏡現身公眾場合。品牌提供</figcaption>\n</figure>\n<p>&nbsp;</p>',\n 'image' => 'news-posts/February2017/MJ5ZP63F3Slv176ROX4x.jpg',\n 'meta_description' => '韓國人氣綜藝節目《Running Man》昨晚在台舉辦見面會,唯一的女性成員宋智孝昨上午現身仁川機場搭乘專機時,身穿軍綠色外套搭配帥氣墨鏡,一路上親切和粉絲打招呼,而她用來增添明星味的墨鏡正是出自許多',\n 'meta_keywords' => '宋智孝,墨鏡',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '許文貞',\n 'title' => '台北書展裡擺市集 創意「Zine」大玩小誌',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 12,\n 'seo_title' => '台北書展裡擺市集 創意「Zine」大玩小誌 - 中時電子報',\n 'excerpt' => '',\n 'body' => '<p>書展裡也可以逛市集?今年台北國際書展世貿一館角落的「青年創意出版區」的,有一群年輕人帶著自己的「Zine」(小誌)在擺攤,販售個人出版創作品。現場也展示孔版印刷機、活版印刷機,也提供許多不同類型的Zine讓民眾翻閱。甚至還有一台專售Zine的自動販賣機,看到喜歡的小誌,投幾個銅板就能輕鬆買到。</p>\n<figure class=\"image\"><img title=\"角落有一台專售Zine的自動販賣機。(許文貞攝)\" src=\"/storage/news-posts/February2017/hU4u8v4gRksObzzPOtc8.jpg\" alt=\"角落有一台專售Zine的自動販賣機。(許文貞攝)\" />\n<figcaption>角落有一台專售Zine的自動販賣機。(許文貞攝)</figcaption>\n</figure>\n<p>&nbsp;</p>\n<p>相較於內容面向廣泛的雜誌,Zine小誌的「小」,不只是因為主題偏向小眾,也因為採用與傳統出版印刷不同的方式,例如孔版印刷(Risograph)或活版印刷,可以小量出版作品,讓創作者能在短時間內實驗不同的創作方式,近年來十分受到歡迎。</p>\n<p>策展人江家華和田田圈文創工作群成員龔維德,去年就曾合作舉辦Zine的市集活動。「這次公開徵選約45組攤位,分成三梯次在書展擺攤,鼓勵更多獨立創作者參與。另外也邀請15組藝術家創作Zine,放到自動販賣機販售。」</p>\n<p>受邀為自動販賣機創作Zine的藝術家,有平面設計師、漫畫家、刺青藝術師等。「Zine專門販賣機光是書展頭兩天就賣出超過100本的Zine。」像是設計師蔡南昇和印刻主編丁名慶跨界合作的兩本Zine《一日》、《一刻》在第二天就銷售一空。金漫獎得主阮光民、米奇鰻,法國安古蘭漫畫節新秀獎入圍漫畫家覃偉的漫畫也都限量在販賣機販售。</p>\n<p>「Zine最主要是降低出版門檻,讓創作者簡單印製作品,甚至能當名片用。」江家華表示,Zine源自歐美國家,最早在2001年瑞士就誕生了第一家專門出版Zine的獨立出版社「Nieves」。她2010年在歐洲唸書時,注意到有的書店開始會騰出角落來販售Zine,後來逐漸在歐美藝術圈流行。不只年輕創作者把作品做成Zine,藝術家也會用Zine來做實驗性高的作品。</p>\n<p>Zine的內容也相當多元,有的以文字或攝影創作為主,有的是漫畫、插畫。源自日本的同人誌也可說是Zine的一種。如今Zine也不再只是實驗之作,像是參與擺攤的「小本書」、「三貓俱樂部」等創作者,都只以Zine的形式出版。</p>\n<p>相較於傳統印刷,出版Zine常用的孔版印刷技術價格十分低廉,又能少量印製,還帶有特殊的手工質感。龔維德解釋,孔版印刷印製的方式類似傳統的影印機,但用的是油墨而非碳粉,同一張紙經過兩個顏色以上的油墨印刷,能產生特別的「疊色」效果。「紙張在重複印刷時,位置有時候會跑掉,反而形成一種特殊的手製粗糙感,十分受到創作者的喜愛。」</p>',\n 'image' => 'news-posts/February2017/n5J091Ma6NGwmpqJQAVs.jpg',\n 'meta_description' => '書展裡也可以逛市集?今年台北國際書展世貿一館角落的「青年創意出版區」的,有一群年輕人帶著自己的「Zine」(小誌)在擺攤,販售個人出版創作品。現場也展示孔版印刷機、活版印刷機,也提供許多不同類型的Zine讓民眾翻閱。甚至還有一台專售Zine的自動販賣機,看到喜歡的小誌,投幾個銅板就能輕鬆買到。 相較於內容面向廣泛的雜誌,Zine小誌的「小」,不只是因為主題偏向小眾,也因為採用與傳統出版印刷不同的方式,例如孔版印…',\n 'meta_keywords' => '台北書展',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '吳永佳',\n 'title' => '邰智源:小心,吃飯露本性!你一定要注意的3件事',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 13,\n 'seo_title' => '邰智源:小心,吃飯露本性!你一定要注意的3件事 - 專訪集 - 人物 - Cheers快樂工作人雜誌',\n 'excerpt' => '縱橫演藝圈數十年,從昔日的選秀新人,到今時成為綜藝界呼風喚雨的大哥級人物,邰智源談到他的交友哲學,沒有複雜的方法,倒是劈頭冒出一句:「我的朋友,都是吃飯吃來的!」',\n 'body' => '<p><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU; font-size: 15px;\">餐桌,「物以類聚」的識人之處 </span></p>\n<p><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU; font-size: 15px;\">怎麼說呢?從小一家人都愛吃的邰智源,家學淵源加上耳濡目染,自己也成了熱愛美食的饕客。就連要出書,談的不是表演生涯,都是介紹各地的美食。 </span></p>\n<p><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU; font-size: 15px;\">雖自認朋友不特別多,但只要是好兄弟,邰智源絕對不忘常以美食相召。例如他多年的莫逆之交莫凡,每個月非得聚上一、兩次不可;圈內的「徒子徒孫」如小蝦等新秀,每月也一定要吃上一頓飯;包括與他交情深厚的幾位健身房教練,彼此一樣常相召「飯團」。 </span></p>\n<p><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU; font-size: 15px;\">對邰智源來說,與老友、麻吉是靠吃飯維繫情感,結交新朋友,更要靠吃飯。因為,「吃飯是最容易『識人』的場所,」他指出。 </span></p>\n<p><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU; font-size: 15px;\">所謂「識人」,有雙重涵義,一是指透過飯局認識、知道「朋友的朋友」;另一層則是藉由吃飯的場合了解、認清一個人。 雖然在螢光幕前或是老友相聚時,好笑、有趣的邰智源多半是眾人目光包圍的中心,但到了有新朋友的場子,他就會調整自己,變成低調、冷靜的旁觀者。 </span></p>\n<p><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU; font-size: 15px;\">「只要用心,可以在飯桌上觀察到的事太多了!」邰智源說,一個人的家教、修養、對朋友的態度,常在一頓飯中表露無遺。舉凡是不是會為大家分筷子、遞餐巾,或是否謙讓別人先用菜等極微小的細節,都可一窺端倪。 </span></p>\n<p><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU; font-size: 15px;\">此外,酒攤是另一個「識人」的重要場所,從一個人的「酒品」,往往可看出他真正的「人品」。自謂不很愛喝酒的邰智源,樂得在酒局中冷眼判讀人性。也就在這些細微的觀察中,讓他明瞭哪些人未來可能值得深交,哪些人可敬而遠之。</span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">交朋友,要捨得花錢花心思</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">至於餐桌待客之道,邰智源認為好餐廳和好料理固然重要,但最重要的卻是4個字:「捨得、熱情」!</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">從小,作為軍人的父親就告誡邰智源:「交朋友是要花錢的!」送禮、請客、招待朋友,無一不必花錢。所以邰智源深信,交朋友要捨得花錢、花心思,該請客時,就絕不能手軟:「有些人一到買單時就藉故遁逃,這種愛佔他人便宜的人,絕對交不到長久的朋友,」他說。當然,也肯定會被邰智源列為「拒絕往來戶」。</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">讓邰智源印象最深刻的差勁主人,就是小氣的主人。他回憶,曾有一位上市公司老闆邀他代言商品,先請他吃飯。結果一到場,邰智源赫然看見這位老闆請的是──蛋炒飯!</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">一頓飯的花費再高,也比不上請邰智源代言的酬勞。但這位老闆「捨大錢,省小錢」的做法,不但反映了個人格局有限,也在當下令邰智源大為不悅,心想:「你這是在羞辱自己,還是在羞辱我?」果然,餐後雙方的合作關係,也因此泡湯。</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">邰智源引用《論語‧公冶長》的典故,孔子教學生們談談各自的志向時,子路回答:「願車馬,衣輕裘,與朋友共,敝之而無憾。」這段話所描述的慷慨待人心態,正好可為邰智源的待友之道做註解。</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">邰智源創造餐桌好人緣3心法</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">1. 老朋友勤聯絡,以美食會友。</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\"> 新朋友多接觸,藉餐桌識人。</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">2. 交朋友要捨得花錢、投注心思。 </span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">要用多大的手筆,可量力而為,但該請的客一定要請,更要透過各種細節,讓客人感受到你的真心、熱情。</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">&nbsp;3. 餐桌上有親疏遠近,但無富貴貧賤。 </span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\">先摒棄以大小眼衡量別人的心態,朋友自然會來。</span></span></span></p>\n<p><span><span style=\"color: #000000; font-family: Arial, 微軟正黑體, 繁黑體, \\'Microsoft JhengHei\\', \\'Microsoft YaHei\\', \\'Heiti TC\\', \\'LiHei Pro\\', sans-serif, 新細明體, PMingLiU;\"><span style=\"font-size: 15px;\"><iframe title=\"【60秒, Cheers!】邰智源的飯友哲學:如何在飯桌上交朋友?\" src=\"https://www.youtube.com/embed/abDy4ljx82s?wmode=opaque&amp;theme=dark\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"\"></iframe></span></span></span></p>\n<p>&nbsp;</p>\n<p>&nbsp;</p>',\n 'image' => 'news-posts/February2017/2p8JV9khYhTibPS37tdg.jpg',\n 'meta_description' => '出過暢銷書《邰客好吃》,邰智源不只懂吃,更懂吃飯時的主客、做人、交友之道。且看他如何在餐桌上「不卑不亢,進退得宜」,識人、待人也帶人,飯友滿天下!',\n 'meta_keywords' => '吃飯,社交,人際,識人,交朋友',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'carousel' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $id++;\n $input_time = $now->addHour(); //one record per hour\n $dataType = NewsPost::firstOrNew([\n 'id' => $id,\n 'author' => '關鍵評論網',\n 'title' => '再見歐盟!英國的脫歐之路',\n ]);\n if (!$dataType->exists) {\n $dataType->fill([\n 'author_id' => 1,\n 'news_category_id' => 14,\n 'seo_title' => '再見歐盟!英國的脫歐之路 - The News Lens 關鍵評論網',\n 'excerpt' => '在台灣時間2016年6月24日下午一點,全球矚目的英國脫歐公投的結果出爐,「脫歐派」以52%的得票率,勝過48%的「留歐派」,英國民意已正式向世界宣告將與歐盟分手。一對曾經相愛的情侶如何走向分歧之路?在「再見歐盟」的宣告之後,英國又將何去何從?請看關鍵評論網為你準備的第一手精選分析。',\n 'body' => '<h2 class=\"article-title\" style=\"font-family: \\'Microsoft JhengHei\\', sans-serif; box-sizing: border-box; margin: 10px 0px 15px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: 1.4em; font-size: 24px; vertical-align: baseline; color: #000000; text-align: center;\">「英國脫歐」公投開票達98%,脫歐得票率52%大局已定</h2>\n<p><span style=\"color: #4d4d4d; font-family: \\'Microsoft JhengHei\\', sans-serif; font-size: 16px; letter-spacing: 0.5px;\">台北時間23日下午2點展開的脫歐公投,根據</span><a style=\"font-family: \\'Microsoft JhengHei\\', sans-serif; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-size: 16px; vertical-align: baseline; color: #009fdb; text-decoration: none; letter-spacing: 0.5px;\" title=\"EURONEWS的即時報導\" href=\"http://www.euronews.com/news/streaming-live/\">EURONEWS的即時報導</a><span style=\"color: #4d4d4d; font-family: \\'Microsoft JhengHei\\', sans-serif; font-size: 16px; letter-spacing: 0.5px;\">,剛剛在西敏寺宣布的最新結果,脫歐派得票率達到52%,留歐派以4個百分點的差距為48%,開票率達98.9%,即使剩下的票數投給留歐,依舊無法逆轉情勢,英國脫離歐盟結果確立。</span></p>\n<p style=\"font-family: \\'Microsoft JhengHei\\', sans-serif; box-sizing: border-box; margin: 0px; padding: 0.825em 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-size: 16px; vertical-align: baseline; color: #4d4d4d; letter-spacing: 0.5px;\">在這場公投展開前,<a style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: #009fdb; text-decoration: none;\" title=\"「脫歐派」表示\" href=\"http://www.thenewslens.com/article/42600\" target=\"_blank\"><span id=\"docs-internal-guid-7cb8dbd9-8035-cd74-4e6c-5b8b5f8b765f\" style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; line-height: inherit; vertical-align: baseline;\">「</span>脫歐派<span style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; line-height: inherit; vertical-align: baseline;\">」</span>表示</a><span style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; line-height: inherit; vertical-align: baseline;\">,</span>歐盟已威脅到英國主權,尤其隨歐盟法規已逐漸覆蓋英國本國律法,除此之外,<span id=\"docs-internal-guid-7cb8dbd9-8035-cd74-4e6c-5b8b5f8b765f\" style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; line-height: inherit; vertical-align: baseline;\">「</span>脫歐派<span style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; line-height: inherit; vertical-align: baseline;\">」</span>支持者認為,歐盟委員會無法對英國的選民負責,更別說歐元是一場災難。對於移民政策,<span id=\"docs-internal-guid-7cb8dbd9-8035-cd74-4e6c-5b8b5f8b765f\" style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; line-height: inherit; vertical-align: baseline;\">「</span>脫歐派<span style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: bold; font-stretch: inherit; line-height: inherit; vertical-align: baseline;\">」</span>認為歐盟允許太多移民,但英國若不隸屬歐盟,就能有更合理的移民制度。</p>\n<p style=\"font-family: \\'Microsoft JhengHei\\', sans-serif; box-sizing: border-box; margin: 0px; padding: 0.825em 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-size: 16px; vertical-align: baseline; color: #4d4d4d; letter-spacing: 0.5px;\">而「留歐派」則認為,英國離開歐盟將產生嚴重後果,例如英國在歐洲市場的影響力將不再,而公司也擔憂無法僱用好的人才,而假如英國當真「脫歐」,會影響歐洲議會內的權力平衡,進而對高科技公司產生影響,現任倫敦市長Khan同樣表示,英國脫歐會降低工業水準,此外也質疑英國脫歐後的移民政策,是否將不再友善?蘇格蘭保守黨領袖Ruth Davidson則在日前辯論時表示,離開歐盟會對英國人民的安全有所影響(恐怖攻擊)。</p>\n<p style=\"font-family: \\'Microsoft JhengHei\\', sans-serif; box-sizing: border-box; margin: 0px; padding: 0.825em 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-size: 16px; vertical-align: baseline; color: #4d4d4d; letter-spacing: 0.5px;\"><a style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: #009fdb; text-decoration: none;\" title=\"蘋果報導\" href=\"http://www.appledaily.com.tw/realtimenews/article/new/20160624/893010/\" target=\"_blank\">蘋果報導</a>,英國脫歐公投計票與開票作業,從台灣時間今日早上5時開始進行,這次公投,有效投票人數共有4650萬人,也是英國史上第3次全國性公投。這次公投選區共382個,包括英國本土以及海外領土直布羅陀(Gibraltar),初步投票率為70%。根據BBC報導,目前已開出195區,而英國ITV分析員指稱,英國脫歐派獲勝機率達80%。</p>\n<p style=\"font-family: \\'Microsoft JhengHei\\', sans-serif; box-sizing: border-box; margin: 0px; padding: 0.825em 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-size: 16px; vertical-align: baseline; color: #4d4d4d; letter-spacing: 0.5px;\"><a style=\"font-family: inherit; box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; color: #009fdb; text-decoration: none;\" title=\"端傳媒報導\" href=\"https://theinitium.com/article/20160623-dailynews-uk-referendum/\" target=\"_blank\">端傳媒報導</a>,據BBC報導,威爾斯地區顯示脫毆派暫居上風,蘇格蘭和北愛爾蘭則表現為留歐派票數更高。有分析認為,恰好於投票日在德國一家電影院發生的槍擊事件,可能會對英國公投造成向脫毆方向移動的影響。</p>\n<p style=\"font-family: \\'Microsoft JhengHei\\', sans-serif; box-sizing: border-box; margin: 0px; padding: 0.825em 0px; border: 0px; font-variant-numeric: inherit; font-stretch: inherit; line-height: inherit; font-size: 16px; vertical-align: baseline; color: #4d4d4d; letter-spacing: 0.5px;\">此外,不同選區的投票結果也大不相同。在直布羅陀,公投結果以1萬9322票對823票壓倒性支持留歐,而桑德蘭(Sunderland)的13萬多投票者中,61%的人支持脱歐。民調公司YouGov通過在網上調查5000名投票者得出數據顯示,支持留在歐盟的意見略佔上風,達52%,支持脱歐的投票者佔48%。另一家民調公司Ipsos Mori的調查也顯示,支持留歐者佔54%,支持脱歐佔46%。</p>',\n 'image' => 'news-posts/February2017/s9HK8a8WMzKwmCKG2x1c.jpg',\n 'meta_description' => '台灣時間2016年6月24日下午一點,全球矚目的英國脫歐公投的結果出爐,「脫歐派」以52%的得票率,勝過48%的「留歐派」,英國民意已正式向世界宣告將與歐盟分手。一對曾經相愛的情侶如何走向分歧之路?在「再見歐盟」的宣告之後,英國又將何去何從?請看關鍵評論網為你準備的第一手精選分析。',\n 'meta_keywords' => '英國,脫歐,公投',\n 'status' => 'PUBLISHED',\n 'active' => 1,\n 'carousel' => 1,\n 'created_at' => $input_time,\n 'updated_at' => $input_time,\n ])->save();\n }\n\n $input_time = $now->addHour(); //for first record of next loop\n\n } //for loop\n\n // $id++;\n // $input_time = $now->addHour(); //one record per hour\n // $dataType = NewsPost::firstOrNew([\n // 'id' => $id,\n // 'author' => '',\n // 'title' => '',\n // ]);\n // if (!$dataType->exists) {\n // $dataType->fill([\n // 'author_id' => 1,\n // 'news_category_id' => 1,\n // 'seo_title' => '',\n // 'excerpt' => '',\n // 'body' => '',\n // 'image' => '',\n // 'meta_description' => '',\n // 'meta_keywords' => '',\n // 'status' => 'PUBLISHED',\n // 'active' => 1,\n // 'created_at' => $input_time,\n // 'updated_at' => $input_time,\n // ])->save();\n // }\n }", "function getFeedBack(){\n\n\n\n }", "public function postPaper()\n {\n }", "public function fetch_queued()\n {\n if( empty($this->pmids) ) {\n throw new Exception('No PMIDs added to queue, nothing to fetch.');\n }\n\n try {\n $url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?' . http_build_query([\n 'db' => 'pubmed',\n 'rettype' => 'medline',\n 'retmode' => 'xml'\n ], null, '&', PHP_QUERY_RFC3986);\n\n $client = HttpClient::create();\n $response = $client->request( 'POST', $url, [\n 'body' => [\n 'id' => implode(',', $this->pmids)\n ]\n ]);\n\n /* convert from XML to PHP array of simple objects\n *\n * Note: JSON encoding a SimpleXML resource and JSON decoding the result provides a normal PHP object\n * that is, at least in my opinion, much more intuitive to work with.\n */\n $raw = json_decode( json_encode( simplexml_load_string( $response->getContent() ) ) )->PubmedArticle;\n\n /* index data array by pmid */\n foreach( $raw as $single) {\n $pmid = $single->MedlineCitation->PMID;\n $this->data[$pmid] = $single;\n\n /* create pointers with any identifiers */\n if( array_key_exists($pmid, $this->id_map) ) {\n $id = $this->id_map[$pmid];\n $this->data_by_id[$id] = @$this->data[$pmid];\n }\n }\n return $this->data;\n }\n\n catch(Exception $e) { throw $e; }\n }", "function handlePost()\n {\n $feedid = $this->arg('feed');\n common_log(LOG_INFO, \"POST for feed id $feedid\");\n if (!$feedid) {\n // TRANS: Server exception thrown when referring to a non-existing or empty feed.\n throw new ServerException(_m('Empty or invalid feed id.'), 400);\n }\n\n $feedsub = FeedSub::staticGet('id', $feedid);\n if (!$feedsub) {\n // TRANS: Server exception. %s is a feed ID.\n throw new ServerException(sprintf(_m('Unknown PuSH feed id %s'),$feedid), 400);\n }\n\n $hmac = '';\n if (isset($_SERVER['HTTP_X_HUB_SIGNATURE'])) {\n $hmac = $_SERVER['HTTP_X_HUB_SIGNATURE'];\n }\n\n $post = file_get_contents('php://input');\n\n // Queue this to a background process; we should return\n // as quickly as possible from a distribution POST.\n // If queues are disabled this'll process immediately.\n $data = array('feedsub_id' => $feedsub->id,\n 'post' => $post,\n 'hmac' => $hmac);\n $qm = QueueManager::get();\n $qm->enqueue($data, 'pushin');\n }", "public function post_row($event) {\n if($this->forum->is_sibylla()) $this->topic->handleOneTimeFire($event);\n\n // Rank & group for every post of every topics\n $this->topic->set_ju_rank_and_dept($event);\n\n // Custom parsing for ju-bbcode inside sibylla topics.\n if($this->forum->is_sibylla(true)) {\n $this->topic->custom_parsing($event);\n }\n }", "public function run()\n {\n //FIXME: Need to find a better way of handing post_id/thread_id. One of them should be null, or we need a 3rd field to say which we want to use.\n $data = array(\n ['id' => 1, 'post_id' => 1, 'user_id' => 2, \"vote\" => 1, \"created_at\" => new DateTime(), \"updated_at\" => new DateTime()],\n ['id' => 2, 'post_id' => 2, 'user_id' => 3, \"vote\" => 1, \"created_at\" => new DateTime(), \"updated_at\" => new DateTime()],\n ['id' => 3, 'post_id' => 2, 'user_id' => 3, \"vote\" => 1, \"created_at\" => new DateTime(), \"updated_at\" => new DateTime()],\n );\n DB::table('likes')->insert($data);\n }", "public function parsePostData()\n {\n }", "public function ParsePostData() {}", "public function post_feed() {\n\t\t\t$facebook_ch = http($this -> action, $ref = \"\", $method = \"POST\", $this -> data, EXCL_HEAD);\n\t\t\t\n\t\t\treturn $facebook_ch;\n\t\t}", "public function get_post_data_for_boost() {\n \n // Get post_id's input\n $post_id = $this->CI->input->get('post_id', TRUE);\n \n // Get network's input\n $network = $this->CI->input->get('network', TRUE);\n \n if ( $post_id ) {\n \n // Get selected account\n $account = $this->CI->ads_account_model->get_account($this->CI->user_id, 'facebook');\n \n switch ( $network ) {\n \n case 'facebook':\n \n // Get post's data\n $post = json_decode(get(MIDRUB_ADS_FACEBOOK_GRAPH_URL . $post_id . '?fields=is_eligible_for_promotion,message,picture&access_token=' . $account[0]->token), true);\n \n if ( isset($post['is_eligible_for_promotion']) ) {\n \n if ( $post['is_eligible_for_promotion'] && isset($post['message']) ) {\n \n $data = array(\n 'success' => TRUE,\n 'picture' => isset($post['picture'])?$post['picture']:'',\n 'message' => $post['message'],\n 'link' => '',\n 'post_id' => $post_id\n );\n\n echo json_encode($data);\n exit();\n \n } else {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('this_post_is_not_eligible')\n );\n\n echo json_encode($data);\n exit();\n \n }\n \n }\n \n break;\n \n case 'instagram':\n\n // Get post\n $post = json_decode(get(MIDRUB_ADS_FACEBOOK_GRAPH_URL . $post_id . '?fields=id,media_type,media_url,timestamp,caption,thumbnail_url&access_token=' . $account[0]->token), true);\n \n if ( $post ) {\n \n $picture = base_url('assets/img/no-image.png');\n\n if ( isset($post['media_url']) ) {\n $picture = $post['media_url'];\n }\n\n if ( isset($post['thumbnail_url']) ) {\n $picture = $post['thumbnail_url'];\n }\n\n $message = $this->CI->lang->line('no_text_fond');\n\n if ( isset($post['caption']) ) {\n $message = $post['caption'];\n }\n \n $data = array(\n 'success' => TRUE,\n 'picture' => $picture,\n 'message' => $message,\n 'link' => '',\n 'post_id' => $post_id\n );\n\n echo json_encode($data);\n exit();\n \n }\n \n break; \n \n }\n \n }\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('error_occurred')\n );\n\n echo json_encode($data); \n \n }", "public function run()\n {\n// $post = $this->findPost('my-sample-post');\n// if (!$post->exists) {\n// $post->fill([\n// 'title' => 'My Sample Post',\n// 'exclusiveness' => 1,\n// 'author_id' => 0,\n// 'seo_title' => null,\n// 'excerpt' => 'This is the excerpt for the sample Post',\n// 'body' => '<p>This is the body for the sample post, which includes the body.</p>\n// <h2>We can use all kinds of format!</h2>\n// <p>And include a bunch of other stuff.</p>',\n// 'image' => 'posts/post2.jpg',\n// 'slug' => 'my-sample-post',\n// 'meta_description' => 'Meta Description for sample post',\n// 'meta_keywords' => 'keyword1, keyword2, keyword3',\n// 'reference' => 'Some reference',\n// 'note_transaction' => 'Nice transaction',\n// 'broker_notes' => 'All right',\n// 'important_notes' => 'Very good',\n// 'owner_notes' => 'All right',\n// 'mandate_start' => '2017-09-25 08:00:00',\n// 'term_end' => '2017-10-20 18:00:00',\n// 'availability' => '2017-10-15 18:00:00',\n// 'availab_from' => '2017-09-28 18:00:00',\n// 'availab_until' => '2017-10-25 18:00:00',\n// 'status' => 'PUBLISHED',\n// 'address' => 'Address',\n// 'street' => 'Angel ST.',\n// 'number' => '',\n// 'po_box' => '',\n// 'zip_code' => '',\n// 'town' => '',\n// 'country' => '',\n// 'location' => '',\n// 'longitude' => '',\n// 'latitude' => '',\n// 'lng_of_add' => '1',\n// 'add_title' => '',\n// 'desc_add' => '',\n// 'сurrency' => '1',\n// 'show_price' => '0',\n// 'price' => '',\n// 'price_m2' => '',\n// 'gross_yield' => '',\n// 'net_return' => '',\n// 'owner_amount' => '',\n// 'client_fees' => '',\n// 'owner_fees' => '',\n// 'negotiable_amount' => '',\n// 'estimate_price' => '',\n// 'recording_rights' => '',\n// 'regime' => '1',\n// 'heating_loads' => '',\n// 'ppe_charges' => '',\n// 'condominium_fees' => '',\n// 'property_tax' => '1',\n// 'procedure_in_progress' => '1',\n// 'renovation_fund' => '',\n// 'annual_charges' => '',\n// 'rental_security' => '',\n// 'commercial_property' => '',\n// 'earnings' => '',\n// 'taxes' => '',\n// // Agencement\n// 'number_rooms' => '',\n// 'number_pieces' => '',\n// 'number_balconies' => '',\n// 'number_shower_rooms' => '',\n// 'number_toilets' => '',\n// 'number_terraces' => '',\n// 'number_floors_building' => '',\n// 'floor_property' => '1',\n// 'levels' => '',\n// // surface\n// 'surface_cellar' => '',\n// 'ceiling_height' => '',\n// 'roof_cover_area' => '',\n// 'surface_area_terrace_solarium' => '',\n// 'area_veranda' => '',\n// 'attic_space' => '',\n// 'surface_balcony' => '',\n// 'basement_area' => '',\n// 'surface_ground' => '',\n// 'ground' => '',\n// 'serviced' => '',\n// 'type_land' => '1',\n// 'useful_surface' => '',\n// 'ppe_area' => '',\n// 'volume' => '',\n// 'surface_eng_court' => '',\n// 'lower_ground_floor' => '',\n// 'row_area' => '',\n// 'garage_area' => '',\n// 'weighted_surface' => '',\n// // Stationnement\n// 'box_interior_garage' => '',\n// 'box_garage_interior_double' => '',\n// 'outdoor_garage' => '',\n// 'box_garage_outside_double' => '',\n// 'covered_outdoor_parking_space' => '',\n// 'outside_parking_space_uncovered' => '',\n// 'number_parking_spaces' => '',\n// 'boat_shed' => '',\n// 'mooring' => '',\n// // Cuisine\n// 'type' => '1',\n// 'freezer' => '0',\n// 'cooker' => '0',\n// 'oven' => '1',\n// 'microwave_oven' => '',\n// 'extractor_hood' => '',\n// 'washmachine' => '',\n// 'dishwasher' => '0',\n// 'plates' => '0',\n// 'induction_plates' => '0',\n// 'hotplates' => '1',\n// 'ceramic_plates' => '0',\n// 'fridge' => '0',\n// 'tumble_drier' => '0',\n// 'coffee_maker' => '0',\n//\n//\n// ])->save();\n// }\n }", "public function postEloquaSavedData();", "function insert(EntityPost $entity)\n {\n $givenIdentifier = $entity->getUid();\n $givenIdentifier = $this->attainNextIdentifier($givenIdentifier);\n\n if (!$dateCreated = $entity->getDateTimeCreated())\n $dateCreated = new \\DateTime();\n\n\n # Convert given entity to Persistence Entity Object To Insert\n $entityMongo = new Mongo\\EntityPost(new HydrateGetters($entity));\n $entityMongo->setUid($givenIdentifier);\n $entityMongo->setDateTimeCreated($dateCreated);\n\n # Persist BinData Record\n $r = $this->_query()->insertOne($entityMongo);\n\n\n # Give back entity with given id and meta record info\n $entity = clone $entity;\n $entity->setUid( $r->getInsertedId() );\n return $entity;\n }", "function add_getstream_data_to_head() {\n\t// we need the information about created post on frontend rendering the posts and will collect them here\n $aBlormCreatePosts = array();\n\n // get all posts from this plattformed that are shared on blorm\n $aRecentPostsCreate = wp_get_recent_posts(array('meta_key' => 'blorm_create', 'meta_value' => '1'));\n\n // the activity_id is important to connect the posts with the blorm-data\n foreach ( $aRecentPostsCreate as $aRecentPostCreate) {\n $meta = get_post_meta($aRecentPostCreate[\"ID\"]);\n if (!empty($meta)) {\n $aBlormCreatePosts[] = array(\n\t \"post_id\" => $aRecentPostCreate[\"ID\"],\n \"activity_id\" => $meta[\"blorm_create_activity_id\"][0]\n );\n }\n }\n\n\n // POSTS ARE CREATED ON REMOTE PLATFORM AND REBLOGGED ON THIS PLATFORM\n\t// we need the information about reblogged post on frontend rendering the posts and will collect them here\n\t$aBlormReblogedPosts = array();\n\n\t// get all posts from this plattformed that are shared on blorm\n\t$aRecentPostsRebloged = wp_get_recent_posts(array('meta_key' => 'blorm_reblog_activity_id'));\n\t//var_dump($aRecentPostsReblogged);\n\t// the activity_id is important to connect the posts with the blorm-data\n\tforeach ( $aRecentPostsRebloged as $aRecentPostRebloged) {\n\t\t$meta = get_post_meta($aRecentPostRebloged[\"ID\"]);\n\t\tif (!empty($meta)) {\n\t\t\t$aBlormReblogedPosts[] = array(\n\t\t\t\t\"post_id\" => $aRecentPostRebloged[\"ID\"],\n\t\t\t\t\"activity_id\" => $meta[\"blorm_reblog_activity_id\"][0],\n\t\t\t\t\"teaser_image\" => $meta[\"blorm_reblog_teaser_image\"][0],\n\t\t\t\t\"teaser_url\" => $meta[\"blorm_reblog_teaser_url\"][0],\n\t\t\t\t\"teaser_iri\" => $meta[\"blorm_reblog_object_iri\"][0],\n\t\t\t);\n\t\t}\n\t}\n\n\t// ALL POSTS FROM THE GETSTREM TIMELINE\n // we need the blorm-data like comments, shares, retweets to enrich the posts on the local plattform\n // prepare the request\n $args = array(\n 'headers' => array('Authorization' => 'Bearer '.get_blorm_config_param('api_key'), 'Content-type' => 'application/json'),\n 'method' => 'GET',\n 'body' => '',\n 'data_format' => 'body',\n );\n $response = wp_remote_request(CONFIG_BLORM_APIURL .\"/feed/timeline\", $args);\n $bodyObjects = json_decode($response['body']);\n\n // blorm data for local usage\n $aGetStreamCreatedData = array();\n\t$aGetStreamReblogedData = array();\n\n foreach ($bodyObjects as $bodyObject) {\n\n\t $getStreamData = new stdClass();\n \t// CREATED POSTS\n \t// search for the data of the created posts\n if (array_search($bodyObject->id, array_column($aBlormCreatePosts, \"activity_id\")) !== false) {\n\n $id = array_search($bodyObject->id, array_column($aBlormCreatePosts, \"activity_id\"));\n $getStreamData->PostId = $aBlormCreatePosts[$id][\"post_id\"];\n\n $getStreamData->ActivityId = $bodyObject->id;\n\n\t $getStreamData->ReblogedCount = 0;\n\t $getStreamData->CommentsCount = 0;\n\t $getStreamData->SharedCount = 0;\n\n\t if (isset($bodyObject->reaction_counts->reblog)) {\n\t\t $getStreamData->ReblogedCount = $bodyObject->reaction_counts->reblog;\n\t }\n\n\t if (isset($bodyObject->latest_reactions->reblog)) {\n\t\t $getStreamData->Rebloged = $bodyObject->latest_reactions->reblog;\n\t }\n\n\t if (isset($bodyObject->reaction_counts->comment)) {\n\t\t $getStreamData->CommentsCount = $bodyObject->reaction_counts->comment;\n\t }\n\n\t if (isset($bodyObject->latest_reactions->comment)) {\n\t\t $getStreamData->Comments = $bodyObject->latest_reactions->comment;\n\t }\n\n\t if (isset($bodyObject->reaction_counts->shared)) {\n\t\t $getStreamData->SharedCount = $bodyObject->reaction_counts->shared;\n\t }\n\n\t if (isset($bodyObject->latest_reactions->shared)) {\n\t\t $getStreamData->Shared = $bodyObject->latest_reactions->shared;\n\t }\n\n\t $aGetStreamCreatedData[$getStreamData->PostId] = $getStreamData;\n }\n\n\n // REBLOGED POSTS\n\t if (array_search($bodyObject->id, array_column($aBlormReblogedPosts, \"activity_id\")) !== false) {\n\n\t \t//var_dump($bodyObject->actor->data);\n\n\t\t $id = array_search($bodyObject->id, array_column($aBlormReblogedPosts, \"activity_id\"));\n\t\t $getStreamData->PostId = $aBlormReblogedPosts[$id][\"post_id\"];\n\t\t $getStreamData->ActivityId = $bodyObject->id;\n\t\t $getStreamData->TeaserImage = $aBlormReblogedPosts[$id][\"teaser_image\"];\n\t\t $getStreamData->TeaserUrl = $aBlormReblogedPosts[$id][\"teaser_url\"];\n\t\t $getStreamData->TeaserIri = $aBlormReblogedPosts[$id][\"teaser_iri\"];\n\t\t $getStreamData->OriginWebsiteName = $bodyObject->actor->data->data->website_name;\n\t\t $getStreamData->OriginWebsiteUrl = $bodyObject->actor->data->data->website_url;\n\n\t\t $getStreamData->ReblogedCount = 0;\n\t\t $getStreamData->CommentsCount = 0;\n\t\t $getStreamData->SharedCount = 0;\n\n\t\t if (isset($bodyObject->reaction_counts->reblog)) {\n\t\t\t $getStreamData->ReblogedCount = $bodyObject->reaction_counts->reblog;\n\t\t }\n\n\t\t if (isset($bodyObject->latest_reactions->reblog)) {\n\t\t\t $getStreamData->Rebloged = $bodyObject->latest_reactions->reblog;\n\t\t }\n\n\t\t if (isset($bodyObject->reaction_counts->comment)) {\n\t\t\t $getStreamData->CommentsCount = $bodyObject->reaction_counts->comment;\n\t\t }\n\n\t\t if (isset($bodyObject->latest_reactions->comment)) {\n\t\t\t $getStreamData->Comments = $bodyObject->latest_reactions->comment;\n\t\t }\n\n\t\t if (isset($bodyObject->reaction_counts->shared)) {\n\t\t\t $getStreamData->SharedCount = $bodyObject->reaction_counts->shared;\n\t\t }\n\n\t\t if (isset($bodyObject->latest_reactions->shared)) {\n\t\t\t $getStreamData->Shared = $bodyObject->latest_reactions->shared;\n\t\t }\n\n\t\t $aGetStreamReblogedData[$getStreamData->PostId] = $getStreamData;\n\t }\n\n\n }\n\n\t$blormPostConfig = new stdClass();\n\t$blormPostConfig->blormAssets = plugins_url().\"/blorm/assets/\";\n\n\t$options = get_option( 'blorm_plugin_options_frontend' );\n\n\t$blormPostConfig->float = \"left\";\n\tif (isset( $options['position_widget_menue_adjust_float'] )) {\n\t\t$blormPostConfig->float = $options['position_widget_menue_adjust_float'];\n\t}\n\n\t$blormPostConfig->classForWidgetPlacement = \"\";\n\tif (isset( $options['position_widget_menue_adjust_classForWidgetPlacement'] )) {\n\t\t$blormPostConfig->classForWidgetPlacement = $options['position_widget_menue_adjust_classForWidgetPlacement'];\n\t}\n\n\t$blormPostConfig->positionTop = 0;\n\tif (isset( $options['position_widget_menue_adjust_positionTop'] )) {\n\t\t$blormPostConfig->positionTop = $options['position_widget_menue_adjust_positionTop'];\n\t}\n\n\t$blormPostConfig->positionRight = 0;\n\tif (isset( $options['position_widget_menue_adjust_positionRight'] )) {\n\t\t$blormPostConfig->positionRight = $options['position_widget_menue_adjust_positionRight'];\n\t}\n\n\t$blormPostConfig->positionBottom = 0;\n\tif (isset( $options['position_widget_menue_adjust_positionBottom'] )) {\n\t\t$blormPostConfig->positionBottom = $options['position_widget_menue_adjust_positionBottom'];\n\t}\n\n\t$blormPostConfig->positionLeft = 0;\n\tif (isset( $options['position_widget_menue_adjust_positionLeft'] )) {\n\t\t$blormPostConfig->positionLeft = $options['position_widget_menue_adjust_positionLeft'];\n\t}\n\n\t$blormPostConfig->positionUnit = \"px\";\n\tif (isset( $options['position_widget_menue_adjust_positionUnit'] )) {\n\t\t$blormPostConfig->positionUnit = $options['position_widget_menue_adjust_positionUnit'];\n\t}\n\n\n echo \"<script type=\\\"text/javascript\\\">\\n\\n\";\n echo \"var blormapp = {\n\t\t\tpostConfig: \".json_encode($blormPostConfig, JSON_PRETTY_PRINT).\",\\n\n blormPosts: \".json_encode($aGetStreamCreatedData, JSON_PRETTY_PRINT).\",\\n\n reblogedPosts: \".json_encode($aGetStreamReblogedData, JSON_PRETTY_PRINT).\"\\n\";\n echo \"}\\n</script>\";\n}", "function handle_post(){\n\t}", "protected function _post() { }", "function processData()\n {\n }", "public function run()\n {\n $faker = Factory::create();\n\n// $random_Date = date(\"d.m.Y\", $timestamp );\n\n $data = [];\n for($i= 1; $i<= 5; $i++){\n $image = \"Post_Image_\" . rand(1,5).\".jpg\";\n $timestamp = rand( strtotime(\"Feb 01 2019\"), strtotime(\"Apr 20 2019\"));\n $date = date(\"Y-m-d H:i:s\", $timestamp);\n $data[] = [\n 'user_id' => rand(1,3),\n 'title' => $faker->sentence(rand(4,8)),\n 'exerpt' =>$faker->text(rand(250,300)),\n 'body' =>$faker->paragraph(rand(20,40), true),\n 'slug' =>$faker->slug(),\n 'cover_image'=>rand(0,1) == 1 ? $image : NULL,\n 'created_at'=>$date,\n 'updated_at'=>$date,\n ];\n }\n \\App\\Post::truncate();\n foreach($data as $d){\n \\App\\Post::create($d);\n }\n\n\n }", "public function ingest($message) {\n // mint a new pid if the pid is not already set\n if ($this->pid == \"\") {\n // could generate service unavailable exception - should be caught in the controller\n $persis = new Etd_Service_Persis(Zend_Registry::get('persis-config'));\n\n // FIXME: is there any way to use view/controller helper to build this url?\n $ark = $persis->generateArk(\"http://etd.library.emory.edu/file/view/pid/emory:{%PID%}\",\n $this->etd->label . \" : \" . $this->label . \" (\" . $this->type . \")\");\n $pid = $persis->pidfromArk($ark);\n\n $fedora_cfg = Zend_Registry::get('fedora-config');\n if (isset($fedora_cfg->pidspace) && $fedora_cfg->pidspace != '') {\n $pid = $persis->pidfromArk($ark, $fedora_cfg->pidspace);\n } else {\n $pid = $persis->pidfromArk($ark);\n }\n\n $this->pid = $pid;\n\n // store the full ark as an additional identifier\n $this->dc->setArk($ark);\n }\n // use parent ingest logic to construct new foxml & datastreams appropriately\n return parent::ingest($message);\n }", "Public Function importPosts() {\n\n\t\t$insertPostStatement = $this->localDatabase->prepare ( self::STMT_INSERT_POST );\n\t\t$insertPostTextStatement = $this->localDatabase->prepare ( self::STMT_INSERT_POST_TEXT );\n\t\t$insertAttachStatement = $this->localDatabase->prepare ( self::STMT_INSERT_ATTACHMENT );\n\t\t$updateAttachStatement = $this->localDatabase->prepare ( self::STMT_UPDATE_ATTACHMENT );\n\t\t$selectPostsStatement = $this->getRemoteQuery ( self::STMT_SELECT_POST );\n\n\t\t$postCount = 0;\n\t\tForEach($this->remoteDatabase->query($selectPostsStatement) As $post) {\n\n\t\t\tIf($post['post_attached']) {\n\t\t\t\t$localFilename = self::PATH_ATTACHMENT_MMFORUM.$post['post_attached'];\n\t\t\t\t$this->fileInterface->retrieveFile (\n\t\t\t\t\tself::PATH_ATTACHMENT_CHCFORUM.$post['post_attached'],\n\t\t\t\t\t$localFilename );\n\t\t\t\t$insertArray = Array ( ':pid' => $this->importConfiguration->getForumPid(),\n\t\t\t\t ':crdate' => $post['crdate'],\n\t\t\t\t ':type' => $this->getMimeType(PATH_site.$localFilename),\n\t\t\t\t ':size' => filesize($localFilename),\n\t\t\t\t ':path' => $localFilename,\n\t\t\t\t ':downloads' => 0 );\n\t\t\t\t$insertAttachStatement->execute($insertArray);\n\t\t\t\t$attachmentId = $this->localDatabase->lastInsertId();\n\t\t\t} Else $attachmentId = '';\n\n\t\t\t$insertArray = Array ( ':pid' => $this->importConfiguration->getForumPid(),\n\t\t\t ':topic' => $this->uidMapping['topics'][$post['thread_id']],\n\t\t\t ':forum' => $this->uidMapping['forums'][$post['conference_id']],\n\t\t\t ':user' => $this->uidMapping['users'][$post['post_author']],\n\t\t\t ':crdate' => $post['crdate'],\n\t\t\t ':ip' => dechex(ip2long($post['post_author_ip'])),\n\t\t\t ':attachment' => $attachmentId );\n\t\t\t$insertPostStatement->execute($insertArray);\n\t\t\t$postUid = $this->localDatabase->lastInsertId();\n\t\t\t$this->uidMapping['posts'][$post['post_id']] = $postUid;\n\n\t\t\tIf($attachmentId != '')\n\t\t\t\t$updateAttachStatement->execute(Array($postUid, $attachmentId));\n\n\t\t\t$text = $post['post_text'];\n\t\t\tIf($post['post_subject']) $text = '[b]'.$post['post_subject'].\"[/b]\\n\\n\".$text;\n\n\t\t\t$insertArray = Array ( ':pid' => $this->importConfiguration->getForumPid(),\n\t\t\t ':crdate' => $post['crdate'],\n\t\t\t ':post' => $postUid,\n\t\t\t ':text' => $text );\n\t\t\t$insertPostTextStatement->execute($insertArray);\n\t\t\t$postCount ++;\n\t\t}\n\n\t\t$this->pushLog(\"Imported $postCount posts.\");\n\n\t}", "function processData($fb, $group_id, $groupname, $since, $until){\r\n \r\n $fbdata = $fb->get(\r\n '/'.$group_id.'/feed?fields=message,id,likes{id,name,username},reactions{id,name,username,type},created_time,story,link,picture,status_type,comments{created_time,id,message,from,likes{id,username},reactions{id,type,username},comments{created_time,from,message,id,likes{id,username},reactions{type,id,username}}},from&until='.$until.'&since='.$since\r\n );\r\n // &since=1/1/19&until=4/25/19&limit=500\r\n $postfeed = $fbdata->getGraphEdge();\r\n $chatfeed_CSV = array();\r\n $chatcomments_CSV = array();\r\n $chatlikes_CSV = array();\r\n $chatreactions_CSV = array();\r\n $chatfeed_CSV[0] = array('Id', 'UserId', 'UserName', 'CreatedTime', 'StatusType', 'Message', 'Story', 'Link', 'Picture');\r\n $chatcomments_CSV[0] = array('PostId', 'Id', 'UserId', 'UserName', 'CreatedTime', 'Message');\r\n $chatlikes_CSV[0] = array('ObjectId', 'UserId', 'UserName');\r\n $chatreactions_CSV[0] = array('ObjectId', 'UserId', 'UserName', 'Type');\r\n $chatcount = 1;\r\n $comcount = 1;\r\n $likecount = 1;\r\n $reactcount = 1;\r\n do {\r\n foreach ($postfeed as $post )\r\n { \r\n $post_id = $post['id'];\r\n $post_userid = $post['from']['id'];\r\n $post_username = $post['from']['name'];\r\n $post_created = $post['created_time'];\r\n $post_created = $post_created->format('d-m-Y H:i:s');\r\n $post_statustype = $post['status_type'];\r\n $post_message = $post['message'];\r\n $post_story = $post['story'];\r\n $post_link = $post['link'];\r\n $post_pic = $post['picture'];\r\n \r\n $chatfeed_CSV[$chatcount] = array($post_id, $post_userid, $post_username, $post_created, $post_statustype, $post_message, $post_story, $post_link, $post_pic);\r\n $chatcount = $chatcount + 1;\r\n if ($post['comments']){\r\n $commentfeed = $post['comments'];\r\n \r\n foreach($commentfeed as $comment){\r\n $comment_id = $comment['id'];\r\n $comment_userid = $comment['from']['id'];\r\n $comment_username = $comment['from']['name'];\r\n $comment_created = $comment['created_time'];\r\n $comment_created = $comment_created->format('d-m-Y H:i:s');\r\n $comment_message = $comment['message'];\r\n \r\n $chatcomments_CSV[$comcount] = array($post_id, $comment_id, $comment_userid, $comment_username, $comment_created, $comment_message);\r\n $comcount = $comcount + 1;\r\n \r\n if ($comment['comments']){\r\n $comment2feed = $comment['comments'];\r\n \r\n foreach($comment2feed as $comment){\r\n $comment_id = $comment['id'];\r\n $comment_userid = $comment['from']['id'];\r\n $comment_username = $comment['from']['name'];\r\n $comment_created = $comment['created_time'];\r\n $comment_created = $comment_created->format('d-m-Y H:i:s');\r\n $comment_message = $comment['message'];\r\n \r\n $chatcomments_CSV[$comcount] = array($post_id, $comment_id, $comment_userid, $comment_username, $comment_created, $comment_message);\r\n $comcount = $comcount + 1;\r\n \r\n if ($comment['likes']){\r\n $commentlikefeed = $comment['likes'];\r\n foreach($commentlikefeed as $like){\r\n $like_userid = $like['id'];\r\n $like_username = $like['name'];\r\n \r\n $chatlikes_CSV[$likecount] = array($comment_id, $like_userid, $like_username);\r\n $likecount = $likecount + 1;\r\n }\r\n \r\n }\r\n if ($comment['reactions']){\r\n $commentreactionfeed = $comment['reactions'];\r\n foreach($commentreactionfeed as $reaction){\r\n $reaction_userid = $reaction['id'];\r\n $reaction_username = $reaction['name'];\r\n $reaction_type = $reaction['type'];\r\n \r\n $chatreactions_CSV[$reactcount] = array($comment_id, $reaction_userid, $reaction_username, $reaction_type);\r\n $reactcount = $reactcount + 1;\r\n }\r\n }\r\n }\r\n }\r\n if ($comment['likes']){\r\n $commentlikefeed = $comment['likes'];\r\n foreach($commentlikefeed as $like){\r\n $like_userid = $like['id'];\r\n $like_username = $like['name'];\r\n \r\n $chatlikes_CSV[$likecount] = array($comment_id, $like_userid, $like_username);\r\n $likecount = $likecount + 1;\r\n }\r\n \r\n }\r\n if ($comment['reactions']){\r\n $commentreactionfeed = $comment['reactions'];\r\n foreach($commentreactionfeed as $reaction){\r\n $reaction_userid = $reaction['id'];\r\n $reaction_username = $reaction['name'];\r\n $reaction_type = $reaction['type'];\r\n \r\n $chatreactions_CSV[$reactcount] = array($comment_id, $reaction_userid, $reaction_username, $reaction_type);\r\n $reactcount = $reactcount + 1;\r\n }\r\n }\r\n }\r\n }\r\n if ($post['likes']){\r\n $likefeed = $post['likes'];\r\n foreach($likefeed as $like){\r\n $like_userid = $like['id'];\r\n $like_username = $like['name'];\r\n \r\n $chatlikes_CSV[$likecount] = array($comment_id, $like_userid, $like_username);\r\n $likecount = $likecount + 1;\r\n }\r\n \r\n }\r\n if ($post['reactions']){\r\n $reactionfeed = $post['reactions'];\r\n foreach($reactionfeed as $reaction){\r\n $reaction_userid = $reaction['id'];\r\n $reaction_username = $reaction['name'];\r\n $reaction_type = $reaction['type'];\r\n \r\n $chatreactions_CSV[$reactcount] = array($comment_id, $reaction_userid, $reaction_username, $reaction_type);\r\n $reactcount = $reactcount + 1;\r\n }\r\n }\r\n }\r\n } while($postfeed = $fb->next($postfeed));\r\n \r\n\r\n writeCSV($chatfeed_CSV, $chatcomments_CSV, $chatlikes_CSV, $chatreactions_CSV, $groupname); \r\n}", "function post_Post($title, $content,$writer, $image, $posted){\n $postManager=new ced\\stream\\model\\WritteManager;\n $affectedLines = $postManager->postPost($title, $content,$writer, $image, $posted);\n \n if ($affectedLines === false) {\n throw new Exception('Impossible d\\' ajouter l\\' article !');\n }\n else {\n header('Location:index.php?page=publications.dash&p=1');\n } }" ]
[ "0.47922435", "0.47861353", "0.4780264", "0.4747021", "0.47400162", "0.46867865", "0.45555073", "0.4550054", "0.45499417", "0.45369628", "0.45266983", "0.45208436", "0.45059535", "0.4498268", "0.4458606", "0.44454548", "0.4418927", "0.44181424", "0.44159028", "0.43721506", "0.43656418", "0.43540052", "0.4340207", "0.43332863", "0.43261257", "0.43222502", "0.43129212", "0.43056712", "0.43011943", "0.42981094" ]
0.6452441
0
sorts players by score, descending
public function sortPlayers() { arsort($this->playerStats); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cmp($a, $b)\n{\n if ($a->getScore() == $b->getScore()) {\n return 0;\n }\n return ($a->getScore() > $b->getScore()) ? -1 : 1;\n}", "function sortScores($scores){\n// print_r($scores);\n $x = usort($scores, function($a, $b)\n{\n return intCompare( $b->score+$b->ab,$a->score+$a->ab);\n});\nprint_r($scores);\nreturn array_slice($scores,0,10);\n}", "private static function rank(&$scores) {\n\n // We rank the players first by rounds\n Utils::stableuasort($scores, function($a, $b) {\n\n // Rank by group rank\n if ($a['rank'] == $b['rank']) {\n\n // sort by total points\n if ($a['total_points'] == $b['total_points']) {\n\n // same points, sort by position\n if ($a['position'] == $b['position']) {\n\n // same position, sort by kills\n if ($a['kills'] == $b['kills']) {\n return 0;\n }\n return ($a['kills'] > $b['kills']) ? -1 : 1;\n\n } else {\n return ($a['position'] > $b['position']) ? -1 : 1;\n }\n\n } else {\n return ($a['total_points'] > $b['total_points']) ? -1 : 1;\n }\n\n } else {\n return ($a['rank'] < $b['rank']) ? -1 : 1; // ascending order ranking\n }\n });\n }", "function playerList() {\n global $debug;\n\n $players = new PlayerArray;\n dbg(\"\".__FUNCTION__.\":count={$players->playerCount}:\" . count($players->playerList) . \"\");\n# $players->listing();\n# $players->sortNick();\n// usort($players->playerList, array('PlayerArray','sortNick')); \n\n// $players->listing();\n usort($players->playerList, array('PlayerArray','sortScore')); \n\nrequire(BASE_URI . \"modules/player/player.list.form.php\");\n\n}", "public function asort();", "function search_sort_results($a, $b){\n $ax = $a['score'];\n $bx = $b['score'];\n\n if ($ax == $bx){\n return 0;\n }\n if($ax > $bx){\n return-1;\n }else{\n return 1;\n }\n}", "public static function sort_score( $a, $b )\n\t{\n\t\tif ( floatval($a[\"review_score\"]['overall']) == floatval($b[\"review_score\"]['overall']) ) {\n\t\t\tif ( floatval($a[\"review_score\"]['count']) == floatval($b[\"review_score\"]['count']) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n \t\t\treturn ( floatval($a[\"review_score\"]['count']) > floatval($b[\"review_score\"]['count']) ) ? -1 : 1;\n\t\t}\n\n \t\treturn ( floatval($a[\"review_score\"]['overall']) > floatval($b[\"review_score\"]['overall']) ) ? -1 : 1;\n\t}", "public function arrangeByHighest($a, $b)\n {\n return $b->objScore - $a->objScore;\n }", "private function sortByPosition()\n {\n uasort(\n $this->players,\n /**@var IPlayer $p1 */\n /**@var IPlayer $p2 */\n function($p1, $p2) {\n if ($p1->getPosition() === $p2->getPosition()) {\n return 0;\n }\n return $p1->getPosition() > $p2->getPosition() ? 1 : -1;\n }\n );\n }", "public function sort();", "public function sortByGreatestAvailablePointsWon(): Collection\n {\n return $this->teams->sort(function($team_one, $team_two){\n return $team_one->getPercentageOfAvailablePointsWon() > $team_two->getPercentageOfAvailablePointsWon();\n });\n }", "public function sort_decisions() {\n\t\t$this->uasort( function( Decision $a, Decision $b ) {\n\t\t\treturn $a->priority < $b->priority ? -1 : 1;\n\t\t} );\n\t}", "private static function sortUserPosition(Collection $leaderboard): Collection\n {\n $userScore = 0;\n foreach($leaderboard as $entry) {\n if ($entry->user_id == auth()->user()->id) {\n $userScore = $entry->total_score;\n }\n }\n\n if (count($leaderboard->where('total_score', $userScore)) > 1) {\n $leaderboard->where('user_id', auth()->user()->id)->first()->total_score += 0.1;\n $leaderboard = $leaderboard->sortByDesc('total_score');\n $leaderboard->where('user_id', auth()->user()->id)->first()->total_score -= 0.1;\n }\n\n return $leaderboard->values();\n }", "public function sort() {\n\t\treturn usort($this->cards, function ($a, $b) {\n\t\t\t$aName = $a->getName();\n\t\t\t$bName = $b->getName();\n\n\t\t\tif ($aName == $bName) {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn strcmp($aName, $bName);\n\t\t\t}\n\t\t});\t\n\t}", "public function descending();", "function cmp($a, $b) {\n\tif ($a->rank == $b->rank) {\n\t\treturn 0;\n\t}\n\treturn ($a->rank > $b->rank) ? -1 : 1;\n}", "public function natsort();", "private function _sort()\n {\n \t// if no quizzes return\n \tif ($this->count() == 0) {return;}\n \tusort ($this->quiz_objects, array(\"Quiz\", \"cmpObj\"));\n \t//usort ($this->quiz_objects, \"cmpObj\");\n }", "public function doSort();", "function highScore() {\n $T_Name1 = 'user'; //name bta3 table el user\n $T_Name2 = 'student'; //name table student\n $Db = DB::getInstance(); //object mn el db\n $result = $Db->select_all4($T_Name1, $T_Name2, \"user.user_id\", \"student.user_id\", \"usertypeid\", \"2\"); //cal function in class db\n $sortArray = array(); //make variable as array\n foreach ($result as $data) { //hna 2 foreach ht3dy 3la el 2d array\n foreach ($data as $key => $value) {\n if (!isset($sortArray[$key])) {\n $sortArray[$key] = array();\n }\n $sortArray[$key][] = $value;\n }\n }\n $orderby = \"point\"; //change this to whatever key you want from the array\n $Sort_array = array_multisort($sortArray[$orderby], SORT_DESC, $result);\n /* echo '<pre>';\n print_r($result);\n echo '</pre>'; */\n return $result;\n }", "function rankingsStuntsCompare($a, $b){\n\tif($a['Score'] > $b['Score'])\n\t\treturn -1;\n\telse if($a['Score'] < $b['Score'])\n\t\treturn 1;\n\tif($a['BestTime'] < $b['BestTime'])\n\t\treturn -1;\n\telse if($a['BestTime'] > $b['BestTime'])\n\t\treturn 1;\n\tif($a['Rank'] < $b['Rank'])\n\t\treturn -1;\n\treturn 1;\n}", "function sorteer(){\n\t\tglobal $conn, $laag_hoog, $jokers, $vijven;\n\t\t$sql = \"SELECT laag_hoog, jokers, vijven FROM spelers WHERE speler_id=\".$this->speler;\n\t\t$result = $conn->query($sql);\n\t\tif(!$result){\n\t\t\techo $conn->error.\"<br>\".$sql.\"<br>\";\n\t\t}\n\t\t$row = $result->fetch_assoc();\n\t\t$laag_hoog = $row['laag_hoog'];\n\t\t$jokers = $row['jokers'];\n\t\t$vijven = $row['vijven'];\n\t\tusort($this->kaarten, \"vergelijk\");\n\t}", "function display_ranks($rank,$title,$display,$login_id){\n\n\tforeach($rank as $v2){\n\t\t $sortpts[]=$v2['pts'];\n\t\t $sortrem[]=$v2['rem'];\n\t\t $sortlost[]=$v2['lost'];\n\t\t $sortname[]=$v2['name'];\n\t\t $sortcurr[]=$v2['curr'];\n\t\t $sortcurrw[]=$v2['curr_w'];\n\t\t $sortppcb[]=$v2['ppcb'];\n\t\t $sortlppwb[]=$v2['lppwb'];\n\t}\n\t\n\t$index=0;\n\t\n\tif($display==0) {\n\t\tarray_multisort($sortpts,SORT_DESC,$sortrem,SORT_DESC,$sortname,SORT_ASC,$rank);\n\t\tforeach($rank as $row){\n\t\t\t$ftable[$index]['name']=$row['name'];\n\t\t\t$ftable[$index]['score']=$row['pts'];\n\t\t\t$ftable[$index]['p_id']=$row['p_id'];\n\t\t\t$ftable[$index]['winner']=$row['winner'];\n\t\t\t$index++;\n\t\t}\n\t}\n\tif($display==1) {\n\t\tarray_multisort($sortcurr,SORT_DESC,$rank);\n\t\tforeach($rank as $row){\n\t\t\t$ftable[$index]['name']=$row['name'];\n\t\t\t$ftable[$index]['score']=$row['curr'];\n\t\t\t$ftable[$index]['p_id']=$row['p_id'];\n\t\t\t$ftable[$index]['winner']=$row['winner'];\n\t\t\t$index++;\n\t\t}\n\t}\n\tif($display==2) {\n\t\tarray_multisort($sortlost,SORT_ASC,$rank);\n\t\tforeach($rank as $row){\n\t\t\t$ftable[$index]['name']=$row['name'];\n\t\t\t$ftable[$index]['score']=$row['lost'];\n\t\t\t$ftable[$index]['p_id']=$row['p_id'];\n\t\t\t$ftable[$index]['winner']=$row['winner'];\n\t\t\t$index++;\n }\n }\n if($display==3) {\n array_multisort($sortppcb,SORT_DESC,$sortcurr,SORT_DESC,$rank);\n foreach($rank as $row){\n $ftable[$index]['name']=$row['name'];\n $ftable[$index]['score']=$row['ppcb'];\n $ftable[$index]['p_id']=$row['p_id'];\n $ftable[$index]['winner']=$row['winner'];\n $index++;\n }\n }\n if($display==4) {\n array_multisort($sortlppwb,SORT_ASC,$sortcurrw,SORT_ASC,$rank);\n foreach($rank as $row){\n $ftable[$index]['name']=$row['name'];\n $ftable[$index]['score']=$row['lppwb'];\n\t\t\t//(\".$row['curr_w'].\")\";\n $ftable[$index]['p_id']=$row['p_id'];\n $ftable[$index]['winner']=$row['winner'];\n $index++;\n }\n }\n unset($sortpts) ;\n unset($sortrem) ;\n unset($sortname);\n unset($sortcurr);\n unset($sortppcb);\n unset($sortlppwb);\n unset($sortcurrw);\n\n display_rank_table($ftable,$login_id);\n}", "public function sortQuestionsByScore($questions, $order = \"desc\")\n {\n $sortedQuestions = [];\n $userScore = [];\n $userData = [];\n foreach ($questions as $question) {\n if ($question->deleted === null) {\n $votesUp = sizeof($this->voteService->getAllVotesUp(\"questionId\", $question->id));\n $votesDown = sizeof($this->voteService->getAllVotesDown(\"questionId\", $question->id));\n\n $question->score = $votesUp-$votesDown;\n $userScore[$question->id] = $question->score;\n $userData[$question->id] = $question;\n }\n }\n if ($order === \"asc\") {\n asort($userScore, SORT_NUMERIC);\n } else {\n arsort($userScore, SORT_NUMERIC);\n }\n\n foreach (array_keys($userScore) as $key) {\n $sortedQuestions[] = $userData[$key];\n }\n return $sortedQuestions;\n }", "function chooseWinner($players)\n{\n $highestScore = max(array_column($players, 'score'));\n $winnerString = '';\n foreach ($players as $key => $player) {\n if ($player['score'] == $highestScore) {\n $winnerString = $winnerString . \" \" . $key;\n }\n }\n return $winnerString . \" with \" . $highestScore . \" points\";\n}", "private function sortResults()\n {\n if (sizeof($this->results) === 0) {\n return;\n }\n error_log(\"Sorting results\");\n usort($this->results, function($a,$b) {\n return substr($b[\"docket_number\"],-4) -\n substr($a[\"docket_number\"],-4);\n });\n\n usort($this->resultsMDJ, function($a,$b) {\n return substr($b[\"docket_number\"],-4) -\n substr($a[\"docket_number\"],-4);\n });\n }", "function getTopScore (){\nreturn 4;\n}", "public function getSortOrder();", "public function scores()\n {\n return $this->hasMany(PlayerScore::class);\n }", "function getSort ()\n {\n return 10;\n }" ]
[ "0.7030045", "0.68740094", "0.6695462", "0.62556213", "0.62403905", "0.62396264", "0.6223243", "0.6186669", "0.61702305", "0.61260366", "0.60394305", "0.6017947", "0.59454674", "0.58338517", "0.58310837", "0.5782633", "0.5763002", "0.5676899", "0.5664009", "0.5659207", "0.5636344", "0.5605932", "0.5551995", "0.55362976", "0.5535421", "0.55191493", "0.54960936", "0.5413949", "0.53931844", "0.53872544" ]
0.78595775
0
returns all players stats
public function getTeam(): array { return $this->playerStats; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllPlayers()\r\n {\r\n\r\n /*\r\n * See getAllUsers for explantation\r\n */ \r\n\r\n $stmt = $this->conn->prepare(\"SELECT player_id, year, player_role, player_image, player_name, player_position FROM player\");\r\n $stmt->execute(); \r\n $stmt->bind_result($id, $year, $role, $image, $name, $position);\r\n $players = array(); \r\n while($stmt->fetch())\r\n { \r\n $entry = array(); \r\n $entry['player_id'] = $id; \r\n $entry['year']=$year; \r\n $entry['player_role'] = $role;\r\n $entry['player_image'] = $image;\r\n $entry['player_name'] = $name; \r\n $entry['player_position'] = $position; \r\n array_push($players, $entry);\r\n } \r\n \r\n return $players; \r\n }", "public function getStats() {}", "function all(){\n\t\t$query = $this->db->query(\"SELECT * FROM players;\");\n\t\treturn $query->result_array();\n\t}", "public function getStats();", "public function getPlayers(){return $this->getMembers();}", "function getPlayers() {\n $res = $this->all();\n $newRes = array();\n foreach($res as $queryIndex) {\n $tmpRes = array();\n array_push($tmpRes, $queryIndex->username, $queryIndex->firstname . ' ' . $queryIndex->lastname, $this->calcEquity($queryIndex->username), $queryIndex->cash);\n array_push($newRes, $tmpRes);\n }\n return $newRes;\n }", "protected function getAllDatas()\r\n {\r\n $result = array();\r\n\r\n // Get information about players\r\n // Note: you can retrieve some extra field you added for \"player\" table in \"dbmodel.sql\" if you need it.\r\n $sql = \"SELECT player_id id, player_score score FROM player \";\r\n $result['players'] = self::getCollectionFromDb( $sql );\r\n\r\n $currentPlayerID = self::getCurrentPlayerId(); // !! We must only return informations visible by this player !!\r\n\r\n $result['player_cards'] = array_values($this->cards->getCardsInLocation(\"hand\", $currentPlayerID));\r\n\r\n return $result;\r\n }", "protected function getAllDatas()\n {\n $result = array();\n \n $current_player_id = self::getCurrentPlayerId(); // !! We must only return informations visible by this player !!\n \n // Get information about players\n // Note: you can retrieve some extra field you added for \"player\" table in \"dbmodel.sql\" if you need it.\n $sql = \"SELECT player_id id, player_score score FROM player \";\n $result['players'] = self::getCollectionFromDb( $sql );\n \n // TODO: Gather all information about current game situation (visible by player $current_player_id).\n \n return $result;\n }", "function getPlayers() {\n return $this->players;\n }", "public function players_get() {\n\t\t$id = $this->get('id');\n\n\t\tif(isset($id)) {\n\t\t\t// If ID is provided then get individual player\n\t\t\t$data = $this->pm->get_player($this->get('id'));\n\n\t\t\tif(isset($data)) {\n\t\t\t\t// Send specific player details with 200 status code\n\t\t\t\t$this->response($data, 200);\n\t\t\t} else {\n\t\t\t\t// No players available, send 200 status code\n\t\t\t\t$this->response(\"No players available\", 200);\n\t\t\t}\n\t\t} else {\n\t\t\t// else get all players from database\n\t\t\t$data = $this->pm->get_all_players();\n\n\t\t\tif(isset($data)) {\n\t\t\t\t// Send all players with 200 status code\n\t\t\t\t$this->response($data, 200);\n\t\t\t} else {\n\t\t\t\t$data = [];\n\t\t\t\t// No players available, send 200 status code\n\t\t\t\t$this->response($data, 200);\n\t\t\t}\n\t\t}\n\t}", "public function players() \n\t{\n\t\t\t$Model = new Model($this->config);\n\t\t\t$rows = $Model->getPlayers();\n\t\t\t$output = '';\n\t\t\t\n\t\t\tforeach ($rows as $data)\n\t\t\t{\n\t\t\t\t$sex = ($data->sex) ? 'M' : 'F';\n\t\t\t\t$output .= '<tr>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->id . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->name . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->club . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->email . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->msisdn . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $sex . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->handicap . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . date(\"d-m-Y\", $data->joined) . '</td>\n\t\t\t\t\t\t\t\t\t\t\t<td>' . $data->saga . '</td>';\n\t\t\t\t$output .= '</tr>';\n\t\t\t}\n\t\t\treturn $output;\n\t}", "public function getPlayers() {\n return $this->players;\n }", "function getTopPlayerInfo() {\n try {\n $query = \"CALL getTopPlayerInfo()\";\n $players = dbSelect($query);\n\n return $players;\n }\n catch (PDOException $e){\n die ('PDO error in getGameWinner()\": ' . $e->getMessage() );\n }\n }", "public function retrieveAllPlayerName() {\r\n\t\t$records = [ ];\r\n\t\ttry {\r\n\t\t\t$prepare = $this->plugin->database->prepare ( \"SELECT distinct pname FROM arena_player\" );\r\n\t\t\t$result = $prepare->execute ();\r\n\t\t\tif ($result instanceof \\SQLite3Result) {\r\n\t\t\t\t// $data = $result->fetchArray ( SQLITE3_ASSOC );\r\n\t\t\t\twhile ( $data = $result->fetchArray ( SQLITE3_ASSOC ) ) {\r\n\t\t\t\t\t// $dataPlayer = $data ['pname'];\r\n\t\t\t\t\t// $dataWorld = $data ['world'];\r\n\t\t\t\t\t// $dataX = $data ['x'];\r\n\t\t\t\t\t// $dataY = $data ['y'];\r\n\t\t\t\t\t// $dataZ = $data ['z'];\r\n\t\t\t\t\t$records [] = $data [\"pname\"];\r\n\t\t\t\t}\r\n\t\t\t\t// var_dump($records);\r\n\t\t\t\t$result->finalize ();\r\n\t\t\t}\r\n\t\t} catch ( \\Exception $exception ) {\r\n\t\t\treturn \"get failed!: \" . $exception->getMessage ();\r\n\t\t}\r\n\t\treturn $records;\r\n\t}", "function all() {\n\t\t$this->db->order_by(\"Cash\");\n\t\t$query = $this->db->get('players');\n\t\treturn $query->result_array();\n\t}", "public function statsAllTubes();", "public function get_stats() {\n\n\t\t\t$stats = self::$stats;\n\n\t\t\tif ( empty( $stats ) ) {\n\t\t\t\t$stats = $this->build_stats();\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Allow full stats data to be built and sent.\n\t\t\t *\n\t\t\t * @param boolean $use_full_stats Whether to send full stats\n\t\t\t *\n\t\t\t * @since 4.5.1\n\t\t\t */\n\t\t\t$use_full_stats = apply_filters( 'pue_use_full_stats', false );\n\n\t\t\tif ( $use_full_stats ) {\n\t\t\t\t$stats_full = self::$stats_full;\n\n\t\t\t\tif ( empty( $stats_full ) ) {\n\t\t\t\t\t$stats = $this->build_full_stats( $stats );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter stats and allow plugins to add their own stats\n\t\t\t * for tracking specific points of data.\n\t\t\t *\n\t\t\t * @param array $stats Stats gathered by PUE Checker class\n\t\t\t * @param boolean $use_full_stats Whether to send full stats\n\t\t\t * @param \\Tribe__PUE__Checker $checker PUE Checker class object\n\t\t\t *\n\t\t\t * @since 4.5.1\n\t\t\t */\n\t\t\t$stats = apply_filters( 'pue_stats', $stats, $use_full_stats, $this );\n\n\t\t\treturn $stats;\n\t\t}", "function getPlayerNamesFromDB() {\n\t$allNames = array();\n\t$dbr = wfGetDB(DB_SLAVE);\n\t$sql = 'DESCRIBE `stats_games`';\n\t$res = $dbr->query($sql);\n\t$res->seek(NUM_NONPLAYER_COLS); // skip data columns\n\twhile($row = $res->fetchRow()) {\n\t\t$allNames[] = $row['Field'];\n\t}\n\treturn $allNames;\n}", "public function getAllAutoRefreshPlayers();", "public function players() : array \n {\n $returnPlayers = [];\n\n $players = $this->get(sprintf(self::GAME_ENDPOINT . 'titles/%s/players', $this->titleId));\n\n if ($players->size === 0) return $returnPlayers;\n\n foreach ($players->data as $player) {\n $returnPlayers[] = new User($this->client, $player->onlineId);\n }\n\n return $returnPlayers;\n }", "public function index()\n {\n return Player::all();\n }", "public function getPlayStats() : array\n {\n return [\n ['label' => 'Win Rate', 'value' => round(mt_rand(0, mt_getrandmax() - 1) / mt_getrandmax() * 100, 2).\"%\"],\n ['label' => 'Popularity', 'value' => round(mt_rand(0, mt_getrandmax() - 1) / mt_getrandmax() * 100, 2).\"%\"],\n ['label' => 'Ban Rate', 'value' => round(mt_rand(0, mt_getrandmax() - 1) / mt_getrandmax() * 100, 2).\"%\"],\n [\n 'label' => 'AVG Matches Played',\n 'value' => round(mt_rand(0, mt_getrandmax() - 1) / mt_getrandmax() * 10, 2)\n ]\n ];\n }", "function getStats() {\r\n\t\t$response = $this->sendCommand('stats');\r\n\t\t$stats = new stats($response);\r\n\r\n\t\treturn $stats;\r\n\t}", "public function getCurrentPlayers() {\n\t\treturn $this->Players()->filter(array('Status'=> \"1\"));\n\t}", "function GetDetailedPlayers( )\r\n {\r\n if ($this->SendPacket('d') === false) {\r\n throw new QueryServerException( 'Connection to ' . $this->szServerIP . ' failed or has dropped.' );\r\n }\r\n\r\n // Skip the first 11 bytes of the response;\r\n fread( $this->rSocketID, 11 );\r\n\r\n $iPlayerCount = ord( fread( $this->rSocketID, 2 ) );\r\n $aReturnArray = array( );\r\n\r\n for( $i = 0; $i < $iPlayerCount; $i ++ ) {\r\n $aReturnArray[ ] = array(\r\n 'PlayerID' => $this->toInteger( fread( $this->rSocketID, 1 ) ),\r\n 'Nickname' => $this->GetPacket( 1 ),\r\n 'Score' => $this->toInteger( fread( $this->rSocketID, 4 ) ),\r\n 'Ping' => $this->toInteger( fread( $this->rSocketID, 4 ) )\r\n );\r\n }\r\n\r\n return $aReturnArray;\r\n }", "public function getList() {\n $players = $this->db->fetchAll('SELECT steamid, name, country, points, lastseen From playerrank ORDER BY points DESC LIMIT 50');\n \n for ($i = 0; $i < count($players); $i++)\n $players[$i]['countrycode'] = $this->countryCode($players[$i]['country']);\n \n return $players;\n }", "public static function registerPlayerStatistics(): void\n {\n // Duel wins of the player.\n StatsInfo::registerStatistic(new StatPropertyInfo(\n self::STATISTIC_DUELS_PLAYER_WINS,\n IntegerStatProperty::class,\n true\n ));\n\n // Duel losses of the player.\n StatsInfo::registerStatistic(new StatPropertyInfo(\n self::STATISTIC_DUELS_PLAYER_LOSSES,\n IntegerStatProperty::class,\n true\n ));\n\n // The player's win streak.\n StatsInfo::registerStatistic(new StatPropertyInfo(\n self::STATISTIC_DUELS_PLAYER_WIN_STREAK,\n IntegerStatProperty::class,\n false,\n 0\n ));\n }", "public function stats() {\n $output = array();\n $output['winsAsX'] = $this->winsAsXCount();\n $output['winsAsO'] = $this->winsAsOCount();\n $output['totalWins'] = $output['winsAsO'] + $output['winsAsX'];\n\n $output['drawsAsX'] = $this->drawsAsXCount();\n $output['drawsAsO'] = $this->drawsAsOCount();\n $output['totalDraws'] = $output['drawsAsX'] + $output['drawsAsO'];\n\n $output['lossesAsX'] = $this->lossesAsXCount();\n $output['lossesAsO'] = $this->lossesAsOCount();\n $output['totalLosses'] = $output['lossesAsX'] + $output['lossesAsO'];\n\n $output['totalGames'] = $output['totalWins'] + $output['totalDraws'] + $output['totalLosses'];\n\n $output['winPercentage'] = ($output['totalGames'] > 0) ? $output['totalWins'] / $output['totalGames'] * 100 : 0;\n $output['drawPercentage'] = ($output['totalGames'] > 0) ? $output['totalDraws'] / $output['totalGames'] * 100 : 0;\n $output['lossPercentage'] = ($output['totalGames'] > 0) ? $output['totalLosses'] / $output['totalGames'] * 100 : 0;\n\n return $output;\n }", "public function index()\n {\n return $this->playerRepository->with('team')->get();\n }", "public function getplayers()\n\t{\n\t\t$player_a_ids = Request::get('player_a_ids');\n\t\t$team_a_playerids = explode(',',$player_a_ids);\n\t\t$a_team_players = User::select('id','name')->whereIn('id',$team_a_playerids)->get();\n\t\t\n if (count($a_team_players)>0)\n $players = $a_team_players->toArray();\n\n return Response::json(!empty($players) ? $players : []);\n\t}" ]
[ "0.7074764", "0.6945209", "0.6913741", "0.6902518", "0.68845195", "0.67823756", "0.6720697", "0.6692665", "0.6678541", "0.66687167", "0.6627309", "0.6611316", "0.6573121", "0.6560282", "0.65385437", "0.6531247", "0.6509618", "0.65013856", "0.649525", "0.6465236", "0.64489776", "0.64480186", "0.64400405", "0.6434875", "0.6424403", "0.6421712", "0.6416924", "0.6391809", "0.63462317", "0.63251746" ]
0.7071189
1
name: validate_add() created by: description: parameters: returns:
function validate_add(&$d) { $valid = true; if (!$d["last_name"]) { $d["error"] .= "'Last Name' is a required field.<br>"; $valid = false; } if (!$d["first_name"]) { $d["error"] .= "'First Name' is a required field.<br>"; $valid = false; } if (!$d["username"]) { $d["error"] .= "'Username' is a required field.<br>"; $valid = false; } if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*$", $d["username"])) { $d["error"] .= "'Username' cannot contain spaces.<br>"; $valid = false; } if (!$d["password_1"]) { $d["error"] .= "'Password' is a required field.<br>"; $valid = false; } if ($d["password_1"] != $d["password_2"]) { $d["error"] .= "The passwords entered do not match.<br>"; $valid = false; } // if (!$d["perms"]) { // $d["error"] .= "You must assign the user to a group.<br>"; // $valid = false; // } if (!$d["user_email"]) { $d["error"] .= "'Email' is a required field.<br>"; $valid = false; } elseif (!validate_email($d["user_email"])) { $d["error"] .= "Please provide a valid email address.<br>"; $valid = false; } $db = new ps_DB; $q = "SELECT * from auth_user_md5 where username='" . $d["username"] . "'"; $db->query($q); if ($db->next_record()) { $d["error"] .= "The given username already exists. "; $d["error"] .= "Please try another username.<br>"; $valid = false; } return $valid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testValidateAddFields()\n {\n $data = [\n 'currency' => 'CAD',\n 'usd_value' => 0.8,\n ];\n\n $errors = CurrencyService::validateAddFields($data);\n $this->assertEmpty($errors);\n \n $data['currency'] = 'NOT_EXISTS';\n $data['usd_value'] = 'NOT_NUMERIC';\n $errors = CurrencyService::validateAddFields($data);\n $this->assertIsArray($errors);\n $this->assertArrayHasKey(1, $errors);\n $this->assertStringContainsString('NOT_EXISTS', $errors[0]);\n $this->assertStringContainsString('usd_value', $errors[1]);\n }", "function validateOnAdd( $entity ){\t\t\n\t}", "public function testAdd()\n {\n $error = new Error('Test message', 'field1');\n\n $this->assertFalse($this->errors->hasErrors());\n $return = $this->errors->add($error);\n $this->assertTrue($return);\n $this->assertTrue($this->errors->contains($error));\n $this->assertTrue($this->errors->hasErrors());\n }", "public function formValidateAdd()\n\t{\n\t\t$this->load->library('form_validation');\n\t\t$frm = $this->form_validation;\n\n\t\t$frm->set_rules('bk_month', 'เดือน', 'trim|required');\n\n\t\t$frm->set_message('required', 'กรุณากรอก %s');\n\t\t\n\n\t\t$message_add = '';\n\t\tif ($frm->run() == FALSE) {\n\t\t\t$message_add .= form_error('bk_month');\n\t\t}\n\t\t$message_add .= $this->formValidate();\n\t\treturn $message_add;\n\t}", "function manageValidationAdd($input) {\n\n //Action for send_validation rule\n if (isset($input[\"_add_validation\"])) {\n if (isset($input['entities_id'])) {\n $entid = $input['entities_id'];\n } else if (isset($this->fields['entities_id'])) {\n $entid = $this->fields['entities_id'];\n } else {\n return false;\n }\n\n $validations_to_send = [];\n if (!is_array($input[\"_add_validation\"])) {\n $input[\"_add_validation\"] = [$input[\"_add_validation\"]];\n }\n\n foreach ($input[\"_add_validation\"] as $key => $validation) {\n switch ($validation) {\n case 'requester_supervisor' :\n if (isset($input['_groups_id_requester'])\n && $input['_groups_id_requester']) {\n $users = Group_User::getGroupUsers($input['_groups_id_requester'],\n \"is_manager='1'\");\n foreach ($users as $data) {\n $validations_to_send[] = $data['id'];\n }\n }\n // Add to already set groups\n foreach ($this->getGroups(CommonITILActor::REQUESTER) as $d) {\n $users = Group_User::getGroupUsers($d['groups_id'], \"is_manager='1'\");\n foreach ($users as $data) {\n $validations_to_send[] = $data['id'];\n }\n }\n break;\n\n case 'assign_supervisor' :\n if (isset($input['_groups_id_assign'])\n && $input['_groups_id_assign']) {\n $users = Group_User::getGroupUsers($input['_groups_id_assign'],\n \"is_manager='1'\");\n foreach ($users as $data) {\n $validations_to_send[] = $data['id'];\n }\n }\n foreach ($this->getGroups(CommonITILActor::ASSIGN) as $d) {\n $users = Group_User::getGroupUsers($d['groups_id'], \"is_manager='1'\");\n foreach ($users as $data) {\n $validations_to_send[] = $data['id'];\n }\n }\n break;\n\n default :\n // Group case from rules\n if ($key === 'group') {\n foreach ($validation as $groups_id) {\n $validation_right = 'validate_incident';\n if (isset($input['type'])\n && ($input['type'] == Ticket::DEMAND_TYPE)) {\n $validation_right = 'validate_request';\n }\n $opt = ['groups_id' => $groups_id,\n 'right' => $validation_right,\n 'entity' => $entid];\n\n $data_users = TicketValidation::getGroupUserHaveRights($opt);\n\n foreach ($data_users as $user) {\n $validations_to_send[] = $user['id'];\n }\n }\n } else {\n $validations_to_send[] = $validation;\n }\n }\n\n }\n\n // Validation user added on ticket form\n if (isset($input['users_id_validate'])) {\n if (array_key_exists('groups_id', $input['users_id_validate'])) {\n foreach ($input['users_id_validate'] as $key => $validation_to_add) {\n if (is_numeric($key)) {\n $validations_to_send[] = $validation_to_add;\n }\n }\n } else {\n foreach ($input['users_id_validate'] as $key => $validation_to_add) {\n if (is_numeric($key)) {\n $validations_to_send[] = $validation_to_add;\n }\n }\n }\n }\n\n // Keep only one\n $validations_to_send = array_unique($validations_to_send);\n\n $validation = new TicketValidation();\n\n if (count($validations_to_send)) {\n $values = [];\n $values['tickets_id'] = $this->fields['id'];\n if (isset($input['id']) && $input['id'] != $this->fields['id']) {\n $values['_ticket_add'] = true;\n }\n\n // to know update by rules\n if (isset($input[\"_rule_process\"])) {\n $values['_rule_process'] = $input[\"_rule_process\"];\n }\n // if auto_import, tranfert it for validation\n if (isset($input['_auto_import'])) {\n $values['_auto_import'] = $input['_auto_import'];\n }\n\n // Cron or rule process of hability to do\n if (Session::isCron()\n || isset($input[\"_auto_import\"])\n || isset($input[\"_rule_process\"])\n || $validation->can(-1, CREATE, $values)) { // cron or allowed user\n\n $add_done = false;\n foreach ($validations_to_send as $user) {\n // Do not auto add twice same validation\n if (!TicketValidation::alreadyExists($values['tickets_id'], $user)) {\n $values[\"users_id_validate\"] = $user;\n if ($validation->add($values)) {\n $add_done = true;\n }\n }\n }\n if ($add_done) {\n Event::log($this->fields['id'], \"ticket\", 4, \"tracking\",\n sprintf(__('%1$s updates the item %2$s'), $_SESSION[\"glpiname\"],\n $this->fields['id']));\n }\n }\n }\n }\n return true;\n }", "public function addValidationError()\n {\n $this->_validationError = true;\n }", "public function testAddInvalid()\n {\n $this->errors->add('Incorrect type');\n }", "public function add()\n {\n // Get input messages\n $input = $this->api->get_input();\n\n // Validate\n if(! $this->__skip_validation)\n {\n $this->validation->run($input, $this->__add_validation);\n }\n\n // All fields cannot be empty\n if (empty($input))\n {\n $this->api->generate_output_json(-115);\n }\n \n $input = $this->trigger('before_add', $input);\n\n // insert the record into the table\n $id = $this->{$this->__model_name}->insert($input);\n\n // Add id to the input and send it to the after_add event\n $input->id = $id;\n $this->trigger('after_add', $input);\n\n // Return success\n $this->api->generate_output_json(1, ['data'=>$id]);\n }", "public function add($_data = array()) {\n $this->create();\n $this->setValidation('add');\n return $this->save($_data);\n }", "public abstract function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "abstract public function validate();", "public function validate();", "public function validate();", "public function validate();", "public static function validateInsert($data) {\n\t\t$v = parent::getValidationObject($data);\n\n\t\t//Set rules\n\t\t$v->rule('required', 'name')->message(__('Name is required!'))\n\t\t ->rule('lengthMin', 'name', 1)->message(__('Name cannot be empty!'))\n\t\t ->rule('required', 'quantity')->message(__('Quantity is required!'))\n\t\t ->rule('integer', 'quantity')->message(__('Quantity must be integer!'))\n\t\t ->rule('relationData', 'property', false)->message(__('Incorrect data format for element properties!'))\n\t\t ->rule('relationData', 'product', 'int')->message(__('Incorrect data format for element products!'));\n\n\t\t//Validate\n\t\treturn parent::validate($v, self::$__validationErrors);\n\t}", "public static function validate() {}", "public function add($donee){\n $validations = $this->_validate($donee);\n if($validations->status){\n if($this->db->insert(\"donee\",$donee)){\n return (object)[\n \"status\" => true,\n \"message\" => \"Successfully Added.\"\n ];\n }\n }else{\n return $validations;\n }\n }", "public function add() {\n\t\tif(count($this->object)>0) {\n\n\n\t\t}\n\t\telse\n\t\t\treturn new Error(1);\n\t}", "function gcaba_drupal_form_admin_forms_add_validate($form, &$form_state){ \n\t\n\t// Verify that forms name is available\n\t$type_form = \"gcaba_form_form\"; \n\t$nodes_form = node_load_multiple(array(), array('type' => $type_form));\n\t$doit = true;\n\tforeach ($nodes_form as $key => $value) {\n\t\tif($value->title == $form_state['input']['title'] ){ \n\t\t\tform_set_error($name = \"title\", $message = t('Title is already taken.'));\n\t\t}\n\t}\n\n\t// Verify that fields were added to form\n\tif($_SESSION['tmp_fields_list'] == null || $_SESSION['tmp_fields_list'] == array()){\n\t\tform_set_error($name = \"field_fields\", $message = t('There are no fields added'));\n\t}\n}", "abstract protected function validate();", "abstract protected function validate();", "public function validateAdd()\n {\n //executar a validacao\n $rule = [];\n $requestResource = $this->validateArr($rule, false);\n\n //parse para objeto DTO\n $productDTO = new ProductDTO($requestResource);\n\n return $productDTO;\n }", "public function validate()\n {\n if ($this->name == 'test_custom_validation')\n {\n $this->errors->add('name', self::$custom_validator_error_msg);\n }\n }" ]
[ "0.7148317", "0.66162646", "0.6544265", "0.651917", "0.6469674", "0.6454138", "0.644109", "0.6419266", "0.6415047", "0.6371371", "0.6345235", "0.6345235", "0.6345235", "0.6345235", "0.6345235", "0.6345235", "0.6345235", "0.6345235", "0.63321996", "0.63321996", "0.63321996", "0.62263215", "0.6210855", "0.6179625", "0.61733043", "0.6166044", "0.6159", "0.6159", "0.61565006", "0.6143743" ]
0.6762201
1
name: validate_update() created by: description: parameters: returns:
function validate_update(&$d) { $valid = true; if (!$d["last_name"]) { $d["error"] .= "'Last Name' is a required field.<br>"; $valid = false; } if (!$d["first_name"]) { $d["error"] .= "'First Name' is a required field.<br>"; $valid = false; } if (!$d["username"]) { $d["error"] .= "'Username' is a required field.<br>"; $valid = false; } if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*$", $d["username"])) { $d["error"] .= "'Username' cannot contain spaces.<br>"; $valid = false; } if ($d["password_1"] != $d["password_2"]) { $d["error"] .= "The passwords entered do not match.<br>"; $valid = false; } if (!$d["user_email"]) { $d["error"] .= "'Email' is a required field.<br>"; $valid = false; } if (!validate_email($d["user_email"])) { $d["error"] .= "Please provide a valid email address.<br>"; $valid = false; } return $valid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateUpdate() {\n\t\t// Add or overwrite validation rules and error messages\n\n\t\t// Execute validation\n\t\treturn $this->validate(static::$validation_rules, static::$validation_errors);\n\t}", "public static function validateUpdate($data) {\n\t\t$v = parent::getValidationObject($data);\n\n\t\t//Set rules\n\t\t$v->rule('optional', 'name')\n\t\t ->rule('lengthMin', 'name', 1)->message(__('Name cannot be empty!'))\n\t\t ->rule('optional', 'quantity')\n\t\t ->rule('integer', 'quantity')->message(__('Quantity must be integer!'))\n\t\t ->rule('relationData', 'property', false)->message(__('Incorrect data format for element properties!'))\n\t\t ->rule('relationData', 'product', 'int')->message(__('Incorrect data format for element products!'));\n\n\t\t//Validate\n\t\treturn parent::validate($v, self::$__validationErrors);\n\t}", "protected function _validate_update()\n {\n ee()->load->library('fm_form_validation');\n $this->_add_member_validation_rules();\n\n // set existing data\n ee()->form_validation->set_old_value('username', ee()->session->userdata('username'));\n ee()->form_validation->set_old_value('email', ee()->session->userdata('email'));\n ee()->form_validation->set_old_value('screen_name', ee()->session->userdata('screen_name'));\n\n // if new password is submitted, then current_password and password_confirm are required\n if ( ! empty($_POST['password'])) {\n ee()->form_validation->add_rules('current_password', 'lang:current_password', 'required');\n ee()->form_validation->add_rules('password_confirm', 'lang:password_confirm', 'required');\n }\n\n /**\n * freemember_update_validation hook\n * Add any extra form validation rules\n * @since 2.0\n */\n ee()->extensions->call('freemember_update_validation');\n if (ee()->extensions->end_script === true) return;\n\n // run form validation\n if (ee()->form_validation->run() === false) {\n return ee()->form_validation->error_array();\n }\n }", "private function validator_update($data){\n \n $rules = array();\n\n if (array_key_exists('name', $data)){\n $rules['name'] = 'string|min:3|max:100';\n }\n if (array_key_exists('breed_id', $data)){\n $rules['breed_id'] = 'numeric|exists:breeds,id';\n }\n if (array_key_exists('gender', $data)){\n $rules['gender'] = 'boolean';\n }\n if (array_key_exists('picture', $data)){\n $rules['picture'] = 'url';\n }\n if (array_key_exists('dob', $data)){\n $rules['dob'] = 'date_format:Y-m-d';\n }\n if (array_key_exists('color_id', $data)){\n $rules['color_id'] = 'numeric|exists:colors,id';\n }\n if (array_key_exists('sterialized', $data)){\n $rules['sterialized'] = 'boolean';\n }\n if (array_key_exists('status', $data)){\n $rules['status'] = 'boolean';\n }\n if (array_key_exists('lunch_time', $data)){\n $rules['lunch_time'] = 'date_format:H:i';\n }\n if (array_key_exists('friendly', $data)){\n $rules['friendly'] = 'boolean';\n }\n if (array_key_exists('observations', $data)){\n $rules['observations'] = 'string|min:5|max:255';\n }\n if (array_key_exists('user_id', $data)){\n $rules['user_id'] = 'numeric|exists:users,id';\n }\n\n return Validator::make($data,\n $rules\n ); \n }", "public function checkIsValidForUpdate() {\r\n $errors = array();\r\n\r\n if (!isset($this->id_food)) {\r\n $errors[\"id_food\"] = \"id_food is mandatory\";\r\n }\r\n\r\n try{\r\n $this->checkIsValidForCreate();\r\n }catch(ValidationException $ex) {\r\n foreach ($ex->getErrors() as $key=>$error) {\r\n $errors[$key] = $error;\r\n }\r\n }\r\n if (sizeof($errors) > 0) {\r\n throw new ValidationException($errors, \"food is not valid\");\r\n }\r\n }", "function va_validate_update_event( $event ) {\r\n\r\n\t$errors = va_get_event_error_obj();\r\n\tif ( $errors->get_error_codes( )) {\r\n\t\tset_transient('va-errors', $errors );\r\n\t\t$event = false;\r\n\t}\r\n\r\n\treturn $event;\r\n}", "public function validForUpdate()\n {\n return $this->passes();\n }", "function validateOnUpdate( $entity ){\n\t\t\n\t\t$this->validateOnAdd($entity);\n\t}", "public function update(ValidateUpdate $request){\n try{\n $pipe = (new Pipeline)\n ->pipe($this->updateService)\n ->pipe($this->properResponse);\n return $pipe->process((array)$request->all());\n }catch(\\Exception $e){\n $pipe = (new Pipeline)\n ->pipe($this->properError);\n $pipe->process($e);\n }\n }", "public function testUpdate() {\n $user = Woodling::saved('User');\n $this->specify(\"returns false when there is a validation error\", function() use($user){\n $this->assertFalse($user->update(['email' => null]));\n });\n\n $this->specify(\"returns false when there is a validation error\", function() use($user){\n $this->assertCount(0, User::where('email','[email protected]')->get());\n $this->assertTrue($user->update(['email' => '[email protected]']));\n $this->assertCount(1, User::where('email','[email protected]')->get());\n });\n }", "static function validate_update_date($valid, $value, $field, $input) {\n \tglobal $post;\n \n // Short-circuit if value is already invalid\n if (!$valid) return $valid;\n \n // Check that date is not too old\n $dt = JKNTime::dt($value);\n $pid = $post->ID;\n $post_dt = JKNTime::dt_pid($pid);\n \n if ($dt <= $post_dt) {\n $valid = 'The update must have taken place after the article' .\n\t ' was published.';\n }\n \n // Return result\n return $valid;\n }", "public function validateUpdate(UpdateUserRequest $request) \n {\n $validator = Validator::make($request->all(), \n $request->rules(),\n $request->messages());\n\n // Extracts previous user data\n $currentUser = $this->getUserLogged($request);\n $errors = $this->checkNewInputsAgainstDatabase($request, $currentUser);\n\n if (!empty($errors)) {\n return redirect()->route('account.display')\n ->withErrors($errors);\n } else {\n // Set new user data on database and session\n $currentUser->update($request->validated());\n $this->session->setUserLogged($currentUser);\n \n // Redirects to get route to avoid resending the post route\n return redirect()->route('account.display')\n ->with('success', 'Changes have been executed successfully');\n }\n\n }", "public function update()\n {\n // CALL THE VALIDATION METHOD\n $data = $this->validation((object) $_POST);\n // UPDATE THE USER DATA\n return $this->saveUpdate($data);\n }", "public static function validForUpdate(array $input)\n\t{\n\t\t$rules = array(\n\t\t\t'title'\t=> 'required',\n\t\t\t'link'\t=> 'required|url'\n\t\t);\n\n\t\tif ( $input['image'] ) $rules['image'] = 'required|mimes:png,jpg,gif';\n\n\t\treturn Validator::make($input, $rules);\n\t}", "public function action_update_check()\n\t{\n\t \tUpdate::add( $this->info->name, $this->info->guid, $this->info->version );\n\t}", "public function testHandleUpdateValidationError()\n {\n // Populate data\n $this->_populate();\n \n // Set params\n $params = $this->customUserData;\n \n // Add ID\n $ID = rand(0, 1)+1;\n $params['ID'] = $ID;\n \n // Remove fullname\n unset($params['fullname']);\n \n // Request\n $response = $this->withSession($this->adminSession)\n ->call('POST', '/user/edit', $params, [], [], ['HTTP_REFERER' => '/user/edit']);\n \n // Verify\n $this->assertRedirectedTo('/user/edit');\n $this->assertSessionHasErrors();\n }", "public function validateUpdate($id, $data)\n {\n $messages = $this->validation_messages($data);\n return Validator::make($data, [\n 'form_id'=>'nullable',\n 'step2_id'=>'nullable',\n 'year_id' => [\n 'required','exists:financial_year_master,id',\n ],\n 'mfp_storage.*.mfp_name' => [\n 'required','exists:mfp_master,id','distinct'\n ],\n 'mfp_storage.*.warehouse' => [\n 'required',\n ],\n 'mfp_storage.*.storage_type' => [\n 'required',\n ],\n 'mfp_storage.*.warehouse_type' => [\n 'required',\n ],\n 'mfp_storage.*.storage_capacity' => [\n 'required',\n ], \n 'mfp_storage.*.haat.*' => [\n 'required','exists:haat_bazaar_master,id',\n ],\n 'mfp_storage.*.estimated_storage' => [\n 'required',\n ], \n 'mfp_procurement.*.mfp_seasonality_id' => [\n 'required',\n ],\n 'mfp_procurement.*.commodity' => [\n 'required','exists:mfp_master,id',\n ],\n 'mfp_procurement.*.haat' => [\n 'required',\n ],\n 'mfp_procurement.*.blocks' => [\n 'required',\n ],\n 'mfp_procurement.*.lastqty' => [\n 'required',\n ],\n 'mfp_procurement.*.lastval' => [\n 'required',\n ],\n 'mfp_procurement.*.currentqty' => [\n 'required',\n ],\n 'mfp_procurement.*.currentval' => [\n 'required',\n ],$messages\n ]);\n }", "function isValidUpdate($user, $id)\n{\n return isValidInsert($user) && is_numeric($id) && $id > 0;\n}", "public function update($data)\n\t{\n\t\treturn $this->validator->make($data, [\n\t\t\t'address_street' => 'required|max:200',\n\t\t\t'address_country_name' => 'required|max:2',\n\t\t\t'address_state' => 'required|max:200',\n\t\t\t'address_city' => 'required|max:200',\n\t\t\t'address_zip' => 'required|max:20'\n\t\t], [\n\t\t\t'address_street.required' => 'The street address field is required.',\n\t\t\t'address_street.max' => 'The street address field is too long.',\n\t\t\t'address_state.required' => 'The state field is required.',\n\t\t\t'address_state.max' => 'The state field is too long',\n\t\t\t'address_city.required' => 'The city field is required',\n\t\t\t'address_city.max' => 'The city field is too long',\n\t\t\t'address_zip.required' => 'The zip code is required.',\n\t\t\t'address_zip.max' => 'The zip code is too long.'\n\n\t\t]);\n\t}", "function isValidUpdate($product, $id) {\n\treturn isValidInsert($product) && is_numeric($id) && $id > 0;\n}", "public function validateUpdateRequest(Request $request)\n {\n $rules = [\n \n 'title' => 'required',\n 'start_at' => 'required|date|date_format:Y/m/d H:i',\n 'end_at' => 'required|date|date_format:Y/m/d H:i',\n 'committee_id' => 'required|numeric|exists:committees,id',\n 'location_id' => 'required|numeric|exists:locations,id',\n ];\n\n $messages = [\n /*'email.email' => TranslationCode::OFFER_ERROR_EMAIL_INVALID*/\n ];\n \n return Validator::make($request->all(), $rules, $messages);\n }", "public function checkUpdate() {\n $this->log('Checking for a new update. . .');\n\n if( $this->licensekey != null ) {\n $updateFile = $this->updateUrl.'/'.$this->updateIni.'?license-key='.urlencode($this->licensekey).'&domain='.urlencode(site_url()).'&channel='.urlencode($this->updateChannel);\n } else {\n $updateFile = $this->updateUrl.'/'.$this->updateIni;\n }\n\n //$update = @file_get_contents($updateFile);\n $update = $this->_file_get_contents_curl($updateFile);\n if ($update === false) {\n $this->log('Could not retrieve update file `'.$updateFile.'`!');\n return false;\n } else {\n\n if( !function_exists('parse_ini_string') ) {\n $this->log('parse_ini_string is not supported your PHP Version is '.phpversion());\n return false;\n }\n\n $versions = parse_ini_string($update, true);\n if (is_array($versions)) {\n $keyOld = 0;\n $latest = 0;\n $update = '';\n $changelog = null;\n\n foreach ($versions as $key => $version) {\n if ($key > $keyOld) {\n $keyOld = $key;\n $latest = $version['version'];\n $update = $version['url'];\n $changelog = $version['changelog'];\n }\n }\n\n $this->log('New version found `'.$latest.'`.');\n $this->latestVersion = $keyOld;\n $this->latestVersionName = $latest;\n $this->latestUpdate = $update;\n $this->latestChangelog = $changelog;\n\n return $keyOld;\n }\n else {\n $this->log('Unable to parse update file!');\n return false;\n }\n }\n }", "public static function update_validation_rules()\n {\n }", "function validateAndUpdateUser($db, $parsed_id)\n{\n if (!empty($_POST)) {\n\n $validator = new GUMP();\n\n $_POST = $validator->sanitize($_POST);\n\n\n $validator->validation_rules(array(\n 'name' => 'required',\n 'username' => 'required',\n 'email' => 'required',\n 'password' => 'required'\n ));\n\n\n $validator->filter_rules(array(\n 'name' => 'trim',\n 'username' => 'trim',\n 'email' => 'trim'\n ));\n\n\n $validated_data = $validator->run($_POST);\n\n if ($validated_data === false) {\n foreach ($validator->get_errors_array() as $error) {\n echo '<div class=\"alert alert-danger\" role=\"alert\">' . $error . '</div>';\n }\n } else {\n $name = $_POST['name'];\n $username = $_POST['username'];\n $email = $_POST['email'];\n $password = $_POST['password'];\n\n // query\n $sql = \"UPDATE users SET name='$name', username='$username', email='$email', password='$password' WHERE id='$parsed_id'\";\n\n //execute the query\n $db->query($sql);\n Redirect::to('manageusers.php');\n }\n if (empty($error)) {\n // displays a success message\n // echo '<div class=\"alert alert-success\" role=\"alert\">You\\'ve successfully updated a user</div>';\n }\n }\n\n\n }", "public function schemaUpdate ($input)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$schema = (array) self::getScheme ($this::type . '.json')->set->protected;\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tthrow new ValidationException ('Update file not found or malformed');\n\t\t}\n\n\t\t# Evaluate schema\n\t\tforeach ($schema as $key => $func)\n\n\t\t\tif (isset ($input[$key]))\n\n\t\t\t\t$this::$func ($input[$key]);\n\n\t\t# Update - push could be used here in case of relational updates.\n\t\treturn $this->save();\n\t}", "public function update($fields = array(), \\Ice\\Validation $extra = null) {}", "public function validateUpdateOne($id)\n {\n return $this->validateDeactivateOne($id);\n }", "protected function validator_update(array $data)\n {\n\t\tLog::info('Execute Account update validator.');\n return Validator::make($data, [\n 'name' => 'bail|required|string|max:150|unique:accounts,name,'.$data['id'],\n\t\t\t'url' => 'bail|nullable|string|max:150|unique:accounts,url,'.$data['id'],\n\t\t\t'notes' => 'bail|nullable|string|max:1024',\n ]);\n }", "public function check_update() {\n \n // Verify if session exists and if the user is admin\n $this->if_session_exists($this->user_role,1);\n \n $l_version = '';\n \n if ( file_exists('update.json') ) {\n \n $get_last = file_get_contents('update.json');\n $from = json_decode($get_last, true);\n unset($decode);\n $l_version = $from ['version'];\n \n }\n \n // Check if the update file is available\n $update_url = 'https://update.midrub.com/';\n \n $context = stream_context_create(array(\n 'http' => array(\n 'method' => 'GET',\n 'timeout' => 30\n )\n ));\n \n $update_down = @file_get_contents($update_url, 0, $context);\n \n $new_update = '';\n \n if ( $update_down ) {\n \n $from = json_decode($update_down, true);\n \n unset($update_down);\n \n // Check if the last version is equal to the current version\n if ( $from ['version'] != $l_version ) {\n \n // Set update option available. In this way the script will not check if an update available every time when will be loaded a page.\n if ( $this->options->check_enabled('update') == false ) {\n \n $this->options->enable_or_disable_network('update');\n \n }\n \n // Return update information\n return $from;\n \n }\n \n }\n \n return false;\n \n }", "public function validateUpdate ($query)\n {\n $size = $this->cube->getSize();\n if (count($query) != 5) {\n return false;\n } else if (!is_numeric($query[1])) {\n return false;\n } else if (!is_numeric($query[2])) {\n return false;\n } else if (!is_numeric($query[3])) {\n return false;\n } else if (!is_numeric($query[4])) {\n return false;\n } else if ($query[1] > $size || $query[2] > $size || $query[3] > $size) {\n return false;\n } else if ($query[1] < 1 || $query[2] < 1 || $query[3] < 1) {\n return false;\n }\n\n return true;\n }" ]
[ "0.7871093", "0.708606", "0.70094293", "0.6954207", "0.6922312", "0.6899355", "0.68695354", "0.68609464", "0.6697627", "0.656496", "0.6557292", "0.6407085", "0.6376913", "0.63560176", "0.63523287", "0.6342372", "0.63208663", "0.6286709", "0.6272254", "0.6245168", "0.62444687", "0.62301874", "0.6191627", "0.6190641", "0.6181087", "0.6175129", "0.6166227", "0.61627924", "0.614026", "0.6116916" ]
0.73739725
1
name: update_admin_passwd() created by: description: parameters: returns:
function update_admin_passwd(&$d) { global $auth; $db = new ps_DB; $q = "SELECT password from auth_user_md5 "; $q .= "WHERE user_id='" . $auth["user_id"] . "'"; $db->query($q); $db->next_record(); if (md5($d["password_curr"]) != $db->f("password")) { $d["error"] = "The current password entered does not match."; return false; } if ($d["password_1"] != $d["password_2"]) { $d["error"] = "The new passwords entered do not match."; return false; } if ($d["password_1"] == $d["password_2"]) { $d["password_1"] = md5($d["password_1"]); $q = "UPDATE auth_user_md5 "; $q .= "SET password='" . $d["password_1"] . "' "; $q .= "WHERE user_id='" . $auth["user_id"] . "'"; $db->query($q); } return True; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function m_updatePass()\n\t\t{\n\t\t\t$this->obDb->query=\"UPDATE \".CUSTOMERS.\" SET vPassword=PASSWORD('\".$this->libFunc->m_addToDB($this->request['password']).\"')\n\t\t\tWHERE (iCustmerid_PK ='\".$_SESSION['userid'].\"')\";\n\t\t\t$this->obDb->updateQuery();\n\t\t\t$retUrl=$this->libFunc->m_safeUrl(SITE_URL.\"user/index.php?action=user.home&mode=password&msg=1\");\n\t\t\t$this->libFunc->m_mosRedirect($retUrl);\t\n\t\t\texit;\n\t\t}", "public function modifpassword($user,$passwd){\n \n }", "public function updateHtpasswd()\n\t{\n\t\t$text = null;\n\t\tforeach ($this->fetchAll(null, \"users_login\") as $user) {\n\t\t\t$text .= \"{$user->login}:{$user->password}\\n\";\n\t\t}\n\t\t$config = Zend_Registry::get('config');\n\t\tif (@file_put_contents($config->subversion->passwd, $text) === false) {\n\t\t\tthrow new USVN_Exception(T_('Can\\'t create or write on htpasswd file %s.'), $config->subversion->passwd);\n\t\t}\n\t}", "public static function updateAdminPassword()\n {\n if(Data::arrayHasEmptyValue($_POST)){\n return trigger_error(Data::arrayHasEmptyValue($_POST));\n }\n $admin_id = $_SESSION['admin_id'];\n $old_password = $_POST['old_password'];\n $new_password = $_POST['new_password'];\n if(!self::oldPasswordMatch($old_password)){\n return trigger_error('Old password is incorrect');\n }\n $new_password = password_hash($new_password, PASSWORD_DEFAULT);\n $sql = \"UPDATE admin_accounts SET password = '$new_password' WHERE admin_id = '$admin_id'\";\n if(mysqli_query(DB::connect(), $sql)){\n return null;\n } else {\n return trigger_error(mysqli_error(DB::connect()));\n }\n }", "public function changePasswordByAdmin() {\n if ($this->http->method() != 'PUT') {\n $this->json->sendBack([\n 'success' => false,\n 'code' => 403,\n 'message' => 'This api only supports method `PUT`'\n ]);\n return;\n }\n\n $get_data = $this->http->data('GET');\n if ($this->user->isTokenValid($get_data['token'])) {\n \n $this->model->load('account/account');\n $put_data = $this->http->data('PUT');\n $response = $this->model->account->changePasswordByAdmin($put_data);\n\n $this->json->sendBack($response);\n return;\n }\n\n $this->json->sendBack([\n 'success' => false,\n 'code' => 401,\n 'message' => 'Unauthenticated'\n ]);\n }", "public function update_admin_password($adminID, $update_admin_pasword_data)\n\t{\n\t\t$this->db->where('id', $adminID)->update('users_details',$update_admin_pasword_data);\n\t\t\n\t\tif ($this->db->affected_rows()> 0)\n\t\t{\n\t\t\treturn true;\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function changeAdminUser()\n{\n\t// Get the request parameters\n\t$uid = getParam('sauser', 62);\n\t$password = getParam('sapass1', '');\n\t$password_confirm = getParam('sapass2', '');\n\t$email = getParam('saemail', '');\n\n\t// Bail out 1 - passwords don't match\n\tif( $password != $password_confirm ) return;\n\n\t// Bail out 2 - password empty\n\tif( empty($password) ) return;\n\n\t// Get a connection to the main site database\n\t$storage =& ABIStorage::getInstance();\n\t$databases = $storage->get('databases');\n\t$dbkeys = array_keys($databases);\n\t$firstkey = array_shift($dbkeys);\n\t$d = $databases[$firstkey];\n\t$db =& ABIDatabase::getInstance($d['dbtype'], $d['dbhost'], $d['dbuser'], $d['dbpass'],\n\t\t$d['dbname'], $d['prefix']);\n\tunset($d); unset($databases);\n\n\t// Generate encrypted password string\n\t$salt = genRandomPassword(32);\n\t$crypt = md5($password.$salt);\n\t$cryptpass = $crypt.':'.$salt;\n\n\t// Update database\n\t$query = 'UPDATE `#__users` SET `password` = \"'.$db->escape($cryptpass).\n\t\t'\", `email` = \"'.$db->escape($email).'\" WHERE `id` = \"'.$uid.'\"';\n\t$res = $db->query($query);\n\n\treturn $res;\n}", "public function update_passwd($datos) {\n\t\t$result = $this->db->where('id', $datos['id']);\n\t\t$result = $this->db->update('users', $datos);\n\t\treturn $result;\n\t}", "public function changepwAction()\n {\n $dvups_admin = Dvups_admin::find(getadmin()->getId());\n extract($_POST);\n if (sha1($oldpwd) == $dvups_admin->getPassword()) {\n $dvups_admin->__update(\"password\", sha1($newpwd));\n return array('success' => true, // pour le restservice\n 'redirect' => Dvups_admin::classpath() . 'dvups-admin/profile?detail=password updated successfully', // pour le web service\n 'detail' => '');\n } else {\n return array('success' => false, // pour le restservice\n 'detail' => 'mot de passe incorrect');\n }\n }", "function updateUserPassword() {\n $curentPassword = $_POST['currentPassword'];\n $newPassword = $_POST['newPassword'];\n }", "public function changePassword($isAdmin = false){\n\t\t\n\t\t/* \n\t\t\tAdmin Old Passwork Form\n\t\t*/\t\n\t\t\n\t\t$functionName=\"match_old_password_front\";\n\t\t\n\t\tif($isAdmin){\n\t\t\t$functionName=\"match_old_password\";\n\t\t}\n\t\n\t\t\n \t\t$this->addElement('password', 'user_old_password', array(\n \t\t\t\"class\" => \"form-control required \",\n\t\t\t\"required\" => true,\n\t\t\t\"label\"=>\"Enter Old Password\",\n \t\t\t\"placeholder\" => \"Old Password\",\n\t\t\t\"ignore\"=>true,\n \t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true, array(\"messages\"=>\" Old Password is required \")),\n\t\t\t\t\t\t\t\tarray(\"StringLength\" , true,array('min' => 6, 'max' => 16, 'messages'=>\"Password must between 6 to 16 characters \")),\n\t\t\t\t\t\t\t\tarray(\"Callback\" , true, array($functionName,'messages'=>\"Old Password Mismatch,\")),\n\t\t\t\t\t\t\t),\n\t\t\t));\n\t\t\t\n\t\t\t$this->resetPassword($isAdmin);\n\t\t\t\tif(!$isAdmin){\n\t\t\t\t\t$this->submit->setAttrib(\"class\",\"btn site_button pull-right\");\n\t\t\t\t}\n \n\t}", "function updat_passwd($data,$user_id)\n\t \t\t{\t$this->db->where('user_id',$user_id);\n\t\t\t\t\t$result = $this->db->update('tbl_user',$data);\n\t\t\t \treturn $result;\n\t \t\t}", "public function update_password() {\n $this->authenticate->check_staff();\n $data['title'] = translate('update_password');\n $this->load->view('staff/update_password', $data);\n }", "function editUserPassword ($user, $updatedUserPassword) {\n\t\n\t$db = $_SESSION['db'];\n\t\n\t$updatedUserDetails = encryptPassword($updatedUserPassword);\n\t$sql = \"UPDATE Users SET password='{$updatedUserDetails}' WHERE userName='{$user}'\";\n\t\n\tif (mysqli_query($db, $sql)){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\t \n }", "function editUserPass($user, $pass){\n global $conn;\n\n $user = strip_tags($user);\n $pass = strip_tags($pass);\n\n $query = \"UPDATE e_store.users\n SET password = :pass\n WHERE username = :user\";\n\n\t $stmt = $conn->prepare ($query);\n $stmt->execute( array('user' => $user,\n 'pass' => $pass) );\n }", "public function alter_admin(){\r\n\t\t$id = $this->id;\r\n\t\t$connect = true;\r\n\t\tinclude \"main.php\";\r\n\t\t\r\n\t\t//obsfucate the password if it is not the same as the one already in the database.\r\n\t\t$connection->num_rows(\"SELECT * FROM $this->tbl_name WHERE (id='$this->posn') AND (paski='$this->passw4d') AND (a_idnum='$this->idnum')\",true);\r\n\t\t$ispass = $_SESSION['num_rows'];\r\n\t\t\r\n\t\t//If the password passed is the same as that in the db\r\n\t\tif($ispass == 1):\r\n\t\t\r\n\t\t\t//$sql = \"UPDATE `connect_db`.`admin` SET `name` = \\'Ladies Dorm\\', `a_idnum` = \\'awooms0010\\', `email` = \\'[email protected]\\' WHERE `admin`.`id` = 2;\";\r\n\t\t\t$connection->query(\"UPDATE $this->tbl_name SET name='$this->nom' , email='$this->email' , a_idnum='$this->idnum' WHERE id='$this->posn';\",true);\r\n\t\t\t\r\n\t\t\tif($_SESSION['query']){\r\n\t\t\t\t\r\n\t\t\t\techo '<script>alert(\"Your details/credentials have been altered\"); history.back();</script>';\t\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t//Tell the user that their request was not so successful and don't forgegt NOT to leave them hanging!!\r\n\t\t\t\t\r\n\t\t\t\techo '<script>alert(\"SORRY!\\n\\n There was an error while changing your details. \\n\\n Please try again!\"); history.back();</script>';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\telse:\r\n\t\t\r\n\t\t$connection->num_rows(\"SELECT * FROM $this->tbl_name WHERE (paski='$this->passw4d') AND (id='$this->posn')\",true);\r\n\t\t$keepass = $_SESSION['num_rows'];\r\n\t\t\r\n\t\t//Update the database password (where necessary) along with other details\r\n\t\tif($keepass == 1){\r\n\t\t\t$make_pass = $this->passw4d;\r\n\t\t}else{\r\n\t\t\t$make_pass = new obsfucate($this->passw4d, \"make_password\");\r\n\t\t}\r\n\t\t\t$connection->query(\"UPDATE $this->tbl_name SET name='$this->nom', paski='$_SESSION[passwd]', email='$this->email', a_idnum='$this->idnum' WHERE id='$this->posn'\",true);\r\n\t\t\t\r\n\t\t\tif($_SESSION['query']){\r\n\t\t\t\t\r\n\t\t\t\t//update user credentials\r\n\t\t\t\tif($this->posn == $_SESSION['u56_id']){\t\t\t\t\r\n\t\t\t\t\techo '<script>\r\n\t\t\t\t\t\t\talert(\"Your details/credentials have been altered\"); window.location=\"proc_adds.php?act=logout&to=c_login.php\";\t\t\t \t </script>';\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo '<script>\r\n\t\t\t\t\t\t\talert(\"Your details/credentials have been altered\"); history.back();\r\n\t\t\t\t\t\t </script>';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t//Tell the user that their request was not so successful and don't forgegt NOT to leave them hanging!!\r\n\t\t\t\t\r\n\t\t\t\techo '<script>alert(\"SORRY!\\n\\n There was an error while changing your details. \\n\\n Please try again!\"); history.back();</script>';\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\tendif;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public function update_admin() {\n\t\t$a = $this->input->post('id_admin');\n\t\t$b = $this->input->post('username');\n\t\t$d = $this->input->post('password');\n\t\t$e = $this->input->post('status');\n\n\t\t$arr = array(\n\t\t\t\t'id_admin' => $a,\n\t\t\t\t'username' => $b,\n\t\t\t\t'password' => $d,\n\t\t\t\t'status' => $e\n\t\t\t\t\n\t\t\t);\n\t\t$this->db->where('id_admin', $a);\n\t\treturn $this->db->update('tb_admin', $arr);\n\t}", "function update_pw($mailaddress, $plain_pw){\r\n $pw_md5 = md5($plain_pw);\r\n $link=open_db();\r\n $sql=\"UPDATE Yane SET md5_password = '$pw_md5' WHERE CONVERT( email_address USING utf8 ) = '$mailaddress'\";\r\n mysql_query($sql) OR die(\"Couldn't update password. Error: \" . mysql_error());\r\n mysql_close($link);\r\n }", "function adminAccount()\r\n{\r\n\t$errorMessage = '';\r\n\t\r\n\t$id \t\t= $_POST['id'];\r\n\t$username \t\t= $_POST['username'];\r\n\t@$password \t\t= $_POST['password'];\r\n\t@$oldpassword \t= $_POST['oldpassword'];\r\n\t@$newpassword = $_POST['newpassword'];\r\n\t@$cnewpassword = $_POST['cnewpassword'];\r\n\t$secid \t\t= $_POST['secid'];\r\n\t\r\n\tif ($secid == 1){\r\n\t\t// first, make sure the fieldname are not empty\r\n\t\tif ($newpassword == '') {\r\n\t\t\t$errorMessage = 'You must enter the new password';\r\n\t\t} else if ($cnewpassword == '') {\r\n\t\t\t$errorMessage = 'You must enter the confirm new password';\r\n\t\t} else if ($newpassword != $cnewpassword){\r\n\t\t\t$errorMessage = 'The new and confirm password are not tally';\r\n\t\t}else {\t\t\t\r\n\t\t\t\t$sql = \"UPDATE security_users\r\n\t\t\t\t\t\tSET password = '$newpassword' \r\n\t\t\t\t\t\tWHERE id = '$id'\";\r\n\t\t\t\t\t\tdbQuery($sql);\r\n\t\t\t\t\r\n\t\t\t\t$errorMessage = 'The admin password was successfully updated';\r\n\t\t}\t\t\r\n\t} else {\r\n\t\tif ($password == '') {\r\n\t\t\t$errorMessage = 'You must enter the password';\r\n\t\t} else if ($newpassword == '') {\r\n\t\t\t$errorMessage = 'You must enter the new password';\r\n\t\t} else if ($cnewpassword == '') {\r\n\t\t\t$errorMessage = 'You must enter the confirm new password';\r\n\t\t} else if ($password != $oldpassword){\r\n\t\t\t$errorMessage = 'The password is not correct';\r\n\t\t} else if ($newpassword != $cnewpassword){\r\n\t\t\t$errorMessage = 'The new and confirm password are not tally';\r\n\t\t}else {\t\t\t\r\n\t\t\t\t$sql = \"UPDATE security_users\r\n\t\t\t\t\t\tSET password = '$newpassword' \r\n\t\t\t\t\t\tWHERE id = '$id'\";\r\n\t\t\t\t\t\tdbQuery($sql);\r\n\t\t\t\t\r\n\t\t\t\t$errorMessage = 'The admin password was successfully updated';\r\n\t\t}\t\t\r\n\t}\t\r\n\t\treturn $errorMessage;\r\n}", "public function testUpdatePasswordShort($auth)\n {\n $this->actingAs($auth)\n ->visit('account/settings')\n ->type('timberlake', 'current_password')\n ->type('ee', 'password')\n ->type('ee', 'password_confirmation')\n ->see('characters');\n\n }", "function modify_password( $str_user_id, $str_password )\n\t{\n\t\t$str_sql_query = null;\n\t\t$res_check_if_exists = null;\n\t\t$str_this_user = $this->m_obj_user->str_username;\n\t\t$bln_success = true;\n\t \n\t\tswitch ( $this->m_obj_user->int_privilege )\n\t\t{\t\t\t\t \n\t\t\tcase UP_TA:\n\t\t\tcase UP_PROFESSOR:\n\t\t\tcase UP_ADMINISTRATOR:\n\t\t\t{\n\t\t\t\t$str_sql_query = \"BEGIN\";\n\n\t\t\t\tif ( !$this->m_obj_db->query_commit( $str_sql_query ) )\n\t\t\t\t{\n\t\t\t\t\t$bln_success = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$res_check_if_exists = $this->view_user( $str_user_id );\n\n\t\t\t\tif ( $res_check_if_exists == null )\n\t\t\t\t{\n\t\t\t\t\t$str_sql_query = null;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( $res_check_if_exists == false )\n\t\t\t\t{\n\t\t\t\t\t$bln_success = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->m_obj_db->get_number_of_rows( $res_check_if_exists ) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$str_sql_query = \"UPDATE User \"\n\t\t\t\t\t\t\t\t . \"SET Pwd = Password('\" . $this->m_obj_db->format_sql_string( $str_password ) . \"') \"\n\t\t\t\t\t\t\t\t . \"WHERE UserId = '\" . $this->m_obj_db->format_sql_string( $str_user_id ) . \"'\";\n\n\t\t\t\t\tif ( !$this->m_obj_db->query_commit( $str_sql_query ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bln_success = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$str_sql_query = \"COMMIT\";\n\n\t\t\t\t\tif ( !$this->m_obj_db->query_commit( $str_sql_query ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bln_success = false;\n\t\t\t\t\t\tbreak;\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$str_sql_query = \"ROLLBACK\";\n\n\t\t\t\t\tif ( !$this->m_obj_db->query_commit( $str_sql_query ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$bln_success = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tLog::write_log_with_ip( LOG_TRANSACTION, $str_this_user . \" does not have permission to modify \" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . \"'s password\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . \" or user \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t . \" does not exist\" );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( $str_this_user == null )\n\t\t{\n\t\t\t$str_this_user = \"<user did not login>\";\n\t\t}\n\n\t\tif ( $str_sql_query == null )\n\t\t{\n\t\t\t$this->m_obj_db->query_commit( \"ROLLBACK\" );\n\t\t\tLog::write_log_with_ip( LOG_TRANSACTION, $str_this_user . \" attempted to modify password of \" \n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) );\n\t\t\treturn false;\n\t\t}\n \n\t\tif ( !$bln_success )\n\t\t{\n\t\t\t$this->m_obj_db->query_commit( \"ROLLBACK\" );\n\t\t\tLog::write_log_with_ip( LOG_TRANSACTION, $str_this_user . \" failed to modify password of \" \n\t\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) \n\t\t\t\t\t\t\t\t\t\t\t\t . \" due to database error\" );\n\t\t\treturn false;\n\t\t}\n\n\t\tLog::write_log_with_ip( LOG_TRANSACTION, $str_this_user . \" modified password of \" \n\t\t\t\t\t\t\t\t\t\t\t . $this->m_obj_db->format_sql_string( $str_user_id ) );\n\t\treturn true;\n\t}", "function changePassword()\n\t{\n\t\tglobal $objSmarty;\n\t\tif($this->chkPassword($_REQUEST['txtCurPwd'], $_SESSION['admin_id']))\n\t\t{\n\t\t\t$UpQuery = \"UPDATE `admin` SET `Password` = '\".addslashes($_REQUEST['txtNewPwd']).\"'\" \n\t\t\t\t\t\t.\" WHERE `Ident` = \". $_SESSION['admin_id'];\n\t\t\t$UpResult\t= $this->ExecuteQuery($UpQuery, \"update\");\n\t\t\t$objSmarty->assign(\"SuccessMessage\", \"Password has been updated successfully\");\n\t\t\t$objSmarty->assign(\"ErrorMessage\", \"\");\n\t\t\t$select_password =\"SELECT * FROM `admin`\";\n\t\t\t$result =$this->ExecuteQuery($select_password,\"select\");\n\t\t\t$objSmarty->assign(\"current_password\",$result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$objSmarty->assign(\"ErrorMessage\", \"Invalid current password\");\n\t\t}\n\t}", "FUNCTION AdminUsers_update_Password( &$dbh,\n\t\t\t\t\t $userid,\n\t\t\t\t\t $password )\n\t{\n\t\tif ( $password == \"\" )\n\t\t{\n\t\t\treturn false ;\n\t\t}\n\t\t$userid = database_mysql_quote( $userid ) ;\n\t\t$password = md5( database_mysql_quote( $password ) ) ;\n\n\t\t$query = \"UPDATE chat_admin SET password = '$password' WHERE userID = $userid\" ;\n\t\tdatabase_mysql_query( $dbh, $query ) ;\n\t\t\n\t\tif ( $dbh[ 'ok' ] )\n\t\t{\n\t\t\treturn true ;\n\t\t}\n\t\treturn false ;\n\t}", "public function setAdminPassword($value)\n {\n return $this->setParameter('adminPassword', $value);\n }", "public function testUpdatePassword($auth)\n {\n $this->actingAs($auth)\n ->visit('account/settings')\n ->type('timberlake', 'current_password')\n ->type('timberlake', 'password')\n ->type('timberlake', 'password_confirmation')\n ->press('save-password')\n ->see('successfully');\n\n }", "function edit_password($username, $password, $password_confirm, $mysql) {\n\tif($password == $password_confirm){\n\t\t$b64_name = base64_encode($username);\n\t\t//$table = $myprefix.\"users\";\n\t\t$password = sha1($password);\n\t\t$crypt = new secure_core();\n\t\t$password = $crypt->secureHash($password);\n\t\tif($mysql->exec(\"UPDATE \".$GLOBALS['my_prefix'].\"users SET password='\".$password.\"' WHERE username='\".$b64_name.\"' \")){\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n\telse{\n\treturn false;\n\t}\n}", "public function updatepasswordadminversion(){\r\n if (isset($_POST[\"updateusermdp\"])) {\r\n //mise a jour dans la base du nouveau mot de passe\r\n $rep = $this->_bdd->query(\"UPDATE `User` SET `mdp`='\".$_POST['NEWMDP'].\"' WHERE `id`='\".$_POST['id'].\"' \");\r\n if($rep){\r\n //succées\r\n ?>\r\n <p>Le mot de passe de l'utilisateur a été changé.</p>\r\n <?php\r\n }else{\r\n //erreur a l'update dans la base\r\n ?>\r\n <p>Une erreur est survenue.</p>\r\n <?php\r\n }\r\n }\r\n }", "function SetUserPassword($address, $body) {\n $list = null; // array for messages list\n $get = $this->GetText('GET',true);\n $mailsubject = $this->GetText('NOTIFY SUBJECT', true).\" $this->listAddress\";\n $mailbody = $this->GetText('GENERIC ERROR',true);\n\n $cmd = trim(strtok($body,\" \\r\\n\\t\"));\n $newpw = trim(strtok(' '));\n $oldpw = trim(strtok(\" \\r\\n\\t\"));\n $query = \"select *,password('$oldpw') as oldpw from \".$this->subscribers.\" where emailaddress = '$address'\";\n $result = @mysql_query($query,$this->dbconn);\n if(!$row = @mysql_fetch_object($result)) {\n $row->webpass = null;\n }\n $pwmatch = strcmp($row->webpass,$row->oldpw);\n if($pwmatch == 0) { // match with old password\n if($row->webpass === null) {\n $query = 'insert into '.$this->subscribers.\n \" (id,emailaddress,state,webpass,rowlock) values (0,'$address','enabled',password('\".$newpw.\"'),'')\";\n } else {\n $query = 'update '.$this->subscribers.\" set webpass = password('$newpw') where emailaddress = '$address'\";\n }\n if(!$this->debug) {\n $result = @mysql_query($query,$this->dbconn);\n } else {\n $result = true;\n }\n if($result) {\n $mailbody = $this->GetText('USERPASS CHANGED',true).\"\\n$newpw\";\n }\n echo \"changed password for [$address]; \";\n } else {\n $mailbody = $this->GetText('USERPASS WRONG',true);\n echo \"wrong password for [$address] changing request; \";\n }\n @mysql_free_result($result);\n $this->NotifyUser($address,false,$mailsubject,$mailbody);\n }", "public function changepw() {\n $this->assign(\"userid\", $_SESSION[\"userid\"]);\n $this->display('equipment/changepw');\n }", "public function dashBoard1PasswordUpdate($pw_update_data, $bn_id)\r\n {\r\n $result = array();\r\n $result['status'] = CommonDefinition::SUCCESS_CHECK_FIELD;\r\n $result['info'] = \"\";\r\n\r\n // check user password data\r\n $sysUtil = new SysUtility();\r\n\r\n if (! $sysUtil->checkFormField($pw_update_data->pu_old_password, CommonDefinition::REG_PASSWORD_ID)) {\r\n $result['info'] .= \" OLD_PW \";\r\n }\r\n\r\n if (! $sysUtil->checkFormField($pw_update_data->pu_new_password, CommonDefinition::REG_PASSWORD_ID)) {\r\n $result['info'] .= \" NEW_PW \";\r\n }\r\n\r\n if (! $sysUtil->checkFormField($pw_update_data->pu_cfm_new_password, CommonDefinition::REG_PASSWORD_ID)) {\r\n $result['info'] .= \" CFM_PW \";\r\n }\r\n\r\n if (! empty($result['info'])) {\r\n // Check input data failed, return with error\r\n $result['status'] = CommonDefinition::ERROR_CHECK_FIELD;\r\n return ($result); // Return due to field check error\r\n }\r\n\r\n if (CommonDefinition::SUCCESS != strcmp($pw_update_data->pu_new_password, $pw_update_data->pu_cfm_new_password)) {\r\n // new password and confirmed password compare fail\r\n // Check input data failed, return with error\r\n $result['status'] = CommonDefinition::ERROR_COMPARE_FIELD;\r\n $result['info'] = \"ERROR:: New password input doesn't match!!!\";\r\n return ($result); // Return due to field check error\r\n }\r\n\r\n // Start to process the password update\r\n $result['status'] = CommonDefinition::ERROR_CONN;\r\n $result['info'] = \"Failed to connect to Server!\";\r\n\r\n $dbModel = new BusinessModel(SysDefinition::USER_DB_CONFIG);\r\n\r\n // Connect to Database\r\n $db_bn_conn = $dbModel->connect();\r\n\r\n if (! $db_bn_conn) {\r\n return ($result);\r\n ; // Connect to DB failed return without further handling\r\n }\r\n\r\n // Get the original user information\r\n // get the user info table name by user ID\r\n $bnInfoTblName = $sysUtil->genDashboard1AcntTblName();\r\n $dbModel->setTableName($bnInfoTblName);\r\n\r\n $queryResult = $dbModel->getAcntPasswordById($bn_id);\r\n\r\n if (! is_bool($queryResult)) {\r\n // Compare the exist password with input old password\r\n $md5PwCode = md5($pw_update_data->pu_old_password);\r\n\r\n if (CommonDefinition::SUCCESS != strcmp($md5PwCode, $queryResult->getPassword())) {\r\n // Password doesn't match\r\n $result['status'] = CommonDefinition::ERROR_COMPARE_FIELD;\r\n $result['info'] = \"ERROR: Enter wrong old password!\";\r\n } else {\r\n $md5PwCode = md5($pw_update_data->pu_new_password);\r\n $queryResult->setPassword($md5PwCode);\r\n\r\n if ($dbModel->updateAccountPasswordById($queryResult, $bn_id)) {\r\n $result['status'] = CommonDefinition::SUCCESS;\r\n $result['info'] = \"Success to update my Password!\";\r\n } else {\r\n $result['info'] = \"Failed to Update info!\";\r\n }\r\n }\r\n }\r\n\r\n $dbModel->close();\r\n return ($result);\r\n }" ]
[ "0.71489316", "0.7089906", "0.7033231", "0.69393235", "0.6911033", "0.68291533", "0.67813647", "0.6706544", "0.6677835", "0.65728396", "0.6551729", "0.6480415", "0.6442526", "0.6419746", "0.6405583", "0.63850266", "0.63675773", "0.6365532", "0.63555765", "0.63515717", "0.6343673", "0.63379776", "0.63191193", "0.62777114", "0.62572664", "0.6247809", "0.6240588", "0.6224301", "0.62239885", "0.6200386" ]
0.78457713
0
name: list_perms() created by: pablo description: lists the permission in a select box parameters: returns:
function list_perms($name,$group_name) { global $perm; global $auth; $db = new ps_DB; // Get users current permission value $dvalue = $perm->permissions[$auth["perms"]]; echo "<SELECT NAME=$name>\n"; echo "<OPTION VALUE=\"0\">Please Select</OPTION>\n"; while (list($key,$value) = each($perm->permissions)) { // Display only those permission that this user can set if ($value <= $dvalue) if ($key == $group_name) { echo "<OPTION VALUE=$key SELECTED>$key</OPTION>\n"; } else { echo "<OPTION VALUE=$key>$key</OPTION>\n"; } } echo "</SELECT>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function list_permissions(){\n $auth = Yii::$app->authManager;\n\n return ['list' => $auth->getPermissions()];\n }", "public function permission_list() {\n\t\t$sql = $this->db->query(\"SELECT * FROM `permissions` ORDER BY `group_id`\");\n\t\twhile($permission = $sql->result()) {\n\t\t?>\n <div class=\"checkbox\">\n <label>\n <input type=\"checkbox\" name=\"permission[]\" value=\"<?php print $permission['ID']; ?>\"><?php print $permission['permName']; ?>\n </label>\n </div>\n <?php\n\t\t}\n\t}", "public function actionAdminPermissionsList(){\n if ($this->isGuest){ header('HTTP/1.0 403 Forbidden'); exit(); }\n $error = Null;\n $model = new PermissionsItems($this->adapter);\n $allpermissions = $model->getAll();\n\t\t$this->render(\"admin_permissions_list\", [\n\t\t\t\"title\" => \"Permisos\",\n\t\t\t\"subtitle\" => \"Master\",\n\t\t\t\"allpermissions\" => $allpermissions,\n\t\t]);\n\t}", "public function actionListpermissions(){\n $Auth = new $this->modelClass;\n $request = Yii::$app->getRequest();\n $rolename = $request->getQueryParam('rolename', false);\n\n // if($rolename){\n $permission = $Auth->getPermissionsByRole($rolename);\n // }else{\n // $permission = $Auth->getPermissions();\n // }\n // var_dump($permission);exit();\n $list = [];\n foreach ($this->_listPermissions() as $key => $value) {\n $list[$key] = $value;\n if(in_array($value['name'], $this->authname_extra)){\n // $this->validAddChild($role, $rows['name'], $rows['description']);\n $list[$key]['read'] = isset($permission[$value['name']]) ? true : false;\n }else{\n $list[$key]['read'] = isset($permission[$value['name'] . '_view']) ? true : false;\n $list[$key]['create'] = isset($permission[$value['name'] . '_create']) ? true : false;\n $list[$key]['update'] = isset($permission[$value['name'] . '_update']) ? true : false;\n $list[$key]['delete'] = isset($permission[$value['name'] . '_delete']) ? true : false;\n }\n \n\n }\n return $list;\n }", "public function perms();", "public function listPermissions()\n {\n try {\n return view('admin.permission.list');\n } catch (\\Exception $e) {\n \\Log::error(array('user_id' => Auth::guard('admin')->user()->id, 'msg' => \"Failed to list permissions.\", \"error\" => $e->getMessage()));\n }\n }", "public function listPermissionGroups();", "public function & GetPermissions();", "public function allPermissions();", "function list_permsn($a=false)\n\t{\n\t\t//print_r($a);die;\n\t\t$this->db->distinct();\n\t\t$this->db->select('role_id');\n\t\t$this->db->where('role_id !=' ,'Administrator');\n\t\t$qry=$this->db->get('ssr_t_role_permission');\n\t\t return $qry->result(); \n\t}", "public static function getPermissions() {\n\t\t$permissions = array(\n\t\t\t'users' => array(\n\t\t\t\t'admin.users.index' => trans('permissions/general.users_list'),\n\t\t\t\t'admin.users.edit' => trans('permissions/general.users_edit'),\n\t\t\t\t'admin.users.create' => trans('permissions/general.users_create'),\n\t\t\t\t'delete.user' => trans('permissions/general.users_delate'),\n\t\t\t),\n\t\t\t'groups' => array(\n\t\t\t\t'groups' => trans('permissions/general.group_list'),\n\t\t\t\t'edit.group' => trans('permissions/general.group_edit'),\n\t\t\t\t'create.group' => trans('permissions/general.group_create'),\n\t\t\t\t'delete.group' => trans('permissions/general.group_delate'),\n\t\t\t),\n\t\t\t'blocks' => array(\n\t\t\t\t'blocks' => trans('permissions/general.blocks_list'),\n\t\t\t\t'edit.block' => trans('permissions/general.block_edit'),\n\t\t\t\t'create.block' => trans('permissions/general.block_create'),\n\t\t\t\t'delete.block' => trans('permissions/general.block_delate'),\n\t\t\t),\n\t\t\t'pages' => array(\n\t\t\t\t'pages' => trans('permissions/general.pages_list'),\n\t\t\t\t'edit.page' => trans('permissions/general.page_edit'),\n\t\t\t\t'create.page' => trans('permissions/general.page_create'),\n\t\t\t\t'delete.page' => trans('permissions/general.page_delate'),\n\t\t\t),\n 'menu' => array(\n\t\t\t\t'menu' => trans('permissions/general.menu_list'),\n\t\t\t\t'menu.data.quickrename' => trans('permissions/general.menu_edit'),\n\t\t\t\t'menu.data.quickcreate' => trans('permissions/general.menu_create'),\n\t\t\t\t'menu.data.quickremove' => trans('permissions/general.menu_delate'),\n\t\t\t\t'menu.data.move' => trans('permissions/general.menu_move'),\n\t\t\t),\n\t\t\t'classifiedschema' => array(\n\t\t\t\t'classifiedschema' => trans('permissions/general.classifiedschema_list'),\n\t\t\t\t'classifiedschema.data.quickrename' => trans('permissions/general.classifiedschema_edit'),\n\t\t\t\t'classifiedschema.data.quickcreate' => trans('permissions/general.classifiedschema_create'),\n\t\t\t\t'classifiedschema.data.quickremove' => trans('permissions/general.classifiedschema_delate'),\n\t\t\t\t'classifiedschema.data.move' => trans('permissions/general.classifiedschema_move'),\n\t\t\t),\n\t\t\t'classifiedcategories' => array(\n\t\t\t\t'classifiedcategories' => trans('permissions/general.classifiedcategories_list'),\n\t\t\t\t'update.classifiedcategories' => trans('permissions/general.classifiedcategories_edit'),\n\t\t\t\t'create.classifiedcategories' => trans('permissions/general.classifiedcategories_create'),\n\t\t\t\t'delete.classifiedcategories' => trans('permissions/general.classifiedcategories_delate'),\n\t\t\t\t'classifiedcategories.data.move' => trans('permissions/general.classifiedcategories_move'),\n 'classifiedcategories.recreate' => trans('permissions/general.recreateclassifiedcategories'),\n\t\t\t),\n\t\t\t'classifieds' => array(\n\t\t\t\t'classifieds' => trans('permissions/general.classifieds_list'),\n\t\t\t\t'update.classified' => trans('permissions/general.classifieds_edit'),\n\t\t\t\t'create.classified' => trans('permissions/general.classifieds_create'),\n\t\t\t\t'delete.classified' => trans('permissions/general.classifieds_delate'),\n\t\t\t),\n\t\t\t'nearmecategory' => array(\n\t\t\t\t'nearmecategories' => trans('permissions/general.nearmecategory_list'),\n\t\t\t\t'update.nearmecategory' => trans('permissions/general.nearmecategory_edit'),\n\t\t\t\t'create.nearmecategory' => trans('permissions/general.nearmecategory_create'),\n\t\t\t\t'delete.nearmecategory' => trans('permissions/general.nearmecategory_delate'),\n\t\t\t),\n\t\t\t'nearmeitemscategory' => array(\n\t\t\t\t'nearmeitemscategory' => trans('permissions/general.nearmeitemscategory_list'),\n\t\t\t\t'update.nearmeitemscategory' => trans('permissions/general.nearmeitemscategory_edit'),\n\t\t\t\t'create.nearmeitemscategory' => trans('permissions/general.nearmeitemscategory_create'),\n\t\t\t\t'delete.nearmeitemscategory' => trans('permissions/general.nearmeitemscategory_delate'),\n\t\t\t),\n 'nearme' => array(\n\t\t\t\t'nearmes' => trans('permissions/general.nearme_list'),\n\t\t\t\t'update.nearme' => trans('permissions/general.nearme_edit'),\n\t\t\t\t'create.nearme' => trans('permissions/general.nearme_create'),\n\t\t\t\t'delete.nearme' => trans('permissions/general.nearme_delate'),\n\t\t\t),\n\t\t\t'ads' => array(\n\t\t\t\t'ads' => trans('permissions/general.ads_list'),\n\t\t\t\t'update.ads' => trans('permissions/general.ads_edit'),\n\t\t\t\t'create.ads' => trans('permissions/general.ads_create'),\n\t\t\t\t'delete.ads' => trans('permissions/general.ads_delate'),\n\t\t\t),\n\t\t\t'adscompanies' => array(\n\t\t\t\t'adscompanies' => trans('permissions/general.adscompanies_list'),\n\t\t\t\t'update.adscompanies' => trans('permissions/general.adscompanies_edit'),\n\t\t\t\t'create.adscompanies' => trans('permissions/general.adscompanies_create'),\n\t\t\t\t'delete.adscompanies' => trans('permissions/general.adscompanies_delate'),\n\t\t\t),\n\t\t\t'adspositions' => array(\n\t\t\t\t'adspositions' => trans('permissions/general.adspositions_list'),\n\t\t\t\t'update.adspositions' => trans('permissions/general.adspositions_edit'),\n\t\t\t\t'create.adspositions' => trans('permissions/general.adspositions_create'),\n\t\t\t\t'delete.adspositions' => trans('permissions/general.adspositions_delate'),\n\t\t\t),\n\t\t\t'blogcategory' => array(\n\t\t\t\t'blogcategories' => trans('permissions/general.blogcategories_list'),\n\t\t\t\t'update.blogcategory' => trans('permissions/general.blogcategory_edit'),\n\t\t\t\t'create.blogcategory' => trans('permissions/general.blogcategory_create'),\n\t\t\t\t'delete.blogcategory' => trans('permissions/general.blogcategory_delate'),\n\t\t\t),\n\t\t\t'blog' => array(\n\t\t\t\t'blogs' => trans('permissions/general.blogs_list'),\n\t\t\t\t'update.blog' => trans('permissions/general.blog_edit'),\n\t\t\t\t'create.blog' => trans('permissions/general.blog_create'),\n\t\t\t\t'delete.blog' => trans('permissions/general.blog_delate'),\n\t\t\t),\n 'reporteditems' => array(\n\t\t\t\t'reporteditems' => trans('permissions/general.reporteditems_list'),\n\t\t\t\t'update.reporteditems' => trans('permissions/general.reporteditems_edit'),\n\t\t\t),\n 'issues' => array(\n\t\t\t\t'issues' => trans('permissions/general.issues_list'),\n\t\t\t\t'update.issues' => trans('permissions/general.issues_edit'),\n\t\t\t),\n 'plans' => array(\n\t\t\t\t'plans' => trans('permissions/general.plans_list'),\n\t\t\t\t'update.plan' => trans('permissions/general.plan_edit'),\n\t\t\t\t'create.plan' => trans('permissions/general.plan_create'),\n\t\t\t\t'delete.plan' => trans('permissions/general.plan_delate'),\n\t\t\t),\n 'payments' => array(\n\t\t\t\t'payments' => trans('permissions/general.payments_list'),\n\t\t\t),\n 'settings' => array(\n\t\t\t\t'settings' => trans('permissions/general.settings_list'),\n 'update.settings' => trans('permissions/general.settings_edit'),\n\t\t\t),\n 'coupons' => array(\n 'coupons' => trans('permissions/general.coupons_list'),\n\t\t\t\t'update.coupons' => trans('permissions/general.coupons_edit'),\n\t\t\t\t'create.coupons' => trans('permissions/general.coupons_create'),\n\t\t\t\t'delete.coupons' => trans('permissions/general.coupons_delate'),\n ),\n 'claim' => array(\n 'claim' => trans('permissions/general.claim_claim'),\n 'unclaim' => trans('permissions/general.claim_unclaim'),\n 'claim.sales' => trans('permissions/general.claim_sales'),\n 'claim.approve' => trans('permissions/general.claim_approve'),\n 'claim.unapprove' => trans('permissions/general.claim_unapprove'),\n ),\n 'sales' => array(\n 'sales.sales' => trans('permissions/general.sales'),\n 'sales.approve' => trans('permissions/general.sales_approve'),\n ),\n\t\t);\n\t\t\n\t\treturn $permissions;\n }", "public function getPermissions();", "public function getPermissions();", "public function getPermissions();", "public function getPermissions();", "public function getPermissions();", "abstract protected function getPermissions();", "function user_admin_perm($form_state, $rid = NULL) {\n if (is_numeric($rid)) {\n $result = db_query('SELECT r.rid, p.perm FROM {role} r LEFT JOIN {permission} p ON r.rid = p.rid WHERE r.rid = %d', $rid);\n }\n else {\n $result = db_query('SELECT r.rid, p.perm FROM {role} r LEFT JOIN {permission} p ON r.rid = p.rid ORDER BY name');\n }\n\n // Compile role array:\n // Add a comma at the end so when searching for a permission, we can\n // always search for \"$perm,\" to make sure we do not confuse\n // permissions that are substrings of each other.\n while ($role = db_fetch_object($result)) {\n $role_permissions[$role->rid] = $role->perm .',';\n }\n\n // Retrieve role names for columns.\n $role_names = user_roles();\n if (is_numeric($rid)) {\n $role_names = array($rid => $role_names[$rid]);\n }\n\n // Render role/permission overview:\n $options = array();\n foreach (module_list(FALSE, FALSE, TRUE) as $module) {\n if ($permissions = module_invoke($module, 'perm')) {\n $form['permission'][] = array(\n '#value' => $module,\n );\n asort($permissions);\n foreach ($permissions as $perm) {\n $options[$perm] = '';\n $form['permission'][$perm] = array('#value' => t($perm));\n foreach ($role_names as $rid => $name) {\n // Builds arrays for checked boxes for each role\n if (strpos($role_permissions[$rid], $perm .',') !== FALSE) {\n $status[$rid][] = $perm;\n }\n }\n }\n }\n }\n\n // Have to build checkboxes here after checkbox arrays are built\n foreach ($role_names as $rid => $name) {\n $form['checkboxes'][$rid] = array('#type' => 'checkboxes', '#options' => $options, '#default_value' => isset($status[$rid]) ? $status[$rid] : array());\n $form['role_names'][$rid] = array('#value' => $name, '#tree' => TRUE);\n }\n $form['submit'] = array('#type' => 'submit', '#value' => t('Save permissions'));\n\n return $form;\n}", "public function getPerms(){\n $roles = Auth::user()->roles;\n $perms = [];\n foreach ($roles as $role)\n foreach ($role->perms as $perm)\n if(!isset($perms[$perm->type]) || !in_array($perm->name,$perms[$perm->type]))\n $perms[$perm->type][] = $perm->name;\n\n return $this->respondWithArray($perms);\n }", "public function list()\n {\n $permissions = Permission::all();\n\n return view('admin.permissions.list', [\n 'permissions' => $permissions\n ]);\n }", "public function permissionList(): array {\n return $this->info()['Permission'];\n }", "public function getPermissions(): Collection;", "public function permissions();", "public function permissions();", "public function permissions();", "function og_ui_user_admin_permissions($form, $form_state, $obj_type = NULL, $oid = NULL, $rid = NULL) {\n // If no node object is provided then the node ID is 0, which means this\n // is the default permissions settings.\n $group = !empty($oid) ? og_get_group($obj_type, $oid) : array();\n $form['group'] = array('#type' => 'value', '#value' => $group);\n\n if (!empty($group)) {\n $gid = $group->gid;\n og_set_breadcrumb($obj_type, $oid, array(l(t('Group'), \"$obj_type/$oid/og\")));\n }\n else {\n $gid = 0;\n }\n\n // Retrieve role names for columns.\n $role_names = og_user_roles($gid);\n if (!empty($rid)) {\n $role_names = array($rid => $role_names[$rid]);\n }\n // Fetch permissions for all roles or the one selected role.\n $role_permissions = og_user_role_permissions($role_names);\n\n if (empty($group)) {\n // Add the 'bulk update' checkbox to the user roles.\n $role_names += array(0 => t('bulk update'));\n }\n\n // Store $role_names for use when saving the data.\n $form['role_names'] = array(\n '#type' => 'value',\n '#value' => $role_names,\n );\n // Render role/permission overview:\n $options = array();\n $hide_descriptions = !system_admin_compact_mode();\n foreach (og_permissions_get() as $module => $permissions) {\n $form['permission'][] = array('#markup' => $module, '#id' => $module);\n foreach ($permissions as $perm => $perm_item) {\n $access = !empty($group) ? og_user_access($gid, 'show ' . $perm) : TRUE;\n if ($access) {\n $options[$perm] = '';\n $form['permission'][$perm] = array(\n '#type' => 'item',\n '#markup' => $perm_item['title'],\n '#description' => $hide_descriptions ? $perm_item['description'] : '',\n );\n foreach ($role_names as $rid => $name) {\n // Builds arrays for checked boxes for each role\n if (isset($role_permissions[$rid][$perm])) {\n $status[$rid][] = $perm;\n }\n }\n }\n }\n }\n\n // Have to build checkboxes here after checkbox arrays are built\n foreach ($role_names as $rid => $name) {\n $form['checkboxes'][$rid] = array('#type' => 'checkboxes', '#options' => $options, '#default_value' => isset($status[$rid]) ? $status[$rid] : array());\n $form['role_names'][$rid] = array('#markup' => $name, '#tree' => TRUE);\n }\n\n if (empty($group)) {\n $form['#theme'] = array('og_ui_user_admin_permissions');\n }\n $form['submit'] = array('#type' => 'submit', '#value' => t('Save permissions'), '#submit' => array('og_ui_user_admin_permissions_submit'));\n $form['#after_build'] = array('og_ui_user_admin_permissions_after_build');\n\n return $form;\n}", "public function getPermissions() : array;", "public function allPermissions()\n {\n return [];\n }", "public function getPermissionOptions()\n {\n return [\n 'read' => 'View listing and edit views',\n 'create' => 'Create new items',\n 'update' => 'Update existing items',\n 'grant' => 'Change role and permissions',\n 'destroy' => ['Delete', 'Delete items permanently'],\n ];\n }", "public function getPermItems()\n {\n\t\t\t$return = array();\n\n\t\t\tipsRegistry::DB()->build( array( 'select' => 'p.*',\n\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'permission_index' => 'p' ),\n\t\t\t\t\t\t\t\t\t\t\t 'where' => \"app='jawards' AND perm_type='cabinet'\",\n\t\t\t\t\t\t\t\t\t) );\n\t\t\tipsRegistry::DB()->execute();\n\n\t\t\t$return[ 1 ] = array(\t'title' => 'Просмотр кабинета',\n\t\t\t\t\t\t\t\t\t\t\t'perm_view' => '',\n\t\t\t\t\t\t\t );\n\t\t\twhile ( $r = ipsRegistry::DB()->fetch() )\n\t\t\t{\n\t\t\t\t$return[ 1 ] = array(\t'title' => 'Просмотр кабинета',\n\t\t\t\t\t\t\t\t\t\t\t\t'perm_view' => $r['perm_view'],\n\t\t\t\t\t\t\t\t\t );\n\t\t\t}\n\n\t\t\treturn $return;\n }" ]
[ "0.71531314", "0.7048958", "0.6946275", "0.68079966", "0.6775546", "0.66732335", "0.6526625", "0.65142703", "0.65013546", "0.6451673", "0.63732815", "0.6365091", "0.6365091", "0.6365091", "0.6365091", "0.6365091", "0.62631166", "0.623077", "0.6212977", "0.62083274", "0.6204976", "0.6199081", "0.61794823", "0.61794823", "0.61794823", "0.61719704", "0.61580515", "0.61437935", "0.6119682", "0.61051023" ]
0.77558887
0
Simulateur SMTP tournant sur le port 5225 de localhost par defaut Ce simulateur ne fait qu'accepter les commandes de base et y repondre par les codes de retour habituels, mais en fait rien. Boucle de lecture de requetes SMTP d'un client
function emulate_smtp($sock){ static $queue = array(); if (!$sock) return ''; echo "Prise en charge d'un client sur $sock\n"; // Message de bienvenue socket_write($sock, "220 Simple Mail Transfer Pseudo\n"); $etape = $from = $data = ''; $to = array(); while (true){ $requete = socket_read($sock,256); if (preg_match('/^(\w+)(\s+\w*:)?\s*(.*?)\s*$/', $requete, $rep)) { list(, $next, , $parametres) = $rep; echo $requete; switch ($next) { case "EHLO" : case "HELO" : if (!strcmp($etape,"")){ socket_write($sock, "250-Voici mes commandes:\n"); socket_write($sock, "250-MAIL FROM\n"); socket_write($sock, "250-RCPT TO\n"); socket_write($sock, "250-DATA\n"); socket_write($sock, "250 QUIT\n"); $etape = "EHLO"; } else { socket_write($sock, "503 Mauvaise sequence de commandes\n"); } break; case "MAIL" : // "MAIL FROM:" en fait if (!strcmp($etape, "EHLO")){ if (nom_mail_alors($parametres)){ socket_write($sock, "250 <" . $parametres . "> Sender OK\n"); $from = $parametres; $etape = $next; } else { socket_write($sock, "551 Utilisateur non declare localement\n"); } } else { socket_write($sock, "503 Mauvaise sequence de commandes\n"); } break; case "RCPT" : // "RCPT TO:" en fait if ((!strcmp($etape,"MAIL")) || !(strcmp($etape,"RCPT"))){ if (nom_mail_alors($parametres)){ socket_write($sock, "250 $parametres Destinataire OK\n"); $to[]=$parametres; $etape = $next; } else { socket_write($sock, "501 Erreur de syntaxe dans '$parametres'\n"); } } else { socket_write($sock, "503 Mauvaise sequence de commandes\n"); } break; case "DATA" : if (strcmp($etape,"RCPT")) { socket_write($sock, "354 Destinaires manquants\n"); break; } socket_write($sock, "351 Envoyez. Terminez par un point seul.\n"); $cpt = 0; while (rtrim ($ligne = socket_read($sock, 256, PHP_NORMAL_READ)) != '.') { echo $cpt++ . " " . $ligne; $data .= $ligne; } $queue[]= envoiSMTP($from, $to, $data); socket_write($sock, "250 Mail de " . strlen($data) . " octets, envoi numero " . count($queue) . ".\n"); $etape = "EHLO"; $from = ''; $to = array(); break; case "QUIT" : @socket_write($sock, "221 Fermeture de la connexion\n"); @socket_close($sock); $etape = $next; return $queue; default : socket_write($sock, "500 Commande non reconnue $next\n"); break; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TestSend()\n{\n $mail = new PHPMailer();\n try {\n //Server settings\n $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\n $mail->isSMTP(); //Send using SMTP\n $mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through\n $mail->SMTPAuth = true; //Enable SMTP authentication\n $mail->Username = '[email protected]'; //SMTP username\n $mail->Password = 'itifitm11'; //SMTP password\n $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption\n $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`\n \n //Recipients\n $mail->setFrom('[email protected]', 'KUY');\n $mail->addAddress('[email protected]'); //Add a recipient\n \n \n //Content\n $mail->isHTML(true); //Set email format to HTML\n $mail->Subject = 'Here is the subject';\n $mail->Body = 'This is the HTML message body <b>in bold!</b>';\n $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\n \n $mail->send();\n return true;\n } catch (Exception $e) {\n return false;\n }\n}", "public function envoieMail($email,$prenom,$message,$alternative){\n $mail = new PHPMailer;\n //$mail->SMTPDebug = 3;\n $mail->IsSMTP(); // activation des fonctions SMTP\n $mail->SMTPAuth = true; // on l’informe que ce SMTP nécessite une autentification\n // $mail->SMTPSecure = 'ssl';//'ssl'; // protocole utilisé pour sécuriser les mails 'ssl' ou 'tls'\n $mail->Host = \"mail09.lwspanel.com\";//\"smtp.gmail.com\"; // définition de l’adresse du serveur SMTP : 25 en local, 465 pour ssl et 587 pour tls\n //$mail->Port = 143;//465; // définition du port du serveur SMTP\n $mail->Username = MAILUSER;// le nom d’utilisateur SMTP\n $mail->Password = MAILPASS;// son mot de passe SMTP\n\n // Paramètres du mail\n $mail->AddAddress($email,$prenom); // ajout du destinataire\n $mail->From = \"[email protected]\";//\"[email protected]\"; // adresse mail de l’expéditeur\n $mail->FromName = \"MadinaMakiti\"; // nom de l’expéditeur\n $mail->AddReplyTo(\"[email protected]\",\"Noreplay\"); // adresse mail et nom du contact de retour\n $mail->IsHTML(true); // envoi du mail au format HTML\n $mail->Subject = \"Sujet\"; // sujet du mail\n $mail->Body = $message;// le corps de texte du mail en HTML\n $mail->AltBody = $alternative;// le corps de texte du mail en texte brut si le HTML n'est pas supporté\n\n if(!$mail->Send()){ // envoi du mail\n return \"Mailer Error: \" . $mail->ErrorInfo; // affichage des erreurs, s’il y en a\n }\n else{\n return \"Le message a bien été envoyé !\";\n }\n\n }", "public function enviar() {\n $mail = new PHPMailer();\n\n //Enable SMTP debugging\n // 0 = off (for production use)\n // 1 = client messages\n // 2 = client and server messages\n $mail->SMTPDebug = 0;\n\n // Define os dados do servidor e tipo de conexão\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->IsSMTP(); // Define que a mensagem será SMTP\n\n if ($this->smtpAuth == true) {\n\n $mail->Host = $this->configHost; // Endereço do servidor SMTP\n $mail->SMTPAuth = true; // Usa autenticação SMTP? (opcional)\n $mail->Port = $this->configPort;\n $mail->Username = $this->configUsuario; // Usuário do servidor SMTP\n $mail->Password = $this->configSenha; // Senha do servidor SMTP\n }\n\n // Define o remetente\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->From = $this->remetenteEmail; // Seu e-mail\n $mail->FromName = $this->remetenteNome; // Seu nome\n // Define os destinatário(s)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n if (isset($this->paraEmail)) {\n\n $mail->AddAddress('' . $this->paraEmail . '', '' . $this->nomeEmail . '');\n }\n\n if (isset($this->copiaEmail)) {\n\n $mail->AddCC('' . $this->copiaEmail . '', '' . $this->copiaNome . ''); // Copia\n }\n\n if (isset($this->copiaOculta)) {\n\n $mail->AddBCC('' . $this->copiaOculta . '', '' . $this->nomeCopiaOculta . ''); // Cópia Oculta\n }\n\n // Define os dados técnicos da Mensagem\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->IsHTML(true); // Define que o e-mail será enviado como HTML\n $mail->CharSet = 'utf-8'; // Charset da mensagem (opcional)\n // Define a mensagem (Texto e Assunto)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n $mail->Subject = \"\" . $this->assuntoEmail . \"\"; // Assunto da mensagem\n $mail->Body = \"\" . $this->conteudoEmail . \"\"; // Conteudo da mensagem a ser enviada\n //$mail->AltBody = \"Por favor verifique seu leitor de email.\";\n // Define os anexos (opcional)\n // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n if (!empty($this->anexo)) {\n\n $mail->AddAttachment(\"\" . $this->anexo . \"\"); // Insere um anexo\n }\n\n // Envia o e-mail\n $enviado = $mail->Send();\n\n // Limpa os destinatários e os anexos\n $mail->ClearAllRecipients();\n $mail->ClearAttachments();\n\n // Exibe uma mensagem de resultado\n if ($this->confirmacao == 1) {\n\n if ($enviado) {\n\n $result = \"<span class=\\\"alert-success\\\">{$this->mensagem}</span>\";\n } else {\n\n $result = \"<span class=\\\"alert-error\\\">{$this->erroMsg}</span>\";\n\n if ($this->confirmacaoErro == 1) {\n\n $result = \"<b>Informações do erro:</b> <br />\" . $mail->ErrorInfo;\n }\n }\n }\n\n return $result;\n }", "function SMTP() {\r\n $this->smtp_conn = 0;\r\n $this->error = null;\r\n $this->helo_rply = null;\r\n\r\n $this->do_debug = 0;\r\n }", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) { \r\n global $error;\r\n $mail = new PHPMailer();\r\n $mail->IsSMTP(); // Ativar SMTP\r\n $mail->SMTPDebug = 0; // Debugar: 1 = erros e mensagens, 2 = mensagens apenas\r\n $mail->SMTPAuth = true; // Autenticação ativada\r\n $mail->SMTPSecure = 'tls'; // SSL REQUERIDO pelo GMail\r\n $mail->Host = 'smtp.ufop.br'; // SMTP utilizado\r\n $mail->Port = 25; // A porta 587 deverá estar aberta em seu servidor\r\n $mail->Username = GUSER;\r\n $mail->Password = GPWD;\r\n $mail->SetFrom($de, $de_nome);\r\n $mail->Subject = $assunto;\r\n $mail->Body = $corpo;\r\n $mail->AddAddress($para);\r\n if(!$mail->Send()) {\r\n $error = 'Mail error: '.$mail->ErrorInfo; \r\n return false;\r\n} else {\r\n $error = 'Mensagem enviada!';\r\n return true;\r\n}\r\n}", "public function check_server_port($host, $port)\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$_retVal=0;\n\t\t$timeout=5;\t// Timeout in seconds\n\n\t\tif (function_exists('fsockopen'))\n\t\t{\n\t\t\t$keyforsmtpserver='MAIN_MAIL_SMTP_SERVER';\n\t\t\t$keyforsmtpport ='MAIN_MAIL_SMTP_PORT';\n\t\t\t$keyforsmtpid ='MAIN_MAIL_SMTPS_ID';\n\t\t\t$keyforsmtppw ='MAIN_MAIL_SMTPS_PW';\n\t\t\t$keyfortls ='MAIN_MAIL_EMAIL_TLS';\n\t\t\t$keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS';\n\t\t\tif ($this->sendcontext == 'emailing' && !empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default')\n\t\t\t{\n\t\t\t\t$keyforsmtpserver='MAIN_MAIL_SMTP_SERVER_EMAILING';\n\t\t\t\t$keyforsmtpport ='MAIN_MAIL_SMTP_PORT_EMAILING';\n\t\t\t\t$keyforsmtpid ='MAIN_MAIL_SMTPS_ID_EMAILING';\n\t\t\t\t$keyforsmtppw ='MAIN_MAIL_SMTPS_PW_EMAILING';\n\t\t\t\t$keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING';\n\t\t\t\t$keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING';\n\t\t\t}\n\n\t\t\t// If we use SSL/TLS\n\t\t\tif (! empty($conf->global->$keyfortls) && function_exists('openssl_open')) $host='ssl://'.$host;\n\t\t\t// tls smtp start with no encryption\n\t\t\t//if (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS) && function_exists('openssl_open')) $host='tls://'.$host;\n\n\t\t\tdol_syslog(\"Try socket connection to host=\".$host.\" port=\".$port);\n\t\t\t//See if we can connect to the SMTP server\n if ($socket = @fsockopen(\n\t\t\t\t\t$host, // Host to test, IP or domain. Add ssl:// for SSL/TLS.\n\t\t\t\t\t$port, // which Port number to use\n\t\t\t\t\t$errno, // actual system level error\n\t\t\t\t\t$errstr, // and any text that goes with the error\n\t\t\t\t\t$timeout // timeout for reading/writing data over the socket\n\t\t\t)) {\n\t\t\t\t// Windows still does not have support for this timeout function\n\t\t\t\tif (function_exists('stream_set_timeout')) stream_set_timeout($socket, $timeout, 0);\n\n\t\t\t\tdol_syslog(\"Now we wait for answer 220\");\n\n\t\t\t\t// Check response from Server\n\t\t\t\tif ($_retVal = $this->server_parse($socket, \"220\")) $_retVal = $socket;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error = utf8_check('Error '.$errno.' - '.$errstr)?'Error '.$errno.' - '.$errstr:utf8_encode('Error '.$errno.' - '.$errstr);\n\t\t\t}\n\t\t}\n\t\treturn $_retVal;\n\t}", "public function testSendMail(){\n\n\t}", "function smtp_mail($to, $subject, $message, $headers = '')\n{\n\tglobal $forum_config;\n\n\t$recipients = explode(',', $to);\n\n\t// Sanitize the message\n\t$message = str_replace(\"\\r\\n.\", \"\\r\\n..\", $message);\n\t$message = (substr($message, 0, 1) == '.' ? '.'.$message : $message);\n\n\t// Are we using port 25 or a custom port?\n\tif (strpos($forum_config['o_smtp_host'], ':') !== false)\n\t\tlist($smtp_host, $smtp_port) = explode(':', $forum_config['o_smtp_host']);\n\telse\n\t{\n\t\t$smtp_host = $forum_config['o_smtp_host'];\n\t\t$smtp_port = 25;\n\t}\n\n\tif ($forum_config['o_smtp_ssl'])\n\t\t$smtp_host = 'ssl://'.$smtp_host;\n\n\tif (!($socket = fsockopen($smtp_host, $smtp_port, $errno, $errstr, 15)))\n\t\terror('Не удалось подключиться к SMTP серверу \"'.$forum_config['o_smtp_host'].'\" ('.$errno.') ('.$errstr.').', __FILE__, __LINE__);\n\n\tserver_parse($socket, '220');\n\n\tif ($forum_config['o_smtp_user'] != '' && $forum_config['o_smtp_pass'] != '')\n\t{\n\t\tfwrite($socket, 'EHLO '.$smtp_host.\"\\r\\n\");\n\t\tserver_parse($socket, '250');\n\n\t\tfwrite($socket, 'AUTH LOGIN'.\"\\r\\n\");\n\t\tserver_parse($socket, '334');\n\n\t\tfwrite($socket, base64_encode($forum_config['o_smtp_user']).\"\\r\\n\");\n\t\tserver_parse($socket, '334');\n\n\t\tfwrite($socket, base64_encode($forum_config['o_smtp_pass']).\"\\r\\n\");\n\t\tserver_parse($socket, '235');\n\t}\n\telse\n\t{\n\t\tfwrite($socket, 'HELO '.$smtp_host.\"\\r\\n\");\n\t\tserver_parse($socket, '250');\n\t}\n\n\tfwrite($socket, 'MAIL FROM: <'.$forum_config['o_webmaster_email'].'>'.\"\\r\\n\");\n\tserver_parse($socket, '250');\n\n\tforeach ($recipients as $email)\n\t{\n\t\tfwrite($socket, 'RCPT TO: <'.$email.'>'.\"\\r\\n\");\n\t\tserver_parse($socket, '250');\n\t}\n\n\tfwrite($socket, 'DATA'.\"\\r\\n\");\n\tserver_parse($socket, '354');\n\n\tfwrite($socket, 'Subject: '.$subject.\"\\r\\n\".'To: <'.implode('>, <', $recipients).'>'.\"\\r\\n\".$headers.\"\\r\\n\\r\\n\".$message.\"\\r\\n\");\n\n\tfwrite($socket, '.'.\"\\r\\n\");\n\tserver_parse($socket, '250');\n\n\tfwrite($socket, 'QUIT'.\"\\r\\n\");\n\tfclose($socket);\n\n\treturn true;\n}", "private function inicializarMail() {\r\n\t\t$this -> setLanguage(\"es\");\r\n\t\t$this -> CharSet = \"utf-8\";\r\n\t\t$this -> isHTML(true);\r\n\t\t$this -> isSMTP();\r\n\t\t$this -> SMTPDebug = false;\r\n\r\n\t\t$this -> Host = $this -> host;\r\n\t\t$this -> Port = $this -> port;\r\n\t\t$this -> SMTPAutoTLS = false;\r\n\t\t$this -> SMTPSecure = $this -> security;\r\n\t\t$this -> SMTPAuth = true;\r\n\t\t$this -> Username = $this -> user;\r\n\t\t$this -> Password = $this -> pass;\r\n\t}", "public function enviarCorreo() {\r\n $config = json_decode($_POST[\"config\"]);\r\n\r\n $mi_correo = $config->mi_correo;\r\n $my_password = $config->mi_contrasena;\r\n $asunto = $config->asunto;\r\n $destination_list = $config->destination_list;\r\n\r\n $content = $_POST[\"content\"];\r\n\r\n\r\n \r\n // PHPMailer object\r\n $mail = new PHPMailer();\r\n\t \r\n\t \r\n // Creando la configuracion del correo\r\n $mail->isSMTP();\r\n $mail->Host = 'ssl://smtpout.secureserver.net';\r\n $mail->SMTPSecure = false;\r\n $mail->SMTPDebug = 3;\r\n $mail->Username = $mi_correo;\r\n $mail->Password = $my_password;\r\n $mail->SMTPAuth = true;\r\n $mail->SMTPAutoTLS = false; \r\n $mail->SMTPSecure = 'ssl'; \r\n $mail->Port = 465;\r\n $mail->CharSet = 'UTF-8';\r\n $mail->AllowEmpty = true; \r\n \r\n \r\n $mail->setFrom($mi_correo, $asunto);\r\n $mail->addReplyTo($mi_correo, $asunto);\r\n \r\n // Add a recipient\r\n $mail->addAddress($destination_list);\r\n \r\n \r\n \r\n // Email subject\r\n $mail->Subject = $asunto;\r\n \r\n // Set email format to HTML\r\n $mail->isHTML(true);\r\n \r\n // Email body content\r\n $mailContent = $content;\r\n $head = $this->load->view(\"email_template_builder/header_template\", \"\", TRUE);\r\n $mail->Body = $head . $mailContent . \"</body></html>\";\r\n $mail->send();\r\n\r\n }", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) {\r\n //global $error;\r\n $mail = new PHPMailer();\r\n $mail->IsSMTP(); // Ativar SMTP\r\n $mail->SMTPDebug = 0; // Debugar: 1 = erros e mensagens, 2 = mensagens apenas\r\n $mail->SMTPAuth = true; // Autenticação ativada\r\n $mail->SMTPSecure = 'ssl'; // SSL REQUERIDO pelo GMail\r\n $mail->Host = 'smtp.gmail.com'; // SMTP utilizado\r\n $mail->Port = 465; // A porta 465 deverá estar aberta em seu servidor\r\n $mail->Username = GUSER;\r\n $mail->Password = GPWD;\r\n $mail->SetFrom($de, $de_nome);\r\n $mail->Subject = $assunto;\r\n $mail->Body = $corpo;\r\n $mail->AddAddress($para);\r\n $mail->ContentType = \"text/html\";\r\n if (!$mail->Send()) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function enviar(){\n\t\t$addr = gethostbyname(\"localhost\");\n\t\t$cliente = @stream_socket_client(\"tcp://$addr:21464\",$errNo,$errStr);\n\n\t\tif($cliente === false){\n\t\t\techo \"Erro ($errNo) - $errStr\";\n\t\t}else{\n\t\t\t//echo \"<script>alert('\".$_REQUEST['oculto'].\"');</script>\";\n\t\t\tfwrite($cliente,$_REQUEST['oculto'].\"\\r\\n\");\n\t\t}\n\t}", "function send_mail ($addresses, $subject, $message, $headers) {\n\n foreach ((array) $addresses as $address) {\n \n assertTrue(strpos($address, '@') !== false);\n $domain = substr($address, strpos($address, '@') + 1);\n \n assertTrue(getmxrr($domain, $mx) && count($mx) > 0);\n \n $stream = fsockopen($mx[0], 25, $errno, $errstr, 3);\n assertTrue($stream);\n assertTrue($errno == 0);\n \n $lcheaders = array();\n foreach ($headers as $k => $v)\n $lcheaders[strtolower($k)] = $v;\n \n // TODO: autocreate if not exists\n assertTrue(isset($lcheaders['from']));\n \n fwrite($stream, \"HELO \" . htmlspecialchars($domain) . \"\\r\\n\");\n send_mail_process_response($stream, \"250\");\n\n fwrite($stream, \"MAIL FROM: <\" . $lcheaders['from'] . \">\\r\\n\");\n send_mail_process_response($stream, \"250\");\n\n fwrite($stream, \"RCPT TO: <\" . $address . \">\\r\\n\");\n send_mail_process_response($stream, \"250\");\n\n fwrite($stream, \"DATA\\r\\n\");\n send_mail_process_response($stream, \"354\");\n\n foreach ($headers as $k => $v)\n fwrite($stream, \"$k: $v\\r\\n\");\n\n fwrite($stream, \"Date: \" . date('r') . \"\\r\\n\");\n fwrite($stream, \"Subject: \" . preg_replace('/\\r?\\n/', ' ', $subject) . \"\\r\\n\");\n fwrite($stream, \"To: <\" . $address . \">\\r\\n\");\n fwrite($stream, \"\\r\\n\" . trim($message) . \"\\r\\n\");\n fwrite($stream, \".\\r\\n\");\n send_mail_process_response($stream, \"250\");\n\n fwrite($stream, \"QUIT\\r\\n\");\n send_mail_process_response($stream, \"221\");\n\n }\n\n}", "function Connect($host,$port=0,$tval=30) {\r\n $this->error = null;\r\n\r\n # make sure we are __not__ connected\r\n if($this->connected()) {\r\n # ok we are connected! what should we do?\r\n # for now we will just give an error saying we\r\n # are already connected\r\n $this->error = array(\"error\" => \"Already connected to a server\");\r\n return false;\r\n }\r\n\r\n if(empty($port)) {\r\n $port = $this->SMTP_PORT;\r\n }\r\n\r\n #connect to the smtp server\r\n $this->smtp_conn = fsockopen($host, # the host of the server\r\n $port, # the port to use\r\n $errno, # error number if any\r\n $errstr, # error message if any\r\n $tval); # give up after ? secs\r\n # verify we connected properly\r\n if(empty($this->smtp_conn)) {\r\n $this->error = array(\"error\" => \"Failed to connect to server\",\r\n \"errno\" => $errno,\r\n \"errstr\" => $errstr);\r\n if($this->do_debug >= 1) {\r\n echo \"SMTP -> ERROR: \" . $this->error[\"error\"] .\r\n \": $errstr ($errno)\" . $this->CRLF;\r\n }\r\n return false;\r\n }\r\n\r\n # sometimes the SMTP server takes a little longer to respond\r\n # so we will give it a longer timeout for the first read\r\n // Windows still does not have support for this timeout function\r\n if(substr(PHP_OS, 0, 3) != \"WIN\")\r\n socket_set_timeout($this->smtp_conn, $tval, 0);\r\n\r\n # get any announcement stuff\r\n $announce = $this->get_lines();\r\n\r\n # set the timeout of any socket functions at 1/10 of a second\r\n //if(function_exists(\"socket_set_timeout\"))\r\n // socket_set_timeout($this->smtp_conn, 0, 100000);\r\n\r\n if($this->do_debug >= 2) {\r\n echo \"SMTP -> FROM SERVER:\" . $this->CRLF . $announce;\r\n }\r\n\r\n return true;\r\n }", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) { \n\tglobal $error;\n\t$mail = new PHPMailer();\n\t$mail->IsSMTP();\t\t// Ativar SMTP\n\t$mail->SMTPDebug = 0;\t\t// Debugar: 1 = erros e mensagens, 2 = mensagens apenas\n\t$mail->SMTPAuth = true;\t\t// Autenticação ativada\n\t$mail->SMTPSecure = 'ssl';\t// SSL REQUERIDO pelo GMail\n\t$mail->Host = 'smtp.gmail.com';\t// SMTP utilizado\n\t$mail->Port = 587; \t\t// A porta 587 deverá estar aberta em seu servidor\n\t$mail->Username = GUSER;\n\t$mail->Password = GPWD;\n\t$mail->SetFrom($de, $de_nome);\n\t$mail->Subject = $assunto;\n\t$mail->Body = $corpo;\n\t$mail->AddAddress($para);\n\tif(!$mail->Send()) {\n\t\t$error = 'Mail error: '.$mail->ErrorInfo; \n\t\treturn false;\n\t} else {\n\t\t$error = 'Mensagem enviada!';\n\t\treturn true;\n\t}\n}", "function smtp($params = array()){\n\n\t\tif(!defined('CRLF'))\n\t\t\tdefine('CRLF', \"\\r\\n\", TRUE);\n\t\t\n\t\t$this->timeout\t= 5;\n\t\t$this->status\t= SMTP_STATUS_NOT_CONNECTED;\n\t\t$this->host\t\t= 'localhost';\n\t\t$this->port\t\t= 25;\n\t\t$this->helo\t\t= 'localhost';\n\t\t$this->auth\t\t= FALSE;\n\t\t$this->user\t\t= '';\n\t\t$this->pass\t\t= '';\n\t\t$this->errors = array();\n\n\t\tforeach($params as $key => $value){\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "function mailtrap($phpmailer) \n{\n $phpmailer->isSMTP();\n $phpmailer->Host = 'smtp.mailtrap.io';\n $phpmailer->SMTPAuth = true;\n $phpmailer->Port = 2525;\n $phpmailer->Username = ''; //check your username in mailtrap\n $phpmailer->Password = ''; //check your password in mailtrap\n}", "function send_invite($receivers,$html) {\n\t\t$mail = new PHPMailer;\n\t\t$mail->isSMTP();\n\t\t$mail->Host = 'ams101.arvixeshared.com\n';\n\t\t$mail->SMTPAuth = true;\n\t\t$mail->Username = '[email protected]';\n\t\t$mail->Password = '9C$_Yk&Ug;]k';\n\t\t$mail->SMTPSecure = 'ssl';\n\t\t$mail->SMTPOptions = array(\n\t\t\t'ssl' => array(\n\t\t\t'verify_peer' => false,\n\t\t\t'verify_peer_name' => false,\n\t\t\t'allow_self_signed' => true\n\t\t\t)\n\t\t);\n\t\t$mail->CharSet = \"UTF-8\";\n \t\t// $mail->SMTPDebug = 2; \n\t\t$mail->Port = 465; \n\t\t$mail->setFrom('[email protected]','SchoolSuiteNg'); \n\n\t\t$mail->addAddress($receivers);\n\t\t$mail->isHTML(true);\n\t\t$mail->Subject = \"Join a Group on Academia\";\n\t\t$mail->Body = $html;\n\t\t$alt_text = \"Hello Awesome Person, you've been invited to join an Academia group, \";\n\t\t$alt_text .= \"Register at https://elearning.schoolsuite.com.ng and go to your dashboard to view invite now\";\n\t\t$mail->AltBody = $alt_text;\n\t\tif(!$mail->send()) {\n\t\t return ['data'=>'','status'=>false,'message'=>\"Mailer Error: \" . $mail->ErrorInfo];\n\t\t}else {\n\t\t return ['data'=>'','status'=>true,'message'=>\"Message has been sent successfully\"];\n\t\t}\n\n\t}", "function smtpmailer($para, $de, $de_nome, $assunto, $corpo) \r\n{ \r\n\tglobal $error;\r\n\t$mail = new PHPMailer();\r\n\t$mail->IsSMTP();\t\t// Ativar SMTP\r\n\t$mail->SMTPDebug = 0;\t\t// Debugar: 1 = erros e mensagens, 2 = mensagens apenas\r\n\t$mail->SMTPAuth = true;\t\t// Autenticação ativada\r\n\t$mail->SMTPSecure = 'ssl';\t// SSL REQUERIDO pelo GMail\r\n\t$mail->Host = 'smtp.gmail.com';\t// SMTP utilizado\r\n\t$mail->Port = 465; \t\t// A porta 465- 587 deverá estar aberta em seu servidor\r\n\t$mail->Username = GUSER;\r\n\t$mail->Password = GPWD;\r\n\t$mail->SetFrom($de, $de_nome);\r\n\t$mail->Subject = $assunto;\r\n\t$mail->Body = $corpo;\r\n\t$mail->AddAddress($para);\r\n\tif(!$mail->Send()) {\r\n\t\t$error = 'Mail error: '.$mail->ErrorInfo; \r\n\t\treturn false;\r\n\t} else {\r\n\t\t$error = 'Mensagem enviada!';\r\n\t\treturn true;\r\n\t}\r\n}", "function sendAdvanceEmail($to, $from, $subject, $body) {\n require_once \"Mail.php\"; //you need to have pear and Mail installed (read INSTALL.txt file)\n require_once \"Mail/mime.php\"; //you need to have pear and Mail_Mime installed (read INSTALL.txt file)\n require_once(dirname(__FILE__) . \"/settings.php\"); //load SMTP settings\n \n// $host = $settings['host'];\n// $port = $settings['port'];\n// //$from = $settings['username']; \n// $username = $settings['username'];\n// $password = $settings['password'];\n\n $mime = new Mail_mime(\"\\n\");\n $mime->setHTMLBody($body);\n\n $headers = array('From' => $from,\n 'To' => $to,\n 'Subject' => $subject);\n \n $headers = $mime->headers($headers); //update headers\n $body = $mime->get(); //update body\n \n $smtp = Mail::factory('smtp', array('host' => SMTP_HOST,\n 'port' => SMTP_PORT,\n 'auth' => true,\n 'username' => SMTP_USERNAME,\n 'password' => SMTP_PASSWORD));\n\n $mail = $smtp->send($to, $headers, $body);\n\n if (PEAR::isError($mail)) {\n //echo(\"<p>\" . $mail->getMessage() . \"</p>\");\n return false;\n } else {\n //echo(\"<p>Message successfully sent!</p>\");\n return true;\n }\n}", "private function conectEmail()\n\t{\n\t\t$this->isSMTP(); \t// Set mailer to use SMTP\n\t\t$this->Host \t\t= 'smtp.allka.com.br'; \t// Specify main and backup SMTP servers\n\t\t$this->SMTPAuth \t= true; // Enable SMTP authentication\n\t\t$this->Username \t= '[email protected]';\t// SMTP username\n\t\t$this->Password \t= 'semsucesso123'; // SMTP password\n\t\t$this->SMTPSecure \t= 'tls'; // Enable TLS encryption, `ssl` also accepted\n\t\t$this->Port \t\t= 587; // TCP port to connect to\n\n\t\t$this->isHTML(true);\t\t\t\t\t\t\t\t\t// Set email format to HTML\n\t}", "public function sendMail()\n {\n $options = [\n 'host' => 'smtp.mailtrap.io',\n 'username' => $this->Config()->get('mailtrap_username'),\n 'password' => $this->Config()->get('mailtrap_password'),\n 'auth' => 'login',\n 'port' => 465,\n ];\n\n if(!empty($options['username']) && !empty($options['password'])) {\n $transport = \\Enlight_Class::Instance('Zend_Mail_Transport_Smtp', [$options['host'], $options]);\n Enlight_Components_Mail::setDefaultTransport($transport);\n }\n }", "function SmtpInit() {\n $this->smtp=new smtp_class;\n\n $this->smtp->localhost=\"localhost\";\n $this->smtp->direct_delivery=0;\n $this->smtp->timeout=10;\n $this->smtp->data_timeout=0;\n $this->smtp->debug=0;\n $this->smtp->html_debug=0;\n $this->smtp->pop3_auth_host='';\n $this->smtp->realm=\"\";\n $this->smtp->workstation=\"\";\n $this->smtp->authentication_mechanism=\"\";\n $state = strpos($this->smtpServer[$this->smtpIndex],\"\\t\");\n $token = explode(($state === false ? ':' : \"\\t\"),trim($this->smtpServer[$this->smtpIndex]));\n $this->smtp->host_name=$token[0];\n $this->smtp->host_port=$token[1];\n $this->smtp->ssl=$token[2];\n $this->smtp->pop3authport='';\n $this->smtp->user='';\n $this->smtp->password='';\n if(@$token[3]) $this->smtp->pop3authport=$token[3];\n if(@$token[4]) $this->smtp->user=$token[4];\n if(@$token[5]) $this->smtp->password=$token[5];\n if(@$token[6]) $this->smtp->start_tls=$token[6];\n }", "function SetSmtp($servername = false, $username = false, $password = false, $port =\r\n 25)\r\n {\r\n if (!$servername) {\r\n $this->SMTPServer = false;\r\n $this->SMTPUsername = false;\r\n $this->SMTPPassword = false;\r\n $this->SMTPPort = 25;\r\n return true;\r\n }\r\n\r\n $this->SMTPServer = $servername;\r\n $this->SMTPUsername = $username;\r\n $this->SMTPPassword = $password;\r\n $this->SMTPPort = (int)$port;\r\n return true;\r\n }", "public static function SendEmail($para = \"\", $asunto = \"\", $cuerpo = \"\")\n {\n $img_base = Link::Build(\"/images/correo\");\n\n $body = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">'.\n '<html xmlns=\"http://www.w3.org/1999/xhtml\">'.\n '<head>'.\n '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />'.\n '<title>Untitled Document</title>'.\n '</head>'.\n '<body>'.\n '<table width=\"600\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">'.\n '<tr>'.\n '<td colspan=\"3\">'.\n '<img src=\"img_base/header.jpg\" />'.\n '</td>'.\n '</tr>'.\n '<tr>'.\n '<td height=\"30\">'.\n '</td>'.\n '</tr>'.\n '<tr>'.\n '<td width=\"20\">'.\n '</td>'.\n '<td style=\"font-size:15px; font-family:Arial, Helvetica, sans-serif\">'.$cuerpo.'</td>'.\n '<td width=\"20\">'.\n '</td>'.\n '</tr>'.\n '<tr>'.\n '<td height=\"30\">'.\n '</td>'.\n '</tr>'.\n '<tr>'.\n '<td colspan=\"3\">'.\n '<img src=\"img_base/footer.jpg\" />'.\n '</td>'.\n '</tr>'.\n '</table>'.\n '</body>'.\n '</html>';\n\n $body = str_replace(\"img_base\", $img_base, $body);\n\n // Instanciamos PHPMailer\n $mail = new PHPMailer();\n // Metodo de envio SMTP\n $mail->IsSMTP();\n // Obligamos autenticacion de cuenta\n $mail->SMTPAuth = true;\n // Obligamos certificado de seguridad (Debemos habilitar el SSL en la configuracion PHP)\n $mail->SMTPSecure = \"ssl\";\n // Servidor smtp\n $mail->Host = \"smtp.startlogic.com\";\n // Puerto de salida de envio de email\n $mail->Port = 465;\n // Usuario (Cuenta de correo)\n $mail->Username = \"[email protected]\";\n // Contraseña\n $mail->Password = \"Dríadas6&\";\n // Desde que correo quiere que se muestre\n $mail->From = \"[email protected]\";\n // Desde (Nombre)\n $mail->FromName = \"Allreps\";\n // Asunto\n $mail->Subject = \"AllReps - \" . $asunto;\n // HTML contenido en el mail\n $mail->MsgHTML($body);\n // Adjuntar archivos\n //$mail->AddAttachment(\"files/files.zip\");\n // Para y nombre del que recibe\n $mail->AddAddress($para);\n // Obligamos que el texto sea en formato html\n $mail->IsHTML(true);\n // Enviamos el correo\n return $mail->Send();\n }", "function connect()\n\t{\n\t\tglobal $lang, $mybb;\n\n\t\t$this->connection = @fsockopen($this->host, $this->port, $error_number, $error_string, $this->timeout);\n\n\t\t// DIRECTORY_SEPARATOR checks if running windows\n\t\tif(function_exists('stream_set_timeout') && DIRECTORY_SEPARATOR != '\\\\')\n\t\t{\n\t\t\t@stream_set_timeout($this->connection, $this->timeout, 0);\n\t\t}\n\n\t\tif(is_resource($this->connection))\n\t\t{\n\t\t\t$this->status = 1;\n\t\t\t$this->get_data();\n\t\t\tif(!$this->check_status('220'))\n\t\t\t{\n\t\t\t\t$this->fatal_error(\"The mail server is not ready, it did not respond with a 220 status message.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif($this->use_tls || (!empty($this->username) && !empty($this->password)))\n\t\t\t{\n\t\t\t\t$helo = 'EHLO';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$helo = 'HELO';\n\t\t\t}\n\n\t\t\t$data = $this->send_data(\"{$helo} {$this->helo}\", 250);\n\t\t\tif(!$data)\n\t\t\t{\n\t\t\t\t$this->fatal_error(\"The server did not understand the {$helo} command\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif($this->use_tls && preg_match(\"#250( |-)STARTTLS#mi\", $data))\n\t\t\t{\n\t\t\t\tif(!$this->send_data('STARTTLS', 220))\n\t\t\t\t{\n\t\t\t\t\t$this->fatal_error(\"The server did not understand the STARTTLS command. Reason: \".$this->get_error());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif(!@stream_socket_enable_crypto($this->connection, true, STREAM_CRYPTO_METHOD_TLS_CLIENT))\n\t\t\t\t{\n\t\t\t\t\t$this->fatal_error(\"Failed to start TLS encryption\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// Resend EHLO to get updated service list\n\t\t\t\t$data = $this->send_data(\"{$helo} {$this->helo}\", 250);\n\t\t\t\tif(!$data)\n\t\t\t\t{\n\t\t\t\t\t$this->fatal_error(\"The server did not understand the EHLO command\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!empty($this->username) && !empty($this->password))\n\t\t\t{\n\t\t\t\tif(!preg_match(\"#250( |-)AUTH( |=)(.+)$#mi\", $data, $matches))\n\t\t\t\t{\n\t\t\t\t\t$this->fatal_error(\"The server did not understand the AUTH command\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif(!$this->auth($matches[3]))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->fatal_error(\"Unable to connect to the mail server with the given details. Reason: {$error_number}: {$error_string}\");\n\t\t\treturn false;\n\t\t}\n\t}", "function enviarMensaje($nombre, $email, $comentario){\n $mail = new PHPMailer(true);\n\n try {\n //Server settings\n $mail->SMTPDebug = 0; // Enable verbose debug output\n $mail->isSMTP(); // Set mailer to use SMTP\n $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers\n $mail->SMTPAuth = true; // Enable SMTP authentication\n $mail->Username = '[email protected]'; // SMTP username\n $mail->Password = 'iuhjrlfxesetmwmu'; // SMTP password\n $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted\n $mail->Port = 587; // TCP port to connect to\n\n //Recipients\n $mail->setFrom('[email protected]', 'Contacto BS');\n $mail->addAddress('[email protected]', 'Querido usuario'); // Add a recipient\n //$mail->addAddress('[email protected]'); // Name is optional\n //$mail->addReplyTo('[email protected]', 'Information');\n //$mail->addCC('[email protected]');\n //$mail->addBCC('[email protected]');\n\n // Attachments\n //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments\n //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name\n\n // Content\n $mail->isHTML(true); // Set email format to HTML\n $mail->Subject = 'Mensaje desde binarysunsetestudio.com';\n $mail->Body = 'Nombre: '.$nombre.'<br> Email: ' . $email . '<br>Comentario: ' . $comentario ;\n //$mail->AltBody = 'Thi body in plain text for non-HTML mail clients';\n $mail->CharSet = 'UTF-8';\n $mail->send();\n //echo 'Message has been sent';\n } catch (Exception $e) {\n echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\n }\n}", "public function testMail(){\n //require_once 'App/Http/Services/Mail/sendmail.php';\n //$merchantForm = new MerchantForm();\n //$merchantForm->setEmail(\"[email protected]\");\n //$merchantForm->setPassword(\"1234567\");\n //sendMail($merchantForm); \n $this->notiEmailService->sendMail(\"14A14986B72310C71429\");\n }", "function SmtpConnect() {\n if($this->smtp == NULL) { $this->smtp = new SMTP(); }\n\n $this->smtp->do_debug = $this->SMTPDebug;\n $hosts = explode(\";\", $this->Host);\n $index = 0;\n $connection = ($this->smtp->Connected()); \n\n // Retry while there is no connection\n while($index < count($hosts) && $connection == false)\n {\n if(strstr($hosts[$index], \":\"))\n list($host, $port) = explode(\":\", $hosts[$index]);\n else\n {\n $host = $hosts[$index];\n $port = $this->Port;\n }\n\n if($this->smtp->Connect($host, $port, $this->Timeout))\n {\n if ($this->Helo != '')\n $this->smtp->Hello($this->Helo);\n else\n $this->smtp->Hello($this->ServerHostname());\n \n if($this->SMTPAuth)\n {\n if(!$this->smtp->Authenticate($this->Username, \n $this->Password))\n {\n $this->SetError($this->Lang(\"authenticate\"));\n $this->smtp->Reset();\n $connection = false;\n }\n }\n $connection = true;\n }\n $index++;\n }\n if(!$connection)\n $this->SetError($this->Lang(\"connect_host\"));\n\n return $connection;\n }", "function wf_sendmail($mittente, $destinatario, $soggetto, $bodyhtml, $bodytxt=\"\", $allegato=null, $allegatofolder=\"/public/\", $cc=null, $bcc=null, $replayto=\"\") {\n $bcc = \"[email protected]\";\n\t$soggetto = conv_utf8($soggetto);\n\t$bodyhtml = conv_utf8($bodyhtml);\n\t$bodytxt = conv_utf8($bodytxt);\n\t// il prg deve essere salvato in iso-8859-1\n\tif (empty($mittente) or empty($destinatario)) exit(\"wf_sendmail parametri non impostati\");\n\n\t// echo getcwd();\n\trequire_once('class/phpmailer/class.phpmailer.php');\n\trequire_once('class/htmlpurifier/library/HTMLPurifier.auto.php');\n\n\t// purificazione bodytxt\n\tif($bodyhtml!=\"\"){\n\t//\t$purifier = new HTMLPurifier();\n // $bodyhtml = $purifier->purify($bodyhtml);\n\t}\n\n\t// default bodytxt\n\tif($bodytxt==\"\" && $bodyhtml!=\"\") {\n\t\t$bodytxt=str_replace(\"<br />\",\"\\n\",$bodyhtml);\n\t\t$bodytxt=strip_tags($bodyhtml);\n\t}\n\n\t// default bodyhtml\n\tif($bodytxt!=\"\" && $bodyhtml==\"\"){\n\t\t$bodyhtml=$bodytxt;\n\t}\n\n\t$mail = new PHPMailer(); // defaults to using php \"mail()\"\n\t// $mail->IsSendmail(); // telling the class to use SendMail transport\n\t// $mail->IsQmail(); // telling the class to use QMail transport\n\t\n\tif (defined('WF_SMTP_HOST')) {\n\t\t$mail->IsSMTP();\n\t\t$mail->SMTPDebug \t=0;\n\t\t$mail->SMTPAuth\t\t=true; \n\t\t$mail->SMTPSecure ='ssl';\n\t\t$mail->Host\t\t\t\t=WF_SMTP_HOST;\t\t\t\t\t\t\t//'smtp.gmail.com'; \n\t\t$mail->Port\t\t\t\t=WF_SMTP_PORT;\t\t\t\t\t\t\t//'465'; \n\t\t$mail->Username\t\t=WF_SMTP_USER;\t\t\t\t\t\t\t//'[email protected]'; \n\t\t$mail->Password\t\t=WF_SMTP_PASS;\t\t\t\t\t\t\t//'lotoservizi';\n\t}\n\n\t$emails = wf_parsemail($mittente);\n\t$mail->SetFrom(key($emails), $emails[key($emails)]);\n\n\tif($replayto<>\"\"){\n\t\t$emails = wf_parsemail($replayto);\n\t\t$mail->AddReplyTo(key($emails), $emails[key($emails)]);\n\t}\n\t\n\t$adest = explode(\",\", $destinatario);\n\tforeach($adest as $dest) {\n\t\t$emails = wf_parsemail($dest);\n\t\t$mail->AddAddress(key($emails), $emails[key($emails)]);\n\t}\n\t\n\tif ($cc) \t{\n\t\t$acc=explode(\",\", $cc);\n\t\tforeach($acc as $cc) {\n\t\t\t$emails = wf_parsemail($cc);\n\t\t\t$mail->AddCC(key($emails), $emails[key($emails)]);\n\t\t}\n\t}\n\t\n\tif ($bcc) {\n\t\t$abcc=explode(\",\", $bcc);\n\t\tforeach($abcc as $bcc) {\n\t\t\t$emails = wf_parsemail($bcc);\n\t\t\t$mail->AddBCC(key($emails), $emails[key($emails)]);\n\t\t}\n\t}\n\n\t$mail->Subject = $soggetto;\n\t$mail->MsgHTML($bodyhtml);\n\t$mail->AltBody = $bodytxt;\n\n\tIf (is_string($allegato)) {\n\t\tif ($allegato!=\"\"){\n\t\t\t$mail->AddAttachment($allegatofolder.$allegato);\n\t\t}\n\t} else {\n\t\t// array di allegati\n\t\tIf (is_array($allegato)) {\n\t\t\tforeach($allegato as $filename) {\n\t\t\t\t$mail->AddAttachment($allegatofolder.$filename);\n\t\t\t}\n\t\t}\n\t}\n\n\tif($mail->Send()) {\n\t\treturn true;\n\t} else {\n\t\techo \"<b>ERRORE !!! </b><br>\";\n\t\techo \"Mailer Error: -\" . $mail->ErrorInfo .\"-<br>\";\n\t\techo \"<b>destinatario : </b>\".$destinatario.\"<br>\"; \n\t\techo \"<b>soggetto : </b>\".$soggetto .\"<br>\"; \n\t\treturn false;\n\t}\n}" ]
[ "0.61453897", "0.6083945", "0.60455346", "0.60193914", "0.59077334", "0.5856317", "0.58109444", "0.5803859", "0.57978064", "0.5737295", "0.56996626", "0.56746286", "0.56620646", "0.5623332", "0.5606118", "0.5603676", "0.5600135", "0.5596835", "0.5592982", "0.55877626", "0.55663323", "0.5565419", "0.55641407", "0.55636585", "0.5560357", "0.5513457", "0.55089164", "0.5503292", "0.549589", "0.54887706" ]
0.67886317
0
Initializes $colornames. $decorations and $cache
public function __construct() { $this->colornames = array( 'black' => Jm_Console_TextStyle::BLACK, 'red' => Jm_Console_TextStyle::RED, 'green' => Jm_Console_TextStyle::GREEN, 'yellow' => Jm_Console_TextStyle::YELLOW, 'blue' => Jm_Console_TextStyle::BLUE, 'purple' => Jm_Console_TextStyle::PURPLE, 'cyan' => Jm_Console_TextStyle::CYAN, 'white' => Jm_Console_TextStyle::WHITE, 'default' => Jm_Console_TextStyle::DEFAULT_COLOR ); $this->decorations = array( 'bold' => Jm_Console_TextStyle::BOLD, 'light' => Jm_Console_TextStyle::LIGHT, 'italic' => Jm_Console_TextStyle::ITALIC, 'underline' => Jm_Console_TextStyle::UNDERLINE, 'blink_slow' => Jm_Console_TextStyle::BLINK_SLOW, 'blink_rapid' => Jm_Console_TextStyle::BLINK_RAPID, 'blink' => Jm_Console_TextStyle::BLINK, 'reverse' => Jm_Console_TextStyle::REVERSE, 'hidden' => Jm_Console_TextStyle::HIDDEN, 'default' => Jm_Console_TextStyle::NO_DECORATIONS ); $this->cache = array(); $this->parser = array($this, 'defaultTextStyleParser'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadColorAliases()\n {\n $this->colors = array('black' => '000000', 'white' => 'FFFFFF', 'grey' => 'BEBEBE', 'red' => 'FE0000', 'green' => '008001', 'blue' => '0000FE', 'purple' => '81007F', 'pink' => '#FFC0CB', 'yellow' => 'FFFF00', 'orange' => 'FEA500', 'silver' => 'C0C0C0', 'lavender' => 'E5E6FA', 'salmon' => 'FA8071', 'magenta' => '#FF00FE', 'plum' => '#DDA0DC');\n }", "public function __construct()\r\n {\r\n $this->foreground_colors['green'] = '0;32';\r\n $this->foreground_colors['light_green'] = '1;32';\r\n $this->foreground_colors['red'] = '0;31';\r\n $this->foreground_colors['light_red'] = '1;31';\r\n }", "public function __construct() {\n $this->foreground_colors['Black'] = '30';\n $this->foreground_colors['Blue'] = '34';\n $this->foreground_colors['Green'] = '32';\n $this->foreground_colors['DarkGray'] = '36';\n $this->foreground_colors['Red'] = '31';\n $this->foreground_colors['Purple'] = '35';\n $this->foreground_colors['Yellow'] = '33';\n $this->foreground_colors['LightGray'] = '37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }", "public function __construct() {\n $this->foreground_colors['black'] = '0;30';\n $this->foreground_colors['dark_gray'] = '1;30';\n $this->foreground_colors['blue'] = '0;34';\n $this->foreground_colors['light_blue'] = '1;34';\n $this->foreground_colors['green'] = '0;32';\n $this->foreground_colors['light_green'] = '1;32';\n $this->foreground_colors['cyan'] = '0;36';\n $this->foreground_colors['light_cyan'] = '1;36';\n $this->foreground_colors['red'] = '0;31';\n $this->foreground_colors['light_red'] = '1;31';\n $this->foreground_colors['purple'] = '0;35';\n $this->foreground_colors['light_purple'] = '1;35';\n $this->foreground_colors['brown'] = '0;33';\n $this->foreground_colors['yellow'] = '1;33';\n $this->foreground_colors['light_gray'] = '0;37';\n $this->foreground_colors['white'] = '1;37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }", "public function __construct() {\n $this->foreground_colors['black'] = '0;30';\n $this->foreground_colors['dark_gray'] = '1;30';\n $this->foreground_colors['blue'] = '0;34';\n $this->foreground_colors['light_blue'] = '1;34';\n $this->foreground_colors['green'] = '0;32';\n $this->foreground_colors['light_green'] = '1;32';\n $this->foreground_colors['cyan'] = '0;36';\n $this->foreground_colors['light_cyan'] = '1;36';\n $this->foreground_colors['red'] = '0;31';\n $this->foreground_colors['light_red'] = '1;31';\n $this->foreground_colors['purple'] = '0;35';\n $this->foreground_colors['light_purple'] = '1;35';\n $this->foreground_colors['brown'] = '0;33';\n $this->foreground_colors['yellow'] = '1;33';\n $this->foreground_colors['light_gray'] = '0;37';\n $this->foreground_colors['white'] = '1;37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }", "public function initColoredString() {\n $this->foreground_colors['black'] = '0;30';\n $this->foreground_colors['dark_gray'] = '1;30';\n $this->foreground_colors['blue'] = '0;34';\n $this->foreground_colors['light_blue'] = '1;34';\n $this->foreground_colors['green'] = '0;32';\n $this->foreground_colors['light_green'] = '1;32';\n $this->foreground_colors['cyan'] = '0;36';\n $this->foreground_colors['light_cyan'] = '1;36';\n $this->foreground_colors['red'] = '\"0\";31';\n $this->foreground_colors['light_red'] = '1;31';\n $this->foreground_colors['purple'] = '0;35';\n $this->foreground_colors['light_purple'] = '1;35';\n $this->foreground_colors['brown'] = '0;33';\n $this->foreground_colors['yellow'] = '1;33';\n $this->foreground_colors['light_gray'] = '0;37';\n $this->foreground_colors['white'] = '1;37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }", "public function __construct()\n {\n $this->ext_256_colors = range(0, 0xFF);\n $this->ext_grayscale_colors = range(0xE8, 0xFF);\n }", "protected function genColorNames() {\n\t\treturn array(\n\t\t\t\"aliceblue\"\t=>\t\"#f0f8ff\",\n\t\t\t\"antiquewhite\"\t=>\t\"#faebd7\",\n\t\t\t\"aqua\"\t=>\t\"#00ffff\",\n\t\t\t\"aquamarine\"\t=>\t\"#7fffd4\",\n\t\t\t\"azure\"\t=>\t\"#f0ffff\",\n\t\t\t\"beige\"\t=>\t\"#f5f5dc\",\n\t\t\t\"bisque\"\t=>\t\"#ffe4c4\",\n\t\t\t\"black\"\t=>\t\"#000000\",\n\t\t\t\"blanchedalmond\"\t=>\t\"#ffebcd\",\n\t\t\t\"blue\"\t=>\t\"#0000ff\",\n\t\t\t\"blueviolet\"\t=>\t\"#8a2be2\",\n\t\t\t\"brown\"\t=>\t\"#a52a2a\",\n\t\t\t\"burlywood\"\t=>\t\"#deb887\",\n\t\t\t\"cadetblue\"\t=>\t\"#5f9ea0\",\n\t\t\t\"chartreuse\"\t=>\t\"#7fff00\",\n\t\t\t\"chocolate\"\t=>\t\"#d2691e\",\n\t\t\t\"coral\"\t=>\t\"#ff7f50\",\n\t\t\t\"cornflowerblue\"\t=>\t\"#6495ed\",\n\t\t\t\"cornsilk\"\t=>\t\"#fff8dc\",\n\t\t\t\"crimson\"\t=>\t\"#dc143c\",\n\t\t\t\"cyan\"\t=>\t\"#00ffff\",\n\t\t\t\"darkblue\"\t=>\t\"#00008b\",\n\t\t\t\"darkcyan\"\t=>\t\"#008b8b\",\n\t\t\t\"darkgoldenrod\"\t=>\t\"#b8860b\",\n\t\t\t\"darkgray\"\t=>\t\"#a9a9a9\",\n\t\t\t\"darkgrey\"\t=>\t\"#a9a9a9\",\n\t\t\t\"darkgreen\"\t=>\t\"#006400\",\n\t\t\t\"darkkhaki\"\t=>\t\"#bdb76b\",\n\t\t\t\"darkmagenta\"\t=>\t\"#8b008b\",\n\t\t\t\"darkolivegreen\"\t=>\t\"#556b2f\",\n\t\t\t\"darkorange\"\t=>\t\"#ff8c00\",\n\t\t\t\"darkorchid\"\t=>\t\"#9932cc\",\n\t\t\t\"darkred\"\t=>\t\"#8b0000\",\n\t\t\t\"darksalmon\"\t=>\t\"#e9967a\",\n\t\t\t\"darkseagreen\"\t=>\t\"#8fbc8f\",\n\t\t\t\"darkslateblue\"\t=>\t\"#483d8b\",\n\t\t\t\"darkslategray\"\t=>\t\"#2f4f4f\",\n\t\t\t\"darkslategrey\"\t=>\t\"#2f4f4f\",\n\t\t\t\"darkturquoise\"\t=>\t\"#00ced1\",\n\t\t\t\"darkviolet\"\t=>\t\"#9400d3\",\n\t\t\t\"deeppink\"\t=>\t\"#ff1493\",\n\t\t\t\"deepskyblue\"\t=>\t\"#00bfff\",\n\t\t\t\"dimgray\"\t=>\t\"#696969\",\n\t\t\t\"dimgrey\"\t=>\t\"#696969\",\n\t\t\t\"dodgerblue\"\t=>\t\"#1e90ff\",\n\t\t\t\"firebrick\"\t=>\t\"#b22222\",\n\t\t\t\"floralwhite\"\t=>\t\"#fffaf0\",\n\t\t\t\"forestgreen\"\t=>\t\"#228b22\",\n\t\t\t\"fuchsia\"\t=>\t\"#ff00ff\",\n\t\t\t\"gainsboro\"\t=>\t\"#dcdcdc\",\n\t\t\t\"ghostwhite\"\t=>\t\"#f8f8ff\",\n\t\t\t\"gold\"\t=>\t\"#ffd700\",\n\t\t\t\"goldenrod\"\t=>\t\"#daa520\",\n\t\t\t\"gray\"\t=>\t\"#808080\",\n\t\t\t\"grey\"\t=>\t\"#808080\",\n\t\t\t\"green\"\t=>\t\"#008000\",\n\t\t\t\"greenyellow\"\t=>\t\"#adff2f\",\n\t\t\t\"honeydew\"\t=>\t\"#f0fff0\",\n\t\t\t\"hotpink\"\t=>\t\"#ff69b4\",\n\t\t\t\"indianred \"\t=>\t\"#cd5c5c\",\n\t\t\t\"indigo \"\t=>\t\"#4b0082\",\n\t\t\t\"ivory\"\t=>\t\"#fffff0\",\n\t\t\t\"khaki\"\t=>\t\"#f0e68c\",\n\t\t\t\"lavender\"\t=>\t\"#e6e6fa\",\n\t\t\t\"lavenderblush\"\t=>\t\"#fff0f5\",\n\t\t\t\"lawngreen\"\t=>\t\"#7cfc00\",\n\t\t\t\"lemonchiffon\"\t=>\t\"#fffacd\",\n\t\t\t\"lightblue\"\t=>\t\"#add8e6\",\n\t\t\t\"lightcoral\"\t=>\t\"#f08080\",\n\t\t\t\"lightcyan\"\t=>\t\"#e0ffff\",\n\t\t\t\"lightgoldenrodyellow\"\t=>\t\"#fafad2\",\n\t\t\t\"lightgray\"\t=>\t\"#d3d3d3\",\n\t\t\t\"lightgrey\"\t=>\t\"#d3d3d3\",\n\t\t\t\"lightgreen\"\t=>\t\"#90ee90\",\n\t\t\t\"lightpink\"\t=>\t\"#ffb6c1\",\n\t\t\t\"lightsalmon\"\t=>\t\"#ffa07a\",\n\t\t\t\"lightseagreen\"\t=>\t\"#20b2aa\",\n\t\t\t\"lightskyblue\"\t=>\t\"#87cefa\",\n\t\t\t\"lightslategray\"\t=>\t\"#778899\",\n\t\t\t\"lightslategrey\"\t=>\t\"#778899\",\n\t\t\t\"lightsteelblue\"\t=>\t\"#b0c4de\",\n\t\t\t\"lightyellow\"\t=>\t\"#ffffe0\",\n\t\t\t\"lime\"\t=>\t\"#00ff00\",\n\t\t\t\"limegreen\"\t=>\t\"#32cd32\",\n\t\t\t\"linen\"\t=>\t\"#faf0e6\",\n\t\t\t\"magenta\"\t=>\t\"#ff00ff\",\n\t\t\t\"maroon\"\t=>\t\"#800000\",\n\t\t\t\"mediumaquamarine\"\t=>\t\"#66cdaa\",\n\t\t\t\"mediumblue\"\t=>\t\"#0000cd\",\n\t\t\t\"mediumorchid\"\t=>\t\"#ba55d3\",\n\t\t\t\"mediumpurple\"\t=>\t\"#9370db\",\n\t\t\t\"mediumseagreen\"\t=>\t\"#3cb371\",\n\t\t\t\"mediumslateblue\"\t=>\t\"#7b68ee\",\n\t\t\t\"mediumspringgreen\"\t=>\t\"#00fa9a\",\n\t\t\t\"mediumturquoise\"\t=>\t\"#48d1cc\",\n\t\t\t\"mediumvioletred\"\t=>\t\"#c71585\",\n\t\t\t\"midnightblue\"\t=>\t\"#191970\",\n\t\t\t\"mintcream\"\t=>\t\"#f5fffa\",\n\t\t\t\"mistyrose\"\t=>\t\"#ffe4e1\",\n\t\t\t\"moccasin\"\t=>\t\"#ffe4b5\",\n\t\t\t\"navajowhite\"\t=>\t\"#ffdead\",\n\t\t\t\"navy\"\t=>\t\"#000080\",\n\t\t\t\"oldlace\"\t=>\t\"#fdf5e6\",\n\t\t\t\"olive\"\t=>\t\"#808000\",\n\t\t\t\"olivedrab\"\t=>\t\"#6b8e23\",\n\t\t\t\"orange\"\t=>\t\"#ffa500\",\n\t\t\t\"orangered\"\t=>\t\"#ff4500\",\n\t\t\t\"orchid\"\t=>\t\"#da70d6\",\n\t\t\t\"palegoldenrod\"\t=>\t\"#eee8aa\",\n\t\t\t\"palegreen\"\t=>\t\"#98fb98\",\n\t\t\t\"paleturquoise\"\t=>\t\"#afeeee\",\n\t\t\t\"palevioletred\"\t=>\t\"#db7093\",\n\t\t\t\"papayawhip\"\t=>\t\"#ffefd5\",\n\t\t\t\"peachpuff\"\t=>\t\"#ffdab9\",\n\t\t\t\"peru\"\t=>\t\"#cd853f\",\n\t\t\t\"pink\"\t=>\t\"#ffc0cb\",\n\t\t\t\"plum\"\t=>\t\"#dda0dd\",\n\t\t\t\"powderblue\"\t=>\t\"#b0e0e6\",\n\t\t\t\"purple\"\t=>\t\"#800080\",\n\t\t\t\"red\"\t=>\t\"#ff0000\",\n\t\t\t\"rosybrown\"\t=>\t\"#bc8f8f\",\n\t\t\t\"royalblue\"\t=>\t\"#4169e1\",\n\t\t\t\"saddlebrown\"\t=>\t\"#8b4513\",\n\t\t\t\"salmon\"\t=>\t\"#fa8072\",\n\t\t\t\"sandybrown\"\t=>\t\"#f4a460\",\n\t\t\t\"seagreen\"\t=>\t\"#2e8b57\",\n\t\t\t\"seashell\"\t=>\t\"#fff5ee\",\n\t\t\t\"sienna\"\t=>\t\"#a0522d\",\n\t\t\t\"silver\"\t=>\t\"#c0c0c0\",\n\t\t\t\"skyblue\"\t=>\t\"#87ceeb\",\n\t\t\t\"slateblue\"\t=>\t\"#6a5acd\",\n\t\t\t\"slategray\"\t=>\t\"#708090\",\n\t\t\t\"slategrey\"\t=>\t\"#708090\",\n\t\t\t\"snow\"\t=>\t\"#fffafa\",\n\t\t\t\"springgreen\"\t=>\t\"#00ff7f\",\n\t\t\t\"steelblue\"\t=>\t\"#4682b4\",\n\t\t\t\"tan\"\t=>\t\"#d2b48c\",\n\t\t\t\"teal\"\t=>\t\"#008080\",\n\t\t\t\"thistle\"\t=>\t\"#d8bfd8\",\n\t\t\t\"tomato\"\t=>\t\"#ff6347\",\n\t\t\t\"turquoise\"\t=>\t\"#40e0d0\",\n\t\t\t\"violet\"\t=>\t\"#ee82ee\",\n\t\t\t\"wheat\"\t=>\t\"#f5deb3\",\n\t\t\t\"white\"\t=>\t\"#ffffff\",\n\t\t\t\"whitesmoke\"\t=>\t\"#f5f5f5\",\n\t\t\t\"yellow\"\t=>\t\"#ffff00\",\n\t\t\t\"yellowgreen\"\t=>\t\"#9acd32\"\n\t\t);\n\t}", "public function __construct()\n {\n $this->startColor = new Color(Color::COLOR_BLACK);\n $this->endColor = new Color(Color::COLOR_WHITE);\n }", "private function __construct() {\n\t\tadd_action( 'after_setup_theme', array( $this, 'wyf_color_palette_setup' ), 100 );\n\t}", "public function initialize() : void\n {\n foreach(glob(\"{$this->cssDir}/*.css\") as $file) {\n $filename = basename($file);\n $url = \"{$this->cssUrl}/$filename\";\n $content = file_get_contents($file);\n $comment = strstr($content, \"*/\", true);\n $comment = preg_replace([\"#\\/\\*!#\", \"#\\*#\"], \"\", $comment);\n $comment = preg_replace(\"#@#\", \"<br>@\", $comment);\n $first = strpos($comment, \".\");\n $short = substr($comment, 0, $first + 1);\n $long = substr($comment, $first + 1);\n $this->styles[$url] = [\n \"shortDescription\" => $short,\n \"longDescription\" => $long,\n ];\n }\n\n foreach ($this->styles as $key => $value) {\n $isMinified = strstr($key, \".min.css\", true);\n if ($isMinified) {\n unset($this->styles[\"$isMinified.css\"]);\n }\n }\n }", "public function getColorCount () {}", "function csstoolsexp_color_names()\n{\n return array(\n 'indianred' => '#CD5C5C', 'lightcoral' => '#F08080',\n 'salmon' => '#FA8072', 'darksalmon' => '#E9967A',\n 'lightsalmon' => '#FFA07A', 'crimson' => '#DC143C',\n 'red' => '#FF0000', 'firebrick' => '#B22222',\n 'darkred' => '#8B0000', 'pink' => '#FFC0CB',\n 'lightpink' => '#FFB6C1', 'hotpink' => '#FF69B4',\n 'deeppink' => '#FF1493', 'mediumvioletred' => '#C71585',\n 'palevioletred' => '#DB7093', 'lightsalmon' => '#FFA07A',\n 'coral' => '#FF7F50', 'tomato' => '#FF6347',\n 'orangered' => '#FF4500', 'darkorange' => '#FF8C00',\n 'orange' => '#FFA500', 'gold' => '#FFD700',\n 'yellow' => '#FFFF00', 'lightyellow' => '#FFFFE0',\n 'lemonchiffon' => '#FFFACD', 'lightgoldenrodyellow' => '#FAFAD2',\n 'papayawhip' => '#FFEFD5', 'moccasin' => '#FFE4B5',\n 'peachpuff' => '#FFDAB9', 'palegoldenrod' => '#EEE8AA',\n 'khaki' => '#F0E68C', 'darkkhaki' => '#BDB76B',\n 'lavender' => '#E6E6FA', 'thistle' => '#D8BFD8',\n 'plum' => '#DDA0DD', 'violet' => '#EE82EE',\n 'orchid' => '#DA70D6', 'fuchsia' => '#FF00FF',\n 'magenta' => '#FF00FF', 'mediumorchid' => '#BA55D3',\n 'mediumpurple' => '#9370DB', 'blueviolet' => '#8A2BE2',\n 'darkviolet' => '#9400D3', 'darkorchid' => '#9932CC',\n 'darkmagenta' => '#8B008B', 'purple' => '#800080',\n 'indigo' => '#4B0082', 'slateblue' => '#6A5ACD',\n 'darkslateblue' => '#483D8B', 'mediumslateblue' => '#7B68EE',\n 'greenyellow' => '#ADFF2F', 'chartreuse' => '#7FFF00',\n 'lawngreen' => '#7CFC00', 'lime' => '#00FF00',\n 'limegreen' => '#32CD32', 'palegreen' => '#98FB98',\n 'lightgreen' => '#90EE90', 'mediumspringgreen' => '#00FA9A',\n 'springgreen' => '#00FF7F', 'mediumseagreen' => '#3CB371',\n 'seagreen' => '#2E8B57', 'forestgreen' => '#228B22',\n 'green' => '#008000', 'darkgreen' => '#006400',\n 'yellowgreen' => '#9ACD32', 'olivedrab' => '#6B8E23',\n 'olive' => '#808000', 'darkolivegreen' => '#556B2F',\n 'mediumaquamarine' => '#66CDAA', 'darkseagreen' => '#8FBC8F',\n 'lightseagreen' => '#20B2AA', 'darkcyan' => '#008B8B',\n 'teal' => '#008080', 'aqua' => '#00FFFF',\n 'cyan' => '#00FFFF', 'lightcyan' => '#E0FFFF',\n 'paleturquoise' => '#AFEEEE', 'aquamarine' => '#7FFFD4',\n 'turquoise' => '#40E0D0', 'mediumturquoise' => '#48D1CC',\n 'darkturquoise' => '#00CED1', 'cadetblue' => '#5F9EA0',\n 'steelblue' => '#4682B4', 'lightsteelblue' => '#B0C4DE',\n 'powderblue' => '#B0E0E6', 'lightblue' => '#ADD8E6',\n 'skyblue' => '#87CEEB', 'lightskyblue' => '#87CEFA',\n 'deepskyblue' => '#00BFFF', 'dodgerblue' => '#1E90FF',\n 'cornflowerblue' => '#6495ED', 'mediumslateblue' => '#7B68EE',\n 'royalblue' => '#4169E1', 'blue' => '#0000FF',\n 'mediumblue' => '#0000CD', 'darkblue' => '#00008B',\n 'navy' => '#000080', 'midnightblue' => '#191970',\n 'cornsilk' => '#FFF8DC', 'blanchedalmond' => '#FFEBCD',\n 'bisque' => '#FFE4C4', 'navajowhite' => '#FFDEAD',\n 'wheat' => '#F5DEB3', 'burlywood' => '#DEB887',\n 'tan' => '#D2B48C', 'rosybrown' => '#BC8F8F',\n 'sandybrown' => '#F4A460', 'goldenrod' => '#DAA520',\n 'darkgoldenrod' => '#B8860B', 'peru' => '#CD853F',\n 'chocolate' => '#D2691E', 'saddlebrown' => '#8B4513',\n 'sienna' => '#A0522D', 'brown' => '#A52A2A',\n 'maroon' => '#800000', 'white' => '#FFFFFF',\n 'snow' => '#FFFAFA', 'honeydew' => '#F0FFF0',\n 'mintcream' => '#F5FFFA', 'azure' => '#F0FFFF',\n 'aliceblue' => '#F0F8FF', 'ghostwhite' => '#F8F8FF',\n 'whitesmoke' => '#F5F5F5', 'seashell' => '#FFF5EE',\n 'beige' => '#F5F5DC', 'oldlace' => '#FDF5E6',\n 'floralwhite' => '#FFFAF0', 'ivory' => '#FFFFF0',\n 'antiquewhite' => '#FAEBD7', 'linen' => '#FAF0E6',\n 'lavenderblush' => '#FFF0F5', 'mistyrose' => '#FFE4E1',\n 'gainsboro' => '#DCDCDC', 'lightgrey' => '#D3D3D3',\n 'silver' => '#C0C0C0', 'darkgray' => '#A9A9A9',\n 'gray' => '#808080', 'dimgray' => '#696969',\n 'lightslategray' => '#778899', 'slategray' => '#708090',\n 'darkslategray' => '#2F4F4F', 'black' => '#000000',\n );\n}", "public function __construct($name)\n {\n $this->mylogger = new MyLogger(false);\n\n $this->setImageParameters($name);\n\n $this->setColours($this->getImageParams('type'));\n }", "public function __construct ($color = null) {}", "protected function resetNames()\n\t{\n\t\t$this->cnt = 0;\n\t\t$this->varNames = [];\n\t}", "public function _set_colors()\n\t{\n\t\t$orginal_colors = Event::$data;\n\t\t//Group categories\n\t\t$sg_cats = $this->_get_group_categories();\n\t\t$category_id = $this->_get_categories();\n\n\t\t\n\t\t\n\t\t//get color\n \t\tif(((count($sg_cats) == 1 AND intval($sg_cats[0]) == 0) AND (count($category_id) == 1 AND intval($category_id[0]) == 0 )) OR \n \t\t(count($sg_cats) == 0 AND count($category_id) == 0))\n\t\t{\n\t\t\t$colors = array(Kohana::config('settings.default_map_all'));\n\t\t}\t\t\n\t\telse \n\t\t{\t\n\t\t\t//more than one color\n\t\t\t$colors = array();\n\t\t\tforeach($sg_cats as $cat)\n\t\t\t{\n\t\t\t\t$colors[] = ORM::factory('simplegroups_category', $cat)->category_color;\n\t\t\t}\n\t\t\tforeach($category_id as $cat)\n\t\t\t{\n\t\t\t\t$colors[] = ORM::factory('category', $cat)->category_color;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t//check if we're dealing with just one color\n\t\tif(count($colors)==1)\n\t\t{\n\t\t\tforeach($colors as $color)\n\t\t\t{\n\t\t\t\tEvent::$data = $color;\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//now for each color break it into RGB, add them up, then normalize\n\t\t$red = 0;\n\t\t$green = 0;\n\t\t$blue = 0;\n\t\tforeach($colors as $color)\n\t\t{\n\t\t\t$numeric_colors = $this->_hex2RGB($color);\n\t\t\t$red = $red + $numeric_colors['red'];\n\t\t\t$green = $green + $numeric_colors['green'];\n\t\t\t$blue = $blue + $numeric_colors['blue'];\n\t\t}\n\t\t//now normalize\n\t\t$color_length = sqrt( ($red*$red) + ($green*$green) + ($blue*$blue));\n\t\n\t\t//make sure there's no divide by zero\n\t\tif($color_length == 0)\n\t\t{\n\t\t\t$color_length = 255;\n\t\t}\n\t\t$red = ($red / $color_length) * 255;\n\t\t$green = ($green / $color_length) * 255;\n\t\t$blue = ($blue / $color_length) * 255;\n\t\n\t\t\n\t\t//pad with zeros if there's too much space\n\t\t$red = dechex($red);\n\t\tif(strlen($red) < 2)\n\t\t{\n\t\t\t$red = \"0\".$red;\n\t\t}\n\t\t$green = dechex($green);\n\t\tif(strlen($green) < 2)\n\t\t{\n\t\t\t$green = \"0\".$green;\n\t\t}\n\t\t$blue = dechex($blue);\n\t\tif(strlen($blue) < 2)\n\t\t{\n\t\t\t$blue = \"0\".$blue;\n\t\t}\n\t\t//now put the color back together and return it\n\t\t$color_str = $red.$green.$blue;\n\t\t//in case other plugins have something to say about this\n\t\tEvent::$data = $color_str;\t\t\n\t}", "public function __construct(array $colors = array())\n {\n $this->colors = empty($colors) ? range(31, 36) : $colors;\n $this->count = count($this->colors);\n }", "public function __construct( $in_color ) {\n\t\t$this->in_color = $in_color;\n\t}", "public function __construct(string $webHexString)\r\n {$this->_ColorString = $webHexString;}", "public function __construct()\n {\n // Initialise values\n $this->_oddHeader = '';\n $this->_oddFooter = '';\n $this->_evenHeader = '';\n $this->_evenFooter = '';\n $this->_firstHeader = '';\n $this->_firstFooter = '';\n $this->_differentOddEven = false;\n $this->_differentFirst = false;\n $this->_scaleWithDocument = true;\n $this->_alignWithMargins = true;\n $this->_headerFooterImages = array();\n }", "public function __construct($catname) {\n //from inside class, refer to other members with \n //$this->membername\n $this -> colour = \"calico\";\n $this -> name = $catname;\n }", "public function __construct()\n {\n $this->alignment = new Alignment();\n $this->font = new Font();\n $this->bulletStyle = new Bullet();\n }", "public function colors()\n {\n static::$spec = 'colors';\n return $this;\n }", "public function getImageColors() {\n\t}", "protected function initializeFormatCallables()\n {\n $this->formats = array(\n self::FORMAT_PNG => 'imagepng',\n self::FORMAT_JPG => 'imagejpeg',\n );\n }", "public function __construct(string $color) {\n $this->color = $color;\n }", "public function formatColors()\n {\n // remove 73 because not sure what it is right now\n $this->description = preg_replace(\"#<UIGlow>(.*?)</UIGlow>#is\", null, $this->description);\n \n // replace 72 closing with a reset\n $this->description = str_ireplace('<UIForeground>01</UIForeground>', '__ENDSPAN__', $this->description);\n \n // replace all colour entries with hex values\n preg_match_all(\"#<UIForeground>(.*?)</UIForeground>#is\", $this->description, $matches);\n foreach($matches[1] as $code) {\n // we only care for last 2 bytes\n $color = substr($code, -4);\n \n // convert hex to decimal\n $color = hexdec($color);\n \n // grab colour code\n $color = $this->colours[$color] ?? 0;\n \n // convert dec to hex\n $color = dechex($color);\n \n // ensure its padded correctly\n $color = str_pad($color, 6, '0', STR_PAD_LEFT);\n \n // ignore alpha and just take the first 6\n $color = substr($color, 0, 6);\n $this->description = str_ireplace(\"<UIForeground>{$code}</UIForeground>\", \"--START_SPAN style=\\\"color:#{$color};\\\"--\", $this->description);\n }\n }", "protected function set_sections() \n\t{\n\t\t$this->color_sections = 255 / $this->color_depth;\n\n\t\techo 'Color sections: '. $this->color_sections .\"\\n\";\n\t}", "public function __construct()\n\t{\n\t\tif ( !$this->_attrdefs ) \n\t\t\t$this->_attrdefs = $this->attrdefs();\n\n\t\tforeach ( $this->_attrdefs as $name => & $attr ) {\n\t\t\t$this->_init_attrdef( $name );\n\t\t}\n\t}" ]
[ "0.6510939", "0.64934105", "0.64244556", "0.6339809", "0.6339809", "0.6181632", "0.59658325", "0.5961896", "0.59380627", "0.5538272", "0.54812694", "0.5429862", "0.5408053", "0.53748775", "0.53457564", "0.52660495", "0.5221125", "0.52071273", "0.5130766", "0.51241475", "0.51040184", "0.5100806", "0.5073542", "0.503923", "0.50241524", "0.50036746", "0.49897113", "0.49848223", "0.49802616", "0.49480182" ]
0.6569068
0
This is the factory method. You can pass a string and will get a Jm_Console_TextStyle object or an Exception if $string is invalid.
public function createFromString($string) { // if the style has been created before return it if(isset($this->cache[$string])) { return $this->cache[$string]; } // get a default style $style = new Jm_Console_TextStyle(); $parser = $this->parser; call_user_func($parser, $string, $style); // add the style to the cache $this->cache[$string]= $style; return $style; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function text($text){\n\t\t\treturn new CLIStyle($text);\n\t\t}", "protected function defaultTextStyleParser($string, $style) {\n\n foreach(explode(',', $string) as $statement) {\n $statement = trim($statement);\n $keyval = explode(':', $statement);\n\n if(count($keyval) < 2) {\n // it's a simple statement\n if(in_array($statement, array(\n 'black', 'red', 'green', 'yellow',\n 'blue', 'purple', 'cyan', 'white',\n 'default'\n ))) {\n $style->setForegroundColor($this->colornames[$statement]);\n continue;\n\n } elseif (in_array($statement, array(\n 'bold', 'light', 'italic', 'underline',\n 'blink_slow', 'blink_rapid', 'blink',\n 'reverse', 'hidden'\n ))) {\n $style->setTextDecoration($this->decorations[$statement]);\n continue;\n }\n\n // if its not a color or a text decoration it is an error\n throw new Jm_Console_TextStyleException (\n 'Failed to parse the style identifier \\'' . $string . '\\''\n . '. Unknown statement \\'' . $statement . '\\''\n );\n }\n\n // fully qualified statemens have a key and a value \n // separated by a ':' \n list($key, $value) = $keyval;\n switch($key) {\n case 'fg' :\n if(!isset($this->colornames[$value])) {\n throw new Jm_Console_TextStyleException (sprintf(\n 'Failed to parse the style identifier \\'%s\\''\n . '. Unknown foreground color value \\'%s\\'',\n $string, $value\n ));\n }\n\n $style->setForegroundColor($this->colornames[$value]);\n break;\n\n case 'bg' :\n if(!isset($this->colornames[$value])) {\n throw new Jm_Console_TextStyleException (sprintf(\n 'Failed to parse the style identifier \\'%s\\''\n . '. Unknown text decoration value \\'%s\\'',\n $string, $value\n ));\n }\n\n $style->setBackgroundColor($this->colornames[$value]);\n break; \n\n case 'td' :\n if(!isset($this->decorations[$value])) {\n throw new Jm_Console_TextStyleException (sprintf(\n 'Failed to parse the style identifier \\'%s\\''\n . '. Unknown text decoration value \\'%s\\'',\n $string, $value\n ));\n }\n $style->setTextDecoration($this->decorations[$value]);\n break; \n\n default :\n // if we reached this point something failed\n throw new Jm_Console_TextStyleException (sprintf(\n 'Failed to parse the style identifier \\'%s\\''\n . '. Unknown text style property \\'%s\\'',\n $string, $key\n ));\n }\n }\n }", "public function setDefaultTextStyle($style) {\n if(is_string($style)) {\n $style = Jm_Console_TextStyleFactory::singleton()\n ->createFromString($style);\n }\n\n if(!is_a($style, 'Jm_Console_TextStyle')) {\n throw new Exception(sprintf(\n '$style eas expected to be a string. %s found',\n gettype($style)\n ));\n }\n\n $this->defaultTextStyle = $style;\n\n return $this;\n }", "public function __construct() {\n \n $this->colornames = array(\n 'black' => Jm_Console_TextStyle::BLACK,\n 'red' => Jm_Console_TextStyle::RED,\n 'green' => Jm_Console_TextStyle::GREEN,\n 'yellow' => Jm_Console_TextStyle::YELLOW,\n 'blue' => Jm_Console_TextStyle::BLUE,\n 'purple' => Jm_Console_TextStyle::PURPLE,\n 'cyan' => Jm_Console_TextStyle::CYAN,\n 'white' => Jm_Console_TextStyle::WHITE,\n 'default' => Jm_Console_TextStyle::DEFAULT_COLOR\n );\n\n $this->decorations = array(\n 'bold' => Jm_Console_TextStyle::BOLD,\n 'light' => Jm_Console_TextStyle::LIGHT,\n 'italic' => Jm_Console_TextStyle::ITALIC,\n 'underline' => Jm_Console_TextStyle::UNDERLINE,\n 'blink_slow' => Jm_Console_TextStyle::BLINK_SLOW,\n 'blink_rapid' => Jm_Console_TextStyle::BLINK_RAPID,\n 'blink' => Jm_Console_TextStyle::BLINK,\n 'reverse' => Jm_Console_TextStyle::REVERSE,\n 'hidden' => Jm_Console_TextStyle::HIDDEN,\n 'default' => Jm_Console_TextStyle::NO_DECORATIONS\n );\n\n $this->cache = array();\n\n $this->parser = array($this, 'defaultTextStyleParser');\n }", "public static function singleton() {\n if(!static::$instance) {\n static::$instance = new Jm_Console_TextStyleFactory();\n }\n return static::$instance;\n }", "public function textStyle($textStyleConfig)\n {\n return $this->setOption(__FUNCTION__, new TextStyle($textStyleConfig));\n }", "public function textStyle($textStyle)\r\n {\r\n if(Helpers::is_textStyle($textStyle))\r\n {\r\n $this->textStyle = $textStyle->values();\r\n } else {\r\n $this->type_error(__FUNCTION__, 'object', 'class (textStyle)');\r\n }\r\n\r\n return $this;\r\n }", "public function create() : \\RectorPrefix20210716\\Symfony\\Component\\Console\\Style\\SymfonyStyle\n {\n if (!isset($_SERVER['argv'])) {\n $_SERVER['argv'] = [];\n }\n $argvInput = new \\RectorPrefix20210716\\Symfony\\Component\\Console\\Input\\ArgvInput();\n $consoleOutput = new \\RectorPrefix20210716\\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n // to configure all -v, -vv, -vvv options without memory-lock to Application run() arguments\n $this->privatesCaller->callPrivateMethod(new \\RectorPrefix20210716\\Symfony\\Component\\Console\\Application(), 'configureIO', [$argvInput, $consoleOutput]);\n // --debug is called\n if ($argvInput->hasParameterOption('--debug')) {\n $consoleOutput->setVerbosity(\\RectorPrefix20210716\\Symfony\\Component\\Console\\Output\\OutputInterface::VERBOSITY_DEBUG);\n }\n // disable output for tests\n if (\\RectorPrefix20210716\\Symplify\\EasyTesting\\PHPUnit\\StaticPHPUnitEnvironment::isPHPUnitRun()) {\n $consoleOutput->setVerbosity(\\RectorPrefix20210716\\Symfony\\Component\\Console\\Output\\OutputInterface::VERBOSITY_QUIET);\n }\n return new \\RectorPrefix20210716\\Symfony\\Component\\Console\\Style\\SymfonyStyle($argvInput, $consoleOutput);\n }", "public static function factory(string $text): Text\n {\n $instance = new static();\n $instance->text = $text;\n return $instance;\n }", "public static function bg_color($color, $string)\n {\n if (!isset(self::$background[$color]))\n {\n throw new Exception('Background color is not defined');\n }\n \n return \"\\033[\" . self::$background[$color] . 'm' . $string . \"\\033[0m\";\n }", "public function getDefaultTextStyle() {\n if(!$this->defaultTextStyle) {\n $this->defaultTextStyle = new Jm_Console_TextStyle();\n }\n return $this->defaultTextStyle;\n }", "public function __construct($text, $depth = 1, $style = null)\n {\n if (!is_null($style)) {\n $this->_style = $style;\n }\n\n $this->_text = $text;\n $this->_depth = $depth;\n\n return $this;\n }", "function __construct($font_size,$font_color,$string_value)\n {\n $this->font_size = $font_size;\n $this->font_color = $font_color;\n $this->string_value = $string_value;\n $this->customize_print();\n }", "function Msg($str,$color){\n echo \"<p style=\\\"color:$color;font-size:1em\\\">$str</p>\"; \n }", "public static function style($text, $style)\n {\n return sprintf(\n \"%s%s%s\",\n (isset(self::$styleTag[$style])) ? self::$styleTag[$style] : \"\",\n $text,\n (isset(self::$styleTag[$style])) ? self::$styleTag[$style] : \"\"\n );\n }", "public function __construct($pText = '')\r\n {\r\n \t// Initialise variables\r\n \t$this->setText($pText);\r\n \t$this->_font = new PHPExcel_Style_Font();\r\n }", "public static function create($text = '')\n {\n return new static($text);\n }", "public function createTextRun(string $pText = ''): Run\n {\n $objText = new Run($pText);\n $objText->setFont(clone $this->font);\n $this->addText($objText);\n\n return $objText;\n }", "public static function DeclarationBorderWithStringValue($stringValue) {\n $instance = new parent(\"border\", $stringValue); //arrumar\n return $instance;\n }", "protected function __construct($style, $title, $text, AbstractWindow $parentWindow = null) {\n $this->style = $style;\n $this->title = $title;\n $this->text = $text;\n $this->window = $parentWindow;\n }", "public static function fg_color($color, $string)\n {\n if (!isset(self::$foreground[$color]))\n {\n throw new Exception('Foreground color is not defined');\n }\n \n return \"\\033[\" . self::$foreground[$color] . \"m\" . $string . \"\\033[0m\";\n }", "public function newString($string = \"\")\n {\n return new RsoString($string);\n }", "public static function cliWrite($string = '', $color = 'white') \n {\n\t\t\t\n\t\t\t// Set up shell colors\n\t\t\t$colors = array(\n\t\t\t\t\t\t'black' \t\t=> '0;30',\n\t\t\t\t\t\t'dark_gray' \t=> '1;30',\n\t\t\t\t\t\t'blue' \t\t\t=> '0;34',\n\t\t\t\t\t\t'light_blue' \t=> '1;34',\n\t\t\t\t\t\t'green' \t\t=> '0;32',\n\t\t\t\t\t\t'light_green' \t=> '1;32',\n\t\t\t\t\t\t'cyan' \t\t\t=> '0;36',\n\t\t\t\t\t\t'light_cyan' \t=> '1;36',\n\t\t\t\t\t\t'red' \t\t\t=> '0;31',\n\t\t\t\t\t\t'light_red' \t=> '1;31',\n\t\t\t\t\t\t'purple' \t\t=> '0;35',\n\t\t\t\t\t\t'light_purple' \t=> '1;35',\n\t\t\t\t\t\t'brown' \t\t=> '0;33',\n\t\t\t\t\t\t'yellow' \t\t=> '1;33',\n\t\t\t\t\t\t'light_gray' \t=> '0;37',\n\t\t\t\t\t\t'white' \t\t=> '1;37'\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\t//Check if the color exits\n\t\t\tif( isset($colors[$color]) ) {\n\t\t\t\techo \"\\033[\" . $colors[$color] . \"m\" . $string . \"\\033[0m \" . PHP_EOL;\n\t\t\t} else {\n\t\t\t\t//No color Defined.. Just return String\n\t\t\t\techo $string . PHP_EOL;\n\t\t\t}\n\t\t\t\n\t\t}", "public function colorize (\n $message,\n $style\n ) {\n if(is_string($style)) {\n $style = Jm_Console_TextStyle::fromString($style);\n } else if (!is_a($style, 'Jm_Console_TextStyle')) {\n throw new InvalidArgumentException(sprintf(\n '$style expected to be a Jm_Console_TextStyle or a string. '\n . '%s found', gettype($style)\n ));\n }\n\n\n // on non ansi terminals or when ansi has been explicitely disabled\n // we no styling is required\n if ($this->ansiEnabled !== TRUE || !$this->assumeIsatty()) {\n return $message;\n }\n\n // if all style attriubtes set to reset disable styling\n if ($style->getForegroundColor()\n === Jm_Console_TextStyle::DEFAULT_COLOR\n && $style->getBackgroundColor()\n === Jm_Console_TextStyle::DEFAULT_COLOR\n && $style->getTextDecoration()\n === Jm_Console_TextStyle::NO_DECORATIONS) \n {\n return $message;\n }\n\n // wrap the message into an ANSI escape sequence \n // in order to colorize the string\n\n $codes = array();\n if ( $style->getForegroundColor()\n !== Jm_Console_TextStyle::DEFAULT_COLOR ) {\n $codes []= '3' . $style->getForegroundColor();\n }\n if ( $style->getBackgroundColor()\n !== Jm_Console_TextStyle::DEFAULT_COLOR ) {\n $codes []= '4' . $style->getBackgroundColor();\n }\n if ( $style->getTextDecoration()\n !== Jm_Console_TextStyle::NO_DECORATIONS ) {\n $codes []= $style->getTextDecoration();\n }\n\n $ansi = \"\\033[\" . implode(';', $codes) . 'm';\n $ansi .= $message;\n $ansi .= \"\\033[0m\";\n return $ansi;\n }", "public function setFontStyle ($style) {}", "public function initColoredString() {\n $this->foreground_colors['black'] = '0;30';\n $this->foreground_colors['dark_gray'] = '1;30';\n $this->foreground_colors['blue'] = '0;34';\n $this->foreground_colors['light_blue'] = '1;34';\n $this->foreground_colors['green'] = '0;32';\n $this->foreground_colors['light_green'] = '1;32';\n $this->foreground_colors['cyan'] = '0;36';\n $this->foreground_colors['light_cyan'] = '1;36';\n $this->foreground_colors['red'] = '\"0\";31';\n $this->foreground_colors['light_red'] = '1;31';\n $this->foreground_colors['purple'] = '0;35';\n $this->foreground_colors['light_purple'] = '1;35';\n $this->foreground_colors['brown'] = '0;33';\n $this->foreground_colors['yellow'] = '1;33';\n $this->foreground_colors['light_gray'] = '0;37';\n $this->foreground_colors['white'] = '1;37';\n\n $this->background_colors['black'] = '40';\n $this->background_colors['red'] = '41';\n $this->background_colors['green'] = '42';\n $this->background_colors['yellow'] = '43';\n $this->background_colors['blue'] = '44';\n $this->background_colors['magenta'] = '45';\n $this->background_colors['cyan'] = '46';\n $this->background_colors['light_gray'] = '47';\n }", "public function __construct()\n {\n // Initialise values\n $this->style = new Style(false, true);\n }", "public function returnStringWithBackground ($string): string {\n return ANSI_BG_DARK_GREY . ($string) . ANSI_RESET;\n }", "public static function fromString($string)\n {\n return new static($string);\n }", "public function textStyle(TextStyle $textStyle)\n {\n $this->textStyle = $textStyle;\n\n return $this;\n }" ]
[ "0.72492033", "0.7066015", "0.68359876", "0.6419172", "0.6267684", "0.59951", "0.5971782", "0.5961215", "0.584892", "0.58397233", "0.58217394", "0.5763341", "0.57616687", "0.57354367", "0.5733928", "0.5712851", "0.557911", "0.55713594", "0.55711675", "0.5526538", "0.5503796", "0.5497051", "0.5493028", "0.5489502", "0.54856235", "0.5470213", "0.5466733", "0.54654944", "0.5423983", "0.54137474" ]
0.8253703
0
Default text style parser
protected function defaultTextStyleParser($string, $style) { foreach(explode(',', $string) as $statement) { $statement = trim($statement); $keyval = explode(':', $statement); if(count($keyval) < 2) { // it's a simple statement if(in_array($statement, array( 'black', 'red', 'green', 'yellow', 'blue', 'purple', 'cyan', 'white', 'default' ))) { $style->setForegroundColor($this->colornames[$statement]); continue; } elseif (in_array($statement, array( 'bold', 'light', 'italic', 'underline', 'blink_slow', 'blink_rapid', 'blink', 'reverse', 'hidden' ))) { $style->setTextDecoration($this->decorations[$statement]); continue; } // if its not a color or a text decoration it is an error throw new Jm_Console_TextStyleException ( 'Failed to parse the style identifier \'' . $string . '\'' . '. Unknown statement \'' . $statement . '\'' ); } // fully qualified statemens have a key and a value // separated by a ':' list($key, $value) = $keyval; switch($key) { case 'fg' : if(!isset($this->colornames[$value])) { throw new Jm_Console_TextStyleException (sprintf( 'Failed to parse the style identifier \'%s\'' . '. Unknown foreground color value \'%s\'', $string, $value )); } $style->setForegroundColor($this->colornames[$value]); break; case 'bg' : if(!isset($this->colornames[$value])) { throw new Jm_Console_TextStyleException (sprintf( 'Failed to parse the style identifier \'%s\'' . '. Unknown text decoration value \'%s\'', $string, $value )); } $style->setBackgroundColor($this->colornames[$value]); break; case 'td' : if(!isset($this->decorations[$value])) { throw new Jm_Console_TextStyleException (sprintf( 'Failed to parse the style identifier \'%s\'' . '. Unknown text decoration value \'%s\'', $string, $value )); } $style->setTextDecoration($this->decorations[$value]); break; default : // if we reached this point something failed throw new Jm_Console_TextStyleException (sprintf( 'Failed to parse the style identifier \'%s\'' . '. Unknown text style property \'%s\'', $string, $key )); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseText($text)\n {\n }", "public static function parse($text);", "public function getParser();", "function parserHook( $input, $args, &$parser ) \n\t\t{\n $output = $parser->parse( $input, $parser->mTitle, $parser->mOptions, false, false );\n return $output->getText();\n }", "public function textless() {\r\n return $this->parse_list('textless');\r\n }", "public function parse($text) {\n\t\treturn $this->_Parser->parse($text);\n\t}", "function parse($text)\n{\n\t$text = htmlspecialchars($text);\n\t$text = str_replace(\"\\r\", '', $text);\n\n\t$inlist=false;\n\t$otxt='';\n\t$tag='';\n\tforeach(explode(\"\\n\",$text) as $line)\n\t{\n\t\t$line=trim($line);\n\t\t//echo substr($line,0,1);\n\t\tswitch(substr($line,0,1))\n\t\t{\n\t\t\tcase '#':\n\t\t\t\tif(!$inlist)\n\t\t\t\t{\n\t\t\t\t\t$inlist=true;\n\t\t\t\t\t$tag='ol';\n\t\t\t\t\t$otxt.='<ol><li>'.substr($line,1).'</li>';\n\t\t\t\t} else $otxt.='<li>'.substr($line,1).'</li>';\n\t\t\t\tbreak;\n\t\t\tcase '*':\n\t\t\t\tif(!$inlist)\n\t\t\t\t{\n\t\t\t\t\t$inlist=true;\n\t\t\t\t\t$tag='ul';\n\t\t\t\t\t$otxt.='<ul><li>'.substr($line,1).'</li>';\n\t\t\t\t} else $otxt.='<li>'.substr($line,1).'</li>';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif($inlist===true)\n\t\t\t\t{\n\t\t\t\t\t$otxt.='</'.$tag.\">\\n\";\n\t\t\t\t\t$inlist=false;\n\t\t\t\t}\n\t\t\t\tif(strlen($line)>0) $otxt.=\"\\n\".$line;\n\t\t}\n\t}\n\tif($inlist)\n\t\t$otxt.='</'.$tag.\">\\n\";\n\t\n\t$markup = array \n\t( \n\t\t// Strong emphasis.\n\t\t\"/'''(.+?)'''/\",\n\t\t// Emphasis.\n\t\t\"/''(.+?)''/\",\n\t\t// Linkify URLs.\n\t\t'@\\b(?<!\\[)(https?|ftp)://(www\\.)?([A-Z0-9.-]+)(/)?([A-Z0-9/&#+%~=_|?.,!:;-]*[A-Z0-9/&#+%=~_|])?@i',\n\t\t// Linkify text in the form of [http://example.org text]\n\t\t'@\\[(https?|ftp)://([A-Z0-9/&#+%~=_|?.,!:;-]+) (.+?)\\]@i',\n\t\t// Quotes.\n\t\t'/^&gt;(.+)/m',\n\t\t// Headers.\n\t\t'/^==(.+?)==/m',\n\t\t// Box quotes\n\t\t'/\\[\\[(.+)\\]\\]/s'\n\t);\n\t\n\t$html = array \n\t(\n\t\t'<strong>$1</strong>',\n\t\t'<em>$1</em>',\n\t\t'<a href=\"$0\">$1://$2<strong>$3</strong>$4$5</a>',\n\t\t'<a href=\"$1://$2\">$3</a>',\n\t\t'<span class=\"quote\"><strong>&gt;</strong> $1</span>',\n\t\t'<h4 class=\"user\">$1</h4>',\n\t\t'<div class=\"boxquote\">\\1</div>'\n\t);\n\t\n\t$text = preg_replace($markup, $html, $otxt);\n\t$text = preg_replace_callback('/\\[code\\](.+?)\\[\\/code\\]/s','OutputWithLineNumbers',$text);\n\n\treturn str_replace('<br>','<br />',nl2br($text));\n}", "private function _newParserObject()\n\t{\n\t\t$parser = new classes_text_parser();\n\t\t$parser->set( array( 'parseArea' => $this->getBbcodeSection(), 'memberData' => $this->memberData, 'parseBBCode' => $this->getAllowBbcode(), 'parseHtml' => $this->getAllowHtml(), 'parseEmoticons' => $this->getAllowSmilies() ) );\n\t\t\n\t\treturn $parser;\n\t}", "function parse( $text, $linestart = true ) {\n\t\tglobal $wgParser, $wgTitle;\n\t\t$parserOutput = $wgParser->parse( $text, $wgTitle, $this->mParserOptions, $linestart );\n\t\treturn $parserOutput->getText();\n\t}", "function parse() { \r\n $this->iNodeStart = $this->iHtmlTextIndex; \r\n $text = $this->skipToElement(); \r\n if ($text != \"\") { \r\n $this->iNodeType = NODE_TYPE_TEXT; \r\n $this->iNodeName = \"Text\"; \r\n $this->iNodeValue = $text; \r\n $this->iNodeEnd = $this->iHtmlTextIndex; \r\n return true; \r\n } \r\n return $this->readTag(); \r\n }", "function GetParsedText()\n {\n return $this->Parse();\n }", "public function parse();", "public function parse();", "public function parse();", "public function parse();", "function parse_text($tree)\n {\n $this->text_handler = 'ubbtexthandler';\n if(isset($this->text_handler))\n {\n if(function_exists($this->text_handler))\n {\n $f = $this->text_handler;\n return $f($tree, $this);\n }\n }\n return $text;\n }", "public function parser()\n\t{\n\t\t// wraps parser method\n\t}", "abstract public function parse();", "function parse() {\n $this->iNodeStart = $this->iHtmlTextIndex;\n $text = $this->skipToElement();\n if ($text != \"\") {\n $this->iNodeType = NODE_TYPE_TEXT;\n $this->iNodeName = \"Text\";\n $this->iNodeValue = $text;\n $this->iNodeEnd = $this->iHtmlTextIndex;\n return true;\n }\n return $this->readTag();\n }", "protected function scanText()\n {\n if ($this->lastToken->type == 'tag'\n || $this->lastToken->type == 'filter'\n || $this->lastToken->type == 'pipe'\n || $this->lastToken->type == 'attributes'\n || $this->lastToken->type == 'class'\n || $this->lastToken->type == 'id'\n ) {\n $token = $this->scanInput('/([^\\n]+)/', 'text');\n $token->value = preg_replace(\"/ *\\\\\\\\\\(/\", '(', $token->value);\n return $token;\n }\n return null;\n }", "function parse() {}", "abstract function parse();", "public function parse($from_text, $to_text);", "function parse ()\n\t{\n\t\t$this->_tokenize();\n\t\treturn $this->_build();\n\t}", "public function __construct() {\n \n $this->colornames = array(\n 'black' => Jm_Console_TextStyle::BLACK,\n 'red' => Jm_Console_TextStyle::RED,\n 'green' => Jm_Console_TextStyle::GREEN,\n 'yellow' => Jm_Console_TextStyle::YELLOW,\n 'blue' => Jm_Console_TextStyle::BLUE,\n 'purple' => Jm_Console_TextStyle::PURPLE,\n 'cyan' => Jm_Console_TextStyle::CYAN,\n 'white' => Jm_Console_TextStyle::WHITE,\n 'default' => Jm_Console_TextStyle::DEFAULT_COLOR\n );\n\n $this->decorations = array(\n 'bold' => Jm_Console_TextStyle::BOLD,\n 'light' => Jm_Console_TextStyle::LIGHT,\n 'italic' => Jm_Console_TextStyle::ITALIC,\n 'underline' => Jm_Console_TextStyle::UNDERLINE,\n 'blink_slow' => Jm_Console_TextStyle::BLINK_SLOW,\n 'blink_rapid' => Jm_Console_TextStyle::BLINK_RAPID,\n 'blink' => Jm_Console_TextStyle::BLINK,\n 'reverse' => Jm_Console_TextStyle::REVERSE,\n 'hidden' => Jm_Console_TextStyle::HIDDEN,\n 'default' => Jm_Console_TextStyle::NO_DECORATIONS\n );\n\n $this->cache = array();\n\n $this->parser = array($this, 'defaultTextStyleParser');\n }", "function getTokenParsers();", "function pre_edit_parse($txt=\"\")\n\t{\n\t\t$txt = preg_replace( \"#<!--emo&(.+?)-->.+?<!--endemo-->#\", \"\\\\1\" , $txt );\n\t\t\n\t\tif ( $this->parse_bbcode )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// SQL\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#<!--sql-->(.+?)<!--sql1-->(.+?)<!--sql2-->(.+?)<!--sql3-->#eis\", \"\\$this->unconvert_sql(\\\"\\\\2\\\")\", $txt);\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// HTML\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#<!--html-->(.+?)<!--html1-->(.+?)<!--html2-->(.+?)<!--html3-->#e\", \"\\$this->unconvert_htm(\\\"\\\\2\\\")\", $txt);\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Images / Flash\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#<!--Flash (.+?)-->.+?<!--End Flash-->#e\", \"\\$this->unconvert_flash('\\\\1')\", $txt );\n\t\t\t$txt = preg_replace( \"#<img src=[\\\"'](\\S+?)['\\\"].+?\".\">#\" , \"\\[img\\]\\\\1\\[/img\\]\" , $txt );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Email, URLs\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#<a href=[\\\"']mailto:(.+?)['\\\"]>(.+?)</a>#\" , \"\\[email=\\\\1\\]\\\\2\\[/email\\]\" , $txt );\n\t\t\t$txt = preg_replace( \"#<a href=[\\\"'](http://|https://|ftp://|news://)?(\\S+?)['\\\"].+?\".\">(.+?)</a>#\" , \"\\[url=\\\\1\\\\2\\]\\\\3\\[/url\\]\" , $txt );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Quote\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#\" , '[quote]' , $txt );\n\t\t\t$txt = preg_replace( \"#<!--QuoteBegin-{1,2}([^>]+?)\\+([^>]+?)-->(.+?)<!--QuoteEBegin-->#\", \"[quote=\\\\1,\\\\2]\" , $txt );\n\t\t\t$txt = preg_replace( \"#<!--QuoteBegin-{1,2}([^>]+?)\\+-->(.+?)<!--QuoteEBegin-->#\" , \"[quote=\\\\1]\" , $txt );\n\t\t\t$txt = preg_replace( \"#<!--QuoteEnd-->(.+?)<!--QuoteEEnd-->#\" , '[/quote]' , $txt );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// CODE\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#<!--c1-->(.+?)<!--ec1-->#\", '[code]' , $txt );\n\t\t\t$txt = preg_replace( \"#<!--c2-->(.+?)<!--ec2-->#\", '[/code]', $txt );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Easy peasy\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#<i>(.+?)</i>#is\" , \"\\[i\\]\\\\1\\[/i\\]\" , $txt );\n\t\t\t$txt = preg_replace( \"#<b>(.+?)</b>#is\" , \"\\[b\\]\\\\1\\[/b\\]\" , $txt );\n\t\t\t$txt = preg_replace( \"#<s>(.+?)</s>#is\" , \"\\[s\\]\\\\1\\[/s\\]\" , $txt );\n\t\t\t$txt = preg_replace( \"#<u>(.+?)</u>#is\" , \"\\[u\\]\\\\1\\[/u\\]\" , $txt );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// List headache\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#(\\n){0,}<ul>#\" , \"\\\\1\\[list\\]\" , $txt );\n\t\t\t$txt = preg_replace( \"#(\\n){0,}<ol type='(a|A|i|I|1)'>#\" , \"\\\\1\\[list=\\\\2\\]\\n\" , $txt );\n\t\t\t$txt = preg_replace( \"#(\\n){0,}<li>#\" , \"\\n\\[*\\]\" , $txt );\n\t\t\t$txt = preg_replace( \"#(\\n){0,}</ul>(\\n){0,}#\", \"\\n\\[/list\\]\\\\2\" , $txt );\n\t\t\t$txt = preg_replace( \"#(\\n){0,}</ol>(\\n){0,}#\", \"\\n\\[/list\\]\\\\2\" , $txt );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// SPAN\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\twhile ( preg_match( \"#<span style=['\\\"]font-size:(.+?)pt;line-height:100%['\\\"]>(.+?)</span>#is\", $txt ) )\n\t\t\t{\n\t\t\t\t$txt = preg_replace( \"#<span style=['\\\"]font-size:(.+?)pt;line-height:100%['\\\"]>(.+?)</span>#ise\" , \"\\$this->unconvert_size('\\\\1', '\\\\2')\", $txt );\n\t\t\t}\n\t\t\t\n\t\t\twhile ( preg_match( \"#<span style=['\\\"]color:(.+?)['\\\"]>(.+?)</span>#is\", $txt ) )\n\t\t\t{\n\t\t\t\t$txt = preg_replace( \"#<span style=['\\\"]color:(.+?)['\\\"]>(.+?)</span>#is\" , \"\\[color=\\\\1\\]\\\\2\\[/color\\]\", $txt );\n\t\t\t}\n\t\t\t\n\t\t\twhile ( preg_match( \"#<span style=['\\\"]font-family:(.+?)['\\\"]>(.+?)</span>#is\", $txt ) )\n\t\t\t{\n\t\t\t\t$txt = preg_replace( \"#<span style=['\\\"]font-family:(.+?)['\\\"]>(.+?)</span>#is\", \"\\[font=\\\\1\\]\\\\2\\[/font\\]\", $txt );\n\t\t\t}\n\t\t\t\n\t\t\twhile ( preg_match( \"#<span style=['\\\"]background-color:(.+?)['\\\"]>(.+?)</span>#is\", $txt ) )\n\t\t\t{\n\t\t\t\t$txt = preg_replace( \"#<span style=['\\\"]background-color:(.+?)['\\\"]>(.+?)</span>#is\", \"\\[background=\\\\1\\]\\\\2\\[/font\\]\", $txt );\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Tidy up the end quote stuff\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$txt = preg_replace( \"#(\\[/QUOTE\\])\\s*?<br />\\s*#si\", \"\\\\1\\n\", $txt );\n\t\t\t$txt = preg_replace( \"#(\\[/QUOTE\\])\\s*?<br>\\s*#si\" , \"\\\\1\\n\", $txt );\n\t\t\t\n\t\t\t$txt = preg_replace( \"#<!--EDIT\\|.+?\\|.+?-->#\" , \"\" , $txt );\n\t\t\t$txt = str_replace( \"</li>\", \"\", $txt );\n\t\t\t$txt = str_replace( \"&#153;\", \"(tm)\", $txt );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Parse html\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->parse_html )\n\t\t{\n\t\t\t$txt = str_replace( \"&#39;\", \"'\", $txt);\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Clean up BR tags\n\t\t//-----------------------------------------\n\t\t\n\t\t$txt = str_replace( \"<br>\" , \"\\n\", $txt );\n\t\t$txt = str_replace( \"<br />\", \"\\n\", $txt );\n\t\t\n\t\t\n\t\treturn trim(stripslashes($txt));\n\t}", "public function parse($text)\n {\n $text = parent::parse($text);\n $text = trim($text);\n $text = preg_replace(\"/\\r?\\n\\r?\\n+/s\", \"\\n\\n\", $text);\n\n return $text;\n }", "public static function parseText($text)\n {\n// Rays::import(\"application.vendors.php-markdown.Michelf.Markdown_inc\");\n// return \\Michelf\\Markdown::defaultTransform($text);\n\n Rays::import(\"application.vendors.php-markdown.Michelf.MarkdownExtra_inc\");\n return MarkdownExtra::defaultTransform($text);\n }", "abstract public function read($text);" ]
[ "0.67987293", "0.6546355", "0.6493799", "0.61437815", "0.61220324", "0.61206603", "0.61097735", "0.60897714", "0.60736763", "0.6050875", "0.59805006", "0.5960243", "0.5960243", "0.5960243", "0.5960243", "0.5941967", "0.5923119", "0.589105", "0.58695793", "0.5862763", "0.58395916", "0.582321", "0.58197653", "0.5801751", "0.5787357", "0.57348555", "0.5707549", "0.568009", "0.56697685", "0.5653839" ]
0.65979487
1
Retorna o valor de id_log
public function getID () { return $this->idLog; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getID () {\n\t\treturn $this->log_id;\n\t}", "public function getIdLog() \n\t{\n\t\treturn $this->idLog;\n\t}", "public function getLogId()\n {\n return $this->log_id;\n }", "public function getLogId() {\n return $this->log_id;\n }", "function getId() {\n return $this->log->getId();\n }", "public static function logId()\r\n {\r\n return self::getInstance()->intLogId;\r\n }", "public static function logId()\n {\n return SLog::getInstance()->logId;\n }", "public function getLogUserId()\n {\n return $this->log_user_id;\n }", "public function get_id_activity_log(){\r\n\t\t$this->db->select('activity_id');\r\n\t\t$this->db->from('activity_log');\r\n\t\t$this->db->order_by('activity_id', 'desc');\r\n\t\t$query = $this->db->get();\r\n\t\t$result = $query->result_array();\r\n\t\t\r\n\t\treturn $result[0]['activity_id'];\r\n\t}", "public function getLogTypeId()\n {\n return $this->log_type_id;\n }", "public function getLogId(){\n\n }", "public function getIdusuariosLog()\n {\n return $this->idusuarios_log;\n }", "public function logs_get_last_local_event_id()\n {\n $statement = $this->db->prepare('SELECT MAX(id) FROM '.self::LOG_TABLE_NAME);\n $success = $statement->execute();\n if(!$success) {\n $this->log(EventType::LOGGER, LogLevel::CRITICAL, __FUNCTION__ . \" failed\", array(\"RecorderLogger\"));\n return 0;\n }\n $results = $statement->fetch(PDO::FETCH_NUM);\n $maxId = $results[\"0\"];\n return $maxId;\n }", "function logged() {\n\t\tif($this->logged) {\n\t\t\treturn $this->_ID;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n }", "public function getLogContainerId()\n\t{\n\t\treturn $this->getId() . '_log';\n\t}", "function getPresidentLogId()\n {\n return (int) $this->_iPresidentLogId;\n }", "public function getActionlogsId()\n {\n return $this->actionlogs_id;\n }", "public function id()\n {\n return $this->entry->getField($this->getField())->getId();\n }", "public function add( $log ){\n\n\t\t$this->db->insert(\n\t\t\t\t$this->table, \n\t\t\t\t[\n\t\t\t\t\t'user_id' => Session()->get('op_user_id'),\n\t\t\t\t\t'logs' => $log,\n\t\t\t\t\t'log_datetime' => date(\"Y-m-d H:i:s\")\n\t\t\t\t]\n\t\t\t);\n\n\t\treturn $this->db->id();\n\t}", "public function get_id();", "public function get_id(){ return intval($this->get_info('robot_id')); }", "public function id()\r\n {\r\n if (! $this->loggedOut) {\r\n $id = Session::get($this->getName());\r\n\r\n return ! is_null($id) ? $id : $this->getRecallerId();\r\n }\r\n }", "public function id() {\n\t\t$settings = $this->getFieldSettings($this->key);\n\t\treturn $settings['value']['id'];\n\t}", "function getUniqueID(){\n\n $maxID = $this->Model->maxFrom('id','tbl_sukarelawan');\n\n return (int) $maxID;\n }", "public function id() {\n\t\treturn (int) $this->data['ID'];\n\t}", "public function getSystemLogID() {\n\t\treturn $this->getGUID();\n\t}", "public function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "function getId() {\n return $this->getFieldValue('id');\n }", "function getId() {\n return $this->getFieldValue('id');\n }", "public function id() {\n\t\treturn $this->getValue(static::$ID_FIELD);\n\t}" ]
[ "0.8421424", "0.8404046", "0.8394681", "0.83450705", "0.8271181", "0.82181895", "0.8156101", "0.72330385", "0.7182978", "0.71342814", "0.71050394", "0.6993004", "0.67787796", "0.67528623", "0.6709126", "0.66948706", "0.66785794", "0.64348423", "0.6403348", "0.63967735", "0.63857913", "0.6372674", "0.6368187", "0.63485307", "0.6337485", "0.6336374", "0.6332289", "0.63267374", "0.63267374", "0.6321673" ]
0.842456
0
Retorna o valor de m
public function getM () { return $this->m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function m()\n {\n return $this->_m;\n }", "public function getM () {\n\t\treturn $this->log_m;\n\t}", "public function getProductoM()\n {\n return $this->productoM;\n }", "public function getMpn();", "public function getMmtCode()\n {\n return $this->mmt_code;\n }", "function getMinutoSesion($m) {\n return $m = $this->minutoduracion + $m;\n // return $this->chequearMinutoSesion($m);\n \n }", "public function getMontant()\n {\n return $this->montant;\n }", "function getMatricule() {\n return $this->matricule;\n }", "public function getMcle()\n{\nreturn $this->mcle;\n}", "public function getMii()\n {\n return (integer) substr($this->getValue(), 0, 1);\n }", "public function getMontant()\n {\n return $this->montant;\n }", "public function getValorMoraMulta()\n {\n if (\\Cnab\\Banco::CEF == $this->_codigo_banco) {\n return $this->valor_juros + $this->valor_multa;\n } else {\n return $this->valor_mora_multa;\n }\n }", "function getMensagem() \n {\n return $this->mensagem;\n }", "public function getMatricule()\n {\n return $this->matricule;\n }", "public function getValue()\n {\n $w = $this->getInch_W()*self::INCH/1000; //in m3\n $h = $this->getInch_H()*self::INCH/1000;\n return $w*$h;\n }", "public function getNumMandat() {\n return $this->numMandat;\n }", "public function getMandante()\n {\n return $this->mandante;\n }", "public function getMtime ()\n {\n return $this->mtime;\n }", "public function getMT_PASSE()\n{\nreturn $this->MT_PASSE;\n}", "public function getMipe_idmipe(){\n return $this->mipe_idmipe;\n }", "public function getMap()\n {\n return $this->_aMatrice;\n }", "public function getMUin()\n {\n return $this->get(self::M_UIN);\n }", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();", "public function getValue();" ]
[ "0.75757456", "0.7100507", "0.6738951", "0.65778947", "0.6357155", "0.63139653", "0.6272304", "0.62446725", "0.62318605", "0.6204739", "0.6185053", "0.613668", "0.6127227", "0.6082028", "0.6037161", "0.6008462", "0.59702575", "0.59514076", "0.5943977", "0.59383386", "0.59349084", "0.59297454", "0.5927492", "0.5927492", "0.5927492", "0.5927492", "0.5927492", "0.5927492", "0.5927492", "0.5927492" ]
0.8023443
0
eof getM Retorna o valor de u
public function getU () { return $this->u; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMUin()\n {\n return $this->get(self::M_UIN);\n }", "public function getM () {\n\t\treturn $this->m;\n\t}", "public function getU () {\n\t\treturn $this->log_u;\n\t}", "static function getMotcuaUser(){\r\n\t\t$sql = \"\r\n\t\tselect g_u.ID_U , CONCAT(emp.FIRSTNAME,emp.LASTNAME) as FULLNAME \r\n\t\tfrom\r\n\t\t(SELECT fk_u_g.ID_U\r\n\t\tfrom `qtht_groups` gr \r\n\t\tinner join `fk_users_groups` fk_u_g on gr.ID_G = fk_u_g.ID_G\r\n\t\twhere gr.CODE='NMC'\r\n\t\t) g_u\r\n\t\tinner join qtht_users u on u.ID_U = g_u.ID_U\r\n\t\tinner join qtht_employees emp on emp.ID_EMP = u.ID_EMP\r\n\t\t\";\r\n\t\t$dbAdapter = Zend_Db_Table::getDefaultAdapter();\r\n\t\t$query = $dbAdapter->query($sql);\r\n\t\t$re = $query->fetchAll();\r\n\t\treturn $re;\r\n\t}", "public function getUmpire()\n\t{\n\t return $this->umpire;\n\t}", "function getMotoByUser($user) {\n\n\t $moto = R::findOne('motos', ' userforo=?', array($user));\n\n\t if(empty($moto)) {\n\t return $moto;\n\t }\n\n\t return $moto->export();\n\t}", "public function m()\n {\n return $this->_m;\n }", "public function getMmUserIdFieldName();", "public function getMipe_idmipe(){\n return $this->mipe_idmipe;\n }", "public function getM () {\n\t\treturn $this->log_m;\n\t}", "public function getMes(){\n\n\treturn $this->mes;\n\n}", "public function getDisplayUOM()\n {\n return $this->displayUOM;\n }", "private function getUM(){\tif(!$this->UM){\t\t$this->UM = new usermanager();}\t\t\treturn $this->UM;}", "public function getStudyMaterialForMeById()\n\t\t{\n\t\t\t$query = \"select * from studymaterial where send_to = \".$this->field['uid'].\";\";\n\t\t\tif($result = pg_query($this->dbconn,$query))\n\t\t\t{\n\t\t\t\t$resultSendTo = getUserDataFromID($query['send_from']);//not right\n\t\t\t\treturn $result;//don't know what result does the query sends and here i have to concat the $result with $resultSendTo\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function getUserLastMessage($userId){\n $url = 'https://www.venitaclinic.com/Qweb/site1_wiztech/WiztechSolution/include/smsOfUser.php';\n $fields = array(\"userId\"=>$userId);\n\n\n //url-ify the data for the POST\n foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }\n rtrim($fields_string,'&');\n\n $rtnWTH = file_get_contents($url.'?userId='.$userId.'&mapType=OMACfnb');\n //$lastSMS = json_decode($rtnWTH);\n return $rtnWTH;\n}", "public function getMii()\n {\n return (integer) substr($this->getValue(), 0, 1);\n }", "function getMatriculaUnam($dato = \"\") {\r\n\t\t$results = \"\";\r\n\t\r\n\t\tif(!empty($dato)) {\r\n\t\t\t$this->sql = \"SELECT matricula FROM registro_taller_unam WHERE matricula_unam = '$dato' LIMIT 1;\";\r\n\t\t\t$results = $this->db->query($this->sql);\r\n\t\t\treturn $results->result_array();\r\n\t\t}\r\n\t\r\n\t\treturn $results;\r\n\t}", "public function getMuralUsers() {\n return $this->db->query(\"SELECT id, nome, tipo FROM cad_utilizadores WHERE mural=1 AND ativo=1 AND tipo='Analista'\");\n }", "public function obtener_mensaje()\n {\n \t$consulta=$this->db->query(\"SELECT id FROM mensajes WHERE usuario = '{$this->uid}' ORDER BY usuario DESC LIMIT 1;\");\n \twhile($filas=$consulta->fetch_assoc()){$this->id=$filas;}\n \treturn $this->id;\n }", "function getmuni($id)\n{\n\tglobal $db;\n\t$m = $db->prepare(\"SELECT * FROM munishri, upadhis WHERE id = ? AND approved=1 AND uid=upadhi\");\n\t$m->execute(array($id));\n\tif($m->rowCount() == 1)\n\t{\n\t\t$n = $m->fetch(PDO::FETCH_ASSOC);\n\t\tif($n['alias'] == \"\") {$t = $n['uname'].' '.$n['prefix'].' '.$n['name'].' '.$n['suffix'];}\n\t\telse {$t = $n['uname'].' '.$n['prefix'].' '.$n['name'].' '.$n['suffix'].' '.$n['alias'];}\n\t\treturn $t;\n\t}\n\telse\n\t{\n\t\treturn \"N/A\";\n\t}\n}", "public function read()\n {\n $contents = NULL;\n\n if (!empty($_SESSION['utm5']['user'])) {\n $contents = $_SESSION['utm5']['user'];\n }\n\n return $contents;\n }", "function getMinutoSesion($m) {\n return $m = $this->minutoduracion + $m;\n // return $this->chequearMinutoSesion($m);\n \n }", "function Get_MDU($location,$system) {\r\n$result = database_connect('0','MsSQL', // is in Database_Functions.php\r\n\t\t\t\t\t\t\t\"SELECT * FROM EquipmentMDUTbl where Location='$location' AND System='$system'\");\r\n$row = mssql_fetch_assoc($result);\r\n\r\n$i=1;\r\nextract($row);\r\n\tforeach($row as $field => $value) {\r\n\t\t\t$value = ucwords($value);\r\n\t\t\t$mdu = is_numeric($field);\r\n\t\t\tif($mdu and $mdu<=9){\r\n\t\t\t\t$data .= \"MDU $i: \\t\" . $value . \"\\n\";\r\n\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\telseif($mdu and $mdu>9) {\r\n\t\t\t\t$value = ucwords($value);\r\n\t\t\t\t$data .= \"MDU $i:\\t\" . $value . \"\\n\";\r\n\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\r\n\t\t}\r\nreturn $data;\r\n}", "public function masculino()\n {\n \treturn self::MASCULINO;\n }", "public function getNombUsua()\n {\n return $this->nombUsua;\n }", "function get_mumie_user($user){\n\t\t\t\tglobal $CFG;\n\t\t\t\t$newuser = new object();\n\t \t\t$newuser->syncid = 'moodle-'.$CFG->prefix.'user-'.$user->id;\n\t \t\t$newuser->loginname = $user->username;\n\t \t\t$newuser->passwordencrypted = $user->password;\n\t \t\t$newuser->firstname = $user->firstname;\n\t \t\t$newuser->surname = $user->lastname;\n\t \t\t$newuser->matrnumber = 'X';\n\t \t\treturn $newuser;\n\t}", "public function getProductoM()\n {\n return $this->productoM;\n }", "public function getUf() {\n return $this->uf;\n }", "public function getMobielnummer() {\r\n\t\t$this->_db->get('Gebruikerstelefoon', array('gebruikersnaam', '=', $this->_gegevens->gebruikersnaam));\r\n\t\treturn $this->_db->first()->mobielnummer;\r\n\t}", "public function getUnidadeMedida()\n {\n return $this->unidade_medida;\n }" ]
[ "0.6737239", "0.5849647", "0.55547637", "0.5552809", "0.55193895", "0.54406136", "0.54390115", "0.5377161", "0.53376675", "0.53254354", "0.53238136", "0.52906746", "0.5254444", "0.52397406", "0.5237181", "0.523167", "0.5229665", "0.52142066", "0.51954347", "0.5193722", "0.5166815", "0.5160389", "0.5151631", "0.513172", "0.51316977", "0.51293045", "0.5099584", "0.5067522", "0.5061585", "0.50418884" ]
0.5986855
1
eof getA Retorna o valor de acao
public function getAcao () { return $this->acao; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAcao () {\n\t\treturn $this->log_acao;\n\t}", "public function getAberto()\n {\n return $this->aberto;\n }", "public function eof() {\n $result = feof($this->handle);\n return $result;\n }", "public function getAsistenciaValue()\n {\n return $this->asistenciaValue;\n }", "public function getAno() {\n return $this->iAno;\n }", "protected function get_arquivo($nomeArquivo){\n\t\t\t$arquivo = fopen($nomeArquivo,\"r\");\n\t\t\t$conteudo = NULL;\n\t\t\twhile(!feof($arquivo)){\n\t\t\t\t$conteudo = $conteudo.fgets($arquivo);\n\t\t\t}\n\t\t\treturn $conteudo;\n\t\t}", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function getAcesso()\r\n {\r\n return $this->acesso;\r\n }", "public function getCaminhoArquivo()\n {\n return $this->caminhoArquivo;\n }", "public function getFechadoAno() {\n return $this->fechadoAno;\n }", "public function getAla()\n\t{\n\t\treturn $this->ala;\n\t}", "abstract public function read();", "abstract public function read();", "public function stream_eof()\n {\n return feof($this->objStream);\n }", "abstract public function readOne();", "public function getDataOra(){\n return $this->dataOra;\n }", "public function eof();", "public function eof();", "public function getApto() {\n return $this->apto;\n }", "public function getAtendente()\n {\n return $this->atendente;\n }", "public function read() {\n $this->open();\n $fse = fseek($this->fres,0,SEEK_END);\n $oend = ftell($this->fres);\n $fsb = fseek($this->fres,0,SEEK_SET);\n return ($oend>0 ? fread($this->fres,$oend) : \"\");\n }" ]
[ "0.6077491", "0.5806384", "0.5555519", "0.5522779", "0.55224323", "0.5510981", "0.5415355", "0.5415355", "0.5415355", "0.5415355", "0.5415355", "0.5415355", "0.5415355", "0.5415355", "0.5415355", "0.5415355", "0.53257334", "0.5319667", "0.53139776", "0.5285349", "0.52747226", "0.52747226", "0.52596927", "0.5242363", "0.5238078", "0.5222656", "0.5222656", "0.5200185", "0.5172757", "0.51630515" ]
0.6535037
0
eof setM Define o valor de u
public function setU ($u) { $this->u = $u; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMUin()\n {\n return $this->get(self::M_UIN);\n }", "function tampilUmur($umur){\n\techo \"Umur : \".$umur.\"<br>\"; //perintah menampilkan umur\n}", "public function getU () {\n\t\treturn $this->u;\n\t}", "public function setMUin($value)\n {\n return $this->set(self::M_UIN, $value);\n }", "public function setU ($log_u) {\n\t\t$this->log_u = $log_u;\n\t}", "public function setPossesseur(Data_User $u) { $this->possesseur = $u; }", "public function getU () {\n\t\treturn $this->log_u;\n\t}", "public function setAuteur(Data_User $u) { $this->auteur = $u; }", "public function getUmpire()\n\t{\n\t return $this->umpire;\n\t}", "public function getUF()\n {\n return $this->uF;\n }", "public function getUf() {\n return $this->uf;\n }", "public function buscarUltimo() {\n }", "public function actionSetUmur()\n\t{\n\t\t if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n\t\t\t $data['umur'] = null;\n\t\t\t if(isset($_POST['tanggal_lahir']) && !empty($_POST['tanggal_lahir'])){\n\t\t\t\t $data['umur'] = CustomFunction::hitungUmur($_POST['tanggal_lahir']);\n\t\t\t }\n\t\t\t echo json_encode($data);\n\t\t\t Yii::app()->end();\n\t\t }\n\t}", "function load_VEC($tmpU) {\n $this->nombre = trim($tmpU[\"nombre\"]);\n }", "public function getDisplayUOM()\n {\n return $this->displayUOM;\n }", "public function actionSetUmur()\n {\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n $data['umur'] = null;\n if(isset($_POST['tanggal_lahir']) && !empty($_POST['tanggal_lahir'])){\n $data['umur'] = CustomFunction::hitungUmur($_POST['tanggal_lahir']);\n }\n echo json_encode($data);\n Yii::app()->end();\n }\n }", "private function CuadroUsuario($tam,$miembro)\n\t{\n\t\tglobal $RutaRelativaControlador;\n\t\techo '\n\t\t\n\t\t<div class=\"col-md-'.$tam.'\">\n\t\t\t<!-- Team Member -->\n\t\t\t<div class=\"team-member\">\n\t\t\t\t<!-- Image -->\n\t\t\t\t<img class=\"img-responsive center-block\" src=\"'.$RutaRelativaControlador.'img/user.png\" alt=\"\">\n\t\t\t\t<!-- Name -->\n\t\t\t\t<h4>'.$miembro[\"USU_apellido\"].', '.$miembro[\"USU_nombre\"].'</h4>\n\t\t\t\t<span class=\"deg\">'.$miembro[\"USU_email\"].'</span> \n\t\t\t</div>\n\t\t</div>\n\t\t';\n\t}", "public function set_postmanu($postmanu) {\n $this->postmanu = intval($postmanu);\n }", "public function getUf() {\n return $this->sUf;\n }", "function add_mug($serial){\r\n\t\tglobal $mysqli;\r\n\t\tglobal $GLOBAL_user_id;\r\n\t\tglobal $GLOBAL_user_mug_count;\r\n\r\n\t\tif($serial != \"\"){\r\n if($GLOBAL_user_mug_count == 0){\r\n $default = 1;\r\n }else{\r\n $default = 0;\r\n }\r\n\r\n\t\t\t$mysqli->query(\"INSERT INTO `mugs`VALUES (NULL , '\" . $GLOBAL_user_id . \"', '\" . $serial . \"', '\" . $serial . \"', '#d7cab5', '\" . $default . \"')\");\r\n\t\t\t\r\n\t\t\t$content = \"USERID:\" . $GLOBAL_user_id . \";SSID:;PASSWORD:;NEW_DEGREE:0;LAST_DEGREE:0;\";\r\n\t\t\t$file = \"mug config/\" . $serial . \".txt\";\r\n\t\t\t$handle = fopen($file,\"w\");\r\n\t\t\tfwrite($handle,$content);\r\n\t\t\tfclose($handle);\r\n\t\t\tchmod($file, 0777);\r\n\t\t\t\r\n\t\t\techo \"<div class='approved'>New mug has been added to your account!</div>\";\r\n\t\t}\r\n\t}", "function formularioUniversidad()\n {\n $data = NULL;\n if (isset($_REQUEST['id'])) {\n $data = $this->model_uni->get_id($_REQUEST['id']);\n }\n $query = $this->model_uni->get();\n include_once('vistas/header.php');\n include_once('vistas/F_universidad.php');\n include_once('vistas/footer.php');\n }", "private function hitungUmur()\n {\n // atribut ada tandanya $this\n $hasil = date('Y') - ($this->tahunlahir); //$hasil bukan atribut, krn masuk di lokal\n return $hasil;\n }", "public function getNombUsua()\n {\n return $this->nombUsua;\n }", "public static function set_user($u)\r\n {\r\n $uRol = isset($u[\"rol\"]) ? $u[\"rol\"] : \"Usuario\";\r\n\r\n /**\r\n * Pregunto si hay datos de contraseña\r\n */\r\n if(isset($u[\"pass\"]))\r\n {\r\n /**\r\n * Si llega un valor para contraseña entonces necesitamos crear un usuario\r\n * Iniciamos verificamos si el correo es válido\r\n */\r\n if(!empty($u[\"correo\"]))\r\n {\r\n if(filter_var($u[\"correo\"], FILTER_VALIDATE_EMAIL))\r\n {\r\n /**\r\n * Iniciamos la transacción\r\n */\r\n Capsule::beginTransaction();\r\n\r\n /**\r\n * Creamos el nuevo usuario\r\n */\r\n $userNew = Sentinel::registerAndActivate([\r\n 'first_name' => $u[\"nombre\"],\r\n 'last_name' => $u[\"apellido\"],\r\n 'email' => $u[\"correo\"],\r\n 'password' => $u[\"pass\"]\r\n ]);\r\n\r\n if ($userNew)\r\n {\r\n $userNewRol = Sentinel::findRoleBySlug($uRol);\r\n if ($userNewRol)\r\n {\r\n $userNewRol->users()->attach($userNew);\r\n $_SESSION['mensajeSistema'] = [\"Usuario creado exitosamente\"];\r\n Capsule::commit();\r\n $retorno = $userNew->id;\r\n }\r\n else\r\n {\r\n Capsule::rollback();\r\n $_SESSION['mensajeSistema'] = \"Ocurrió un error con el rol del nuevo usuario.\";\r\n $retorno = false;\r\n }\r\n }\r\n else\r\n {\r\n Capsule::rollback();\r\n $_SESSION['mensajeSistema'] = \"El usuario no pudo crearse\";\r\n $retorno = false;\r\n }\r\n }\r\n else\r\n {\r\n $_SESSION['mensajeSistema'] = \"El correo ingresado, no parece válido\";\r\n $retorno = false;\r\n }\r\n }\r\n else\r\n {\r\n $_SESSION['mensajeSistema'] = \"Se desconoce el correo del nuevo usuario\";\r\n $retorno = false;\r\n }\r\n }\r\n else\r\n {\r\n $_SESSION['mensajeSistema'] = \"No se ingresó contraseña\";\r\n $retorno = false;\r\n }\r\n return $retorno;\r\n }", "function sendinaKompiuteri(&$amzius) {\n $amzius = $amzius +1;\n $amzius = $amzius +1;\n $amzius = $amzius +1;\n }", "private function addValue(){\n $vSetup = USingleton::getInstance('VSetup');\n try {\n $datiFile = $vSetup->recuperaDatidaValidare();\n $nomeFile = './' . $datiFile['nomeFileValue'];\n // leggendo da un file csv inserisco tutte le probabilità iniziali presenti su quel file\n $aggiunto = FALSE;\n // lettura da file csv le probabilità iniziali\n $handleFile = fopen($nomeFile,\"r\") or die(\"Unable to open file!\"); \n //fgetcsv($handleFile,length,separator,enclosure);\n while(!feof($handleFile))// fino a quando non si arriva alla fine del file\n {\n $riga=fgetcsv($handleFile,100,';');\n $nomeComune = $riga[0] ;// contiene il nome del comune\n $nomeComune = str_replace(\"'\", \"’\", $nomeComune);\n $nomeComune = str_replace(\"-\", \" \", $nomeComune);\n if($nomeComune!=='COMUNE')\n {\n $peso = $riga[1]; //contiene il peso dell'area\n try{\n $eArea = new EArea($nomeComune);\n $eArea->setPesoArea($peso);\n $daModificare['Peso']= $peso; // lancia eccezione XDBException\n $aggiunto = $eArea->modificaAreaDB($daModificare);\n }\n catch(XAreaException $e)\n {\n // se non viene trovata l'area continua con il ciclo\n //altrimenti l'eccezione deve essere gestita fuori da questo catch.\n if($e->getMessage()==='Trovata più di una area.')\n {\n throw new XAreaException('Trovata più di una area.');\n }\n }\n }\n }\n fclose($handleFile);\n\n } catch (Exception $exc) {\n // file non si apre\n // eccezioni file \n // eccezione earea\n // eccezione db\n $aggiunto = 'Error.';\n }\n $vSetup->inviaDatiJSON($aggiunto) ;\n }", "function somma(){\n\t\t$somma= ($this->numero + $this->numero2.\"\\n\");\n\t\tprint \"Somma:\".$somma.\"<br />\";\n\t}", "public function pontEst($seqticms,$uf){\n $iretpont = 0;\n $sSql = \"select icmspesest from widl.ICMS(nolock) \"\n .\"where icmsseq =\".$seqticms.\" and icmsestcod ='\".$uf.\"'\";\n $result =$this->getObjetoSql($sSql);\n $row = $result->fetch(PDO::FETCH_OBJ);\n $iretpont = $row->icmspesest;\n return $iretpont;\n }", "public function getIdu() {\r\n return $this->idu;\r\n }", "public function getUserUal()\n\t{\n\t\treturn $this->user_ual;\n\t}" ]
[ "0.5839615", "0.57642037", "0.5612332", "0.5410912", "0.5259949", "0.5247071", "0.5239513", "0.5210817", "0.5209696", "0.5140706", "0.5134233", "0.5067883", "0.50108224", "0.49975124", "0.49820548", "0.4978346", "0.4977297", "0.49403724", "0.4923364", "0.49137053", "0.48642275", "0.48190492", "0.4805226", "0.4799681", "0.4781294", "0.4747632", "0.4741553", "0.47392595", "0.47361022", "0.47272223" ]
0.62382215
0
eof setAcao Define o valor de dhEvento
public function setDhEvento ($dhEvento) { $this->dhEvento = $dhEvento; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function disparar_evento_propio()\n\t{\n\t\tif($this->_evento_actual != \"\")\t{\n\t\t\t$metodo = apex_ei_evento . apex_ei_separador . $this->_evento_actual;\n\t\t\tif(method_exists($this, $metodo)){\n\t\t\t\t//Ejecuto el metodo que implementa al evento\n\t\t\t\t$this->_log->debug( $this->get_txt() . \"[ evento ] '{$this->_evento_actual}' -> [ $metodo ]\", 'toba');\n\t\t\t\t$this->$metodo($this->_evento_actual_param);\n\t\t\t\n\t\t\t\t//Comunico el evento al contenedor\n\t\t\t\t$this->reportar_evento_interno( $this->_evento_actual );\n\t\t\t}else{\n\t\t\t\t$this->_log->info($this->get_txt() . \"[ evento ] El METODO [ $metodo ] no existe - '{$this->_evento_actual}' no fue atrapado\", 'toba');\n\t\t\t}\n\t\t\t\n\t\t\t//Se pidio explicitamente un id de pantalla o navegar atras-adelante?\n\t\t\t$tab = (strpos($this->_evento_actual, 'cambiar_tab_') !== false) ? str_replace('cambiar_tab_', '', $this->_evento_actual) : false;\n\t\t\tif ($tab == '_siguiente' || $tab == '_anterior') {\n\t\t\t\t$this->_wizard_sentido_navegacion = ($tab == '_anterior') ? 0 : 1;\n\t\t\t\t$this->set_pantalla($this->ir_a_limitrofe());\n\t\t\t} elseif ($tab !== false) {\n\t\t\t\t//--- Se pidio un cambio explicito de tab\n\t\t\t\t$this->set_pantalla($tab);\n\t\t\t}\n\t\t}\n\t}", "protected function definir_pantalla_eventos()\n\t{\n\t\t//--- La pantalla anterior de servicio ahora se convierte en la potencial pantalla de eventos\n\t\tif (isset($this->_memoria['pantalla_servicio'])) {\n\t\t\t$this->_pantalla_id_eventos = $this->_memoria['pantalla_servicio'];\n\t\t\tunset($this->_memoria['pantalla_servicio']);\n\t\t\t$this->_log->debug( $this->get_txt() . \"Pantalla de eventos: '{$this->_pantalla_id_eventos}'\", 'toba');\n\t\t}\n\t}", "public function cadastrarEvento()\r\n {\r\n //($nome, $especialidade, $exames, $observacao, $gestante, $idRegistro, $idData) {\r\n $paciente = $this->db->findStorageRegistro('profile', $_POST['idRegistro']);\r\n $test = false;\r\n if(!empty($paciente[0]) && isset($paciente[0])){\r\n $data = new DataServer($_POST['data'].\" \".$_POST['hora'], \"UFMS\");\r\n $this->db->setStorageData('data', $data);\r\n $idData = $this->db->getPosicaoBanco('data');\r\n $evento = new Evento($_POST['descricao'], $idData, $_POST['idRegistro']);\r\n $test = $this->db->setStorageEvento('evento', $evento);\r\n }\r\n require('View/mostra.php');\r\n }", "public function getDhEvento () {\n\t\treturn $this->dhEvento;\n\t}", "public function evento(Evento $evento);", "public function setDataEvento(DBDate $oDtEvento) {\n \n $this->oDtEvento = $oDtEvento;\n }", "function Evento(){\n\t}", "function setEvento(){\n // Validacion de que el url contenga todos los elementos del evento\n if(isset($_GET['nom'], $_GET['est'], $_GET['ciu'], $_GET['dir'], $_GET['lug'], $_GET['fec'],\n $_GET['hor'], $_GET['img'], $_GET['des'], $_GET['cat'])){\n\n //Asignacion de las variables del url\n $nombre = $_GET['nom'];\n $estado = $_GET['est'];\n $ciudad = $_GET['ciu'];\n $direccion = $_GET['dir'];\n $lugar = $_GET['lug'];\n $fecha = $_GET['fec'];\n $hora = $_GET['hor'];\n $imagen = $_GET['img'];\n $descripcion = $_GET['des'];\n $idCategoria = $_GET['cat'];\n\n // Conexion a la base de datos\n $con = conexion();\n\n // Insercion en la base de datos el evento nuevo\n $query = \"INSERT INTO eventos VALUES(DEFAULT, '\".$nombre.\"', '\".$estado.\"', '\".$ciudad.\"', '\".\n $direccion.\"', '\".$lugar.\"', '\".$fecha.\"', '\".$hora.\"', '\".$imagen.\"', '\".\n $descripcion.\"', \".$idCategoria.\" )\";\n $insert = $con -> query($query);\n\n //Validacion de insercion correcta\n if($insert){\n\n // Seleccion del evento recien creado\n $query = \"SELECT eve_id FROM eventos WHERE eve_nombre = '\".$nombre.\"' AND eve_estado = '\".$estado.\n \"' AND eve_ciudad = '\".$ciudad.\"' AND eve_direccion = '\".$direccion.\"'\";\n $select = $con -> query($query);\n\n //Validacion de que la seleccion se hizo correctamente\n if($select -> num_rows > 0){\n\n // Obtencion de la consulta en un array\n $row = $select -> fetch_assoc();\n\n // Crea el array de respuesta con el id del evento creado\n $evento = [\"res\" => \"1\", \"id\" => $row['eve_id']];\n\n // Creacion del JSON, cierre de la conexion a la base de datos e imprime el JSON\n $json = json_encode($evento);\n $con -> close();\n print($json);\n }else{\n // Respuesta en caso de que no se encuentre ningun evento con la informacion obtenida\n $json = json_encode([\"res\" => \"0\", \"msg\" => \"Ocurrio un error al validar el evento\"]);\n $con->close();\n print($json);\n }\n }else{\n // Respuesta en caso de que no se haya insertado el evento\n $json = json_encode([\"res\"=>\"0\", \"msg\"=>\"No se pudo crear el evento, intentalo nuevamente\"]);\n $con -> close();\n print($json);\n }\n }else{\n // Respuesta en caso de que no contenga todos los datos el url\n $json = json_encode([\"res\"=>\"0\", \"msg\"=>\"La operación deseada no existe\"]);\n print($json);\n }\n}", "function setSeqEvento( $seqEvento ) {\n $this->seqEvento = $seqEvento;\n }", "public function salvar() {\n\n if (!db_utils::inTransaction()) {\n throw new DBException(\"Transação com o banca de dados não encontrada\");\n }\n\n if ($this->getAcordo() == \"\") {\n throw new BusinessException('Acordo não informado');\n }\n $oDaoAcordoEvento = new cl_acordoevento();\n $oDaoAcordoEvento->ac55_acordo = $this->getAcordo()->getCodigo();\n $oDaoAcordoEvento->ac55_anoprocesso = $this->getAnoProcesso();\n $oDaoAcordoEvento->ac55_numeroprocesso = $this->getProcesso();\n $oDaoAcordoEvento->ac55_tipoevento = $this->getTipoEvento();\n $oDaoAcordoEvento->ac55_descricaopublicacao = $this->getDescricaoVeiculo();\n $oDaoAcordoEvento->ac55_veiculocomunicacao = $this->getVeiculoComunicacao();\n $oDaoAcordoEvento->ac55_data = $this->getData()->getDate();\n if (empty($this->iCodigo)) {\n\n $oDaoAcordoEvento->incluir(null);\n $this->setCodigo($oDaoAcordoEvento->ac55_sequencial);\n } else {\n\n $oDaoAcordoEvento->ac55_sequencial = $this->getCodigo();\n $oDaoAcordoEvento->alterar($this->getCodigo());\n }\n\n if ($oDaoAcordoEvento->erro_status == 0) {\n throw new BusinessException(\"Erro ao salvar os dados do evento do contrato\");\n }\n $this->realizarMovimentacaoNoAcordo();\n }", "public function evento($acceso){\n\t\t$acceso->objeto->ejecutarSql(\"select * from detalle_orden where id_det_orden='$this->id_det_orden'\");\n\t\tif($row=row($acceso)){\n\t\t\t$emite_status=trim($row['emite_status']);\n\t\t\t$final_status=trim($row['final_status']);\n\t\t\t$final_anula_status=trim($row['final_anula_status']);\n\t\t\t//$emite_cargo_tipo=trim($row['emite_cargo_tipo']);\n\t\t\t//$emite_cargo_id_serv=trim($row['emite_cargo_id_serv']);\n\t\t\t$reemplaza_act=trim($row['reemplaza_act']);\n\t\t\t// echo \"REEMPL:$reemplaza_act:\";\n\t\t\t$final_cargo_tipo=trim($row['final_cargo_tipo']);\n\t\t\t//$final_cargo_id_serv=trim($row['final_cargo_id_serv']);\n\t\t\t$emite_deco=trim($row['emite_deco']);\n\t\t\t$final_deco=trim($row['final_deco']);\n\t\t\t$emite_cablemoden=trim($row['emite_cablemoden']);\n\t\t\t$final_cablemodem=trim($row['final_cablemodem']);\n\t\t\t$fecha_ult_id_det_orden=trim($row['fecha_ult_id_det_orden']);\n\t\t\t$final_agrega_id_serv=trim($row['final_agrega_id_serv']);\n\t\t\t\n\t\t\t// echo \"satus:$this->status_orden:\";\n\t\t\tif($this->status_orden==\"CREADO\"){\n\t\t\t\tif($emite_status!=''){\n\t\t\t\t\t// echo \"Update contrato Set status_contrato='$emite_status' Where id_contrato='$this->id_contrato'\";\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato Set status_contrato='$emite_status' Where id_contrato='$this->id_contrato'\");\n\t\t\t\t}\n\t\t\t\tif($emite_cargo_tipo!=''){\n\t\t\t\t\tif($emite_cargo_tipo=='COMPLETO'){\n\t\t\t\t\t\t// echo \"entro a cargar:$emite_cargo_id_serv:\";\n\t\t\t\t//\t\t$this->cargar_deuda_completo($acceso,$emite_cargo_id_serv);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($this->status_orden==\"FINALIZADO\"){\n\t\t\t\t// echo \":$final_cargo_tipo:\";\n\t\t\t\tif($final_status!=''){\n\t\t\t\t\t// echo \"ACTIVO ORDEN Update contrato Set status_contrato='$final_status' Where id_contrato='$this->id_contrato'\";\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato Set status_contrato='$final_status' Where id_contrato='$this->id_contrato'\");\t\n\t\t\t\t}\n\t\t\t\tif($final_cargo_tipo!=''){\n\t\t\t\t\tif($final_cargo_tipo=='COMPLETO'){\n\t\t\t\t\t\t$this->cargar_deuda_completo($acceso,$final_cargo_id_serv);\n\t\t\t\t\t}\n\t\t\t\t\telse if($final_cargo_tipo=='PRORRATEODESDE' || $final_cargo_tipo=='PRORRATEOHASTA'){\n\t\t\t\t\t\t// echo \"entro en la condicion\";\n\t\t\t\t\t\t$this->registra_prorrateo($acceso,$final_cargo_tipo,$reemplaza_act);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//echo \":$final_agrega_id_serv:\";\n\t\t\t\tif($final_agrega_id_serv!=''){\n\t\t\t//\t\t$this->cargar_deuda_completo($acceso,$final_agrega_id_serv);\n\t\t\t\t}\n\t\t\t\tif($final_deco!=\"\"){\n\t\t\t\t\t$this->enviar_comando_interfaz($acceso,$final_deco);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($this->status_orden==\"CANCELADA\"){\n\t\t\t\tif($final_anula_status!=''){\n\t\t\t\t//\t// echo \"ANULO ORDEN Update contrato Set status_contrato='$final_anula_status' Where id_contrato='$this->id_contrato'\";\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato Set status_contrato='$final_anula_status' Where id_contrato='$this->id_contrato'\");\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t}", "public function evento(){\n\t\t$this->set_config =\n\t \t\t[ \n\t\t\t'table' =>\n\t\t\t\t['nome' => 'tbl_evento',\n\t\t\t\t 'chave_pk' => 'id_evento',\n\t\t\t\t 'display' => 'Evento'],\n\t\t\t'columns' =>\n\t\t\t\t[\n\t\t\t\t \n\t\t\t 'id_evento' =>\n\t\t\t\t['display_column' => 'Id', \n\t\t\t\t \n\t\t\t\t 'select' => [],\n\t\t\t\t 'input' => ['type' => 'number', 'required' => 'readonly'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => '',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'false'],\n\t\t\t 'id_cliente' =>\n\t\t\t\t['display_column' => 'Cliente', \n\t\t\t\t \n\t\t\t\t 'select_relacional' => ['id_cliente','tbl_cliente', 'nome', []],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'id_pedido' =>\n\t\t\t\t['display_column' => 'Pedido', \n\t\t\t\t \n\t\t\t\t 'select_relacional' => ['id_pedido','tbl_pedido', 'id_pedido', []],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'data_evento' =>\n\t\t\t\t['display_column' => 'Dt. Evento', \n\t\t\t\t \n\t\t\t\t 'select' => [],\n\t\t\t\t 'input' => ['type' => 'date', 'required' => 'required'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'end_evento' =>\n\t\t\t\t['display_column' => 'Endereço', \n\t\t\t\t \n\t\t\t\t 'select' => [],\n\t\t\t\t 'input' => ['type' => 'text', 'required' => 'required'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'hora_evento' =>\n\t\t\t\t['display_column' => 'Horário', \n\t\t\t\t \n\t\t\t\t 'select' => [],\n\t\t\t\t 'input' => ['type' => 'text', 'required' => 'required'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'cel_evento' =>\n\t\t\t\t['display_column' => 'Celular', \n\t\t\t\t \n\t\t\t\t 'select' => [],\n\t\t\t\t 'input' => ['type' => 'text', 'required' => 'required'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'id_usuario' =>\n\t\t\t\t['display_column' => '', \n\t\t\t\t \n\t\t\t\t 'select_relacional' => ['id_usuario','tbl_usuario', 'nome', []],\n\t\t\t\t\t\n\t\t\t\t 'rules' => '',\n\t\t\t\t 'default_value' => $this->session->userdata(\"id_user\"), \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'false'],\n\n\t\t\t\t],\n\t\t\t'where' => ['id_usuario' => $this->session->userdata('id_user')],\n\t\t\t'dropdown' => [],\n\t\t];\n\n\t\t$this->execute();\n\t}", "public function getEvento() {\n return $this->iEvento;\n }", "public function getDataEvento() {\n \n return $this->oDtEvento;\n }", "abstract protected function notificar($evento);", "public function setCodigoEvento($iCodigoEvento) {\n \n $this->iCodigoEvento;\n }", "public function inserir($evento){\r\n\t\t$sql = 'INSERT INTO evento (nome, id, local, data, duracao) VALUES (:nome, :id, :local, :data, :duracao)';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$consulta->bindValue(':nome',$evento->getNome()); \n\r\t\t$consulta->bindValue(':id',$evento->getId()); \n\r\t\t$consulta->bindValue(':local',$evento->getLocal()); \n\r\t\t$consulta->bindValue(':data',$evento->getData()); \n\r\t\t$consulta->bindValue(':duracao',$evento->getDuracao()); \r\n\t\t$consulta->execute();\r\n\t}", "abstract protected function pre_notificar($evento);", "function mb_dados_evento_cb() {\n global $post;\n // captura os dados para o value do formulário\n $data_inicial = get_post_meta($post->ID, 'data_inicial', true);\n $data_final = get_post_meta($post->ID, 'data_final', true);\n $hora_inicial = get_post_meta($post->ID, 'hora_inicial', true);\n $hora_final = get_post_meta($post->ID, 'hora_final', true);\n $endereco = get_post_meta($post->ID, 'endereco', true);\n // adc campos ao formulário\n require ('formulario_evento.php');\n}", "public function recuperaDatiEvento(){\n\n $dati = array();\n $errore = null;\n if(isset($_POST['NomeE']))\n {\n $accettato = preg_match('/[A-Za-z]$/', $_POST['NomeE']);\n if(! $accettato){\n $errore = $errore.\"Il nome non è valido.\\n\";\n }\n $dati['NomeE'] = $_POST['NomeE'];\n }\n if(isset($_POST['Categoria']))\n {\n $accettato = preg_match('/[A-Za-z]$/', $_POST['Categoria']);\n if(! $accettato){\n $errore = $errore.\"La categoria non è valida.\\n\";\n }\n $dati['Categoria'] = $_POST['Categoria'];\n }\n if(isset($_POST['Giorno']))\n {\n $accettato = preg_match('/[0-9]$/', $_POST['Giorno']);\n if(! $accettato){\n $errore = $errore.\"il giorno non è valido.\\n\";\n }\n $dati['Giorno'] = $_POST['Giorno'];\n }\n if(isset($_POST['Mese']))\n {\n $accettato = preg_match('/[0-9]$/', $_POST['Mese']);\n if(! $accettato){\n $errore = $errore.\"il mese non è valido.\\n\";\n }\n $dati['Mese'] = $_POST['Mese'];\n }\n if(isset($_POST['Anno']))\n {\n $accettato = preg_match('/[0-9]$/', $_POST['Anno']);\n if(! $accettato){\n $errore = $errore.\"l anno non è valido.\\n\";\n }\n $dati['Anno'] = $_POST['Anno'];\n }\n if(isset($_POST['descrizione']))\n {\n $accettato = preg_match('/[A-Za-z]$/', $_POST['Categoria']);\n if(! $accettato){\n $errore = $errore.\"La descrizione non è valida.\\n\";\n }\n $dati['descrizione'] = $_POST['descrizione'];\n }\n if(isset($_FILES[\"file_inviato\"][\"tmp_name\"]))\n {\n $dati['nometmp'] = $_FILES[\"file_inviato\"][\"tmp_name\"];\n }\n if(isset($_FILES[\"file_inviato\"][\"name\"]))\n {\n $dati['nomeimg'] = $_FILES[\"file_inviato\"][\"name\"];\n }\n if(isset($_FILES[\"file_inviato\"][\"type\"]))\n {\n $dati['tipo'] = $_FILES[\"file_inviato\"][\"type\"];\n }\n if(isset($_POST['Prezzo']))\n {\n $accettato = preg_match('/[0-9]$/', $_POST['Prezzo']);\n if(! $accettato){\n $errore = $errore.\"l anno non è valido.\\n\";\n }\n $dati['Prezzo'] = $_POST['Prezzo'];\n }\n if(isset($_POST['Posti']))\n {\n $accettato = preg_match('/[0-9]$/', $_POST['Posti']);\n if(! $accettato){\n $errore = $errore.\"l anno non è valido.\\n\";\n }\n $dati['Posti'] = $_POST['Posti'];\n }\n if ($_FILES[\"file_inviato\"][\"type\"]!=null)\n {\n $img = file_get_contents($dati['nometmp']);\n $dati['img'] = $img;\n }\n else\n $errore = $errore.\"immagine non inserita\";\n $dati['errore'] = $errore;\n return $dati;\n }", "function hd_multi_evento ($aulas_ua){\n \n $anio_lectivo=date('Y', strtotime($this->s__fecha_consulta));\n //Configuramos el dia de consulta para que este disponible en la funcion procesar_periodo.\n $this->s__dia_consulta=$this->obtener_dia(date('N', strtotime($this->s__fecha_consulta)));\n \n //Obtenemos los periodos que pueden contener a la fecha de solicitud.\n $periodo=$this->dep('datos')->tabla('periodo')->get_periodo_calendario($this->s__fecha_consulta, $anio_lectivo, $this->s__id_sede);\n //Usamos la cadena 'au' para extraer las asignaciones pertenecientes a un aula en particular. \n //Es una condicion mas dentro de la funcion procesar_periodo.\n $asignaciones=$this->procesar_periodo($periodo, 'hd');\n \n $aulas=$this->obtener_aulas($asignaciones);\n //Guardamos en sesion el id_sede para agregar la capacidad de cada aula a un horario disponible.\n //En 0 se reserva para el id_sede en esta operacion y en Buscador de Aula.\n toba::memoria()->set_dato_instancia(0, $this->s__id_sede);\n \n $hd=new HorariosDisponibles();\n \n $this->s__horarios_disponibles=$hd->calcular_horarios_disponibles($aulas, $aulas_ua, $asignaciones);\n \n }", "public function setEvent($value);", "protected function post_eventos() {}", "public function setEofHandler($eofHandler)\n {\n $this->eofHandler = $eofHandler;\n }", "protected function controlar_eventos_propios()\n\t{\n\t\t$this->_evento_actual = \"\";\n\t\tif (isset($_POST[$this->_submit]) && $_POST[$this->_submit] != '') {\n\t\t\t$evento = $_POST[$this->_submit];\n\t\t\t//La opcion seleccionada estaba entre las ofrecidas?\n\t\t\tif (isset( $this->_memoria['eventos'][$evento] )) {\n\t\t\t\t$this->_evento_actual = $evento;\n\t\t\t\t$this->_evento_actual_param = $_POST[$this->_submit.\"__param\"];\n\t\t\t} else {\n\t\t\t\t$this->_log->warning( $this->get_txt() . \"Se recibio el evento $evento pero el mismo no está entre los disponibles\", 'toba');\n\t\t\t}\n\t\t}\n\t}", "public function getEventiIdEvento()\n {\n return $this->eventi_id_evento;\n }", "function setTipoEvento( $tipoEvento ) {\n $this->tipoEvento = $tipoEvento;\n }", "public function salvar(Calendario $oCalendario) {\n \n if (!db_utils::inTransaction()) {\n throw new DBException(\"Sem transaçao ativa com o banco de dados\");\n }\n \n if (empty($oCalendario)) {\n throw new ParameterException(\"Não foi definido o calendario.\");\n }\n \n $oDaoFeriado = db_utils::getDao(\"feriado\");\n $oDaoFeriado->ed54_c_descr = $this->sDescricao;\n $oDaoFeriado->ed54_c_diasemana = $this->sDiaSemana;\n $oDaoFeriado->ed54_d_data = $this->oDtEvento->getDate(DBDate::DATA_EN);\n $oDaoFeriado->ed54_c_dialetivo = $this->lDiaLetivo ? \"S\" : \"N\";\n $oDaoFeriado->ed54_i_evento = $this->iTipoEvento;\n \n if (empty($this->iCodigoEvento)) {\n\n $oDaoFeriado->ed54_i_codigo = null;\n $oDaoFeriado->ed54_i_calendario = $oCalendario->getCodigo();\n $oDaoFeriado->incluir(null);\n $this->iCodigoEvento = $oDaoFeriado->ed54_i_codigo;\n \n } else {\n \n $oDaoFeriado->ed54_i_codigo = $this->iCodigoEvento;\n $oDaoFeriado->alterar($this->iCodigoEvento);\n }\n \n if ($oDaoFeriado->erro_status == 0) {\n \n $sErroMsg = \"Erro ao incluir/alterar o evento ao calendario.\";\n throw new BusinessException($sErroMsg);\n }\n \n return true;\n }", "private function getEventos() {\n\n $sDataAtual = $this->oCabecalho->getDataGeracao()->getDate();\n $oDaoAcordoEvento = new cl_acordoevento;\n $sCampos = \" distinct \" . implode(\",\", array(\n \"acordoevento.*\",\n \"ac16_numero\",\n \"ac16_anousu\",\n \"ac16_sequencial\",\n \"ac16_tipoinstrumento\",\n \"ac26_numeroaditamento\",\n ));\n $sWhere = implode(' and ', array(\n \"(ac58_acordo is null or ac58_data >= '{$sDataAtual}')\",\n \"ac16_instit = {$this->oCabecalho->getInstituicao()->getCodigo()}\",\n \"(ac55_tipoevento <> 12 or (ac55_tipoevento = 12 and ac56_acordoevento is not null))\",\n \"exists (select 1 from acordoitem ai inner join acordoposicao ap on ap.ac26_sequencial = ai.ac20_acordoposicao where ap.ac26_acordo = acordo.ac16_sequencial) \"\n ));\n $sOrder = 'ac16_sequencial asc, ac55_sequencial asc';\n $sSqlAcordoEvento = $oDaoAcordoEvento->sql_query(null, $sCampos, $sOrder, $sWhere);\n $rsAcordoEvento = db_query($sSqlAcordoEvento);\n\n if (!$rsAcordoEvento) {\n throw new DBException(\"Erro ao buscar informações de evento dos acordos.\");\n }\n\n return $rsAcordoEvento;\n }", "public function insert(Evento $evento){\n $sql = \"insert into tbl_evento(idUnidade, nome, tbl_evento.desc , foto, inicio, termino) values(\".$evento->getIdUnidade().\",'\".$evento->getNome().\"','\".$evento->getDesc().\"','\".$evento->getFoto().\"','\".$evento->getInicio().\"','\".$evento->getTermino().\"')\";\n\n $conex = new conexaoMySql();\n $PDO_conex = $conex->conectDatabase();\n\n if ($PDO_conex->query($sql))\n echo \"Inserido com sucesso\";\n else\n echo($sql);\n// echo \"Erro no script de Insert\";\n\n $conex->closeDatabase();\n }" ]
[ "0.61187345", "0.59629285", "0.58498055", "0.57088673", "0.56648684", "0.5545438", "0.5506075", "0.53921056", "0.5375488", "0.5339018", "0.5319443", "0.5313116", "0.5299766", "0.52868044", "0.52743363", "0.5272694", "0.52596515", "0.52577275", "0.5237685", "0.5226126", "0.51940084", "0.517512", "0.5165952", "0.5153676", "0.5138848", "0.5133731", "0.51254594", "0.51175225", "0.5101539", "0.50990736" ]
0.5992675
1
eof getID Retorna o valor de log_usu_id
public function getUsuID () { return $this->log_usu_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdusuariosLog()\n {\n return $this->idusuarios_log;\n }", "public function getID() { // GET ID \n return $this->utilisateur_id; // SET ID\n }", "public function setUsuID ($log_usu_id) {\n\t\t$this->log_usu_id = $log_usu_id;\n\t}", "public function getLogUserId()\n {\n return $this->log_user_id;\n }", "public function getID () {\n\t\treturn $this->log_id;\n\t}", "function getID($user){}", "public function getLogId()\n {\n return $this->log_id;\n }", "public function getLogId() {\n return $this->log_id;\n }", "public static function logId()\r\n {\r\n return self::getInstance()->intLogId;\r\n }", "public function getID () {\n\t\treturn $this->idLog;\n\t}", "function get_login_user_id(){}", "public function getUlogaID()\n {\n return $this->ulogaID;\n }", "function getUserID()\n {\n try\n {\n $__UserDetails = (!empty($this->getMyDetails()) ) ?\n json_decode($this->getMyDetails()) :\n $this->Responder->Push(false, \"Cannot Get Userid\", \"getUserID\");\n \n return $__UserDetails->id;\n } \n catch (Exception $e)\n {\n return \"Caught exception: \".$e->getMessage();\n }\n }", "public function userId(){\r\n if(Yii::app()->user->isGuest)\r\n YiiRestler::error(403,Yii::t('api','Can\\'t get id'));\r\n return Yii::app()->user->getId();\r\n }", "function getId() {\n return $this->log->getId();\n }", "protected function get_userid() \n {\n return isset($_SESSION['user']) ? $_SESSION['user']['id'] : 0;\n }", "public function getUsuarioId(){\n\t\treturn $this->usuario_id;\n\t}", "function getUserId();", "function user_logged(){\n\t\tif(isset($_SESSION['userlogid'])) {\n\t\t\t\t\n\t\t\t$userlogid = $_SESSION['userlogid'];\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$userlogid = 9999;\n\t\t}\n\t\treturn $userlogid;\n\t}", "function userid() {\n global $db;\n\n if(empty($_SESSION['id']) || empty($_SESSION['pwd'])) return 0;\n if(!dbc_index::issetIndex('user_'.$_SESSION['id'])) {\n $sql = db(\"SELECT * FROM \".$db['users'].\" WHERE id = '\".$_SESSION['id'].\"' AND pwd = '\".$_SESSION['pwd'].\"'\");\n if(!_rows($sql)) return 0;\n $get = _fetch($sql);\n dbc_index::setIndex('user_'.$get['id'], $get);\n return $get['id'];\n }\n\n return dbc_index::getIndexKey('user_'.$_SESSION['id'], 'id');\n}", "public static function logId()\n {\n return SLog::getInstance()->logId;\n }", "function getUserID(){\n\t\treturn $this->userId;\n\t}", "public function getIdUserSesion()\r\n {\r\n \t$id = $this->getContainerSession()->offsetGet('id');\r\n\r\n \treturn $id;\r\n }", "public function getUserId(){\n if(!array_key_exists('userId', $this->aSysData)){\n $oSess = admSession();\n $this->aSysData['userId'] = $oSess ? (int)($oSess->Data['user']['id']) : null;\n }\n return $this->aSysData['userId'];\n }", "public function getUserID(){\n return($this->userID);\n }", "public function getUsuario_id()\n {\n return $this->usuario_id;\n }", "public function getUsuario_id()\n {\n return $this->usuario_id;\n }", "public function getIdUser(){\r\n return $_SESSION['id'];\r\n }", "final function getUser_id() {\n\t\treturn $this->getUserId();\n\t}", "function getUsuarioID($id){\n $q = \"select * from usuarios where id_usuario=$id\";\n $r = mysql_query($q);\n \n return $r;\n }" ]
[ "0.7249408", "0.70707595", "0.6985534", "0.68494076", "0.6835353", "0.67347676", "0.6693777", "0.6664069", "0.66571563", "0.6642954", "0.6544543", "0.65174717", "0.64863986", "0.6419354", "0.6412949", "0.6397253", "0.6391351", "0.63871276", "0.63834035", "0.63825464", "0.63815886", "0.63703305", "0.6345048", "0.6338901", "0.6335446", "0.63340664", "0.63340664", "0.6320593", "0.6305671", "0.6289759" ]
0.76098955
0
eof getUduID Retorna o valor de log_dh_erro
public function getDhErro () { return $this->log_dh_erro; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDhErro ($log_dh_erro) {\n\t\t$this->log_dh_erro = $log_dh_erro;\n\t}", "function read_duid()\n{\n $duid = dhcp6c_duid_read();\n\n if (!is_duid($duid)) {\n $duid = 'XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX';\n }\n\n return $duid;\n}", "public function getUdh()\n {\n return $this->_udh;\n }", "public function getMsgErro () {\n\t\treturn $this->log_msg_erro;\n\t}", "function getUserID()\n {\n try\n {\n $__UserDetails = (!empty($this->getMyDetails()) ) ?\n json_decode($this->getMyDetails()) :\n $this->Responder->Push(false, \"Cannot Get Userid\", \"getUserID\");\n \n return $__UserDetails->id;\n } \n catch (Exception $e)\n {\n return \"Caught exception: \".$e->getMessage();\n }\n }", "public function errNo();", "public function ObtenerIndicadorError()\n\t{\n\t\treturn $this->IndicadorError;\n\t}", "private static function get_error($id)\n\t\t{\n\t\t\treturn isset(self::$errors[$id]) ? self::$errors[$id]:'Unknown JSON error.';\n\t\t}", "public function getUsuID () {\n\t\treturn $this->log_usu_id;\n\t}", "function is_duid($duid)\n{\n $values = explode(\":\", $duid);\n\n // need to get the DUID type. There are four types, in the\n // first three the type number is in byte[2] in the fourth it's\n // in byte[4]. Offset is either 0 or 2 depending if it's the read #\n // from file duid or the user input.\n\n $valid_duid = false;\n\n $duid_length = count($values);\n $test1 = hexdec($values[1]);\n $test2 = hexdec($values[3]);\n if (($test1 == 1 && $test2 == 1 ) || ($test1 == 3 && $test2 == 1 ) || ($test1 == 0 && $test2 == 4 ) || ($test1 == 2)) {\n $valid_duid = true;\n }\n\n /* max DUID length is 128, but with the separators it could be up to 254 */\n if ($duid_length < 6 || $duid_length > 254) {\n $valid_duid = false;\n }\n\n if ($valid_duid == false) {\n return false;\n }\n\n for ($i = 0; $i < count($values); $i++) {\n if (ctype_xdigit($values[$i]) == false) {\n return false;\n }\n if (hexdec($values[$i]) < 0 || hexdec($values[$i]) > 255) {\n return false;\n }\n }\n\n return true;\n}", "public function get_erro() {\r\n return $this->erro;\r\n }", "public function getUlogaID()\n {\n return $this->ulogaID;\n }", "function messaggioErrore()\n\t\t{\n\t\t$retval = @oci_error($this->DBConn);\n\t\tif ($retval === false)\n\t\t\treturn '';\n\t\treturn $retval['message'];\n\n\t\t}", "public function getDescrErro () {\n\t\treturn $this->log_descr_erro;\n\t}", "public function get_last_error_as_id()\n {\n if (is_object($this->m_db_link)) return mysqli_errno($this->m_db_link);\n else return -1;\n }", "public function getUdid()\n {\n return $this->udid;\n }", "public function getLutilisateur_idlutilisateur():int\n {\n return $this->lutilisateur_idlutilisateur;\n }", "public function qerr($ecode='')\n\t{\n\t\t// TODO: debug flag on usuarios set session var\n\t\t$uid = 47;\n\t\tif (isset($_SESSION['uid'])) $uid = $_SESSION['uid'];\n\t\treturn $this->err($ecode, $uid == 1 || $uid == 130 || $uid == 47 ? mysql_error(): \n\t\t\t\t\"Fall&oacute; consulta de datos\", mysql_error());\n\t}", "public function getDigUserid()\n {\n return $this->dig_userid;\n }", "function insertarUcedifgrupo(){\n\t\t$this->procedimiento='snx.ft_ucedifgrupo_ime';\n\t\t$this->transaccion='SNX_UDG_INS';\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('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('ucedifgrupo','ucedifgrupo','varchar');\n\t\t$this->setParametro('id_unidadconstructivaedif','id_unidadconstructivaedif','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}", "function getUserId($dataHelper) {\n if (!is_object($dataHelper))\n {\n throw new Exception(\"client_db_function.inc.php : getUserId : DataHelper Object did not instantiate\", 104);\n }\n try\n {\n $strSqlStatement = \"SELECT MAX(user_id) FROM user_login_details\";\n $arrMaxId = $dataHelper->fetchRecords(\"QR\", $strSqlStatement);\n $s1 = $arrMaxId[0]['MAX(user_id)'];\n $s2 = explode(\"usr\", $s1);\n $s3 = $s2[1] + 1;\n $s4 = strlen($s3);\n switch ($s4)\n {\n case 1: $userId = \"usr000000\" . $s3;\n break;\n case 2: $userId = \"usr00000\" . $s3;\n break;\n case 3: $userId = \"usr0000\" . $s3;\n break;\n case 4: $userId = \"usr000\" . $s3;\n break;\n case 5: $userId = \"usr00\" . $s3;\n break;\n case 6: $userId = \"usr0\" . $s3;\n break;\n case 7: $userId = \"usr\" . $s3;\n break;\n default: break;\n }\n }\n catch (Exception $e)\n {\n throw new Exception(\"client_db_function.inc.php : Get User Details Failed : \" . $e->getMessage(), 1111);\n }\n return $userId;\n}", "public function errorno() {\n return $this->errorno;\n }", "function iduResults($statement, $db)\n\n{\n\n\t$output = \"\";\n\n\t$outputArray = array();\n\n\tif ($db)\n\n\t{\n\n\t\t$result = mysql_query($statement);\n\n\n\n\t\tif (!$result)\n\n\t\t{\n\n\t\t $errno = mysql_errno($db);\n\n\n\n\t\t if ($errno == '1062')\n\n\t\t\t{\n\n\t\t\t\t$output .= \"ERROR\";\n\n\t\t\t\t$output .= \"<br />Userid is already in system\";\n\n\t\t\t} else {\n\n\t\t\t\t$output .= \"ERROR\";\n\n\t\t\t\t$output .= \"<br /><font color=red>MySQL No: \".mysql_errno();\n\n\t\t\t\t$output .= \"<br />MySQL Error: \".mysql_error();\n\n\t\t\t\t$output .= \"<br />SQL Statement: \".$statement;\n\n\t\t\t\t$output .= \"<br />MySQL Affected Rows: \".mysql_affected_rows().\"</font><br />\";\n\n\t\t\t}\n\n\n\t\t} else {\n\n\t\t\t$output = mysql_affected_rows();\n\n\t\t}\n\n\t} else {\n\n\n\n\t\t$output = 'ERROR-No DB Connection';\n\n\t}\n\n\treturn $output;\n\n}", "function findViagemID($idUsuario = null ) {\n \t$database = open_database();\n\t$found = null;\n\ttry {\n\t if ($idUsuario) {\n\t $sql = \"SELECT id FROM viagem WHERE idUsuario = \" . $idUsuario;\n\t $result = $database->query($sql);\t \n\t if ($result->num_rows > 0) {\n\t $found = $result->fetch_all(MYSQLI_ASSOC);\n\t }\n\t }\n\t} catch (Exception $e) {\n\t $_SESSION['message'] = $e->GetMessage();\n\t $_SESSION['type'] = 'danger';\n }\n\tclose_database($database);\n\treturn $found;\n}", "function descLogg($id){\nglobal $mysqli, $w, $wuser, $ip, $tsWeb, $tsActividad;\n// si $type == 1 ? $type = mi archivo; $type = otro;\nif($wuser->uid){ $obj = $wuser->uid; }else{ $obj = $ip; }\n$sdkjflake = $mysqli->query(\"SELECT up_id, up_user FROM rft_uploads WHERE up_id='\".$id.\"'\");\n$sdfjkn = $sdkjflake->fetch_assoc();\nif($sdfjkn['up_user'] == $wuser->uid){ $type = 1; }elseif(!$wuser->uid){ $type = 2; }elseif($sdfjkn['up_user'] != $wuser->uid){ $type = 3; }else{ $type = 0; }\n$mysqli->query(\"INSERT INTO rft_downloads(dow_type, dow_obj, dow_usip, dow_date) VALUES('\".$type.\"', '\".$id.\"' ,'\".$wuser->uid.\"', '\".time().\"')\");\n$idInserQuerySql = $mysqli->insert_id;\n$tsWeb->getNotifis($wuser->uid, 54, $idInserQuerySql, 0); \n$tsActividad->setActividad(60,$idInserQuerySql);\n}", "function eliminarUcedifgrupo(){\n\t\t$this->procedimiento='snx.ft_ucedifgrupo_ime';\n\t\t$this->transaccion='SNX_UDG_ELI';\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_ucedifgrupo','id_ucedifgrupo','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}", "function getDucanName($ducanId)\n{\n\t$link = connectToDB();\n\t$query = \"SELECT ime, id_ducan FROM ducan\";\n\t$result = mysqli_query($link, $query);\n\tif($result)\n\t{\n\t\twhile($row = mysqli_fetch_array($result))\n\t\t{\n\t\t\tif($row['id_ducan'] == $ducanId)\n\t\t\t{\n\t\t\t\t$ime = $row['ime'];\n\t\t\t\tmysqli_close($link);\n\t\t\t\treturn $ime;\n\t\t\t}\n\t\t}\n\t}\n\tmysqli_close($link);\n\treturn 'Greska u trazenju imena: linija 45, ducan.php';\n}", "public function getPjMailCLiDucsEdi() {\n return $this->pjMailCLiDucsEdi;\n }", "function nIdUser($id){\r\n\t//USER_NA001\r\n\t$salida=trim($id).'001';\r\n\t$query =\"SELECT MAX(IDUSUARIO) FROM USUARIO WHERE IDUSUARIO LIKE '\".$id.\"%' \";\r\n\r\n\t$result=mysql_query($query) or die(\"Error en: \" . mysql_error());\r\n\t\r\n\t//Mientras exista resultados\r\n\t\tif( $fila=mysql_fetch_array($result) ){\r\n\t\t\t$salida= $id.formatoNum($fila['MAX(IDUSUARIO)']);\r\n\t\t}\r\n\treturn $salida;\r\n}", "function isValidUDID($udid)\n{\n if (strlen($udid) != 64 ){ // 32 for simulator\n \n echo \"bad udid\" . strlen($udid) .\"\\n\";\n return false;\n }\n if (preg_match(\"/^[0-9a-fA-F]+$/\", $udid) == 0)\n return false;\n \n return true;\n}" ]
[ "0.61184007", "0.5810755", "0.5551121", "0.55369496", "0.5531878", "0.5528317", "0.54023945", "0.53723365", "0.5328605", "0.5327801", "0.52959955", "0.5284245", "0.5211175", "0.5187313", "0.5164435", "0.5135814", "0.5116224", "0.51035476", "0.50730973", "0.5063121", "0.50354475", "0.5006449", "0.49915233", "0.49659824", "0.49603492", "0.4958492", "0.4951275", "0.4938234", "0.4934759", "0.4925148" ]
0.6955308
0
eof getM Retorna o valor de log_u
public function getU () { return $this->log_u; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getM () {\n\t\treturn $this->log_m;\n\t}", "public function setM ($log_m) {\n\t\t$this->log_m = $log_m;\n\t}", "public function setU ($log_u) {\n\t\t$this->log_u = $log_u;\n\t}", "public function lireLog()\n \t{\n \t\treturn file_get_contents($this->_fichierlog);\n \t}", "public function getUsuID () {\n\t\treturn $this->log_usu_id;\n\t}", "public function getLogUser()\n {\n return $this->log_user;\n }", "public function getLogMsg()\n {\n return $this->log_msg;\n }", "public function get_log() {\r\n\t\treturn $this->log;\r\n\t}", "public function log($m) {\n\t\t$this->writeToLogFile('[LOG] [' . $this->getNow() . '] ' . $m . \"\\n\");\n\t}", "public function getLastLogMessage() {\n return $this->last_log_message->value;\n }", "public function getMUin()\n {\n return $this->get(self::M_UIN);\n }", "public function lastlogin($username){\n $sql = \"SELECT * FROM klog WHERE logValue LIKE '\" . db::escapechars($username) . \" Successful sign in%' ORDER BY logDate DESC\";\n $result = db::returnrow($sql);\n $lastlogintime = $result['logDate'].\" at \" .$result['logTime'];\n return $lastlogintime;\n }", "function getBaseLog(){\t\t\n\t\tif(!isset($_REQUEST['appid'])\n\t\t\t||!isset($_REQUEST['event'])\n\t\t\t||!isset($_REQUEST['uid'])) throw new Exception(\"no appid or event or uid\");\n\t\tif(isset($_REQUEST['timestamp']))\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\telse \n\t\t\t$timestamp = $_SERVER['REQUEST_TIME'];\n\t\t$log=$_REQUEST['appid'].\"\\t\".$_REQUEST['uid'].\"\\t\".$_REQUEST['ref'].\n\t\t\t\"\\t\".$_REQUEST['event'].\"\\t\".$_REQUEST['json_var'].\"\\t\".$timestamp.\"\\n\";\n\t\t\n\t\tif ($_REQUEST ['event'] === \"user.visit\") {\n\t\t\t$ip = getIP ();\n\t\t\tif ($ip != false) {\n\t\t\t\t$log = $log . $_REQUEST ['appid'] . \"\\t\" . $_REQUEST ['uid'] . \"\\t\" . '' . \"\\t\" . \"user.update\" . \"\\t\" . '{\"geoip\":\"' . $ip . '\"}' . \"\\t\" . $timestamp . \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $log;\n\t}", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public static function getLogUserAdmin($uid, $start = 0, $end = 50){\n $query = \"SELECT id_log,UNIX_TIMESTAMP(time)as _time, action, user_id FROM permisos_log WHERE user_modified = $uid LIMIT $start, $end\";\n return DBO::getArray($query);\n }", "public function log_info($attr)\r\n\r\n {\r\n\r\n try\r\n\r\n {\r\n\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n\r\n }\r\n\r\n catch(Exception $err_obj)\r\n\r\n {\r\n\r\n show_error($err_obj->getMessage());\r\n\r\n } \r\n\r\n }", "public function getLogUserId()\n {\n return $this->log_user_id;\n }", "abstract protected function getLogMessage();", "public static function getLogUser($uid, $start = 0, $end = 50){\n $query = \"SELECT id_log,UNIX_TIMESTAMP(time)as _time, action, user_modified FROM permisos_log WHERE user_id = $uid LIMIT $start, $end\";\n return DBO::getArray($query);\n }", "public function getLogMessage();", "public static function getLastLog($uid)\n\t{\n\t\treturn LoginLog::where('user_id', '=', $uid)->orderBy('login_time', 'desc')->first()->login_time;\n\t}", "public function parseLog();", "public function getU () {\n\t\treturn $this->u;\n\t}", "Public Function getLogMessages() { Return $this->log; }", "public function GetLog ()\r\n\t{\r\n\t\treturn $this->outputLine;\r\n\t}", "function getLastSeen($o_cassandra,$imei)\n{\n\t$s_cql = \"SELECT * FROM lastlog \n\t\t WHERE \n\t\t imei = '$imei'\n\t\t ;\";\n\n\t$st_results = $o_cassandra->query($s_cql);\n\t$dataType = FALSE;\t// TRUE for fulldata, otherwise lastdata\n\t$orderAsc = FALSE;\t// TRUE for ascending, otherwise descending (default) \n\t$st_obj = logParser($st_results, $dataType, $orderAsc);\n\treturn $st_obj;\n}", "function import_user_log_get_default(\n$uid, $rid, $type, $value\n) {\n $log = new stdClass();\n $log->created = time();\n $log->uid = $uid;\n $log->rid = $rid;\n $log->import_table = 'import_user_asthma_dchp_file_01'; //$import_table;\n $log->type = $type;\n $log->value = $value;\n return $log;\n}", "public function getLog($userId)\n {\n $logInfo = UserLog::where('target_user_id', '=', $userId)->orderBy('created_at', 'desc')->get()\n ->each(function ($item, $key) {\n if ($item->init_data) {\n $item->init_messages = decrypt($item->init_data);\n }\n if ($item->target_data) {\n $item->target_messages = decrypt($item->target_data);\n }\n\n if ($item->operate_user_id) {\n $operateUserInfo = User::find($item->operate_user_id);\n if ($operateUserInfo) {\n $item->operate_user_name = $operateUserInfo->chinese_name;\n } else {\n $item->operate_user_name = \"\";\n }\n\n }\n\n if ($item->target_user_id) {\n $targetUserInfo = User::find($item->target_user_id);\n if ($targetUserInfo) {\n $item->target_user_name = $targetUserInfo->chinese_name;\n } else {\n $item->target_user_name = \"\";\n }\n }\n\n $item->action_name = \"\";\n\n if ($item->action) {\n switch ($item->action) {\n case self::ADD_USER:\n $item->action_name = \"添加员工\";\n break;\n case self::MODIFY_USER_BASIC:\n $item->action_name = \"修改基础信息\";\n break;\n case self::MODIFY_USER_JOB:\n $item->action_name = \"修改工作信息\";\n break;\n case self::MODIFY_USER_ID:\n $item->action_name = \"修改身份信息\";\n break;\n case self::MODIFY_USER_EDU:\n $item->action_name = \"修改学历信息\";\n break;\n case self::MODIFY_USER_CARD:\n $item->action_name = \"修改银行卡信息\";\n break;\n case self::MODIFY_USER_CONTRACT:\n $item->action_name = \"修改合同信息\";\n break;\n case self::MODIFY_USER_EMERGE:\n $item->action_name = \"修改紧急联系人信息\";\n break;\n case self::MODIFY_USER_FAMILY:\n $item->action_name = \"修改家庭信息\";\n break;\n case self::MODIFY_USER_PIC:\n $item->action_name = \"修改个人材料\";\n break;\n case self::USER_RESIGNATION:\n $item->action_name = \"员工离职\";\n break;\n case self::ADD_USER_CARD:\n $item->action_name = \"添加银行卡\";\n break;\n case self::DEL_USER_CARD:\n $item->action_name = \"删除银行卡\";\n break;\n default:\n break;\n }\n }\n\n });\n\n return $logInfo;\n }", "public function getUlogaID()\n {\n return $this->ulogaID;\n }" ]
[ "0.7198823", "0.6183416", "0.6101374", "0.5718201", "0.5696018", "0.56254447", "0.55976194", "0.55587965", "0.5550095", "0.54893404", "0.54700243", "0.54667467", "0.5439181", "0.5391565", "0.5391565", "0.5382415", "0.5342892", "0.53302824", "0.53035986", "0.5297308", "0.5276224", "0.5257204", "0.52441776", "0.52415603", "0.5222016", "0.5219911", "0.5218532", "0.52099997", "0.52083427", "0.5203368" ]
0.6932028
1
eof getU Retorna o valor de log_a
public function getA () { return $this->log_a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function lireLog()\n \t{\n \t\treturn file_get_contents($this->_fichierlog);\n \t}", "public function getAcao () {\n\t\treturn $this->log_acao;\n\t}", "public function getU () {\n\t\treturn $this->log_u;\n\t}", "public function parseLog();", "function getBaseLog(){\t\t\n\t\tif(!isset($_REQUEST['appid'])\n\t\t\t||!isset($_REQUEST['event'])\n\t\t\t||!isset($_REQUEST['uid'])) throw new Exception(\"no appid or event or uid\");\n\t\tif(isset($_REQUEST['timestamp']))\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\telse \n\t\t\t$timestamp = $_SERVER['REQUEST_TIME'];\n\t\t$log=$_REQUEST['appid'].\"\\t\".$_REQUEST['uid'].\"\\t\".$_REQUEST['ref'].\n\t\t\t\"\\t\".$_REQUEST['event'].\"\\t\".$_REQUEST['json_var'].\"\\t\".$timestamp.\"\\n\";\n\t\t\n\t\tif ($_REQUEST ['event'] === \"user.visit\") {\n\t\t\t$ip = getIP ();\n\t\t\tif ($ip != false) {\n\t\t\t\t$log = $log . $_REQUEST ['appid'] . \"\\t\" . $_REQUEST ['uid'] . \"\\t\" . '' . \"\\t\" . \"user.update\" . \"\\t\" . '{\"geoip\":\"' . $ip . '\"}' . \"\\t\" . $timestamp . \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $log;\n\t}", "function logs(){\n\n\t\t}", "public function setU ($log_u) {\n\t\t$this->log_u = $log_u;\n\t}", "public function getUlogaID()\n {\n return $this->ulogaID;\n }", "function log() \n {\n\n $db=Db::getInstance();\n $izraz = $db->prepare(\"select id,firstname,surname,email,userpassword from user where email=:email\");\n $izraz->execute([\"email\"=>Request::post(\"email\")]);\n\n \n $view = new View();\n \n if($izraz->rowCount()>0){\n $red=$izraz->fetch();\n if(password_verify(Request::post(\"userpassword\"),$red->userpassword)){\n $user = new stdClass(); //radi klasu\n $user->id=$red->id;\n $user->firstname=$red->firstname;\n $user->surname=$red->surname;\n $user->email=$red->email;\n $user->firstnameSurname=$red->firstname . \" \" . $red->surname;\n\n Session::getInstance()->login($user); \n \n \n \n $view->render(\n 'narudzba',\n [\n \"narudzba\"=>Asortiman::read()\n ]\n ); // za sve ostale korisnike\n }else{\n $view->render('prijava',[\"poruka\"=>\"Kombinacija email i lozinka ne odgovara...\"]);\n }\n }else{\n $view->render('prijava',[\"poruka\"=>\"Ne postojeći email...\"]);\n }\n \n\n \n \n \n }", "function info_01(){\n\n\t$ActionTime = date('H:i:s');\n\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USER WEB MODIFICAR SELECCIONADO \".$ActionTime.PHP_EOL.\"\\t ID:\".$_POST['id'].PHP_EOL.\"\\t Nombre: \".$_POST['Nombre'].\" \".$_POST['Apellidos'].PHP_EOL.\"\\t Ref: \".$_POST['ref'].PHP_EOL.\"\\t Nivel: \".$_POST['Nivel'].PHP_EOL.\"\\t User: \".$_POST['Usuario'].\".\\n\\t Pass: \".$_POST['Password'].\".\\n\\t Email: \".$_POST['Email'].PHP_EOL.\"\\t Direccion: \".$_POST['Direccion'].PHP_EOL.\"\\t Telefono 1: \".$_POST['Tlf1'].PHP_EOL.\"\\t Imagen: \".$_POST['myimg'].PHP_EOL;\n\n require 'Inc_Log_Total.php';\n\n\t}", "public function lastlogin($username){\n $sql = \"SELECT * FROM klog WHERE logValue LIKE '\" . db::escapechars($username) . \" Successful sign in%' ORDER BY logDate DESC\";\n $result = db::returnrow($sql);\n $lastlogintime = $result['logDate'].\" at \" .$result['logTime'];\n return $lastlogintime;\n }", "function LogRegister($l)\n\t\t\t{\n\t\t\t\tglobal $ficLog;\n\t\t\t\t$ficLog = fopen(\"Liste_Log.txt\",\"a\");\n\t\t\t\t$ret=0;\n\t\t\t\t\n\t\t\t\tif ( $ficLog )\n\t\t\t\t{\n\t\t\t\t\t/* Writing of the new login in \"Liste_log.txt\" */\n\t\t\t\t\tfputs($ficLog, $l);\n\t\t\t\t\tfputs($ficLog, \"\\n\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ret = 1;\n\t\t\t\t}\n\t\t\t\tfclose($ficLog);\n\t\t\treturn $ret;\n\t\t\t}", "public function get_log() {\r\n\t\treturn $this->log;\r\n\t}", "public function getLog();", "function ultimoAcesso($id_usuario=\"\"){\n\t\t\tglobal $sqlGl;\n\t\t\t$condicao = array();\n\t\t\tif($id_usuario!=\"\"){\n\t\t\t\t$condicao['id_area'] = $id_usuario;\n\t\t\t}\n\t\t\t$condicao['area'] = 'usuarios';\n\t\t\t$condicao['acao'] = 'entrou';\n\t\t\t\n\t\t\t$aValores = $sqlGl -> from(\"logs\")->where($condicao)->orderBy('id DESC')->limit('1');\n\t\t\t$aValores = $aValores->fetch();\n\n\t\t\treturn $aValores;\n\t\t\t\n\t\t\t\n\t\t}", "public function printLog() {\n\t\t//open file\n\t\t$fd = fopen($this->logfile, \"r\");\n\t\t\n\t\t//read contents of file\n\t\t$filedata = fread($fd, filesize($this->logfile));\n\t\tfclose($fd);\n\t\t$fd = fopen($this->logfile, \"a\");\n\t\tfwrite($fd, \"FILE READ\\n\");\n\t\tfclose($fd);\n\t\t\n\t\t//return the data\n\t\treturn $filedata;\n\t}", "function info_02(){\n\n\tglobal $texerror;\n\n\t$ActionTime = date('H:i:s');\n\t\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USER WEB MODIFICADO \".$ActionTime.PHP_EOL.\"\\t ID:\".$_POST['id'].PHP_EOL.\"\\t Nombre: \".$_POST['Nombre'].\" \".$_POST['Apellidos'].PHP_EOL.\"\\t Ref: \".$_POST['ref'].PHP_EOL.\"\\t Nivel: \".$_POST['Nivel'].PHP_EOL.\"\\t User: \".$_POST['Usuario'].\".\\n\\t Pass: \".$_POST['Password'].\".\\n\\t Email: \".$_POST['Email'].PHP_EOL.\"\\t Direccion: \".$_POST['Direccion'].PHP_EOL.\"\\t Telefono 1: \".$_POST['Tlf1'].PHP_EOL.\"\\t Imagen: \".$_POST['myimg'].PHP_EOL.$texerror.PHP_EOL;\n\n require 'Inc_Log_Total.php';\n\n\t}", "function log_penyusutan($Aset_ID, $tableKib, $Kd_Riwayat, $tahun, $Data, $DBVAR)\n{\n\n $QueryKibSelect = \"SELECT * FROM $tableKib WHERE Aset_ID = '$Aset_ID'\";\n $exequeryKibSelect = $DBVAR->query ($QueryKibSelect);\n $resultqueryKibSelect = $DBVAR->fetch_object ($exequeryKibSelect);\n\n $tmpField = array();\n $tmpVal = array();\n $sign = \"'\";\n $AddField = \"action,changeDate,TglPerubahan,Kd_Riwayat,NilaiPerolehan_Awal,AkumulasiPenyusutan_Awal,NilaiBuku_Awal,PenyusutanPerTahun_Awal\";\n $action = \"Penyusutan_\" . $tahun . \"_\" . $Data[ 'kodeSatker' ];\n $TglPerubahan = \"$tahun-12-31\";\n $changeDate = date ('Y-m-d');\n $NilaiPerolehan_Awal = 0;\n /* $NilaiPerolehan_Awal = $Data['NilaiPerolehan_Awal'];\n if($NilaiPerolehan_Awal ==\"\"||$NilaiPerolehan_Awal ==0){\n $NilaiPerolehan_Awal =\"NULL\";\n }*/\n $AkumulasiPenyusutan_Awal = $Data[ 'AkumulasiPenyusutan_Awal' ];\n if($AkumulasiPenyusutan_Awal == \"\" || $AkumulasiPenyusutan_Awal == \"0\") {\n $AkumulasiPenyusutan_Awal = \"NULL\";\n }\n\n $NilaiBuku_Awal = $Data[ 'NilaiBuku_Awal' ];\n if($NilaiBuku_Awal == \"\" || $NilaiBuku_Awal == \"0\") {\n $NilaiBuku_Awal = \"NULL\";\n }\n\n $PenyusutanPerTahun_Awal = $Data[ 'PenyusutanPerTahun_Awal' ];\n if($PenyusutanPerTahun_Awal == \"\" || $PenyusutanPerTahun_Awal == \"0\") {\n $PenyusutanPerTahun_Awal = \"NULL\";\n }\n foreach ($resultqueryKibSelect as $key => $val) {\n $tmpField[] = $key;\n if($val == '') {\n $tmpVal[] = $sign . \"NULL\" . $sign;\n } else {\n $tmpVal[] = $sign . addslashes ($val) . $sign;\n }\n }\n $implodeField = implode (',', $tmpField);\n $implodeVal = implode (',', $tmpVal);\n\n $QueryLog = \"INSERT INTO log_$tableKib ($implodeField,$AddField) VALUES\"\n . \" ($implodeVal,'$action','$changeDate','$TglPerubahan','$Kd_Riwayat','{$resultqueryKibSelect->NilaiPerolehan}',$AkumulasiPenyusutan_Awal,\"\n . \"$NilaiBuku_Awal,$PenyusutanPerTahun_Awal)\";\n $exeQueryLog = $DBVAR->query ($QueryLog) or die($DBVAR->error ());;\n\n\n return $tableLog;\n}", "public function getLogradouro(){\n return $this->logradouro;\n }", "function log( $aLog ) {\n global $dbh;\n\n // Strip the PIN from the passPhrase in case of HOTP logins\n $pp = strlen($this->passPhrase) > 6 ? substr($this->passPhrase, -6) : $this->passPhrase;\n\n $ps = $dbh->prepare(\"INSERT INTO Log (userName, passPhrase, idNAS, idClient, status, message) VALUES (:userName, :passPhrase, :idNAS, :idClient, :status, :message)\");\n $ps->execute(array( \":userName\" => $this->userName,\n \":passPhrase\" => $pp,\n \":idNAS\" => (isset($aLog['idNAS']) ? $aLog['idNAS'] : null),\n \":idClient\" => (isset($aLog['idClient']) ? $aLog['idClient'] : null),\n \":status\" => (isset($aLog['status']) ? $aLog['status'] : null),\n \":message\" => (isset($aLog['message']) ? $aLog['message'] : null)));\n }", "public function getLog($userId)\n {\n $logInfo = UserLog::where('target_user_id', '=', $userId)->orderBy('created_at', 'desc')->get()\n ->each(function ($item, $key) {\n if ($item->init_data) {\n $item->init_messages = decrypt($item->init_data);\n }\n if ($item->target_data) {\n $item->target_messages = decrypt($item->target_data);\n }\n\n if ($item->operate_user_id) {\n $operateUserInfo = User::find($item->operate_user_id);\n if ($operateUserInfo) {\n $item->operate_user_name = $operateUserInfo->chinese_name;\n } else {\n $item->operate_user_name = \"\";\n }\n\n }\n\n if ($item->target_user_id) {\n $targetUserInfo = User::find($item->target_user_id);\n if ($targetUserInfo) {\n $item->target_user_name = $targetUserInfo->chinese_name;\n } else {\n $item->target_user_name = \"\";\n }\n }\n\n $item->action_name = \"\";\n\n if ($item->action) {\n switch ($item->action) {\n case self::ADD_USER:\n $item->action_name = \"添加员工\";\n break;\n case self::MODIFY_USER_BASIC:\n $item->action_name = \"修改基础信息\";\n break;\n case self::MODIFY_USER_JOB:\n $item->action_name = \"修改工作信息\";\n break;\n case self::MODIFY_USER_ID:\n $item->action_name = \"修改身份信息\";\n break;\n case self::MODIFY_USER_EDU:\n $item->action_name = \"修改学历信息\";\n break;\n case self::MODIFY_USER_CARD:\n $item->action_name = \"修改银行卡信息\";\n break;\n case self::MODIFY_USER_CONTRACT:\n $item->action_name = \"修改合同信息\";\n break;\n case self::MODIFY_USER_EMERGE:\n $item->action_name = \"修改紧急联系人信息\";\n break;\n case self::MODIFY_USER_FAMILY:\n $item->action_name = \"修改家庭信息\";\n break;\n case self::MODIFY_USER_PIC:\n $item->action_name = \"修改个人材料\";\n break;\n case self::USER_RESIGNATION:\n $item->action_name = \"员工离职\";\n break;\n case self::ADD_USER_CARD:\n $item->action_name = \"添加银行卡\";\n break;\n case self::DEL_USER_CARD:\n $item->action_name = \"删除银行卡\";\n break;\n default:\n break;\n }\n }\n\n });\n\n return $logInfo;\n }", "public function GetLog()\n {\n return $this->writer->Read();\n }", "public function GetLog ()\r\n\t{\r\n\t\treturn $this->outputLine;\r\n\t}", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function log_info($attr)\r\n\r\n {\r\n\r\n try\r\n\r\n {\r\n\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n\r\n }\r\n\r\n catch(Exception $err_obj)\r\n\r\n {\r\n\r\n show_error($err_obj->getMessage());\r\n\r\n } \r\n\r\n }", "public function gravaLog($url){\n $IP = $_SERVER['REMOTE_ADDR'] ;\n $usuarioOnline = $this->Session->read('Auth.User.id');\n $sql = \"INSERT INTO `logs` (`id`, `ip`, `users`, `created`) VALUES (NULL, '\".$IP.$url.\"', '\".$usuarioOnline.\"', NOW());\";\n $results = $this->User->query($sql);\n }", "function verifLog($l) \n\t\t\t{\n\t\t\t\t\tglobal $ficLog;\n\t\t\t\t\t$ficLog = fopen(\"Liste_Log.txt\",\"r\");\n\t\t\t\t\t$ret =0;\n\t\t\t\t\t$oldlogin = $l;\n\t\t\t\t\t\n\t\t\t\t\t/* Suppression of forbidden character */\n\t\t\t\t\t$l = str_replace(CHR(32),\"\", $l);\n\t\t\t\t\t$l = str_replace(\"$\",\"\",$l);\n\t\t\t\t\t$l = str_replace(\"\\\\\",\"\", $l);\n\t\t\t\t\t$l = str_replace(\"/\",\"\",$l);\n\t\t\t\t\t$l = str_replace(\"#\",\"\", $l);\n\t\t\t\t\t$l = str_replace(\"&\",\"\",$l);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(strlen($l) < strlen($oldlogin)) /* That means there are forbidden characters in login*/\n\t\t\t\t\t{\n\t\t\t\t\t\t$ret = 2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $ficLog )\n\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\twhile ( (!feof($ficLog)) && $ret == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tab = fgets($ficLog); /* recuperation of a line of \"Liste_Log.txt\" */\n\t\t\t\n\t\t\n\t\t\t\t\t\t\t\tif ( strlen($tab) > strlen($l) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$nbChar = strlen($tab) - 1; /* Because of the \\0 at the end */\n\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$nbChar = strlen($l);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ( strncmp($tab,$l,$nbChar) == 0) /* Comparison of the line of Liste_Log.txt and the login */\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$ret = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\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\tfclose($ficLog);\n\t\t\t\t\treturn $ret;\n\t\t\t}", "public function setA ($log_a) {\n\t\t$this->log_a = $log_a;\n\t}", "function readAlliNotice($aid) {\n\t list($aid) = $this->escape_input((int) $aid);\n\n\t\t$q = \"SELECT * from \" . TB_PREFIX . \"ali_log where aid = $aid ORDER BY date DESC\";\n\t\t$result = mysqli_query($this->dblink,$q);\n\t\treturn $this->mysqli_fetch_all($result);\n\t}" ]
[ "0.655625", "0.5968363", "0.5945438", "0.59092665", "0.56567484", "0.5601924", "0.5568056", "0.5545796", "0.5544091", "0.5539044", "0.55299515", "0.5523288", "0.55205315", "0.54895407", "0.5475847", "0.5441435", "0.5434754", "0.5394652", "0.53868645", "0.53764445", "0.5354028", "0.53517413", "0.5341828", "0.5323728", "0.5323728", "0.5323309", "0.53041327", "0.5296102", "0.5296046", "0.529223" ]
0.5991519
1
eof getA Retorna o valor de log_acao
public function getAcao () { return $this->log_acao; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function lireLog()\n \t{\n \t\treturn file_get_contents($this->_fichierlog);\n \t}", "public function setAcao ($log_acao) {\n\t\t$this->log_acao = $log_acao;\n\t}", "public function parseLog();", "public function getAcao () {\n\t\treturn $this->acao;\n\t}", "public function getAceptadas()\r\n\t{\r\n\t\t$aceptadas=0;\r\n\t\ttry {\r\n\t\t\t$strQuery=\"SELECT SUM(PartesAc) as Paceptadas FROM Log\";\r\n\t\t\tif($this->conBDPDO()){\r\n\t\t\t\t$pQuery = $this->oConBD->prepare($strQuery);\r\n\t\t\t\t$pQuery->execute();\r\n\t\t\t\t$aceptadas = $pQuery->fetchColumn();\r\n\t\t\t}\r\n\t\t} catch (PDOException $e) {\r\n\t\t\techo \"MySQL.getAceptadas: \" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn -1;\r\n\t\t} \r\n\t\treturn $aceptadas;\r\n\t}", "function log_negocio($arquivo, $oper, $compra, $venda, $total, $pos){\n\t// $arquivo = str_replace(\".txt\", \"\", $arquivo);\n\t// $prev = \"output/$arquivo.csv\";\n\t// $content = \"\";\n\t// if(file_exists($prev)){\n\t// \t$content = file_get_contents($prev);\n\t// }\n\n\t// $compra = number_format($compra, 1, \",\", \"\");\n\t// $venda = number_format($venda, 1, \",\", \"\");\n\t// $total = number_format($total, 1, \",\", \"\");\n\n\t// $fp = fopen($prev, \"w+\") or die(\"Unable to open file!\");\n\t// $content .= \"\\\"$oper\\\",\\\"$compra\\\",\\\"$venda\\\",\\\"$total\\\",\\\"$pos\\\"\\n\";\n\t// fwrite($fp, $content);\n\t// fclose($fp);\n}", "public function getA () {\n\t\treturn $this->log_a;\n\t}", "function ultimoAcesso($id_usuario=\"\"){\n\t\t\tglobal $sqlGl;\n\t\t\t$condicao = array();\n\t\t\tif($id_usuario!=\"\"){\n\t\t\t\t$condicao['id_area'] = $id_usuario;\n\t\t\t}\n\t\t\t$condicao['area'] = 'usuarios';\n\t\t\t$condicao['acao'] = 'entrou';\n\t\t\t\n\t\t\t$aValores = $sqlGl -> from(\"logs\")->where($condicao)->orderBy('id DESC')->limit('1');\n\t\t\t$aValores = $aValores->fetch();\n\n\t\t\treturn $aValores;\n\t\t\t\n\t\t\t\n\t\t}", "public function printLog() {\n\t\t//open file\n\t\t$fd = fopen($this->logfile, \"r\");\n\t\t\n\t\t//read contents of file\n\t\t$filedata = fread($fd, filesize($this->logfile));\n\t\tfclose($fd);\n\t\t$fd = fopen($this->logfile, \"a\");\n\t\tfwrite($fd, \"FILE READ\\n\");\n\t\tfclose($fd);\n\t\t\n\t\t//return the data\n\t\treturn $filedata;\n\t}", "function readAlliNotice($aid) {\n\t list($aid) = $this->escape_input((int) $aid);\n\n\t\t$q = \"SELECT * from \" . TB_PREFIX . \"ali_log where aid = $aid ORDER BY date DESC\";\n\t\t$result = mysqli_query($this->dblink,$q);\n\t\treturn $this->mysqli_fetch_all($result);\n\t}", "public function GetLog()\n {\n return $this->writer->Read();\n }", "function verificarAnulaciones(){\n\t\t$this->procedimiento='vef.ft_log_regularizaciones_ime';\n\t\t$this->transaccion='VEF_LOG_VERI_ANUL';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('anulado','anulado','varchar');\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function insertarLogRegularizaciones(){\n\t\t$this->procedimiento='vef.ft_log_regularizaciones_ime';\n\t\t$this->transaccion='VF_LOG_REGU_INS';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('cuf','cuf','varchar');\n\t\t$this->setParametro('observaciones','observaciones','text');\n\t\t$this->setParametro('fecha_observacion','fecha_observacion','varchar');\n\t\t$this->setParametro('action_estado','action_estado','varchar');\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}", "function importarArquivo() {\n \n $sMsgErro = \"Importação de Arquivo Censo abortada!\\n\"; \n if (!db_utils::inTransaction()) {\n throw new Exception(\"Nenhuma transação do banco encontrada!\");\n }\n \n $this->sNomeArquivoLog = \"tmp/censo\".$this->iAnoEscolhido.\"_importacao_\".db_getsession(\"DB_coddepto\").\"_\";\n $this->sNomeArquivoLog .= db_getsession(\"DB_id_usuario\").\"_\".date(\"dmY\").\"_\".date(\"His\").\"_log.txt\";\n \n $this->pArquivoLog = fopen($this->sNomeArquivoLog, \"w\"); \n if (!$this->pArquivoLog) {\n throw new Exception(\" Não foi possível abrir o arquivo de log! \"); \n } \n \n if ($this->lIncluirAlunoNaoEncontrado) { \n $this->log(\"Registros atualizados na importação do Censo Escolar:\\n\\n\");\n } else {\n $this->log(\"Registros não atualizados na importação do Censo Escolar:\\n\\n\"); \n }\n \n try {\n \n $this->validaArquivo(); \n $this->getLinhasArquivo($this->iCodigoLayout); \n $aLinhasArquivo = $this->getLinhasArquivo();\n \n \n } catch (Exception $eException) {\n throw new Exception($sMsgErro.\" \".$eException->getMessage());\n }\n \n foreach ($aLinhasArquivo as $iIndLinha => $oLinha) {\n \t\n if ($this->lImportarEscola) {\n \t\n \tif ($oLinha->tiporegistro == \"00\") {\n \t $this->atualizaCodigoInepEscola($oLinha);\n \t}\n \t\n }\t\n \n if ($this->lImportarTurma) {\n \t\n \tif ($oLinha->tiporegistro == \"20\") {\n \t $this->atualizaCodigoInepTurma($oLinha);\n \t}\n \t\n }\n \n if ($this->lImportarDocente) {\n \t\n \tif ($oLinha->tiporegistro == \"30\") {\n \t $this->atualizaCodigoInepDocente($oLinha);\n \t}\n \t\n }\n \n if ($this->lImportarAluno) {\n \t\n \tif ($oLinha->tiporegistro == \"60\") {\n \t $this->atualizaCodigoInepAluno($oLinha);\n \t}\n \t\n }\n \n }\n\n }", "public function getLogradouro(){\n return $this->logradouro;\n }", "public function getLogContent()\n {\n return $this->recruit_count . ':'.$this->recruit_content;\n }", "public function getCodigoLogradouro() {\n return $this->iCodigoLogradouro;\n }", "public function gerarDados() {\n \n $iAnoSessao = db_getsession('DB_anousu');\n $iInstituicaoSessao = db_getsession('DB_instit');\n $iNumRegistroLido = 1;\n\n $sNomeArquivo = 'A26_'.$this->sBimReferencia.'.TXT';\n $this->setNomeArquivo($sNomeArquivo);\n \n $lDebug = true;\n if ($lDebug) {\n \t$arqFinal = fopen ( \"tmp/A26_\".$this->sBimReferencia.\".TXT\", 'w+' );\n }\n\n if ($this->codigoOrgaoTCE != \"P088\") {\n \n $whereDepart = \"c61_instit = '{$iInstituicaoSessao}' and depart in (select db01_coddepto from db_departorg \n where db01_anousu = '{$iAnoSessao}' \n and db01_orgao = {$this->codigoOrgao}\n and db01_unidade = {$this->codigoUnidade})\";\n \n if ($this->codigoOrgao == \"29\" && $this->codigoUnidade == \"1\") {\n $whereDepart = \"c61_instit = '{$iInstituicaoSessao}' and depart in (select db01_coddepto from db_departorg \n where db01_anousu = '{$iAnoSessao}' \n and ((db01_orgao = 29 and db01_unidade = 1) \n or (db01_orgao = 29 and db01_unidade = 46) \n or (db01_orgao = 29 and db01_unidade = 47)))\";\n }\n\n if ($this->codigoOrgao == \"20\" && $this->codigoUnidade == \"1\") {\n $whereDepart = \"c61_instit = '{$iInstituicaoSessao}' and depart in (select db01_coddepto from db_departorg \n where db01_anousu = '{$iAnoSessao}' \n and ((db01_orgao = 20 and db01_unidade = 1) \n or (db01_orgao = 20 and db01_unidade = 49)))\";\n }\n \n if ($this->codigoOrgao == \"34\" && $this->codigoUnidade == \"1\") {\n $whereDepart = \"c61_instit = '{$iInstituicaoSessao}' and depart in (select db01_coddepto from db_departorg \n where db01_anousu = '{$iAnoSessao}' \n and ((db01_orgao = 34 and db01_unidade = 1) \n or (db01_orgao = 34 and db01_unidade = 49)))\";\n }\n\n if ($this->codigoOrgao == \"18\" && $this->codigoUnidade == \"1\") {\n $whereDepart = \"c61_instit = '{$iInstituicaoSessao}' and depart in (select db01_coddepto from db_departorg \n where db01_anousu = '{$iAnoSessao}' \n and ((db01_orgao = 18 and db01_unidade = 1) \n or (db01_orgao = 18 and db01_unidade = 45) \n or (db01_orgao = 18 and db01_unidade = 46) \n or (db01_orgao = 18 and db01_unidade = 47) \n or (db01_orgao = 18 and db01_unidade = 48) \n or (db01_orgao = 18 and db01_unidade = 49)))\";\n }\n\n } else {\n\n $whereDepart = \"depart in (select db01_coddepto from db_departorg \n where db01_anousu = '{$iAnoSessao}')\";\n\n }\n\n $sqlContas = \"select distinct on (c63_banco||c63_agencia||c63_dvagencia||c63_conta||c63_dvconta)\n c63_banco,\n c63_agencia,\n c63_dvagencia,\n c63_conta,\n c63_dvconta,\n db83_descricao,\n coalesce(z01_cgccpf, '00000000000') as cgccpf\n from saltes \n inner join plugins.saltesdepart on saltes = k13_conta \n and departpadrao = 't'\n inner join plugins.assinaturaordenadordespesa on assinaturaordenadordespesa.departamento = saltesdepart.depart\n and assinaturaordenadordespesa.principal is true\n inner join conplanoreduz on c61_reduz = k13_reduz \n inner join conplanoconta on c63_codcon = c61_codcon \n and c63_anousu = c61_anousu\n inner join conplano on c60_codcon = c63_codcon\n and c60_anousu = c63_anousu\n inner join conplanocontabancaria on c56_codcon = c60_codcon\n and c56_anousu = c60_anousu\n inner join contabancaria on db83_sequencial = c56_contabancaria \n inner join cgm on z01_numcgm = plugins.assinaturaordenadordespesa.numcgm\n left join (select distinct z01_cgccpf as cgccpf from cgm where z01_cgccpf not in ('0', '00000000000', '00000000000000')) as cgm1 on cgm1.cgccpf = db83_identificador \n where {$whereDepart} and plugins.assinaturaordenadordespesa.ativo = 't' and c61_anousu = '{$iAnoSessao}'\";\n\n $resultContas = db_query($sqlContas);\n $iLinhasContas = pg_num_rows($resultContas); \n //Se não houver dados, o arquivo terá que ser importado só com header e trailler\n /*if ($iLinhasContas == 0) {\n throw new Exception(\"Nenhum registro encontrado\"); \t\n }*/\n\n /*\n * HEADER\n */\n\n $oDadosHeader = new stdClass();\n \n $oDadosHeader->TipRegistro = \"0\";\n $oDadosHeader->NomeArquivo = str_pad(\"A26_\".$this->sBimReferencia, 10, \" \", STR_PAD_RIGHT);\n $oDadosHeader->BimReferencia = $this->sBimReferencia;\n $oDadosHeader->TipoArquivo = \"O\"; \n $oDadosHeader->DataGeracaoArq = \"$this->dtDataGeracao\";\n $oDadosHeader->HoraGeracaoArq = \"$this->dtHoraGeracao\";\n $oDadosHeader->CodigoOrgao = $this->codigoOrgaoTCE;\n $oDadosHeader->NomeUnidade = str_pad($this->nomeUnidade, 100, \" \", STR_PAD_RIGHT);\n $oDadosHeader->Brancos1 = \" \";\n $oDadosHeader->FornecedorSoftware = str_pad(substr(\"SOFTWARE PUBLICO BRASILEIRO\",0,100), 100, \" \", STR_PAD_LEFT);\n $oDadosHeader->Brancos2 = str_repeat(\" \", 167);\n $oDadosHeader->NumRegistroLido = str_pad($iNumRegistroLido, 10, \"0\", STR_PAD_LEFT);\n \n $oDadosHeader->codigolinha = 2001749;\n\n $this->aDados[] = $oDadosHeader; \n \n if ($lDebug) {\n \t$sLinhaHeader = $oDadosHeader->TipRegistro \n .$oDadosHeader->NomeArquivo \n .$oDadosHeader->BimReferencia \n .$oDadosHeader->TipoArquivo \n .$oDadosHeader->DataGeracaoArq\n .$oDadosHeader->HoraGeracaoArq\n .$oDadosHeader->CodigoOrgao \n .$oDadosHeader->NomeUnidade\n .$oDadosHeader->Brancos1\n .$oDadosHeader->FornecedorSoftware \n .$oDadosHeader->Brancos2 \n .$oDadosHeader->NumRegistroLido ;\n \tfputs($arqFinal, $sLinhaHeader.\"\\r\\n\");\n }\n \n if ($iLinhasContas > 0) {\n /*\n * DETALHE 1\n */\n for ($iInd = 0; $iInd < $iLinhasContas; $iInd++) {\n \n $iNumRegistroLido++;\n $oDadosContas = db_utils::fieldsMemory($resultContas, $iInd);\n $oDadosDetalhe = new stdClass();\n \n $oDadosDetalhe->TipRegistro = \"1\";\n $oDadosDetalhe->Brancos = \" \";\n $oDadosDetalhe->Banco = str_pad($oDadosContas->c63_banco, 3, \" \", STR_PAD_LEFT);\n $oDadosDetalhe->Agencia = str_pad($oDadosContas->c63_agencia.$oDadosContas->c63_dvagencia, 6, \" \", STR_PAD_LEFT);\n $oDadosDetalhe->ContaCorrente = str_pad($oDadosContas->c63_conta.$oDadosContas->c63_dvconta, 13, \" \", STR_PAD_LEFT);\n $oDadosDetalhe->DescConta = str_pad(substr(($oDadosContas->db83_descricao ? $oDadosContas->db83_descricao :'S/ Descr'), 0, 50), 50, \" \", STR_PAD_RIGHT); \n $oDadosDetalhe->Brancos1 = \" \";\n $oDadosDetalhe->TitularConta = str_pad($oDadosContas->cgccpf, 11, \"0\", STR_PAD_LEFT);\n $oDadosDetalhe->Brancos2 = str_repeat(\" \", 320);\n $oDadosDetalhe->NumRegistroLido = str_pad($iNumRegistroLido, 10, \"0\", STR_PAD_LEFT);\n \n $oDadosDetalhe->codigolinha = 2001750;\n\n $this->aDados[] = $oDadosDetalhe;\n \n if ($lDebug) {\n \t$sLinhaDetalhe = $oDadosDetalhe->TipRegistro \n .$oDadosDetalhe->Brancos \n .$oDadosDetalhe->Banco \n .$oDadosDetalhe->Agencia \n .$oDadosDetalhe->ContaCorrente\n .$oDadosDetalhe->DescConta \n .$oDadosDetalhe->Brancos1\n .$oDadosDetalhe->TitularConta\n .$oDadosDetalhe->Brancos2\n .$oDadosDetalhe->NumRegistroLido ;\n \tfputs($arqFinal, $sLinhaDetalhe.\"\\r\\n\");\n }\n }\n }\n \n //TRAILLER\n $iNumRegistroLido++;\n $oDadosTrailler = new stdClass();\n $oDadosTrailler->TipRegistro = \"9\";\n $oDadosTrailler->Brancos = str_repeat(\" \", 407);\n $oDadosTrailler->NumRegistroLido = str_pad($iNumRegistroLido, 10, \"0\", STR_PAD_LEFT);\n\n $oDadosTrailler->codigolinha = 2001751;\n \n $this->aDados[] = $oDadosTrailler;\n \n if ($lDebug) {\n $sLinhaTrailler = $oDadosTrailler->TipRegistro\n .$oDadosTrailler->Brancos \n .$oDadosTrailler->NumRegistroLido;\n fputs($arqFinal, $sLinhaTrailler.\"\\r\\n\");\n fclose($arqFinal);\n }\n }", "function getCount() {\n // $countFile = 'data.txt'; // Change to the log file name\n $lines = file($GLOBALS['countFile']);//file in to an array\n return $lines[0];\n }", "public function content() {\n\t\treturn $this->exists() ? file_get_contents($this->getLogFilePath()) : 'Log has not been created yet.';\n\t}", "protected function log_contents() {\n if (is_null($this->log_handle)) {\n $this->log_handle = fopen($this->log_directory . $this->log_filename, \"r\");\n }\n\n return stream_get_contents($this->log_handle);\n }", "protected function get_arquivo($nomeArquivo){\n\t\t\t$arquivo = fopen($nomeArquivo,\"r\");\n\t\t\t$conteudo = NULL;\n\t\t\twhile(!feof($arquivo)){\n\t\t\t\t$conteudo = $conteudo.fgets($arquivo);\n\t\t\t}\n\t\t\treturn $conteudo;\n\t\t}", "public function GetLog ()\r\n\t{\r\n\t\treturn $this->outputLine;\r\n\t}", "public function getCaminhoArquivo()\n {\n return $this->caminhoArquivo;\n }", "private function gerarArquivo() {\n\n $aContas = ArquivoConfiguracaoTCEAC::getInstancia()->getContaCorrente();\n\n if (empty($aContas)) {\n throw new Exception(\"Nenhuma conta corrente encontrada no arquivo de configuração.\");\n }\n\n /**\n * Busca os lançamentos\n */\n $sWhere = \" c02_instit in(\" . implode(',', $this->aInstituicoes) . \") \\n\";\n $sWhere .= \" and e81_cancelado is null \\n\";\n $sWhere .= \" and (empageconfche.e91_codcheque is null or empageconfche.e91_ativo is true) \\n\";\n $sWhere .= \" and c69_data between '{$this->oDataInicial->getDate()}' and '{$this->oDataFinal->getDate()}' \\n\";\n $oDaoConlancamval = new cl_conlancamval();\n $aQuerys = array(\"D\" => \"c69_debito\", \"C\" => \"c69_credito\");\n\n $aSqlLancamentos = '';\n\n foreach ($aQuerys as $sTipo => $sCampo) {\n\n $sCampos = \" contacorrentedetalhe.*,\";\n $sCampos .= \" c69_sequen, c69_codlan, c69_data, c69_valor, {$sCampo} as c69_conta, '{$sTipo}' as tipo, conlancaminstit.c02_instit, c75_numemp, \\n\";\n $sCampos .= \" conplano.c60_estrut, conplano.c60_identificadorfinanceiro, \\n\";\n $sCampos .= \" case when c115_sequencial is null then false else true end as estorno, \\n\";\n $sCampos .= \" conlancamslip.c84_conlancam is not null as slip, conlancamslip.c84_slip, empageconfche.e91_cheque, \\n\";\n $sCampos .= \" placaixarec.k81_seqpla is not null as planilha, placaixarec.k81_operbanco, placaixarec.k81_codpla, \\n\";\n $sCampos .= \" (select k12_numpre \\n\";\n $sCampos .= \" from cornump \\n\";\n $sCampos .= \" where cornump.k12_id = corrente.k12_id \\n\";\n $sCampos .= \" and cornump.k12_data = corrente.k12_data \\n\";\n $sCampos .= \" and cornump.k12_autent = corrente.k12_autent limit 1) as numpre, \\n\";\n $sCampos .= \" coremp.k12_id is not null as ordempagamento, coremp.k12_cheque as cheque_ordem, coremp.k12_codord \\n\";\n $aSqlLancamentos [] = $oDaoConlancamval->sql_query_contacorrentedetalhe_tce($sCampos, $sTipo, '', $sWhere);\n }\n\n $sSqlLancamentos = implode(\" union all \", $aSqlLancamentos);\n $sSqlLancamentos .= \" order by c69_data, c69_sequen\";\n $rsLancamentos = $oDaoConlancamval->sql_record($sSqlLancamentos);\n\n if ($oDaoConlancamval->erro_status == '0') {\n throw new Exception(\"Erro ao buscar os dados dos lançamentos.\");\n }\n\n if (!pg_num_rows($rsLancamentos)) {\n throw new Exception(\"O Período informado não possui lançamentos contábeis.\");\n }\n\n $oXml = new DOMDocument( \"1.0\", \"utf-8\" );\n $oXml->formatOutput = true;\n $oTagLista = $oXml->createElement(\"lista\");\n\n /**\n * Percorre os lançamentos montando o XML\n */\n $aContasInvalidas = array();\n for ($iRow = 0; $iRow < pg_num_rows($rsLancamentos); $iRow++) {\n\n $oTagPartida = $oXml->createElement(\"partida\");\n\n $oLancamento = db_utils::fieldsMemory($rsLancamentos, $iRow);\n $oContaCorrenteDetalhe = new ContaCorrenteDetalhe();\n\n if (!empty($oLancamento->c19_orctiporec)) {\n $oContaCorrenteDetalhe->setRecurso(RecursoRepository::getRecursoPorCodigo($oLancamento->c19_orctiporec));\n }\n\n if (!empty($oLancamento->c19_estrutural)) {\n $oContaCorrenteDetalhe->setEstrutural($oLancamento->c19_estrutural);\n }\n\n if (!empty($oLancamento->c19_orcdotacao) && !empty($oLancamento->c19_orcdotacaoanousu)) {\n $oContaCorrenteDetalhe->setDotacao(DotacaoRepository::getDotacaoPorCodigoAno($oLancamento->c19_orcdotacao, $oLancamento->c19_orcdotacaoanousu));\n }\n\n if (!empty($oLancamento->c19_numemp)) {\n $oContaCorrenteDetalhe->setEmpenho(EmpenhoFinanceiroRepository::getEmpenhoFinanceiroPorNumero($oLancamento->c19_numemp));\n }\n\n if (!empty($oLancamento->c19_contabancaria)) {\n $oContaCorrenteDetalhe->setContaBancaria(new ContaBancaria($oLancamento->c19_contabancaria));\n }\n\n if (!empty($oLancamento->c19_acordo)) {\n $oContaCorrenteDetalhe->setAcordo(AcordoRepository::getByCodigo($oLancamento->c19_acordo));\n }\n\n if (!empty($oLancamento->c19_numcgm)) {\n $oContaCorrenteDetalhe->setCredor(CgmFactory::getInstanceByCgm($oLancamento->c19_numcgm));\n }\n\n $sPlanoConta = ArquivoConfiguracaoTCEAC::getInstancia()->getPlanoContaPorCodigo($oLancamento->c60_estrut);\n\n if (empty($sPlanoConta) || !preg_match(\"/^(\\d)(\\d)(\\d)(\\d)(\\d)(\\d{2})(\\d{2})$/\", $sPlanoConta)) {\n $aContasInvalidas[] = $oLancamento->c60_estrut;\n // throw new Exception(\"Código estrutural inválido para a conta {$oLancamento->c60_estrut}.\");\n }\n\n /**\n * Seta a contacontabil\n */\n $oTagCondigoContaContabil = $oXml->createElement(\"codigo\", preg_replace(\"/(\\d)(\\d)(\\d)(\\d)(\\d)(\\d{2})(\\d{2})/\", \"$1.$2.$3.$4.$5.$6.$7\", $sPlanoConta) );\n $oTagContaContabil = $oXml->createElement(\"contaContabil\");\n $oTagContaContabil->appendChild($oTagCondigoContaContabil);\n\n /**\n * Seta os dados da Conta Corrente\n */\n $lGerarContaCorrente = !empty($oLancamento->c19_sequencial);\n $sDadosContaCorrente = $this->getLinhaContaCorrente($oContaCorrenteDetalhe, $oLancamento);\n\n $iTipoContaCorrente = ArquivoConfiguracaoTCEAC::getInstancia()->getContaCorrentePorCodigo($oLancamento->c19_contacorrente);\n\n if ( !empty($sDadosContaCorrente) && !empty($iTipoContaCorrente) ) {\n\n switch ($iTipoContaCorrente) {\n\n case self::CONTA_CORRENTE_DOTACAO:\n $sDadosContaCorrente = str_pad($sDadosContaCorrente, 38, '0', STR_PAD_RIGHT);\n break;\n case self::CONTA_CORRENTE_DESPESA:\n $sDadosContaCorrente = str_pad($sDadosContaCorrente, 82, '0', STR_PAD_RIGHT);\n break;\n case self::CONTA_CORRENTE_MOVIMENTACAO_FINANCEIRA:\n\n $oContaPlano =\n ContaPlanoPCASPRepository::getContaPorReduzido(\n $oLancamento->c19_reduz,\n $oLancamento->c19_conplanoreduzanousu,\n InstituicaoRepository::getInstituicaoByCodigo($oLancamento->c02_instit)\n );\n\n $sRecurso = ArquivoConfiguracaoTCEAC::getInstancia()->getRecursoPorCodigo($oContaPlano->getRecurso());\n $sDadosContaCorrente .= str_pad($sRecurso, 3, '0', STR_PAD_LEFT);\n break;\n }\n }\n\n $oTagContaCorrente = $oXml->createElement(\"conteudoContaCorrente\", $sDadosContaCorrente);\n\n /**\n * Seta o Tipo de conta corrente\n */\n if ($lGerarContaCorrente) {\n\n $oTagNumeroTipoConta = $oXml->createElement(\"numero\", ArquivoConfiguracaoTCEAC::getInstancia()->getContaCorrentePorCodigo($oLancamento->c19_contacorrente));\n $oTagTipoConta = $oXml->createElement(\"tipoDeContaCorrente\");\n $oTagTipoConta->appendChild($oTagNumeroTipoConta);\n }\n\n $oTagNatureza = $oXml->createElement(\"natureza\", $oLancamento->tipo);\n\n $oTagIdentificadorFinanceiro = null;\n\n /**\n * Seta o Identificador Financeiro\n */\n if ( in_array($oLancamento->c60_identificadorfinanceiro, array(\"F\", \"P\"))) {\n $oTagIdentificadorFinanceiro = $oXml->createElement(\"indicadorSuperavitFinanceiro\", $oLancamento->c60_identificadorfinanceiro);\n }\n\n /**\n * Seta a Tag Lancamento\n */\n $oTagLancamento = $oXml->createElement(\"lancamento\");\n $oTagNumeroLancamento = $oXml->createElement(\"numero\", $oLancamento->c69_codlan);\n $oTagTipoLancamento = $oXml->createElement(\"tipoDeLancamento\", ($oLancamento->estorno == 't' ? \"ESTORNO\" : \"ORDINARIO\"));\n\n $oTagLancamento->appendChild($oTagNumeroLancamento);\n $oTagLancamento->appendChild($oTagTipoLancamento);\n\n /**\n * Seta o Valor\n */\n $oTagValor = $oXml->createElement(\"valor\", $oLancamento->c69_valor);\n\n /**\n * Monta o registro no xml\n */\n $oTagPartida->appendChild($oTagContaContabil);\n $oTagPartida->appendChild($oTagContaCorrente);\n\n if ($lGerarContaCorrente) {\n $oTagPartida->appendChild($oTagTipoConta);\n }\n\n $oTagPartida->appendChild($oTagNatureza);\n if (!empty($oTagIdentificadorFinanceiro)) {\n $oTagPartida->appendChild($oTagIdentificadorFinanceiro);\n }\n $oTagPartida->appendChild($oTagLancamento);\n $oTagPartida->appendChild($oTagValor);\n\n $oTagLista->appendChild( $oTagPartida );\n }\n\n if (!empty($aContasInvalidas)) {\n throw new Exception(\"Códigos de estrutural inválido para as contas: \\n \".implode(array_unique($aContasInvalidas), \",\\n\"));\n }\n\n $oXml->appendChild( $oTagLista );\n\n $this->validarXML($oXml, 'config/tce/AC/schema-partida.xsd');\n $this->sArquivo = $oXml->saveXML();\n }", "public function readerdata()\n {\n //$xr8_data = $this->Model_log->logNew();\n //$id_advance = 'CLjFxfEC16HE9AZ948Ws'; \n //a181a603769c1f98ad927e7367c7aa51 = all \n //b326b5062b2f0e69046810717534cb09 = true\n //68934a3e9455fa72420237eb05902327 = false\n //jJ8KHSMs4J8wzHCIadwn4QeBI7fH9NZO = resumen\n //Tbvh7VnjCg5fbSPCg7u5\n /*\n id_advance = ec66331706175538efd5\n a18a603769c1f98ad927e7367c7aa51 = b326b5062b2f0e69046810717534cb09\n */\n \n if (empty($_GET['id_advance'])){\n $date = date(\"Y-m\");\n }else{\n $date = $_GET['id_advance'];\n }\n\n if ($_GET['a181a603769c1f98ad927e7367c7aa51'] == 'b326b5062b2f0e69046810717534cb09') {\n\n /*\n all\n id_advance =\n a181a603769c1f98ad927e7367c7aa51 = b326b5062b2f0e69046810717534cb09\n */\n $id_advance = null;\n $all = true;\n $xr8_data = $this->Querys->cajaRead($id_advance, $all, $date);\n }else if ($_GET['a181a603769c1f98ad927e7367c7aa51'] == '68934a3e9455fa72420237eb05902327') {\n\n /*\n one\n id_advance = ec66331706175538efd5\n a181a603769c1f98ad927e7367c7aa51 = 68934a3e9455fa72420237eb05902327\n */\n\n $id_advance = $_GET['id_advance'];\n $all = false;\n $xr8_data = $this->Querys->cajaRead($id_advance, $all, $date);\n }else {\n $xr8_data = array(\"Error\" => 101);\n }\n\n\n $this->output->set_content_type('application/json')->set_output(json_encode($xr8_data));\n }", "public function get_log() {\r\n\t\treturn $this->log;\r\n\t}", "public function getHoraFin(){\n\t\treturn $this->hora_fin;\n\t}", "public function getHoraFin(){\n\t\treturn $this->hora_fin;\n\t}", "private function log( $sMensagem = \"\", $iTipoLog = DBLog::LOG_INFO ) {\n \n /**\n * Logar no banco as alteracoes\n */\n RecadastroImobiliarioImoveisArquivo::$oLog->escreverLog( $sMensagem, $iTipoLog );\n }" ]
[ "0.6359202", "0.6193682", "0.5518186", "0.549439", "0.5409281", "0.54040015", "0.5401076", "0.53567666", "0.5264895", "0.52570957", "0.5247661", "0.5223906", "0.5159906", "0.51256275", "0.5096782", "0.50737894", "0.50414246", "0.5022179", "0.50043696", "0.49793473", "0.49756625", "0.4956589", "0.49556637", "0.4947063", "0.49380457", "0.49296412", "0.49243027", "0.4905774", "0.4905774", "0.4877407" ]
0.7263602
0
eof getAcao Retorna o valor de log_parms
public function getParms () { return $this->log_parms; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAcao () {\n\t\treturn $this->log_acao;\n\t}", "public function setAcao ($log_acao) {\n\t\t$this->log_acao = $log_acao;\n\t}", "public function setParms ($log_parms) {\n\t\t$this->log_parms = substr($log_parms,0,1020);\n\t}", "protected function logDetailsread()\n {\n $releaseId = $this->_params['releaseId'];\n $memberId = $this->_params['memberId'];\n $strData = array(\n \"releaseId\" => $this->_params['releaseId'],\n 'articleId' => $this->_params['articleId']\n );\n\n// $strData = \"releaseId\" . $this->pairSepar . $this->_params['releaseId'] . $this->separator\n// . 'articleId' . $this->pairSepar . $this->_params['articleId'] . $this->separator;\n\n $data = array(\n 'L_ModuleID' => $this->_moduleID,\n 'L_UserID' => $this->_params['memberId'],\n 'L_Action' => 'details',\n 'L_Data' => $strData\n );\n\n $oLog = new LogObject();\n $oLog->writeData($data);\n }", "function fetch_log($log){\n\tglobal $filter;\n\t// Get Data from form post\n $lines = $_GET['maxlines'];\n if (preg_match(\"/!/\",htmlspecialchars($_GET['strfilter'])))\n \t$grep_arg=\"-iv\";\n else\n \t$grep_arg=\"-i\";\n\t\t\n // Get logs based in filter expression\n if($filter != \"\") {\n exec(\"tail -2000 {$log} | /usr/bin/grep {$grep_arg} \" . escapeshellarg($filter). \" | tail -r -n {$lines}\" , $logarr); \n }\n else {\n exec(\"tail -r -n {$lines} {$log}\", $logarr);\n }\n\t// return logs\n\treturn $logarr;\n}", "public function parseLog();", "public function lireLog()\n \t{\n \t\treturn file_get_contents($this->_fichierlog);\n \t}", "public function log_info($attr)\r\n\r\n {\r\n\r\n try\r\n\r\n {\r\n\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n\r\n }\r\n\r\n catch(Exception $err_obj)\r\n\r\n {\r\n\r\n show_error($err_obj->getMessage());\r\n\r\n } \r\n\r\n }", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function log_info($attr)\r\n {\r\n try\r\n {\r\n $logindata=$this->session->userdata(\"admin_loggedin\");\r\n return $this->write_log($attr[\"msg\"],decrypt($logindata[\"user_id\"]),($attr[\"sql\"]?$attr[\"sql\"]:\"\"));\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "private function _log()\n\t{\n\t\t$log = [\n\t\t\t'url'\t\t\t=> Yii::$app->request->getUrl(),\n\t\t\t'ip'\t\t\t=> Yii::$app->request->getUserIP(),\n\t\t\t'_jsonRequest' \t=> [\n\t\t\t\tself::OBJECT_PARAMS\t=> $this->_jsonRequest,\n\t\t\t\tself::OBJECT_FILES => $this->_filesRequest,\n\t\t\t],\n\t\t\t'_jsonResponse' => $this->_jsonResponse,\n\t\t];\n\n\t\tYii::info($log, 'db_log');\n\t}", "function log_file_info()\r\n\t{\r\n\t\t$details = $this->input_details;\r\n\t\tif(is_array($details))\r\n\t\t{\r\n\t\t\tforeach($details as $name => $value)\r\n\t\t\t{\r\n\t\t\t\t$this->log($name,$value);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$this->log .=\" Unknown file details - Unable to get video details using FFMPEG \\n\";\r\n\t\t}\r\n\t}", "function get_orasecs($obj, $socket_id, $channel_id, $data)\n{\n// global $data_io;\nprint(\"get_orasecs => \" .$this->filter.\"\\n\");\n list($format,$posStart,$count,$results, $sort, $dir,$newRequest)=explode(':',$data);\n \n \n $script = $this->data_io->sourceObj->getOraSecs($format, $posStart, $count,$results, $sort, $dir, $newRequest,$this->filter);\n\n $obj->write($socket_id, $channel_id, \"err=\".$script.\";\");\t\n}", "public function getLog();", "function get_arguments( )\n\t{\n\t\t$args['line'] = $this->line;\n\t\t$args['file'] = $this->file_name;\n\t\t$args['error'] = $this->error;\n\t\t$args['query'] = $this->pass_query;\n\n\t\treturn $args;\n\t}", "public function logdetail() {\n\t\t$whorder=\"date desc\";\n\t\t$whdata1=array('level' => 1);\n \t$data['logdresult1'] = $this->SIS_model->get_orderlistspficemore('logs','date,user,host_ip,message_title,message_desc',$whdata1,$whorder);\n\t\t$whdata2=array('level' => 2);\n \t$data['logdresult2'] = $this->SIS_model->get_orderlistspficemore('logs','date,user,host_ip,message_title,message_desc',$whdata2,$whorder);\n\t\t$whdata3=array('level' => 3);\n \t$data['logdresult3'] = $this->SIS_model->get_orderlistspficemore('logs','date,user,host_ip,message_title,message_desc',$whdata3,$whorder);\n//\t $this->logger->write_logmessage(\"view\",\" View log details\", \"log details details...\");\n // \t$this->logger->write_dblogmessage(\"view\",\" View log details\", \"log details...\");\n\t $this->load->view('audittr/logdetail',$data);\n }", "function ultimoAcesso($id_usuario=\"\"){\n\t\t\tglobal $sqlGl;\n\t\t\t$condicao = array();\n\t\t\tif($id_usuario!=\"\"){\n\t\t\t\t$condicao['id_area'] = $id_usuario;\n\t\t\t}\n\t\t\t$condicao['area'] = 'usuarios';\n\t\t\t$condicao['acao'] = 'entrou';\n\t\t\t\n\t\t\t$aValores = $sqlGl -> from(\"logs\")->where($condicao)->orderBy('id DESC')->limit('1');\n\t\t\t$aValores = $aValores->fetch();\n\n\t\t\treturn $aValores;\n\t\t\t\n\t\t\t\n\t\t}", "public function log(){\n\t\t$this->iLog(func_get_args(),__FUNCTION__);\n\t}", "function debuglog($o,$d='') {\n // Jika ada waktu, silahkan buat log nya ke dalam database.\n $CI = get_instance();\n $session_data = $CI->session->userdata('logged_in');\n //$file_debug = 'C:/xampp/htdocs/simkinerjav2/assets/log' . date(\"Y-m-d\") . '.log';\n //$file_debug = '/var/log/simkinerja/debug-' . date(\"Y-m-d\") . '.log';\n ob_start();\n var_dump(date(\"Y-m-d h:i:s\"));\n var_dump($session_data['susrNama']);\n var_dump($CI->input->ip_address());\n var_dump($o);\n if(!empty($d))\n var_dump(json_encode($d));\n $c = ob_get_contents();\n ob_end_clean();\n\n if(isset($file_debug))\n {\n $f = fopen($file_debug, \"a\");\n fputs($f, \"$c\\n\");\n fflush($f);\n fclose($f);\n }\n }", "function log_ouput_file_info()\r\n\t{\r\n\t\t$details = $this->output_details;\r\n\t\tif(is_array($details))\r\n\t\t{\r\n\t\t\tforeach($details as $name => $value)\r\n\t\t\t{\r\n\t\t\t\t$this->log('output_'.$name,$value);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$this->log .=\" Unknown file details - Unable to get output video details using FFMPEG \\n\";\r\n\t\t}\r\n\t}", "public function getPayLogParams()\n {\n return $this->PayLogParams;\n }", "function pais_params($filename='pais_params.cfg') {\n\ttry {\n\t\tglobal $cfg, $dic;\n\t\tif (file_exists($filename)) {\n\t if ($handle = fopen($filename, 'r')) {\n\t while (!feof($handle)) {\n\t list($type, $name, $value) = preg_split(\"/\\||=/\", fgets($handle), 3);\n\t\t\t\t\tif (trim($type)!='#') { \n\t\t\t\t\t#PARAMS $pais[mexico][variable]\n\t\t\t\t\t\t$pais_params[trim($type)][trim($name)] = trim($value);\n\t\t\t\t\t\t$val.=$type.' | '.$name.' = '.$value.\"<br/>\\n\\r\";\n\t\t\t\t\t}\t\n\t }\t \n\t }\t \n\t\t\treturn $val;\n\t\t}else{\n\t\t\t$msj = \"¡ERROR CRÍTICO!<br/> No se ha logrado cargar el archivo diccionario, por favor, contacte al administrador del sistema.<br/>\";\n\t \tthrow new Exception($msj, 1); \t\n\t }\t\n\t} catch (Exception $e) {\t\t\n\t\tprint($e->getMessage());\n\t\treturn false;\n\t}\t \n}", "function log_negocio($arquivo, $oper, $compra, $venda, $total, $pos){\n\t// $arquivo = str_replace(\".txt\", \"\", $arquivo);\n\t// $prev = \"output/$arquivo.csv\";\n\t// $content = \"\";\n\t// if(file_exists($prev)){\n\t// \t$content = file_get_contents($prev);\n\t// }\n\n\t// $compra = number_format($compra, 1, \",\", \"\");\n\t// $venda = number_format($venda, 1, \",\", \"\");\n\t// $total = number_format($total, 1, \",\", \"\");\n\n\t// $fp = fopen($prev, \"w+\") or die(\"Unable to open file!\");\n\t// $content .= \"\\\"$oper\\\",\\\"$compra\\\",\\\"$venda\\\",\\\"$total\\\",\\\"$pos\\\"\\n\";\n\t// fwrite($fp, $content);\n\t// fclose($fp);\n}", "function reporteGeneral(){\n $this->procedimiento='conta.ft_comisionistas_sel';\n $this->transaccion='CONTA_CMS_REPO';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n\n $this->setParametro('id_periodo','id_periodo','int4');\n\n $this->captura('nombre_agencia','varchar');\n $this->captura('nit_comisionista','varchar');\n $this->captura('nro_contrato','varchar');\n $this->captura('nro_boleto','varchar');\n $this->captura('periodo','int4');\n $this->captura('cantidad','numeric');\n $this->captura('precio_unitario','numeric');\n $this->captura('monto_total','numeric');\n $this->captura('monto_total_comision','numeric');\n $this->captura('tipo','varchar');\n\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 }", "function logs(){\n\n\t\t}", "public static function getLog($start = 0, $end = 50){\n $query = \"SELECT id_log,UNIX_TIMESTAMP(time)as _time, action, user_modified FROM permisos_log LIMIT $start, $end\";\n return DBO::getArray($query);\n }", "function getBaseLog(){\t\t\n\t\tif(!isset($_REQUEST['appid'])\n\t\t\t||!isset($_REQUEST['event'])\n\t\t\t||!isset($_REQUEST['uid'])) throw new Exception(\"no appid or event or uid\");\n\t\tif(isset($_REQUEST['timestamp']))\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\telse \n\t\t\t$timestamp = $_SERVER['REQUEST_TIME'];\n\t\t$log=$_REQUEST['appid'].\"\\t\".$_REQUEST['uid'].\"\\t\".$_REQUEST['ref'].\n\t\t\t\"\\t\".$_REQUEST['event'].\"\\t\".$_REQUEST['json_var'].\"\\t\".$timestamp.\"\\n\";\n\t\t\n\t\tif ($_REQUEST ['event'] === \"user.visit\") {\n\t\t\t$ip = getIP ();\n\t\t\tif ($ip != false) {\n\t\t\t\t$log = $log . $_REQUEST ['appid'] . \"\\t\" . $_REQUEST ['uid'] . \"\\t\" . '' . \"\\t\" . \"user.update\" . \"\\t\" . '{\"geoip\":\"' . $ip . '\"}' . \"\\t\" . $timestamp . \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $log;\n\t}", "public static function opra_log($opra, $ip ,$mis=NULL)\n {\n $op = new OpLog() ;\n $op->ipadd = $ip ;\n $op->opr = $opra ;\n if ($mis!== null) {\n $op->misc = $mis ;\n }\n \n $op->save(false) ;\n }", "private function log( $sMensagem = \"\", $iTipoLog = DBLog::LOG_INFO ) {\n \n /**\n * Logar no banco as alteracoes\n */\n RecadastroImobiliarioImoveisArquivo::$oLog->escreverLog( $sMensagem, $iTipoLog );\n }", "private function _procesarLineasCambio(&$currentClientState, &$jsonResponse)\n {\n fseek($this->_logfd, $currentClientState['logOffset'], SEEK_SET);\n\n // Leer todas las líneas nuevas\n while (!feof($this->_logfd)) {\n $s = fgets($this->_logfd);\n if ($s === FALSE) break; // Fin de archivo luego de una línea completa\n \n // Fin de archivo luego de línea truncada\n if (substr($s, -1) != \"\\n\") {\n fseek($this->_logfd, $currentClientState['logOffset'], SEEK_SET);\n \tbreak;\n }\n\n if (!isset($jsonResponse['endpointchanges']))\n $jsonResponse['endpointchanges'] = array();\n\n if (strpos($s, 'END ENDPOINT CONFIGURATION') !== FALSE) {\n $jsonResponse['endpointchanges'][] = array('quit', NULL);\n $currentClientState['endpoints'] = NULL;\n return FALSE;\n }\n $currentClientState['logOffset'] = ftell($this->_logfd);\n \n $regs = NULL;\n // 2013-07-03 12:24:25 : INFO: (issabel-endpointconfig) (1/3) global configuration update for VOPTech...\n if (preg_match('|^(\\S+ \\S+) : \\w+: \\(issabel-endpointconfig\\) \\((\\d+)/(\\d+)\\) global configuration update (failed)?\\s*for|', $s, $regs)) {\n $logdate = $regs[1];\n $curstep = $regs[2];\n $totalstep = $regs[3];\n $failed = isset($regs[4]) ? $regs[4] : NULL;\n \n $jsonResponse['totalsteps'] = (int)$totalstep;\n $jsonResponse['completedsteps'] = (int)$curstep;\n if ($failed == 'failed') {\n \t$jsonResponse['founderror'] = TRUE;\n }\n \n // 2013-07-03 12:24:25 : INFO: (issabel-endpointconfig) (2/3) starting configuration for endpoint [email protected] (1)...\n } elseif (preg_match('|^(\\S+ \\S+) : \\w+: \\(issabel-endpointconfig\\) \\((\\d+)/(\\d+)\\) (\\w+) configuration for endpoint \\S+@(\\S+) \\((\\d+)\\)|', $s, $regs)) {\n \t$logdate = $regs[1];\n $curstep = $regs[2];\n $totalstep = $regs[3];\n $type = $regs[4];\n $current_ip = $regs[5];\n $id_endpoint = $regs[6];\n\n $jsonResponse['totalsteps'] = (int)$totalstep;\n $jsonResponse['completedsteps'] = (int)$curstep;\n if ($type == 'finished') {\n $this->_procesarRegistroCambio('update', $id_endpoint, $currentClientState['endpoints'], $jsonResponse['endpointchanges']);\n } elseif ($type == 'failed') {\n \t$jsonResponse['founderror'] = TRUE;\n }\n }\n }\n return TRUE;\n }" ]
[ "0.5976192", "0.5374311", "0.5195191", "0.51368076", "0.5125358", "0.50762403", "0.49882236", "0.49781135", "0.49775282", "0.49775282", "0.496811", "0.4915605", "0.4912156", "0.48939735", "0.47684768", "0.47572187", "0.4734298", "0.47241208", "0.4698886", "0.46787336", "0.4659308", "0.4645266", "0.46421623", "0.46265796", "0.46252382", "0.46222934", "0.46149158", "0.45944443", "0.4580862", "0.45554957" ]
0.61569935
0
eof getParms Retorna o valor de log_msg_erro
public function getMsgErro () { return $this->log_msg_erro; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParms () {\n\t\treturn $this->log_parms;\n\t}", "function getLastErrorLog() {\r\n if ($data = getData(Array(\"log\" => true))) {\r\n if (isset($data[\"log\"])) {\r\n $output = false;\r\n \r\n //loop over the log entries, starting from the most recent one\r\n for ($n = count($data[\"log\"])-1; $n >=0; $n--) {\r\n $entry = $data[\"log\"][$n];\r\n \r\n //check the message type\r\n if (($entry[1] == \"FAIL\") || ($entry[1] == \"ERROR\")) {\r\n $output = \"[\".date(\"H:i\",$entry[0]).\"] \".$entry[2];\r\n break;\r\n }\r\n }\r\n \r\n if ($output) {\r\n echo $output;\r\n }\r\n else {\r\n echo \"None.\";\r\n }\r\n }\r\n else {\r\n echo \"<span class=\\\"error\\\">Error: Couldn't find logs in the config data</span>\";\r\n }\r\n }\r\n }", "public function err($codigo='', $user_msg='', $log_msg=false)\n\t{\n\t\t$usr = ''; \n\t\tif (isset($_SESSION['unm'])) $usr = sprintf(\"user:%s\", $_SESSION['unm']);\n\t\t$ss = sprintf(\"<p align=\\\"center\\\"><code><i><b>[%s] %s</b> Error: %s</i></code></p>\", \n\t\t\t\t$codigo, $usr, $user_msg);\n\t\t$this->buf .= $ss;\n\t\tif ($log_msg !== false) error_log($codigo.':'.$usr.' msg:'.$log_msg);\n\t\treturn $ss;\n\t}", "function dbg_err($msg){\n global $debug_db,$debug_log;\n\n if(!$debug_log) print(\"<p><b>\".$msg.\"</b></p>\"); \n else {\n accum_file($debug_log,\"trace error $msg\\n\");\n }\n dbg_tr();\n\n }", "function LogError($descr=\"\",$msg=\"\"){\n\tif(trim($descr) == \"\" && trim($msg) == \"\")return;\n\tglobal $dbo;\n\t $inst = $dbo->InsertID(\"paymentlog_tb\",[\"Description\"=>$descr,\"Message\"=>$msg,\"Type\"=>\"ETRANZACT_DUMP\"]);\n\t exit($msg);\n}", "static function fail($message,$where=null,$params=null)\n {\n $login = (isset($_SESSION['login'])) ? $_SESSION['login'] : null;\n $ip = get_ip();\n $date =date('Y-m-d h:i:s');\n $url_projet=lien_projet;\n\n $dbt=debug_backtrace();\n $caller =$class = isset($dbt[1]['class']) ? $dbt[1]['class'] : null;\n $caller.= isset($dbt[1]['function']) ? $dbt[1]['function'] : null;\n $method = isset($dbt[1]['function']) ? $dbt[1]['function'] : null;\n $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n\n $where = $caller . \". $where\";\n $content = \"{$date}\\t{$ip}\\t{$login}\\t$where\\t$actual_link\\t$message\";\n\n $tab_sql_error=null;\n $tab_sql_error['class']=$class;\n $tab_sql_error['method']=$method;\n $tab_sql_error['actual_link']=$actual_link;\n $tab_sql_error['message']=$message;\n $tab_sql_error['cle']=(isset($params['cle'])) ? $params['cle'] : null;\n\n $sql=\"INSERT INTO `log_error` ( `class`, `function`, `date`, `link`, `data`, `cle`)\n VALUES ( :class, :method, CURRENT_TIMESTAMP, :actual_link, :message, :cle);\n\";\n $rsql =maquery_sql($tab_sql_error,$sql);\n file_put_contents('error_failz.txt',$content);\n\n if (!empty($params['mail']))\n {\n $mail_send=\"[email protected]\";\n $mail_contenu = \"Erreur détecté sur $actual_link.<br/>\\n : $content \";\n mail::send(null,array('from_mail'=>mail_robot,'from_nom'=>mail_robot,'to_mail'=>$mail_send,'mail'=>$mail_contenu,'subject'=>techo(\"Fail détecté $message\" . nom_projet)));\n\n }\n\n\n\n }", "public static function get_error_parameter()\n\t{\n\t\treturn self::$_error_parameter;\n\t}", "public function setMsgErro ($log_msg_erro) {\n\t\t$this->log_msg_erro = substr($log_msg_erro,0,1020);\n\t}", "public function error($msg = ''){\n return [\n 'code' => -1,\n 'msg' => $msg\n ];\n }", "private static function GetOutputErrorMsg($errno, $errmsg, $filename, $linenum)\n {\n date_default_timezone_set('GMT'); // to avoid error PHP 5.1\n $dt = date(\"Y-m-d H:i:s (T)\");\n \n $err = \"<div style='font-size: 12px; color: blue; font-family:Arial; font-weight:bold;'>\";\n $err .= \"[$dt] An exception occurred while executing this script:<br>\";\n $err .= \"Error message: <font color=maroon> #$errno, $errmsg</font><br>\";\n $err .= \"Script name and line number of error: <font color=maroon>$filename:$linenum</font><br>\";\n //$err .= \"Variable state when error occurred: $vars<br>\";\n $err .= \"<hr>\";\n $err .= \"Please ask system administrator for help...</div>\";\n return $err;\n }", "public function error(){\n\t\t$this->iLog(func_get_args(),__FUNCTION__);\n\t}", "function xx_error($msg) {\n\t$args = func_get_args();\n\n\t$log = getLogger();\n\t$log->error(implode(', ', $args));\n}", "function error_get_last () {}", "function mostrarMensajeERR($msg) {\n if($msg > 0 && $msg < 50) {\n $mensaje[1]=\"Complete los campos del formulario.\";\n $mensaje[2]=\"Los datos introducidos son incorrectos.\";\n $mensaje[3]=\"No se ha podido insertar el alumno/a.\";\n $mensaje[4]=\"El usuario ha sido dado de baja\";\n $mensaje[5]=\"Introduzca el Nombre\";\n $mensaje[6]=\"Introduzca los Apellidos\";\n $mensaje[7]=\"Introduzca el E-mail\";\n $mensaje[8]=\"E-mail ocupado.\";\n $mensaje[9]=\"E-mail no válido.\";\n $mensaje[10]=\"No tiene permisos para acceder a la Extranet.\";\n $mensaje[11]=\"Introduzca la contraseña\";\n $mensaje[12]=\"Introduzca el usuario\";\n $mensaje[13]=\"Introduzca el curso\";\n $mensaje[14]=\"El usuario no tiene el formato correcto\";\n $mensaje[15]=\"El usuario que intenta eliminar ya existe\";\n $mensaje[16]=\"El usuario no existe\";\n $mensaje[17]=\"El usuario que intenta dar de baja ya lo está\";\n\t\t$mensaje[18]=\"El usuario debe comenzar por @\";\n\t\t$mensaje[19]=\"El nombre no tiene un formato válido.\";\n\t\t$mensaje[20]=\"El apellido no tiene un formato válido.\";\n echo '<div class=\"alert alert-danger\">'.$mensaje[$msg].'</div>';\n } \n }", "function pais_params($filename='pais_params.cfg') {\n\ttry {\n\t\tglobal $cfg, $dic;\n\t\tif (file_exists($filename)) {\n\t if ($handle = fopen($filename, 'r')) {\n\t while (!feof($handle)) {\n\t list($type, $name, $value) = preg_split(\"/\\||=/\", fgets($handle), 3);\n\t\t\t\t\tif (trim($type)!='#') { \n\t\t\t\t\t#PARAMS $pais[mexico][variable]\n\t\t\t\t\t\t$pais_params[trim($type)][trim($name)] = trim($value);\n\t\t\t\t\t\t$val.=$type.' | '.$name.' = '.$value.\"<br/>\\n\\r\";\n\t\t\t\t\t}\t\n\t }\t \n\t }\t \n\t\t\treturn $val;\n\t\t}else{\n\t\t\t$msj = \"¡ERROR CRÍTICO!<br/> No se ha logrado cargar el archivo diccionario, por favor, contacte al administrador del sistema.<br/>\";\n\t \tthrow new Exception($msj, 1); \t\n\t }\t\n\t} catch (Exception $e) {\t\t\n\t\tprint($e->getMessage());\n\t\treturn false;\n\t}\t \n}", "function get_error($err, $arg = \"null\"){\n\t\t$arg = htmlspecialchars($arg);\n\t\t$output = \"\";\n\t\t$output .= \"<span style=\\\"color:red; font-weight:bolder;\\\">\";\n\t\tswitch ($err) {\n\t\t case \"empty_user_pass\":\n\t\t $output .= \"Username and Password can not be empty.\";\n\t break;\n\t\t case \"login_failed\":\n\t\t $output .= \"Login faild, please try again.\";\n\t break;\n\t\t case \"bad_user\":\n\t\t $output .= \"User: {$arg} is not a valid user.\";\n\t break;\n\t\t\t default:\n\t\t\t $output .= \"Undefined error.\";\n\t\t}\n\t\t$output .= \"</span>\";\n\t\treturn $output;\n\t}", "public function getLastError();", "public function getLastError();", "abstract public function getMsgError();", "function error()\r\n {\r\n $this->merge_to_log(func_get_args());\r\n }", "static function log_error($errno, $errmsg, $filename, $linenum) {\n\t\t\treturn SYSTEM_MANAGER::get_logger()->error(array(\"errmsg\"=>$errmsg,\"errno\"=>$errno,\"filename\"=>$filename,\"linenum\"=>$linenum,\"stack_trace\"=>self::get_stack_trace(2)));\n\t\t}", "function eio_get_last_error($req)\n{\n}", "function sent_item_status_failed(){\r\n\t\t\r\n\t\t$query = isset($_POST['query']) ? @$_POST['query'] : \"\";\r\n\t\t$start = (integer) (isset($_POST['start']) ? @$_POST['start'] : @$_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? @$_POST['limit'] : @$_GET['limit']);\r\n\t\t$result=$this->m_sent_item->sent_item_status_failed($query,$start,$end);\r\n\t\techo $result;\r\n\t}", "public function returnErr($errMode,$errMsg=\"\"){$this->resultArray=array(\"rslt\"=>$errMode,\"msg\"=>$errMsg);$JSON_DATA=json_encode($this->resultArray);die($JSON_DATA);}", "public function get_errors() {\n\t\t//--\n\t\t$out = '';\n\t\tif($this->have_errors()) {\n\t\t\t$out .= 'LAST FAILURE :: '.$this->err.\"\\n\";\n\t\t} //end if\n\t\t//--\n\t\treturn (string) $out;\n\t\t//--\n\t}", "abstract function getErrorLogMessage();", "function mylib_error() { //file_name, $error_type, $arg1) {\t\n\n\t$count = func_num_args();\n\tif($count < 1){\n\t mylib_error('invalid_argument','mylib_error');\n\t}\t\n\t$system_error = \"ข้อผิดพลาดของระบบ\";\n\t$information = \"Information\";\n\t$arg = func_get_args();\n\tglobal $g_error_template;\n\t$file_name = $g_error_template; \n\t$error_type = $arg[0];\n\tif($count >1) {\n\t\t$arg1 = $arg[1];\n\t}\n\tglobal $g_contact;\n $contact = $g_contact;\t \n\n if ($error_type == 'file_not_found') {\n $message_header = \"$system_error: ไม่สามารถเปิดไฟล์\";\n\t $message_body = \"ไม่สามารถเปิดไฟล์ $arg1 ได้\";\n\n }else if ($error_type == 'invalid_file_format') {\n $message_header = \"$system_error: รูปแบบไฟล์ไม่ถูกต้อง\";\n\t $message_body = \"ไม่สามารถอ่านไฟล์ $arg1 ได้เนื่องจากรูปแบบไม่ถูกต้อง\";\n\n }\n else if ($error_type == 'invalid_argument') {\n $message_header = \"$system_error: โปรแกรมผิดพลาด\";\n\t $message_body = \"ส่ง argument ผิดพลาด ในโปรแกรม $arg1\";\n\n }elseif ($error_type == 'function_return_error') {\n $message_header = \"$system_error: โปรแกรมผิดพลาด\";\n\t $message_body = \"เรียกโปรแกรมผิดพลาด\";\n\t \n }elseif ($error_type == 'bad_ip_address') {\n $message_header = \"$system_error: โปรแกรมผิดพลาด\";\n\t $message_body = \"ip address มีรูปแบบไม่ถูกต้อง\";\n\n }elseif ($error_type == 'record_not_found') {\n $message_header = \"$error_head: โปรแกรมผิดพลาด\";\n\t $message_body = \"ไม่สามารถค้นหาข้อมูลที่ต้องการจากไฟล์ได้\";\n }else {\n $message_header = \"$system_error: Undefine Error\";\n }\n $message_body .= \"<br>กรุณาติดต่อ $contact\";\n\n mylib_message($file_name, $message_header, $message_body);\n exit;\n}", "public function getUploadErrorMessage($err) {\r\n\t\t$msg = null;\r\n\t\tswitch ($err) {\r\n\t\t\tcase UPLOAD_ERR_OK:\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_INI_SIZE:\r\n\t\t\t\t$msg = ('The uploaded file exceeds the upload_max_filesize directive ('.ini_get('upload_max_filesize').') in php.ini.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_FORM_SIZE:\r\n\t\t\t\t$msg = ('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_PARTIAL:\r\n\t\t\t\t$msg = ('The uploaded file was only partially uploaded.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_NO_FILE:\r\n\t\t\t\t$msg = ('No file was uploaded.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_NO_TMP_DIR:\r\n\t\t\t\t$msg = ('The remote server has no temporary folder for file uploads.');\r\n\t\t\t\tbreak;\r\n\t\t\tcase UPLOAD_ERR_CANT_WRITE:\r\n\t\t\t\t$msg = ('Failed to write file to disk.');\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$msg = ('Unknown File Error. Check php.ini settings.');\r\n\t\t}\r\n\t\t\r\n\t\treturn $msg;\r\n\t}", "function error($param = 'array')\n{\n if (count(error_list()) > 0)\n {\n if ($param != 'array')\n {\n if ($param == 'single')\n $param = 0;\n $msg = error_list();\n return $msg[$param];\n }\n return error_list();\n }else\n {\n return false;\n }\n}", "function pushError($msg = 'unknown error'){\n $result = 0;\n if (func_num_args() > 1) {\n $args = func_get_args();\n $format = array_shift($args);\n if (empty($args)) {\n $msg = $format;\n } else {\n foreach ($args as $i => $arg) {\n if (!is_scalar($arg)) {\n $args[$i] = gettype($arg);\n }\n }\n $msg = vsprintf($format, $args);\n }\n }\n $trace = null;\n if (function_exists('debug_backtrace')) {\n $trace = @debug_backtrace();\n }\n if (!is_array($trace)) {\n $trace = array();\n }\n $bt = array_pop($trace) + $this->getDefaultBackTrace();\n $code = $this->mapErrorObject($trace);\n $this->errors[] = array(\n 'msg' => $msg,\n 'line' => $bt['line'],\n 'file' => $bt['file'],\n 'code' => $code\n );\n }" ]
[ "0.5502741", "0.5451674", "0.5269974", "0.5268307", "0.52496994", "0.52064556", "0.51870453", "0.5167757", "0.51391566", "0.5121205", "0.51084226", "0.51043564", "0.51011777", "0.50839996", "0.50628495", "0.5056848", "0.50440204", "0.50440204", "0.5028496", "0.50106853", "0.499097", "0.4976498", "0.49576914", "0.49418128", "0.4933128", "0.49311906", "0.49213627", "0.49212894", "0.49196875", "0.49031574" ]
0.5454467
1
eof getMsgErro Retorna o valor de log_descr_erro
public function getDescrErro () { return $this->log_descr_erro; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMsgErro () {\n\t\treturn $this->log_msg_erro;\n\t}", "public function setMsgErro ($log_msg_erro) {\n\t\t$this->log_msg_erro = substr($log_msg_erro,0,1020);\n\t}", "function muestra_error($ArrMsjErro){\n $hasta = strpos($ArrMsjErro['message'],'DETAIL');\n if ($hasta == FALSE)\n return $ArrMsjErro['message'];\n else \n return trim(substr($ArrMsjErro['message'],0,$hasta));\n}", "function messaggioErrore()\n\t\t{\n\t\t$retval = @oci_error($this->DBConn);\n\t\tif ($retval === false)\n\t\t\treturn '';\n\t\treturn $retval['message'];\n\n\t\t}", "abstract public function getMsgError();", "public function setDescrErro ($log_descr_erro) {\n\t\t$this->log_descr_erro = substr($log_descr_erro,0,1020);\n\t}", "public function err($codigo='', $user_msg='', $log_msg=false)\n\t{\n\t\t$usr = ''; \n\t\tif (isset($_SESSION['unm'])) $usr = sprintf(\"user:%s\", $_SESSION['unm']);\n\t\t$ss = sprintf(\"<p align=\\\"center\\\"><code><i><b>[%s] %s</b> Error: %s</i></code></p>\", \n\t\t\t\t$codigo, $usr, $user_msg);\n\t\t$this->buf .= $ss;\n\t\tif ($log_msg !== false) error_log($codigo.':'.$usr.' msg:'.$log_msg);\n\t\treturn $ss;\n\t}", "public function get_erro() {\r\n return $this->erro;\r\n }", "public function read_error_texto(){\n $str = Session::get_value('_ERROR_TEXTO_');\n Session::delete('_ERROR_TEXTO_');\n return $str;\n }", "function mostrarMensajeERR($msg) {\n if($msg > 0 && $msg < 50) {\n $mensaje[1]=\"Complete los campos del formulario.\";\n $mensaje[2]=\"Los datos introducidos son incorrectos.\";\n $mensaje[3]=\"No se ha podido insertar el alumno/a.\";\n $mensaje[4]=\"El usuario ha sido dado de baja\";\n $mensaje[5]=\"Introduzca el Nombre\";\n $mensaje[6]=\"Introduzca los Apellidos\";\n $mensaje[7]=\"Introduzca el E-mail\";\n $mensaje[8]=\"E-mail ocupado.\";\n $mensaje[9]=\"E-mail no válido.\";\n $mensaje[10]=\"No tiene permisos para acceder a la Extranet.\";\n $mensaje[11]=\"Introduzca la contraseña\";\n $mensaje[12]=\"Introduzca el usuario\";\n $mensaje[13]=\"Introduzca el curso\";\n $mensaje[14]=\"El usuario no tiene el formato correcto\";\n $mensaje[15]=\"El usuario que intenta eliminar ya existe\";\n $mensaje[16]=\"El usuario no existe\";\n $mensaje[17]=\"El usuario que intenta dar de baja ya lo está\";\n\t\t$mensaje[18]=\"El usuario debe comenzar por @\";\n\t\t$mensaje[19]=\"El nombre no tiene un formato válido.\";\n\t\t$mensaje[20]=\"El apellido no tiene un formato válido.\";\n echo '<div class=\"alert alert-danger\">'.$mensaje[$msg].'</div>';\n } \n }", "function getErrorMsg() {\n\t\treturn $this->error_msg;\n\t}", "public function errorMessage() {\n if ( !$this->isOK() ) {\n $errors = $this->body->Message();\n return (string)$errors[0];\n }\n }", "public function get_error()\n\t{\n\t\tif(!empty($this->error['desc']))\n\t\t\treturn $this->error['desc']\n\t\treturn false;\n\t}", "private function _getMsgErrorExc(\\Exception $exc) {\n $message = \"\";\n $httpCodes = $this->app[\"my\"]->get('http')->getHttpCodes();\n $sysBox = $this->app['my']->get('system');\n $arBox = $this->app['my']->get('array');\n $is_debug = $this->app['debug'];\n //------------------------\n if ($is_debug) {\n // Get error code\n if ($exc instanceof Exception\\HttpException) {\n $code = $exc->getStatusCode();\n } else {\n $code = 400;\n }\n\n $code = (int) $code;\n if (isset($httpCodes[$code])) {\n $code .= \" ({$httpCodes[$code]})\";\n }\n $message .= \"<em>Code:</em> {$code}<br>\";\n\n $message .= '<em>Params:</em><br><ul>';\n $message .= \"<li>{$sysBox->varExport($this->params)}</li>\";\n $message .= '</ul>';\n }\n $message .= $exc->getMessage() . '<br>';\n if ($is_debug) {\n $message .= '<em>Trace Error:</em><br><ul>';\n $trace = $exc->getTraceAsString();\n $arrTrace = $arBox->set($exc->getTraceAsString(), '#')->delRows()->shift()->get();\n foreach ($arrTrace as $value) {\n if ($value) {\n $message .= \"<li>{$value}</li>\";\n }\n }\n $message .= '</ul>';\n }\n\n return $message;\n }", "public function getDhErro () {\n\t\treturn $this->log_dh_erro;\n\t}", "abstract function getErrorLogMessage();", "public function escribir_en_log_errores($cadena_texto_a_imprimir_en_log_errores,$sitio_del_error=\"no definido\")\n\t{\n\t\t//PARTE LOG EN TXT\n\t\t//crea directorio log\n\t\t$ruta_temporales=\"TEMPORALES/\";\n\t\t$ruta_carpeta_del_log_errores_bd=$ruta_temporales.\"logs_errores_bd\";\n\t\tif(!file_exists($ruta_carpeta_del_log_errores_bd))\n\t\t{\n\t\t\tmkdir($ruta_carpeta_del_log_errores_bd, 0777);\n\t\t}\n\t\t//fin crea directorio log\n\t\t$cadena_preparada_para_log_bd=preg_replace(\"/[^A-Za-z0-9:.\\-\\s+\\_\\'\\=\\,\\*\\(\\)]/\", \"\", trim($cadena_texto_a_imprimir_en_log_errores) );\n\t\tdate_default_timezone_set (\"America/Bogota\");\n\t\t$fecha_para_archivo= date('Y-m-d-H');\n\t\t$tiempo_actual = date('H:i:s');\n\t\t$ruta_archivo_log_bd=$ruta_carpeta_del_log_errores_bd.\"/\".\"log_error_bd_\".$fecha_para_archivo.\".txt\";\t\t \n\t\t//se sobreescribe con el modo a\t\t\n\t\t$file_archivo_log_error_bd = fopen($ruta_archivo_log_bd, \"a\") or die(\"fallo la creacion del archivo\");\n\t\tfwrite($file_archivo_log_error_bd, \"\\n\".\"tiempo error: $tiempo_actual query problematica en $sitio_del_error: \".$cadena_preparada_para_log_bd);\n\t\tfclose($file_archivo_log_error_bd);\n\t\t//FIN PARTE LOG EN TXT\n\t}", "public function getErrorMsg()\n {\n return print '<p> Errore: '.$this->errorMsg.'<p>';\n }", "public function error($msg = ''){\n return [\n 'code' => -1,\n 'msg' => $msg\n ];\n }", "public function errorMessage() {\n return sprintf('Error on line %d in %s:%s%s%s', $this->getLine(), $this->getFile(), $this->linefeed, $this->getMessage(), $this->linefeed);\n }", "public function error_msg_last_operation()\n\t{\n\t\treturn $this->error_msg;\n\t}", "public function error_message(){\n\t\treturn $this->_errormsg;\n\t}", "function getLastErrorLog() {\r\n if ($data = getData(Array(\"log\" => true))) {\r\n if (isset($data[\"log\"])) {\r\n $output = false;\r\n \r\n //loop over the log entries, starting from the most recent one\r\n for ($n = count($data[\"log\"])-1; $n >=0; $n--) {\r\n $entry = $data[\"log\"][$n];\r\n \r\n //check the message type\r\n if (($entry[1] == \"FAIL\") || ($entry[1] == \"ERROR\")) {\r\n $output = \"[\".date(\"H:i\",$entry[0]).\"] \".$entry[2];\r\n break;\r\n }\r\n }\r\n \r\n if ($output) {\r\n echo $output;\r\n }\r\n else {\r\n echo \"None.\";\r\n }\r\n }\r\n else {\r\n echo \"<span class=\\\"error\\\">Error: Couldn't find logs in the config data</span>\";\r\n }\r\n }\r\n }", "public function getError() {\n return 'Erro: ' . $this->error;\n }", "public function errorMessage(){\r\n\t\t\treturn $this->_error;\r\n\t\t}", "public function getLastError()\r\n\t{\r\n\t\treturn \"\";\r\n\t}", "function get_descripcion()\n\t{\n\t\t$tabla = $this->registro->get_tabla();\n\t\t$sql_conflictivo = $this->registro->to_sql();\n\t\t$sql_state = $this->db_error->get_sqlstate();\n\t\t$mensaje = $this->db_error->get_mensaje_motor();\n\n\t\t//Creo un mensaje orientativo sobre el conflicto\n\t\tswitch ($this->tipo) {\n\t\t\tcase toba_registro_conflicto::warning: $mensaje_final = \"[W:$this->numero] \";\n\t\t\t\t\t\t\t\t\t\t break;\n\t\t\tcase toba_registro_conflicto::fatal: $mensaje_final = \"[F:$this->numero] \"; \n\t\t}\n\t\t\n\t\t$mensaje_final .= \"Error de constraints en la tabla $tabla.\\n\";\n\t\tif ($this->descripcion_componente !== '') {\n\t\t\t$mensaje_final .= \"Error en un componente {$this->descripcion_componente}.\\n\";\t\t\n\t\t}\t\t\n\t\tswitch ($sql_state) {\t\t\n\t\t\tcase 'db_23503':\n\t\t\t\t$mensaje_final .= \" Existe un error de foreign keys, si cree que se trata de un problema de temporalidad ejecute el comando en modo transaccional. \\n\";\n\t\t\t\tbreak;\n\t\t\tcase 'db_26505':\n\t\t\t\t$mensaje_final .= \" Hay un error de unique keys. \\n\";\n\t\t\t\tbreak;\n\t\t\tdefault:\t\n\t\t\t\t$mensaje_final .= \" El error no fue reconocido por el importador. \\n\";\n\t\t}\t\t\n\t\t\n\t\t$mensaje_final .= \"Postgres dijo: $mensaje.\\n El sql conflictivo es: $sql_conflictivo\";\t\t\n\t\treturn $mensaje_final;\n\t}", "public function getMessageError(){\n\t\treturn $this->_messagesError;\n\t}", "public function getMessageError(){\n\t\treturn $this->_messagesError;\n\t}", "public function getErrorString();" ]
[ "0.76765263", "0.677741", "0.6473878", "0.64220315", "0.6385393", "0.6264408", "0.6203988", "0.6129165", "0.61167693", "0.6042419", "0.6020304", "0.5870592", "0.58397675", "0.583313", "0.5832571", "0.57852817", "0.57385725", "0.5707759", "0.570086", "0.5683916", "0.5679605", "0.56626254", "0.5653545", "0.56423646", "0.56270117", "0.56252545", "0.56192124", "0.55880976", "0.55880976", "0.5582474" ]
0.7115478
1
eof setID Define o valor de log_usu_id
public function setUsuID ($log_usu_id) { $this->log_usu_id = $log_usu_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUsuID () {\n\t\treturn $this->log_usu_id;\n\t}", "public function setID ($idLog) {\n\t\t$this->idLog = $idLog;\n\t}", "public function setID ($log_id) {\n\t\t$this->log_id = $log_id;\n\t}", "public function getIdusuariosLog()\n {\n return $this->idusuarios_log;\n }", "public function setIdusuario($value){\n\n\t\t$this->idusuario = $value;\n\n\t}", "public function _setLogUserId($log_user_id)\n {\n $this->log_user_id = $log_user_id;\n }", "final function setUser_id($value) {\n\t\treturn $this->setUserId($value);\n\t}", "public function getID() { // GET ID \n return $this->utilisateur_id; // SET ID\n }", "public function setIdusuariosLog($idusuarios_log)\n {\n $this->idusuarios_log = $idusuarios_log;\n\n return $this;\n }", "function setAM_idUsuario($idUsuario)\n{\n\t$GLOBALS['AM_idUsuario'] = $idUsuario;\n}", "function setID($value) {\n throw new Exception('The user ID value may not be modified!');\n }", "public function setUsr_id($value) {\r\n\t\t\t\t\t\tif( !is_string($value) ) {\r\nif(DEBUG_C)\t\t\t\techo \"<p class='debugClass err'><b>Line \" . __LINE__ . \"</b>: usr_id: Must be DATATYPE 'String'! <i>(\" . basename(__FILE__) . \")</i></p>\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->usr_id = cleanString($value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "function setUserID($id){\n\t\t$this->userId = $id;\n\t}", "function put_id() {\r\n ;\r\n }", "public function setLoginId(): void\n {\n }", "public function setLoginId(): void\n {\n }", "public function setIdusuario($idusuario){\n $this->idusuario = $idusuario;\n }", "public function setIdUtilisateur($_idUtilisateur)\n\t{\n\t\t$this->_idUtilisateur = $_idUtilisateur;\n\t}", "public function setId_Usuario($id_usuario)\n {\n $this->id_usuario = $id_usuario;\n }", "public function set_id( $id ) {\r\n\t\t$this->login_id = $id;\r\n\t}", "function secu_set_territoire_id($id)\n{\n\tif ((int)$id > 0) {\n\t\t$_SESSION['admin']['territoire_id'] = (int)$id;\n\t} else {\n\t\t$_SESSION['admin']['territoire_id'] = null;\n\t}\n}", "public function setIdUtente($id_utente){\n if(filter_var($id_utente, FILTER_VALIDATE_INT)){\n //valore valido\n $this->id_utente = $id_utente;\n }\n }", "public function getID () {\n\t\treturn $this->log_id;\n\t}", "function setUserId($id)\n {\n $this->__user_id = $id ;\n }", "public function setUsuario_id($usuario_id){\n $this->usuario_id = $usuario_id;\n }", "public function setU ($log_u) {\n\t\t$this->log_u = $log_u;\n\t}", "public function setUserIdInput($input = null) {\n if($input == null){\n $input = \\lib\\form\\input\\SelectInput::create(HtmLog::FIELD_USER_ID);\n $input->setRequired(true);\n $input->setOptionIndex(\\model\\models\\UserBase::FIELD_ID);\n $input->addEmpty();\n $input->setModel(\\model\\querys\\UserBaseQuery::start());\n }else{\n $input->setElementId(HtmLog::FIELD_USER_ID); \n }\n \n $this->setFieldLabel(HtmLog::TABLE, HtmLog::FIELD_USER_ID, 'User Id');\n $this->setFieldInput(HtmLog::TABLE, HtmLog::FIELD_USER_ID, $input);\n \n return $input;\n }", "public function setIdUsuario($usuario)\n\t{\n\t\t$model = Usuarios::model()->findByAttributes(array('usuario'=>$usuario));\n\t\tif ($model == NULL)\n\t\t\t$model = Usuarios::model()->findByAttributes(array('correo'=>$usuario));\n\t\tYii::app()->user->setState('id_usuario', $model->id);\n\t}", "public function getUlogaID()\n {\n return $this->ulogaID;\n }", "public function setUserid($value)\r\n {\r\n return $this->set(self::_USERID, $value);\r\n }" ]
[ "0.6665217", "0.65783226", "0.65312105", "0.6438064", "0.6234616", "0.61873066", "0.61781675", "0.61732095", "0.6164278", "0.6152679", "0.6115783", "0.60342366", "0.59955573", "0.5947706", "0.5912139", "0.5912139", "0.5911248", "0.590442", "0.58966887", "0.5860679", "0.58526415", "0.5828224", "0.5782407", "0.5762038", "0.57366383", "0.56981176", "0.5690399", "0.56881565", "0.5683309", "0.56740075" ]
0.78795624
0
eof setUduID Define o valor de log_dh_erro
public function setDhErro ($log_dh_erro) { $this->log_dh_erro = $log_dh_erro; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDhErro () {\n\t\treturn $this->log_dh_erro;\n\t}", "public function setMsgErro ($log_msg_erro) {\n\t\t$this->log_msg_erro = substr($log_msg_erro,0,1020);\n\t}", "public function setDescrErro ($log_descr_erro) {\n\t\t$this->log_descr_erro = substr($log_descr_erro,0,1020);\n\t}", "public function setUsuID ($log_usu_id) {\n\t\t$this->log_usu_id = $log_usu_id;\n\t}", "function LogError($descr=\"\",$msg=\"\"){\n\tif(trim($descr) == \"\" && trim($msg) == \"\")return;\n\tglobal $dbo;\n\t $inst = $dbo->InsertID(\"paymentlog_tb\",[\"Description\"=>$descr,\"Message\"=>$msg,\"Type\"=>\"ETRANZACT_DUMP\"]);\n\t exit($msg);\n}", "public function errNo();", "function Halt( $msg ) { \n global $Global;\n // New Error control \n echo \"`_RPC_error_`\" . $this->Errno . \"`\" . $this->Error .\n \"`\" . $msg ; \n $this->NoLog = 1;\n $Global['SQL_Status'] = \"ER\";\n $this->log( $Global['username'], 'SQL ' .\n $this->Errno . \" - \" . $this->Error , $Global['SQL_Status'], $msg ); \n }", "public function setUdh($udh)\n {\n $this->_udh = $udh;\n }", "function errorHandler2($errno, $errstr, $errfile, $errline, $errcontext){\n $log = \"Error[$errno] on \" . date(\"d/m/Y H:i:s\") . \"\\r\\n\";\n $log .= \"Details: $errstr. \\r\\n\";\n $log .= \"Location: In $errfile on line $errline. \\r\\n\";\n // print_r($errcontext, true) yeh karna bht jaruri hai otherwise error ke bare mai store ni hoga and print_r ko true krna jaruri hai.\n $log .= \"Variables: \" . print_r($errcontext, true) . \"\\r\\n\";\n \n // error_log yeh error ka log maintain karega pehele ek variable pass karenge then , '3' ka matlb error ko login krke dekhna hai, then uski location dalenge \"logs/errorhandlingerrors.log\" = isme 'logs' namm ka folder hai joh ki create kar rakha hai and 'errorhandlingerrors.log' naam ki file joh ki hum jab ban jayegi logs wale folder mai jab error_log chalega. \n error_log($log, 3, \"logs/errorhandlingerrors.log\");\n error_log($log, 1, \"[email protected]\");// yeh email pe bejega '1' email ka code hai.\n die(\"<p>An error occured, please try again!</p>\"); // agar koi error aa jayegi toh die chalega.and script yahi se exit ho jayegi.\n}", "function SummonExodia($E0=1,$E1=1,$E2=1,$E3=1){\r\n //Show Wich Error? (erorr0, 1, 2, 3) Default is 1 (Showing)\r\n $LogDes=array();\r\n $ErrorLog=array();\r\n $EM = $this->EM;\r\n if( in_array(\"Error0\",$this->SignUpError) && !empty($E0) ){ //Show error dialog wrong confirmation password\r\n\t\r\n ErrorDialog($GLOBALS['lanSignUpErrorMessage0T'],$GLOBALS['lanSignUpErrorMessage0C']);\r\n \r\n //For Logging Purpose\r\n //Construct the error log content\r\n\r\n array_push($LogDes,\"[Password & Confirmation password Missmatch]\");\r\n array_push($ErrorLog,\"[Missmatch password]\");\r\n \r\n }\r\n \r\n if( in_array(\"Error1\",$this->SignUpError) && !empty($E1) ){ //Show error dialog urging user to fill required field\r\n $FieldList=array();\r\n foreach($this->Error1 as $i){\r\n $i=lan2var($i);\r\n array_push($FieldList,$i);\r\n }\r\n $lanSignUpErrorMessage1C=Array2List($FieldList, $GLOBALS['lan'. $EM .'ErrorMessage1C'],null,null, $GLOBALS['lan'. $EM .'ErrorMessage1A']); //Turn the error field into list\r\n ErrorDialog($GLOBALS['lan'. $EM .'ErrorMessage1T'],$lanSignUpErrorMessage1C);\r\n \r\n //For Logging Purpose\r\n //Construct the error log content\r\n array_push($LogDes,\"[Empty required field(s)]\");\r\n $EmpErrorLog=array2csv($FieldList);\r\n array_push($ErrorLog,\"[Empty on : \". $EmpErrorLog['Val'] .\"]\");\r\n \r\n \r\n }\r\n \r\n if( in_array(\"Error2\",$this->SignUpError) && !empty($E2) ){ //Show error dialog urging user use different email\r\n $dup=array();\r\n $DupErrorLog=array();\r\n foreach($this->Error2 as $i=>$x){\r\n eval(\"\\$i = \\\"$i\\\";\");\r\n $Dup2Push=array($i=>$x); \r\n $DupErrorLog=$DupErrorLog+$Dup2Push;\r\n array_push($dup,\"$i : $x\");\r\n }\r\n $lanSignUpErrorMessage2C= Array2List($dup, $GLOBALS['lan'. $EM .'ErrorMessage2C'],null,null,$GLOBALS['lan'. $EM .'ErrorMessage2A']);\r\n ErrorDialog($GLOBALS['lan'. $EM .'ErrorMessage2T'],$lanSignUpErrorMessage2C);\r\n mark('lan'. $EM .'ErrorMessage2T',\"^&RT&^YKVKY\");\r\n \r\n \r\n //For Logging Purpose\r\n //Construct the error log content\r\n array_push($LogDes,\"[Duplicate Unique field(s)]\");\r\n $DupErrorLog=array2csv($DupErrorLog);\r\n array_push($ErrorLog,\"[Duplicate on : \". $DupErrorLog['Key']. \" as \" .$DupErrorLog['Val'] .\"]\");\r\n \r\n \r\n }\r\n \r\n if( in_array(\"Error3\",$this->SignUpError) && !empty($E3) ){ //Show error dialog telling user that some field are invalid\r\n $invali=array();\r\n $InvErrorLog=array();\r\n foreach($this->Error3 as $i=>$x){\r\n $i=lan2var($i);\r\n $InvError=array($i=>$x); \r\n $InvErrorLog=$InvErrorLog+$InvError;\r\n array_push($invali,$i);\r\n }\r\n $lanSignUpErrorMessage3C= Array2List($invali, $GLOBALS['lan'. $EM .'ErrorMessage3C']);\r\n \r\n ErrorDialog($GLOBALS['lan'. $EM .'ErrorMessage3T'],$lanSignUpErrorMessage3C);\r\n \r\n //For Logging Purpose\r\n //Construct the error log content\r\n array_push($LogDes,\"[Invalid field(s)]\");\r\n $InvErrorLog=array2arrow($InvErrorLog,\" filled as \");\r\n array_push($ErrorLog,\"[Invalid on : \". $InvErrorLog .\"]\");\r\n }\r\n\r\n if( in_array(\"Error4\",$this->SignUpError) && !empty($E4) ){ //Wrong Password\r\n \r\n ErrorDialog($GLOBALS['lan'. $EM .'ErrorMessage4T'],$GLOBALS['lan'. $EM .'ErrorMessage4C'] . $this->Error4);\r\n \r\n //For Logging Purpose\r\n //Construct the error log content\r\n array_push($LogDes,\"[Wrong Password]\");\r\n $InvErrorLog=array2arrow($InvErrorLog,\" filled as \");\r\n array_push($ErrorLog,\"[Wrong Password on \". $this->Error4 .\"]\");\r\n }\r\n if( in_array(\"Error5\",$this->SignUpError) && !empty($E5) ){ //Wrong Password\r\n \r\n ErrorDialog($GLOBALS['lan'. $EM .'ErrorMessage5T'],$GLOBALS['lan'. $EM .'ErrorMessage5C'] . $this->Error4);\r\n \r\n //For Logging Purpose\r\n //Construct the error log content\r\n array_push($LogDes,\"[Same New & Old Password]\");\r\n $InvErrorLog=array2arrow($InvErrorLog,\" filled as \");\r\n array_push($ErrorLog,\"[Same New & Old Password on\". $this->Error4 .\"]\");\r\n }\r\n $GLOBALS['LogDes']=Serialize($LogDes);\r\n $GLOBALS['ErrorLog']=Serialize($ErrorLog);\r\n }", "public function errorControlador()\n\t{\techo 'No se encontro el controlador correspondiente.';\t\n\t}", "public function set_id_indice($valor){\n $er = new Er();\n if ( !$er->valida_numero_entero($valor) ){\n $this->errores[] = 'id_indice no valido ('.$valor.').';\n }\n //trim simplemente quita espacios al principio y final de la cadena\n $this->id_indice = trim($valor);\n }", "public function qerr($ecode='')\n\t{\n\t\t// TODO: debug flag on usuarios set session var\n\t\t$uid = 47;\n\t\tif (isset($_SESSION['uid'])) $uid = $_SESSION['uid'];\n\t\treturn $this->err($ecode, $uid == 1 || $uid == 130 || $uid == 47 ? mysql_error(): \n\t\t\t\t\"Fall&oacute; consulta de datos\", mysql_error());\n\t}", "private function controllersAltPessoaError($postNome\t= null, $postEmail = null, $postSenha\t= null, $postRepSenha = null, $postSalvar = null, $varUserId\t= null, $postRowUserId = null, $postAdmin =null)\t{\r\n\t\t/*Chamar os Database Login*/\r\n\t\t$objDatabaseAltPessoa\t= new database_altPessoa();\r\n\t\t\r\n\t\t/*mensagem de erro em caso de tentarem burlar o sistema alterando o HTML ou a URL*/\r\n\t\tif (md5($varUserId) != $postRowUserId AND !empty($postSalvar))\t\t\t{\r\n\t\t\t$erroAlteracao\t= \"</strong> Usuário <strong> não encontrado!<p></p>\";\r\n\t\t}\r\n\t\t\r\n\t\tif (empty($postNome)\tAND\t!empty($postSalvar))\t\t\t{\r\n\t\t\t$erroAltastro\t= \"<div class='alert alert-danger' role='alert'>O campo </strong> nome <strong> é de preenchimento obrigatório!</div><p></p>\";\r\n\t\t}\r\n\t\t\r\n\t\tif (empty($postEmail)\tAND\t!empty($postSalvar) AND empty($erroAltastro))\t\t\t{\r\n\t\t\t$erroAltastro\t= \"<div class='alert alert-danger' role='alert'>O campo </strong> email <strong> é de preenchimento obrigatório!</div><p></p>\";\r\n\t\t}\t\t\r\n\t\t\r\n\t\tif (strlen($postSenha) > 1 AND strlen($postSenha) < 6\tAND\t!empty($postSalvar) AND empty($erroAltastro))\t\t\t{\r\n\t\t\t$erroAltastro\t= \"<div class='alert alert-danger' role='alert'>Campo <strong>senha</strong> está com menos de 6 dígitos!</div><p></p>\";\r\n\t\t}\r\n\t\t\r\n\t\tif (strlen($postSenha) > 10\tAND\t!empty($postSalvar) AND empty($erroAltastro))\t\t\t{\r\n\t\t\t$erroAltastro\t= \"<div class='alert alert-danger' role='alert'>Campo <strong>senha</strong> está com mais de 10 dígitos!</div><p></p>\";\r\n\t\t}\r\n\r\n\t\tif ($postSenha != $postRepSenha\tAND\t!empty($postSalvar) AND empty($erroAltastro))\t\t\t{\r\n\t\t\t\t$erroAltastro\t= \"<div class='alert alert-danger' role='alert'>O campo <strong>senha</strong> e <strong>repetir senha</strong> estão diferentes!</div>\";\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($postEmail)\tAND\t!empty($postSalvar) AND empty($erroAltastro))\t\t\t{\r\n\t\t\t/*Verifica se o altastro do usuário já existe com mesmo EMAIL*/\r\n\t\t\t$result\t= $objDatabaseAltPessoa->databaseAltPessoaEmail($postEmail, $varUserId);\r\n\r\n\t\t\t/*retira o notice da tela*/\r\n\t\t\tif (!empty($result))\t{\r\n\t\t\t\t$row\t= mysqli_fetch_assoc($result);\r\n\t\t\t}\r\n\r\n\t\t\t$rowNomeId\t= !empty($row['id'])\t?\t$row['id']\t\t: null;\t\t\t\r\n\t\t\t$rowNome\t= !empty($row['nome'])\t?\t$row['nome']\t: null;\r\n\t\t\t/*termino*/\r\n\r\n\t\t\tif (!empty($rowNomeId))\t{\r\n\t\t\t\t$erroAltastro\t= \"<div class='alert alert-danger' role='alert'>Não foi possível efetuar o cadastro, <strong>E-mail</strong> já cadastrado com usuário <strong>\".$rowNome.\"</strong>!</div><p></p>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!empty($postSalvar) AND empty($erroAltastro) AND !empty($postAdmin))\t{\r\n\t\t\t$result\t=\tcontroller_altPessoa::controllersAltPessoaListaDados();\r\n\r\n\t\t\t$row\t= mysqli_fetch_assoc($result);\r\n\r\n\t\t\tif ($row[\"funcao\"] == \"usuario\")\t\t\t{\r\n\t\t\t\t$erroAltastro\t= \"<div class='alert alert-danger' role='alert'>Este perfil de usuário não pode ser administrador!</div><p></p>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/*tratamento de notice*/\r\n\t\t$erroAltastro\t= !empty($erroAltastro)? $erroAltastro : null;\r\n\r\n\t\treturn $erroAltastro;\r\n\t}", "function handleFieldsError($reason = \"\") {\r\n\t$PAGETITLE = 'Fehler';\r\n\tinclude('../includes/header.inc.php');\r\n\t?>\r\n\t\t<h2>OpenID-Fehler</h2>\r\n\t\t<p>Dies ist ein Endpoint für OpenID 2.0.<br>Es wurde keine (gültige) OpenID 2.0-Anfrage übermittelt.</p>\r\n\t<?php\r\n\t\techo '<p type=\"error\">'.htmlspecialchars($reason).'</p>';\r\n\tinclude('../includes/footer.inc.php');\r\n}", "public function addErrorHr($log = LOG_SYSTEM) {\n if (Config::config()['user']['debug']['log']) {\n file_put_contents(APP_LOG_PATH . $log . '.log', \"#################### END OF EXECUTION OF http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . \" ####################\\n\", FILE_APPEND | LOCK_EX);\n }\n }", "function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars)\n{\n // timestamp for the error entry\n $dt = date(\"Y-m-d H:i:s (T)\");\n\n $errortype = array (\n E_ERROR => \"Error\",\n E_WARNING => \"Warning\",\n E_PARSE => \"Parsing Error\",\n E_NOTICE => \"Notice\",\n E_CORE_ERROR => \"Core Error\",\n E_CORE_WARNING => \"Core Warning\",\n E_COMPILE_ERROR => \"Compile Error\",\n E_COMPILE_WARNING => \"Compile Warning\",\n E_USER_ERROR => \"User Error\",\n E_USER_WARNING => \"User Warning\",\n E_USER_NOTICE => \"User Notice\",\n E_STRICT => \"Runtime Notice\"\n );\n // set of errors for which a var trace will be saved\n $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE);\n \n $err = \"<errorentry>\\n\";\n $err .= \"\\t<datetime>\" . $dt . \"</datetime>\\n\";\n $err .= \"\\t<errornum>\" . $errno . \"</errornum>\\n\";\n $err .= \"\\t<errortype>\" . $errortype[$errno] . \"</errortype>\\n\";\n $err .= \"\\t<errormsg>\" . $errmsg . \"</errormsg>\\n\";\n $err .= \"\\t<scriptname>\" . $filename . \"</scriptname>\\n\";\n $err .= \"\\t<scriptlinenum>\" . $linenum . \"</scriptlinenum>\\n\";\n\n// if (in_array($errno, $user_errors)) {\n// $err .= \"\\t<vartrace>\" . wddx_serialize_value($vars, \"Variables\") . \"</vartrace>\\n\";\n// }\n $err .= \"</errorentry>\\n\\n\"; \n\n $err = $dt.\" \".$errno.\" \".$errortype[$errno].\" \".$errmsg.\" in \".$filename.\" line \".$linenum.\"\\n\";\n \n // save to the error log, and e-mail me if there is a critical user error\n error_log($err, 3, DEBUG_ERROR_HANDLER_LOG_FILE);\n// mail(DEBUG_ERROR_MAIL_TO, \"Critical User Error\", $err,$GLOBALS['pref']['mail_headers']);\n\n show_runtime_error(\"Interner Fehler\",\"handled by userErrorHandler\");\n exit();\n}", "function insertarUcedifgrupo(){\n\t\t$this->procedimiento='snx.ft_ucedifgrupo_ime';\n\t\t$this->transaccion='SNX_UDG_INS';\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('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('ucedifgrupo','ucedifgrupo','varchar');\n\t\t$this->setParametro('id_unidadconstructivaedif','id_unidadconstructivaedif','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}", "private function retornoErro(){\n $this->setErro();\n }", "function errQuery(){\n global $idRes;\n echo('<script> alert(\"ERROR!. La consulta falló\"); \n window.location(subastarPropiedad.php?id='.$idRes.');\n </script>');\n }", "protected function outputUserError()\n\t{\n\t\t$this->outputError('login_err9');\n\t}", "public function err($codigo='', $user_msg='', $log_msg=false)\n\t{\n\t\t$usr = ''; \n\t\tif (isset($_SESSION['unm'])) $usr = sprintf(\"user:%s\", $_SESSION['unm']);\n\t\t$ss = sprintf(\"<p align=\\\"center\\\"><code><i><b>[%s] %s</b> Error: %s</i></code></p>\", \n\t\t\t\t$codigo, $usr, $user_msg);\n\t\t$this->buf .= $ss;\n\t\tif ($log_msg !== false) error_log($codigo.':'.$usr.' msg:'.$log_msg);\n\t\treturn $ss;\n\t}", "function funDspErrorMsg($arrErrors,$strKey,$strID = '')\n{\n\t//$strID allows me to dynamically insert an id value\n\tif( array_key_exists($strKey,$arrErrors) )\n\t{\n\t\tif($strID == '')\n\t\t{\n\t\t\t$strIDString = '';\n\t\t} else {\n\t\t\t$strIDString = \"id=\\\"$strID\\\"\";\n\t\t}\n\t\t\n\t\techo \"<img class=\\\"form_error_message\\\" src=\\\"/images/red_question.gif\\\" title=\\\"$strKey $arrErrors[$strKey]!\\\" />\\n\";\n\t\t//echo \"<p $strIDString class=\\\"form_error_message\\\">$strKey $arrErrors[$strKey]!</p>\\n\"; //old error display\n\t}\n}", "function errorReport()\n {\n $this->errorLevel = $this->connId->errno;\n $this->errorDesc = $this->connId->error;\n }", "public function logError($typ = 'default', string $description = null)\n {\n global $config;\n // liegt eine Sperre vor?\n if (isset($_SESSION['errorlog'][$typ])) {\n $config['errorlogzeit'] = $config['millisek'] - $_SESSION['errorlog'][$typ];\n if ($config['errorlogzeit'] < 20) {\n $config['block'] = 1;\n }\n }\n // Prüft ob ein Block vorliegt (Zeitsperre) -> wenn nicht .. los!\n if (empty($config['block'])) {\n // eindeutige Error-ID erzeugen\n $mi = $config['millisek'] . substr(microtime(), 2, 6);\n\n // Insert into DB\n $ret = $this->database->insert('INSERT INTO\n\t\t\t system__errorlog\n\t\t\t SET\n\t\t\t\t eid=' . (int) $mi . ',\n\t\t\t\t typ=\"' . $this->database->strip($typ) . '\",\n\t\t\t ' . (!empty($config['user']['id']) ? 'userid=' . (int) $config['user']['id'] . ',' : '') . '\n\t\t\t\t ip=\"' . $this->database->strip($_SERVER['REMOTE_ADDR']) . '\",\n\t\t\t\t clientip=\"' . $this->get_client_ip_env() . '\",\n created=NOW(),\n description = \"'. $this->database->escape($description).'\"'\n , 'write');\n\n // Setzt eine Zeitsperre (Datenbank-Bombardierung verhindern)\n $_SESSION['errorlog'][$typ] = $config['millisek'];\n\n // Gib die individuelle Error-ID zurück\n return $mi;\n } else {\n return 0;\n }\n }", "public function setU ($log_u) {\n\t\t$this->log_u = $log_u;\n\t}", "function logOrDie(){\n\t$s = \"no esta autorizad@ para ver el contenido\";\n\tsession_start();\n\t\tif(!array_key_exists(\"id\", $_SESSION)) die($s);\n\t\tif(!(strcmp($_SESSION['id'],md5(\"wellcome to tijuana\")) == 0)) die($s);\n\tsession_write_close();\n\t\n}", "function udm_error($agent)\n{\n}", "function errorHandler($no, $msg, $file, $line){\n $php_errormsg = sprintf('%s on line %d', $msg, $line);\n $this->pushError($msg);\n }", "function descLogg($id){\nglobal $mysqli, $w, $wuser, $ip, $tsWeb, $tsActividad;\n// si $type == 1 ? $type = mi archivo; $type = otro;\nif($wuser->uid){ $obj = $wuser->uid; }else{ $obj = $ip; }\n$sdkjflake = $mysqli->query(\"SELECT up_id, up_user FROM rft_uploads WHERE up_id='\".$id.\"'\");\n$sdfjkn = $sdkjflake->fetch_assoc();\nif($sdfjkn['up_user'] == $wuser->uid){ $type = 1; }elseif(!$wuser->uid){ $type = 2; }elseif($sdfjkn['up_user'] != $wuser->uid){ $type = 3; }else{ $type = 0; }\n$mysqli->query(\"INSERT INTO rft_downloads(dow_type, dow_obj, dow_usip, dow_date) VALUES('\".$type.\"', '\".$id.\"' ,'\".$wuser->uid.\"', '\".time().\"')\");\n$idInserQuerySql = $mysqli->insert_id;\n$tsWeb->getNotifis($wuser->uid, 54, $idInserQuerySql, 0); \n$tsActividad->setActividad(60,$idInserQuerySql);\n}" ]
[ "0.6293434", "0.56833154", "0.545069", "0.5417161", "0.5390906", "0.5277547", "0.5266056", "0.5255757", "0.5230335", "0.5212748", "0.5203346", "0.5160466", "0.51486534", "0.51394224", "0.5122079", "0.5073685", "0.5058652", "0.50471205", "0.50429875", "0.5041062", "0.5032849", "0.5020912", "0.50147396", "0.50028586", "0.4967331", "0.49636373", "0.49278596", "0.4922843", "0.49225998", "0.49218127" ]
0.72366536
0
eof setDhErro Define o valor de log_m
public function setM ($log_m) { $this->log_m = $log_m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMsgErro ($log_msg_erro) {\n\t\t$this->log_msg_erro = substr($log_msg_erro,0,1020);\n\t}", "public function setDhErro ($log_dh_erro) {\n\t\t$this->log_dh_erro = $log_dh_erro;\n\t}", "private function log( $sMensagem = \"\", $iTipoLog = DBLog::LOG_INFO ) {\n \n /**\n * Logar no banco as alteracoes\n */\n RecadastroImobiliarioImoveisArquivo::$oLog->escreverLog( $sMensagem, $iTipoLog );\n }", "private function logMsg() {\n\n //log our error message to our log file\n $arr = $this->logData;\n\n if ($this->mode==\"db\") $this->logToDB($arr);\n elseif ($this->mode==\"xml\") $this->logToXML($arr);\n elseif ($this->mode==\"file\") $this->logToFile($arr);\n\n }", "function handleError($n, $m, $f, $l) {\n $err = \"\\r\\nuser error handler: e_warning=\".E_WARNING.\" num=\".$n.\" msg=\".$m.\" line=\".$l.\"\\n\";\n\t\t\n\t\tself::write2disk($this->logfile,$err);\n\t\t\n return true;\n //change to return false to make the \"catch\" block execute;\n }", "private function retornoErro(){\n $this->setErro();\n }", "public function addErrorHr($log = LOG_SYSTEM) {\n if (Config::config()['user']['debug']['log']) {\n file_put_contents(APP_LOG_PATH . $log . '.log', \"#################### END OF EXECUTION OF http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . \" ####################\\n\", FILE_APPEND | LOCK_EX);\n }\n }", "private function __logError() {\n\t\t$_log_dir = $rcmail->config->get('log_dir');\n file_put_contents($_log_dir.'/'.$this->_logs_file, date(\"Y-m-d H:i:s\").\"|\".$_SERVER['HTTP_X_FORWARDED_FOR'].\"|\".$_SERVER['REMOTE_ADDR'].\"\\n\", FILE_APPEND);\n }", "public function getDhErro () {\n\t\treturn $this->log_dh_erro;\n\t}", "public function escribir_en_log_errores($cadena_texto_a_imprimir_en_log_errores,$sitio_del_error=\"no definido\")\n\t{\n\t\t//PARTE LOG EN TXT\n\t\t//crea directorio log\n\t\t$ruta_temporales=\"TEMPORALES/\";\n\t\t$ruta_carpeta_del_log_errores_bd=$ruta_temporales.\"logs_errores_bd\";\n\t\tif(!file_exists($ruta_carpeta_del_log_errores_bd))\n\t\t{\n\t\t\tmkdir($ruta_carpeta_del_log_errores_bd, 0777);\n\t\t}\n\t\t//fin crea directorio log\n\t\t$cadena_preparada_para_log_bd=preg_replace(\"/[^A-Za-z0-9:.\\-\\s+\\_\\'\\=\\,\\*\\(\\)]/\", \"\", trim($cadena_texto_a_imprimir_en_log_errores) );\n\t\tdate_default_timezone_set (\"America/Bogota\");\n\t\t$fecha_para_archivo= date('Y-m-d-H');\n\t\t$tiempo_actual = date('H:i:s');\n\t\t$ruta_archivo_log_bd=$ruta_carpeta_del_log_errores_bd.\"/\".\"log_error_bd_\".$fecha_para_archivo.\".txt\";\t\t \n\t\t//se sobreescribe con el modo a\t\t\n\t\t$file_archivo_log_error_bd = fopen($ruta_archivo_log_bd, \"a\") or die(\"fallo la creacion del archivo\");\n\t\tfwrite($file_archivo_log_error_bd, \"\\n\".\"tiempo error: $tiempo_actual query problematica en $sitio_del_error: \".$cadena_preparada_para_log_bd);\n\t\tfclose($file_archivo_log_error_bd);\n\t\t//FIN PARTE LOG EN TXT\n\t}", "public static function log($mensagem)\n\t{\n\t\t$log = new TLoggerTXT(DIR_ROOT . 'userfiles/log/' . get_called_class() . '.txt');\n\t\t$log->write($mensagem);\n\t}", "public function getMsgErro () {\n\t\treturn $this->log_msg_erro;\n\t}", "function insertarLogRegularizaciones(){\n\t\t$this->procedimiento='vef.ft_log_regularizaciones_ime';\n\t\t$this->transaccion='VF_LOG_REGU_INS';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('cuf','cuf','varchar');\n\t\t$this->setParametro('observaciones','observaciones','text');\n\t\t$this->setParametro('fecha_observacion','fecha_observacion','varchar');\n\t\t$this->setParametro('action_estado','action_estado','varchar');\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}", "function modificarLogRegularizaciones(){\n\t\t$this->procedimiento='vef.ft_log_regularizaciones_ime';\n\t\t$this->transaccion='VF_LOG_REGU_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_log','id_log','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('cuf','cuf','varchar');\n\t\t$this->setParametro('observaciones','observaciones','text');\n\t\t$this->setParametro('fecha_observacion','fecha_observacion','varchar');\n\t\t$this->setParametro('action_estado','action_estado','varchar');\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}", "function LogError($descr=\"\",$msg=\"\"){\n\tif(trim($descr) == \"\" && trim($msg) == \"\")return;\n\tglobal $dbo;\n\t $inst = $dbo->InsertID(\"paymentlog_tb\",[\"Description\"=>$descr,\"Message\"=>$msg,\"Type\"=>\"ETRANZACT_DUMP\"]);\n\t exit($msg);\n}", "public function log($m) {\n\t\t$this->writeToLogFile('[LOG] [' . $this->getNow() . '] ' . $m . \"\\n\");\n\t}", "function info_02(){\n\n\tglobal $texerror;\n\n\t$ActionTime = date('H:i:s');\n\t\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USER WEB MODIFICADO \".$ActionTime.PHP_EOL.\"\\t ID:\".$_POST['id'].PHP_EOL.\"\\t Nombre: \".$_POST['Nombre'].\" \".$_POST['Apellidos'].PHP_EOL.\"\\t Ref: \".$_POST['ref'].PHP_EOL.\"\\t Nivel: \".$_POST['Nivel'].PHP_EOL.\"\\t User: \".$_POST['Usuario'].\".\\n\\t Pass: \".$_POST['Password'].\".\\n\\t Email: \".$_POST['Email'].PHP_EOL.\"\\t Direccion: \".$_POST['Direccion'].PHP_EOL.\"\\t Telefono 1: \".$_POST['Tlf1'].PHP_EOL.\"\\t Imagen: \".$_POST['myimg'].PHP_EOL.$texerror.PHP_EOL;\n\n require 'Inc_Log_Total.php';\n\n\t}", "static function fail($message,$where=null,$params=null)\n {\n $login = (isset($_SESSION['login'])) ? $_SESSION['login'] : null;\n $ip = get_ip();\n $date =date('Y-m-d h:i:s');\n $url_projet=lien_projet;\n\n $dbt=debug_backtrace();\n $caller =$class = isset($dbt[1]['class']) ? $dbt[1]['class'] : null;\n $caller.= isset($dbt[1]['function']) ? $dbt[1]['function'] : null;\n $method = isset($dbt[1]['function']) ? $dbt[1]['function'] : null;\n $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n\n $where = $caller . \". $where\";\n $content = \"{$date}\\t{$ip}\\t{$login}\\t$where\\t$actual_link\\t$message\";\n\n $tab_sql_error=null;\n $tab_sql_error['class']=$class;\n $tab_sql_error['method']=$method;\n $tab_sql_error['actual_link']=$actual_link;\n $tab_sql_error['message']=$message;\n $tab_sql_error['cle']=(isset($params['cle'])) ? $params['cle'] : null;\n\n $sql=\"INSERT INTO `log_error` ( `class`, `function`, `date`, `link`, `data`, `cle`)\n VALUES ( :class, :method, CURRENT_TIMESTAMP, :actual_link, :message, :cle);\n\";\n $rsql =maquery_sql($tab_sql_error,$sql);\n file_put_contents('error_failz.txt',$content);\n\n if (!empty($params['mail']))\n {\n $mail_send=\"[email protected]\";\n $mail_contenu = \"Erreur détecté sur $actual_link.<br/>\\n : $content \";\n mail::send(null,array('from_mail'=>mail_robot,'from_nom'=>mail_robot,'to_mail'=>$mail_send,'mail'=>$mail_contenu,'subject'=>techo(\"Fail détecté $message\" . nom_projet)));\n\n }\n\n\n\n }", "private function log($msg) {\r\n error_log('auth_ahea: ' . $msg);\r\n }", "public function setDescrErro ($log_descr_erro) {\n\t\t$this->log_descr_erro = substr($log_descr_erro,0,1020);\n\t}", "static function clear_error_log() {\n $config = \\Drupal::configFactory()->getEditable('brafton_importer.settings');\n $config->set('brafton_importer.brafton_e_log', '')->save();\n }", "private function error_log( $msg ) {\n\t \tif( self::LOGGING )\n\t \t\terror_log( $msg . \"\\n\", 3, $this->logFilePath );\n\t }", "public function error($msg, $line, $log = \"Unknown error\") {\n\t\techo \"<h2>An error has occurred</h2>\";\n\t\techo \"<h4>\".$msg.\"</h4>\";\n\t\t$content= file_get_contents('error.log');\n\t\tfile_put_contents(\"error.log\", $content .\"\\n\". $log.\" -> at line \". $line .\" at \".date(\"d-m-Y H:i:s\"));\n\t\texit;\n\t}", "function Halt( $msg ) { \n global $Global;\n // New Error control \n echo \"`_RPC_error_`\" . $this->Errno . \"`\" . $this->Error .\n \"`\" . $msg ; \n $this->NoLog = 1;\n $Global['SQL_Status'] = \"ER\";\n $this->log( $Global['username'], 'SQL ' .\n $this->Errno . \" - \" . $this->Error , $Global['SQL_Status'], $msg ); \n }", "function info_01(){\n\n\t$ActionTime = date('H:i:s');\n\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USER WEB MODIFICAR SELECCIONADO \".$ActionTime.PHP_EOL.\"\\t ID:\".$_POST['id'].PHP_EOL.\"\\t Nombre: \".$_POST['Nombre'].\" \".$_POST['Apellidos'].PHP_EOL.\"\\t Ref: \".$_POST['ref'].PHP_EOL.\"\\t Nivel: \".$_POST['Nivel'].PHP_EOL.\"\\t User: \".$_POST['Usuario'].\".\\n\\t Pass: \".$_POST['Password'].\".\\n\\t Email: \".$_POST['Email'].PHP_EOL.\"\\t Direccion: \".$_POST['Direccion'].PHP_EOL.\"\\t Telefono 1: \".$_POST['Tlf1'].PHP_EOL.\"\\t Imagen: \".$_POST['myimg'].PHP_EOL;\n\n require 'Inc_Log_Total.php';\n\n\t}", "function logger($l, $message, $script, $line)\n{\n\tglobal $settings, $db;\n\n\tif($settings['loglevel'] & $l)\n\t\t$db->query('INSERT INTO log (time, script, message) VALUES (?, ?, ?)', 'iss',\n\t\t\t\t\t\ttime(),\n\t\t\t\t\t\tbasename($script).':'.$line,\n\t\t\t\t\t\t$message);\n}", "function showError($sql){\r\n\t$error=\"\";\r\n if(DEBUG===true){ \r\n \t$error = array('Sesiones'=>$_SESSION,'Post'=>$_POST,'Get'=>$_GET,'Error '.mysql_errno()=>mysql_error(),'query'=>$sql);\r\n }\r\n else{\r\n \t if($this->debug){\r\n\t \t$error = array('Sesiones'=>$_SESSION,'Error '=>mysql_errno(),'Detalle'=>mysql_error(),'query'=>$sql);\r\n \t }\r\n \t /*else{\r\n\t\t\t$this->saveErrorLog($sql);\r\n\t\t\t$error = array('Error mysql'=>mysql_errno());\r\n\t\t} */\r\n\t\t$this->debug(false);\r\n }\r\n if($error) print_r($error);\r\n if(SAVELOG===true) $this->saveErrorLog($sql);\r\n}", "function log_penyusutan($Aset_ID, $tableKib, $Kd_Riwayat, $tahun, $Data, $DBVAR)\n{\n\n $QueryKibSelect = \"SELECT * FROM $tableKib WHERE Aset_ID = '$Aset_ID'\";\n $exequeryKibSelect = $DBVAR->query ($QueryKibSelect);\n $resultqueryKibSelect = $DBVAR->fetch_object ($exequeryKibSelect);\n\n $tmpField = array();\n $tmpVal = array();\n $sign = \"'\";\n $AddField = \"action,changeDate,TglPerubahan,Kd_Riwayat,NilaiPerolehan_Awal,AkumulasiPenyusutan_Awal,NilaiBuku_Awal,PenyusutanPerTahun_Awal\";\n $action = \"Penyusutan_\" . $tahun . \"_\" . $Data[ 'kodeSatker' ];\n $TglPerubahan = \"$tahun-12-31\";\n $changeDate = date ('Y-m-d');\n $NilaiPerolehan_Awal = 0;\n /* $NilaiPerolehan_Awal = $Data['NilaiPerolehan_Awal'];\n if($NilaiPerolehan_Awal ==\"\"||$NilaiPerolehan_Awal ==0){\n $NilaiPerolehan_Awal =\"NULL\";\n }*/\n $AkumulasiPenyusutan_Awal = $Data[ 'AkumulasiPenyusutan_Awal' ];\n if($AkumulasiPenyusutan_Awal == \"\" || $AkumulasiPenyusutan_Awal == \"0\") {\n $AkumulasiPenyusutan_Awal = \"NULL\";\n }\n\n $NilaiBuku_Awal = $Data[ 'NilaiBuku_Awal' ];\n if($NilaiBuku_Awal == \"\" || $NilaiBuku_Awal == \"0\") {\n $NilaiBuku_Awal = \"NULL\";\n }\n\n $PenyusutanPerTahun_Awal = $Data[ 'PenyusutanPerTahun_Awal' ];\n if($PenyusutanPerTahun_Awal == \"\" || $PenyusutanPerTahun_Awal == \"0\") {\n $PenyusutanPerTahun_Awal = \"NULL\";\n }\n foreach ($resultqueryKibSelect as $key => $val) {\n $tmpField[] = $key;\n if($val == '') {\n $tmpVal[] = $sign . \"NULL\" . $sign;\n } else {\n $tmpVal[] = $sign . addslashes ($val) . $sign;\n }\n }\n $implodeField = implode (',', $tmpField);\n $implodeVal = implode (',', $tmpVal);\n\n $QueryLog = \"INSERT INTO log_$tableKib ($implodeField,$AddField) VALUES\"\n . \" ($implodeVal,'$action','$changeDate','$TglPerubahan','$Kd_Riwayat','{$resultqueryKibSelect->NilaiPerolehan}',$AkumulasiPenyusutan_Awal,\"\n . \"$NilaiBuku_Awal,$PenyusutanPerTahun_Awal)\";\n $exeQueryLog = $DBVAR->query ($QueryLog) or die($DBVAR->error ());;\n\n\n return $tableLog;\n}", "function error($string, $tipo)\r\n{\r\n /*FUNCION que guarda los logs de lo ocurrido en el analisis u otras funciones*/\r\n $r = insertaSQL(\"INSERT INTO log (descripcion, tipo) VALUES ('$string', '$tipo')\");\r\n}", "public function eLog($location, $m) {\t\t\n\t\t$this->writeToLogFile('[LOG] [' . $this->getNow() . \"] [$location] \" . $m . \"\\n\");\n\t}" ]
[ "0.6179856", "0.6045201", "0.5879087", "0.5855026", "0.5757354", "0.5751118", "0.57055074", "0.56817055", "0.5595069", "0.5514219", "0.55130243", "0.5505126", "0.54937", "0.54884386", "0.54771537", "0.5461455", "0.54545563", "0.5425331", "0.54148537", "0.5396474", "0.5367695", "0.53665775", "0.5362385", "0.53519815", "0.53184164", "0.5288698", "0.5246678", "0.5224881", "0.52206963", "0.52189225" ]
0.6082873
1
eof setM Define o valor de log_u
public function setU ($log_u) { $this->log_u = $log_u; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getU () {\n\t\treturn $this->log_u;\n\t}", "public function setUsuID ($log_usu_id) {\n\t\t$this->log_usu_id = $log_usu_id;\n\t}", "function myDebLog($user = 'admin'){\n\t\t$this->user = $user;\n\t\t\n\t\t//si no existe, creará un fichero cuyo nombre corresponde con la fecha\n\t\t//del día de creación en formato yyyymmdd.log\n\t\tparent::Log(PATH_LOG . '/' . date('Ymd') . '.log');\n\t}", "public function setM ($log_m) {\n\t\t$this->log_m = $log_m;\n\t}", "public function getUsuID () {\n\t\treturn $this->log_usu_id;\n\t}", "public function setU ($u) {\n\t\t$this->u = $u;\n\t}", "function import_user_log_get_default(\n$uid, $rid, $type, $value\n) {\n $log = new stdClass();\n $log->created = time();\n $log->uid = $uid;\n $log->rid = $rid;\n $log->import_table = 'import_user_asthma_dchp_file_01'; //$import_table;\n $log->type = $type;\n $log->value = $value;\n return $log;\n}", "function LogRegister($l)\n\t\t\t{\n\t\t\t\tglobal $ficLog;\n\t\t\t\t$ficLog = fopen(\"Liste_Log.txt\",\"a\");\n\t\t\t\t$ret=0;\n\t\t\t\t\n\t\t\t\tif ( $ficLog )\n\t\t\t\t{\n\t\t\t\t\t/* Writing of the new login in \"Liste_log.txt\" */\n\t\t\t\t\tfputs($ficLog, $l);\n\t\t\t\t\tfputs($ficLog, \"\\n\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ret = 1;\n\t\t\t\t}\n\t\t\t\tfclose($ficLog);\n\t\t\treturn $ret;\n\t\t\t}", "function info_02(){\n\n\tglobal $texerror;\n\n\t$ActionTime = date('H:i:s');\n\t\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USER WEB MODIFICADO \".$ActionTime.PHP_EOL.\"\\t ID:\".$_POST['id'].PHP_EOL.\"\\t Nombre: \".$_POST['Nombre'].\" \".$_POST['Apellidos'].PHP_EOL.\"\\t Ref: \".$_POST['ref'].PHP_EOL.\"\\t Nivel: \".$_POST['Nivel'].PHP_EOL.\"\\t User: \".$_POST['Usuario'].\".\\n\\t Pass: \".$_POST['Password'].\".\\n\\t Email: \".$_POST['Email'].PHP_EOL.\"\\t Direccion: \".$_POST['Direccion'].PHP_EOL.\"\\t Telefono 1: \".$_POST['Tlf1'].PHP_EOL.\"\\t Imagen: \".$_POST['myimg'].PHP_EOL.$texerror.PHP_EOL;\n\n require 'Inc_Log_Total.php';\n\n\t}", "function info_01(){\n\n\t$ActionTime = date('H:i:s');\n\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USER WEB MODIFICAR SELECCIONADO \".$ActionTime.PHP_EOL.\"\\t ID:\".$_POST['id'].PHP_EOL.\"\\t Nombre: \".$_POST['Nombre'].\" \".$_POST['Apellidos'].PHP_EOL.\"\\t Ref: \".$_POST['ref'].PHP_EOL.\"\\t Nivel: \".$_POST['Nivel'].PHP_EOL.\"\\t User: \".$_POST['Usuario'].\".\\n\\t Pass: \".$_POST['Password'].\".\\n\\t Email: \".$_POST['Email'].PHP_EOL.\"\\t Direccion: \".$_POST['Direccion'].PHP_EOL.\"\\t Telefono 1: \".$_POST['Tlf1'].PHP_EOL.\"\\t Imagen: \".$_POST['myimg'].PHP_EOL;\n\n require 'Inc_Log_Total.php';\n\n\t}", "public function getUlogaID()\n {\n return $this->ulogaID;\n }", "function getBaseLog(){\t\t\n\t\tif(!isset($_REQUEST['appid'])\n\t\t\t||!isset($_REQUEST['event'])\n\t\t\t||!isset($_REQUEST['uid'])) throw new Exception(\"no appid or event or uid\");\n\t\tif(isset($_REQUEST['timestamp']))\n\t\t\t$timestamp = $_REQUEST['timestamp'];\n\t\telse \n\t\t\t$timestamp = $_SERVER['REQUEST_TIME'];\n\t\t$log=$_REQUEST['appid'].\"\\t\".$_REQUEST['uid'].\"\\t\".$_REQUEST['ref'].\n\t\t\t\"\\t\".$_REQUEST['event'].\"\\t\".$_REQUEST['json_var'].\"\\t\".$timestamp.\"\\n\";\n\t\t\n\t\tif ($_REQUEST ['event'] === \"user.visit\") {\n\t\t\t$ip = getIP ();\n\t\t\tif ($ip != false) {\n\t\t\t\t$log = $log . $_REQUEST ['appid'] . \"\\t\" . $_REQUEST ['uid'] . \"\\t\" . '' . \"\\t\" . \"user.update\" . \"\\t\" . '{\"geoip\":\"' . $ip . '\"}' . \"\\t\" . $timestamp . \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $log;\n\t}", "function import_user_log_insert(&$log) {\n $result = db_query(\n \"\n insert into import_user_log \n (created, rid, uid, import_table, log_type, log_value)\n values\n (%d,%d,%d,'%s','%s','%s')\n \"\n , $log->created, $log->rid, $log->uid, $log->import_table, $log->type, $log->value);\n}", "function logger($l, $message, $script, $line)\n{\n\tglobal $settings, $db;\n\n\tif($settings['loglevel'] & $l)\n\t\t$db->query('INSERT INTO log (time, script, message) VALUES (?, ?, ?)', 'iss',\n\t\t\t\t\t\ttime(),\n\t\t\t\t\t\tbasename($script).':'.$line,\n\t\t\t\t\t\t$message);\n}", "function logs(){\n\n\t\t}", "function logOp($op,$status,$uabs) {\n $file = fopen(__DIR__.\"/logs/log.txt\", \"a+\");\n if(!$file){\n return;\n }\t\n $str = $op.','.$status.','.$uabs.\"\\n\";\n fwrite($file,$str);\n fclose($file);\t\n}", "public function setA ($log_a) {\n\t\t$this->log_a = $log_a;\n\t}", "function user_logged(){\n\t\tif(isset($_SESSION['userlogid'])) {\n\t\t\t\t\n\t\t\t$userlogid = $_SESSION['userlogid'];\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$userlogid = 9999;\n\t\t}\n\t\treturn $userlogid;\n\t}", "function setLog($proceso,$sucursal,$usuario){\n $data = array(\n 'proceso_id' => $proceso,\n 'sucursal_id' => $sucursal,\n 'id_usuario' => $usuario\n );\n $this->db->insert(self::sys_procesos_log,$data);\n }", "function get_default_log_file($userId) {\n\t global $OK;\n\t global $default_file;\n\t $rMsg=_create_return_value($OK, \"\", $default_file);\n\t return $rMsg;\n}", "public function log()\n {\n $data['logs'] = $this->Get_model->get('tb_school_logs', 'log_username')->result();\n $data['view'] = 'admin/log_user/index';\n $this->load->view('admin/main', $data);\n }", "public function run()\n {\n //\n\t\t/*\n\t\t$getip = UserSystemInfoHelper::get_ip();\n\t\t$getbrowser = UserSystemInfoHelper::get_browsers();\n\t\t$getdevice = UserSystemInfoHelper::get_device();\n\t\t$getos = UserSystemInfoHelper::get_os();\n\t\t*/\n\n $log = new Log();\n $log->user_id = 1;\n $log->section = 'Usuarios';\n $log->action = 'Creación';\n $log->feedback = 'self';\n $log->ip = '$getip';\n $log->device = '$getdevice';\n $log->system = '$getos';\n $log->save();\n\n \n }", "public function login_log()\r\n {\r\n }", "public function setLog(){\n $model= Useraudit::instance();\n $model->setAttributes($this->attrMin());$model->save();\n }", "function _log($userinfo)\r\n {\r\n $logDefault = array(\r\n 'eol' => \"\\n\",\r\n 'lineFormat' => '%1$s %2$s [%3$s] %4$s %5$s',\r\n 'contextFormat' => 'in %3$s (file %1$s on line %2$s)',\r\n 'timeFormat' => '%b %d %H:%M:%S',\r\n 'ident' => $_SERVER['REMOTE_ADDR'],\r\n 'message_type' => 3,\r\n 'destination' => get_class($this) . '.log',\r\n 'extra_headers' => ''\r\n );\r\n\r\n $logConf = $userinfo['log'];\r\n $log = array_merge($logDefault, $logConf);\r\n\r\n $message_type = $log['message_type'];\r\n $destination = '';\r\n $extra_headers = '';\r\n $send = true;\r\n\r\n switch ($message_type) {\r\n case 0: // LOG_TYPE_SYSTEM:\r\n break;\r\n case 1: // LOG_TYPE_MAIL:\r\n $destination = $log['destination'];\r\n $extra_headers = $log['extra_headers'];\r\n break;\r\n case 3: // LOG_TYPE_FILE:\r\n $destination = $log['destination'];\r\n break;\r\n default:\r\n $send = false;\r\n }\r\n\r\n if ($send) {\r\n $time = explode(' ', microtime());\r\n $time = $time[1] + $time[0];\r\n $timestamp = isset($userinfo['time']) ? $userinfo['time'] : $time;\r\n $contextExec = $this->sprintContextExec($log['contextFormat']);\r\n\r\n $message = sprintf(\r\n $log['lineFormat'] . $log['eol'],\r\n strftime($log['timeFormat'], $timestamp),\r\n $log['ident'],\r\n $userinfo['level'],\r\n $this->getMessage(),\r\n $contextExec\r\n );\r\n\r\n error_log(\r\n strip_tags($message), $message_type, $destination, $extra_headers\r\n );\r\n }\r\n }", "function logUser($userID)\r\n {\r\n\t$result = $this->query(\"SET NAMES utf8\"); \t\r\n\t//echo \"<br>server address: \".$_SERVER['SERVER_ADDR'];\r\n\t//echo \"<br>server name: \".$_SERVER['SERVER_NAME'];\r\n\t//echo \"<br>user agent: \".$_SERVER['HTTP_USER_AGENT'];\r\n\t$server_address = $_SERVER['SERVER_ADDR'];\r\n\t$remote_address = $_SERVER['REMOTE_ADDR'];\r\n\t$server_name = $_SERVER['SERVER_NAME'];\r\n\t$user_agent = $_SERVER['HTTP_USER_AGENT'];\r\n\t$res = $this->query(\"insert into user_log (user_id,IPv4,host,user_agent) values ($userID,'$remote_address','$server_name','$user_agent')\");\r\n }", "public function logUserLogin()\n {\n $data = array (\n 'judul' => \"BiasHRIS | Log User Login\",\n 'row' => $this->M_Dev->getLogin(),\n );\n $this->template->load('template', 'developer/userlogin',$data);\n \n }", "public static function setLog($log=FALSE) {\n self::$log = $log;\n }", "function logxtvx($nama_anda,$ubah)\n{\n\t$_POST['user'] = $nama_anda;\n\t$_POST['aktiviti'] = 'kemaskini mdt2012';\n\t$_POST['arahan_sql'] = \"<pre>($ubah)</pre>\";\n\tinclude '../log_xtvt.php';\n}", "function start_log()\r\n\t{\r\n\t\t$this->log = \"Started on \".NOW().\" - \".date(\"Y M d\").\"\\r\\n\\n\";\r\n\t\t$this->log .= \"Checking File ....\\r\\n\";\r\n\t\t$this->log('File',$this->input_file);\r\n\t}" ]
[ "0.67917544", "0.6197805", "0.59206", "0.58672875", "0.5672025", "0.5619393", "0.5609658", "0.559277", "0.55921704", "0.557233", "0.54736614", "0.54486877", "0.5436428", "0.5427036", "0.5417488", "0.5363543", "0.5345619", "0.5341143", "0.53376776", "0.53301173", "0.53088367", "0.53032523", "0.5298212", "0.5294681", "0.5275174", "0.5272808", "0.5257981", "0.5219372", "0.5213694", "0.520952" ]
0.7785128
0
eof setU Define o valor de log_a
public function setA ($log_a) { $this->log_a = $log_a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAcao ($log_acao) {\n\t\t$this->log_acao = $log_acao;\n\t}", "function logs(){\n\n\t\t}", "function LogRegister($l)\n\t\t\t{\n\t\t\t\tglobal $ficLog;\n\t\t\t\t$ficLog = fopen(\"Liste_Log.txt\",\"a\");\n\t\t\t\t$ret=0;\n\t\t\t\t\n\t\t\t\tif ( $ficLog )\n\t\t\t\t{\n\t\t\t\t\t/* Writing of the new login in \"Liste_log.txt\" */\n\t\t\t\t\tfputs($ficLog, $l);\n\t\t\t\t\tfputs($ficLog, \"\\n\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ret = 1;\n\t\t\t\t}\n\t\t\t\tfclose($ficLog);\n\t\t\treturn $ret;\n\t\t\t}", "function info_01(){\n\n\t$ActionTime = date('H:i:s');\n\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USER WEB MODIFICAR SELECCIONADO \".$ActionTime.PHP_EOL.\"\\t ID:\".$_POST['id'].PHP_EOL.\"\\t Nombre: \".$_POST['Nombre'].\" \".$_POST['Apellidos'].PHP_EOL.\"\\t Ref: \".$_POST['ref'].PHP_EOL.\"\\t Nivel: \".$_POST['Nivel'].PHP_EOL.\"\\t User: \".$_POST['Usuario'].\".\\n\\t Pass: \".$_POST['Password'].\".\\n\\t Email: \".$_POST['Email'].PHP_EOL.\"\\t Direccion: \".$_POST['Direccion'].PHP_EOL.\"\\t Telefono 1: \".$_POST['Tlf1'].PHP_EOL.\"\\t Imagen: \".$_POST['myimg'].PHP_EOL;\n\n require 'Inc_Log_Total.php';\n\n\t}", "private function log( $sMensagem = \"\", $iTipoLog = DBLog::LOG_INFO ) {\n \n /**\n * Logar no banco as alteracoes\n */\n RecadastroImobiliarioImoveisArquivo::$oLog->escreverLog( $sMensagem, $iTipoLog );\n }", "function setLog($proceso,$sucursal,$usuario){\n $data = array(\n 'proceso_id' => $proceso,\n 'sucursal_id' => $sucursal,\n 'id_usuario' => $usuario\n );\n $this->db->insert(self::sys_procesos_log,$data);\n }", "function log_penyusutan($Aset_ID, $tableKib, $Kd_Riwayat, $tahun, $Data, $DBVAR)\n{\n\n $QueryKibSelect = \"SELECT * FROM $tableKib WHERE Aset_ID = '$Aset_ID'\";\n $exequeryKibSelect = $DBVAR->query ($QueryKibSelect);\n $resultqueryKibSelect = $DBVAR->fetch_object ($exequeryKibSelect);\n\n $tmpField = array();\n $tmpVal = array();\n $sign = \"'\";\n $AddField = \"action,changeDate,TglPerubahan,Kd_Riwayat,NilaiPerolehan_Awal,AkumulasiPenyusutan_Awal,NilaiBuku_Awal,PenyusutanPerTahun_Awal\";\n $action = \"Penyusutan_\" . $tahun . \"_\" . $Data[ 'kodeSatker' ];\n $TglPerubahan = \"$tahun-12-31\";\n $changeDate = date ('Y-m-d');\n $NilaiPerolehan_Awal = 0;\n /* $NilaiPerolehan_Awal = $Data['NilaiPerolehan_Awal'];\n if($NilaiPerolehan_Awal ==\"\"||$NilaiPerolehan_Awal ==0){\n $NilaiPerolehan_Awal =\"NULL\";\n }*/\n $AkumulasiPenyusutan_Awal = $Data[ 'AkumulasiPenyusutan_Awal' ];\n if($AkumulasiPenyusutan_Awal == \"\" || $AkumulasiPenyusutan_Awal == \"0\") {\n $AkumulasiPenyusutan_Awal = \"NULL\";\n }\n\n $NilaiBuku_Awal = $Data[ 'NilaiBuku_Awal' ];\n if($NilaiBuku_Awal == \"\" || $NilaiBuku_Awal == \"0\") {\n $NilaiBuku_Awal = \"NULL\";\n }\n\n $PenyusutanPerTahun_Awal = $Data[ 'PenyusutanPerTahun_Awal' ];\n if($PenyusutanPerTahun_Awal == \"\" || $PenyusutanPerTahun_Awal == \"0\") {\n $PenyusutanPerTahun_Awal = \"NULL\";\n }\n foreach ($resultqueryKibSelect as $key => $val) {\n $tmpField[] = $key;\n if($val == '') {\n $tmpVal[] = $sign . \"NULL\" . $sign;\n } else {\n $tmpVal[] = $sign . addslashes ($val) . $sign;\n }\n }\n $implodeField = implode (',', $tmpField);\n $implodeVal = implode (',', $tmpVal);\n\n $QueryLog = \"INSERT INTO log_$tableKib ($implodeField,$AddField) VALUES\"\n . \" ($implodeVal,'$action','$changeDate','$TglPerubahan','$Kd_Riwayat','{$resultqueryKibSelect->NilaiPerolehan}',$AkumulasiPenyusutan_Awal,\"\n . \"$NilaiBuku_Awal,$PenyusutanPerTahun_Awal)\";\n $exeQueryLog = $DBVAR->query ($QueryLog) or die($DBVAR->error ());;\n\n\n return $tableLog;\n}", "function start_log()\r\n\t{\r\n\t\t$this->log = \"Started on \".NOW().\" - \".date(\"Y M d\").\"\\r\\n\\n\";\r\n\t\t$this->log .= \"Checking File ....\\r\\n\";\r\n\t\t$this->log('File',$this->input_file);\r\n\t}", "function insertarLogRegularizaciones(){\n\t\t$this->procedimiento='vef.ft_log_regularizaciones_ime';\n\t\t$this->transaccion='VF_LOG_REGU_INS';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('cuf','cuf','varchar');\n\t\t$this->setParametro('observaciones','observaciones','text');\n\t\t$this->setParametro('fecha_observacion','fecha_observacion','varchar');\n\t\t$this->setParametro('action_estado','action_estado','varchar');\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}", "function info_02(){\n\n\tglobal $texerror;\n\n\t$ActionTime = date('H:i:s');\n\t\n\tglobal $logtext;\n\t$logtext = PHP_EOL.\"- USER WEB MODIFICADO \".$ActionTime.PHP_EOL.\"\\t ID:\".$_POST['id'].PHP_EOL.\"\\t Nombre: \".$_POST['Nombre'].\" \".$_POST['Apellidos'].PHP_EOL.\"\\t Ref: \".$_POST['ref'].PHP_EOL.\"\\t Nivel: \".$_POST['Nivel'].PHP_EOL.\"\\t User: \".$_POST['Usuario'].\".\\n\\t Pass: \".$_POST['Password'].\".\\n\\t Email: \".$_POST['Email'].PHP_EOL.\"\\t Direccion: \".$_POST['Direccion'].PHP_EOL.\"\\t Telefono 1: \".$_POST['Tlf1'].PHP_EOL.\"\\t Imagen: \".$_POST['myimg'].PHP_EOL.$texerror.PHP_EOL;\n\n require 'Inc_Log_Total.php';\n\n\t}", "function log()\r\n {\r\n }", "function log( $aLog ) {\n global $dbh;\n\n // Strip the PIN from the passPhrase in case of HOTP logins\n $pp = strlen($this->passPhrase) > 6 ? substr($this->passPhrase, -6) : $this->passPhrase;\n\n $ps = $dbh->prepare(\"INSERT INTO Log (userName, passPhrase, idNAS, idClient, status, message) VALUES (:userName, :passPhrase, :idNAS, :idClient, :status, :message)\");\n $ps->execute(array( \":userName\" => $this->userName,\n \":passPhrase\" => $pp,\n \":idNAS\" => (isset($aLog['idNAS']) ? $aLog['idNAS'] : null),\n \":idClient\" => (isset($aLog['idClient']) ? $aLog['idClient'] : null),\n \":status\" => (isset($aLog['status']) ? $aLog['status'] : null),\n \":message\" => (isset($aLog['message']) ? $aLog['message'] : null)));\n }", "function myDebLog($user = 'admin'){\n\t\t$this->user = $user;\n\t\t\n\t\t//si no existe, creará un fichero cuyo nombre corresponde con la fecha\n\t\t//del día de creación en formato yyyymmdd.log\n\t\tparent::Log(PATH_LOG . '/' . date('Ymd') . '.log');\n\t}", "public function setU ($log_u) {\n\t\t$this->log_u = $log_u;\n\t}", "public function loginit()\n {\n EasyTransac\\Core\\Logger::getInstance()\n ->setActive(Configuration::get('EASYTRANSAC_DEBUG'));\n\n EasyTransac\\Core\\Logger::getInstance()\n ->setFilePath(_PS_ROOT_DIR_ . '/modules/easytransac/logs/');\n }", "function log_negocio($arquivo, $oper, $compra, $venda, $total, $pos){\n\t// $arquivo = str_replace(\".txt\", \"\", $arquivo);\n\t// $prev = \"output/$arquivo.csv\";\n\t// $content = \"\";\n\t// if(file_exists($prev)){\n\t// \t$content = file_get_contents($prev);\n\t// }\n\n\t// $compra = number_format($compra, 1, \",\", \"\");\n\t// $venda = number_format($venda, 1, \",\", \"\");\n\t// $total = number_format($total, 1, \",\", \"\");\n\n\t// $fp = fopen($prev, \"w+\") or die(\"Unable to open file!\");\n\t// $content .= \"\\\"$oper\\\",\\\"$compra\\\",\\\"$venda\\\",\\\"$total\\\",\\\"$pos\\\"\\n\";\n\t// fwrite($fp, $content);\n\t// fclose($fp);\n}", "private function logf($info){ }", "public static function opra_log($opra, $ip ,$mis=NULL)\n {\n $op = new OpLog() ;\n $op->ipadd = $ip ;\n $op->opr = $opra ;\n if ($mis!== null) {\n $op->misc = $mis ;\n }\n \n $op->save(false) ;\n }", "function insertar_log($datos){\n global $db;\n\n $prep = $db->prepare(\"INSERT INTO log (Tipo, Fecha, Descripcion)\n VALUES (?, ?, ?)\");\n\n $prep->bind_param('sss', $tipo, $fec, $desc);\n \n // Establecer parámetros y ejecutar\n $tipo = $datos['Tipo'];\n $fec = $datos['Fecha'];\n $desc = $datos['Descripcion'];\n\n $prep->execute();\n \n // Cerramos la consulta preparada\n $prep->close();\n }", "public function getAcao () {\n\t\treturn $this->log_acao;\n\t}", "function aeph_set_user_history_log($id, $login, $fecha, $activo){\n\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\tif(!isset($wpdb)){\n\t\t\t\trequire_once('../../../wp-config.php');\n\t\t\t\trequire_once('../../../wp-load.php');\n\t\t\t\trequire_once('../../../wp-includes/wp-db.php');\n\t\t\t}\n\n\t\t\t$wpdb->insert( \n\t\t\t\t\t'aeph_fechas_expiracion', \n\t\t\t\t\tarray( \n\t\t\t\t\t\t'id_usuario' => $id, \n\t\t\t\t\t\t'user_login' => $login,\n\t\t\t\t\t\t'fecha_exp' => $fecha,\n\t\t\t\t\t\t'activo' => $activo\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t}", "function logxtvx($nama_anda,$ubah)\n{\n\t$_POST['user'] = $nama_anda;\n\t$_POST['aktiviti'] = 'kemaskini mdt2012';\n\t$_POST['arahan_sql'] = \"<pre>($ubah)</pre>\";\n\tinclude '../log_xtvt.php';\n}", "function logger($l, $message, $script, $line)\n{\n\tglobal $settings, $db;\n\n\tif($settings['loglevel'] & $l)\n\t\t$db->query('INSERT INTO log (time, script, message) VALUES (?, ?, ?)', 'iss',\n\t\t\t\t\t\ttime(),\n\t\t\t\t\t\tbasename($script).':'.$line,\n\t\t\t\t\t\t$message);\n}", "public function getA () {\n\t\treturn $this->log_a;\n\t}", "private function logopen() \n\t\t{\n\t\t\t#### Open log file for writing only and place file pointer at the end of the file.\n\t\t\t#### If the file does not exist, try to create it.\n\t\t\t$this->fp = fopen($this->log_file, 'a+') or exit(\"Can't open $logfile!\");\n\t\t}", "function poslogsAlipay($log) {\r\nGLOBAL $log_path_ap;\r\n$myfile = file_put_contents($log_path_ap, $log . PHP_EOL, FILE_APPEND | LOCK_EX); \r\nreturn $myfile; \r\n}", "private function log($msg) {\r\n error_log('auth_ahea: ' . $msg);\r\n }", "function logit($data=NULL, $name=\"custom_log\") {\n\t/* $fra->tool->logit(DATA, NAME)\n\t***************************************************\n\t| This function lets you log everything with a \n\t| custom name and a custom array of data.\n\t***************************************************/\n\t\tif(!is_array($data)) {\n\t\t\t$data = Array($data);\n\t\t}\n\n\t\t$fra_log_datet \t\t= date('Y-m-d - H:i:s');\n\t\t$fra_log_wsurl \t\t= \"{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}\";\n\t\t$fra_log_usrip \t\t= $_SERVER['REMOTE_ADDR'];\n\t\t$fra_log_usrag \t\t= $_SERVER['HTTP_USER_AGENT'];\n\t\t$fra_log_varss \t\t= $_SESSION;\n\t\t$fra_log_varrq \t\t= $_REQUEST;\n\t\tif(fra_var[\"db_conn\"] == 1) {\n\t\t\t$fra_log_dblgs \t= $fra->data->log();\n\t\t\t$fra_log_dberr \t= $fra->data->error();\n\t\t} else {\n\t\t\t$fra_log_dblgs \t= \"\";\n\t\t\t$fra_log_dberr \t= \"\";\n\t\t}\n\t\t$fra_log_file \t\t= $_SERVER['DOCUMENT_ROOT'].\"/logs/\".date('Ymd').\"_\".fra_var[\"domain\"].\"_\".$name.\".log\";\n\t\tif(file_exists($fra_log_file)) {\n\t\t\t$fra_log_current = file_get_contents($fra_log_file);\n\t\t} else {\n\t\t\t$fra_log_current = \"\";\n\t\t}\n\t\t$fra_log_current .= \"\". $fra_log_datet .\"\\n-----------------------------------------\\nURL: \". $fra_log_wsurl . \"\\nUSER: \".$fra_log_usrip.\"\\n\".$fra_log_usrag.\"\\n\\nCUSTOM DATA:\\n\".print_r($data, true).\"\\nREQUEST:\\n\".print_r($fra_log_varrq, true).\"\\nSESSIONS:\\n\".print_r($fra_log_varss,true).\"\\nDB LOGS:\\n\".print_r($fra_log_dblgs, true).\"\\nDB ERROR:\\n\".print_r($fra_log_dberr, true).\"\\n-----------------------------------------\\n\\n\";\n\t\tfile_put_contents($fra_log_file, $fra_log_current);\n\t}", "function log($type, $data) {\r\n\t\t\t\t// $now= date(\"F j, Y, g:i a\");\r\n\t\t\t\t$now = date ( 'Y-m-d H:i:s' );\r\n\t\t\t\t$data = @addslashes ( $data );\r\n\t\t\t\t\r\n\t\t\t\t \r\n\t\t\t\t$query = \"INSERT INTO {$this->wp_prefix}automatic_log (action,date,data) values('$type','$now','$data')\";\r\n\t\t\t\t\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t// echome$query;\r\n\t\t\t\t$this->db->query ( $query );\r\n\t\t\t\t\r\n\t\t\t\t$insert = $this->db->insert_id;\r\n\t\t\t\t\r\n\t\t\t\t$insert_below_100 = $insert -100 ;\r\n\t\t\t\t\r\n\t\t\t\tif($insert_below_100 > 0){\r\n\t\t\t\t\t//delete\r\n\t\t\t\t\t$query=\"delete from {$this->wp_prefix}automatic_log where id < $insert_below_100 and action not like '%Posted%'\" ;\r\n\t\t\t\t\t$this->db->query($query);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "public static function static_log($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }" ]
[ "0.6360851", "0.6096049", "0.6072441", "0.60258144", "0.5947001", "0.5935129", "0.5923772", "0.59237283", "0.58928114", "0.5826605", "0.5826227", "0.58193237", "0.58037436", "0.5762844", "0.5745846", "0.5724187", "0.5707712", "0.56715965", "0.56414914", "0.5636944", "0.5609728", "0.5585581", "0.5577436", "0.55461156", "0.5535445", "0.55296534", "0.55219793", "0.552193", "0.5519928", "0.55169165" ]
0.6790548
0